Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Convert from UTC to account for different time zones
function convertFromUTC(utcdate) { localdate = new Date(utcdate); return localdate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIsoString = dateAdd(localTime, \"minute\", localTime.getTimezoneOffset() * -1).toISOString();\r\n }\r\n return this.clone(TimeZone_1, `localtimetoutc('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"LocalTimeToUTC\") ? res.LocalTimeToUTC : res);\r\n }", "utcToLocalTime(utcTime) {\r\n let dateIsoString;\r\n if (typeof utcTime === \"string\") {\r\n dateIsoString = utcTime;\r\n }\r\n else {\r\n dateIsoString = utcTime.toISOString();\r\n }\r\n return this.clone(TimeZone_1, `utctolocaltime('${dateIsoString}')`)\r\n .postCore()\r\n .then(res => hOP(res, \"UTCToLocalTime\") ? res.UTCToLocalTime : res);\r\n }", "function convertUTCtoOttawa(date) {\n \n var d = new Date();\n if (d.getHours() === d.getUTCHours()) {\n d.setUTCHours(d.getUTCHours() - 5);\n }\n\n return d;\n}", "function convertUTC2Local(dateformat) {\r\n\tif (!dateformat) {dateformat = 'globalstandard'}\r\n\tvar $spn = jQuery(\"span.datetime-utc2local\").add(\"span.date-utc2local\");\r\n\t\r\n\t$spn.map(function(){\r\n\t\tif (!$(this).data(\"converted_local_time\")) {\r\n\t\t\tvar date_obj = new Date(jQuery(this).text());\r\n\t\t\tif (!isNaN(date_obj.getDate())) {\r\n\t\t\t\tif (dateformat = 'globalstandard') {\r\n\t\t\t\t\t//console.log('globalstandard (' + dateformat + ')');\r\n\t\t\t\t\tvar d = date_obj.getDate() + ' ' + jsMonthAbbr[date_obj.getMonth()] + ' ' + date_obj.getFullYear();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//console.log('other (' + dateformat + ')');\r\n\t\t\t\t\tvar d = (date_obj.getMonth()+1) + \"/\" + date_obj.getDate() + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\tif (dateformat == \"DD/MM/YYYY\") {\r\n\t\t\t\t\t\td = date_obj.getDate() + \"/\" + (date_obj.getMonth()+1) + \"/\" + date_obj.getFullYear();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif ($(this).hasClass(\"datetime-utc2local\")) {\r\n\t\t\t\t\tvar h = date_obj.getHours() % 12;\r\n\t\t\t\t\tif (h==0) {h = 12;}\r\n\t\t\t\t\tvar m = \"0\" + date_obj.getMinutes();\r\n\t\t\t\t\tm = m.substring(m.length - 2,m.length+1)\r\n\t\t\t\t\tvar t = h + \":\" + m;\r\n\t\t\t\t\tif (date_obj.getHours() >= 12) {t = t + \" PM\";} else {t = t + \" AM\";}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).text(d + \" \" + t);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this).text(d);\r\n\t\t\t\t}\r\n\t\t\t\t$(this).data(\"converted_local_time\",true);\r\n\t\t\t} else {console.log(\"isNaN returned true on \" + date_obj.getDate())}\r\n\t\t} else {console.log($(this).data(\"converted_local_time\"));}\r\n\t});\r\n}", "function transformUTCToTZ() {\n $(\".funnel-table-time\").each(function (i, cell) {\n var dateTimeFormat = \"MM:DD HH:mm\";\n transformUTCToTZTime(cell, dateTimeFormat);\n });\n }", "function toMarketTime(date,tz){\n\t\t\t\tvar utcTime=new Date(date.getTime() + date.getTimezoneOffset() * 60000);\n\t\t\t\tif(tz && tz.indexOf(\"UTC\")!=-1) return utcTime;\n\t\t\t\telse return STX.convertTimeZone(utcTime,\"UTC\",tz);\n\t\t\t}", "utcToNumbers() {\n this.events.forEach((event) => {\n let summary = event.summary\n\n let startDate = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .date()\n let endDate = moment.tz(event.end.dateTime, event.endTimeZone).date()\n let startHour = moment\n .tz(event.start.dateTime, event.startTimeZone)\n .hours()\n let endHour = moment.tz(event.end.dateTime, event.endTimeZone).hours()\n\n\n this.eventSet.add([summary, startDate, endDate, startHour, endHour])\n })\n }", "function parse_utc(value)\n{\n var value_int = parse_int(value);\n \n if ((value_int > 3600) || (value_int < -3600))\n {\n console.error(\"timezone out of range\");\n return NaN;\n } \n return value_int;\n}", "function convertDateToUTC(day, month, year){\n return year + \"-\" + month + \"-\" + day + \"T00:00:00\";\n }", "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n } // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function convertUTCDateToLocalDate(date) {\r\n if (IsNotNullorEmpty(date)) {\r\n var d = new Date(date);\r\n //var d = new Date(date.replace(/-/g, \"/\"))\r\n d = d - (d.getTimezoneOffset() * 60000);\r\n d = new Date(d);\r\n return d;\r\n }\r\n return null;\r\n //return d.toISOString().substr(0, 19) + \"Z\";\r\n}", "function setDepartureDatesToNoonUTC(criteria){\n let segments = _.get(criteria,'itinerary.segments',[])\n _.each(segments, (segment,id)=>{\n\n let d=segment.departureTime.substr(0,10).split(\"-\");\n let utc = new Date(Date.UTC(d[0],d[1]-1,d[2]))\n utc.setUTCHours(12);\n logger.debug(`Departure date from UI:${segment.departureTime}, UTC date which will be used for search:${utc}`)\n segment.departureTime=utc;\n });\n}", "function convertLocalDateToUTCDate(date, toUTC) {\n date = new Date(date);\n //Hora local convertida para UTC \n var localOffset = date.getTimezoneOffset() * 60000;\n var localTime = date.getTime();\n if (toUTC) {\n date = localTime + localOffset;\n } else {\n date = localTime - localOffset;\n }\n date = new Date(date);\n\n return date;\n }", "parse(value) {\n return +moment.utc(value);\n }", "function sanitizeDate (date) {\n var utc = moment.tz(date['utc'], 'America/Guayaquil');\n return {\n utc: date['utc'],\n local: utc.format()\n };\n}", "function getTimeZoneCode(houtUTC) {\n\tlet rs = [];\n\tif (houtUTC >= 0 && houtUTC <= 11)\n\t\trs.push(-1 * ((houtUTC) % 12));//from 0 to 12\n\tif (houtUTC >= 10)\n\t\trs.push(((24 - houtUTC) % 24));//from 10 to 23\n\treturn rs;\n}", "function dateObjtoUT(dateTime) {\n var setUT = ((dateTime.getTime() - foundingMoment) / 1000);\n if (dateTime.toString().includes(\"Standard\")) setUT += 3600;\n return setUT;\n}", "function makeAs(input, model) {\n\t return model._isUTC ? moment(input).zone(model._offset || 0) :\n\t moment(input).local();\n\t }", "function treatAsUTC(date) {\n var result = new Date(date);\n result.setMinutes(result.getMinutes() - result.getTimezoneOffset());\n return result;\n }", "function changeTimeZone() {\n analyticsEvent('changed');\n setKnownBrowserOffset().done(function () {\n exports.navigate(nav.newBuilder('account').build());\n });\n }", "function utcToLocal (utcDt, format = 'YYYY-M-D HH:mm:ss') {\n return moment.utc(utcDt).local().format(format)\n}", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "function convertToUTCTimezone(date) {\n\t// Doesn't account for leap seconds but I guess that's ok\n\t// given that javascript's own `Date()` does not either.\n\t// https://www.timeanddate.com/time/leap-seconds-background.html\n\t//\n\t// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset\n\t//\n\treturn new Date(date.getTime() - date.getTimezoneOffset() * 60 * 1000)\n}", "get BROWSER_TO_UTC(): number\n\t{\n\t\treturn cache.remember('BROWSER_TO_UTC', () => {\n\t\t\treturn Text.toInteger((new Date()).getTimezoneOffset() * 60);\n\t\t});\n\t}", "toAppTimezone(value) {\n return value\n ? dayjs\n .tz(value, this.userTimezone)\n .clone()\n .tz(this.appConfig.timezone)\n .format('YYYY-MM-DD HH:mm:ss')\n : value\n }", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}", "function toUTCtime(dateStr) {\n //Date(1381243615503+0530),1381243615503,(1381243615503+0800)\n \n dateStr += \"\";\n var utcPrefix = 0;\n var offset = 0;\n var dateFormatString = \"yyyy-MM-dd hh:mm:ss\";\n var utcTimeString = \"\";\n var totalMiliseconds = 0;\n\n var regMatchNums = /\\d+/gi;\n var regSign = /[\\+|\\-]/gi;\n var arrNums = dateStr.match(regMatchNums);\n utcPrefix = parseInt(arrNums[0]);\n if (arrNums.length > 1) {\n offset = arrNums[1];\n offsetHour = offset.substring(0, 2);\n offsetMin = offset.substring(2, 4);\n offset = parseInt(offsetHour) * 60 * 60 * 1000 + parseInt(offsetMin) * 60 * 1000;\n }\n if(dateStr.lastIndexOf(\"+\")>-1){\n totalMiliseconds= utcPrefix - offset;\n } else if (dateStr.lastIndexOf(\"-\") > -1) {\n totalMiliseconds = utcPrefix + offset;\n }\n\n utcTimeString = new Date(totalMiliseconds).format(dateFormatString);\n return utcTimeString;\n}", "function newCityTz() {\n var value = document.getElementById('tz').innerHTML;\n var time = moment()\n var newCity = time.clone().tz(value);\n var converted = newCity.format('MMMM Do YYYY, h:mm:ss a');\n document.getElementById('converted').innerHTML = \"Converted time: \" + converted;\n}", "function momentify(source) {\r\n return moment.utc(source);\r\n}", "function getTimeZone() {\n var tz = 'UTC'; // Default value\n var ddmenu = document.getElementById('timeZoneSelect');\n var timeZoneTxt = ddmenu.options[ddmenu.selectedIndex].text;\n\n for ( var i in forecast.timeZoneList) {\n if ( timeZoneTxt === forecast.timeZoneList[i][1] ) {\n if (Math.abs(forecast.timeZoneList[i][0]) % 1 !== 0 ) {\n tz = [i, Math.ceil( forecast.timeZoneList[i][0] ), -30]; // UTC-2.5 hrs instead of -3, and UTC-3.5hrs instead of -4\n }\n else {\n tz = [i, forecast.timeZoneList[i][0], 0];\n }\n localStorage.setItem('timeZone', i);\n break;\n }\n else {\n tz = ['UTC', 0, 0];\n }\n }\n return tz;\n}", "function makeUtcWrapper(d) {\n\n function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n sourceObj[sourceMethod] = function() {\n return targetObj[targetMethod].apply(targetObj, arguments);\n };\n };\n\n var utc = {\n date: d\n };\n\n // support strftime, if found\n\n if (d.strftime != undefined) {\n addProxyMethod(utc, \"strftime\", d, \"strftime\");\n }\n\n addProxyMethod(utc, \"getTime\", d, \"getTime\");\n addProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n var props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n for (var p = 0; p < props.length; p++) {\n addProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n addProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n }\n\n return utc;\n }", "function TS_GR_TO_AK(obj) {\n return moment(obj).utc().format(\"YYYYMMDDTHHmmss.SSSSSSSSS\");\n}", "function getTrueDate(utc){\n var date = new Date(utc);\n return date.toString();\n}", "function DateUTC () {\n\ttime = new Date();\n\tvar offset = time.getTimezoneOffset() / 60;\n\ttime.setHours(time.getHours() + offset);\n\treturn time\n}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function calcTime(timezone) {\r\n\tconst d = new Date(),\r\n\t\t\t\tutc = d.getTime() + (d.getTimezoneOffset() * 60000),\r\n\t\t\t\tnd = new Date(utc + (3600000 * timezone.offset));\r\n\r\n\treturn nd.toLocaleString();\r\n}", "function makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function () {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t}", "function getUTCOffset(date = new Date()) {\n var hours = Math.floor(date.getTimezoneOffset() / 60);\n var out;\n\n // Note: getTimezoneOffset returns the time that needs to be added to reach UTC\n // IE it's the inverse of the offset we're trying to divide out.\n // That's why the signs here are apparently flipped.\n if (hours > 0) {\n out = \"UTC-\";\n } else if (hours < 0) {\n out = \"UTC+\";\n } else {\n return \"UTC\";\n }\n\n out += hours.toString() + \":\";\n\n var minutes = (date.getTimezoneOffset() % 60).toString();\n if (minutes.length == 1) minutes = \"0\" + minutes;\n\n out += minutes;\n return out;\n}", "function time() {\n return dateFormat(\"isoUtcDateTime\");\n}", "function jsMoment(utcTime, tz, format) {\n var tz = (typeof tz === 'undefined') ? 'pac' : tz;\n var format = (typeof format === 'undefined') ? null : format;\n\n if (tz == 'utc') {\n if (format == 'normal') format = 'MM/DD/YYYY HH:mm:ss';\n return moment(utcTime).utc().format(format);\n } else {\n if (format == 'normal') format = 'MM/DD/YYYY HH:mm:ss Z (ddd)';\n return moment(utcTime).tz(\"America/Los_Angeles\").format(format);\n }\n}", "fromAppTimezone(value) {\n if (!value) {\n return value\n }\n\n return dayjs\n .tz(value, this.appConfig.timezone)\n .clone()\n .tz(this.userTimezone)\n .format('YYYY-MM-DD HH:mm:ss')\n }", "function timeZoneCheck() {\n var timeZoneLog = document.querySelector(\".timezone\");\n var timeZone = response.timezone;\n console.log(timeZone);\n\n timeZoneLog.innerHTML += timeZone;\n }", "function dateToUTC(d) {\n var arr = [];\n [\n d.getUTCFullYear(), (d.getUTCMonth() + 1), d.getUTCDate(),\n d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()\n ].forEach(function(n) {\n arr.push((n >= 10) ? n : '0' + n);\n });\n return arr.splice(0, 3).join('-') + ' ' + arr.join(':');\n }", "function timezones_guess(){\n\n\tvar so = -1 * new Date(Date.UTC(2012, 6, 30, 0, 0, 0, 0)).getTimezoneOffset();\n\tvar wo = -1 * new Date(Date.UTC(2012, 12, 30, 0, 0, 0, 0)).getTimezoneOffset();\n\tvar key = so + ':' + wo;\n\n\treturn _timezones_map[key] ? _timezones_map[key] : 'US/Pacific';\n}", "function convertChartDateToLocalDate(chartDate) {\n var m = moment.utc(chartDate);\n var offsetMinutes = m.toDate().getTimezoneOffset();\n m.add(offsetMinutes, 'minutes');\n return m.toDate();\n }", "function utcDate(date) {\n\tdate.setMinutes(date.getMinutes() - date.getTimezoneOffset());\n\treturn date;\n}", "static asDate(inputValue, userTimeZone) {\n if (userTimeZone && userTimeZone.length > 0) {\n return moment.utc(inputValue).tz(userTimeZone).format('MM/DD/YYYY');\n }\n return moment.utc(inputValue).tz(Intl.DateTimeFormat().resolvedOptions().timeZone).format('MM/DD/YYYY');\n }", "toUTCString() {\n return this.timestamp().toUTCString();\n }", "function setTimeZoneOffset(tz) {\n if (angular.isString(tz.offset)) {\n if (!angular.isDefined(vm.fromDate)) vm.fromDate = {};\n vm.fromDate.timezone = tz.offset;\n if (!angular.isDefined(vm.toDate)) vm.toDate = {};\n vm.toDate.timezone = tz.offset;\n }\n }", "function toUtcTimeString(source) {\r\n if (!source) {\r\n return source;\r\n }\r\n const wrapped = moment.utc(source);\r\n return (wrapped.isValid() ? wrapped.format() : source);\r\n}", "function UtcToIst(data) {\r\n var dt = new Date(data);\r\n return dt;\r\n}", "function formatServerDateTimeTZ(t){\r\n\t/*\r\n\t// TODO Server time zone offset should be in server response along with tzName and ID (like America/New_York).\r\n\tvar tzOffset = 5 * 60 * 60 * 1000;\r\n\tvar tzName = responseObj.server_time.substr(-3);\r\n\tvar d = new Date(asDate(t).getTime() - tzOffset);\r\n\treturn d.format(Date.formats.default, true) + ' ' + tzName;\r\n\t*/\r\n\treturn responseObj.server_time;\r\n}", "function ConvertUTCtoGPSTime() {\r\n\t\tvar day = $('#UTCDay').val();\r\n\t\tvar month = $('#UTCMonth').val();\r\n\t\tvar year = $('#UTCYear').val();\r\n\t\tvar hour = $('#UTCHour').val();\r\n\t\tvar minute = $('#UTCMinute').val();\r\n\t\tvar second = $('#UTCSecond').val();\r\n\t\tvar Leap = $('#LeapSecond').val();\r\n\t\tvar GPSTime = $('#gpsTime').val();\r\n\t\t\r\n\t\tif(GPSTime.length > 0){\r\n\t\t\t\r\n\t\t\treturn GPSTime;\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\tvar D = new Date(Date.UTC(year, (month -1), day, hour, minute, second));\r\n\t\tvar UNIX = (D.getTime() / 1000);\r\n\t\tvar GPSTime = UNIX - 315964800 + +Leap;\r\n\t\treturn GPSTime;\r\n\t}\r\n\t\r\n}", "function dateUTC(date) {\n\treturn new Date(date.getTime() + date.getTimezoneOffset() * 60 * 1000);\n}", "function setTimeZoneInOptions(opts, timeZone) {\n return Object.keys(opts).reduce((all, k) => {\n all[k] = Object.assign({ timeZone }, opts[k]);\n return all;\n }, {});\n}", "function worldClock(zone, region){\r\nvar dst = 0\r\nvar time = new Date()\r\nvar gmtMS = time.getTime() + (time.getTimezoneOffset() * 60000)\r\nvar gmtTime = new Date(gmtMS)\r\n\r\nvar hr = gmtTime.getHours() + zone\r\nvar min = gmtTime.getMinutes()\r\n\r\nif (hr >= 24){\r\nhr = hr-24\r\nday -= -1\r\n}\r\nif (hr < 0){\r\nhr -= -24\r\nday -= 1\r\n}\r\nif (hr < 10){\r\nhr = \" \" + hr\r\n}\r\nif (min < 10){\r\nmin = \"0\" + min\r\n}\r\n\r\n\r\n//america\r\nif (region == \"NAmerica\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(2)\r\n\tendDST.setHours(1)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\n//europe\r\nif (region == \"Europe\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(1)\r\n\tendDST.setHours(0)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\nif (dst == 1){\r\n\thr -= -1\r\n\tif (hr >= 24){\r\n\thr = hr-24\r\n\tday -= -1\r\n\t}\r\n\tif (hr < 10){\r\n\thr = \" \" + hr\r\n\t}\r\nreturn hr + \":\" + min + \" DST\"\r\n}\r\nelse{\r\nreturn hr + \":\" + min\r\n}\r\n}", "function back_to_now()\n{\n var nowdate = new Date();\n var utc_day = nowdate.getUTCDate();\n var utc_month = nowdate.getUTCMonth() + 1;\n var utc_year = nowdate.getUTCFullYear();\n zone_comp = nowdate.getTimezoneOffset() / 1440;\n var utc_hours = nowdate.getUTCHours();\n var utc_mins = nowdate.getUTCMinutes();\n var utc_secs = nowdate.getUTCSeconds();\n utc_mins += utc_secs / 60.0;\n utc_mins = Math.floor((utc_mins + 0.5));\n if (utc_mins < 10) utc_mins = \"0\" + utc_mins;\n if (utc_mins > 59) utc_mins = 59;\n if (utc_hours < 10) utc_hours = \"0\" + utc_hours;\n if (utc_month < 10) utc_month = \"0\" + utc_month;\n if (utc_day < 10) utc_day = \"0\" + utc_day;\n\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n\n /*\n if (UTdate == \"now\")\n {\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n }\n else\n {\n document.planets.date_txt.value = UTdate;\n }\n if (UTtime == \"now\")\n {\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n }\n else\n {\n document.planets.ut_h_m.value = UTtime;\n }\n */\n planets();\n}", "function getpass_at(e) {\n const minuteRelativeTime = /(\\d+)\\s*分钟前/;\n const hourRelativeTime = /(\\d+)\\s*小时前/;\n const yesterdayRelativeTime = /昨天\\s*(\\d+):(\\d+)/;\n const shortDate = /(\\d+)-(\\d+)\\s*(\\d+):(\\d+)/;\n\n // offset to ADD for transforming China time to UTC\n const chinaToUtcOffset = -8 * 3600 * 1000;\n // offset to ADD for transforming local time to UTC\n const localToUtcOffset = new Date().getTimezoneOffset() * 60 * 1000;\n // offset to ADD for transforming local time to china time\n const localToChinaOffset = localToUtcOffset - chinaToUtcOffset;\n\n let time;\n if (e === '刚刚') {\n time = new Date();\n } else if (minuteRelativeTime.test(e)) {\n const rel = minuteRelativeTime.exec(e);\n time = new Date(Date.now() - parseInt(rel[1]) * 60 * 1000);\n } else if (hourRelativeTime.test(e)) {\n const rel = hourRelativeTime.exec(e);\n time = new Date(Date.now() - parseInt(rel[1]) * 60 * 60 * 1000);\n } else if (yesterdayRelativeTime.test(e)) {\n const rel = yesterdayRelativeTime.exec(e);\n // this time is China time data in local timezone\n time = new Date(Date.now() - 86400 * 1000 + localToChinaOffset);\n time.setHours(parseInt(rel[1]), parseInt(rel[2]), 0, 0);\n // transform back to china timezone\n time = new Date(time.getTime() - localToChinaOffset);\n } else if (shortDate.test(e)) {\n const rel = shortDate.exec(e);\n const now = new Date(Date.now() + localToChinaOffset);\n const year = now.getFullYear();\n // this time is China time data in local timezone\n time = new Date(year, parseInt(rel[1]) - 1, parseInt(rel[2]), parseInt(rel[3]), parseInt(rel[4]));\n // transform back to china timezone\n time = new Date(time.getTime() - localToChinaOffset);\n } else {\n time = new Date(e);\n }\n return time;\n }", "function set_sonix_date()\n{\n var d = new Date();\n var dsec = get_utc_sec();\n var tz_offset = -d.getTimezoneOffset() * 60;\n d = (dsec+0.5).toFixed(0);\n var cmd = \"set_time_utc(\" + d + \",\" + tz_offset + \")\";\n command_send(cmd);\n}", "function adjustTimezone(myDate, myTimezone) {\n var offset = isNaN(myTimezone) ? new Date().getTimezoneOffset() : parseFloat(myTimezone) * 60;\n\n //TPV: use zone 0\n offset = 0;\n\n return new Date(myDate.getTime() + offset * 60 * 1000);\n }", "function parseUtcDate(inputDateString, useUtc) {\n let date = null;\n if (/^[0-9\\-\\/]*$/.test(inputDateString)) {\n // get the UTC datetime with moment.js but we need to decode the value so that it's valid text\n const dateString = decodeURIComponent(inputDateString);\n const dateMoment = moment(new Date(dateString));\n if (dateMoment.isValid() && dateMoment.year().toString().length === 4) {\n date = (useUtc) ? dateMoment.utc().format() : dateMoment.format();\n }\n }\n return date;\n}", "function irdGetUTC()\n{\n\tvar nDat = Math.floor(new Date().getTime()/1000); \n\treturn nDat;\n}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\n return c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "get supportsTimezone() { return false; }", "function setTimeZone() {\n localStorage.setItem('timeZone', timeZone.value);\n}", "static toTargetTimezone(time) {\n return new Date(time + TARGET_TIMEZONE_OFFSET * 60 * 60 * 1000);\n }", "function checkLocalStorage() {\n if ( typeof(Storage) !== \"undefined\") {\n if (localStorage.timeZone) {\n // console.log(localStorage.timeZone);\n return localStorage.timeZone;\n }\n }\n else { //return default of UTC\n return \"UTC\";\n }\n}" ]
[ "0.6623361", "0.6553579", "0.636182", "0.6087981", "0.59756655", "0.59392315", "0.5935672", "0.5884768", "0.5870722", "0.58174556", "0.57627285", "0.57627285", "0.57627285", "0.57627285", "0.57627285", "0.57584906", "0.5757649", "0.5757649", "0.5734492", "0.57145", "0.5706694", "0.5694956", "0.56934816", "0.56522554", "0.5651056", "0.5627845", "0.56120074", "0.5596474", "0.55649364", "0.5534942", "0.5534942", "0.5534942", "0.5534942", "0.5534942", "0.5534942", "0.5534942", "0.5534942", "0.5534942", "0.5534942", "0.5534942", "0.5534942", "0.5534942", "0.5534942", "0.5534942", "0.5534942", "0.5534942", "0.5534521", "0.55329937", "0.55201524", "0.5456321", "0.5443263", "0.54421943", "0.5423142", "0.53589666", "0.5357698", "0.53362644", "0.53274804", "0.53269714", "0.5265612", "0.5265612", "0.5265612", "0.5265612", "0.5265612", "0.5265612", "0.5265612", "0.5265612", "0.5265612", "0.5265612", "0.526242", "0.5255033", "0.52415437", "0.5238389", "0.5234282", "0.5215857", "0.52037436", "0.5203328", "0.5180468", "0.51714045", "0.5162234", "0.5152919", "0.5144603", "0.51375705", "0.51252335", "0.51011086", "0.5098901", "0.5090375", "0.5086626", "0.5066061", "0.50652885", "0.5045461", "0.5042685", "0.5041201", "0.50390464", "0.5029101", "0.50179076", "0.5014449", "0.5011931", "0.5009152", "0.5005664", "0.50034964" ]
0.6342179
3
now we will be using new keywords ASYNC and AWAIT await is to tells us that a function is returning a promise wait until its done i.e..,resolved create a fetchtodo
function getTodo(){ return new Promise((resolve,reject)=>{ let error = false; if(!error){ resolve({text:"you should work on this"}) } else{ reject() } },1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function asynFunc() {\r\n await createPost(\"title#3\", \"body#3\");\r\n getPosts();\r\n}", "async function getDetailsAsync(){\n const details = await getDetails(\"Here is your details from ASYNC AWAIT\");\n\n console.log(details);\n}", "async function asyncWrapperFunction() {\r\n await htmlRouting();\r\n await videoRouting();\r\n const data = await dataProcessing();\r\n const nodes = await nodesGetting();\r\n dynamic(data,nodes);\r\n display(data,nodes);\r\n}", "async function fetchtodos(){\r\n\r\n const response= await fetch('https://jsonplaceholder.typicode.com/todos');\r\n //const data = await response;\r\n const data = await response.json();\r\n console.log(data);\r\n}", "async function fetchtodos(){\r\n const response = await fetch('https://jsonplaceholder.typicode.com/todos');\r\n const data = await response.json();\r\n\r\n console.log(data);\r\n}", "async function fn(){ //This is the newer way of doing an async function\n return 'hello';\n}", "async function awaitFetchData() {\n let returnedData = await fetchData();\n console.log(returnedData);\n}", "async function getRecipeAW() { // the function always return a Promises\n //the await will stop executing the code at this point until the Promises is full filled\n // the await can be used in only async function\n const id = await getID;\n console.log(id)\n console.log('here 2');\n const recipe = await getRecipe(id[1]);\n console.log(recipe);\n const related = await getRelated('Publisher');\n console.log(related);\n\n return recipe;\n}", "function demoOfAsyncAwait(){\n\tfunction mockRequest(second){\n\t const args = [...arguments];\n\t [second,...params] = args;\n\t return new Promise((resolve,reject)=>{\n\t setTimeout(function() {resolve(params)},second*1000);\n\t })\n\t};\n\t //继发,依次执行\n\t async function jifa(){\n\t const a= await mockRequest(1,1,2);\n\t const b= await mockRequest(1,1,2);\n\t const c= await mockRequest(1,1,2);\n\t return [...a,...b,...c];\n\t};\n\t //jifa().then(a=>console.log(a));\n\t \n\t //并发,同时执行\n\t async function wrong_bingfa(){\n\t return Promise.all([await mockRequest(3,1,2),\n\t await mockRequest(3,1,2),\n\t await mockRequest(3,1,2)])\n\t .then(([a,b,c])=>[...a,...b,...c]);\n\t }\n\t //wrong_bingfa()依然是继发执行\n\t async function bingfa(){\n\t const [a,b,c]= await Promise.all([mockRequest(3,10,2),\n\t mockRequest(3,10,2),\n\t mockRequest(3,10,2)]);\n\t return [...a,...b,...c];\n\t\t }\n\t//bingfa().then(a=>console.log(a));\n\t \n\t async function bingfa2(){\n\t const arr=[[4,11,2],[4,11,2],[4,11,2]].map(async item=>{\n\t return await mockRequest(...item);\n\t });\n\t //!!!!!!!! items of 'arr' are Promise instances, not Array instances.\n\t const res=[];\n\t for(const p of arr){\n\t res.push(await p);\n\t }\n\t [a,b,c]=res;\n\t return [...a,...b,...c];\n\t }\n\t/*上面代码中,虽然map方法的参数是async函数,但它是并发执行的,\n\t因为只有async函数内部是继发执行,外部不受影响。\n\t后面的for..of循环内部使用了await,因此实现了按顺序输出。\n*/\n\tbingfa2().then(a=>console.log(a));\n}", "async function myfunc() {\n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve(\"okk\"), 2000);\n });\n\n const result = await promise;\n // await makes it wait till the promise resolves and after the promise is resolved\n // after that it assigns the data returned from the promise to result\n return result;\n}", "async function asyncFn(){\n\n return 1;\n}", "async function fetchAsync(func) { // eslint-disable-line no-unused-vars\r\n const response = await func();\r\n return response;\r\n}", "async fetchAsync() {\n // await response of fetch call\n let response = await fetch(this.restApiUrl + this.params);\n // only proceed once promise is resolved\n return await response.json();\n }", "async function getData (url){ //aca getData nos esta devolviendo una promesa porque hace await \n const response = await fetch(url);\n const data = await response.json()\n return data;\n}", "async function miFuncionConPromesa ()\r\n{\r\n return 'saludos con promesa y async';\r\n}", "async function MyAsyncFn () {}", "async function fetchAsyncWait() {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(\n `AsyncWait Alert: HTTP error! status: ${response.status}`\n );\n }\n const tasks = await response.json();\n return tasks;\n }", "async function getRecipesAW(){\n\t\t//waits till the promise is fulfilled and then stores the resolved value in the variable ie. Ids ,recipe ,related here\n\t\tconst Ids = await getIds; \n\t\tconsole.log(Ids);\n\t\tconst recipe=await getRecipe(Ids[2]);\n\t\tconsole.log(recipe);\n\t\tconst related = await getRelated('Jonas');\n\t\tconsole.log(related);\n\t\t\n\t\treturn recipe; //async function also returns a promise always!\n\t}", "async function getData() {\n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve('done'), 3000);\n });\n\n //Add await\n let result = await promise;\n console.log(result);\n}", "async function doWork() {\n const response = await makeRequest('osu');\n console.log('response received')\n const finalResponse = await addSomething(response);\n console.log(finalResponse);\n\n}", "async doSomethingAsync() {\n // Note the use of const\n const result = await Promise.resolve(42);\n }", "async function fetchUser() {\n return \"abc\";\n}", "async function myFn() {\n // wait\n}", "async function asyncFuncExample(){\n let resolvedValue = await myPromise();\n console.log(resolvedValue);\n }", "async function funcionAsincronaDeclarada (){\r\n try {\r\n console.log(`Inicio de Async function`)\r\n let obj = await cuadradoPromise(0);\r\n console.log(`Async function: ${obj.value}, ${obj.result}`)\r\n \r\n obj = await cuadradoPromise(1);\r\n console.log(`Async function: ${obj.value}, ${obj.result}`)\r\n\r\n obj = await cuadradoPromise(2);\r\n console.log(`Async function: ${obj.value}, ${obj.result}`)\r\n\r\n obj = await cuadradoPromise(3);\r\n console.log(`Async function: ${obj.value}, ${obj.result}`)\r\n\r\n obj = await cuadradoPromise(4);\r\n console.log(`Async function: ${obj.value}, ${obj.result}`)\r\n } catch (err) {\r\n console.error(err)\r\n }\r\n}", "async method(){}", "async function random_code(){\r\n\r\nconst response= fetch('https://jsonplaceholder.typicode.com/todos'\r\n);\r\n\r\nconst data= await (await response).json();\r\nconsole.log(data);\r\n// .then(response => response.json())\r\n// .then(data =>console.log(data))\r\n\r\n}", "async function myFunc() {\n // Function body here\n }", "async function makerequest() {\r\n \r\n}", "async function fetchUser() {\r\n // do network request in 10 secs....\r\n return 'ellie';\r\n}", "async function myPromise (){\n return \"This is my promise\"\n}", "async function miFuncionConPromesa(){\n return \"Saludos con promeso y async\";\n}", "async function asyncFunction(arg) {\r\n return arg;\r\n}", "async function asyncCall() {\n try {\n const result = await getListActivity();\n console.log(result);\n return result;\n // the next line will fail\n //const result2 = await apiFunctionWrapper(\"bad query\");\n //console.log(result2);\n } catch(error) {\n console.error(\"ERROR:\" + error);\n }\n }", "async function getTodoData() {\n try {\n let res = await fetch(apiUrl)\n let resJSON = await res.json();\n return resJSON\n }\n catch (error) {\n console.log(error)\n return error\n }\n}", "async fetchAndInform() {\n this.todos = await this.fetchTodos()\n this.inform()\n }", "async function fetchUser() {\n // do network reqeust in 10 secs....\n return 'ellie';\n}", "async function executeHardAsync() {\n const r1 = await fetchUrlData(apis[0]);\n const r2 = await fetchUrlData(apis[1]);\n}", "async function AppelApi(parfunc=api_tan.GenericAsync(api_tan.getTanStations(47.2133057,-1.5604042)),\nretour=function(par){console.log(\"demo :\" + JSON.stringify(par))}) {\n let demo = await parfunc \n retour(demo);\n // console.log(\"demo : \" + JSON.stringify(demo));\n}", "async function myFunc() {\n const promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve('Hello'), 1000);\n });\n\n const res = await promise; // Wait until the promise is resolved\n\n return res;\n}", "async function fetchAsyncSave(func, data) { // eslint-disable-line no-unused-vars\r\n const response = await func(data);\r\n return response;\r\n}", "async function WrapperForAsyncFunc() {\n const result = await AsyncFunction();\n console.log(result);\n}", "async function myAsync(){\n let myVar = await fetch(\"https://swapi.dev/api/starships/9/\");\n myVar = await myVar.json();\n return myVar\n}", "async function asyncPromiseAll() {\n //PLACE YOUR CODE HERE:\n}", "async function myFunc() {\n return 'Hello';\n}", "async function doWork(){\r\n // all the code that could fail goes here.\r\n try {\r\n // await: the 'doWork' function will wait until the 'makeRequest' function has returned before moving forward. if 'await' is not used, it will\r\n // return the promise and not the result of the promise.\r\n // this will only return the resolve section of the promise\r\n const response = await makeRequest('Google')\r\n console.log('Response Recieved')\r\n const processedResponse = await processRequest(response)\r\n console.log(processedResponse)\r\n // catch takes a single parameter 'err' which is collected from the reject statement in the promise.\r\n } catch (err) {\r\n console.log(err)\r\n }\r\n}", "async function fetchUser() {\n // do network request in 10secs. \n resolve('sani');\n}", "async function asyncAwait(){\n \n const promise= await fetch(url); \n\n const jsonPromise=await promise.json();\n\n\n setTimeout(( ) => {\n\n console.log(jsonPromise.status) \n\n }, 3000);\n\n}", "async function test() {}", "async function funcionConPromesaYAwait(){\n let miPromesa = new Promise((resolved) => {\n resolved(\"Promesa con await\"); \n });\n\n //Ya no es necesario utilizar .then() sino que con await va a recibir el valor\n // y se va a mostrar en consola \n console.log( await miPromesa );\n}", "static async method(){}", "async function helloAgain() {\n return await Promise.resolve(\"Oh Hello\");\n}", "async function asyncCall() {\n result = await resolveAfter2Seconds();\n result.forEach((indItem) =>\n printItem(\n indItem.title,\n indItem.tkt,\n indItem.desc,\n indItem.urg,\n indItem.store,\n indItem.owner,\n indItem.date\n )\n );\n }", "async function fetchUsers() {\n //The code below returns a promise \nconst res = await fetch ('http://jsonplaceholder.typicode.com/users')\n\nconst data = await res.json()\n//Transforming the res. to json format \nconsole.log(data)\n\n}", "async function helloWorld(){\n console.log(\"Were going to say something, but you have to wait 1.5 seconds\")\n await wait(1500);\n return(\n console.log(\"Hello world!\"),\n console.log(\"Congrats on waiting for the promise to fulfill, that took 1.5 seconds\")\n );\n }", "async function f(){\n return something\n}", "async function noAwait() {\n let value = myPromise();\n console.log(value);\n}", "async function init(){\n await createPostPromise({title:'post six',body:'this is post six'})\n .then(getPosts)\n .catch(err=>console.log(err))\n}", "async function doWork() {\n // use try catch to handle any errors with the promise\n try {\n // await says that the code should wait for this code to finish before executing the next thing\n const response = await makeRequest('Google')\n console.log('Response received')\n const processedResponse = await makeRequest(response)\n console.log(processedResponse)\n // catch will be used if promise rejects instead of resolves\n } catch(err) {\n console.log(err)\n }\n}", "function __awaiter(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())}))}", "async function ABC() {\n \n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve('Done'), 1000)\n });\n\n let result = await promise;\n\n alert(result);\n}", "async function cool() {\n let promise = new Promise(function(resolve, reject) {\n setTimeout(() => resolve('All done!'), 1000);\n });\n\n let result = await promise;\n return result;\n}", "async function fetchUser() {\n // do network request in 10 secs..\n return 'yuna';\n}", "async function ej3() {\n var res = await prom();\n console.log(res);\n}", "async function miAsyncFunction()\n{\n try \n { //Esto de acá sería como el then de la async function miAsyncFunction() \n const promesa = await miPromesa; //espera el resultado de la promesa satisfecha (resolved)\n console.log(`Este es el valor de la promesa ${promesa}`);\n } //Esto de acá sería como el catch de la async function miAsyncFunction() \n catch (error) {\n console.log(\"La pecheaste\"); \n }\n}", "function __awaiter(n,e,t,o){return new(t||(t=Promise))((function(r,i){function a(n){try{s(o.next(n))}catch(e){i(e)}}function l(n){try{s(o.throw(n))}catch(e){i(e)}}function s(n){var e;n.done?r(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(a,l)}s((o=o.apply(n,e||[])).next())}))}", "function f() {\n let promise = Promise.resolve(1);\n let result = await promise; // SyntaxError: await is only valid in async function\n}", "async function wrapperForAsyncFunc() {\n const result1 = await AsyncFunction1();\n console.log(result1);\n const result2 = await AsyncFunction2();\n console.log(result2);\n}", "async function testLib() {\n var initC = await initContract();\n var callOne = await makeRequest(\"ShipmentDelivered\");\n var callTwo = await makeRequest(\"ShipmentDelivered\");\n console.log(initC, callOne, callTwo)\n}", "function __awaiter(n,e,t,o){return new(t||(t=Promise))((function(r,l){function a(n){try{s(o.next(n))}catch(e){l(e)}}function i(n){try{s(o.throw(n))}catch(e){l(e)}}function s(n){var e;n.done?r(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(a,i)}s((o=o.apply(n,e||[])).next())}))}", "async function dowork() {\n try {\n const response = await makeReques('Google');\n console.log('response received');\n const processingResponse = await processRequest(response);\n console.log(processingResponse);\n\n }\n catch (err) {\n console.log(err);\n }\n}", "async function doSomething() {\n // resolve is callback function\n //reject is a callback\n\n logger.log('2: function is called');\n return new Promise((resolve, reject) => {\n\n\n // read from the database.. example\n // the following timeout function is asynchronus block of code\n setTimeout(function () {\n // anonymous function that simulates reading from the database\n resolve(\"3:reading from the database\")\n\n\n // error scenarios\n // var error= new Error(\" connection failed with the database\")\n // reject(error);\n }, 3000);\n });\n\n\n\n}", "async function fetchData() {\n const response = await API.get(\"findTask/\");\n\n setTasks(response.data);\n console.log(\"👉 Returned data:\", response);\n }", "async function wait()\n{\n let answer = await isEven(42)\n console.log(answer)\n}", "function wait () { return new Promise( (resolve,reject)=>{ setTimeout(resolve,5000)} )}", "async function func() {\n return 1;\n}", "function asyncHelper () {\n\tlet f, r\n\tconst prm = new Promise((_f, _r)=>{f = _f, r = _r})\n\tfunction done(...x){\n\t\treturn x.length === 0 ? f() : r(x[0])\n\t}\n\tdone.then = prm.then.bind(prm)\n\tdone.catch = prm.catch.bind(prm)\n\tdone.finally = prm.finally.bind(prm)\n\treturn done\n}", "async function doSomething() {\n await fetch('http://localhost:5000/')\n }", "async function executar(){\n await esperarPor(2000)\n console.log('Async 1');\n\n await esperarPor(2000)\n console.log('Async 2');\n\n await esperarPor(2000)\n console.log('Async 3');\n\n}", "async function fetchDataES6AsyncAwait() {\n const url = newsurl + `&country=${userlanguage}`\n const response = await fetch(url);\n const data = await response.json()\n renderArticles(data.articles)\n}", "async function fetchData() {\n const res = await fetch('https://jsonplaceholder.typicode.com/users');\n const data = await res.json();\n console.log(data)\n\n}", "function async_io_normal(cb) {\n\n}", "async function fetchThing() {\n const a = await fetch(\"http://localhost:8080/all\", { method: \"GET\" }).then(\n (result) => {\n return result.json();\n // })\n // .then((data) => (obj = data))\n // .then(() => {\n // obj.todos.forEach((element) => console.log(element));\n // apods.push(obj.todos);\n }\n );\n function addApod(url, date) {\n apods.push([url, date]);\n }\n a.todos.forEach((element) => addApod(element.image_url, element.date));\n var al = document.getElementById(\"apod-list\");\n for (apod of apods) {\n console.log(apod);\n al.appendChild(makeAPOD(apod[0], apod[1]));\n }\n }", "async function asyncAwaitRequest() {\n const beerListFetches = createBeerListFetches()\n\n console.clear()\n console.log(\"asyncAwaitRequest()\")\n showLoading(\"Async/Await\", true)\n \n const results = await Promise.all(beerListFetches)\n const names = await Promise.all(\n results.map((result) => { \n console.log(`AsyncAwait -> Normalize`)\n return new Promise((resolve) => {\n setTimeout(() => { \n result.json().then((data) => {\n const names = data.map(beer => beer.name)\n .reduce((acc, name) => `${acc}, ${name}`)\n resolve(names)\n })\n }, 2000)\n })\n })\n )\n\n names.forEach((nameList) => console.log(`AsyncAwait Names=[${nameList}]`))\n\n console.log(`AsyncAwait$Done`)\n showLoading(\"Async/Await\", false)\n}", "function fetchAsync(callback) {\n setTimeout(() => {\n callback({ hello: \"world\" });\n }, 1000);\n }", "async function waiting() {\n const firstValue = await firstAsyncThing();\n const secondValue = await secondAsyncThing();\n console.log(firstValue, secondValue);\n }", "async function start() {\n return await Promise.resolve(\"async await\");\n}", "async function fetcher() {\n let data = {};\n try {\n data = await query()\n }\n catch (error) {\n setError(error)\n return\n }\n console.log(\"DATAAA\", data)\n setLoading(false)\n setData(data)\n setDone(true)\n }", "AsyncProcessResponse() {\n\n }", "async function main() {\n const userInfo = await getUserInfo('12');\n console.log(userInfo);\n\n const userAddress = await getUserAddress('12');\n console.log(userAddress);\n\n console.log('ceva4');\n}", "async function callClient(){\r\n console.log(\"Waiting for the project....\");\r\n let firstStep = await willGetProject();\r\n let secondStep = await showOff(firstStep);\r\n let lastStep = await willWork(secondStep);\r\n console.log(\"Completed and deployed in seatle\");\r\n}", "async function main() {\n\n const articleId = getArticleId();\n console.log(articleId);\n\tconst teddy = await getArticleContent(articleId);\n console.log(teddy);\n displayArticle(teddy);\n testOptions(teddy);\n}", "async function accountEmployee(){\n\tconsole.log(\"First function\");\n\tlet res = await fetch('http://localhost:8080/ExpenseReimbursementSystem/api/employeeAccount');\n\tlet data = await res.json();\n\t//let data1 = JSON.stringify(data);\n\tconsole.log(data);\n\tconsole.log(\"First function\");\n\tpopulateAccount(data);\n}", "async function myFn() {\n await console.log('testing');\n}", "async function getTasks() {\r\n const todos = await getData();\r\n addToDoToDom(todos);\r\n}", "async function asyncAwaitFn(str) {\n return await new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve(str)\n }, 1000);\n })\n}", "async function main() {\n // await in front of whatever is resolved from a fct and then returned into a const for instance\n const name = await myPromise;\n name;\n}", "async function fetchData()\r\n{\r\n let url='https://opentdb.com/api.php?amount=10&type=multiple';\r\n try \r\n {\r\n let res = await fetch(url);\r\n return await res.json();\r\n } \r\n catch (error) \r\n {\r\n console.log(error);\r\n }\r\n}", "function asyncFunction(work){\r\n\treturn new Promise(function(resolve,reject){\t\t//resolve for success and reject for failure\r\n\t\tif (work === \"\")\r\n\t\t\treject(Error(\"Nothing\"));\r\n\t\tsetTimeout(function(){\r\n\t\t\tresolve(work);\r\n\t\t},1000);\r\n\t});\r\n}", "async function fetchUser (){\r\n // do network request in 10seconds...\r\n\r\n return 'kiseo';\r\n}", "async function cobaAsync() {\n\n try {\n const coba = await cobaPromise();\n console.log(coba);\n } catch (error) {\n console.error(error);\n }\n}" ]
[ "0.6677672", "0.6656829", "0.6483484", "0.64800024", "0.6396786", "0.63749623", "0.6362798", "0.6350954", "0.63150537", "0.6265807", "0.62570405", "0.6253253", "0.6243075", "0.6241737", "0.62399954", "0.62125546", "0.62030494", "0.6198117", "0.6180709", "0.61520445", "0.6126499", "0.6115137", "0.6113191", "0.61039686", "0.60781187", "0.6072664", "0.6069434", "0.6069328", "0.6054881", "0.60519683", "0.60330427", "0.6029745", "0.6007502", "0.60004854", "0.59798694", "0.59743273", "0.5939939", "0.59398025", "0.5931568", "0.5927989", "0.5926199", "0.59239453", "0.5920763", "0.5909117", "0.5908594", "0.58919764", "0.5891866", "0.58918434", "0.5891154", "0.58722126", "0.58596367", "0.5856876", "0.58454496", "0.58439326", "0.5838483", "0.58220845", "0.58183897", "0.58147067", "0.58094245", "0.58067906", "0.5802262", "0.5797733", "0.57974935", "0.5796626", "0.5791416", "0.57851255", "0.5781022", "0.5775903", "0.577192", "0.5765324", "0.5763955", "0.5755976", "0.57516766", "0.57484895", "0.57474136", "0.57435405", "0.5742669", "0.5742227", "0.573737", "0.5735631", "0.57307607", "0.5722689", "0.57190925", "0.57149047", "0.5713527", "0.57038397", "0.5699667", "0.569266", "0.5683224", "0.56828547", "0.5682195", "0.5670226", "0.5659834", "0.56584686", "0.5655557", "0.5654292", "0.56453013", "0.56438065", "0.5641513", "0.5641212", "0.56373954" ]
0.0
-1
TODO do we also need to store value's type?
setUniform(name, value) { this.uniforms[name] = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function value() { }", "set type(value) {}", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "registerValue(value, valueHolder) {\n const category = determineValueTypeCategory(value);\n if (category === ValueTypeCategory.Primitive) {\n valueHolder.valueId = 0;\n valueHolder.value = value;\n }\n else {\n const valueRef = this._serialize(value, 1, null, category);\n Verbose && this._log(`value #${valueRef.valueId} for trace #${valueHolder.traceId}: ${ValueTypeCategory.nameFrom(category)} (${valueRef.serialized})`);\n valueHolder.valueId = valueRef.valueId;\n valueHolder.value = undefined;\n }\n }", "getProcessedValue(value) {\n if (this.subtype === GeoJsonParameter.PointType) {\n return {\n inputType: \"ComplexData\",\n inputValue: PointParameter.formatValueForUrl(value)\n };\n }\n if (this.subtype === GeoJsonParameter.PolygonType) {\n return {\n inputType: \"ComplexData\",\n inputValue: PolygonParameter.formatValueForUrl(value)\n };\n }\n if (this.subtype === GeoJsonParameter.SelectAPolygonType) {\n return {\n inputType: \"ComplexData\",\n inputValue: SelectAPolygonParameter.formatValueForUrl(value)\n };\n }\n }", "function M(t) {\n return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobValue */ : \"referenceValue\" in t ? 7 /* RefValue */ : \"geoPointValue\" in t ? 8 /* GeoPointValue */ : \"arrayValue\" in t ? 9 /* ArrayValue */ : \"mapValue\" in t ? O(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : _e(\"Invalid value type: \" + JSON.stringify(t));\n}", "function tt(t) {\n return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobValue */ : \"referenceValue\" in t ? 7 /* RefValue */ : \"geoPointValue\" in t ? 8 /* GeoPointValue */ : \"arrayValue\" in t ? 9 /* ArrayValue */ : \"mapValue\" in t ? X(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : Gn(\"Invalid value type: \" + JSON.stringify(t));\n}", "onValueChange(value) {\n const { fieldValue } = this.props;\n const { onFieldValueChange } = this.context.jsonEditor;\n const valueType = getValueType(fieldValue);\n\n onFieldValueChange(this.getFieldPath(), coerceToType(value, valueType));\n }", "function canBeValue() { }", "get value(){ return this._value; }", "function SoloValue() {}", "get value() {}", "get value() {}", "getClass() {\n return ValueEmbedder;\n }", "ValueType() { \n\n return typeof this.Expected == typeof this.Actual ? this.ExactType() : `Expected type ${typeof this.Expected} but found type ${typeof this.Actual}`\n }", "set value(value) {}", "function valueFromASTUntyped(valueNode) {\n switch (valueNode.kind) {\n case graphql_1.Kind.NULL:\n return null;\n case graphql_1.Kind.INT:\n return parseInt(valueNode.value, 10);\n case graphql_1.Kind.FLOAT:\n return parseFloat(valueNode.value);\n case graphql_1.Kind.STRING:\n case graphql_1.Kind.ENUM:\n case graphql_1.Kind.BOOLEAN:\n return valueNode.value;\n case graphql_1.Kind.LIST:\n return valueNode.values.map(valueFromASTUntyped);\n case graphql_1.Kind.OBJECT:\n var obj_1 = Object.create(null);\n valueNode.fields.forEach(function (field) {\n obj_1[field.name.value] = valueFromASTUntyped(field.value);\n });\n return obj_1;\n /* istanbul ignore next */\n default:\n throw new Error('Unexpected value kind: ' + valueNode.kind);\n }\n}", "function valueFromASTUntyped(valueNode) {\n switch (valueNode.kind) {\n case graphql_1.Kind.NULL:\n return null;\n case graphql_1.Kind.INT:\n return parseInt(valueNode.value, 10);\n case graphql_1.Kind.FLOAT:\n return parseFloat(valueNode.value);\n case graphql_1.Kind.STRING:\n case graphql_1.Kind.ENUM:\n case graphql_1.Kind.BOOLEAN:\n return valueNode.value;\n case graphql_1.Kind.LIST:\n return valueNode.values.map(valueFromASTUntyped);\n case graphql_1.Kind.OBJECT:\n var obj_1 = Object.create(null);\n valueNode.fields.forEach(function (field) {\n obj_1[field.name.value] = valueFromASTUntyped(field.value);\n });\n return obj_1;\n /* istanbul ignore next */\n default:\n throw new Error('Unexpected value kind: ' + valueNode.kind);\n }\n}", "get valueField() {\n return this.i.jo;\n }", "function type(d){\n d.value = +d.value\n return d\n }", "get value() {\r\n return this._value;\r\n }", "function ReturnValue(type, value){\n this.type = type\n this.value = value\n}", "function ReturnValue(type, value){\n this.type = type\n this.value = value\n}", "function Value (val) {\n\tthis.value = val;\n}", "get value () {\n\t\treturn this._value;\n\t}", "get value () {\n\t\treturn this._value;\n\t}", "get value() {\n return this._value;\n }", "get value() {\n return this._value;\n }", "getSimpleTypeAndValue(valueXTypes, def, defAsValue) {\n if (defAsValue == null) {\n defAsValue = new mdls.IdentifiableValue(def.identifier).withMinMax(1,1);\n }\n let type, value;\n const map = this._specs.maps.findByTargetAndIdentifier(this._target, def.identifier);\n if (map != null) {\n if (def.isEntry || def.isAbstract) {\n // Entries and abstracts should be represented as references to a resource/profile\n type = 'Reference';\n value = defAsValue;\n } else {\n const targets = common.getFHIRTypeHierarchy(this._fhir, common.TargetItem.parse(map.targetItem).target);\n const target = targets.find(t => valueXTypes.indexOf(t) !== -1);\n if (target) {\n // Non-entries should map to one of the choice types\n type = target;\n value = defAsValue;\n }\n }\n } else if (def.value !== undefined && def.value.effectiveCard.max <= 1 && def.fields.length == 0) {\n if (def.value instanceof mdls.ChoiceValue && this.choiceSupportsValueX(def.value)) {\n value = def.value;\n type = '[x]';\n } else if (def.value instanceof mdls.IdentifiableValue) {\n if (def.value.effectiveIdentifier.isPrimitive) {\n value = def.value;\n type = def.value.effectiveIdentifier.name;\n if (type === 'concept') {\n type = 'CodeableConcept';\n } else if (type === 'xhtml') {\n // xhtml is a weird type in FHIR and needs to be treated as a string\n type = 'string';\n }\n } else {\n const valueDef = this._specs.dataElements.findByIdentifier(def.value.effectiveIdentifier);\n if (valueDef) {\n return this.getSimpleTypeAndValue(valueXTypes, valueDef, def.value);\n }\n }\n }\n }\n return [type, value];\n }", "get value() {\n return this._value;\n }", "get value() {\n return this._value;\n }", "get value() {\n return this._value;\n }", "get value() {\n return this._value;\n }", "getTypeFromValue(value, originalTypes) {\n if (value && value instanceof mdls.IdentifiableValue) {\n if (value.effectiveIdentifier.isPrimitive) {\n let type = value.effectiveIdentifier.name;\n if (type === 'concept') {\n type = 'CodeableConcept';\n } else if (type === 'xhtml') {\n // xhtml is a weird type in FHIR and should be treated like a string instead\n type = 'string';\n }\n return { code: type };\n } else {\n const def = this._specs.dataElements.findByIdentifier(value.effectiveIdentifier);\n const [type, value2] = this.getSimpleTypeAndValue(originalTypes.map(t => t.code), def, value);\n if (value2 == null) {\n // 13115, 'Couldn\\'t identify appropriate Extension.value[x] value for ${elementId}. Is it an attempt to reference a non-Entry?', 'Check value to ensure it is a primitive, maps to a FHIR datatype, or is an Entry (which allows references)', 'errorNumber'\n logger.error({ elementId: value.effectiveIdentifier.fqn }, '13115');\n return;\n }\n const map = this._specs.maps.findByTargetAndIdentifier(this._target, value2.effectiveIdentifier);\n if (map === undefined) {\n return;\n }\n const code = type;\n const profile = this._profileExporter.lookupProfile(map.identifier, true, true);\n if (code == 'Reference') {\n return { code: code, targetProfile: [profile.url] };\n } else if (common.isCustomProfile(profile) || profile.id !== type) {\n return { code: code, profile: [profile.url] };\n }\n return { code };\n }\n }\n }", "function _valueOf(value) {\n var p = {};\n switch (value.type) {\n case 'object':\n p.value = {\n description: value.className,\n hasChildren: true,\n injectedScriptId: value.ref || value.handle,\n type: 'object'\n };\n break;\n case 'function':\n p.value = {\n description: value.text || 'function()',\n hasChildren: true,\n injectedScriptId: value.ref || value.handle,\n type: 'function'\n };\n break;\n case 'undefined':\n p.value = {description: 'undefined'};\n break;\n case 'null':\n p.value = {description: 'null'};\n break;\n case 'script':\n p.value = {description: value.text};\n break;\n default:\n p.value = {description: value.value};\n break;\n }\n return p;\n }", "function type(d) {\n\t\t d.value = +d.value;\n\t\t return d;\n\t\t}", "writeValue() { }", "get value() {\n return this._value;\n }", "_getValue_unavailable() {}", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "function ValuesOfCorrectType(context) {\n return {\n NullValue: function NullValue(node) {\n var type = context.getInputType();\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isNonNullType\"])(type)) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](badValueMessage(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(type), Object(_language_printer__WEBPACK_IMPORTED_MODULE_2__[\"print\"])(node)), node));\n }\n },\n ListValue: function ListValue(node) {\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n var type = Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"getNullableType\"])(context.getParentInputType());\n\n if (!Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isListType\"])(type)) {\n isValidScalar(context, node);\n return false; // Don't traverse further.\n }\n },\n ObjectValue: function ObjectValue(node) {\n var type = Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"getNamedType\"])(context.getInputType());\n\n if (!Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isInputObjectType\"])(type)) {\n isValidScalar(context, node);\n return false; // Don't traverse further.\n } // Ensure every required field exists.\n\n\n var fieldNodeMap = Object(_jsutils_keyMap__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(node.fields, function (field) {\n return field.name.value;\n });\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = Object(_polyfills_objectValues__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type.getFields())[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var fieldDef = _step.value;\n var fieldNode = fieldNodeMap[fieldDef.name];\n\n if (!fieldNode && Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isRequiredInputField\"])(fieldDef)) {\n var typeStr = Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(fieldDef.type);\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](requiredFieldMessage(type.name, fieldDef.name, typeStr), node));\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n },\n ObjectField: function ObjectField(node) {\n var parentType = Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"getNamedType\"])(context.getParentInputType());\n var fieldType = context.getInputType();\n\n if (!fieldType && Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isInputObjectType\"])(parentType)) {\n var suggestions = Object(_jsutils_suggestionList__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(node.name.value, Object.keys(parentType.getFields()));\n var didYouMean = suggestions.length !== 0 ? \"Did you mean \".concat(Object(_jsutils_orList__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(suggestions), \"?\") : undefined;\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](unknownFieldMessage(parentType.name, node.name.value, didYouMean), node));\n }\n },\n EnumValue: function EnumValue(node) {\n var type = Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"getNamedType\"])(context.getInputType());\n\n if (!Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isEnumType\"])(type)) {\n isValidScalar(context, node);\n } else if (!type.getValue(node.value)) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](badValueMessage(type.name, Object(_language_printer__WEBPACK_IMPORTED_MODULE_2__[\"print\"])(node), enumTypeSuggestion(type, node)), node));\n }\n },\n IntValue: function IntValue(node) {\n return isValidScalar(context, node);\n },\n FloatValue: function FloatValue(node) {\n return isValidScalar(context, node);\n },\n StringValue: function StringValue(node) {\n return isValidScalar(context, node);\n },\n BooleanValue: function BooleanValue(node) {\n return isValidScalar(context, node);\n }\n };\n}", "getProcessedValue(value) {\n const { returnValue } = this.props;\n\n switch (returnValue) {\n case 'start':\n return this.getValueFrom(value);\n case 'end':\n return this.getValueTo(value);\n case 'range':\n return this.getValueArray(value);\n default:\n throw new Error('Invalid returnValue.');\n }\n }", "get value() {\n\t\treturn this.__value;\n\t}", "get value() {\n\t\treturn this.__value;\n\t}", "get value () {\n return this._value\n }", "_packValue(buf, type, typeClass, value) {\n if (value === null || value === undefined) {\n if (typeClass && !typeClass.prototype.isCollection) {\n buf.writeUInt8(constants.TNS_OBJ_ATOMIC_NULL);\n } else {\n buf.writeUInt8(constants.TNS_NULL_LENGTH_INDICATOR);\n }\n } else {\n switch (type) {\n case types.DB_TYPE_CHAR:\n case types.DB_TYPE_VARCHAR:\n buf.writeBytesWithLength(Buffer.from(value));\n break;\n case types.DB_TYPE_NCHAR:\n case types.DB_TYPE_NVARCHAR:\n buf.writeBytesWithLength(Buffer.from(value, 'utf16le').swap16());\n break;\n case types.DB_TYPE_NUMBER:\n buf.writeOracleNumber(value.toString());\n break;\n case types.DB_TYPE_BINARY_INTEGER:\n case types.DB_TYPE_BOOLEAN:\n buf.writeUInt8(4);\n buf.writeUInt32BE(value);\n break;\n case types.DB_TYPE_RAW:\n buf.writeBytesWithLength(value);\n break;\n case types.DB_TYPE_BINARY_DOUBLE:\n buf.writeBinaryDouble(value);\n break;\n case types.DB_TYPE_BINARY_FLOAT:\n buf.writeBinaryFloat(value);\n break;\n case types.DB_TYPE_DATE:\n case types.DB_TYPE_TIMESTAMP:\n case types.DB_TYPE_TIMESTAMP_LTZ:\n case types.DB_TYPE_TIMESTAMP_TZ:\n buf.writeOracleDate(value, type);\n break;\n case types.DB_TYPE_OBJECT:\n if (this._objType.isCollection || value._objType.isCollection) {\n buf.writeBytesWithLength(value._getPackedData());\n } else {\n value._packData(buf);\n }\n break;\n default:\n errors.throwErr(errors.ERR_NOT_IMPLEMENTED, type);\n }\n }\n }", "get valueType() {\n const { maxDetail } = this.props;\n return allValueTypes[allViews.indexOf(maxDetail)];\n }", "create(_id, _data, _type) {\n if (!_type) {\n HValue.new(_id, _data);\n }\n else if (_type === 1) {\n HPushValue.new(_id, _data);\n }\n else if (_type === 2) {\n HPullValue.new(_id, _data);\n }\n else {\n console.warn(`Unknown value type: ${_type}`);\n }\n }", "function get_value(type, data, extra) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tlet str = type + \" <code>none</code>\"\n\t\t\t\t\t\t\tfor (let i = 0 ; i < data.length; i++) {\n\t\t\t\t\t\t\t\tlet tmpS = JSON.stringify(data[i])\n\t\t\t\t\t\t\t\tif (tmpS.indexOf(type) !== -1) {\n\t\t\t\t\t\t\t\t\ttmpS = tmpS.replace(/\"/g, \"\")\n\t\t\t\t\t\t\t\t\ttmpS = tmpS.replace(\"{type:\", \"\")\n\t\t\t\t\t\t\t\t\ttmpS = tmpS.replace(\",value:\", \" \")\n\t\t\t\t\t\t\t\t\tstr = tmpS.replace(\"}\", \"\")\n\t\t\t\t\t\t\t\t\tif (extra == true) {str += \" <code>\"+ str.charCodeAt(str.length-1) +\"</code>\"}\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 (str == undefined) {str = \" <code>undefined</code>\"}\n\t\t\t\t\t\t\treturn str\n\t\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\t\treturn type +\" error\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "_deserializeValue(value, type) {\n if (type == Boolean) {\n return !(!value || value.toLowerCase() == 'false');\n }\n return super._deserializeValue(value, type);\n }", "_trackValue(value, valueRef) {\n let tracked = this.trackedValues.get(value);\n if (!tracked) {\n // if (value === undefined) {\n // this.logger.warn(new Error(`Tried to track value but is undefined`).stack);\n // }\n try {\n this.trackedValues.set(value, tracked = new TrackedValue(value));\n }\n catch (err) {\n let typeInfo = typeof value;\n if (isObject(value)) {\n typeInfo += `(${Object.getPrototypeOf(value)})`;\n }\n logError(`could not store value (\"${err.message}\"): ${typeInfo} ${JSON.stringify(value)}`);\n }\n }\n tracked.addRef(valueRef);\n\n return tracked;\n }", "set Raw(value) {}", "_sanitizeValue (item) {\n let itemType = typeof item;\n\n if (null === item) {\n // null is allowed\n }\n else if (\"string\" === itemType || \"number\" === itemType || \"boolean\" === itemType) {\n // primitives are allowed\n }\n else if (cls.isSquelBuilder(item)) {\n // Builders allowed\n }\n else {\n let typeIsValid =\n !!getValueHandler(item, this.options.valueHandlers, cls.globalValueHandlers);\n\n if (!typeIsValid) {\n throw new Error(\"field value must be a string, number, boolean, null or one of the registered custom value types\");\n }\n }\n\n return item;\n }", "isValue(mixed) {\n return isValueInternal(this.keys, mixed);\n }", "constructor(value){\n\t\tthis.value = value;\n\t}", "function value(val, size, specifiers0) {\n var specifiers = set(specifiers0);\n var segment = {value: val};\n segment.type = type_in(specifiers);\n // TODO check type v. value ..\n specs(segment, segment.type, specifiers);\n segment.size = size_of(segment, segment.type, size, segment.unit);\n return segment;\n}", "function value(val, size, specifiers0) {\n var specifiers = set(specifiers0);\n var segment = {value: val};\n segment.type = type_in(specifiers);\n // TODO check type v. value ..\n specs(segment, segment.type, specifiers);\n segment.size = size_of(segment, segment.type, size, segment.unit);\n return segment;\n}", "toString() { return this._value; }", "writeValue(value) {\n this.value = value;\n }", "writeValue(value) {\n this.value = value;\n }", "writeValue(value) {\n this.value = value;\n }", "'validateValue'(value) {}", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "function $value(value) {\n\t function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n\t function $replace(value) {\n\t var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n\t return replacement.length ? replacement[0] : value;\n\t }\n\t value = $replace(value);\n\t return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n\t }", "_set_value(value) {\n if (!this._has_value_flag) {\n this._update_size(1);\n this._has_value_flag = true;\n }\n this._value = value;\n }", "get value() {\n return super.value;\n }", "get valueCoding () {\r\n\t\treturn this.__valueCoding;\r\n\t}", "toValue () {\n return this.data.toValue()\n }", "function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].NULL:\n return null;\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].INT:\n return parseInt(valueNode.value, 10);\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].FLOAT:\n return parseFloat(valueNode.value);\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].STRING:\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].ENUM:\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].BOOLEAN:\n return valueNode.value;\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].OBJECT:\n return Object(_jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(0, 'Unexpected value node: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(valueNode));\n}", "function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].NULL:\n return null;\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].INT:\n return parseInt(valueNode.value, 10);\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].FLOAT:\n return parseFloat(valueNode.value);\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].STRING:\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].ENUM:\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].BOOLEAN:\n return valueNode.value;\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].OBJECT:\n return Object(_jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(0, 'Unexpected value node: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(valueNode));\n}", "function $value(value) {\n\t\t\t\tfunction hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n\t\t\t\tfunction $replace(value) {\n\t\t\t\t\tvar replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n\t\t\t\t\treturn replacement.length ? replacement[0] : value;\n\t\t\t\t}\n\t\t\t\tvalue = $replace(value);\n\t\t\t\treturn !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n\t\t\t}", "get value() { return this.#val; }", "function type(d) {\n d.value = +d.value;\n return d;\n }", "valueOf(field, value){\n\t\tif(value === undefined){\n\t\t\treturn this.fields[field].getValue();\n\t\t}\n\t\telse{\n\t\t\tthis.fields[field].setValue(value);\n\t\t}\n\t}", "function processValue(el) {\n switch (el.dataType) {\n case HEX:\n {\n return processHEX(el.value);\n }\n case RGB:{\n return processRGB(el.value);\n }\n case RGBA:{\n return processRGB(el.value);\n }\n \n }\n}", "function processValue(el) {\n switch (el.dataType) {\n case HEX:\n {\n return processHEX(el.value);\n }\n case RGB:{\n return processRGB(el.value);\n }\n case RGBA:{\n return processRGB(el.value);\n }\n \n }\n}", "function $value(value) {\n\t function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n\t function $replace(value) {\n\t var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n\t return replacement.length ? replacement[0] : value;\n\t }\n\t value = $replace(value);\n\t return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n\t }", "_get_value() {\n return this._has_value() ? this._value : undefined;\n }", "function parseValue (type, value) {\n\tswitch (type) {\n\t\tcase 'REG_DWORD': {\n\t\t\treturn parseInt(value);\n\t\t}\n\t\t// case 'REG_QWORD': {\n\t\t// \tvalue = hexToUint8Array(value);\n\t\t// \tbreak;\n\t\t// }\n\t}\n\treturn value;\n}", "function processValue(schema, value) {\n // \"enum\" is a reserved word, so only \"type\" and \"items\" can be destructured\n var type = schema.type,\n items = schema.items;\n\n if (value === \"\") {\n return undefined;\n } else if (type === \"array\" && items && nums.has(items.type)) {\n return value.map(_utils.asNumber);\n } else if (type === \"boolean\") {\n return value === \"true\";\n } else if (type === \"number\") {\n return (0, _utils.asNumber)(value);\n } // If type is undefined, but an enum is present, try and infer the type from\n // the enum values\n\n\n if (schema[\"enum\"]) {\n if (schema[\"enum\"].every(function (x) {\n return (0, _utils.guessType)(x) === \"number\";\n })) {\n return (0, _utils.asNumber)(value);\n } else if (schema[\"enum\"].every(function (x) {\n return (0, _utils.guessType)(x) === \"boolean\";\n })) {\n return value === \"true\";\n }\n }\n\n return value;\n}", "function value(i) {\n var d = values.values[i];\n switch (values.dstypes[i]) {\n case \"derive\": {\n var key = values.host + \"/\" + values.plugin + \"/\" + values.plugin_instance + \"/\" + values.type + \"/\" + values.type_instance + \"/\" + values.dsnames[i],\n value = key in valuesByKey ? valuesByKey[key] : d;\n valuesByKey[key] = d;\n d -= value;\n break;\n }\n }\n return d;\n }", "function processValue({ type, items }, value) {\n if (value == null) {\n return undefined;\n }\n else if (value === \"\") {\n return undefined;\n } else if (type === \"array\" && items && nums.has(items.type)) {\n return value.map(asNumber);\n } else if (type === \"boolean\") {\n return value === \"true\";\n } else if (type === \"number\") {\n return asNumber(value);\n }\n return value;\n}", "value() { return undefined; }", "function identify(value) {\n return value;\n}" ]
[ "0.6743143", "0.673287", "0.6620208", "0.6620208", "0.6620208", "0.6620208", "0.6620208", "0.6620208", "0.6620208", "0.6620208", "0.6620208", "0.6576745", "0.6453963", "0.6414844", "0.6404815", "0.6401283", "0.63497293", "0.6306706", "0.6261238", "0.62537855", "0.62537855", "0.6251833", "0.6220015", "0.62192756", "0.6178203", "0.6178203", "0.6169175", "0.61573315", "0.6113524", "0.6098784", "0.6098784", "0.60944724", "0.60828626", "0.60828626", "0.6081228", "0.6081228", "0.6064543", "0.60570514", "0.60570514", "0.60570514", "0.60570514", "0.6051685", "0.60468507", "0.60415715", "0.60395914", "0.6022269", "0.6005091", "0.5991843", "0.5991843", "0.5991843", "0.5991843", "0.5991222", "0.59498906", "0.594761", "0.594761", "0.5944909", "0.59233814", "0.5923069", "0.5913856", "0.5902539", "0.59007686", "0.5888348", "0.5879705", "0.58755237", "0.5874082", "0.58667403", "0.5864519", "0.5864519", "0.58639914", "0.5860013", "0.5860013", "0.5860013", "0.5853086", "0.58475703", "0.58475703", "0.58475703", "0.58475703", "0.58475703", "0.58475703", "0.58475703", "0.58473676", "0.58423436", "0.5835579", "0.58338183", "0.58282036", "0.58256096", "0.58256096", "0.5819066", "0.5816693", "0.5812808", "0.5812502", "0.58102435", "0.58102435", "0.5807748", "0.57980794", "0.57927305", "0.57926565", "0.57910156", "0.578423", "0.5781712", "0.57656103" ]
0.0
-1
Shows how long it will take the driver to complete the entire path (all of the legs). Also, calculate how much time is left for the driver based on their current position
toHHMMSS( num ) { let hours = Math.floor(num / 3600); let minutes = Math.floor((num - (hours * 3600)) / 60); let seconds = num - (hours * 3600) - (minutes * 60); if (hours < 10) {hours = "0"+hours;} if (minutes < 10) {minutes = "0"+minutes;} if (seconds < 10) {seconds = "0"+seconds;} return hours+':'+minutes+':'+seconds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "computePathToComplete(){\n if (Object.keys(this.state.legs_dict).length !== 0 &&Object.keys(this.state.stops_dict).length !== 0 && this.state.driver_location !== null) {\n\n // Time required to complete all legs\n var time_complete_all_legs = 0\n // Time required to complete driver's remaining path\n var time_complete = 0\n \n // Append legs dictionary with start and stop locations and compute time required to drive from start to stop.\n // Also, compute times to complete driver's path and all legs\n var new_legs_dict = {}\n var is_passed_driver_leg = false\n\n for (var key in this.state.legs_dict) {\n var dict_specs = this.state.legs_dict[key]\n dict_specs[\"startStop_x\"] = this.state.stops_dict[dict_specs[\"startStop\"]][\"x\"]\n dict_specs[\"startStop_y\"] = this.state.stops_dict[dict_specs[\"startStop\"]][\"y\"]\n dict_specs[\"endStop_x\"] = this.state.stops_dict[dict_specs[\"endStop\"]][\"x\"]\n dict_specs[\"endStop_y\"] = this.state.stops_dict[dict_specs[\"endStop\"]][\"y\"]\n \n // Distance between subsequent stops\n var dist = Math.sqrt(Math.pow(dict_specs[\"endStop_x\"] - dict_specs[\"startStop_x\"], 2) + \n Math.pow(dict_specs[\"endStop_y\"] - dict_specs[\"startStop_y\"], 2))\n // Time required to drive from the start to the stop point\n dict_specs[\"time\"] = dist / dict_specs[\"speedLimit\"]\n\n // Update leg info\n new_legs_dict[key] = dict_specs\n\n // Update time to complete the entire path and the remaining path\n time_complete_all_legs += new_legs_dict[key][\"time\"]\n if (is_passed_driver_leg) time_complete += new_legs_dict[key][\"time\"]\n if (key === this.state.driver_location[\"activeLegID\"]) is_passed_driver_leg = true\n }\n\n // Update time to complete the remaining path with the time to complete the current leg\n time_complete += new_legs_dict[this.state.driver_location[\"activeLegID\"]][\"time\"] * (100 - parseInt(this.state.driver_location[\"legProgress\"])) / 100\n \n this.setState({legs_dict: new_legs_dict,\n bonus2_time_complete_all_legs: time_complete_all_legs,\n bonus2_time_complete: time_complete\n })\n } else {\n this.setState({alert_info: {status: true,\n type: \"warning\",\n reason: \"computePath\",\n message: \"Legs, stops and driver location are reqired for this feature to work\"}})\n }\n }", "computeBonusRemainingPath(){\n var path_to_complete = []\n var x = this.state.bonus_driver_location[\"x\"]\n var y = this.state.bonus_driver_location[\"y\"]\n \n // Find the closest stop\n var min_i = 0\n var min = Infinity\n for (var i = 0; i < this.state.stops.length; i++ ){\n var dist = Math.sqrt(Math.pow(this.state.stops[i][\"x\"] - x, 2) + Math.pow(this.state.stops[i][\"y\"] - y, 2))\n if (dist < min){\n min = dist\n min_i = i\n }\n }\n\n // Compute the remaining path\n path_to_complete.push({\n \"name\": \"loc\",\n \"x\": x,\n \"y\": y,\n })\n for (i = min_i; i < this.state.stops.length; i++ ){\n path_to_complete.push({\n \"name\": this.state.stops[i][\"name\"],\n \"x\": this.state.stops[i][\"x\"],\n \"y\": this.state.stops[i][\"y\"],\n })\n }\n\n this.setState({path_to_complete: path_to_complete})\n }", "get time ()\n\t{\n\t\tlet speed = parseInt (this.token.actor.data.data.attributes.movement.walk, 10);\n\t\t\n\t\tif (! speed)\n\t\t\tspeed = 30;\n\n\t\treturn speed / this.gridDistance;\n\t}", "computePath(){\n var driver_path = []\n for (var i=0; i < this.state.stops.length; i++){\n driver_path.push({\n \"name\": this.state.stops[i][\"name\"],\n \"x\": this.state.stops[i][\"x\"],\n \"y\": this.state.stops[i][\"y\"],\n })\n if (this.state.stops[i][\"name\"] === this.state.driver_location[\"activeLegID\"][0]){\n break\n }\n }\n \n // Compute driver's current position\n var leg_progress = parseInt(this.state.driver_location[\"legProgress\"]) / 100\n var delta_x = this.state.stops[i+1][\"x\"] - this.state.stops[i][\"x\"]\n var delta_y = this.state.stops[i+1][\"y\"] - this.state.stops[i][\"y\"]\n var x = delta_x * leg_progress + this.state.stops[i][\"x\"]\n var y = delta_y * leg_progress + this.state.stops[i][\"y\"]\n\n driver_path.push({\n \"name\": \"loc\",\n \"x\": x,\n \"y\": y,\n })\n\n this.setState({\n newDriverLoc : {\n \"x\": x,\n \"y\": y,\n },\n sliderVal: parseInt(this.state.driver_location[\"legProgress\"]),\n driver_loc_activeLegID_new: this.state.driver_location[\"activeLegID\"]\n })\n\n // Update driver's path\n this.setState({driver_path: driver_path})\n }", "function calculateFillTime(){\n\t\t// Por cada tipo de recurso calcula el tiempo hasta el llenao\n\t\tfor (var i = 0; i < 4; i++){\n\t\t\tif (produccion[i] < 0) var tiempo = Math.round(actual[i] / -produccion[i]);\n\t\t\t// Si la produccion es 0, el tiempo es infinito\n\t\t\telse if (produccion[i] == 0) var tiempo = -1;\n\t\t\t// Si la produccion es negativa, se calcula el tiempo hasta el vaciado\n\t\t\telse var tiempo = Math.round((total[i] - actual[i]) / produccion[i]);\n\n var produccionHora = get('l' + (i+1)).title;\n var tiempoRestante = \"<span id='timeouta' style='font-weight:bold'>\" + formatear_tiempo(tiempo) + \"</span>\";\n var celda = elem(\"DIV\", \"<span style='font-size:9px; color:#909090; position: absolute; top:13px; height: 20px; text-align:left;'>(\" + (produccionHora > 0 ? '+' : '') + produccionHora + ', ' + (produccionHora < 0 ? '<font color=\"#FF0000\">' + tiempoRestante + '</font>' : tiempoRestante) + ')</span>');\n\t\t\tvar a = get('l'+(i+1)).previousSibling;\n\t\t\t// FIXME: Apaño para Firefox. FF mete nodos de tipo texto vacios\n\t\t\tif (a.nodeName == '#text') a = a.previousSibling;\n\t\t\ta.appendChild(celda);\n\t\t}\n\t}", "function calculate_distance() {\n\n currgal_length_in_Mpc = convert_ltyr_to_Mpc(currgal_length_in_ltyr);\n currgal_distance = currgal_length_in_Mpc / view_height_rad;\n\n print_distance(\"calculating.\");\n setTimeout(function () {\n print_distance(\"calculating..\")\n }, 500);\n setTimeout(function () {\n print_distance(\"calculating...\")\n }, 1000);\n setTimeout(function () {\n print_distance(Math.round(currgal_distance).toLocaleString() + \" Mpc\")\n }, 1500);\n }", "function pathGatherer(){\n var indicator = Grid[EndPoint[0]][EndPoint[1]].VisitedAt\n var currentPoint = [EndPoint[0],EndPoint[1]]\n var path = []\n\n while( indicator != 0){\n console.log(indicator)\n console.log(\"Current: \" + currentPoint[0] + \"-\" + currentPoint[1])\n if(currentPoint[0]!=EndPoint[0] | currentPoint[1]!=EndPoint[1]){\n console.log(currentPoint,\"not equal to\",EndPoint)\n document.getElementById(Grid[currentPoint[0]][currentPoint[1]].id).innerHTML=\"<div id='path\"+currentPoint[0]+\"x\"+currentPoint[1]+\"' class='path'></div>\";\n document.getElementById(\"path\"+currentPoint[0]+\"x\"+currentPoint[1]).style.animationDelay=indicator/15+\"s\"\n }\n \n Grid[currentPoint[0]][currentPoint[1]].State = \"Path\"\n //update, find the \n indicator -= 1\n //-x NORTH\n if(currentPoint[0] > 0){\n if(Grid[currentPoint[0]-1][currentPoint[1]].VisitedAt == indicator){\n path.push([currentPoint[0],currentPoint[1],\"NORTH\"])\n currentPoint[0] -= 1\n continue\n }\n \n }\n //+x SOUTH\n if(currentPoint[0] < GRID_ROW_SIZE-1){\n if(Grid[currentPoint[0]+1][currentPoint[1]].VisitedAt == indicator){\n path.push([currentPoint[0],currentPoint[1],\"SOUTH\"])\n currentPoint[0] += 1\n continue\n }\n \n }\n //-y WEST\n if(currentPoint[1] > 0){\n if(Grid[currentPoint[0]][currentPoint[1]-1].VisitedAt == indicator){\n path.push([currentPoint[0],currentPoint[1],\"WEST\"])\n currentPoint[1] -= 1\n continue\n }\n \n }\n //+y EAST\n if(currentPoint[1] < GRID_COL_SIZE-1){\n if(Grid[currentPoint[0]][currentPoint[1]+1].VisitedAt == indicator){\n path.push([currentPoint[0],currentPoint[1],\"EAST\"])\n currentPoint[1] += 1\n continue\n }\n \n }\n\n }\n //!! the path is the REVERSE PATH from the END to the START \n Grid[EndPoint[0]][EndPoint[1]].State = \"End\"\n console.log(path)\n consoleGridPrinter()\n}", "function calculateFillTime(){\r\n\t\t// Por cada tipo de recurso calcula el tiempo hasta el llenao\r\n\t\tfor (var i = 0; i < 4; i++){\r\n\t\t\tif (produccion[i] < 0) var tiempo = Math.round(actual[i] / -produccion[i]);\r\n\t\t\t// Si la produccion es 0, el tiempo es infinito\r\n\t\t\telse if (produccion[i] == 0) var tiempo = -1;\r\n\t\t\t// Si la produccion es negativa, se calcula el tiempo hasta el vaciado\r\n\t\t\telse var tiempo = Math.round((total[i] - actual[i]) / produccion[i]);\r\n\t\t\t\t\t\tif(getv2()!=1){\r\n\t\t\t\t\t\tvar produccionHora = get('l' + (4-i)).title;} else{\r\n\t\t\t\t\t\tvar produccionHora = get('l' + (1+i)).title;}\r\n\t\t\t\t\t\tvar tiempoRestante = \"<span id='timeouta' style='font-weight:bold' noreload='1'>\" + formatear_tiempo(tiempo) + \"</span>\";\r\n\t\t\t\t\t\tvar celda = elem(\"span\", \"<span style='font-size:9px; color:#909090; position: absolute; top:13px; height: 20px; text-align:left;'>(\" + (produccionHora > 0 ? '+' : '') + produccionHora + ', ' + calculateHighlight(produccionHora, tiempo, tiempoRestante) + ')</span>');\r\n\t\t\t\t\t\t//var celda = elem(\"DIV\", \"<span style='font-size:9px; color:#909090; position: absolute; top:13px; height: 20px; text-align:left;'>(\" + (produccionHora > 0 ? '+' : '') + produccionHora + ', ' + (produccionHora < 0 ? '<font color=\"#FF0000\">' + tiempoRestante + '</font>' : tiempoRestante) + ')</span>');\r\n\t\t\tif(getv2()!=1){\r\n\t\t\t\tvar a = get('l'+(4-i)).previousSibling;\r\n\t\t\t} else {\r\n\t\t\t\tvar a = get('l'+(1+i)).previousSibling;\r\n\t\t\t}\r\n\t\t\t// FIXME: Apanyo para Firefox. FF mete nodos de tipo texto vacios\r\n\t\t\tif (a.nodeName == '#text') a = a.previousSibling;\r\n\t\t\ta.appendChild(celda);\r\n\t\t}\r\n\r\n\t\tget('l1').style.cssText = 'padding-bottom: 5px;';\r\n\t}", "function calculateNextVelInPaths(){\n pathStats.size += pathStats.calculateSpeed;\n for (let i = 0; i < pathStats.calculateSpeed; i++){\n for (const p of allPlanets){\n p.calculateNextVelInPath();\n }\n }\n}", "_getRemainingDistance()\r\n {\r\n let distanceList = this._navPath.distances;\r\n let distRemaining = 0;\r\n\r\n // Add distance to next waypoint.\r\n distRemaining += this._distanceToNext();\r\n\r\n for (let distIdx = this._waypointIdx + 1; distIdx < distanceList.length; distIdx++)\r\n {\r\n // Add distances between all successive waypoints.\r\n distRemaining += distanceList[distIdx]\r\n }\r\n\r\n // Return distance in metres.\r\n return distRemaining;\r\n }", "function tiles_FX() {\n var delta_time,\n path_tiles;\n b += 1;\n if (b < n_c.length) {\n\n misc.s_cl(n_c[b], \"point path\");\n misc.s_ti(n_c[b], b + 1);\n\n if (!!n_c[b].getAttribute(\"data-direction\")) {\n n_c[b].innerHTML = n_c[b].getAttribute(\"data-direction\");\n } else {\n n_c[b].innerHTML = comparer(n_c[b], AI.v.sf.finish);\n }\n\n } else {\n delta_time = AI.v.time_end - AI.v.time_start;\n path_tiles = misc.slc(\".point.path\").length;\n misc.s_cl(misc.gid(e[0] + \"_\" + e[1]), \"point end white smiley\");\n\n title.innerHTML =\n \"Path Finding<br><sub style='color:white'>Calculated in \" + delta_time +\n \" ms | \" + path_tiles + \" steps between start - finish</sub>\";\n\n title.style.background = \"deepskyblue\";\n btn.innerHTML = \"Finished\";\n rebuild_btn.disabled = 0;\n clear_btn.disabled = 0;\n AI.v.traceback = 0;\n clearInterval(a);\n }\n }", "_updateRouteProgressHelper(route,time){\n let distance = 0;\n while(time >= this.route.timeSegment){\n if(this.route.index === this.route.route.length - 1){\n this.distanceTravelled += distance;\n this.fuelConsumed += this.computeFuelConsumed(distance, this.currentLoad.weight);\n this._setLocation(route[this.route.index].coordinates);\n return ;\n }\n this.route.index += 1;\n distance += this.route.distSegment;\n time -= this.route.timeSegment;\n this.route.distSegment = route[this.route.index].distance;\n this.route.timeSegment = route[this.route.index].duration;\n }\n let ratio = time / this.route.timeSegment;\n distance += ratio * this.route.distSegment;\n this.fuelConsumed += this.computeFuelConsumed(distance, this.currentLoad.weight);\n this.route.timeSegment -= time;\n this.route.distSegment -= ratio * this.route.distSegment;\n this.distanceTravelled += distance;\n this._setLocation({\n lat : ratio * (route[this.route.index + 1].coordinates.lat -\n this.location.lat) + this.location.lat,\n lng : ratio * (route[this.route.index + 1].coordinates.lng -\n this.location.lng) + this.location.lng,\n });\n }", "get distanceToNext()\r\n {\r\n if (!this._endOfPath)\r\n {\r\n // Return remaining distance in m.\r\n let distanceValue = this._distanceToNext().toFixed(2);\r\n return distanceValue.toString() + \" m\"\r\n }\r\n else\r\n {\r\n return \"None\"\r\n }\r\n }", "function Pathfinder() {\n this.calculateDistancesFromIndex = function (start) {\n let frontier = new Set();\n const distances = [];\n frontier.add(start);\n distances[ start ] = 0;\n\n let neighbors = neighborsForIndex(start);\n let currentDistance = 1;\n\n while (frontier.size <= levelList[ levelNow ].length) {\n let newNeighbors = [];\n for (let i = 0; i < neighbors.length; i++) {\n const frontierSize = frontier.size;\n frontier.add(neighbors[ i ]);\n if (frontier.size > frontierSize) {\n distances[ neighbors[ i ] ] = currentDistance;\n newNeighbors = newNeighbors.concat(neighborsForIndex(neighbors[ i ]));\n }\n }\n\n neighbors = newNeighbors;\n\n currentDistance++;\n }\n\n let string = \"\";\n for (let j = 0; j < levelList[ levelNow ].length; j++) {\n let distString = distances[ j ].toString();\n if (distString.length < 2) {\n distString = (\"0\" + distString);\n }\n\n distString += \", \";\n string += distString;\n if ((j + 1) % ROOM_COLS == 0) {\n string += \"\\n\";\n }\n }\n// console.log(string);//Temporary\n };\n\n const neighborsForIndex = function (index) {\n const result = [];\n const above = indexAboveIndex(index);\n if (above != null) {\n result.push(above);\n }\n const below = indexBelowIndex(index);\n if (below != null) {\n result.push(below);\n }\n const left = indexLeftofIndex(index);\n if (left != null) {\n result.push(left);\n }\n const right = indexRightOfIndex(index);\n if (right != null) {\n result.push(right);\n }\n\n return result;\n };\n\n const indexAboveIndex = function (index) {\n const result = index - ROOM_COLS;\n if (result < 0) {\n return null;\n } else {\n return result;\n }\n };\n\n const indexBelowIndex = function (index) {\n const result = index + ROOM_COLS;\n if (result > levelList[ levelNow ].length) {\n return null;\n } else {\n return result;\n }\n };\n\n const indexLeftofIndex = function (index) {\n const result = index - 1;\n if (result < 0) {\n return null;\n } else {\n return result;\n }\n };\n\n const indexRightOfIndex = function (index) {\n const result = index + 1;\n if (result > levelList[ levelNow ].length) {\n return null;\n } else {\n return result;\n }\n }\n}", "get remainingDistance()\r\n {\r\n if (!this._endOfPath)\r\n {\r\n // Return remaining distance in km.\r\n let distanceValue = this._getRemainingDistance().toFixed(2);\r\n return distanceValue.toString() + \" m\"\r\n }\r\n else\r\n {\r\n return \"None\"\r\n }\r\n }", "function pathLength() {\n\t\tvar l = this.getTotalLength();\n\t\treturn -l;\n\t}", "get remainingTime()\r\n { \r\n if (!this._endOfPath)\r\n {\r\n // Return remaining time in minutes.\r\n let minutesValue = (this._getRemainingTime() / 60).toFixed(2);\r\n if (isNaN(minutesValue))\r\n {\r\n return \"NaN\"\r\n }\r\n return minutesValue.toString() + \" mins\"\r\n }\r\n else\r\n {\r\n return \"None\"\r\n }\r\n }", "function countingValleys(steps, path) {\r\n\t// Write your code here\r\n\tlet u = 0;\r\n\tlet d = 0;\r\n\tlet currLevel = 0;\r\n\tlet valleys = 0;\r\n\tlet mountains = 0;\r\n\tfor (let i = 0; i < steps; i++) {\r\n\t\t//update the current level\r\n\t\tif (path[i] === 'U') {\r\n\t\t\tcurrLevel += 1;\r\n\t\t\t// check if going up will bring me back to sea level\r\n\t\t\tif (currLevel == 0) valleys += 1;\r\n\t\t} else {\r\n\t\t\tcurrLevel -= 1;\r\n\t\t\t// check if going down will bring me back to sea level\r\n\t\t\tif (currLevel == 0) mountains += 1;\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn valleys;\r\n}", "_countLostPolyglots(time) {\n\t\tconst unableToActTime = this.unableToAct.getDowntimes().filter(downtime => Math.max(0, downtime.end - downtime.start) >= ASTRAL_UMBRAL_DURATION).reduce((duration, downtime) => duration + Math.max(0, downtime.end - downtime.start), 0)\n\t\treturn Math.floor((time - unableToActTime)/ENOCHIAN_DURATION_REQUIRED)\n\t}", "findPath(unit) {\n /**\n * The open list (Nodes yet to check),\n * this list is always sorted according to the\n * score of its nodes:\n */\n let openList = [];\n\n /**\n * The closed list (Nodes already checked):\n */\n this.closedList = [];\n\n this.nodeScoring.posFinishX = unit.route.finish.posX;\n this.nodeScoring.posFinishY = unit.route.finish.posY;\n\n let done = false;\n let cumCostPath = -1;\n let iteCnt = 0;\n let tmpCost = 0;\n let tmp = null;\n\n //\tThe node which is currently being processed:\n let curNode = unit.route.start;\n\n let i, j;\n\n /**\n * MAIN LOOP:\n */\n while (!done) {\n /** If we've reached the destination: */\n if (curNode.equals(unit.route.finish)) {\n done = true;\n cumCostPath = curNode.cost;\n\n unit.route.Steps.push(curNode);\n tmp = curNode;\n while (tmp.parent != null) {\n unit.route.Steps.push(tmp.parent);\n tmp = tmp.parent;\n }\n unit.route.Steps.reverse();\n unit.route.routeActive = true;\n }\n /** If not yet: */\n else {\n /** EXPAND THE CURRENT NODE: */\n for (i = -1; i < 2; i++) {\n for (j = -1; j < 2; j++) {\n /** Current node is already expanded: */\n if (i == 0 && j == 0) {\n continue;\n }\n /** If we're out of bounds: */\n if (curNode.posX + i < 0 || curNode.posX + i >= this.map.width || curNode.posY + j < 0 || curNode.posY + j >= this.map.height) {\n continue;\n }\n /** If it's an obstacle: */\n //if (this.map.getTileType(curNode.posY + j, curNode.posX + i) == this.INDEX_FOR_OBSTACLE) {\n if (this.map.getTileType(curNode.posX + i, curNode.posY + j) == this.INDEX_FOR_OBSTACLE) {\n continue;\n }\n /** Is this neighbor already done with ?: */\n if (this.closedList != null) {\n tmp = this.closedList.find(a => (a.posX == curNode.posX + i && a.posY == curNode.posY + j));\n if (tmp != null) {\n tmp = null;\n continue;\n }\n }\n\n /** Skip diagonally adjacent nodes IF NO_DIAG_MOV == true: */\n if (i != 0 && j != 0 && this.NO_DIAG_MOV) {\n continue;\n }\n /** THIS IS FOR PSEUDO-NO_DIAG_MOV\n YOU SHALL NOT MOVE DIAGONALLY IF\n AN OBSTACLE IS ADJACENT TO current_node\n AND THIS NODE:\n */\n if (i != 0 && j != 0 && this.HALF_DIAG_MOV) {\n if (this.map.getTileType(curNode.posX + i, curNode.posY) == this.INDEX_FOR_OBSTACLE)\n continue;\n if (this.map.getTileType(curNode.posX, curNode.posY + j) == this.INDEX_FOR_OBSTACLE)\n continue;\n }\n /** Check whether this neighbor is already on the open list,\n * if yes - update its costs accordingly:\n */\n if (openList != null) {\n tmp = openList.find(a => (a.posX == curNode.posX + i && a.posY == curNode.posY + j));\n }\n\n if (openList != null && tmp != null) {\n /** checking for diagonal vs (horizontal / vertical step): */\n if (i != 0 && j != 0) {\n /** Is curNode the better predecessor\n * than what we have atm ?:\n */\n if (tmp.cost > curNode.cost + 14) {\n tmp.cost = curNode.cost + 14;\n tmp.parent = curNode;\n }\n }\n else {\n if (tmp.cost > curNode.cost + 10) {\n tmp.cost = curNode.cost + 10;\n tmp.parent = curNode;\n }\n }\n\n }\n /** tmp is neither on the openList nor on the closedList\n * so we gotta add it to the open list:\n */\n else {\n if (i != 0 && j != 0) {\n tmpCost = curNode.cost + 14;\n }\n else {\n tmpCost = curNode.cost + 10;\n }\n tmp = new Node(curNode.posX + i, curNode.posY + j);\n tmp.cost = tmpCost;\n tmp.parent = curNode;\n if (openList == null) {\n openList = [];\n }\n openList.push(tmp);\n //openList.sort(this.nodeScoring.compareManhattan);\n //openList.sort(function() { this.nodeScoring.compareManhattan(); });\n // TODO: find out why this works and what exactly it does D:\n // TODO: compareManhattan() does not get a and b (= undefined) !!!\n /** PATH SCORING: */\n openList.sort((a, b) => {\n this.nodeScoring.compareManhattan(a, b);\n });\n }\n }\n }\n\n /** ADD curNode TO THE closedList: */\n if (this.closedList == null) {\n this.closedList = [];\n }\n this.closedList.push(curNode);\n /** REMOVE curNode FROM THE openList: */\n let index = openList.indexOf(curNode);\n if (index > -1) {\n openList.splice(index, 1);\n }\n\n /** if openList is empty, there are no open nodes left, even though destination is not reached yet: */\n if (openList.length == 0) {\n unit.route.Steps = null;\n unit.route.finish = null;\n unit.route.routeActive = false;\n done = true;\n console.log(\"NO PATH FOUND!\");\n }\n else {\n curNode = openList[0];\n }\n iteCnt++;\n }\n }\n }", "estimatedTime(peak) {\n // The estimated time depends on the distance in blocks\n // and whether the trip is occurring during peak hours or off peak hours.\n\n if (peak === true) {\n // while during peak hours\n // - two blocks in a minute.\n console.log(this.blocksTravelled()/2)\n let blocksOnPeak = this.blocksTravelled()/ 2;\n return Math.ceil(blocksOnPeak)\n } else {\n // During off peak hours,\n // - three blocks in a minute,\n console.log(this.blocksTravelled()/3)\n let blocksOnPeak = this.blocksTravelled()/ 3;\n return Math.ceil(blocksOnPeak)\n }\n }", "function countMoves() {\n moves++;\n moveCounter.innerHTML = moves;\n if (moves === 1) {\n //time does not accelerate when startTime function is activated here, why?\n startTime();\n }\n if (moves > 10 && moves < 14) {\n for (i = 0; i < 3; i++) {\n if(i > 1) {\n stars[i].style.visibility = \"collapse\";\n }\n }\n } else if (moves > 14) {\n for (i = 0; i < 3; i++) {\n if (i > 0) {\n stars[i].style.visibility = \"collapse\";\n }\n }\n }\n }", "function checkPathOfIndivue(individue)\n{\n var path = [];\n var position = Object.assign({},init_position);\n var steps = individue.data\n steps.forEach(function(doubleNible){\n var firstSetOfMovements = posible_directions[doubleNible & filter[1] >>> 4];\n var secondSetOfMovements = posible_directions[doubleNible & filter[0]];\n\n firstSetOfMovements.forEach(function(step){\n switch(step)\n {\n case lft:\n if(position.y-1>=0)\n {\n var temp_element=map[position.x][position.y-1];\n if(!Object.is(temp_element,wall_character)){ position.y--; path.push(step);}\n }\n break;\n case rgt:\n if(position.y+1<map.length)\n {\n var temp_element=map[position.x][position.y+1];\n if(!Object.is(temp_element,wall_character)){ position.y++; path.push(step); }\n }\n break;\n case up_:\n if(position.x-1>=0)\n {\n var temp_element=map[position.x-1][position.y];\n if(!Object.is(temp_element,wall_character)){ position.x--; path.push(step); }\n }\n break;\n case dwn:\n if(position.x+1<map[0].length)\n {\n var temp_element=map[position.x+1][position.y];\n if(!Object.is(temp_element,wall_character)){ position.x++; path.push(step); }\n }\n break;\n }\n })\n secondSetOfMovements.forEach(function(step){\n switch(step)\n {\n case lft:\n if(position.y-1>=0)\n {\n var temp_element=map[position.x][position.y-1];\n if(!Object.is(temp_element,wall_character)){ position.y--; path.push(step);}\n }\n break;\n case rgt:\n if(position.y+1<map.length)\n {\n var temp_element=map[position.x][position.y+1];\n if(!Object.is(temp_element,wall_character)){ position.y++; path.push(step); }\n }\n break;\n case up_:\n if(position.x-1>=0)\n {\n var temp_element=map[position.x-1][position.y];\n if(!Object.is(temp_element,wall_character)){ position.x--; path.push(step); }\n }\n break;\n case dwn:\n if(position.x+1<map[0].length)\n {\n var temp_element=map[position.x+1][position.y];\n if(!Object.is(temp_element,wall_character)){ position.x++; path.push(step); }\n }\n break;\n }\n })\n })\n return path;\n}", "getProgression() {\n const duration = this.props.duration;\n const timeSpent = new Date().getTime() - this.props.startTime;\n let progress;\n // If the car is traveling\n if (duration > timeSpent) {\n progress = timeSpent / duration * 100;\n this.state.finished = false;\n } else {\n progress = 100;\n this.state.finished = true;\n }\n\n this.setState({\n progression: progress\n });\n }", "animateShortestPath(nodesInShortestPathOrder) {\n for (let i = 1; i < nodesInShortestPathOrder.length-1; i++) {\n setTimeout(() => {\n const node = nodesInShortestPathOrder[i];\n document.getElementById(`node-${node.row}-${node.col}`).className =\n 'node node-shortest-path';\n }, 50 * i);\n }\n if(nodesInShortestPathOrder.length<=1){\n setTimeout(() => {\n alert(\"Path Not Found!!\");\n },1000);\n }\n }", "_getRemainingTime()\r\n {\r\n // Get time remaining in seconds.\r\n let timeRemaining = this._getRemainingDistance() / this._getAverageSpeed();\r\n if (timeRemaining === Infinity){\r\n timeRemaining = NaN\r\n }\r\n return timeRemaining\r\n }", "function update()\n\t\t{\n\t\tdocument.getElementById('flows').innerText=\"paths: \" + stackcount + \"/\" + maxpath;\n\t\tdocument.getElementById('currentstack').innerText=\"moves: \" + (stackarray.length-1);\n\t}", "posAlongPath(elapsed) {\n if (elapsed < 0) return this.pointAtIndex(0);\n else if (elapsed > 1) return this.lastPoint;\n\n let totalLen = this.pathLength;\n let fraction = 0;\n for (let i = 1; i < this.points.length; i++) {\n let len = distBetweenPos(this.points[i-1], this.points[i]);\n if (elapsed < fraction + len / totalLen) {\n let seg_elapsed = elapsed - fraction;\n let vec = fromTo(this.points[i-1], this.points[i]);\n let seg_len = lengthOfPos(vec) * seg_elapsed;\n return addPos( this.points[i-1], rescalePos(vec, seg_len) );\n }\n fraction += len / totalLen;\n }\n\n return this.lastPoint;\n }", "_calculatePath() {\n\t\tlet startNode = { x: this.gridX, y: this.gridY };\n\t\tlet goalNode = { x: window.uncover.player.gridX, y: window.uncover.player.gridY };\n\t\tstartNode.g = 0;\n\t\tstartNode.f = Math.pow(startNode.x - goalNode.x, 2) + Math.pow(startNode.y - goalNode.y, 2);\n\n\t\tlet openList = [startNode];\n\t\tlet closedList = [];\n\n\t\tconst neighborPositions = [{ dx: 0, dy: -1}, { dx: 1, dy: 0}, { dx: 0, dy: 1}, { dx: -1, dy: 0}];\n\n\t\tlet iterations = 0;\n\t\twhile (openList.length > 0) {\n\t\t\titerations++;\n\t\t\tif (iterations >= this._maxIterations) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Find node with minimum f\n\t\t\tlet currentNodeIndex = 0;\n\t\t\tfor (let i = 1; i < openList.length; i++) {\n\t\t\t\tif (openList[i].f < openList[currentNodeIndex].f) {\n\t\t\t\t\tcurrentNodeIndex = i;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet currentNode = openList[currentNodeIndex];\n\t\t\topenList.splice(currentNodeIndex, 1);\n\t\t\tclosedList.push(currentNode);\n\n\t\t\t// Found the goal node, create path\n\t\t\tif (currentNode.x === goalNode.x && currentNode.y === goalNode.y) {\n\t\t\t\treturn this._constructPath(currentNode);\n\t\t\t}\n\n\t\t\t// Create adjacent neighbors\n\t\t\tconst neighbors = []; \n\t\t\tfor (let neighborPosition of neighborPositions) {\n\t\t\t\tconst xPosition = currentNode.x + neighborPosition.dx;\n\t\t\t\tconst yPosition = currentNode.y + neighborPosition.dy;\n\t\t\t\tif (xPosition < 0 || xPosition >= window.uncover.gameGrid.gridSize || yPosition < 0 || yPosition >= window.uncover.gameGrid.gridSize) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst isNeighborInClosedList = closedList.some((node) => node.x === xPosition && node.y === yPosition);\n\t\t\t\tif (isNeighborInClosedList) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (window.uncover.gameGrid.grid[xPosition][yPosition] != GridType.FILLED) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} \n\n\t\t\t\tneighbors.push({ x: xPosition, y: yPosition, parent: currentNode });\n\t\t\t}\n\n\t\t\tfor (let neighbor of neighbors) {\n\t\t\t\tneighbor.g = currentNode.g + 1;\n\t\t\t\tneighbor.h = Math.pow(neighbor.x - goalNode.x, 2) + Math.pow(neighbor.y - goalNode.y, 2);\n\t\t\t\tneighbor.f = neighbor.g + neighbor.h;\n\n\t\t\t\tconst neighborInOpenListIndex = openList.findIndex((node) => node.x === neighbor.x && node.y === neighbor.y);\n\t\t\t\tconst isNeighborInOpenList = neighborInOpenListIndex >= 0;\n\t\t\t\tif (isNeighborInOpenList) {\n\t\t\t\t\tif (neighbor.g > openList[neighborInOpenListIndex].g) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\topenList.push(neighbor);\n\t\t\t}\n\t\t}\n\n\t\treturn [];\n\t}", "function Pathfinder(){\n this.openTiles = [];\n this.closedTiles = [];\n \n var me = this;\n //===========FIND PATH FUNCTION==========//\n //Finds the path for the player to follow\n this.findPath = function(startTile, endTile){\n me.openTiles = [];\n me.closedTiles = [];\n \n //Starting tiles parent property shuld be null\n startTile.resetParent();\n //STEP 1: CONNECT START TO END\n me.connectStartToEnd(startTile,endTile);\n //STEP 2: BUILD PATH BACK TO BEGINNING\n var path = me.connectEndToStart(startTile,endTile);\n //STEP 3: REVERSE THE PATH(FOR CONVENIENCE)\n path.reverse();\n }\n \n //function that calculates the cost of moving from one tile to the next and connects a starting tile to an ending tile\n this.connectStartToEnd=function(startTile,endTile){\n me.openTiles.push(startTile);//add startTile to the open tiles array\n \n //WHILE THERE ARE STILL TILES IN THE OPEN TILES ARRAY\n while(me.openTiles.length >0){\n //FIND THE OPEN TILE WITH THE LOWEST F VALUE\n var F = 99999999999;\n var index = -1;\n for(var i = 0; i < me.openTiles.length;i++){\n if(me.openTiles[i].F < F){\n F=me.openTiles[i].F;\n index=i;\n }\n }\n var current = openTiles.slice(index);//REMOVE TILE FROM OPEN TILES ARRAY\n me.closedTiles.push(current);\n \n //IF WE'VE CONNECTED THE START TO THE END , BREAK OUT OF WHILE, RETURN OUT OF FUNCTION\n if(current == endTile)break;\n \n for(var i = 0; i < current.neighbors.length;i++){\n var neighbor = current.neighbors[i];\n if(!me.tileInArray(me.closedTiles,neighbor)){\n if(!me.tileInArray(me.openTiles,neighbor)){\n me.openTiles.push(neighbor);\n neighbor.setParentTile(current);\n neighbor.doHeuristic(endTile);\n }\n }else{\n if(neighbor.G>current.G+neighbor.getCost()){\n neighbor.setParentTile(current);\n neighbor.doHeuristic(endTile);\n }\n }\n }\n }\n }//end start to end method\n \n //get each tile's parent starting at the end\n this.connectEndToStart = function(startTile, endTile){\n var path = [];\n var pathNode=endTile;\n while(pathNode!=null){\n path.push(pathNode);\n pathNode = pathNode.parent;\n }\n return path;\n }\n //function that checks to see if a tile is in an array\n this.tileInArray = function(array,tile){\n for(var i =0; i < array.length;i++) if(array[i]==tile)return true;\n return false;\n \n }\n \n}", "estimatedTime(peak){\n if(peak){\n return (this.blocksTravelled() / 2);\n }\n else{\n return (this.blocksTravelled() / 3);\n }\n }", "function TravelRHR() {\n\tif (gridArr[OPC.currentPos].room == \"ST\") { // check to see if it's time to exit the dungeon\n\t\topenCounter = 0; // open amount on map\n\t\tfor(i = 0; i < gridArr.length; i++) {\n\t\t\tif(gridArr[i].open > 0) {\n\t\t\t\topenCounter ++;\n\t\t\t}\n\t\t}\n\t\texploredCounter = 0; // explored amount on map\n\t\tfor(i = 0; i < gridArr.length; i++) {\n\t\t\tif(gridArr[i].explored > 0) {\n\t\t\t\texploredCounter ++;\n\t\t\t}\n\t\t}\n\t\tif(exploredCounter/openCounter > 0.6) { // if mostly explored, create a new dungeon\n\t\t\tGenerateDungeon();\n\t\t\tfor(var i = 0; i < gridArr.length; i++) { // find and store the start position\n\t\t\t\tif(gridArr[i].room == \"ST\"){\n\t\t\t\t\tOPC.currentPos = i;\n\t\t\t\t\tOPC.lastPos = i - 10;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tUpdateTileMap();\n\t\t\tLongRest();\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\tOPC.goal = \"long rest\";\n\t\t}\n\t}\n\tdirectionPriority = 0; // determine which was to go based on the left hand rule\n\tif(OPC.lastPos == OPC.currentPos - 1) {\n\t\tdirectionPriority = 3;\n\t}\n\telse if(OPC.lastPos == OPC.currentPos + 1) {\n\t\tdirectionPriority = 1;\n\t}\n\telse if(OPC.lastPos == OPC.currentPos - 10) {\n\t\tdirectionPriority = 4;\n\t}\n\telse if(OPC.lastPos == OPC.currentPos + 10) {\n\t\tdirectionPriority = 2;\n\t}\n\tnextMove = -1;\n\twhile(nextMove == -1) {\n\t\tswitch(directionPriority){\n\t\t\tcase 1:\n\t\t\t\ttargetPos = OPC.currentPos - 10;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\ttargetPos = OPC.currentPos + 1;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\ttargetPos = OPC.currentPos + 10;\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\ttargetPos = OPC.currentPos - 1;\n\t\t\t\tbreak;\n\t\t}\n\t\ttargetValid = 0;\n\t\tswitch(Math.abs(OPC.currentPos - targetPos)) { // determine between west-east and north-south moves\n\t\t\tcase 1: // west-east\n\t\t\t\tif(Math.floor(targetPos / 10) == Math.floor(OPC.currentPos / 10)) { // valid\n\t\t\t\t\ttargetValid = 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 10: // north-south\n\t\t\t\tif(targetPos >= 0 && targetPos <= 99) { // valid\n\t\t\t\t\ttargetValid = 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t};\n\t\tif(targetValid == 1 && // is a valid space on the grid \n\t\tgridArr[targetPos].open > 0) { // is an open area\n\t\t\tif(gridArr[OPC.currentPos].room == \"SC\") { // OPC is in a secret room\n\t\t\t\tif(gridArr[OPC.currentPos].exit == targetPos) { // target position has the secret door\n\t\t\t\t\tnextMove = targetPos;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(gridArr[targetPos].room != \"SC\") { // target is not a secret room\n\t\t\t\tnextMove = targetPos;\n\t\t\t}\n\t\t\telse if(gridArr[targetPos].room == \"SC\" && // target is a secrect room\n\t\t\tOPC.currentPos == gridArr[targetPos].exit && // current is the secret door for the target secret room\n\t\t\tgridArr[OPC.currentPos].sDoor == 1) { // OPC is at the closed secrect door\n\t\t\t\tdocument.getElementById(\"opc-feedback\").innerHTML=\"Hmm...\";\n\t\t\t\tOPC.encounter = \"investigate\";\n\t\t\t\tUpdateTileMap();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if(gridArr[targetPos].room == \"SC\" && // target is a secrect room\n\t\t\tOPC.currentPos == gridArr[targetPos].exit && // current is the secret door for the target secret room\n\t\t\tgridArr[OPC.currentPos].sDoor == 3) { // OPC is at the open secrect door\n\t\t\t\tUpdateTileMap();\n\t\t\t\tnextMove = targetPos;\n\t\t\t}\n\t\t}\n\t\tdirectionPriority --;\n\t\tif(directionPriority < 1) {\n\t\t\tdirectionPriority = 4;\n\t\t}\n\t}\n\tgridArr[OPC.currentPos].explored ++;\n\tTravelMove(nextMove);\n}", "function calcAnimationLength() {\r\n return data[data.length - 1].time / 1000 + \"s\"\r\n}", "function TravelExit() {\n\tif (gridArr[OPC.currentPos].room == \"ST\") { // check to see if it's time to exit the dungeon\n\t\topenCounter = 0; // open amount on map\n\t\tfor(i = 0; i < gridArr.length; i++) {\n\t\t\tif(gridArr[i].open > 0) {\n\t\t\t\topenCounter ++;\n\t\t\t}\n\t\t}\n\t\texploredCounter = 0; // explored amount on map\n\t\tfor(i = 0; i < gridArr.length; i++) {\n\t\t\tif(gridArr[i].explored > 0) {\n\t\t\t\texploredCounter ++;\n\t\t\t}\n\t\t}\n\t\tif(exploredCounter/openCounter > 0.6) { // if mostly explored, create a new dungeon\n\t\t\tGenerateDungeon();\n\t\t\tfor(var i = 0; i < gridArr.length; i++) { // find and store the start position\n\t\t\t\tif(gridArr[i].room == \"ST\"){\n\t\t\t\t\tOPC.currentPos = i;\n\t\t\t\t\tOPC.lastPos = i - 10;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tUpdateTileMap();\n\t\t\tLongRest();\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\tOPC.goal = \"long rest\";\n\t\t\treturn;\n\t\t}\n\t}\n\tnextMove = -1;\n\tpNorth = OPC.currentPos - 10;\n\tpEast = OPC.currentPos + 1;\n\tpSouth = OPC.currentPos + 10;\n\tpWest = OPC.currentPos - 1;\n\tpBest = 100;\n\tif(pNorth >= 0 && // is on map\n\tgridArr[pNorth].encounter != \"combat\" && // is not hostile\n\tgridArr[pNorth].explored > 0 && // has been explored\n\t//gridArr[pNorth}.room != \"SC\" &&\n\t//gridArr[pNorth].pathValue < gridArr[OPC.currentPos].pathValue && // is cloder to start than current posiiton\n\tgridArr[pNorth].pathValue > 0) { // is a valid path to start\n\t\tif(gridArr[pNorth].pathValue < pBest) {\n\t\t\tnextMove = pNorth;\n\t\t\tpBest = gridArr[pNorth].pathValue;\n\t\t}\n\t}\n\tif(Math.floor(pEast / 10) == Math.floor(OPC.currentPos / 10) &&\n\tgridArr[pEast].encounter != \"combat\" &&\n\tgridArr[pEast].explored > 0 &&\n\t//gridArr[pEast].pathValue < gridArr[OPC.currentPos].pathValue && / is cloder to start than current posiiton\n\tgridArr[pEast].pathValue > 0) {\n\t\tif(gridArr[pEast].pathValue < pBest) {\n\t\t\tnextMove = pEast;\n\t\t\tpBest = gridArr[pEast].pathValue;\n\t\t}\n\t}\n\tif(pSouth < 100 &&\n\tgridArr[pSouth].encounter != \"combat\" &&\n\tgridArr[pSouth].explored > 0 &&\n\t//gridArr[pSouth].pathValue < gridArr[OPC.currentPos].pathValue && // is cloder to start than current posiiton\n\tgridArr[pSouth].pathValue > 0) {\n\t\tif(gridArr[pSouth].pathValue < pBest) {\n\t\t\tnextMove = pSouth;\n\t\t\tpBest = gridArr[pSouth].pathValue;\n\t\t}\n\t}\n\tif(Math.floor(pWest / 10) == Math.floor(OPC.currentPos / 10) &&\n\tgridArr[pWest].encounter != \"combat\" &&\n\tgridArr[pWest].explored > 0 &&\n\t//gridArr[pWest].pathValue < gridArr[OPC.currentPos].pathValue && // is cloder to start than current posiiton\n\tgridArr[pWest].pathValue > 0) {\n\t\tif(gridArr[pWest].pathValue < pBest) {\n\t\t\tnextMove = pWest;\n\t\t\tpBest = gridArr[pWest].pathValue;\n\t\t}\n\t}\n\tif(nextMove == -1) { // a nextMove hasn't been found\n\t\tAssignPathValue(); // recalculate the path values\n//\t\tTravelExit(); // rerun this script\n\t}\n\tTravelMove(nextMove);\n\tdocument.getElementById(\"opc-feedback\").innerHTML=\"To the exit!\";\t\n}", "findWay(passedGrid) {\n // console.log('moj gridek', passedGrid)\n var pathFinder = (entranceX, entranceY, grid) => {\n var distanceFromTop = entranceX;\n var distanceFromLeft = entranceY;\n\n var location = {\n distanceFromTop: distanceFromTop,\n distanceFromLeft: distanceFromLeft,\n path: [],\n status: 'Start'\n }\n\n //inicjalizacja kolejki\n var queue = [];\n queue.push(location);\n\n //loop grida\n while (queue.length > 0) {\n //zwrocenie pierwszego elementu z kolejki\n var currentLocation = queue.shift();\n\n //polnoc\n var newLocation = explore(currentLocation, 'North', grid);\n //jesli wyjscie przekazac do stanu aplikacji kolejke z najkrotsza sciezka\n if (newLocation.status === 'Exit') {\n this.setState(prevState => ({\n exit: [...prevState.exit, newLocation.path]\n }))\n return newLocation.path;\n //droga\n } else if (newLocation.status === 'Valid') {\n queue.push(newLocation);\n }\n\n //wschod\n var newLocation = explore(currentLocation, 'East', grid);\n if (newLocation.status === 'Exit') {\n this.setState(prevState => ({\n exit: [...prevState.exit, newLocation.path]\n }))\n return newLocation.path;\n } else if (newLocation.status === 'Valid') {\n queue.push(newLocation);\n }\n\n //poludnie\n var newLocation = explore(currentLocation, 'South', grid);\n if (newLocation.status === 'Exit') {\n this.setState(prevState => ({\n exit: [...prevState.exit, newLocation.path]\n }))\n return newLocation.path;\n } else if (newLocation.status === 'Valid') {\n queue.push(newLocation);\n }\n\n //zachod\n var newLocation = explore(currentLocation, 'West', grid);\n if (newLocation.status === 'Exit') {\n this.setState(prevState => ({\n exit: [...prevState.exit, newLocation.path]\n }))\n return newLocation.path;\n } else if (newLocation.status === 'Valid') {\n queue.push(newLocation);\n }\n }\n //nie znaleziono drogi\n this.setState(prevState => ({\n exit: [...prevState.exit, 'Nie znaleziono wyjścia, ten grobowiec będzie twoim grobowcem']\n }))\n return false;\n }\n\n //sprawdzenie typu lokacji\n var locationStatus = (location, grid) => {\n let gridSize = grid.length;\n let dft = location.distanceFromTop;\n let dfl = location.distanceFromLeft;\n // console.log(gridSize, 'size')\n // console.log(location)\n // console.log(grid, dft, dfl);\n\n if (location.distanceFromLeft < 0 ||\n location.distanceFromLeft >= gridSize ||\n location.distanceFromTop < 0 ||\n location.distanceFromTop >= gridSize) {\n //poza gridem\n return 'Invalid';\n //jesli wyjscie\n } else if (grid[dft][dfl].type === 'w') {\n return 'Exit';\n //jesli nie droga (zablokowana lub odwiedzona)\n } else if (grid[dft][dfl].type !== 'o') {\n return 'Blocked';\n //jesli droga\n } else {\n return 'Valid';\n }\n }\n\n //chodzenie\n var explore = (currentLocation, direction, grid) => {\n var newPath = currentLocation.path.slice();\n newPath.push(direction);\n\n var dft = currentLocation.distanceFromTop;\n var dfl = currentLocation.distanceFromLeft;\n\n if (direction === 'North') {\n dft -= 1;\n } else if (direction === 'East') {\n dfl += 1;\n } else if (direction === 'South') {\n dft += 1;\n } else if (direction === 'West') {\n dfl -= 1;\n }\n\n var newLocation = {\n distanceFromTop: dft,\n distanceFromLeft: dfl,\n path: newPath,\n status: 'Unknown'\n };\n\n newLocation.status = locationStatus(newLocation, grid);\n\n //jesli droga, to oznacz lokacje jako odwiedzoną\n if (newLocation.status === 'Valid') {\n grid[newLocation.distanceFromTop][newLocation.distanceFromLeft] = 'Visited';\n }\n\n return newLocation;\n }\n console.log(pathFinder(this.state.startY, this.state.startX, passedGrid));\n }", "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath = void 0;\n\n var addPath = bestPath[diagonalPath - 1],\n removePath = bestPath[diagonalPath + 1],\n _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen,\n canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n } // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n\n\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done\n\n if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n } // Performs the length of edit iteration. Is a bit fugly as this has to support the", "function timeToWalk(steps, lengthOfStep, speedInKmPerHr){\n let distance = steps * lengthOfStep; // in meters\n\n //convert kms/hr into mtr/min : 5kms/hr = 5*1000 / 60\n let speedInMtrPerSec = (speedInKmPerHr * 1000) / (60 * 60);\n let time = distance/speedInMtrPerSec;\n for(let i=500; i<=distance; i+=500){\n time += 60;\n // console.log(time)\n }\n let hrs = Math.floor(time / 3600);\n let min = Math.floor((time % 3600) / 60);\n let sec = Math.ceil(time % 60);\n\n let result = '';\n if(hrs < 10){\n result += '0' + hrs; \n }else result += '' + hrs;\n min < 10 ? result += ':0' + min : result += ':' + min;\n sec < 10 ? result += ':0' + sec : result += ':' + sec;\n console.log(result); \n}", "function updateLevelTime() {\n\t\tlevel_time_left --;\n\t\tif(level_time_left == 0) {\n\t\t\tlevelComplete();\n\t\t}\n\t}", "function timeIt() {\n mousePressedDuration++;\n distance = dist( mouseX, mouseY, width / 2, height / 2);\n if (mousePressedDuration == 28) {\n clearInterval(interval);\n }\n pressSize = map(mousePressedDuration, 0, 28, 5, 70);\n if (distance <= canvasDimension && distance >= 50 && uploaded === false) {\n newPlanetPrev.size = pressSize;\n }\n}", "function calculatePath (startIndex, endIndex, onlyMeasure = false) {\n // startIndex ist der Index im TileArray von dem der Pfad startet\n // endIndex ist der Index im TileArray zu dem der Pfad geht\n // onlyMeasure = true begrenzt den Pfad nicht auf die maximale Bewegungsweite während einem Kampf\n \n let mappedList = [];\n let frontierList = [];\n let frontierListValues = [];\n let activeNode;\n let pathFound = false;\n let pathToTravel = [];\n let distance = 0;\n \n //Fange Ausnahmen ab startIndex = endIndex\n if (startIndex == endIndex || endIndex == undefined) {\n return {\n first: pathToTravel,\n second: distance\n }\n }\n \n // finde A und füge ihn der frontierList hinzu {name, wayPointUsefulness}\n tileArray[startIndex].entryPoint = \"Start\";\n tileArray[startIndex].distanceTravelled = 0;\n tileArray[startIndex].wayPointUsefulness = tileArray[startIndex].distanceTravelled + tileArray[startIndex].estimatedWayToB(endIndex);\n tileArray[startIndex].difDegree = Phaser.Math.Angle.BetweenPoints(tileArray[startIndex], tileArray[endIndex]);\n frontierList.push(tileArray[startIndex]);\n \n // gehe folgende Schleife solange durch bis es einen Weg gibt\n while (pathFound == false) {\n \n // Wenn kein Weg möglich ist brich diese Schleife ab\n if (frontierList.length == 0) {\n pathToTravel = [];\n break;\n }\n \n // gehe frontierList durch nach niedrigster wayPointUsefulness + Tiebreaker (geringster Winkelunterschied zur Luftlinie)\n frontierListValues.length = 0;\n for (let i = 0; i < frontierList.length; i++) {\n let difDegree = Math.abs(Phaser.Math.Angle.ShortestBetween(tileArray[startIndex].difDegree, frontierList[i].difDegree))/1000;\n frontierListValues.push(frontierList[i].wayPointUsefulness + difDegree);\n }\n activeNode = frontierListValues.indexOf(Math.min(...frontierListValues));\n \n // Wenn Knoten mit Niedrigster wayPointUsefulness schon das Ziel ist, ist A* fertig\n if (frontierList[activeNode].name == endIndex) {\n pathFound = true; // unterbricht diese Schleife und damit das Pfadsuchen\n let backtraceIndex = endIndex; // Sucht den Index des Zielfeldes\n pathToTravel.unshift(backtraceIndex); // Fügt das Zielfeld dem Pfad hinzu\n \n while (tileArray[tileArray[backtraceIndex].entryPoint].name != startIndex) {\n pathToTravel.unshift(tileArray[backtraceIndex].entryPoint);\n backtraceIndex = tileArray[backtraceIndex].entryPoint;\n }\n \n break;\n }\n \n // berechne für diesen alle neighbors\n frontierList[activeNode].checkForNeighbors();\n \n // Füge Neighbors des aktuellen Knotens der Frontierlist hinzu\n for (let i = 0; i < frontierList[activeNode].neighbors.length; i++) {\n \n let distanceTravelled = frontierList[activeNode].distanceTravelled + frontierList[activeNode].neighborsDistance[i];\n if (containsObject(frontierList[activeNode].neighbors[i], frontierList)) {\n if (distanceTravelled < frontierList[activeNode].neighbors[i].distanceTravelled) {\n frontierList[activeNode].neighbors[i].distanceTravelled = distanceTravelled;\n frontierList[activeNode].neighbors[i].wayPointUsefulness = frontierList[activeNode].neighbors[i].distanceTravelled + frontierList[activeNode].neighbors[i].estimatedWayToB(endIndex);\n frontierList[activeNode].neighbors[i].entryPoint = frontierList[activeNode].name;\n }\n } else if (containsObject(frontierList[activeNode].neighbors[i], mappedList)) {\n continue;\n } else {\n frontierList[activeNode].neighbors[i].distanceTravelled = frontierList[activeNode].distanceTravelled + frontierList[activeNode].neighborsDistance[i];\n frontierList[activeNode].neighbors[i].wayPointUsefulness = frontierList[activeNode].neighbors[i].distanceTravelled + frontierList[activeNode].neighbors[i].estimatedWayToB(endIndex);\n frontierList[activeNode].neighbors[i].entryPoint = frontierList[activeNode].name;\n frontierList[activeNode].neighbors[i].difDegree = Phaser.Math.Angle.BetweenPoints(frontierList[activeNode].neighbors[i], tileArray[endIndex])\n frontierList.push(frontierList[activeNode].neighbors[i]);\n }\n }\n \n // Füge den aktiven Knoten der mappedList hinzu und Lösche den aktven Knoten aus der frontierList\n mappedList.push(frontierList[activeNode]);\n frontierList.splice(activeNode,1);\n }\n \n // wenn gerade ein Kampf ist soll die Bewegung begrenzt sein auf die Maximale Bewegungsweite des aktiven Charakters\n if (fightmode == true && onlyMeasure == false) {\n movementStopper: for (let l = 0; l < pathToTravel.length; l++) {\n if (tileArray[pathToTravel[l]].distanceTravelled > activeChar.movementCounter) {\n pathToTravel.length = l;\n break movementStopper;\n }\n }\n }\n \n // wenn das Ziefeld der Bewegung besetzt ist, wird die Bewegung gekürzt\n checkEnd: while (pathToTravel.length > 0) {\n if (checkFor (tileArray[pathToTravel[pathToTravel.length-1]].occupiedBy, Figure) || checkFor (tileArray[pathToTravel[pathToTravel.length-1]].occupiedBy, Enemy)) {\n pathToTravel.length = pathToTravel.length-1;\n } else {\n break checkEnd;\n }\n }\n \n // speichert die Entfernung bis zum Ende des Pfades\n if (pathToTravel.length > 0) {\n distance += tileArray[pathToTravel[pathToTravel.length-1]].distanceTravelled;\n }\n \n // räumt alle Tiles wieder auf\n clearNodes();\n return {\n first: pathToTravel,\n second: distance\n }\n}", "function solvePath(){\n var grid = cGrid;\n stepCount = 0; //resetStep\n startRow = 0;\n exitRow = grid.length-1;\n var point = {\n row: 0,\n col: 0\n };\n\n //1. Loop start row , find the start col and mark\n let startCol = point.col;\n for ( ;startCol < grid[startRow].length; startCol++){\n noEntry = true;\n if (grid[startRow][startCol] == colValues.OPEN){\n point.row = startRow;\n point.col = startCol;\n noEntry = false;\n break;\n }\n }\n if(noEntry){\n writeResults();\n return;\n }\n \n //2. loop and find open path and mark as walked\n do {\n let step = {};\n for( var direct in directions){\n step = movable(point, grid, direct);\n if(step.canMove && step.colValue == colValues.OPEN){\n //mark current step as walked , move and add step count\n grid[point.row][point.col] = colValues.PATH;\n document.getElementById(`${point.row}:${point.col}`).setAttribute(\"blockValue\", \"step\");\n point = getNextPoint(point, direct);\n stepCount ++;\n break;\n }\n }\n //3. Test exit condition\n if ( point.row == exitRow){\n exitReached = true;\n grid[point.row][point.col] = colValues.PATH;\n document.getElementById(`${point.row}:${point.col}`).setAttribute(\"blockValue\", \"step\");\n break;\n }\n } while(true);\n\n writeResults();\n}", "getDuration(){\n // coefficient to increase or reduce the default animation duration\n var coeff = 1 / this.getSpeed()\n\n var duration = coeff * this.durationAnim\n\n // check if the duration is different from the one that has been used\n if (this.oldDuration !== duration){\n // duration is different. Therefore, the disks have to be re-rendered because\n // speed is one of their property\n this.oldDuration = duration\n this.setState({})\n\n }else{}\n\n return(duration)\n }", "function timeToWalk(steps, strideLength, speed){\n\n let speedInMetersPerSecond = Number(speed) / 3.6;\n let distance = Number(steps) * Number(strideLength);\n let stridesPerSecond = speedInMetersPerSecond / Number(strideLength);\n let timeInSeconds = distance / speedInMetersPerSecond;\n\n let restTime = Math.floor(distance / 500);\n timeInSeconds += restTime * 60;\n\n let hours = Math.floor(timeInSeconds / 3600);\n timeInSeconds %= 3600;\n let minutes = Math.floor(timeInSeconds / 60);\n timeInSeconds %= 60;\n timeInSeconds = Math.round(timeInSeconds);\n\n\n var hoursResult = hours < 10 ? \"0\" + hours : hours;\n var minutesResult = minutes < 10 ? \"0\"+ minutes : minutes;\n var secondsResult = timeInSeconds < 10 ? \"0\"+ timeInSeconds : timeInSeconds;\n\n var result = hoursResult \n + \":\" \n + minutesResult\n + \":\"\n + timeInSeconds;\n\n console.log(result);\n}", "step(){\n \n if(this.path.length === 0){\n this.updatePath();\n }\n \n this.move();\n \n }", "function calculateTravelTime(currLoc,newLoc){\n\n // Slice up the locations into coordinates\n var currX = parseInt(currLoc[0].slice(0,-1))\n var currY = parseInt(currLoc[1].slice(0,-1))\n var newX = parseInt(newLoc[0].slice(0,-1))\n var newY = parseInt(newLoc[1].slice(0,-1))\n\n // Calculate the distance between them\n var xOffset = currX - newX\n var yOffset = currY - newY\n var dist = Math.sqrt(xOffset*xOffset + yOffset*yOffset)\n\n // Multiply by speed to give a time\n var speed = 1.85\n var time = dist*speed\n\n return time\n\n}", "function draw() {\r\n\tbackground(53, 74, 35);\r\n\tfor (let i = 0; i < maze_grid.length; i++) {\r\n\t\tmaze_grid[i].displayGrid();\r\n\t}\r\n\r\n\tlet following_unit = current_unit.findAdjcent();\r\n\r\n\tcurrent_unit.visited = true;\r\n\t// console.log(current_unit);\r\n\r\n\tif (complete == false) {\r\n\t\tcurrent_unit.mark();\r\n\t\tif (following_unit) {\r\n\t\t\t// pushes current Unit to the stack for backtracking\r\n\t\t\tmaze_stack.push(current_unit);\r\n\t\t\tclearSide(current_unit, following_unit);\r\n\r\n\t\t\t// sets the current Unit to the following Unit in iteration\r\n\t\t\tfollowing_unit.visited = true;\r\n\t\t\tcurrent_unit = following_unit;\r\n\t\t// if no adjcent cells available then will pop \"backtrack\" until one becomes avaiable\r\n\t\t} else if (maze_stack.length > 0) {\r\n\t\t\tcurrent_unit = maze_stack.pop();\r\n\t\t}\r\n\t}\r\n\r\n\tdetermineComplete(maze_stack);\r\n\r\n\t// displays final path\r\n\tif (complete_path == true) {\r\n\t\tdisplayPath(path_stack)\r\n\t}\r\n\r\n\t// starts path finding process\r\n\tif (complete == true) {\r\n\t\tpath_iteration.pathvisit = true;\r\n\t\tpath_iteration.marksolve();\r\n\r\n\t\tvar following_path = path_iteration.findAdjcentPath();\r\n\t\tif(following_path) {\r\n\t\t\t// pushes current path to the stack for backtracking\r\n\t\t \tpath_stack.push(path_iteration);\r\n\r\n\t\t \t// sets the current path to the following path in iteration\r\n\t\t \tfollowing_path.pathvisit = true;\r\n\t\t \tpath_iteration = following_path;\r\n\t\t } else if(path_stack.length > 0 ) {\r\n\t\t \tpath_iteration = path_stack.pop();\r\n\t\t \tpath_iteration.markbacktrack();\r\n\t\t }\r\n\t}\r\n}", "function moreTime(elementID){\n var i, j;\n //Get the index of the selected element id\n for (i = 0; i < diagram.length; i++) {\n var cur = diagram[i];\n if (cur._id == elementID) {\n break;\n }\n }\n\n // increase the time of all the elements\n for (var j = i; j < diagram.length; j++) {\n var cur = diagram[j];\n if (j == i) {\n if (diagram[i].end_time - diagram[i].start_time == 10) {\n return;\n }\n diagram[j].end_time = diagram[j].end_time + 1; // Increase end time of current element by 1\n $(\"#time_\"+diagram[j]._id).text(diagram[j].end_time - diagram[j].start_time);\n totalTime++;\n //alert(diagram[j].end_time);\n continue;\n }\n diagram[j].start_time = diagram[j].start_time + 1;\n diagram[j].end_time = diagram[j].end_time + 1; \n //alert(diagram[j]._id);\n $(\"#time_\"+diagram[j]._id).text(diagram[j].end_time - diagram[j].start_time);\n }\n}", "step(now) {\n let percent;\n if( this.duration === 0 ){\n percent = 1;\n } else {\n percent = (now - this.startTime) / this.duration;\n }\n\n for (let i = 0; i < this.nodeContainer.instanceCount; i++) {\n const currentPosition = this.calStep(\n { x: this.startPositions[2 * i], y: this.startPositions[2 * i +1 ]},\n { x: this.endPositions[2 * i], y: this.endPositions[2 * i +1 ]},\n percent\n );\n\n const nodeId = this.nodeContainer.idIndexMap.idFrom(i);\n const nodeSprite = this.nodeSprites[nodeId];\n nodeSprite.updateNodePosition(currentPosition);\n this.nodeContainer.nodeMoved(nodeSprite);\n }\n\n Object.values(this.edgeSprites).forEach((link) => {\n link.updatePosition();\n });\n\n if (percent > 1) {\n this.resolve();\n } else {\n requestAnimationFrame(this.step.bind(this));\n }\n }", "function getPathDifficulty(center, p) {\n if(p.length <= 0) return Infinity;\n return p.reduce(function(acc, val) {return acc + getLifeCondition(center, val);}, 0);\n }", "function timeCount(){\n time += 1;\n fill(0,0,0);\n textAlign(LEFT);\n text(`Time: ${time}`, 20, 20);\n if (time % 1000 == 0){\n poleSpeed += 1;\n if (rrate == 5){\n rrate = 5;\n }\n else{\n rrate -= 5;\n }\n }\n}", "function reduceTime() {\n timeLeft = timeLeft - 10;\n}", "function directPath(dir, current, goal, grid) {\r\n var start = current;\r\n var pth = [];\r\n // console.log(\"going from: \" + current + \" to \" + goal);\r\n while (start != goal) { \r\n switch (dir) {\r\n case \"left\" :\r\n // move only when it's not hitting a wall && it's an empty spot, or our goal\r\n if (start[1] > 0 && grid[start[0]][start[1] - 1] == 0 || (start[1] - 1 == goal[1] && start[0] == goal[0])) {\r\n start[1] --;\r\n // console.log(\"captain, we're moving left\");\r\n pth.push(start); // add to current path\r\n } else {\r\n return pth;\r\n }\r\n break;\r\n case \"right\" :\r\n if (start[1] <= grid[1].length && grid[start[0]][start[1] + 1] == 0 || (start[1] + 1 == goal[1] && start[0] == goal[0])) {\r\n start[1] ++;\r\n pth.push(start);\r\n } else {\r\n return pth;\r\n }\r\n break;\r\n case \"up\" :\r\n if (start[0] > 0 && grid[start[0] - 1][start[0]] == 0 || (start[0] - 1 == goal[0] && start[1] == goal[1])) {\r\n start[0] --;\r\n // console.log(\"moving up\");\r\n pth.push(start); // add to current path\r\n } else {\r\n return pth;\r\n }\r\n break;\r\n case \"down\" :\r\n if (start[0] < grid[0].length && grid[start[0] + 1][start[0]] == 0 || (start[0] + 1 == goal[0] && start[1] == goal[1])) {\r\n start[0] ++;\r\n // console.log(\"moving down\");\r\n pth.push(start); // add to current path\r\n } else {\r\n return pth;\r\n }\r\n break;\r\n default :\r\n return;\r\n }\r\n }\r\n if (start == end) {\r\n pth.push(start);\r\n return pth;\r\n }\r\n \r\n}", "function execEditLength() {\n\t for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n\t var basePath = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;\n\t var addPath = bestPath[diagonalPath - 1],\n\t removePath = bestPath[diagonalPath + 1],\n\t _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\t if (addPath) {\n\t // No one else is going to attempt to use this value, clear it\n\t bestPath[diagonalPath - 1] = undefined;\n\t }\n\n\t var canAdd = addPath && addPath.newPos + 1 < newLen,\n\t canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n\t if (!canAdd && !canRemove) {\n\t // If this path is a terminal then prune\n\t bestPath[diagonalPath] = undefined;\n\t continue;\n\t }\n\n\t // Select the diagonal that we want to branch from. We select the prior\n\t // path whose position in the new string is the farthest from the origin\n\t // and does not pass the bounds of the diff graph\n\t if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n\t basePath = clonePath(removePath);\n\t self.pushComponent(basePath.components, undefined, true);\n\t } else {\n\t basePath = addPath; // No need to clone, we've pulled it from the list\n\t basePath.newPos++;\n\t self.pushComponent(basePath.components, true, undefined);\n\t }\n\n\t _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);\n\n\t // If we have hit the end of both strings, then we are done\n\t if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n\t return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));\n\t } else {\n\t // Otherwise track this path as a potential candidate and continue.\n\t bestPath[diagonalPath] = basePath;\n\t }\n\t }\n\n\t editLength++;\n\t }", "function execEditLength() {\n\t for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n\t var basePath = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;\n\t var addPath = bestPath[diagonalPath - 1],\n\t removePath = bestPath[diagonalPath + 1],\n\t _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\t if (addPath) {\n\t // No one else is going to attempt to use this value, clear it\n\t bestPath[diagonalPath - 1] = undefined;\n\t }\n\n\t var canAdd = addPath && addPath.newPos + 1 < newLen,\n\t canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n\t if (!canAdd && !canRemove) {\n\t // If this path is a terminal then prune\n\t bestPath[diagonalPath] = undefined;\n\t continue;\n\t }\n\n\t // Select the diagonal that we want to branch from. We select the prior\n\t // path whose position in the new string is the farthest from the origin\n\t // and does not pass the bounds of the diff graph\n\t if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n\t basePath = clonePath(removePath);\n\t self.pushComponent(basePath.components, undefined, true);\n\t } else {\n\t basePath = addPath; // No need to clone, we've pulled it from the list\n\t basePath.newPos++;\n\t self.pushComponent(basePath.components, true, undefined);\n\t }\n\n\t _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);\n\n\t // If we have hit the end of both strings, then we are done\n\t if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n\t return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));\n\t } else {\n\t // Otherwise track this path as a potential candidate and continue.\n\t bestPath[diagonalPath] = basePath;\n\t }\n\t }\n\n\t editLength++;\n\t }", "function execEditLength() {\n\t for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n\t var basePath = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;\n\t var addPath = bestPath[diagonalPath - 1],\n\t removePath = bestPath[diagonalPath + 1],\n\t _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\t if (addPath) {\n\t // No one else is going to attempt to use this value, clear it\n\t bestPath[diagonalPath - 1] = undefined;\n\t }\n\n\t var canAdd = addPath && addPath.newPos + 1 < newLen,\n\t canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n\t if (!canAdd && !canRemove) {\n\t // If this path is a terminal then prune\n\t bestPath[diagonalPath] = undefined;\n\t continue;\n\t }\n\n\t // Select the diagonal that we want to branch from. We select the prior\n\t // path whose position in the new string is the farthest from the origin\n\t // and does not pass the bounds of the diff graph\n\t if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n\t basePath = clonePath(removePath);\n\t self.pushComponent(basePath.components, undefined, true);\n\t } else {\n\t basePath = addPath; // No need to clone, we've pulled it from the list\n\t basePath.newPos++;\n\t self.pushComponent(basePath.components, true, undefined);\n\t }\n\n\t _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);\n\n\t // If we have hit the end of both strings, then we are done\n\t if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n\t return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));\n\t } else {\n\t // Otherwise track this path as a potential candidate and continue.\n\t bestPath[diagonalPath] = basePath;\n\t }\n\t }\n\n\t editLength++;\n\t }", "function execEditLength() {\n\t for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n\t var basePath = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;\n\t var addPath = bestPath[diagonalPath - 1],\n\t removePath = bestPath[diagonalPath + 1],\n\t _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\t if (addPath) {\n\t // No one else is going to attempt to use this value, clear it\n\t bestPath[diagonalPath - 1] = undefined;\n\t }\n\n\t var canAdd = addPath && addPath.newPos + 1 < newLen,\n\t canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n\t if (!canAdd && !canRemove) {\n\t // If this path is a terminal then prune\n\t bestPath[diagonalPath] = undefined;\n\t continue;\n\t }\n\n\t // Select the diagonal that we want to branch from. We select the prior\n\t // path whose position in the new string is the farthest from the origin\n\t // and does not pass the bounds of the diff graph\n\t if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n\t basePath = clonePath(removePath);\n\t self.pushComponent(basePath.components, undefined, true);\n\t } else {\n\t basePath = addPath; // No need to clone, we've pulled it from the list\n\t basePath.newPos++;\n\t self.pushComponent(basePath.components, true, undefined);\n\t }\n\n\t _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);\n\n\t // If we have hit the end of both strings, then we are done\n\t if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n\t return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));\n\t } else {\n\t // Otherwise track this path as a potential candidate and continue.\n\t bestPath[diagonalPath] = basePath;\n\t }\n\t }\n\n\t editLength++;\n\t }", "function calculateStepDistance(steps, midlength) {\n var distanceTravelled = 0, previousTravelled, pathLength = 0;\n var currentCalculatedLocation;\n var increment = 50 * 1.75;//$('#radius').val() * 1.75;\n var pathWalked = 0;\n var pathLeftToWalk = 0;\n var distanceOvershot = 0;\n var searchCount = 0;\n var distanceTravelledThisPath = 0;\n var midlocation = '';\n //console.log('Traversing route steps-midpoint' + midlength); //this is the distance\n for (var i = 0; i < steps.length; i++) {\n //console.log('distance of step i:' + i + ' distance:' + steps[i].distance.value);\n //console.log('step' + i + ' has ' + steps[i].path.length + ' paths');\n var distanceStep = 0;\n pathWalked = 0;\n for (var j = 1; j < steps[i].path.length; j++) {\n //we have to iterate through the length of each path\n //console.log('i,j'+i+':'+j);\n if (j === 1) {\n currentCalculatedLocation = steps[i].path[0];\n }\n pathLength = google.maps.geometry.spherical.computeDistanceBetween(currentCalculatedLocation, steps[i].path[j]);\n distanceTravelledThisPath = 0;\n pathLeftToWalk = pathLength;\n //console.log('distance in path ' + pathLength);\n //case 1 pathLength=100, increment=50\n //case 2 pathLegth 10\n //case 2 step 2 pathLength 42, pathLeftToWalk will be 42-40=2\n pathWalked = 0;\n do {\n //record keeping\n previousTravelled = pathWalked;\n //update the path to walk before incrementing with how far overshot the last iteration\n //console.log('distanceOvershot check' + distanceOvershot + 'pathLeftToWalk' + pathLeftToWalk);\n if (distanceOvershot > 0) {\n pathLeftToWalk = pathLeftToWalk - distanceOvershot;\n //check for midpoint and search circle has to be made evertime the pathWalked is incremented\n //there is two possible iterations with this logic that can happen when this path is first\n //entered, causing the possibility that a search circle and midpoint be missed.\n\n //only time pathLeftToWalk can be <0 is if distanceOvershot >0 and pathLeftToWalk < that.. when first entered.\n if (pathLeftToWalk < 0) {//ok increment>distance\n pathWalked += pathLength;\n distanceOvershot = -pathLeftToWalk;\n } else {\n pathWalked = distanceOvershot;\n distanceOvershot = 0;\n }\n distanceTravelledThisPath += pathWalked;\n } else {\n //we don't want to run this in the first iteration\n pathLeftToWalk = pathLeftToWalk - increment;\n if (pathLeftToWalk < 0) {//ok increment>distance\n pathWalked += (increment + pathLeftToWalk) + distanceOvershot;\n distanceOvershot = -pathLeftToWalk;\n } else {\n //case 1 step 2 pathWalked=50\n //case 2 step\n pathWalked += increment + distanceOvershot;\n distanceOvershot = 0;\n }\n }\n if (midlocation === '' && midlength <= (distanceTravelled + pathWalked)) {\n //displayInfo.midlocation =\n midlocation = google.maps.geometry.spherical.interpolate(currentCalculatedLocation, steps[i].path[j], (midlength - distanceTravelled) / pathLength);\n //console.log('midpoint calculated at ' + midlocation);\n return midlocation;\n }\n //this is old code, we don't have to draw search circles because it's too resource heavy\n if (parseInt((distanceTravelled + pathWalked) / increment, 10) > searchCount) {\n //the pathWalked might have been too far, we want to get it as it steps over the increment in whole units\n /*\n if (pathLeftToWalk < 0) {//if the overshot goes beyond the path, then the search is less than that\n //console.log('CIRCLE pathlength' + pathLength + 'negative overshoot' + distanceOvershot + 'increment' + increment);\n drawCircle(google.maps.geometry.spherical.interpolate(currentCalculatedLocation, steps[i].path[j], ((((searchCount + 1) * increment) - (distanceTravelled + previousTravelled)) / pathLength)), 2);\n } else {\n //console.log('CIRCLE distance ' + pathLength + ' distanceStep:' + pathLeftToWalk + ' prevous walked:' + previousTravelled);\n drawCircle(google.maps.geometry.spherical.interpolate(currentCalculatedLocation, steps[i].path[j], 1 - (pathLeftToWalk / pathLength)), 2);\n }\n */\n searchCount++;\n }\n //console.log('distanceTravelledThisStep:' + pathWalked + ' searchCount:' + searchCount);\n } while (pathLeftToWalk > 0);\n //console.log('-----------------');\n distanceTravelled += pathWalked;\n currentCalculatedLocation = steps[i].path[j];\n }\n\n //console.log('distance travelled:' + distanceTravelled + ' distance travelled this step:' + pathWalked);\n }\n //console.log('distance travelled:' + distanceTravelled);\n}", "updateTime() {\n\t\tlet now = new Date().getTime();\n\t\tlet x = now - this.startTime;\n\t\tlet time = moment.duration(x);\n\t\tthis.elapsedTime = clc.xterm(242)(time.hours() + 'h ') + clc.xterm(242)(time.minutes() + 'm ') + clc.xterm(242)(time.seconds() + 's');\n\t}", "genAllPaths() {\n const startTime = moment.now()\n let iterations = 0\n \n const edges = this.get('edges')\n const root = this.get('root')\n const startNode = root.source\n const endNode = root.target\n\n let open = []\n let paths = []\n let pathObjects = []\n let curr = [startNode] //Not sure if needed\n\n while(curr != null){\n for(let j = 0; j < edges.length; j++){\n if(edges[j].source == curr[curr.length-1] && edges[j].target != startNode && !curr.includes(edges[j].target)){\n let newPath = curr.concat(edges[j].target)\n if(edges[j].target == endNode && edges[j].target != startNode && paths.toString().indexOf(curr.toString()) < 0){\n paths[paths.length] = newPath.copy()\n pathObjects.push({path: newPath.copy(), degredationVariance: Math.abs(this.calcDegredation(newPath) - root.data)})\n }else{\n open[open.length] = newPath.copy()\n }\n }else if(edges[j].target == curr[curr.length-1] && edges[j].source != startNode && !curr.includes(edges[j].source)){\n let newPath = curr.concat(edges[j].source)\n if(edges[j].source == endNode && paths.toString().indexOf(curr.toString()) < 0){\n paths[paths.length] = newPath.copy()\n pathObjects.push({path: newPath.copy(), degredationVariance: Math.abs(this.calcDegredation(newPath) - root.data)})\n }else{\n open[open.length] = newPath.copy()\n }\n }\n iterations++\n }\n if(open.length > 0){\n curr = open.pop()\n }else{\n curr = null\n }\n }\n\n this.setStats({'time': (moment.now() - startTime) /1000, 'iterations': iterations})\n this.set('allPaths', pathObjects.sort(function(a, b) { return a.degredationVariance - b.degredationVariance}))\n }", "function execEditLength() {\n\t for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n\t var basePath = undefined;\n\t var addPath = bestPath[diagonalPath - 1],\n\t removePath = bestPath[diagonalPath + 1],\n\t _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\t if (addPath) {\n\t // No one else is going to attempt to use this value, clear it\n\t bestPath[diagonalPath - 1] = undefined;\n\t }\n\n\t var canAdd = addPath && addPath.newPos + 1 < newLen,\n\t canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n\t if (!canAdd && !canRemove) {\n\t // If this path is a terminal then prune\n\t bestPath[diagonalPath] = undefined;\n\t continue;\n\t }\n\n\t // Select the diagonal that we want to branch from. We select the prior\n\t // path whose position in the new string is the farthest from the origin\n\t // and does not pass the bounds of the diff graph\n\t if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n\t basePath = clonePath(removePath);\n\t self.pushComponent(basePath.components, undefined, true);\n\t } else {\n\t basePath = addPath; // No need to clone, we've pulled it from the list\n\t basePath.newPos++;\n\t self.pushComponent(basePath.components, true, undefined);\n\t }\n\n\t _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);\n\n\t // If we have hit the end of both strings, then we are done\n\t if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n\t return done(buildValues(basePath.components, newString, oldString, self.useLongestToken));\n\t } else {\n\t // Otherwise track this path as a potential candidate and continue.\n\t bestPath[diagonalPath] = basePath;\n\t }\n\t }\n\n\t editLength++;\n\t }", "function elevator_move(current_floor, up){\n if (current_floor > num_of_floors + bottom_floor-1 || current_floor < bottom_floor){\n return;\n }\n var percent = \"-30%\";\n if (up == false){\n percent = \"30%\";\n }\n if (mode >= 0){\n $(\"#floor_num_display\").text(\"Going to floor \" + current_floor);\n $(\"#elevator_door\").css(\"width\",\"100%\");\n $(\"#floor_num_display\").css(\"font-size\",\"20px\")\n clearTimeout(elevator_translate_timer);\n elevator_translate_timer = window.setTimeout(function(){\n $(\".elevatorSpaceAbs\").css(\"transform\",\"translate(0,\" + percent + \")\");\n $(\".elevatorSpaceAbsReal\").css(\"transform\",\"translate(0,\" + percent + \")\");\n }, 1000);\n \n //Realistic\n $(\".elevatorDoorLeft\").css(\"width\",\"87.5px\");\n $(\".elevatorDoorRight\").css(\"width\",\"87px\");\n \n clearTimeout(floor_num_display_timer);\n floor_num_display_timer = window.setTimeout(function(){\n $(\"#floor_num_display\").text(current_floor);\n $(\"#floor_num_display\").css(\"font-size\",\"30px\")\n $(\"#elevator_door\").css(\"width\",\"0%\");\n \n //Realistic\n $(\"#floor_num_display_real\").text(current_floor);\n $(\"#floor_num_display_real\").css(\"font-size\",\"30px\")\n $(\".elevatorDoorLeft\").css(\"width\",\"0px\");\n $(\".elevatorDoorRight\").css(\"width\",\"0px\");\n },3000);\n }\n \n \n \n \n clearTimeout(elevator_translate_timer);\n elevator_translate_timer = window.setTimeout(function(){\n $(\".elevatorSpaceAbs\").css(\"transform\",\"translate(0,0)\");\n $(\".elevatorSpaceAbsReal\").css(\"transform\",\"translate(0,0)\");\n if (current_floor <= num_of_floors + bottom_floor - 1 && current_floor >= bottom_floor){\n $(\".floor_title\").text(floor_names[current_floor - bottom_floor])\n }\n else{\n $(\".floor_title\").text(\"You are at nowhere...\")\n }\n }, 2000);\n}", "evaluateScore(path){\n var pathScore = 0;\n\n if(this.game.gameData.gameMode == \"DOTS\"){\n\n pathScore = path.hexesInPath.length + path.additionalHexes.size;\n if(path.currentConstellation!= false){\n console.log(path.currentConstellation);\n pathScore+=path.currentConstellation.assocConstellation.getScoreMod();\n }\n }else{\n var scorePerHex = 1;\n\n if(path.isLoop){\n if(path.hexesInPath.length>3){\n pathScore += 3;\n }else{\n pathScore+=1;\n }\n\n }\n for(var i = 0; i<path.hexesInPath.length; i++){\n pathScore+= scorePerHex;\n }\n pathScore += (5* path.getNumDifferentInLoop());\n\n }\n return pathScore;\n\n\n }", "function viewGameProgression(){\n\t\t\tvar clearPercentage = Math.floor((playerStats.movesMade)/(ROWS*COLS -playerStats.totalMines) *100);\n\t\t\tconsole.log(playerStats.movesMade, clearPercentage)\n\t\t\treturn(clearPercentage);\n\n\t\t}", "function speedInfo() {\n if (currentTimer === 244 || currentTimer === 154 || currentTimer === 64) {\n gameInProgress.append('<div class=\"speed-up\"></div>');\n $('.speed-up')\n .delay(10000)\n .queue(function () {\n $(this).remove();\n });\n }\n }", "function growingPlant(upSpeed, downSpeed, desiredHeight) {\n let initHeight = 0;\n let days = 0;\n while (initHeight < desiredHeight) {\n console.log(initHeight);\n initHeight += upSpeed;\n\n if (initHeight < desiredHeight) {\n initHeight -= downSpeed;\n }\n\n days++;\n }\n return days;\n}", "function GetPath() : int {\n\t\tnumberOfHops = 0; \n\t\tvar ToMovePos : int; \n\t\tvar i : int = 0;\n\t\tfor(var a : int = 0; a < ClosedNodes.Length; a++){ \n\t\t\tif (ClosedNodes[a] != 0){ \n\t\t\t\ti++; \n\t\t\t\t//Debug.Log(parent_Closed[a]+\" \"+ClosedNodes[a]);\n\t\t\t\t } }\n\t\tvar match_name = targetLeaf;\n\t\tfor(var b : int = (i-1); b >= 0 ; b--){\n\t\t\tif (ClosedNodes[b] == match_name){\n\t\t\t\tnumberOfHops++;\n\t\t\t\t//Debug.Log(parent_Closed[b]);\n\t\t\t\tmatch_name = parent_Closed[b];\n\t\t\t\tif (match_name == frogLeaf ){\n\t\t\t\t\tToMovePos = ClosedNodes[b];\n\t\t\t\t\tb = -20;\n\t\t\t\t\t//Debug.Log(\"ToMovePos \"+ToMovePos);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ToMovePos;\n\t}", "function go() {\r\n //removes directions\r\n $(\"#start\").remove();\r\n $(\"#dir1\").remove();\r\n $(\"#dir2\").remove();\r\n $(\"#dir3\").remove();\r\n $(\"#dir4\").remove();\r\n $(\"#dir5\").remove();\r\n $(\"#dir6\").remove();\r\n $(\"#dir7\").remove();\r\n $(\"#dir8\").remove();\r\n $(\"#dir9\").remove();\r\n $(\"#dir10\").remove();\r\n $(\"#dir11\").remove();\r\n $(\"#dir12\").remove();\r\n $(\"br\").remove();\r\n \r\n $(\"#directions\").css(\"margin-bottom\", \"5vh\");\r\n \r\n update(\"#title\", \"Memorize!\");\r\n \r\n setDimensions();\r\n //starts the countdown timer\r\n var time = 0;\r\n var timeInterval = setInterval(function () {\r\n update(\"#output\", (10 - (time / 1000)).toFixed(2).toString());\r\n time += 10;\r\n if (time >= 10000) {\r\n timeRanOut = true;\r\n $(\"#output\").css(\"font-size\", (10 * 0.25).toString() + \"vw\");\r\n $(\"button\").css(\"color\", \"rgba(0, 0, 0, 0)\");\r\n $(\"button\").text(\"E\");\r\n update(\"#title\", \"Click the squares in numerical order!\");\r\n clearInterval(timeInterval);\r\n //starts the timer to record how long it takes to win\r\n var countUp = setInterval(function () {\r\n $(\"#output\").css(\"font-size\", (10 * 0.25).toString() + \"vw\");\r\n if(hasWon) {\r\n update(\"#output\",\"Misses: \" + misses.toString() + \" | Top Streak: \" + streak.toString() + \" | Time: \" + (counter/1000).toFixed(2).toString());\r\n clearInterval(countUp);\r\n } else {\r\n counter += 10;\r\n update(\"#output\",\"Misses: \" + misses.toString() + \" | Top Streak: \" + streak.toString() + \" | Time: \" + (counter/1000).toFixed(2).toString());\r\n //stop counting at 5 minutes\r\n if (counter >= 300000) {\r\n counter = 300000;\r\n update(\"#output\",\"Misses: \" + misses.toString() + \" | Top Streak: \" + streak.toString() + \" | Time: \" + (counter/1000).toFixed(2).toString() + \"+\");\r\n }\r\n }\r\n }, 10);\r\n }\r\n }, 10);\r\n\r\n //this makes the numbers appear in the buttons one after the other in numberical order\r\n var index = 0;\r\n var interval = setInterval(function () {\r\n index++;\r\n var button = buttons[numbers.findIndex(function (num) {return num == index;})];\r\n $(button).css(\"color\", \"rgba(0, 0, 0, 1)\");\r\n update(button, index.toString());\r\n\r\n if (index == 16) {\r\n clearInterval(interval);\r\n }\r\n }, 200);\r\n}", "function timePassed() {\r\n if (health === 0 || happiness === 0 || hunger === 0) {\r\n clearInterval(timer);\r\n dodo(); \r\n timer =null; \r\n groan();\r\n }\r\n \r\n message();\r\n screen();\r\n i++;\r\n decrease();\r\n changeStar();\r\n changeDonut();\r\n changeHeart();\r\n console.log(i)\r\n console.log(`health: ${health}, happiness: ${happiness}, hunger: ${hunger}`) \r\n }", "function render() {\n var ctx = canvas.getContext(\"2d\");\n ctx.clearRect(0, 0, canvas.clientWidth, canvas.clientHeight);\n var varList = document.getElementsByClassName(\"inner-flex-horiz\");\n //Draw each step of the pathway, including reversible and non-reversible steps\n for (var i = 0; i < enzymeList.length; i++) {\n getDotPos(i);\n //set speed\n if (i === 0) {\n firstRectMidX = xCoords[i] * 75 + (canvas.clientWidth / 2 + 50);\n firstRectMidY = yCoords[i] * 100;\n }\n if (revList[i].toLowerCase() === \"reversible\") {\n var nextX;\n var nextY;\n if (i != enzymeList.length) {\n nextX = xCoords[i+1] * 75 + (canvas.clientWidth / 2 + 50);\n nextY = yCoords[i+1] * 100;\n } else {\n nextX = xCoords[i] * 75 + (canvas.clientWidth / 2 + 50);\n nextY = yCoords[i] * 100;\n }\n revStep(substrateList[i][0], productList[i][0], enzymeList[i],\n xCoords[i] * 75 + (canvas.clientWidth / 2 + 50), yCoords[i] * 100,\n nextX, nextY, ctx, i);\n } else {\n notRevStep(substrateList[i][0], productList[i][0], enzymeList[i],\n xCoords[i] * 75 + (canvas.clientWidth / 2 + 50), yCoords[i] * 100,\n ctx, i);\n }\n if (varList[i].getAttribute(\"drawRect\") === \"true\") {\n ctx.beginPath();\n ctx.rect(highlightRects[i][0], highlightRects[i][1], highlightRects[i][2],\n highlightRects[i][3]);\n ctx.stroke();\n }\n }\n ctx.stroke();\n ctx.closePath();\n ctx.beginPath();\n ctx.fillStyle = \"blue\";\n for (var i = 0; i < dotPositions.length; i++) {\n ctx.moveTo(dotPositions[i][0] + 5, dotPositions[i][1]);\n ctx.arc(dotPositions[i][0], dotPositions[i][1], 5, 0, 2 * Math.PI);\n if (dotPositions[i].length === 4) {\n ctx.moveTo(dotPositions[i][2] + 5, dotPositions[i][3]);\n ctx.arc(dotPositions[i][2], dotPositions[i][3], 5, 0, 2 * Math.PI);\n }\n }\n ctx.fill();\n}", "resolvePath(path, hasLoop){\n if(this.gameOverTriggered){\n return;\n }\n this.exclamationText = \"nice\";\n this.currentPath = undefined;\n if(path.hexesInPath.length ==1){\n path.hexesInPath[0].removeHexFromPathAnim();\n return;\n }\n this.decrementNumMoves();\n this.setScore(this.evaluateScore(path));\n for(var col in path.columnsAffected){\n col = parseInt(col);\n //loop over all of the hexs in the affected columns\n var numBelow = 0;\n //decrement from bottom up\n for(var i = this.boardData[col].length-1; i>=0; i--){\n //if it reaches an undefined one, skip\n if(this.boardData[col][i] == undefined){\n continue;\n }\n //if we are on a row that was removed in the column\n if(path.columnsAffected[col].includes(this.boardData[col][i].index.row)){\n numBelow++;\n this.boardData[col][i].removeFromDict();\n this.boardData[col][i].assocText.destroy();\n this.boardData[col][i].gameObject.destroy();\n\n this.boardData[col][i] = undefined;\n\n\n }else{\n if(numBelow>0){\n this.boardData[col][i].moveDown(numBelow);\n this.boardData[col][i+numBelow] = this.boardData[col][i];\n //make new hexs here\n this.boardData[col][i] = undefined;\n }\n\n\n }\n\n\n }\n for(var i =0; i< numBelow; i++){\n this.boardData[col][i] = new Hex(this, this.initOffset.x + col*this.hexWidth,this.initOffset.y + i*this.vertOffset, ((i%2) * this.hexWidth/2), {row: i, col: col}, this.hexScale, this.game);\n this.boardData[col][i].draw();\n\n this.boardData[col][i].spawnAnim();\n }\n\n }\n\n\n var constTextRef= this.constellationText;\n this.subConstellationText.visible = false;\n this.constellationText.visible = false;\n this.constFadePath.forEach((item, i) => {\n item.visible = true;\n item.setDepth(100);\n item.anims.play(\"CONST_FADE\", false);\n var itemRef = item;\n item.once(Phaser.Animations.Events.SPRITE_ANIMATION_COMPLETE, () => {\n console.log('SPRITE_ANIMATION_COMPLETE')\n constTextRef.visible = false;\n itemRef.destroy();\n })\n\n });\n this.constFadePath = [];\n this.hasConstellation = false;\n }", "function drawPath(percent) {\n\t\t// determines how much of the path is shown\n\t\tpercentLength = pathLength * percent;\n\n\t\t// modify offset to show percentage of path completed\n\t\tpath.style.strokeDashoffset = pathLength - percentLength;\n\t}", "function TravelLHR() {\n\tif(OPC.currentPos >= 0 && // is valid poisition\n\tOPC.currentPos <= 99) {\n\t\tif(gridArr[OPC.currentPos].loot.length != 0) { // there is some thing stored in the loot array for this position\n\t\t\tLoot(); // loot current position\n\t\t\treturn; // skip the rest of the function\n\t\t\t}\n\t\t}\n\tif(OPC.currentPos == -1) {\n\t\tfor(var i = 0; i < gridArr.length; i++) { // find and store the start position and the intial OPC locations\n\t\t\tif(gridArr[i].room == \"ST\"){\n\t\t\t\tOPC.currentPos = i;\n\t\t\t\tOPC.lastPos = i - 10;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tUpdateTileMap();\n\t\treturn;\n\t}\n\tif (gridArr[OPC.currentPos].room == \"ST\") { // check to see if it's time to exit the dungeon\n\t\topenCounter = 0; // open amount on map\n\t\tfor(i = 0; i < gridArr.length; i++) {\n\t\t\tif(gridArr[i].open > 0) {\n\t\t\t\topenCounter ++;\n\t\t\t}\n\t\t}\n\t\texploredCounter = 0; // explored amount on map\n\t\tfor(i = 0; i < gridArr.length; i++) {\n\t\t\tif(gridArr[i].explored > 0) {\n\t\t\t\texploredCounter ++;\n\t\t\t}\n\t\t}\n\t\tif(exploredCounter/openCounter > 0.6) { // if 60% explored, create a new dungeon\n\t\t\tGenerateDungeon();\n\t\t\tfor(var i = 0; i < gridArr.length; i++) { // find and store the start position\n\t\t\t\tif(gridArr[i].room == \"ST\"){\n\t\t\t\t\tOPC.currentPos = i;\n\t\t\t\t\tOPC.lastPos = i - 10;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tUpdateTileMap();\n\t\t\tLongRest();\n\t\t\treturn;\n\t\t}\n\t}\n\tdirectionPriority = 0; // determine which way to go based on the left hand rule\n\tif(OPC.lastPos == OPC.currentPos - 1) {\n\t\tdirectionPriority = 1;\n\t}\n\telse if(OPC.lastPos == OPC.currentPos + 1) {\n\t\tdirectionPriority = 3;\n\t}\n\telse if(OPC.lastPos == OPC.currentPos - 10) {\n\t\tdirectionPriority = 2;\n\t}\n\telse if(OPC.lastPos == OPC.currentPos + 10) {\n\t\tdirectionPriority = 4;\n\t}\n\tnextMove = -1;\n\twhile(nextMove == -1) {\n\t\tswitch(directionPriority){\n\t\t\tcase 1:\n\t\t\t\ttargetPos = OPC.currentPos - 10;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\ttargetPos = OPC.currentPos + 1;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\ttargetPos = OPC.currentPos + 10;\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\ttargetPos = OPC.currentPos - 1;\n\t\t\t\tbreak;\n\t\t}\n\t\ttargetValid = 0;\n\t\tswitch(Math.abs(OPC.currentPos - targetPos)) { // determine between west-east and north-south moves\n\t\t\tcase 1: // west-east\n\t\t\t\tif(Math.floor(targetPos / 10) == Math.floor(OPC.currentPos / 10)) { // valid\n\t\t\t\t\ttargetValid = 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 10: // north-south\n\t\t\t\tif(targetPos >= 0 && targetPos <= 99) { // valid\n\t\t\t\t\ttargetValid = 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t};\n\t\tif(targetValid == 1 && // is a valid space on the grid \n\t\tgridArr[targetPos].open > 0) { // is an open area\n\t\t\tif(gridArr[OPC.currentPos].room == \"SC\") { // OPC is in a secret room\n\t\t\t\tif(gridArr[OPC.currentPos].exit == targetPos) { // target position has the secret door\n\t\t\t\t\tnextMove = targetPos;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(gridArr[targetPos].room != \"SC\") { // target is not a secret room\n\t\t\t\tnextMove = targetPos;\n\t\t\t}\n\t\t\telse if(gridArr[targetPos].room == \"SC\" && // target is a secrect room\n\t\t\tOPC.currentPos == gridArr[targetPos].exit && // current is the secret door for the target secret room\n\t\t\tgridArr[OPC.currentPos].sDoor == 1) { // OPC is at the closed secrect door\n\t\t\t\tdocument.getElementById(\"opc-feedback\").innerHTML=\"Hmm...\";\n\t\t\t\tOPC.encounter = \"investigate\";\n\t\t\t\tUpdateTileMap();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if(gridArr[targetPos].room == \"SC\" && // target is a secrect room\n\t\t\tOPC.currentPos == gridArr[targetPos].exit && // current is the secret door for the target secret room\n\t\t\tgridArr[OPC.currentPos].sDoor == 3) { // OPC is at the open secrect door\n\t\t\t\tUpdateTileMap();\n\t\t\t\tnextMove = targetPos;\n\t\t\t}\n\t\t}\n\t\tdirectionPriority ++;\n\t\tif(directionPriority > 4) {\n\t\t\tdirectionPriority = 1;\n\t\t}\n\t}\n\tgridArr[OPC.currentPos].explored ++;\n\tif(gridArr[OPC.currentPos].explored > 9) { // keep coming back to the same place\n\t\tfor(i = 0; i < gridArr.length; i++) {\n\t\t\tif(gridArr[i].explored > 0) {\n\t\t\t\tgridArr[i].explored = 1;\n\t\t\t}\n\t\t}\n\t\tAssignPathValue(); // find a path to the exit\n\t\tOPC.goal = \"exit\"; // head back to the exit\n\t}\n\telse {\n\t\tTravelMove(nextMove);\n\t}\n}", "function motion() {\r\n\t// update time\r\n\tlet d = new Date();\r\n\tlet timeElapsed = d.getTime() - n - instructionDisplayTime;\r\n\t\r\n\tif (timeElapsed > 0) {\r\n\t\r\n\t\t// check if need to display text (130000 means 13s, 10s for each \r\n\t\t// level, 3s for display text)\r\n\t\tif (timeElapsed > (levelTime - 50) + curretLevels*(levelTime + waitLevelTime)) {\r\n\t\t\t// console.log(\"movingballs called curretLevels: \" + curretLevels)\r\n\t\t\tlevelText.alpha = 100;\r\n\t\t};\r\n\t\t\r\n\t\tif (rewardCollided() && rewardPresent){\r\n\t\t\tapp.stage.removeChild(reward);\r\n\t\t\tscale = scale * 2;\r\n\t\t\trewardPresent = false;\r\n\t\t\t// TODO: add a double score message to the screen\r\n\t\t};\r\n\t\t\r\n\t\t// update text\r\n\t\tlet xCo = playerBall.x.toString();\r\n\t\tlet yCo = playerBall.y.toString();\r\n\t\tplayerInfoText.text = \"X: \" + xCo + \" Y: \" + yCo + \" V: \" + playerBallVelocity;\r\n\t\t\r\n\t\t//update score and time\r\n\t\tscoreText.text = \"Score: \" + (timeElapsed - curretLevels*waitLevelTime) * scale;\r\n\t\ttimeText.text = \"Time: \" + \r\n\t\t(1 + Math.floor((timeElapsed - curretLevels*waitLevelTime)/ 1000)) + \"s\";\r\n\t\tlevelInfoText.text = \"Level: \" + (curretLevels + 1);\r\n\t\t\r\n\t\t// update red balls' position\r\n\t\tfor (let j = 0; j < allGraphic.length; j++) {\r\n\t\t\tlet xPos = allGraphic[j].x + allGraphicVelocity[j][0];\r\n\t\t\tlet yPos = allGraphic[j].y + allGraphicVelocity[j][1];\r\n\t\t\tif (xPos > xSize || xPos < 0) {\r\n\t\t\t\tallGraphicVelocity[j][0] = -allGraphicVelocity[j][0];\r\n\t\t\t};\r\n\t\t\tif (yPos > ySize || yPos < 0) {\r\n\t\t\t\tallGraphicVelocity[j][1] = -allGraphicVelocity[j][1];\r\n\t\t\t};\r\n\t\t\tallGraphic[j].x += allGraphicVelocity[j][0];\r\n\t\t\tallGraphic[j].y += allGraphicVelocity[j][1];\r\n\t\t};\r\n\t\t\r\n\t\t// update reward's position\r\n\t\trewardXPos = reward.x;\r\n\t\trewardYPos = reward.y;\r\n\t\t//console.log(\"x: \", rewardXPos);\r\n\t\t//console.log(\"y: \", rewardYPos);\r\n\t\tif (rewardXPos > xSize + 100 || rewardXPos < 0 - 100) {\r\n\t\t\trewardXSpeed = -rewardXSpeed;\r\n\t\t}; \r\n\t\tif (rewardYPos > ySize + 100 || rewardYPos < 0 - 100) {\r\n\t\t\trewardYSpeed = -rewardYSpeed;\r\n\t\t};\r\n\t\treward.x += rewardXSpeed;\r\n\t\treward.y += rewardYSpeed;\r\n\t};\r\n}", "function computeTotalDistance(result) {\n\n //adds the total time for arrival\n var total = 0;\n var myroute = result.routes[0];\n for (var i = 0; i < myroute.legs.length; i++) {\n total += myroute.legs[i].distance.value;\n }\n\n //gets user room number input\n var r = document.getElementById('startroom').value;\n var r2 = document.getElementById('endroom').value;\n\n var dis = (total/1000)*(0.621371/1);//round distance needed to travel\n dis = round(dis,1)//rounds it off\n\n //displays the distance in miles (PERSON USE)\n // document.getElementById('total').innerHTML = dis + ' mi';\n\n //average speed (PERSON USE)\n var spe =1.45;\n // document.getElementById('speed').innerHTML = spe + ' speed';\n\n var at = r.substring(0,1);\n var c=0;\n if(!isEmpty(at)){\n while(!isInt(at)){\n at = r.substring(c,(c+1));\n c++;\n }\n }\n var at2 = r2.substring(0,1);\n var c=0;\n if(!isEmpty(at2)){\n while(!isInt(at2)){\n at2 = r2.substring(c,(c+1));\n c++;\n }\n }\n \n function isInt(value) {\n return !isNaN(value) && \n parseInt(Number(value)) == value && \n !isNaN(parseInt(value, 10));\n }\n\n function isEmpty(str) {\n return (!str || 0 === str.length);\n }\n //seconds for stair (PERSON USE)\n var sps = Number(at) * 0.10;\n var sps2 = Number(at2) * 0.10;\n // document.getElementById('addedTime').innerHTML = sps + ' time added';\n // document.getElementById('time2').innerHTML = sps2 + ' time added';\n // document.getElementById('tot').innerHTML = (sps+sps2) + ' time added';\n\n //time (PERSON USE)\n tim =(total/spe)*(1/60);\n tim = round(tim+sps+sps2,0)\n document.getElementById('time').innerHTML = tim + ' min';\n\n //creates the current time and displays (PERSON USE)\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n a = h + \":\" + m + \":\" + s+\" \"+a;\n\n //round numbers method\n function round(number, precision) {\n var shift = function (number, precision, reverseShift) {\n if (reverseShift) {\n precision = -precision;\n } \n var numArray = (\"\" + number).split(\"e\");\n return +(numArray[0] + \"e\" + (numArray[1] ? (+numArray[1] + precision) : precision));\n };\n return shift(Math.round(shift(number, precision, false)), precision, true);\n }\n //method used to get current time\n function checkTime(i) {\n if( i < 10 ) {\n i = \"0\" + i;\n }\n return i;\n }\n}", "function findPath(world, pathStart, pathEnd)\n\n{\n\n// shortcuts for speed\n\nvar\n\nabs = Math.abs;\n\nvar\n\nmax = Math.max;\n\nvar\n\npow = Math.pow;\n\nvar\n\nsqrt = Math.sqrt;\n\n\n// the world data are integers:\n\n// anything higher than this number is considered blocked\n\n// this is handy is you use numbered sprites, more than one\n\n// of which is walkable road, grass, mud, etc\n\nvar maxWalkableTileNum = 0;\n\n\n// keep track of the world dimensions\n\n // Note that this A-star implementation expects the world array to be square:\n\n// it must have equal height and width. If your game world is rectangular,\n\n// just fill the array with dummy values to pad the empty space.\n\nvar worldWidth = world[0].length;\n\nvar worldHeight = world.length;\n\nvar worldSize =\n\nworldWidth * worldHeight;\n\n\n// which heuristic should we use?\n\n// default: no diagonals (Manhattan)\n\nvar distanceFunction = ManhattanDistance;\n\nvar findNeighbours = function(){}; // empty\n\n\n\n// alternate heuristics, depending on your game:\n\n\n// diagonals allowed but no sqeezing through cracks:\n\nvar distanceFunction = DiagonalDistance;\n\nvar findNeighbours = DiagonalNeighbours;\n\n\n\n\n/*\n\n// diagonals and squeezing through cracks allowed:\n\nvar distanceFunction = DiagonalDistance;\n\nvar findNeighbours = DiagonalNeighboursFree;\n\n\n// euclidean but no squeezing through cracks:\n\nvar distanceFunction = EuclideanDistance;\n\nvar findNeighbours = DiagonalNeighbours;\n\n\n// euclidean and squeezing through cracks allowed:\n\nvar distanceFunction = EuclideanDistance;\n\nvar findNeighbours = DiagonalNeighboursFree;\n\n\n*/\n\n\n// distanceFunction functions\n\n// these return how far away a point is to another\n\n\nfunction ManhattanDistance(Point, Goal)\n\n{\n\n// linear movement - no diagonals - just cardinal directions (NSEW)\n\nreturn abs(Point.x - Goal.x) + abs(Point.y - Goal.y);\n\n}\n\n\nfunction DiagonalDistance(Point, Goal)\n\n{\n\n// diagonal movement - assumes diag dist is 1, same as cardinals\n\nreturn max(abs(Point.x - Goal.x), abs(Point.y - Goal.y));\n\n}\n\n\nfunction EuclideanDistance(Point, Goal)\n\n{\n\n// diagonals are considered a little farther than cardinal directions\n\n// diagonal movement using Euclide (AC = sqrt(AB^2 + BC^2))\n\n// where AB = x2 - x1 and BC = y2 - y1 and AC will be [x3, y3]\n\nreturn sqrt(pow(Point.x - Goal.x, 2) + pow(Point.y - Goal.y, 2));\n\n}\n\n\n// Neighbours functions, used by findNeighbours function\n\n// to locate adjacent available cells that aren't blocked\n\n\n// Returns every available North, South, East or West\n\n// cell that is empty. No diagonals,\n\n// unless distanceFunction function is not Manhattan\n\nfunction Neighbours(x, y)\n\n{\n\nvar\n\nN = y - 1,\n\nS = y + 1,\n\nE = x + 1,\n\nW = x - 1,\n\nmyN = N > -1 && canWalkHere(x, N),\n\nmyS = S < worldHeight && canWalkHere(x, S),\n\nmyE = E < worldWidth && canWalkHere(E, y),\n\nmyW = W > -1 && canWalkHere(W, y),\n\nresult = [];\n\nif(myN)\n\nresult.push({x:x, y:N});\n\nif(myE)\n\nresult.push({x:E, y:y});\n\nif(myS)\n\nresult.push({x:x, y:S});\n\nif(myW)\n\nresult.push({x:W, y:y});\n\nfindNeighbours(myN, myS, myE, myW, N, S, E, W, result);\n\nreturn result;\n\n}\n\n\n// returns every available North East, South East,\n\n// South West or North West cell - no squeezing through\n\n// \"cracks\" between two diagonals\n\nfunction DiagonalNeighbours(myN, myS, myE, myW, N, S, E, W, result)\n\n{\n\nif(myN)\n\n{\n\nif(myE && canWalkHere(E, N))\n\nresult.push({x:E, y:N});\n\nif(myW && canWalkHere(W, N))\n\nresult.push({x:W, y:N});\n\n}\n\nif(myS)\n\n{\n\nif(myE && canWalkHere(E, S))\n\nresult.push({x:E, y:S});\n\nif(myW && canWalkHere(W, S))\n\nresult.push({x:W, y:S});\n\n}\n\n}\n\n\n// returns every available North East, South East,\n\n// South West or North West cell including the times that\n\n// you would be squeezing through a \"crack\"\n\nfunction DiagonalNeighboursFree(myN, myS, myE, myW, N, S, E, W, result)\n\n{\n\nmyN = N > -1;\n\nmyS = S < worldHeight;\n\nmyE = E < worldWidth;\n\nmyW = W > -1;\n\nif(myE)\n\n{\n\nif(myN && canWalkHere(E, N))\n\nresult.push({x:E, y:N});\n\nif(myS && canWalkHere(E, S))\n\nresult.push({x:E, y:S});\n\n}\n\nif(myW)\n\n{\n\nif(myN && canWalkHere(W, N))\n\nresult.push({x:W, y:N});\n\nif(myS && canWalkHere(W, S))\n\nresult.push({x:W, y:S});\n\n}\n\n}\n\n\n// returns boolean value (world cell is available and open)\n\nfunction canWalkHere(x, y)\n\n{\n\nreturn ((world[x] != null) &&\n\n(world[x][y] != null) &&\n\n(world[x][y] <= maxWalkableTileNum));\n\n};\n\n\n// Node function, returns a new object with Node properties\n\n// Used in the calculatePath function to store route costs, etc.\n\nfunction Node(Parent, Point)\n\n{\n\nvar newNode = {\n\n// pointer to another Node object\n\nParent:Parent,\n\n// array index of this Node in the world linear array\n\nvalue:Point.x + (Point.y * worldWidth),\n\n// the location coordinates of this Node\n\nx:Point.x,\n\ny:Point.y,\n\n// the heuristic estimated cost\n\n// of an entire path using this node\n\nf:0,\n\n// the distanceFunction cost to get\n\n// from the starting point to this node\n\ng:0\n\n};\n\n\nreturn newNode;\n\n}\n\n\n// Path function, executes AStar algorithm operations\n\nfunction calculatePath()\n\n{\n\n// create Nodes from the Start and End x,y coordinates\n\nvar\n\nmypathStart = Node(null, {x:pathStart[0], y:pathStart[1]});\n\nvar mypathEnd = Node(null, {x:pathEnd[0], y:pathEnd[1]});\n\n// create an array that will contain all world cells\n\nvar AStar = new Array(worldSize);\n\n// list of currently open Nodes\n\nvar Open = [mypathStart];\n\n// list of closed Nodes\n\nvar Closed = [];\n\n// list of the final output array\n\nvar result = [];\n\n// reference to a Node (that is nearby)\n\nvar myNeighbours;\n\n// reference to a Node (that we are considering now)\n\nvar myNode;\n\n// reference to a Node (that starts a path in question)\n\nvar myPath;\n\n// temp integer variables used in the calculations\n\nvar length, max, min, i, j;\n\n// iterate through the open list until none are left\n\nwhile(length = Open.length)\n\n{\n\nmax = worldSize;\n\nmin = -1;\n\nfor(i = 0; i < length; i++)\n\n{\n\nif(Open[i].f < max)\n\n{\n\nmax = Open[i].f;\n\nmin = i;\n\n}\n\n}\n\n// grab the next node and remove it from Open array\n\nmyNode = Open.splice(min, 1)[0];\n\n// is it the destination node?\n\nif(myNode.value === mypathEnd.value)\n\n{\n\nmyPath = Closed[Closed.push(myNode) - 1];\n\ndo\n\n{\n\nresult.push([myPath.x, myPath.y]);\n\n}\n\nwhile (myPath = myPath.Parent);\n\n// clear the working arrays\n\nAStar = Closed = Open = [];\n\n// we want to return start to finish\n\nresult.reverse();\n\n}\n\nelse // not the destination\n\n{\n\n// find which nearby nodes are walkable\n\nmyNeighbours = Neighbours(myNode.x, myNode.y);\n\n// test each one that hasn't been tried already\n\nfor(i = 0, j = myNeighbours.length; i < j; i++)\n\n{\n\nmyPath = Node(myNode, myNeighbours[i]);\n\nif (!AStar[myPath.value])\n\n{\n\n// estimated cost of this particular route so far\n\nmyPath.g = myNode.g + distanceFunction(myNeighbours[i], myNode);\n\n// estimated cost of entire guessed route to the destination\n\nmyPath.f = myPath.g + distanceFunction(myNeighbours[i], mypathEnd);\n\n// remember this new path for testing above\n\nOpen.push(myPath);\n\n// mark this node in the world graph as visited\n\nAStar[myPath.value] = true;\n\n}\n\n}\n\n// remember this route as having no more untested options\n\nClosed.push(myNode);\n\n}\n\n} // keep iterating until the Open list is empty\n\nreturn result;\n\n}\n\n\n// actually calculate the a-star path!\n\n// this returns an array of coordinates\n\n// that is empty if no path is possible\n\nreturn calculatePath();\n\n\n\n\n} // end of findPath() function", "async function traverseGraph(algorithm) {\n\tinProgress = true;\n\tclearBoard (keepWalls = true);\n\tvar startTime = Date.now();\n\tvar pathFound = executeAlgo();\n\tvar endTime = Date.now();\n\tawait animateCells();\n\tif(pathFound) {\n\t\tupdateResults((endTime - startTime),true,countLength());\n\t}\n\telse {\n\t\tupdateResults((endTime - startTime),false,countLength());\n\t}\n\tinProgress = false;\n\tjustFinished = true;\n}", "function GetPath2() : int {\n\t\tnumberOfHops = 0; \n\t\tnumberOfHops1 = 0; \n\t\tvar ToMovePos : int; \n\t\tvar ToMovePos2 : int; \n\n\t\tvar i : int = 0;\n\t\tfor(var a : int = 0; a < ClosedNodes.Length; a++){ \n\t\t\tif (ClosedNodes[a] != 0){ \n\t\t\t\ti++; \n\t\t\t\t//Debug.Log(parent_Closed[a]+\" \"+ClosedNodes[a]);\n\t\t\t\t} }\n\n\t\tvar match_name = targetLeaf;\n\t\tfor(var b : int = (i-1); b >= 0 ; b--){\n\t\t\tif (ClosedNodes[b] == match_name){\n\t\t\t\tnumberOfHops++;\n\t\t\t\tmatch_name = parent_Closed[b];\n\t\t\t\tif (match_name == frogLeaf ){\n\t\t\t\t\tToMovePos = ClosedNodes[b];\n\t\t\t\t\tb = -20;\n\t\t\t\t\t//Debug.Log(\"ToMovePos \"+ToMovePos);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t\tvar match_name2 = targetLeaf2;\n\t\t\tfor(var c : int = (i-1); c >= 0 ; c--){\n\t\t\tif (ClosedNodes[c] == match_name2){\n\t\t\t\tnumberOfHops1++;\n\t\t\t\t//Debug.Log(parent_Closed[b]);\n\t\t\t\tmatch_name2 = parent_Closed[c];\n\t\t\t\tif (match_name2 == frogLeaf ){\n\t\t\t\t\tToMovePos2 = ClosedNodes[c];\n\t\t\t\t\tc = -20;\n\t\t\t\t\t//Debug.Log(\"ToMovePos \"+ToMovePos);\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\n\t\tif (numberOfHops1 !=0){\n\t\t\tif (numberOfHops1 < numberOfHops){\n\t\t\t\t//Debug.Log(\"ToMovePos2 \"+ToMovePos2);\n\t\t\t\treturn ToMovePos2;\n\t\t\t\t}\n\t\t\telse if(numberOfHops !=0){\n\t\t\t\t\t//Debug.Log(\"ToMovePos \"+ToMovePos); \n\t\t\t\t\treturn ToMovePos;\n\t\t\t\t\t}\n\t\t\t\t else{\n\t\t\t\t \t//Debug.Log(\"ToMovePos2 \"+ToMovePos2); \n\t\t\t\t \treturn ToMovePos2;\n\t\t\t\t \t}\n\t\t\t}\n\t\telse {\n\t\t\t//Debug.Log(\"ToMovePos \"+ToMovePos); \n\t\t\treturn ToMovePos;\n\t\t\t}\n\t}", "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath = /*istanbul ignore start*/void 0;\n var addPath = bestPath[diagonalPath - 1],\n removePath = bestPath[diagonalPath + 1],\n _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen,\n canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n }\n\n // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);\n\n // If we have hit the end of both strings, then we are done\n if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n }", "function calculatePath() {\n\t // create Nodes from the Start and End x,y coordinates\n\t var mypathStart = Node(null, { x: pathStart[0], y: pathStart[1] });\n\t var mypathEnd = Node(null, { x: pathEnd[0], y: pathEnd[1] });\n\t // create an array that will contain all world cells\n\t var AStar = new Array(worldSize);\n\t // list of currently open Nodes\n\t var Open = [mypathStart];\n\t // list of closed Nodes\n\t var Closed = [];\n\t // list of the final output array\n\t var result = [];\n\t // reference to a Node (that is nearby)\n\t var myNeighbours;\n\t // reference to a Node (that we are considering now)\n\t var myNode;\n\t // reference to a Node (that starts a path in question)\n\t var myPath;\n\t // temp integer variables used in the calculations\n\t var length, max, min, i, j;\n\t // iterate through the open list until none are left\n\t while (length = Open.length) {\n\t max = worldSize * 999999;\n\t min = -1;\n\t for (i = 0; i < length; i++) {\n\t if (Open[i].f < max) {\n\t max = Open[i].f;\n\t min = i;\n\t }\n\t }\n\t // grab the next node and remove it from Open array\n\t myNode = Open.splice(min, 1)[0];\n\t // is it the destination node?\n\t if (myNode.value === mypathEnd.value) {\n\t myPath = Closed[Closed.push(myNode) - 1];\n\t do {\n\t result.push([myPath.x, myPath.y]);\n\t } while (myPath = myPath.Parent);\n\t // clear the working arrays\n\t AStar = Closed = Open = [];\n\t // we want to return start to finish\n\t result.reverse();\n\t } else // not the destination\n\t {\n\t // find which nearby nodes are walkable\n\t myNeighbours = Neighbours(myNode.x, myNode.y);\n\t // test each one that hasn't been tried already\n\t for (i = 0, j = myNeighbours.length; i < j; i++) {\n\t myPath = Node(myNode, myNeighbours[i], world[myNeighbours[i].x][myNeighbours[i].y]);\n\t if (!AStar[myPath.value]) {\n\t // estimated cost of this particular route so far\n\t myPath.g += myNode.g + distanceFunction(myNeighbours[i], myNode);\n\t // estimated cost of entire guessed route to the destination\n\t myPath.f = myPath.g + distanceFunction(myNeighbours[i], mypathEnd);\n\t // remember this new path for testing above\n\t Open.push(myPath);\n\t // mark this node in the world graph as visited\n\t AStar[myPath.value] = true;\n\t }\n\t }\n\t // remember this route as having no more untested options\n\t Closed.push(myNode);\n\t }\n\t } // keep iterating until the Open list is empty\n\t return result;\n\t }", "function updateRouteInfo() {\n\tdocument.getElementById(\"console-dest\").innerHTML = nextWaypoint.str;\n\tdocument.getElementById(\"console-nextwpcoords\").innerHTML = nextWaypoint.latitude + \",\" + nextWaypoint.longitude;\n\tdocument.getElementById(\"console-nextwpdir\").innerHTML = nextWaypoint.dir;\n\tdocument.getElementById(\"console-nextwpdist\").innerHTML = nextWaypoint.dist;\n\tupdateNextWaypoint();\n\t\n\tif (countSteps) {\n\t\tif (nextWaypoint.dist < reachDistance) {\n\t\t\treachedNextWaypoint();\n\t\t}\n\t}\n}", "function execEditLength() {\n\t\t\tfor ( var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2 ) {\n\t\t\t\tvar basePath = void 0;\n\n\t\t\t\tvar addPath = bestPath[ diagonalPath - 1 ],\n\t\t\t\t\tremovePath = bestPath[ diagonalPath + 1 ],\n\t\t\t\t\t_oldPos = ( removePath ? removePath.newPos : 0 ) - diagonalPath;\n\n\t\t\t\tif ( addPath ) {\n\t\t\t\t\t// No one else is going to attempt to use this value, clear it\n\t\t\t\t\tbestPath[ diagonalPath - 1 ] = undefined;\n\t\t\t\t}\n\n\t\t\t\tvar canAdd = addPath && addPath.newPos + 1 < newLen,\n\t\t\t\t\tcanRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n\n\t\t\t\tif ( ! canAdd && ! canRemove ) {\n\t\t\t\t\t// If this path is a terminal then prune\n\t\t\t\t\tbestPath[ diagonalPath ] = undefined;\n\t\t\t\t\tcontinue;\n\t\t\t\t} // Select the diagonal that we want to branch from. We select the prior\n\t\t\t\t// path whose position in the new string is the farthest from the origin\n\t\t\t\t// and does not pass the bounds of the diff graph\n\n\t\t\t\tif ( ! canAdd || ( canRemove && addPath.newPos < removePath.newPos ) ) {\n\t\t\t\t\tbasePath = clonePath( removePath );\n\t\t\t\t\tself.pushComponent( basePath.components, undefined, true );\n\t\t\t\t} else {\n\t\t\t\t\tbasePath = addPath; // No need to clone, we've pulled it from the list\n\n\t\t\t\t\tbasePath.newPos++;\n\t\t\t\t\tself.pushComponent( basePath.components, true, undefined );\n\t\t\t\t}\n\n\t\t\t\t_oldPos = self.extractCommon( basePath, newString, oldString, diagonalPath ); // If we have hit the end of both strings, then we are done\n\n\t\t\t\tif ( basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen ) {\n\t\t\t\t\treturn done( buildValues( self, basePath.components, newString, oldString, self.useLongestToken ) );\n\t\t\t\t} else {\n\t\t\t\t\t// Otherwise track this path as a potential candidate and continue.\n\t\t\t\t\tbestPath[ diagonalPath ] = basePath;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\teditLength++;\n\t\t} // Performs the length of edit iteration. Is a bit fugly as this has to support the", "function cycleFinished(){\nif (objsCounter == -1){//first time run-create startpart\n // run only first time and create startparts(2)\n whenstart = Date.now();\n // ----(when, cycle,status)\n addPart(whenstart,0,\"start\");\n addPart(whenstart,sugAvg,\"first-off\");\n partsCounter--;\n PartObj.prototype.partsQty--;\n //console.log('initialised . objsCounter=',objsCounter);\n //timenow varible needed to keep for next, part of \"part\" status\n //to compute then cycle duration\n timenow = Date.now();\n drawGraph();\n importantLog(); \n return;\n}\n\n//compute cycle duration since last part. storing previous and substracting from it timenow to get the cycle time\nprevtime = timenow;\ntimenow = Date.now();\nvar cycletime = timenow - prevtime;\n\n\n//creates different objects for different real world occurences,\n//status is by default \"part\"\n\nif (status=='part')\n {\n addPart(timenow,cycletime,status);\n //console.log('part cycle fin . objsCounter=',objsCounter);\n\n clearAndLog(minmax(cycletime),'L3');\n /* if this is part, checks/sets the new lowest and highest and logs them to screen \n */\n }\n\nelse if (status=='break')\n {\n addBreak(timenow,cycletime,status);\n status='part'; // changes the status since there is no case of \n // taking two breaks in a row\n changeValue(\"Start Break\",'btnbreak');\n changeValue(\"OK\",'btnRUN');\n }\n\n\n \n\ndrawGraph();\n\nimportantLog();\n\nasd(objsList[objsCounter]);// print out last object\n\n}", "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath =\n /*istanbul ignore start*/\n void 0\n /*istanbul ignore end*/\n ;\n\n var addPath = bestPath[diagonalPath - 1],\n removePath = bestPath[diagonalPath + 1],\n _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen,\n canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n } // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n\n\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done\n\n if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n } // Performs the length of edit iteration. Is a bit fugly as this has to support the", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "computeDrawPathBuffers() {\n const buffer = this._pathBuffer;\n let preview,current,next;\n const cList = $objs.cases_s;\n for (let i=0, l=buffer.length; i<l; i++) {\n const preview = buffer[i-1];\n const current = buffer[i ];\n const next = buffer[i+1];\n const preview_id = preview && cList.indexOf(preview);\n const current_id = current && cList.indexOf(current);\n const next_id = next && cList.indexOf(next);\n //TODO: FIXME: compute distance via global position for Math.hypot\n if(preview){\n current.pathConnexion[String(preview_id)] = Math.hypot(preview.x-current.x, preview.y-current.y);\n };\n if(next){\n current.pathConnexion[String(next_id)] = Math.hypot(next.x-current.x, next.y-current.y);\n };\n };\n console.log0('PathsBuffers: ', buffer);\n this._pathBuffer = [];\n this.refreshPath();\n }", "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath = void 0;\n\n var addPath = bestPath[diagonalPath - 1],\n removePath = bestPath[diagonalPath + 1],\n _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen,\n canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n } // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n\n\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done\n\n if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n } // Performs the length of edit iteration. Is a bit fugly as this has to support the", "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath = void 0;\n\n var addPath = bestPath[diagonalPath - 1],\n removePath = bestPath[diagonalPath + 1],\n _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen,\n canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n } // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n\n\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done\n\n if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n } // Performs the length of edit iteration. Is a bit fugly as this has to support the", "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath = void 0;\n\n var addPath = bestPath[diagonalPath - 1],\n removePath = bestPath[diagonalPath + 1],\n _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen,\n canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n } // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n\n\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done\n\n if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n } // Performs the length of edit iteration. Is a bit fugly as this has to support the", "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath = void 0;\n\n var addPath = bestPath[diagonalPath - 1],\n removePath = bestPath[diagonalPath + 1],\n _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen,\n canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n } // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n\n\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done\n\n if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n } // Performs the length of edit iteration. Is a bit fugly as this has to support the", "function userMove() {\n\n if (up) {\n up = false;\n let temp = user.curPosition().aboveConnect();\n if (temp != undefined) {\n if (user.prevPosition() != undefined && temp.equals(user.prevPosition())) {\n drawPathLine(\"white\", user.curPosition(), temp);\n user.path.pop();\n } else {\n drawPathLine(lineColor, user.curPosition(), temp);\n user.path.push(temp);\n }\n countMoves++;\n }\n }\n\n if (down) {\n down = false;\n let temp = user.curPosition().belowConnect();\n if (temp != undefined) {\n if (user.prevPosition() != undefined && temp.equals(user.prevPosition())) {\n drawPathLine(\"white\", user.curPosition(), temp);\n user.path.pop();\n } else {\n drawPathLine(lineColor, user.curPosition(), temp);\n user.path.push(temp);\n }\n countMoves++;\n }\n }\n\n if (right) {\n right = false;\n let temp = user.curPosition().rightConnect();\n if (temp != undefined) {\n if (user.prevPosition() != undefined && temp.equals(user.prevPosition())) {\n drawPathLine(\"white\", user.curPosition(), temp);\n user.path.pop();\n } else {\n drawPathLine(lineColor, user.curPosition(), temp);\n user.path.push(temp);\n }\n countMoves++;\n }\n }\n\n if (left) {\n left = false;\n let temp = user.curPosition().leftConnect();\n if (temp != undefined) {\n if (user.prevPosition() != undefined && temp.equals(user.prevPosition())) {\n drawPathLine(\"white\", user.curPosition(), temp);\n user.path.pop();\n } else {\n drawPathLine(lineColor, user.curPosition(), temp);\n user.path.push(temp);\n }\n countMoves++;\n }\n }\n\n if (user.curPosition().getCoord().equals(coords[coords.length - 1])) {\n errorMessage.innerHTML = \"Congrats! You solved it in \" + countMoves + \" moves!\";\n errorMessage.style.visibility = 'visible';\n showSoln = true;\n }\n}", "function updateScreen(){\t//funcio (bucle) que s'executa per actualitzar l'estat de la pantalla del joc\n\tcuttingSegments();\t//mira si hi ha segments que es creuin\n\tdrawAll();\t\t\t//dibuixa al canvas\n\tupdateState();\t\t//reescriu el nivell i el % completat\n}", "function fullRunnersMotionLogicTimeEscape() {\n\n var firstSeparatorStartX = 0;\n var firstSeparatorStartY = 0;\n var secondSeparatorStartX = 0;\n var secondSeparatorStartY = 0;\n\n // Offsets calculation\n for (var offsets = 0; offsets < howManyAllDigits; offsets++) {\n\n if (offsets == choursDigit_1) {\n // FIRST DIGIT !\n\n for (var fd = 0; fd < animGS.allAsciiCharsData[offsets].allCharDefinitionData.length; fd++) {\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[fd][0].runnerX =\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[fd][0].runnerStartingXBackup + animGS.startingTimeTopLeftOffset;\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[fd][0].runnerY =\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[fd][0].runnerStartingYBackup + animGS.startingTimeTopLeftOffset;\n }\n }\n\n if (offsets == choursDigit_2) {\n // SECOND DIGIT !\n\n for (var sd = 0; sd < animGS.allAsciiCharsData[offsets].allCharDefinitionData.length; sd++) {\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[sd][1].runnerX =\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[sd][1].runnerStartingXBackup + (2 * animGS.startingTimeTopLeftOffset) + animGS.allAsciiCharsData[offsets].oneCharWidth;\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[sd][1].runnerY =\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[sd][1].runnerStartingYBackup + animGS.startingTimeTopLeftOffset;\n\n if (animGS.allAsciiCharsData[offsets].allCharDefinitionData[sd][1].runnerX > firstSeparatorStartX) {\n firstSeparatorStartX = animGS.allAsciiCharsData[offsets].allCharDefinitionData[sd][1].runnerX;\n }\n\n if (animGS.allAsciiCharsData[offsets].allCharDefinitionData[sd][1].runnerY > firstSeparatorStartY) {\n firstSeparatorStartY = animGS.allAsciiCharsData[offsets].allCharDefinitionData[sd][1].runnerY;\n }\n }\n\n // MIDDLE of CHAR-DIGIT\n firstSeparatorStartY /= 2;\n }\n\n if (offsets == cminutesDigit_1) {\n // THIRD DIGIT !\n\n for (var td = 0; td < animGS.allAsciiCharsData[offsets].allCharDefinitionData.length; td++) {\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[td][2].runnerX =\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[td][2].runnerStartingXBackup + (4 * animGS.startingTimeTopLeftOffset) + (2 * animGS.allAsciiCharsData[offsets].oneCharWidth);\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[td][2].runnerY =\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[td][2].runnerStartingYBackup + animGS.startingTimeTopLeftOffset;\n }\n }\n\n if (offsets == cminutesDigit_2) {\n // FOURTH DIGIT !\n\n for (var fod = 0; fod < animGS.allAsciiCharsData[offsets].allCharDefinitionData.length; fod++) {\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[fod][3].runnerX =\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[fod][3].runnerStartingXBackup + (5 * animGS.startingTimeTopLeftOffset) + (3 * animGS.allAsciiCharsData[offsets].oneCharWidth);\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[fod][3].runnerY =\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[fod][3].runnerStartingYBackup + animGS.startingTimeTopLeftOffset;\n\n if (animGS.allAsciiCharsData[offsets].allCharDefinitionData[fod][3].runnerX > secondSeparatorStartX) {\n secondSeparatorStartX = animGS.allAsciiCharsData[offsets].allCharDefinitionData[fod][3].runnerX;\n }\n\n if (animGS.allAsciiCharsData[offsets].allCharDefinitionData[fod][3].runnerY > secondSeparatorStartY) {\n secondSeparatorStartY = animGS.allAsciiCharsData[offsets].allCharDefinitionData[fod][3].runnerY;\n }\n }\n\n // MIDDLE of CHAR-DIGIT\n secondSeparatorStartY /= 2;\n }\n\n if (offsets == csecondsDigit_1) {\n // FIFTH DIGIT !\n\n for (var fthd = 0; fthd < animGS.allAsciiCharsData[offsets].allCharDefinitionData.length; fthd++) {\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[fthd][4].runnerX =\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[fthd][4].runnerStartingXBackup + (7 * animGS.startingTimeTopLeftOffset) + (4 * animGS.allAsciiCharsData[offsets].oneCharWidth);\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[fthd][4].runnerY =\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[fthd][4].runnerStartingYBackup + animGS.startingTimeTopLeftOffset;\n }\n }\n\n if (offsets == csecondsDigit_2) {\n // SIXTH DIGIT !\n\n for (var sxthd = 0; sxthd < animGS.allAsciiCharsData[offsets].allCharDefinitionData.length; sxthd++) {\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[sxthd][5].runnerX =\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[sxthd][5].runnerStartingXBackup + (8 * animGS.startingTimeTopLeftOffset) + (5 * animGS.allAsciiCharsData[offsets].oneCharWidth);\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[sxthd][5].runnerY =\n animGS.allAsciiCharsData[offsets].allCharDefinitionData[sxthd][5].runnerStartingYBackup + animGS.startingTimeTopLeftOffset;\n }\n }\n }\n\n // Time-separators offsets\n var oneSeparatorDownOffset = 0;\n\n for (var timeSep = 0; timeSep < (animGS.runnersTimerSeparators.length / 2); timeSep++) {\n\n // 0,1 for HOUR-MINUTE separators\n animGS.runnersTimerSeparators[timeSep].runnerX = firstSeparatorStartX + animGS.startingTimeTopLeftOffset;\n animGS.runnersTimerSeparators[timeSep].runnerY = firstSeparatorStartY + oneSeparatorDownOffset;\n\n oneSeparatorDownOffset += animGS.startingTimeTopLeftOffset;\n }\n\n oneSeparatorDownOffset = 0;\n\n for (var timeSep2 = (animGS.runnersTimerSeparators.length / 2); timeSep2 < animGS.runnersTimerSeparators.length; timeSep2++) {\n\n // 2,3 for MINUTE-SECOND separators\n animGS.runnersTimerSeparators[timeSep2].runnerX = secondSeparatorStartX + animGS.startingTimeTopLeftOffset;\n animGS.runnersTimerSeparators[timeSep2].runnerY = secondSeparatorStartY + oneSeparatorDownOffset;\n\n oneSeparatorDownOffset += animGS.startingTimeTopLeftOffset;\n }\n // END: Time-separators offsets\n\n // Single digits-indexes-conters\n var d1 = 0;\n var d2 = 0;\n var d3 = 0;\n var d4 = 0;\n var d5 = 0;\n var d6 = 0;\n\n for (var r = 0; r < animGS.runners.length; r++) {\n\n if (checkForBorder(animGS.runners[r]) === true) {\n\n // We hit border AND moved the runner, we can CONTINUE with other runners\n continue;\n }\n\n if (animGS.runners[r].whichTimeDigitLoyal == 1) {\n\n tryToCatchTheEscapingRunner(\n animGS.runners[r], animGS.allAsciiCharsData[choursDigit_1].allCharDefinitionData[d1][animGS.runners[r].whichTimeDigitLoyal - 1], d1);\n\n d1++;\n }\n else if (animGS.runners[r].whichTimeDigitLoyal == 2) {\n\n tryToCatchTheEscapingRunner(\n animGS.runners[r], animGS.allAsciiCharsData[choursDigit_2].allCharDefinitionData[d2][animGS.runners[r].whichTimeDigitLoyal - 1], d2);\n\n d2++;\n }\n else if (animGS.runners[r].whichTimeDigitLoyal == 3) {\n\n tryToCatchTheEscapingRunner(\n animGS.runners[r], animGS.allAsciiCharsData[cminutesDigit_1].allCharDefinitionData[d3][animGS.runners[r].whichTimeDigitLoyal - 1], d3);\n\n d3++;\n }\n else if (animGS.runners[r].whichTimeDigitLoyal == 4) {\n\n tryToCatchTheEscapingRunner(\n animGS.runners[r], animGS.allAsciiCharsData[cminutesDigit_2].allCharDefinitionData[d4][animGS.runners[r].whichTimeDigitLoyal - 1], d4);\n\n d4++;\n }\n else if (animGS.runners[r].whichTimeDigitLoyal == 5) {\n\n tryToCatchTheEscapingRunner(\n animGS.runners[r], animGS.allAsciiCharsData[csecondsDigit_1].allCharDefinitionData[d5][animGS.runners[r].whichTimeDigitLoyal - 1], d5);\n\n d5++;\n }\n else if (animGS.runners[r].whichTimeDigitLoyal == 6) {\n\n tryToCatchTheEscapingRunner(\n animGS.runners[r], animGS.allAsciiCharsData[csecondsDigit_2].allCharDefinitionData[d6][animGS.runners[r].whichTimeDigitLoyal - 1], d6);\n\n d6++;\n }\n else if (animGS.runners[r].whichTimeDigitLoyal == (howManyAllDigits)) { // 1 point of 1 separator\n\n tryToCatchTheEscapingRunner(\n animGS.runners[r], animGS.runnersTimerSeparators[0], 0);\n }\n else if (animGS.runners[r].whichTimeDigitLoyal == (howManyAllDigits + 1)) { // 2 point of 1 separator\n\n tryToCatchTheEscapingRunner(\n animGS.runners[r], animGS.runnersTimerSeparators[1], 1);\n }\n else if (animGS.runners[r].whichTimeDigitLoyal == (howManyAllDigits + 2)) { // 1 point of 2 separator\n\n tryToCatchTheEscapingRunner(\n animGS.runners[r], animGS.runnersTimerSeparators[2], 2);\n }\n else if (animGS.runners[r].whichTimeDigitLoyal == (howManyAllDigits + 3)) { // 2 point of 2 separator\n\n tryToCatchTheEscapingRunner(\n animGS.runners[r], animGS.runnersTimerSeparators[3], 3);\n }\n\n if (animGS.timeDigitsSingleRunnerLittleBitOffsetBehaviourTypes == 1) {\n // NOTE: NOTHING (just for info.)\n }\n else if (animGS.timeDigitsSingleRunnerLittleBitOffsetBehaviourTypes == 2) {\n // Move little bit more\n runnerMoveNormal(animGS.runners[r]);\n }\n else {\n // Move little bit more - but more randomly\n if (Math.random() > Math.random()) {\n runnerMoveNormal(animGS.runners[r]);\n }\n }\n }\n\n // NOTE: If === 0, we DO NOT use any dynamic movement !\n if (animGS.timeDigitsDynamicMovement === 1) {\n // Time-digits dynamic movement 1!\n makeDynamicTimeDigitMovement1();\n }\n else if (animGS.timeDigitsDynamicMovement === 2) {\n // Time-digits dynamic movement 2!\n makeDynamicTimeDigitMovement2();\n }\n else if (animGS.timeDigitsDynamicMovement === 3) {\n // Time-digits dynamic movement 3!\n makeDynamicTimeDigitMovement3();\n }\n else if (animGS.timeDigitsDynamicMovement === 4) {\n // Time-digits dynamic movement 4!\n makeDynamicTimeDigitMovement4();\n }\n else if (animGS.timeDigitsDynamicMovement === 5) {\n // Time-digits dynamic movement 5!\n makeDynamicTimeDigitMovement5();\n }\n else if (animGS.timeDigitsDynamicMovement === 6) {\n // Time-digits dynamic movement 6!\n makeDynamicTimeDigitMovement6();\n }\n else if (animGS.timeDigitsDynamicMovement === 7) {\n // Time-digits dynamic movement 7!\n makeDynamicTimeDigitMovement7();\n }\n else if (animGS.timeDigitsDynamicMovement === 8) {\n // Time-digits dynamic movement 8!\n makeDynamicTimeDigitMovement8();\n }\n else if (animGS.timeDigitsDynamicMovement === 9) {\n // Time-digits dynamic movement 9!\n makeDynamicTimeDigitMovement9();\n }\n else if (animGS.timeDigitsDynamicMovement === 10) {\n // Time-digits dynamic movement 10!\n makeDynamicTimeDigitMovement10();\n }\n else if (animGS.timeDigitsDynamicMovement === 11) {\n // Time-digits dynamic movement 11!\n makeDynamicTimeDigitMovement11();\n }\n else if (animGS.timeDigitsDynamicMovement === 12) {\n\n // RANDOMLY chosen between movements !\n var choseRandomlyDynamicMovement = calcRndGenMinMax(1, 11);\n eval('makeDynamicTimeDigitMovement' + choseRandomlyDynamicMovement.toString() + '();');\n }\n\n // NOTE: We DO NOT search escapist in Woozy Clock version !\n }", "updateTime() {\r\n if (this.state == STATES.play) {\r\n if (this.remain === 0) {\r\n return this.winner();\r\n }\r\n this.time += 0.1; \r\n this.htmlScore.innerHTML = (this.mines-this.flags) +\r\n \" / \" + this.mines + \" \" + this.time.toFixed(1);\r\n }\r\n }", "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath;\n var addPath = bestPath[diagonalPath - 1];\n var removePath = bestPath[diagonalPath + 1];\n var oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen;\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\n\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n } // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n\n\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n oldPos = self.extractCommon(basePath, newArr, oldArr, diagonalPath); // If we have hit the end of both strings, then we are done\n\n if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\n return buildValues(self, basePath.components, newArr, oldArr);\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n }", "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath;\n var addPath = bestPath[diagonalPath - 1];\n var removePath = bestPath[diagonalPath + 1];\n var oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen;\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\n\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n } // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n\n\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n oldPos = self.extractCommon(basePath, newArr, oldArr, diagonalPath); // If we have hit the end of both strings, then we are done\n\n if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\n return buildValues(self, basePath.components, newArr, oldArr);\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n }", "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath;\n var addPath = bestPath[diagonalPath - 1];\n var removePath = bestPath[diagonalPath + 1];\n var oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen;\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\n\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n } // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n\n\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n oldPos = self.extractCommon(basePath, newArr, oldArr, diagonalPath); // If we have hit the end of both strings, then we are done\n\n if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\n return buildValues(self, basePath.components, newArr, oldArr);\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n }", "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath;\n var addPath = bestPath[diagonalPath - 1];\n var removePath = bestPath[diagonalPath + 1];\n var oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen;\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\n\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n } // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n\n\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n oldPos = self.extractCommon(basePath, newArr, oldArr, diagonalPath); // If we have hit the end of both strings, then we are done\n\n if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\n return buildValues(self, basePath.components, newArr, oldArr);\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n }", "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath;\n var addPath = bestPath[diagonalPath - 1];\n var removePath = bestPath[diagonalPath + 1];\n var oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen;\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\n\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n } // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n\n\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n oldPos = self.extractCommon(basePath, newArr, oldArr, diagonalPath); // If we have hit the end of both strings, then we are done\n\n if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\n return buildValues(self, basePath.components, newArr, oldArr);\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n }", "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath;\n var addPath = bestPath[diagonalPath - 1];\n var removePath = bestPath[diagonalPath + 1];\n var oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen;\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\n\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n } // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n\n\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n oldPos = self.extractCommon(basePath, newArr, oldArr, diagonalPath); // If we have hit the end of both strings, then we are done\n\n if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\n return buildValues(self, basePath.components, newArr, oldArr);\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n }" ]
[ "0.6987525", "0.61795187", "0.5930575", "0.5882869", "0.5838576", "0.580843", "0.5793571", "0.57772696", "0.5766943", "0.5657002", "0.5637903", "0.5632606", "0.56216824", "0.56208664", "0.56088674", "0.5597037", "0.5596953", "0.55876577", "0.558611", "0.55437326", "0.5543095", "0.5538658", "0.5525571", "0.5513884", "0.5501376", "0.54806775", "0.54688376", "0.5462493", "0.5456109", "0.54536086", "0.5452597", "0.54431546", "0.5433886", "0.5427628", "0.54238796", "0.5423786", "0.54219043", "0.5421443", "0.53865486", "0.53724957", "0.5372176", "0.5370501", "0.5360245", "0.53488326", "0.53451455", "0.5336772", "0.5332117", "0.53266793", "0.53236187", "0.5316608", "0.53113717", "0.5305702", "0.5298346", "0.5298346", "0.5298346", "0.5298346", "0.52976394", "0.52975774", "0.5290926", "0.5284181", "0.52816314", "0.527758", "0.5275376", "0.52721125", "0.5254694", "0.5252128", "0.5249308", "0.52347785", "0.5234213", "0.5233949", "0.5233915", "0.5223687", "0.5197266", "0.51906735", "0.51898146", "0.51828474", "0.5178852", "0.51783466", "0.5177414", "0.51750535", "0.5173337", "0.5173051", "0.51642275", "0.51635075", "0.51635075", "0.51635075", "0.51629907", "0.5157756", "0.5157756", "0.5157756", "0.5157756", "0.5154733", "0.5144435", "0.51422423", "0.5124583", "0.512327", "0.512327", "0.512327", "0.512327", "0.512327", "0.512327" ]
0.0
-1
LAB 1: A Trip to Woodland Park Zoo Welcome to Lab 1 =) Be sure to read all the comments! All of the instructions are inline with the assignment below. Look for the word TODO in comments. Each TODO will have a description of what is required. To run this file, type the following (in the terminal): node lab1.js and then press enter/return. Instructions for turning this lab in are in the assignment description in Canvas. I'm happy to answer any questions on Slack. / Helper We've implemented a function that will help you sanitycheck your code.
function assert(expression, failureMessage) { if (!expression) { console.log('assertion failure: ', failureMessage); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exercise11() {}", "function exercise07() {}", "function MainFunction()\n{\n 'use strict';\n\n Steps(7);\n\n}", "function puzzle_welcome() {\n return {\n id: \"intro_puzzle\",\n name: \"Welcome to Puzzle Code!\",\n description: \"Collect all the coins on the board.\",\n\n // TODO: add read-only code mirror boxes to the hint\n hint: \n \"<p>\"\n + \"In Puzzle Code there are many <strong>instructions</strong> you \"\n + \"can use to <strong>program</strong> your robot.\"\n + \"</p>\"\n + \"<p>\"\n + \"This level introduces you to <strong>two instructions</strong>: \"\n + keyword(\"move\") + \" and \" + keyword(\"turn\") + \".\"\n + \"</p>\" \n + \"<h3>Move</h3>\"\n + \"<ul>\"\n + \"<li>The \" + keyword(\"move\") + \" instruction moves the \"\n + \"robot forward one square.</li>\"\n + \"<li>The robot can only move forward. It cannot move backwards or \"\n + \"sideways.</li>\"\n + \"<li>\"\n + \"<a target='_blank' href='\"\n + WIKI_URL + \"Move-instruction\"\n + \"'>\"\n + \"Learn more about the \" + keyword_link(\"move\") + \" instruction.\"\n + \"</a></li>\"\n + \"</ul>\"\n + \"<h3>Turn</h3>\"\n + \"<ul>\"\n + \"<li>\" + keyword(\"turn left\") + \" will rotate the robot to the left.\" \n + \"<li>\" + keyword(\"turn right\") + \" will rotate the robot to the right.\"\n + \"<li>\"\n + \"<a target='_blank' href='\"\n + WIKI_URL + \"Turn-instruction\"\n + \"'>\"\n + \"Learn more about the \" + keyword_link(\"turn\") + \" instruction.\"\n + \"</a></li>\"\n + \"</ul>\"\n + \"<h3>Example program</h3>\"\n + \"<pre>\"\n + keyword(\"move\") + \"<br>\"\n + keyword(\"move\") + \"<br>\"\n + keyword(\"turn right\") + \"<br>\"\n + keyword(\"move\")\n + \"</pre>\"\n + \"<p>This program tells the robot to:</p>\"\n + \"<ul>\"\n + \"<li>move forward twice</li>\"\n + \"<li>rotate to the right 90 degrees</li>\"\n + \"<li>move forward once</li>\"\n + \"</ul>\"\n\n ,\n win_conditions: [\n {type: WinCondition.COLLECT_COINS}\n ],\n\n constraints: [],\n\n solutions: [\n \"move\\nmove\\nmove\\nturn left\\nmove\\nmove\\nmove\\nmove\\n\",\n ],\n num_cols: 9,\n num_rows: 7,\n // BUG: this should be programming_bot_id, not index\n programming_bot_index: 0,\n bots : [\n {\n botColor: BotColor.BLUE,\n cellX: 4,\n cellY: 4,\n facing: Direction.UP,\n program: \"move\\nmove\\nturn left\\nmove\\nmove\\n\",\n },\n ],\n coins: [\n {x:0, y:1},\n {x:1, y:1},\n {x:2, y:1},\n {x:3, y:1},\n ],\n // TODO: make it so that you can omit empty properties from a puzzle\n blocks: [],\n traps: [\n //{x:3, y:0}\n ]\n }\n}", "function exercise06() {}", "function run() {\n console.log(\"--------------------------------------------------------------\");\n console.log(\"Fantasy Name Generator\");\n console.log(\"--------------------------------------------------------------\");\n firstName = readline.question(\"What is your first name: \");\n lastName = readline.question(\"What is your last name: \");\n momMaidenName = readline.question(\"What is your mom's maiden name: \");\n cityBorn = readline.question(\"The city you were born: \");\n favoriteColor = readline.question(\"Your favorite color: \");\n street = readline.question(\"The name of the street you live on: \");\n console.log(\"Thank you for answering every question! Please wait one moment.\");\n console.log(\"CALCULATING, PLEASE WAIT...\");\n console.log(\"**************************************************************\");\n console.log(getNewFirstName() + \" \" + getNewLastName() + \", \" + getTitle() + \" of \" + getHonorific());\n console.log(\"**************************************************************\");\n}", "function main() {\n const inputs = [\n ['1 2 N', 'LMLMLMLMM'],\n ['3 3 E', 'MMRMMLMRRM'],\n ['4 1 S', 'MLMLMRMRM'],\n ];\n const grid = new Grid(5, 5);\n\n inputs.forEach(line => {\n const coordinate = line[0].split(' ');\n const x = parseInt(coordinate[0]);\n const y = parseInt(coordinate[1]);\n const direction = coordinate[2];\n const rover = new Rover(x, y, direction, grid);\n rover.move(line[1]);\n rover.print();\n });\n}", "function main(input) {\n \n let newInput = input.replace(/\\r/,\"\").split(\"\\n\");\n \n //write your input logic as per the problem statement.\n\n //first line of input contains number of testcases\n let T = Number(newInput[0]);\n \n for(let t=0; t<T; t++){\n let qIndex = 2*t + (t+1);\n\n //first line of each test case contains the lenth of the Stairs array \n let Q = Number(newInput[qIndex]);\n \n //second line of each test case contains the Q space seperated numbers denoting the stair heights\n let Stairs = newInput[qIndex+1].split(\" \");\n \n //third line of each test case contains the Q space seperated numbers denoting the jump required for each steps.\n let Steps = newInput[qIndex+2].split(\" \");\n \n let output = playGameOfStairs(Q,Stairs,Steps);\n\n console.log(output);\n }\n}", "function puzzle_the_t() {\n return {\n id: \"the_t\",\n name: \"The T\",\n\n // TODO: add link to goto help page\n hint: \n \"<p>\"\n + \"Instead of turning left at the T, turn right. Then use the \"\n + keyword(\"goto\") + \" instruction to keep moving.\"\n + \"<p>\"\n + \"<p>\" + learnMoreGoto() + \"</p>\"\n\n ,\n win_conditions: [\n {type: WinCondition.COLLECT_COINS}\n ],\n\n // TODO: add a constraint that you can only use 4 move instructions\n constraints: {\n \"max_instructions\": 8,\n },\n\n solutions: [\n \"move\\nmove\\nmove\\nturn right\\nstart: move\\ngoto start\\n\",\n ],\n num_cols: 9,\n num_rows: 7,\n // BUG: this should be programming_bot_id, not index\n programming_bot_index: 0,\n bots : [\n {\n botColor: BotColor.BLUE,\n cellX: 4,\n cellY: 5,\n facing: Direction.UP,\n program: \"move\\nmove\\nmove\\nturn left\\nstart: move\\ngoto start\\n\",\n },\n ],\n coins: [\n {x: 4, y: 2},\n {x: 5, y: 2},\n {x: 6, y: 2},\n {x: 7, y: 2},\n\n {x: 4, y: 3},\n {x: 4, y: 4},\n\n\n ],\n // TODO: make it so that you can omit empty properties from a puzzle\n blocks: [\n {x: 0, y: 0},\n {x: 0, y: 1},\n {x: 0, y: 2},\n {x: 0, y: 3},\n {x: 0, y: 4},\n {x: 0, y: 5},\n {x: 0, y: 6},\n\n {x: 1, y: 0},\n {x: 1, y: 1},\n //{x: 1, y: 2},\n {x: 1, y: 3},\n {x: 1, y: 4},\n {x: 1, y: 5},\n {x: 1, y: 6},\n\n {x: 2, y: 0},\n {x: 2, y: 1},\n //{x: 2, y: 2},\n {x: 2, y: 3},\n {x: 2, y: 4},\n {x: 2, y: 5},\n {x: 2, y: 6},\n\n {x: 3, y: 0},\n {x: 3, y: 1},\n //{x: 3, y: 2},\n {x: 3, y: 3},\n {x: 3, y: 4},\n {x: 3, y: 5},\n {x: 3, y: 6},\n\n {x: 4, y: 0},\n {x: 4, y: 1},\n //{x: 4, y: 2},\n //{x: 4, y: 3},\n //{x: 4, y: 4},\n //{x: 4, y: 5},\n {x: 4, y: 6},\n\n {x: 5, y: 0},\n {x: 5, y: 1},\n //{x: 5, y: 2},\n {x: 5, y: 3},\n {x: 5, y: 4},\n {x: 5, y: 5},\n {x: 5, y: 6},\n\n {x: 6, y: 0},\n {x: 6, y: 1},\n //{x: 6, y: 2},\n {x: 6, y: 3},\n {x: 6, y: 4},\n {x: 6, y: 5},\n {x: 6, y: 6},\n\n {x: 7, y: 0},\n {x: 7, y: 1},\n //{x: 7, y: 2},\n {x: 7, y: 3},\n {x: 7, y: 4},\n {x: 7, y: 5},\n {x: 7, y: 6},\n\n {x: 8, y: 0},\n {x: 8, y: 1},\n {x: 8, y: 2},\n {x: 8, y: 3},\n {x: 8, y: 4},\n {x: 8, y: 5},\n {x: 8, y: 6},\n\n ],\n traps: [\n ]\n }\n}", "function experimentSetup() {\n\n\n var tankLeft = draw.polyline([[200, 200],[220, 220],[220, 450],[400, 450],[400, 220],[420, 200]]).fill('none').stroke ({\n \twidth: 3,\n\t}); \n\t\n\tvar incomingPipe = draw.polyline([[300,250],[300,150],[150,150],[150,170],[280,170],[280,250]]).fill('none').stroke ({\n\t\twidth: 3\n\t});\n\t\n\t\n\tvar ductLower = draw.polygon([[400,425],[460,405],[650,405],[710,425],[710,380],[400,380]]).fill('none').stroke ({\n \twidth: 3,\n\t\t\n\t});\n\t\n\n\tvar tankRight = draw.polyline([[690,200],[710,220],[710,450],[890,450],[890,220],[910,200]]).fill('none').stroke ({ \n \twidth: 3\n\t});\n\n\t\tvar verticalPipe1 = draw.polyline([[430,380],[430,220],[445,220],[445,380]]).fill('none').stroke ({ \n \twidth: 3\n\t});\n\t\n\n\n\tvar verticalPipe3 = draw.polyline([[500,380],[500,220],[515,220],[515,380]]).fill('none').stroke ({\n \twidth: 3\n\t});\n\n\n\n\tvar verticalPipe5 = draw.polyline([[570,380],[570,220],[585,220],[585,380]]).fill('none').stroke ({\n \twidth: 3\n\t});\n\n\t\n\t\n\tvar verticalPipe7 = draw.polyline([[640,380],[640,220],[655,220],[655,380]]).fill('none').stroke ({ \n \twidth: 3\n\t});\n\n\n\n\tvar measureTank = draw.polyline([[890,390],[1000,390],[1000,450],[1150,450],[1150,550],[920,550],[920,450],[980,450],[980,410],\t[890,410]]).fill('none').stroke ({\n \n \twidth: 3 \n\t});\n\t\n\n\t\n}", "function displayMessage() {\n // Task 8: Call each of the functions as properties of the imported object.\n // Task 17: Modify each of the function within each of the displayMessage so that they use only the variable name in the function call.\n console.log(countCharacter(\"What is the color of the sky?\", \"t\"));\n console.log(capitalizeFirstCharacterOfWords(\"What is the color of the sky?\"));\n console.log(reverseWord(\"What is the color of the sky?\"));\n console.log(reverseAllWords(\"What is the color of the sky?\"));\n console.log(replaceFirstOccurence(\"What is the color of the sky?\", \"sky\", \"water\"));\n console.log(Mencode(\"What is the color of the sky?\"));\n // Task 13: Use console.log() to display the output of palindrome()) function. You will need to pass the functions a string.\n console.log(palindrome(\"What is the color of the sky?\"));\n console.log(pigLatin(\"What is the color of the sky?\", \"$\"));\n}", "function initializeprogram(){\n hidetape(2);\n hidetape(3);\n cleartape(1);\n tape1edit = new Array(tape1.length);\n copytape(1);//copy the original tape to the editable tape\n loadtape(1);\n if(machine[0].length === 8){\n cleartape(2);\n tape2edit = new Array(tape2.length);\n copytape(2);//copy the original tape to the editable tape\n loadtape(2);\n showtape(2);\n }\n if(machine[0].length === 11){\n cleartape(2);\n tape2edit = new Array(tape2.length);\n copytape(2);//copy the original tape to the editable tape\n loadtape(2);\n showtape(2);\n cleartape(3);\n tape3edit = new Array(tape3.length);\n copytape(3);//copy the original tape to the editable tape\n loadtape(3);\n showtape(3);\n }\n $(\"#statebox\").val(initialstate);\n $(\"#stepsbox\").val(\"0\");\n programfinished = false;\n programRunning = false;\n tapeindex = 0;\n tape2index = 0;\n tape3index = 0;\n steps = 0;\n tupleLength = machine[0].length;\n currentstate = initialstate;\n $(\"#statebox\").removeClass(\"w3-red w3-green\");\n $(\"#machinename\").html(name);\n numberofstates();\n getlinks();\n createcircles(uniquestates);\n \n}", "function setup () {\n createCanvas(screen.width, screen.height); // This is the interface on which the user of the weppage will see the result of whether the current year is a loop year or not.\n}", "function challenge1() {\n\n}", "function challenge1() {\n\n}", "function challenge3() {\n\n}", "function setup() {\n\n noCanvas();\n\n // Selecting the text field and button\n input = select('#textinput');\n button = select('#submit');\n // What to do when button pressed\n button.mousePressed(handleInput);\n\n loadStrings('files/rainbow.txt', fileLoaded);\n\n regexInput = select('#regex');\n globalCheck = select('#global');\n caseCheck = select('#case');\n}", "function main() {\n addHeadings();\n styleTutorialsAndArticles();\n separateAllTutorials();\n}", "function setup() {\n // Task 1a - change our canvas size to 500x500\n createCanvas(500, 500);\n noStroke();\n \n // Task 2a - give random values to our snake and food variables\n// snakeX = random(width);\n// snakeY = \n \n// foodX = ;\n// foodY = ;\n \n}", "function main () {\n var numberOfTests = readline() * 1\n\n if (numberOfTests > MAX_TESTS) {\n numberOfTests = MAX_TESTS\n }\n\n for (var i = 0; i < numberOfTests; i++) {\n var board = parseTestData()\n\n if (!isValidBoard(board)) {\n if (DEBUG_2) {\n console.log('N' + ' (' + board.width + 'x' + board.height + ')') // reject test\n } else {\n console.log('N') // reject test\n }\n } else {\n if (DEBUG_2) {\n console.log('Y' + ' (' + board.width + 'x' + board.height + ')') // accept test\n } else {\n console.log('Y') // accept test\n }\n\n if (DEBUG) {\n drawBoard(board)\n }\n var moves = dummyPlay(board)\n\n for (var m = 0; m < moves.length; m++) {\n var moveString = moves[m][1] + ' ' + moves[m][0]\n\n if (DEBUG) {\n moveString += ' ' + moves[m][2]\n }\n\n if (!DEBUG_2) {\n console.log(moveString)\n }\n }\n }\n }\n}", "function main () {\n\tvar prompt = require('prompt');\n prompt.start();\n console.log (\"\\nInput the business's name and address below, avoiding unit, suite, and floor numbers if applicable \\n\");\n prompt.get(['name', 'address'], function (err, result) {\n googleGetCoord(result.name, result.address, function (res) {\n \tsearchYelp(result.name, result.address, function (res2) {\n \t\tvar undefObj = {'rating': 0, numRatings: 0};\n \t\tvar p = 0;\n \t\tif (res === undefined && res2 === undefined) {\n \t\t\tconsole.log (\"\\nThe business does not have any online presence on the set up APIs\");\n \t\t}\n \t\telse if (res === undefined) {\n \t\t\t p = getPScore (undefObj, res2);\n \t\t}\n \t\telse if (res2 === undefined) {\n \t\t\tp = getPScore(res, undefObj);\n \t\t}\n \t\telse {\n \t\t\tp = getPScore (res, res2);\n \t\t}\n \t\tconsole.log (\"\\nP score:\", p.toFixed(2), \"\\n\")\n \t});\n });\n });\t\n}", "function puzzle_the_square() {\n return {\n id: \"the_square\",\n name: \"The Square\",\n\n // TODO: add link to goto help page\n hint: \n \"<ul>\"\n + \"<li>You want to create a loop using the \" + keyword(\"goto\") + \" \"\n + \"instruction.</li>\"\n + \"<li><strong>Each time the loop executes</strong>, you \"\n + \"want your robot \"\n + \"to pick up <strong>four coins</strong>, and then position itself \"\n + \"so that it can pickup the next four coins.</li>\"\n + \"<li>\" + learnMoreGoto() + \"</li>\"\n + \"</ul>\"\n\n ,\n win_conditions: [\n {type: WinCondition.COLLECT_COINS}\n ],\n\n // TODO: add a constraint that you can only use 4 move instructions\n constraints: {\n \"max_instructions\": 8,\n },\n\n solutions: [\n \"start: move\\nmove\\nmove\\nmove\\nturn right\\ngoto start\"\n ],\n num_cols: 9,\n num_rows: 7,\n // BUG: this should be programming_bot_id, not index\n programming_bot_index: 0,\n bots : [\n {\n botColor: BotColor.BLUE,\n cellX: 2,\n cellY: 1,\n facing: Direction.RIGHT,\n program: \"\",\n },\n ],\n coins: [\n {x:3, y:1},\n {x:4, y:1},\n {x:5, y:1},\n {x:6, y:1},\n {x:6, y:2},\n {x:6, y:3},\n {x:6, y:4},\n {x:6, y:5},\n {x:3, y:5},\n {x:4, y:5},\n {x:5, y:5},\n {x:2, y:2},\n {x:2, y:3},\n {x:2, y:4},\n {x:2, y:5},\n ],\n // TODO: make it so that you can omit empty properties from a puzzle\n blocks: [],\n traps: [\n //{x:3, y:0}\n ]\n }\n}", "function kata29() {\r\n // Your Code Here\r\n}", "function help(){\n console.log(\"1. Addition\");\n console.log('2. Subtraction');\n console.log(\"3. Multiplication\");\n console.log(\"4. Division\");\n console.log(\"5. Check whether a number is even\");\n console.log(\"6. Check whether a number is odd\");\n console.log(\"7. Print the sum of numbers before a given number\");\n console.log(\"8. Square\");\n console.log(\"9. Exit\");\n}", "function instructions() {\n stroke('Black'); fill('White')\n textSize(15)\n const thecopy = `The Chaos Game! by Daniel Reeves and Cantor Soule-Reeves\n\nDrawing with math ${\" \".repeat(35)} (${width}x${height} pixels)\n${noa} attractors, ` +\n`${hub===1 ? \"w/\" : \"w/o\"} a hub, ` +\n`excluding ${cac}, partial teleport ${fracify(pat)}\n\n• SPACE to toggle hyperspeed ⟶\n• CLICK (or R) for new fractal\n• G to regenerate (or 1/2/3/etc for other color schemes)`\n/*\n N to refresh everything but number of attractors\n H to refresh everything but whether there's a hub\n P to refresh everything but the partial teleport\n*/\n text(thecopy, 5, 15)\n const baretitle = rawnamify(noa, hub, cac, pat)\n let title = titlehash[baretitle]\n if (title === undefined) title = `untitled ${baretitle}`\n fill(1, 0, .3); textSize(width < 500 ? 37 :\n width < 640 ? 65 :\n width < 800 ? 68 :\n width < 1000 ? 70 :\n width < 2000 ? 100 : \n width < 3000 ? 150 : 300)\n push()\n textAlign(LEFT, TOP)\n text(`“${title}”`, 5, 160, width-10, height-160)\n pop()\n}", "function Exercise3() {\n\n // Your code here.\n\n}", "function kata31() {\r\n // Your Code Here\r\n}", "function challenge2() {\n\n}", "function Exercise2() {\n\n // Your code here.\n\n}", "function Start() {\n console.log(\n \"%cChecking the functions...\",\n \"background: green; color: white; font-size: 14px;\"\n );\n\n let success = addTextToIntro();\n if (success) {\n console.log(\n \"%cSuccessfully added paragraphs to Intro\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Intro does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success1 = addTextToFolegandros();\n if (success1) {\n console.log(\n \"%cSuccessfully added paragraphs to Folegandros\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Folegandros does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success2 = addTextToAlonissos();\n if (success2) {\n console.log(\n \"%cSuccessfully added paragraphs to Alonissos\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Alonissos does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success3 = addTextToSpetses();\n if (success3) {\n console.log(\n \"%cSuccessfully added paragraphs to Spetses\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Spetses does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success4 = addTextToAmorgos();\n if (success4) {\n console.log(\n \"%cSuccessfully added paragraphs to Amorgos\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Amorgos does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success5 = addTextToSyros();\n if (success5) {\n console.log(\n \"%cSuccessfully added paragraphs to Syros\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Syros does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success6 = addTextToMilos();\n if (success6) {\n console.log(\n \"%cSuccessfully added paragraphs to Milos\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Milos does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success7 = addTextToHydra();\n if (success7) {\n console.log(\n \"%cSuccessfully added paragraphs to Hydra\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Hydra does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success8 = addTextToIthaca();\n if (success8) {\n console.log(\n \"%cSuccessfully added paragraphs to Ithaca\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Ithaca does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success9 = addTextToGavdos();\n if (success9) {\n console.log(\n \"%cSuccessfully added paragraphs to Gavdos\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Gavdos does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n }", "function _main() \n{\n \n\tvar g= new Graph();\n\n\n \n\t// set input graph properties (label, directed etc.)\n\t g.label=\"Exercise 8.4: 7 (Levitin, 3rd edition)\";\n\t g.digraph = true;\n\t// use global input arrays _v and _e to initialize its internal data structures\n \n\tg.read_graph(_v,_e);\n\n\t// use print_graph() method to check graph\n \n\tg.print_graph();\n\t// report connectivity status if available\n\tg.topoSearch(\"dfs\");\n\t\n\t\n\n\t\n\tg.topoSearch(\"bfs\");\n document.write(\"<p>bfs_order: \", g.bfs_out);\n document.write(\"<p>\", g. componentInfoImpl());\n\tg.DfsTC();\n\tdocument.write(\"<p> TC matrix by DFS:<br>\");\n\tfor (var i = 0; i < g.dfsTC.length; i++)\n\t{\n\t\tdocument.write(g.dfsTC[i], \"<br>\");\n\t}\n\tdocument.write(\"<p>TC matrix by Warshall-Floyd:<br>\");\n\tg.warshallFloyd();\n\tfor (var i = 0; i < g.warshallTC.length; i++)\n\t{\n\t\tdocument.write(g.warshallTC[i], \"<br>\");\n\t}\n\t\n\t//check if the graph is DAG (directed acyclic graph)\n\tdocument.write(\"<p>DAG: \", g.isDAG(), \"</p>\");\n\t\n\t//output floyed-distance matrix\n\tg.warshallFloyd();\n\tdocument.write(\"<p>Distance matrix<br>\");\n\n\tfor (var i = 0; i < g.floydD.length; i++)\n\t{\n\t\tdocument.write(g.floydD[i], \"<br>\");\n\t}\n}", "function introduction() {\n\tconsole.log(\"Welcome to Coding at Philz! Let's get started! \\n . \\n . \\n\");\n\tconsole.log(\"You are going to have to blend in! Let's hit your closet! \\n . \\n . \\n\")\t\n}", "function main() {\n\t// process.argv array stores command-line arguments\n\tif (process.argv.length !== 3) {\n\t\tconsole.log(\"Incorrect number of arguments to the program\");\n\t\tconsole.log(\"Usage: node GameOfLife.js inputfilename\");\n\t\tconsole.log(\"Example: node GameOfLife.js blinker.gol\");\n\t\tprocess.exit(1);\n\t}\n\n\t// instantiate GameOfLife object\n\tlet gol = new GameOfLife();\n\n\t// load grid with data from file given on command line\n //the parameter passed into this load grid argument is\n //the filename and is argument 2\n\tgol.loadGrid(process.argv[2]);\n\n\tconsole.log(\"Beginning with grid size \" + gol.rows + \",\" + gol.cols);\n\tconsole.log(gol.toString());\n\n\t// play game\n\twhile (true) {\n\t\tlet line = readlineSync.question(\"Press n (or return) for next generation, i to iterate multiple times,\\n\"\n\t\t\t\t\t\t\t+ \"w to save grid to disk, or q to quit? \");\n\t\tline = line.trim().toLowerCase();\n\n\t\tswitch (line) {\n\t\t\tcase \"n\":\n\t\t\tcase \"\":\n\t\t\t\tgol.mutate();\n\t\t\t\tconsole.log(gol.toString());\n\t\t\t\tbreak;\n\n\t\t\tcase \"i\":\n\t\t\t\tlet num = parseInt(readlineSync.question(\"How many iterations? \"));\n\t\t\t\tfor (let i = 0; i < num; i++) {\n\t\t\t\t\tgol.mutate();\n\t\t\t\t\tconsole.log(gol.toString());\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"w\":\n\t\t\t\tlet filename = readlineSync.question(\"Enter a filename: \");\n\t\t\t\tgol.saveGrid(filename.trim());\n\t\t\t\tconsole.log(\"Grid saved to file \" + filename + \"\\n\");\n\t\t\t\tbreak;\n\n\t\t\tcase \"q\":\n\t\t\t\tconsole.log(\"Exiting program\");\n\t\t\t\tprocess.exit(0);\n\t\t\t\tbreak;\n\t\t}\n\t}\n}", "function puzzle_get_unstuck() {\n return {\n id: \"get_unstuck\",\n name: \"Introducing the goto instruction\",\n\n // TODO: add read-only code mirror boxes to the hint\n hint: \n \"<p>\"\n + \"This level introduces you to <strong>a new instruction</strong>: \"\n + \" the \" + keyword(\"goto\") + \" instruction. \"\n + \"</p>\" \n + \"<h3>Example program</h3>\"\n + \"<pre>\"\n + \"start: \" + keyword(\"move\") + \"<br>\"\n + keyword(\"turn right\") + \"<br>\"\n + keyword(\"goto\") + \" start\"\n + \"</pre>\"\n + \"<p>This program tells the robot to:</p>\"\n + \"<ul>\"\n + \"<li>move forward </li>\"\n + \"<li>turn right</li>\"\n + \"<li>move forward again</li>\"\n + \"<li>turn right again</li>\"\n + \"<li>and so on forever...</li>\"\n + \"</ul>\"\n + \"<h3>How it works</h3>\"\n + \"<ul>\"\n + \"<li>The \" + keyword(\"goto\") + \" instruction tells the robot to \"\n + \"execute <strong>another instruction</strong>, instead of \"\n + \"executing the \" \n + \"instruction that comes next.</li>\"\n + \"<li>To use the \" + keyword(\"goto\") + \" instruction you must \"\n + \"give a <strong><i>label</i></strong> to another instruction.\"\n + \"</li>\"\n + \"<li>You give another instruction a <i>label</i> by prefixing \"\n + \"the instruction with a word followed by the ':' symbol.</li>\"\n + \"<li>In this example, \"\n + \"<pre>\"\n + \"sally: \" + keyword(\"move\")\n + \"</pre>\"\n + \"sally is a label for the \" + keyword(\"move\") + \" instruction.\"\n + \"</li>\"\n + \"<li>The label you give for an instruction doesn't really matter. \"\n + \"It can be almost anything.\"\n + \"</li>\"\n + \"<li>\" + learnMoreGoto() + \"</li>\"\n + \"</ul>\"\n\n ,\n win_conditions: [\n {type: WinCondition.COLLECT_COINS}\n ],\n\n // TODO: add a constraint that you can only use 4 move instructions\n constraints: {\n \"max_instructions\": 2,\n },\n\n solutions: [\n \"start: move\\ngoto start\\n\",\n ],\n num_cols: 9,\n num_rows: 7,\n // BUG: this should be programming_bot_id, not index\n programming_bot_index: 0,\n bots : [\n {\n botColor: BotColor.BLUE,\n cellX: 4,\n cellY: 4,\n facing: Direction.UP,\n program: \"start: turn right\\ngoto start\\n\",\n },\n ],\n coins: [\n {x: 4, y: 1},\n {x: 4, y: 0},\n {x: 4, y: 2},\n {x: 4, y: 3},\n {x: 4, y: 5},\n {x: 4, y: 6},\n ],\n blocks: [\n ],\n traps: [\n ]\n }\n}", "function kata27() {\r\n // Your Code Here\r\n}", "function runProgram() {\n console.log(\"\\n~~~~~~~~~~~~~~~~WELCOME TO LIRI!~~~~~~~~~~~~~~~~~~~\")\n console.log(\"~~~~~~~~~~~~~~~TO START, TYPE IN~~~~~~~~~~~~~~\" + \"\\n1. node liri.js concert-this\" + \"\\n2. node liri.js spotify-this-song\" + \"\\n3. node liri.js movie-this, or \" + \"'\\n4. node liri.js do-what-it-says'\")\n\n}", "function main() {\n\tvar docs;\n\n\tdebug( 'Generating REPL help documentation.' );\n\tcreateHelp();\n\n\tdebug( 'Loading REPL help documentation.' );\n\tdocs = require( HELP_OUTPUT );\n\n\tdebug( 'Generating REPL examples.' );\n\tcreateExamples( docs );\n} // end FUNCTION main()", "function kata22() {\r\n // Your Code Here\r\n}", "function task2() {\n var current_year = 2018;\n var age = prompt(\"Please enter your age\");\n var year_born = console.log(\"You were born in the year of \" + (current_year - age) + \".\");\n \n var study = prompt(\"Enter the number of years you expect to study in the college:\");\n var graduate = console.log(\"You will graduate from Seneca college in the year of \" + (current_year+parseInt(study)) + \".\");\n}", "function start(){\n\t \t// Local variables\n\t \tlet fs = require('fs');\n\t \tlet file = \"test.json\";\n\t \tlet myBoard;\n\t \tlet disc;\n\t \tlet height;\n\t \tlet width;\n\t \tlet turn;\n\t \tlet response;\n\t \tlet p1Disc;\n\t\tlet p2Disc;\n\n\t \tconsole.log('<<<<< Welcom to the game of Othello >>>>>\\n');\n\t \ttry{\n\t \t\tif(fs.existsSync(file))\n\t \t\t{\n\t \t\t\t//if file not empty\n\t \t\t\tif(fs.readFileSync(file) != null)\n\t \t\t\t{\n\t \t\t\t\tlet newBoard = loadFile(file);\n\t \t\t\t\t\n\t \t\t\t\tmyBoard = new board(newBoard.height, newBoard.width);\n\t\t\t\t\tmyBoard.board = newBoard.board;\n\n\t \t\t\t\t// if myBoard is not full\n\t \t\t\t\tif(!(myBoard.isBoardFull()))\n\t \t\t\t\t{\n\t \t\t\t\t\t// ask user if he would like to continue previous game\n\t \t\t\t\t\tresponse = prompt('Would you like to continue the game you saved? Enter Y for Yes or N for No > ').toUpperCase();\n\t \t\t\t\t\t// if yes \n\t \t\t\t\t\tif(response == 'Y')\n\t \t\t\t\t\t{\n\t \t\t\t\t\t\tturn = 1;\n\t \t\t\t\t\t\tdisc = 'B';\n\t \t\t\t\t\t\t// load content of file into board\n\t \t\t\t\t\t\tif(turn == 1){\n\t\t\t\t\t\t\t\tp1Disc = disc;\n\t\t\t\t\t\t\t\tp2Disc = disc == 'W' ? 'B' : 'W';\n\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\tp2Disc = disc;\n\t\t\t\t\t\t\t\tp1Disc = disc == 'W' ? 'B' : 'W';\n\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\n\t \t\t\t\t\t}else if(response == 'N')// if no \n\t \t\t\t\t\t{\n\t \t\t\t\t\t\t//create new game\n\t \t\t\t\t\t\theight = prompt('What height for your board? ');\n\t\t\t\t\t\t\twhile(height < 4)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tconsole.log('\\nHeight is too small\\nPlease enter a number greater than 4 ');\n\t\t\t\t\t\t\t\theight = prompt('What height for your board? ');\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twidth = prompt('\\nWhat width for your board? ');\n\t\t\t\t\t\t\twhile(width < 4)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tconsole.log('\\nWidth is too small\\n Please enter a number greater than 4 ');\n\t\t\t\t\t\t\t\twidth = prompt('What width for your board? ');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// SYNCHRONOUSLY read from keyboard\n\t\t\t\t\t\t\tconsole.log('Creating a board with size ' + height + ' x ' + width + '.');\n\t\t\t\t\t\t\t// Create new board object\n\t\t\t\t\t\t\tmyBoard = new board(height, width);\n\t\t\t\t\t\t\t//saveFile(\"test.json\", myBoard);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tturn = prompt('Enter player to start the game: 1 or 2 ');\n\t\t\t\t\t\t\twhile( turn < 1 || turn >= 3)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tconsole.log('Invalid number entered. Please try again');\n\t\t\t\t\t\t\t\tturn = prompt('Enter player to start the game: 1 or 2 ');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tdisc = prompt('Enter disc color: W for White B for Black ').toUpperCase();\n\t\t\t\t\t\t\twhile(disc != 'W' && disc != 'B')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tconsole.log('Invalid Color. Please try again');\n\t\t\t\t\t\t\t\tdisc = prompt('Enter disc color: W for White B for Black ').toUpperCase();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif(turn == 1){\n\t\t\t\t\t\t\t\tp1Disc = disc;\n\t\t\t\t\t\t\t\tp2Disc = disc == 'W' ? 'B' : 'W';\n\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\tp2Disc = disc;\n\t\t\t\t\t\t\t\tp1Disc = disc == 'W' ? 'B' : 'W';\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}else{\n\t \t\t\theight = prompt('What height for your board? ');\n\t\t\t\twhile(height < 4)\n\t\t\t\t{\n\t\t\t\t\tconsole.log('\\nHeight is too small\\nPlease enter a number greater than 4 ');\n\t\t\t\t\theight = prompt('What height for your board? ');\t\n\t\t\t\t}\n\t\t\t\twidth = prompt('\\nWhat width for your board? ');\n\t\t\t\twhile(width < 4)\n\t\t\t\t{\n\t\t\t\t\tconsole.log('\\nWidth is too small\\n Please enter a number greater than 4 ');\n\t\t\t\t\twidth = prompt('What width for your board? ');\t\n\t\t\t\t}\n\n\t\t\t\t// SYNCHRONOUSLY read from keyboard\n\t\t\t\tconsole.log('Creating a board with size ' + height + ' x ' + width + '.');\n\t\t\t\t// Create new board object\n\t\t\t\tmyBoard = new board(height, width);\n\t\t\t\t//saveFile(file, myBoard);\n\n\t\t\t\tturn = prompt('Enter player to start the game: 1 or 2 ');\n\t\t\t\twhile( turn < 1 || turn >= 3)\n\t\t\t\t{\n\t\t\t\t\tconsole.log('Invalid number entered. Please try again');\n\t\t\t\t\tturn = prompt('Enter player to start the game: 1 or 2 ');\n\t\t\t\t}\n\n\t\t\t\tdisc = prompt('Enter disc color: W for White B for Black ').toUpperCase();\n\t\t\t\twhile(disc != 'W' && disc != 'B')\n\t\t\t\t{\n\t\t\t\t\tconsole.log('Invalid Color. Please try again');\n\t\t\t\t\tdisc = prompt('Enter disc color: W for White B for Black ').toUpperCase();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(turn == 1){\n\t\t\t\t\tp1Disc = disc;\n\t\t\t\t\tp2Disc = disc == 'W' ? 'B' : 'W';\n\t\t\t\t}else {\n\t\t\t\t\tp2Disc = disc;\n\t\t\t\t\tp1Disc = disc == 'W' ? 'B' : 'W';\n\t\t\t\t}\n\t \t\t}\n\t \t}catch(err){\n\t \t\tconsole.log(\"AN ERROR OCCURRED!\");\n\t \t\tconsole.error(err);\n\t \t}\n\t \t\n\t\tconsole.log('Player 1: ' + p1Disc + ' Player 2: ' + p2Disc +'\\n');\n\t\tconsole.log('Player ' + turn + ' starts the game...\\n');\n\n\t\t// Loop, asking user input, calling appropriate functions.\n\t\tlet row;\n\t\tlet col;\n\t\t//console.log(typeof myBoard);\n\t\twhile(!myBoard.isGameOver())\n\t\t{\n\t\t\tmyBoard.printBoard();\n\t\t\tif(!(myBoard.isValidMoveAvailable((turn == 1) ? p1Disc : p2Disc)))\n\t\t\t{\n\t\t\t\tconsole.log('No valid moves available for player ' + turn + '. You lose your turn.\\n');\n\t\t\t}else{\n\t\t\t\tdo{\n\t\t\t\t\tconsole.log('Turn> Player ' + turn + '(' + ((turn == 1) ? p1Disc : p2Disc) + ')');\n\t\t\t\t\trow = prompt('Enter row to place your disc:');\n\t\t\t\t\tcol = prompt('Enter col to place your disc:');\n\t\t\t\t\t\n\t\t\t\t\tif(row < 1 || row > width || col < 1 || col > height)\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.log('Sorry, invalid input. Try again. \\n');\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\trow--; // adjust it for zero-indexed array of board\n\t\t\t\t\tcol--; // adjust it for zero-indexed array of boardelse if(!myBoard.isValid(row, col, ((turn == 1) ? p1Disc : p2Disc)))\n\t\t\t\t\tif(!myBoard.isValid(row, col, (turn == 1 ? p1Disc : p2Disc))){\n\t\t\t\t\t\tconsole.log('Sorry, that is not a valid move. Try again');\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}while(true);\n\t\t\t\tmyBoard.placeDiskAt(row,col,((turn == 1) ? p1Disc : p2Disc));\n\t\t\t\tsaveFile(file, myBoard);\n\t\t\t}\n\t\t\tturn = (turn == 1) ? 2 : 1;\n\t\t}\n\n\t\twinner = myBoard.checkWinner();\n\t\tif(winner == 'B' || winner == 'W')\n\t\t{\n\t\t\tconsole.log('Game is over. The winner is Player ' + (winner == p1Disc ? 1 : 2) + winner + '.\\n');\n\t\t}else{\n\t\t\tconsole.log('Game is over. No winner.');\n\t\t}\n\t}", "function compile() {\n var board = BOARD\n\n var programText = CODE_MIRROR_BOX.getValue()\n var program = compilePuzzleCode(programText, board)\n addLineComments(CODE_MIRROR_BOX, program.lineComments)\n\n if (program.constraintViolation) {\n $(\"#constraintBoxDiv\").addClass(\"glow-focus\")\n } else {\n $(\"#constraintBoxDiv\").removeClass(\"glow-focus\") \n }\n\n // Enable or disable the #pausePlay and #stepButton buttons\n if (PLAY_STATUS == PlayStatus.INITAL_STATE_PAUSED) {\n if (program.instructions == null) {\n disableButton(\"#pauseplay\")\n disableButton(\"#stepButton\")\n } else {\n enableButton(\"#pauseplay\")\n enableButton(\"#stepButton\")\n\n updatePrimaryButton()\n }\n } else {\n console.error(\"I don't expect compile to be called unless board is reset\")\n }\n\n // Update the messageBox\n if (program.instructions == null){\n d3.select(\"#messageBoxDiv\")\n .attr(\"class\", \"alert alert-block alert-error\")\n d3.select(\"#messageBoxHeader\")\n .text(\"Error:\")\n d3.select(\"#messageBox\").html(\"<h3>You must fix the errors \" +\n \"before you can run your program.</h3>\")\n } else {\n // TODO: put this comm functionality in function\n d3.select(\"#messageBox\")\n d3.select(\"#messageBoxDiv\")\n .attr(\"class\", \"alert alert-block alert-success\")\n\n\n // TODO: give a tip to click the hint button (when it is highlighted)\n if (HELP_BUTTON_CLICKED) {\n d3.select(\"#messageBoxHeader\")\n .text(\"Tip:\")\n d3.select(\"#messageBox\")\n .html(\"<h3>Click the 'Run!' button to run your program</h3>\")\n } else {\n d3.select(\"#messageBoxHeader\")\n .text(\"\")\n d3.select(\"#messageBox\")\n .html(\"<br><h3>To begin, click the blue 'Help' button below</h3><br>\")\n }\n }\n\n return program\n}", "function kata23() {\r\n // Your Code Here\r\n}", "function setup() {\n createCanvas(600, 600);\n\n // Config\n boardSize = 10;\n spawningRate = 3;\n colorList = ['red', 'blue', 'yellow', 'green'];\n\n balls = [];\n board = [];\n for (let i = 0; i < boardSize; i++) {\n board[i] = [];\n for (let j = 0; j < boardSize; j++) {\n board[i][j] = 0;\n }\n }\n\n // Start the game with 3 balls\n spawn(balls, board);\n\n selectedBall = null;\n gameState = 'idling';\n score = document.getElementById('score');\n score.innerHTML = 0;\n}", "function main() {\n \n setupWebGL(); // set up the webGL environment\n loadGrid(); // load in the models from tri file\n ultimateDone = false;\n loadPeicesA();\n loadPeicesB();\n loadPeicesC();\n loadPeicesD();\n loadPeicesE();\n setActive();\n setTaken();\n loadNextA(0);\n setupShaders(); // setup the webGL shaders\n renderModels(); // draw the triangles using webGL\n \n} // end main", "function kata28() {\r\n // Your Code Here\r\n}", "function kata30() {\r\n // Your Code Here\r\n}", "function coursework(cswork)\r\n {\r\n//assigning a variable name coursework parameters\r\n//invocking tests\r\n//solving for coursework\r\n let coursework = cswork + tests(80,80)\r\n \r\n //posting results to the browsers console\r\n console.log(coursework)\r\n\r\n //allowing access to coursework\r\nreturn coursework\r\n\r\n }", "function main() {\n const ws = fs.createWriteStream(process.env.OUTPUT_PATH);\n\n const nt = readLine().split(' ');\n\n const n = parseInt(nt[0], 10);\n\n const t = parseInt(nt[1], 10);\n\n const width = readLine().split(' ').map(widthTemp => parseInt(widthTemp, 10));\n\n let cases = Array(t);\n\n for (let i = 0; i < t; i++) {\n cases[i] = readLine().split(' ').map(casesTemp => parseInt(casesTemp, 10));\n }\n\n let result = serviceLane(width, cases);\n\n ws.write(result.join('\\n') + '\\n');\n\n ws.end();\n}", "function setup() {\n newLetter();\n printWin();\n printGuesses();\n printLetters();\n printLoss();\n}", "function runScoreboard(){\n // Setup\n IC = 0;\n var clk = 0;\n var hardwareLatency = {fpAdder:0, fpMult:0, fpDiv:0, integer:0};\n var pipeline = [];\n var instList = document.getElementById('instruction_input').value;\n var scoreboard = [];\n getHardwareLatencies(hardwareLatency);\n \n // Split each line into its own instruction and remove empty/commented lines\n instList = instList.split('\\n');\n instList = instList.filter(function(inst){\n return (inst.trim() !== '' && inst.trim()[0] !== '#');\n });\n instList = instList.map(function(line){\n try {\n return getInstructionType(line);\n }\n catch (e){\n throw e + \"\\nError decoding \" + line;\n }\n });\n \n // Loop as long as IC is not at the end of the program and there are\n // instructions in the pipeline\n while ((IC < instList.length) || (pipeline.length > 0)){\n // Loop through every instruction in the pipeline\n for (var inst in pipeline){\n // If waiting to issue, check WAW and FU\n if (pipeline[inst].state == \"waiting\"){\n // Go through all other instructions in the pipeline to see if\n // this one can be issued\n var canIssue = true;\n for (var otherInst in pipeline){\n if (otherInst >= inst) break;\n if ( (pipeline[inst].dest === pipeline[otherInst].dest)\n || (pipeline[inst].FU === pipeline[otherInst].FU)){\n canIssue = false;\n break;\n }\n }\n if (canIssue){\n pipeline[inst].nextState = \"issue\";\n }\n }\n \n // If the instruction has all sources, it can read the variables\n // Check for RAW\n else if (pipeline[inst].state == \"issue\"){\n // Go through all other instructions issued before this one in\n // the pipeline to check that this one has all the sources it\n // needs to start executing\n var canRead = true;\n for (var otherInst in pipeline){\n if (otherInst >= inst) break;\n if ( pipeline[otherInst].dest === pipeline[inst].src\n || pipeline[otherInst].dest === pipeline[inst].trgt){\n canRead = false;\n break;\n }\n }\n if (canRead){\n try {\n pipeline[inst].nextState = \"read\";\n // Add the latency to the HW\n hardware[pipeline[inst].FU].busy = hardwareLatency[pipeline[inst].FU];\n // Input A = source value\n hardware[pipeline[inst].FU].inputA = getValue(pipeline[inst].src);\n // Input B = target value (or mem address for s.d)\n if (pipeline[inst].inst === \"S.D\"){\n hardware[pipeline[inst].FU].inputB = pipeline[inst].trgt;\n }\n else {\n hardware[pipeline[inst].FU].inputB = getValue(pipeline[inst].trgt);\n }\n // Save the instruction in the HW too\n hardware[pipeline[inst].FU].inst = pipeline[inst].inst;\n }\n catch (e) {\n throw e + \"\\nInstruction:\" + pipeline[inst].inst + \"\\n\";\n }\n }\n }\n // The instruction will stay in read until its HW timer\n // reaches 0\n else if (pipeline[inst].state == \"read\"){\n if (hardware[pipeline[inst].FU].busy > 1){\n hardware[pipeline[inst].FU].busy--;\n }\n else {\n // Since no other instruction can execute as long as there\n // is an instruction in the pipeline using the same FU,\n // nothing will \"execute\" until the WB state\n pipeline[inst].nextState = \"exec\";\n hardware[pipeline[inst].FU].busy = 0;\n }\n }\n // Before writing the output, check for WAR (Ensure no instruction\n // that is waiting to read has this instruction dest as an input)\n // and no writing if a branch is still waiting to write\n else if (pipeline[inst].state == \"exec\"){\n var canWrite = true;\n for (var otherInst in pipeline){\n if (otherInst >= inst) break;\n if ( pipeline[inst].dest === pipeline[otherInst].src\n || pipeline[inst].dest === pipeline[otherInst].trgt\n || pipeline[otherInst].type === \"ctrl\"){\n // if it was not a branch/control instruction and\n // it already read, the instruction can write\n if (!((pipeline[otherInst].type !== \"ctrl\") && (pipeline[otherInst].read !== null))){\n canWrite = false;\n break;\n }\n }\n }\n if (canWrite){\n pipeline[inst].nextState = \"wb\";\n var fu = hardware[pipeline[inst].FU];\n var result = executeInstruction(fu.inst, fu.inputA, fu.inputB, pipeline[inst].dest);\n // If a branch was taken, remove everything in the pipeline after it\n\t\t\t\t\tif (pipeline[inst].type === \"ctrl\" && result === true){\n var removed = pipeline.splice(inst+1, pipeline.length-inst);\n removed.forEach(function(remInstr){\n // Of the instructions removed from the pipeline, make sure\n // they actually issued before putting onto the scoreboard\n if (remInstr.issue !== null)\n scoreboard.push(deepCopy(remInstr));\n });\n }\n \n }\n }\n }\n \n // Add next element into the pipeline if there is another instruction\n // AND either (nothing is in the pipeline OR the last element in the\n // pipeline has issued)\n if ( (instList[IC]) && ((pipeline.length == 0)\n || (pipeline[pipeline.length-1].nextState === \"issue\"))){\n pipeline.push(deepCopy(instList[IC]));\n IC++;\n }\n \n // Update all states of instructions in the pipeline and move completed\n // from the pipeline to the scoreboard.\n for (var inst in pipeline){\n if (pipeline[inst].state !== pipeline[inst].nextState){\n pipeline[inst].state = pipeline[inst].nextState;\n pipeline[inst][pipeline[inst].state] = clk;\n }\n }\n \n // Only allow one writeback per clk cycle\n for (var inst in pipeline){\n if (pipeline[inst].state == \"wb\"){\n var written = pipeline.splice(inst, 1)[0];\n written.wb = clk;\n scoreboard.push(written);\n break;\n }\n }\n clk++;\n \n if (clk % 10000 == 0 && clk > instList.length*100){\n if (confirm(\"It looks like you might be in an endless loop, \" +\n \"Would you like to kill it?\\n\" +\n \"\\rclk = \" + clk)){\n return null;\n }\n \n }\n \n }\n // Since instructions were put in the scoreboard at different times (done at\n // WB), they need to be sorted by issue clk cycles\n scoreboard.sort(function(a, b){\n return (a.issue - b.issue);\n });\n printScoreboard(scoreboard);\n printRegisterFile(intRegFile, \"regFile_table\", \"RegFile\");\n printRegisterFile(fpRegFile, \"fpRegFile_table\", \"FP RegFile\");\n printRegisterFile(dataMem, \"dataMem_table\", \"Data Mem\");\n return instList;\n}", "static train() {\n\t\t// Get random number from 1-5\t\t\n let randNum = Math.ceil(Math.random() * 5);\n let training = 0;\n let trainingMessage = \"\";\n\t\t\n\t\t// Made it so that if the random number is odd you get an ability point and a message for how you did that session. If the number is even you lose an ability point with a message explaining why.\n switch (randNum) {\n case 1:\n training = 1;\n trainingMessage = \"You had a nice steady learning experience\";\n break;\n case 2:\n training = -1;\n trainingMessage = \"You were distracted most of the day and had to refresh what you already know\";\n break;\n case 3:\n training = 2;\n trainingMessage = \"You had a great day you learned more than what you set out to accomplish\";\n break;\n case 4:\n training = -2;\n trainingMessage = \"You had a terrible day and just couldn't figure anything out and started questioning what you already know.\";\n break;\n case 5:\n training = 5;\n trainingMessage = \"You had an amazing day! You feel that you might just be a natural programmer\";\n break;\n default:\n training = 0;\n trainingMessage = \"I don't think it's possible for the code to get here but just in case Good Job you found a bug!\"\n break;\n }\n\n\t\t// I got bored with the simulator myself so I added this part in for a multiplier to your positive training. If you had a bad training session you penalty will not be multiplied.\n let finalScore = 0;\n if (training < 1) {\n finalScore = training;\n } else {\n let multiplierNum = Math.random();\n let multiplier = 1;\n if (multiplierNum < 0.3) {\n multiplier = 1;\n } else if (multiplierNum < 0.5) {\n multiplier = 1.5;\n } else if (multiplierNum < 0.7) {\n multiplier = 2;\n } else if (multiplierNum < .9) {\n multiplier = 2.5;\n } else {\n multiplier = 3; // Yes intentional 1/10th chance for 3x multiplier\n trainingMessage += \" Congrats you got a 3x multiplier too! Super smart looking!\"\n }\n\n\n finalScore = training * multiplier;\n }\n\n return [finalScore, trainingMessage];\n }", "function kata25() {\r\n // Your Code Here\r\n}", "function kata24() {\r\n // Your Code Here\r\n}", "function run(){\n\n\tdescribe(\"UnderseaWorld2\", function(){\n\n\t\tfindXML();\n\t\tparseXML();\n\t\tloadGame();\n\t\tsingleSpin(); // Start by doing a single spin\n\t\tfullGame();\n\t\texpandingTiles();\n\t\tbonusGame();\n\t\tbonusTime();\n\t});\n}", "function setup() {\n createCanvas(1280, 720);\n\n // setting up class for scorecard function\n stressCard = new scoreCard();\n\n // setup the clickables = this will allocate the array\n clickables = clickablesManager.setup();\n\n \n // based on the state name in the clickableLayout\n adventureManager.setClickableManager(clickablesManager);\n\n // This will load the images, go through state and interation tables, etc\n adventureManager.setup();\n\n // load all text screens\n loadAllText();\n\n // call OUR function to setup additional information about the p5.clickables\n setupClickables(); \n\n fs = fullscreen();\n}", "function kata32() {\r\n // Your Code Here\r\n}", "function kata21() {\r\n // Your Code Here\r\n}", "function main() { //function is a command that tells the computer it has to do something\r\n process.stdout.write('\\x1Bc'); //Clears the screen //This will clear the screen. stdout means standard out which would be your monitor\r\n // is a way for editors to put in comments\r\n setContinueResponse();//calls for the first function to be done\r\n while (continueResponse === 1) {//this is a while loop.\r\n setCurrentMonth();//lines 24-28 are mutate methods. They are all called in the main.\r\n setCurrentGrade();//the open and close parentheses and semi- colon finish the line\r\n setCurrentClassroom();//\r\n processPaymentCoupons();\r\n setContinueResponse();\r\n for (let i = 0; i < MAX_CLASSROOM; i++) {//for loop under the condition that i is assigned a value of 1.\r\n //i must be less than MAX_CLASSROOM and each time i will increase by +1.\r\n printGoodbye();//if condition is met then the print goodbye method will run\r\n }\r\n }//brackets are used to close loops or methods.\r\n\r\n}", "function loadTerminalPrint() {\n \"use strict\";\n addInput(\"ThomasBiddleResume 1.2</br></br>\");\n addInput(\"Welcome!</br></br>\");\n addInput(\" * Project URL: https://github.com/thomasbiddle/ThomasBiddle.info</br></br>\");\n addInput(\"recruiter@resume ~> about</br></br>Last Name: Biddle</br>First Name: Thomas</br>Major: Computer Science</br></br>I am currently a student at the University of Cincinnati working towards my BS in Computer Science. Software development is one of my greatest interests, and I always strive to not only increase my knowledge and experience in the field; but find new ways to apply it.</br></br>Independent Ventures:</br></br>In 2011 I was able to successfully found two web hosting companies centered around Virtual Private Servers. Between the two companies, I catered to over 500 individual monthly customers and held a reputation for outstanding customers service and going the extra mile in order to make sure my services were the best available.</Specialties:Java, C++, Javascript, Linux, Android</br></br></br>recruiter@resume ~> education</br></br>University of Cincinnati</br>BS, Computer Science</br>2010-2015 (expected)</br></br>Sycamore High School</br>2006-2010</br>Enrolled in Honors and Advanced Placement (AP) courses. Entire senior year was deciated to the Post Secondary Enrollment Options Program (PSEOP)</br></br>recruiter@resume ~> workhistory</br></br>Seapine Software</br>Software Development Co-op</br>January 2012 - Present</br>Worked as a part of the Surround SCM Development Team and was responsible for fixing submitted defects with the SCM software. Work was mainly done in C++; however while working with certain features knowledge of Java, Javascript, HTML, and CSS were needed.</br></br>MinecraftLayer.com</br>Co-Founder</br>September 2011 - December 2011</br>Company was built around being a hosting platform for the popular Indie game, 'Minecraft'. Even with dozens of competitors in this field, we were able to quickly grow a reputation for having fast and reliable solutions for our customers. With my familiarity of VPSs, and my partner's knowledge of the game and experience in web-hosting - we became a deadly duo to have the company gain a strong foothold in a tough market. While the company was, and still is, running very smoothly - I chose to leave MinecraftLayer in order to focus on other endeavors.I officially left MinecraftLayer December 31, 2011.</br></br>VPSInfinity.com</br>Founder</br>February 2011 - December 2011</br>VPSInfinity was founded in early 2011 as a hosting company for the niche group in game macros. Over 300 individuals clients were served over the period of operation, many leaving our competitor's services to join us due to our superior customer support and feature advancement. The company turned a successful profit from day one and was experiencing incredible growth throughout the period of operation. Many lessons were learned; however unfortunately doors were closed due to the market taking a very swift downturn as our prime target user became unable to run macros as the 3rd party game had implemented a way to prevent this.Officially shut down December 31, 2011.</br></br>Boulder Landscaping</br>Division Manager</br>January 2008 - June 2011</br>Duties included: Lawn-care, tree removal, mulching, and other landscaping necessities.Was the company's first hire from their founding, helped with initial marketing and customer relations.</br></br>Cold Stone Creamery</br>Server</br>November 2007 - April 2009</br>Served a multitude of customers as this was the most profitable franchise in the company during peak seasons, practiced teamwork with fellow colleagues, and worked the cash register.</br></br>recruiter@resume ~> portfolio</br></br>As my experience in Computer Science and programming continues to grow, I will be adding as much to my portfolio as possible. As a supporter of open source communities, I plan to release the source code for any personal projects I take on. The majority, if not all, of my independent projects can be found at: <span class='inLink'><a href='http://www.ThomasBiddle.com/#work'>http://www.ThomasBiddle.com/#work</a></span></br></br>At the above address, you will find a collection of my independent projects, such as 'Project Euler' problems, as well as Android Applications. I also have a few small school assignments that I found to be interesting.</br></br></br></br></br></br></br>&nbsp;\");\n}", "function demonstrate() {\n\t\n\t// ========== Chapters 11-15 ==========\n\t\n\tvar products = [\"Lessons\", \"Clinics\", \"Contact Us\"];\n\tvar choice = prompt(\"Have you looked at what services we provide?\");\n\t// Using if else-if statements to display the correct response by comparing user input\n\tif(choice == \"no\" || choice == \"No\"){\n\t\talert(\"Please view the CourtSide homepage for more info!!\");\n\t} else if(choice == \"yes\" || choice == \"Yes\"){\n\t\tvar productChoice = prompt(\"Great! Was it \"+products[0]+\" or \"+products[1]+\"?\");\n\t\tif(productChoice == products[0] || productChoice == products[1]){\n\t\t\talert(\"Awesome! Thank You!\");\n\t\t} else{\n\t\t\talert(\"Your choice was not recongized. Please visit the CourtSide homepage for more information!\");\n\t\t}\n\t} else{\n\t\t\talert(\"You didn't anwser.\");\n\t}\n\t\n\t// ========== Chapters 16-20 ==========\n\t\n\t// Creating a nested array with client info\n\tvar clientList = [[\"Robert\",31],[\"Elijah\",10],[\"Logan\",16]];\n\t\n\t// Using for loop to count the roster\n\tvar currentRoster = 0;\n\tfor(var i=0; i<clientList.length; i++){\n\t\tcurrentRoster++;\n\t}\n\t\n\t// Displaying the roster list with current roster members\n\talert(\"Here is a list of our current \\\"New Client Roster\\\" : \\n\"+\n\t\"\\nName Age\"+\n\t\"\\n----------------\"+\n\t\"\\n\"+clientList[0][0]+\" \"+clientList[0][1]+\n\t\"\\n\"+clientList[1][0]+\" \"+clientList[1][1]+\n\t\"\\n\"+clientList[2][0]+\" \"+clientList[2][1]+\n\t\"\\n\\nCurrent Roster: \"+currentRoster);\n\t\n\t// Getting user info to current roster array\n\tvar name = prompt(\"Enter your name.\");\n\tif(name==\"\"){\n\t\tname = prompt(\"Please enter your name.\");\n\t}\n\tvar age = prompt(\"Enter your age.\");\n\tif(age==\"\"){\n\t\tage = prompt(\"Enter your age.\");\n\t}\n\tage = parseInt(age); // Parsing string into an int\n\t\n\t// Adding user info to client list\n\tclientList.push([name,age]);\n\talert(clientList[3][0]+\", your name and age (\"+clientList[3][1]+\") has been added to the current New Client Roster!\");\n\t\n\t// Using for loop to count the updated roster\n\tvar currentRoster = 0;\n\tfor(var i=0; i<clientList.length; i++){\n\t\tcurrentRoster++;\n\t}\n\t// Displaying the updated roster number\n\talert(\"After adding you to the roster, there are now currently \"+currentRoster+\n\t\" clients on the roster!\");\n\t\n\t// Counting everything in the array with nested for loops\n\tvar nameCount=0;\n\tvar ageCount=0;\n\tfor(var i=0; i<clientList.length; i++){\n\t\tnameCount++;\n\t\tfor(var j=1; j<clientList[i].length; j++){\n\t\t\tageCount++;\n\t\t}\n\t}\n\tvar allInfo = nameCount + ageCount;\n\talert(\"There is \"+allInfo+\" pieces of information in the New Client Roster.\");\n}//End of Function", "function setup() {\n \n createCanvas(displayWidth, displayHeight);\n \n input = createInput();\n input.position(36, 124);\n enterButton = createButton('submit');\n enterButton.position(214, 124);\n enterButton.mousePressed(submit);\n clearButton = createButton('clear');\n clearButton.position(273, 124);\n clearButton.mousePressed(clear);\n textSize(30);\n heading = createElement('h1', 'surrealist (dadist) text rearranger');\n inputText = createElement('h2', 'enter some paragraphs of text and see the many poetic iterations that can be found');\n siteDescript = createElement('h3', 'sentences are chopped, rearranged, removed, repeated, with no punctuation.');\n aLink = createElement('h4', 'try it with: https://www.gutenberg.org/files/11/11-h/11-h.htm');\n heading.position(35,20);\n inputText.position(35, 55);\n siteDescript.position(37, 80)\n aLink.position(38, 100);\n textAlign(CENTER); // With the layout centered and endmarks removed, the new text looks like poetry\n\n}", "function takeChallenge() {\r\n var challenge = getInput().toLowerCase(); //Hämta värden från inputfälten och omvandla alla höga bokstäver till små.\r\n \r\n //Om spelaren ta utmaning kommer den hoppa till spiderLegs().\r\n if (challenge === \"yes\") {\r\n print(\"That is the spirit! Your first step is to add 4 left <br> spider legs and also 4 right spider legs. Hmmm...<br> How many spider legs do you need...? <br> Please type the number of spider legs.\");\r\n \r\n submit(spiderLegs);\r\n }\r\n \r\n //Om spelaren svara No eller annat kommer den ber spelaren göra om tills hen skriver Yes.\r\n else if (challenge === \"no\") {\r\n print(\"No? Come on! You can do it! <br> Yes or No?\");\r\n submit(takeChallenge);\r\n }\r\n else {\r\n print(\"What? Please try again. <br> Yes or No?\");\r\n submit(takeChallenge);\r\n }\r\n \r\n}", "function intro() {\n\t\tif (getyx(y,x) =='Y5X2') {\n\t\talert('Greetings, I am the all powerfull Elodin, son of Steve \\nI am here to guide you on a quest!\\nAre You ready to play?');\n\t\tvar answer = prompt();\n\t\t\tif(answer.toUpperCase() == 'YES'){\n\t\t\t\tbeginWizard.appendChild(beginWizardImg);\n\t\t\t\talert('Fantastic! \\nGet a score of 100 to win the game \\nDont Let your health get to zero or you will die\\nGood Luck and godspeed');\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\talert('Alright your loss, get out of here');\n\t\t\t\treloadPage();\n\t\t\t}\n\t\t}\n}", "function setup() {\n // creste the Cancas\n createCanvas(column_num * column_length + 2 * sideMargins, row_num * row_length + 2 * topMargins);\n // create the columns of the grid. Note:length depends on column_num\n grid = grid.map(x => [0, 0, 0, 0]);\n // add two numbers to the grid, when initializing.\n addNumber();\n addNumber();\n // set the background to white\n background(255);\n // call drawGrid() to draw the grid and display the tiles\n drawGrid();\n // set 'initial' to false after initialization(setup)\n initial = false;\n // display the scoe on screen\n select('#score').html(score);\n}", "function start(){\n \t// Local variables\n\tlet height = prompt('What height for your board? ');\n\tlet width = prompt('What width for your board? ');\n\n\t// SYNCHRONOUSLY read from keyboard\n\tconsole.log('Creating a board with size ' + height + ' x ' + width + '.');\n\t// Create new board object\n\tlet myBoard = new board(height, width);\n\n\t// Print board\n\n\t// Loop, asking user input, calling appropriate functions.\n\tconsole.log('\\nWelcome to Othello\\n');\n\tconsole.log('Player 1 is black(b), Player 2 is white(w)');\n\tlet turn = 1;\n\twhile(!(myBoard.isGameOver()))\n\t{\n\n\t\tmyBoard.printBoard();\n\t\tif(turn == 1 && myBoard.isValidMoveAvailable('b'))\n\t\t{\n\t\t\tconsole.log('\\nPlayer 1(b) turn\\n');\n\t\t\tlet row = prompt('\\nEnter row: ');\n\t\t\tif(row == -1)\n\t\t\t{\n\t\t\t\tbreak; \t\t\t//for debugging\n\t\t\t}\n\t\t\tlet col = prompt('\\nEnter column: ');\n\t\t\twhile(!(myBoard.isValid(row,col,'b')))\n\t\t\t{\n\t\t\t\tconsole.log('Not a valid move');\n\t\t\t\tlet row = prompt('\\nEnter row: ');\n\t\t\t\tlet col = prompt('\\nEnter column: ');\n\t\t\t}\n\t\t\tmyBoard.placeDiscAt(row,col,'b');\n\t\t\tturn++;\n\t\t}\n\t\telse if(turn == 1 && !(myBoard.isValidMoveAvailable('b')))\n\t\t{\n\t\t\tconsole.log('No Valid Moves. Turn is skipped\\n');\n\t\t\tturn++;\n\t\t}\n\t\tif(turn == 2 && myBoard.isValidMoveAvailable('w'))\n\t\t{\n\t\t\tconsole.log('\\nPlayer 2(w) turn\\n');\n\t\t\tlet row = prompt('\\nEnter row: ');\n\t\t\tif(row == -1)\n\t\t\t{\n\t\t\t\tbreak; \t\t\t//for debugging\n\t\t\t}\n\t\t\tlet col = prompt('\\nEnter column: ');\n\t\t\tconsole.log('\\nPlayer 2(w) turn\\n');\n\t\t\twhile(!(myBoard.isValid(row,col,'w')))\n\t\t\t{\n\t\t\t\tconsole.log('Not a valid move');\n\t\t\t\tlet row = prompt('\\nEnter row: ');\n\t\t\t\tlet col = prompt('\\nEnter column: ');\n\t\t\t}\n\t\t\tmyBoard.placeDiscAt(row,col,'w');\n\t\t\tturn--;\n\t\t}\n\t\telse if(turn == 2 && !(myBoard.isValidMoveAvailable('w')))\n\t\t{\n\t\t\tconsole.log('No Valid Moves. Turn is skipped\\n');\n\t\t\tlet cont = prompt('Infinite Loop??????????? Enter -1 to exit\\n');\n\t\t\tif(cont == -1)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tturn--;\n\t\t}\n\t}\n\tconsole.log('Game Over');\n\n\tif(myBoard.checkWinner() != null)\n\t{\n\t\tconsole.log('Winner is color: ' + myBoard.checkWinner());\n\t}\n\telse\n\t\tconsole.log('The game ended in a tie');\n\t// Save board example code.\n\tsaveFile(\"test.json\", myBoard);\n}", "function practice3(){\n console.log(\"This is the Hoisted function.\");\n}", "function help() {\n console.log(\" \");\n console.log(\n \" ╔════════════════════════════════════════════════════════════════════════╗\"\n .rainbow\n );\n console.log(\n \" ║ ║\"\n .rainbow\n );\n console.log(\n \" ║ Hi my name is LUIRI, like Siri but better, Ill be assisting you... ║\"\n .rainbow\n );\n console.log(\n \" ║ ║\"\n .rainbow\n );\n console.log(\n \" ╠════════════════════════════════════════════════════════════════════════╣\"\n .rainbow\n );\n console.log(\n \" ║ To see your tweets: luiri tweets ║\"\n .red\n );\n console.log(\n ' ║ To track a tweet: luiri twitterTrack \"word\" ║'\n .red\n );\n console.log(\n ' ║ To search for a song: luiri spotify \"song name\" ║'\n .green\n );\n console.log(\n ' ║ To search for a movie: luiri movie \"movie name\" ║'\n .yellow\n );\n console.log(\n \" ║ Saved: luiri saved ║\"\n .blue\n );\n console.log(\n \" ║ To view the log: luiri log ║\"\n .green\n );\n console.log(\n \" ╚════════════════════════════════════════════════════════════════════════╝\"\n .rainbow\n );\n}", "function kata26() {\r\n // Your Code Here\r\n}", "function htmlIntro() {\n \n document.writeln(\"<div class = title>Prescriber Portal</div>\");\n document.writeln(\"<div class = subtitle>Created By: GunaCode </div>\");\n /* game rules and examples */\n //button\n document.writeln(\"<button type=\\\"button\\\" class=\\\"collapsible\\\">\" + gameHeader[0] + \"</button>\")\n \n //content\n document.writeln(\"<div class=\\\"content\\\">\");\n htmlDescript(0);\n document.writeln(\"</div>\");\n \n /* header for game setup */\n //button\n document.writeln(\"<button type=\\\"button\\\" class=\\\"collapsible\\\">\" + gameHeader[1] + \"</button>\")\n // document.writeln(\"<canvas id=\\\"myChart\\\" style=\\\"width:100%;max-width:700px\\\"></canvas>\");\n // document.writeln(\"<p>\"+displayValue+\"</p>\");\n // makeChart();\n // document.writeln(\"<p>\"+displayValue+\"</p>\");\n // document.writeln(\"<p>\"+printValue+\"</p>\");\n \n \n \n //content\n document.writeln(\"<div class=\\\"content\\\">\");\n htmlDescript(1);\n document.writeln(\"</div>\");\n \n //header for game\n //htmlHeaders(2);\n collapsibleStyling();\n \n }", "function setup() {\n createCanvas(600,600);\n noStroke();\n for (let i=0;i<8;i++) {\n steps[i] = i%3\n }\n console.log(steps);\n// let n = 10;\n// console.log('i can fit number 8', floor(n/8), 'times into number', n, 'and the remainder is', n%8);\n// t0 = new Tone.MembraneSynth().chain(reverb)\n\tt0.oscillator.type = 'sine';\n// t0.envelope.attack = 1.1;\n// t0.envelope.decay = 0.1;\n// t0.envelope.sustain = 0.1;\n// t0.envelope.release = 0.1;\n t0.toMaster();\n}", "function DoProject() \r\n{\r\n\talert(\"Here we go again..\"); //project begin! and description below\r\n\talert(\"So this program will calulate how much money (gross) you make a year. So. Lets do this....\");\r\n\tvar name = prompt(\"What's your name?\"); //get user's name\r\n\twhile(name.replace(\" \", \"\") == \"\") //basically the jquery $.trim function\r\n\t\t//however, regular expressions would validate better since this\r\n\t\t//only looks for one space character, not multiple\r\n\t{\r\n\t\tname = prompt(\"What's your name?!\"); //while the name entered is blank, keep asking for the user's name till we get something\r\n\t}\r\n\r\n\t//is the user getting salary\r\n\tvar areYouSalary = prompt(\"Are you salary? Enter Y or N\");\r\n\t//error checking. Was the value entered either y or n\r\n\twhile (areYouSalary.toLowerCase() != \"y\" && areYouSalary.toLowerCase() != \"n\")\r\n\t{\r\n\t\t//keep asking till we get the proper value\r\n\t\tareYouSalary = prompt(\"Are you salary? Enter Y or N!\");\r\n\t}\r\n\r\n\t//if the user does receive salary\r\n\tif (areYouSalary == \"Y\")\r\n\t{\r\n\t\t//unfortunately, we have no implemented functionality for salary\r\n\t\t//odds are, the user already knows how much they make a year this way\r\n\t\tvar salary = confirm(\"Fantastic, your salary. Unfortunately this program doesn't support salary. Please click 'OK' to run this program again. Make sure you type N when the salary prompt appears\");\r\n\t\tif (salary == true)\r\n\t\t{\r\n\t\t\t//the user can choose to re-run the program if they choosed salary.\r\n\t\t\t//they can type N to see what the program does if they are not salary\r\n\t\t\tDoProject();\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\telse \r\n\t{\r\n\t\t//quick intro of hourly\r\n\t\talert(\"Alright, assuming your hourly..\");\r\n\t\t//ask how much they make hourly and how many hours a week they work\r\n\t\tvar howMuchHourly = prompt(\"How much do you make per hour? Enter a number.\");\r\n\t\tvar howManyHours = prompt(\"How many hours do you work a week? Enter a number.\");\r\n\r\n\t\t//parse these strings into int's\r\n\t\tvar hourlyNumber = parseInt(howMuchHourly);\r\n\t\tvar howManyHoursNumber = parseInt(howManyHours);\r\n\r\n\t\t//if the parse variables are NaN\r\n\t\twhile (isNaN(hourlyNumber))\r\n\t\t{\r\n\t\t\t//continue asking until we get a number\r\n\t\t\thowMuchHourly = prompt(\"How much do you make per hour? Enter a number!\");\r\n\t\t\thourlyNumber = parseInt(howMuchHourly);\r\n\t\t}\r\n\t\t//same functionality as the above while statement\r\n\t\twhile (isNaN(howManyHoursNumber))\r\n\t\t{\r\n\t\t\t//same\r\n\t\t\thowManyHours = prompt(\"How many hours do you work a week? Enter a number.\");\r\n\t\t\thowManyHoursNumber = parseInt(howManyHours);\r\n\t\t}\r\n\r\n\t\t//get the result by multiple how much they make hourly\r\n\t\t//times how many hours they work a week times 52 \r\n\t\t//52 because 52 weeks in a year (duh)\r\n\t\tvar result = hourlyNumber * (howManyHoursNumber * 52);\r\n\r\n\t\t//notify user to check console\r\n\t\talert(\"Please check the console for the results\");\r\n\t\t//quick friendly greeting\r\n\t\tlog(\"Hello \" + name + \"! Here are your results..\");\r\n\r\n\t\t//if they make less than 25k a year\r\n\t\tif (result <= 25000)\r\n\t\t{\r\n\t\t\t//output this message, concatenate the amount they make a year\r\n\t\t\tlog(\"Cool! You make a decent wage. You make $\" + result + \" a year!\");\r\n\t\t}\r\n\t\telse if (result <= 40000)\r\n\t\t{\r\n\t\t\t//same as the first if statement on line 87\r\n\t\t\tlog(\"Not bad! You make a good wage. You make $\"+result + \" a year!\");\r\n\t\t}\r\n\t\telse if (result <= 60000)\r\n\t\t{\r\n\t\t\t//same as the first if statement on line 87\r\n\t\t\tlog(\"Now we're cooking! You make a pretty good wage (in most places). You make $\" + result+ \" a year!\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//same as the first if statement on line 87\r\n\t\t\tlog(\"You must be doing pretty good. Very cool. You make $\" + result + \" a year!\");\r\n\t\t}\r\n\t}\r\n\t\r\n}", "function main(){\n\tDMessage(\"AV_StrokeNumber Task: Beginning\");\n\tlet answers = [ \n [null,\"Give me 10 %Crazy% fast strokes\",null],\n [null,\"Give me 20 %Crazy% fast strokes\",null],\n [null,\"Give me 30 %Crazy% fast strokes\",null],\n [null,\"Give me 10 %Crazy% fast strokes\",null],\n [null,\"Give me 20 %Crazy% fast strokes\",null],\n [\"checkOldApathyLevel(4)\",\"Give me \" + (java.lang.Math.round(randomInt(40, 50) / 10.0) * 10) + \"%Crazy% fast strokes\",null],\n [\"checkOldApathyLevel(5)\",\"Give me \" + (java.lang.Math.round(randomInt(40, 60) / 10.0) * 10) + \"%Crazy% fast strokes\",null],\n [\"checkOldApathyLevel(4)\",\"Give me \" + (java.lang.Math.round(randomInt(30, 40) / 10.0) * 10) + \"%Crazy% fast strokes\",null],\n [\"checkOldApathyLevel(5)\",\"Give me \" + (java.lang.Math.round(randomInt(40, 50) / 10.0) * 10) + \"%Crazy% fast strokes\",null],\n [\"checkOldDommeLevel(4)\",\"Give me \" + (java.lang.Math.round(randomInt(30, 40) / 10.0) * 10) + \"%Crazy% fast strokes\",null],\n [\"checkOldDommeLevel(5)\",\"Give me \" + (java.lang.Math.round(randomInt(40, 50) / 10.0) * 10) + \"%Crazy% fast strokes\",null],\n [null,\"Give me 10 strokes\",null],\n [null,\"Give me 20 strokes\",null],\n [null,\"Give me 30 strokes\",null],\n [null,\"Give me 40 strokes\",null],\n [null,\"Give me 50 strokes\",null],\n [null,\"I want 10 strokes\",null],\n [null,\"I want 20 strokes\",null],\n [null,\"I want 30 strokes\",null],\n [null,\"I want 40 strokes\",null],\n [null,\"I want 50 strokes\",null],\n [\"checkOldApathyLevel(4)\",\"I want 60 strokes\",null],\n [\"checkOldApathyLevel(5)\",\"I want 60 strokes\",null],\n [null,\"%GNMTaskSpankingIntro% 10 strokes\",null],\n [null,\"%GNMTaskSpankingIntro% 20 strokes\",null],\n [null,\"%GNMTaskSpankingIntro% 30 strokes\",null],\n [null,\"%GNMTaskSpankingIntro% 40 strokes\",null] ];\n\n\texecRndLine(answers);\n\t\n\tDMessage(\"AV_StrokeNumberGliter1 Task: End\");\n\treturn;\n}", "function beginGame() {\n gameConsole.innerHTML = \"\";\n\n// Prompt player name\nplayer1Name = prompt('Please input your name');\n\n// and change it in the HTML\n document.getElementById('player-1-name').innerHTML = player1Name;\n\n// explain the rules for the opening puzzle\n gameConsole.innerHTML = 'Thanks ' + player1Name + '. The opening puzzle will begin. There will be one word up above that will fill in slowly. Click the buzzer of the opportunity to guess correctly. A correct guess will net you 50 points, and control of the first board. Guessing incorrectly will give the opponent the points and control. Good luck, and click the start button to begin.';\n\n// modify the start button to initialize the pizzle as oppose to beginning the game\n\tappendOutputConsole('div', '<button class=\"continue-button\" onclick=\"firstPuzzleStart()\">Begin first Puzzle</button>', 'flex-container justify-center');\n}", "function parrotFacts(){\n console.log('Some parrots can live for 8 years');\n console.log('Parrots can speak human language');\n}", "function Sekai() {\n console.log('This is the World we live in now');\n const monsters = \"We're attacked all the time\";\n const factions = 'We protect each other, that is how we survive!'\n\n function status() {\n const fighting = `working on a mission, but ${monsters}`;\n const living = `sitting inside the wall that was build to keep on ${factions}`;\n\n console.log(`this is a ruff existence ${fighting} for our lives`);\n\n function change() {\n const live = 'relax and live a peaceful wonderful life';\n console.log(`one day we will live in a world where ${living} changes and we can actually just ${live}`);\n };\n\n change()\n };\n\n status()\n}", "function setup(){\n let width = CELL_SIZE * COLS \n let height = CELL_SIZE * ROWS\n createCanvas(width, height);\n // slider + label\n textSize(32);\n let label = createDiv('Speed');\n label.id('label');\n sSlider = createSlider(0, frame_buffer - 1, frame_buffer);\n let ruleset = createDiv('RULESET: 0 = turn right | 1 = turn left |\\\n 2 = enter countdown state (going straight for a bit)');\n ruleset.id('label');\n //checkboxes\n toggleStats = createCheckbox('show stats?', true);\n toggleStats.changed(toggle_stats);\n toggleAnt = createCheckbox('show ant?', false);\n toggleAnt.changed(toggle_ant);\n}", "function runExercise() {\r\n // Storing the min and max input values.\r\n var min = parseInt(document.getElementById(\"min\").value);\r\n var max = parseInt(document.getElementById(\"max\").value);\r\n // Storing the feedback span element.\r\n var feedback = document.getElementById(\"feedback\");\r\n // Making sure the max is at least the min.\r\n if (!(min <= max)) {\r\n // Informing the user that the input was invalid.\r\n feedback.innerHTML = \"Make sure the maximum is greater than the minimum.\";\r\n // Exiting the function.\r\n return;\r\n }\r\n\r\n // Making the start button invisible.\r\n document.getElementById(\"start\").style.display = \"none\";\r\n // Clearing the feedback span element.\r\n feedback.innerHTML = \"\";\r\n\r\n // Generating 2 starting integers.\r\n var firstInteger = randomInteger(min, max);\r\n var secondInteger = randomInteger(min, max);\r\n // Storing the chosen operation.\r\n var operation = document.getElementById(\"operation\").value;\r\n // Generating the answer based on the chosen operation.\r\n switch (operation) {\r\n case \"addition\":\r\n var answer = firstInteger + secondInteger;\r\n break;\r\n case \"subtraction\":\r\n var answer = firstInteger - secondInteger;\r\n break;\r\n case \"multiplication\":\r\n var answer = firstInteger * secondInteger;\r\n break;\r\n case \"division\":\r\n // Using math to make sure the answer is a whole number.\r\n var answer = firstInteger;\r\n firstInteger = firstInteger * secondInteger;\r\n }\r\n\r\n // Checking if the first integer is positive.\r\n if (firstInteger > 0) {\r\n // Adding brackets and a positive sign.\r\n firstInteger = \"(+\" + firstInteger + \")\";\r\n } else if (firstInteger < 0) { // Checking if the first integer is negative.\r\n // Adding brackets.\r\n firstInteger = \"(\" + firstInteger + \")\";\r\n }\r\n // Checking if the second integer is positive.\r\n if (secondInteger > 0) {\r\n // Adding brackets and a positive sign.\r\n secondInteger = \"(+\" + secondInteger + \")\";\r\n } else if (secondInteger < 0) { // Checking if the second integer is negative.\r\n // Adding brackets.\r\n secondInteger = \"(\" + secondInteger + \")\";\r\n }\r\n // Storing the question element.\r\n var question = document.getElementById(\"question\");\r\n // Printing the question in the question span element based on the chosen operation.\r\n switch (operation) {\r\n case \"addition\":\r\n question.innerHTML = firstInteger + \" + \" + secondInteger + \" = ?\";\r\n break;\r\n case \"subtraction\":\r\n question.innerHTML = firstInteger + \" - \" + secondInteger + \" = ?\";\r\n break;\r\n case \"multiplication\":\r\n question.innerHTML = firstInteger + \" × \" + secondInteger + \" = ?\";\r\n break;\r\n case \"division\":\r\n question.innerHTML = firstInteger + \" ÷ \" + secondInteger + \" = ?\";\r\n }\r\n\r\n // Storing the first start time.\r\n var startTime = new Date();\r\n // Initializing the end time and the time taken so I don't need to keep using var.\r\n var endTime = null;\r\n var timeTaken = null;\r\n // Storing the number of iterations and sum to calculate the average.\r\n var numberOfIterations = 0;\r\n var sum = 0;\r\n // Storing the number of attempts and correct answers to calculate the correct answers/attempts percentage.\r\n var attempts = 0;\r\n var correctAnswers = 0;\r\n\r\n // Storing the user input box.\r\n var userInputBox = document.getElementById(\"user-answer\");\r\n // Storing the average span element.\r\n var average = document.getElementById(\"average\");\r\n // Storing the wrong/correct span element.\r\n var correct = document.getElementById(\"correct\");\r\n // Adding a keypress event listener to the user input box.\r\n userInputBox.addEventListener(\"keypress\", function(event) {\r\n // Making sure the key was an enter key.\r\n if (event.charCode == 13) {\r\n // Incrementing the number of attempts.\r\n attempts++;\r\n // Checking if the user answer was correct.\r\n if (parseInt(userInputBox.value) == answer) {\r\n // Getting the end time.\r\n endTime = new Date();\r\n // Calculating the number of seconds taken.\r\n timeTaken = parseFloat(((endTime - startTime) / 1000).toFixed(2));\r\n // Updating the number of iterations and the sum.\r\n numberOfIterations++;\r\n sum += timeTaken;\r\n\r\n // Incrementing the amount of correct answers.\r\n correctAnswers++;\r\n\r\n // Setting the feedback element color to green.\r\n feedback.style.color = \"green\";\r\n // Telling the user that they are correct and what their time was.\r\n feedback.innerHTML = \"Correct! You took \" + timeTaken + \" seconds.\";\r\n // Telling the user their new average time.\r\n average.innerHTML = \"Your average time is \" + (sum / numberOfIterations).toFixed(2) + \" seconds.\";\r\n\r\n // Telling the user their correct answers/attempts percentage.\r\n correct.innerHTML = \"You have gotten \" + Math.round((correctAnswers / attempts) * 100) + \"% (\" + correctAnswers + \" out of \" + attempts + \") of your answers correct.\";\r\n\r\n // Clearing the input box for the next question.\r\n userInputBox.value = \"\";\r\n // Updating the start time.\r\n startTime = new Date();\r\n\r\n // Generating two new integers.\r\n firstInteger = randomInteger(min, max);\r\n secondInteger = randomInteger(min, max);\r\n // Printing the question in the question span element based on the chosen operation.\r\n switch (operation) {\r\n case \"addition\":\r\n answer = firstInteger + secondInteger;\r\n break;\r\n case \"subtraction\":\r\n answer = firstInteger - secondInteger;\r\n break;\r\n case \"multiplication\":\r\n answer = firstInteger * secondInteger;\r\n break;\r\n case \"division\":\r\n // Using math to make sure the answer is a whole number.\r\n answer = firstInteger;\r\n firstInteger = firstInteger * secondInteger;\r\n }\r\n\r\n // Checking if the first integer is positive.\r\n if (firstInteger > 0) {\r\n // Adding brackets and a positive sign.\r\n firstInteger = \"(+\" + firstInteger + \")\";\r\n } else if (firstInteger < 0) { // Checking if the first integer is negative.\r\n // Adding brackets.\r\n firstInteger = \"(\" + firstInteger + \")\";\r\n }\r\n // Checking if the second integer is positive.\r\n if (secondInteger > 0) {\r\n // Adding brackets and a positive sign.\r\n secondInteger = \"(+\" + secondInteger + \")\";\r\n } else if (secondInteger < 0) { // Checking if the second integer is negative.\r\n // Adding brackets.\r\n secondInteger = \"(\" + secondInteger + \")\";\r\n }\r\n // Printing the question in the question span element based on the chosen operation.\r\n switch (operation) {\r\n case \"addition\":\r\n question.innerHTML = firstInteger + \" + \" + secondInteger + \" = ?\";\r\n break;\r\n case \"subtraction\":\r\n question.innerHTML = firstInteger + \" - \" + secondInteger + \" = ?\";\r\n break;\r\n case \"multiplication\":\r\n question.innerHTML = firstInteger + \" × \" + secondInteger + \" = ?\";\r\n break;\r\n case \"division\":\r\n question.innerHTML = firstInteger + \" ÷ \" + secondInteger + \" = ?\";\r\n }\r\n } else {\r\n // Setting the feedback element color to red.\r\n feedback.style.color = \"red\";\r\n // Telling the user that they were wrong.\r\n feedback.innerHTML = \"Wrong.\";\r\n // Telling the user their correct answers/attempts percentage.\r\n correct.innerHTML = \"You have gotten \" + Math.round((correctAnswers / attempts) * 100) + \"% (\" + correctAnswers + \" out of \" + attempts + \") of your answers correct.\";\r\n // Clearing the input box for the next attempt.\r\n userInputBox.value = \"\";\r\n }\r\n }\r\n });\r\n}", "function setup() {\n createCanvas(1200, 800);\n\n if (annyang) {\n\n // these are all the commands that you can say to the program\n let commands = {\n 'right': moveCircleRight,\n 'left': moveCircleLeft,\n 'up': moveCircleUp,\n 'down': moveCircleDown,\n 'make the circle grow': circleGrow,\n 'make the circle shrink': circleShrink,\n 'add some red': circleMoreRed,\n 'add less red': circleLessRed,\n 'add some green': circleMoreGreen,\n 'add less green': circleLessGreen,\n 'add some blue': circleMoreBlue,\n 'add less blue': circleLessBlue,\n 'get more rough': circleRougher,\n 'get smoother': circleSmoother,\n 'faster': circleFaster,\n 'slower': circleSlower\n\n };\n\n\n annyang.addCommands(commands);\n annyang.start();\n\n\n\n }\n}", "function runProgram(input){\n let input_arr = input.trim().split(\"\\n\")\n let [no_houses, no_towers] = input_arr[0].trim().split(\" \").map(Number)\n let houses = input_arr[1].trim().split(\" \").map(Number).sort((a, b) => a - b)\n\n let low = 0\n let high = houses[houses.length - 1] - houses[0] \n while(high <= low){\n let mid = Math.floor(low + ((high - low) / 2))\n if(possibility_check(mid)){\n\n }\n else{\n\n }\n }\n\n function possibility_check(range_assum, houses, no_towers, no_houses){\n let for_houses = Math.ceil(no_houses/no_towers)\n for(let i = 0; i < houses.length; i++){\n let count = 0\n let at_position = houses[i] + range_assum\n while(houses[i] && count < for_houses){\n if()\n count++\n i++\n }\n i = i - 1\n }\n }\n}", "function part_one_exercise_three(){\n// finding the result of 423 X 12 statement\nconsole.log(\"The result of 423 multiplied by 12 is: \" + (423 * 12))\n// finding the result of 802 / 2 statement\nconsole.log(\"The result of 802 divided by 2 is: \" + (802 / 2))\n// finding the result of the sum of 5 and 6, multiplied by 3 statement\nconsole.log(\"The result of the sum of 5 and 6, multiplied by 3 is: \" + ((5 + 6) * 3))\nconsole.log(\"------\")\n}", "function printInstructions(){\n console.log(\"\\nHello! My Name is Liri. I am an AI assistant.\");\n console.log(\"I can perform the following tasks:\");\n console.log(`\\n\"my-tweets\": This command will return Yuen's latest tweets.`);\n console.log(`\\n\"spotify-this-song\": This command will return information about a song of your choice.`);\n console.log(`\\n\"movie-this\": This command will return information about a movie of your choice.`);\n console.log(`\\n\"do-what-it-says\": This command will perform a random command on a predefined query`);\n console.log(`-------------------`);\n}", "function run () {\n\n // //Test Case 1\n address = \"809 Thomas Ave, San Diego, CA 92109\"\n var frmtAddr = addressSearch(address);\n var frmtName = formatInput(\"The Local\");\n dbAddr = formatInput(address);\n\n // Test Case 2\n // address =\"8970 University Center Ln, San Diego, CA 92122\";\n // var frmtAddr = addressSearch(address);\n // var frmtName = formatInput(\"Fleming's\");\n // dbAddr = formatInput(address);\n \n\n //Make API calls\n yelpAPIcall(frmtName,frmtAddr,ratingsobjectarray,zomatoAPIcall);\n\n // .then(zomatoAPIcall(frmtName,frmtAddr))\n // .then(googleAPIcall(frmtName,frmtAddr))\n // .then(dbfind(frmtName,dbAddr,callbacklog))\n // .then(dbrating(dbAddr)); \n // runwhendone(yelprating,zomatorating,googlerating,internalrating);\n}", "function runExercise06 () {\n console.log(\"= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\");\n console.log(\"JS-1 - week 1 - Exercise 06\");\n console.log(\"Declaring arrays and adding elements\");\n console.log(\"- - - - - - - - - - - - - - - - - - - -\");\n console.log(\"declare a variable `emptyElements` and initialize it to an empty array\");\n let emptyElements=[];\n console.log(\"The value of the `emptyElements` variable is an empty array\");\n console.log(emptyElements);\n console.log(\"Declare an array `myFavoriteAnimals` containing my 3 favorite animals\");\n let myFavoriteAnimals=['Frilled Shark','Martialis Huereka','Jelly Fish'];\n console.log(myFavoriteAnimals);\n console.log(\"Add another element to the array `myFavoriteAnimals` with the value `Piglet`\");\n myFavoriteAnimals.push('Piglet');\n console.log(myFavoriteAnimals);\n console.log(\"= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\");\n console.log(\" \");\n}", "function main() {\n let firstNumber, secondNumber; //Variables particular to JavsScript Assignment\n //Get the value of the Heighth Input Field, id=\"testfield1\", assign it to a variable\n firstNumber = document.getElementById(\"textField1\").value;\n secondNumber = document.getElementById(\"textField2\").value;\n //Validate by alert or HTML Text in p-tag\n document.getElementById(\"validityTest1\").innerHTML = alert (testNaN (firstNumber) );\n document.getElementById(\"validityTest1\").innerHTML = testNaN (firstNumber);\n document.getElementById(\"validityTest2\").innerHTML = alert (testNaN (secondNumber) );\n document.getElementById(\"validityTest2\").innerHTML = testNaN (secondNumber);\n if (stop == true) {\n document.getElementById(\"answer\").innerHTML = \"Restart because I said so.\"; //Change to more appropriate message\n } else {\n //Difference between calling functions with arguements and sending to parameter's, local variables\n console.log(\"What did you say?\", solution (firstNumber, secondNumber)); // Change to more appropriate message\n document.getElementById(\"answer\").innerHTML = \"What did you say? \" + solution (firstNumber, secondNumber);\n }\n} //End main()", "function setup() {\n CONTROLS = {\n up: [UP_ARROW, \"w\"],\n down: [DOWN_ARROW, \"s\"],\n left: [LEFT_ARROW, \"a\"],\n right: [RIGHT_ARROW, \"d\"],\n new_game: [\"n\"],\n start: [ENTER]\n };\n createCanvas(SCREEN, SCREEN);\n UP = createVector(0, -BOX);\n DOWN = createVector(0, BOX);\n RIGHT = createVector(BOX, 0);\n LEFT = createVector(-BOX, 0);\n snake = new Snake();\n sec = second();\n new Apple;\n}", "function check() {\r\n\tconsole.log(\"Today's special guest requirements: \" + specialGuest);\r\n\tconsole.log(\"Yesterday's special guest requirements: \" + specialPre);\r\n\treturn(\"Check complete.\");\r\n}", "function main() {\n\n}", "function js3()\n{\n var x, text, y;\n\n // Get the value of the input field with id=\"numb\"\n x = document.getElementById(\"numb\").value;\n\n // If x is Not a Number or less than one or greater than 10\n if (isNaN(x) || x < 1 || x > 100) {\n text = \"Input not valid\";\n } else {\n text = \"Input OK\";\n\n for(var i = 0; i <= x; i++)\n {\n if( (i % 3 == 0) && (i % 5 == 0))\n {\n\n console.log(\"Hee-Haw!\");\n document.writeln(\"Hee-Haw!\");\n //document.getElementById(\"assert\").innerHTML = \"Hee-Haw!\";\n }\n else if(i % 3 == 0)\n {\n console.log(\"Hee!\");\n document.writeln(\"Hee!\");\n // document.getElementById(\"assert\").innerHTML = \"Hee!\";\n }\n else if(i % 5 == 0)\n {\n console.log(\"Haw!\");\n document.writeln(\"Haw!\");\n // document.getElementById(\"assert\").innerHTML = \"Haw!\";\n }\n else\n {\n console.log(i);\n document.writeln(i +\"\\r\");\n //document.getElementById(\"assert\").innerHTML = i;\n\n }\n }\n }\n //loop to go over the input amount with the statements from the JS2 review question\n\n\n //Display the status of input\n document.getElementById(\"demo\").innerHTML = text;\n //document.getElementById(\"assert\").innerHTML = y;\n}", "function validateInput()\n{\n /*\n let errorLabel = document.getElementById(\"error-label\");\n let prompt = document.getElementById(\"prompt\");\n let functionName = document.getElementById(\"function-name\");\n let topic = document.getElementById(\"topic\");\n let firstTestCase = document.getElementById(\"first-test-case\");\n let firstOutput = document.getElementById(\"first-output\");\n let secondTestCase = document.getElementById(\"second-test-case\");\n let secondOutput = document.getElementById(\"second-output\");\n \n if(prompt.value.length == 0 || prompt.value.length > 128)\n errorLabel.innerHTML = \"The prompt must be nonempty and less than or equal to 128 characters.\";\n else if(functionName.value.length == 0 || functionName.value.length > 64)\n errorLabel.innerHTML = \"The function name must be nonempty and less than or equal to 64 characters.\";\n else if(topic.value.length == 0 || topic.value.length > 32)\n errorLabel.innerHTML = \"The topic must be nonempty and less than or equal to 32 characters.\";\n else if(firstTestCase == null || firstTestCase.value.length == 0 || firstTestCase.value.length > 64)\n errorLabel.innerHTML = \"The first test case must be nonempty and less than or equal to 64 characters.\";\n else if(firstOutput == null || firstOutput.value.length == 0 || firstOutput.value.length > 64)\n errorLabel.innerHTML = \"The first output must be nonempty and less than or equal to 64 characters.\";\n else if(secondTestCase == null || secondTestCase.value.length == 0 || secondTestCase.value.length > 64)\n errorLabel.innerHTML = \"The second test case must be nonempty and less than or equal to 64 characters.\";\n else if(secondOutput == null || secondOutput.value.length == 0 || secondOutput.value.length > 64)\n errorLabel.innerHTML = \"The second output must be nonempty and less than or equal to 64 characters.\";\n else\n */\n attemptQuestionCreation();\n \n}", "function runit() {\n var prog = simple_coding.getTextArea().value;\n console.log(\"************code\"+prog)\n var mypre = document.getElementById(\"output\");\n console.log(\"************mypre \"+mypre)\n\n mypre.innerHTML = '';\n Sk.pre = \"output\";\n // console.log(\"-----------------1\")\n Sk.configure({output:outf, read:builtinRead});\n // console.log(\"-----------------2\" +Sk.TurtleGraphics)\n // console.log(\"-----------------3\" +Sk.TurtleGraphics)\n\n (Sk.TurtleGraphics || (Sk.TurtleGraphics = {})).target = 'mycanvas';\n var myPromise = Sk.misceval.asyncToPromise(function() {\n return Sk.importMainWithBody(\"<stdin>\", false, prog, true);\n });\n myPromise.then(function(mod) {\n console.log('success');\n },\n function(err) {\n console.log(err.toString());\n });\n }", "function main(entryArgs){\n\tlet argV = entryArgs;\n\t//verify proper formatting\n\tif(argV.length > 3 || argV.length <= 2){\n\t\tconsole.log(\"Usage: $ node coding-exercise.js <path-to-input-file>\");\n\t\treturn;\n\t}\n\tlet filePath = entryArgs.slice(2);\n\tfilePath = path.resolve(filePath[0]);\n\t//verify file exists and read line by line\n\tif(fs.existsSync(filePath)){\n\t\tlet fileInterface = readline.createInterface({\n\t\t\tinput: fs.createReadStream(filePath)\n\t\t});\n\t\tfileInterface.on('line', function(line){\n\t\t\tlineParse(line);\n\t\t});\n\t\t//show file information once it has been completley read\n\t\tfileInterface.on('close', function(line){\n\t\t\tinfoOutput(filePath);\n\t\t});\n\t} else{\n\t\tconsole.log(\"Input: \" + filePath + \" does not exist.\");\n\t\treturn;\n\t}\n\n}", "function setup() {\n createCanvas(1008,1008);\n textFont(quicksand);\n tiger = new firstPredator(100, 100, 5, color(204, 159, 69), 40, tigerImage, UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW, 16); // press Shift key to sprint\n leopard = new firstPredator(100, 100, 15, color(200, 175, 175), 35, leopardImage, 87, 83, 65, 68, 70); // press F to sprint\n bear = new firstPredator(100, 100, 25, color(120, 114, 97), 45, bearImage, 73, 75, 74, 76, 72); // press H key to sprint\n antelope = new Prey(100, 100, 10, color(255, 100, 10), 50, antelopeImage);\n zebra = new Prey(100, 100, 8, color(255, 255, 255), 60, zebraImage);\n bee = new Prey(100, 100, 20, color(255, 255, 0), 10, beeImage);\n}", "function Main()\n {\n \n }", "function ec(){\n var n;\n var op=prompt(\"seclect 1-9\",\"1\");\n switch(op){\n case \"1\":\n \n n= \"Economy<br>1)India opposes binding commitments for eoss-border goods clearance<br>2)NITI Aayog beginasier crs groundwork on identifying more PSUs for sale<br>3)The story of Harshad Mehta and five ways it changed Dalal Street \";\n break;\n \n case \"2\":\n n=\"Environment<br>1) 500 volunteers fighting fire on Africa's tallest mountain<br> 2) Scientists return from Arctic with wealth of climate data\";\n break;\n \n case \"3\":\n n=\"Political<br>1)No place for arrogance, breaking of promises in a ruler's life: Sonia Gandhi's Dussehra message<br>2) COVID-19: Recovery rate touches 90%; only 8.5% of total caseload active in India\";\n break;\n \n case \"4\":\n n=\"Industry<br> 1)JK Cement looks to improve H2 growth numbers on higher demand, capacity <br>2)Hitachi ABB Power Grids India wins Rs 100-cr order from HPCL Rajasthan Refinery\";\n break;\n \n case \"5\":\n n=\"Science & Technology<br>1)Cisco looks to make hay as data bill may bring in deals from government, banks<br> 2)India to allow foreign companies too to make and launch satellites\";\n break;\n \n case \"6\":\n n=\"flimyfocus<br> 1) #UdtaPunjab: Hrithik feels the movie shows predicament Indian films face <br>2)Akshay Kumar admits there is a drug problem in Bollywood; says entire industry cannot be blamed for deeds of a few\";\n break;\n \n case \"7\":\n n=\"Sports<br> 1)Virat Kohli becomes third Indian to hit 200 sixes in IPL<br>2) Australia batswoman Grace Harris takes inspiration from Dhoni, wants to be a finisher like him\";\n break;\n \n case \"8\":\n n=\"International<br> 1)View: New visas limits would be a self-inflicted wound for the US<br>2) Thailand protestors vow fresh protests after PM refuses to resign\";\n break;\n \n case \"9\":\n n=\"End the search\";\n break;\n \n default :\n n=\"Invalid\";\n }\n document.getElementById(\"demo1\").innerHTML = n;\n}", "function Fundamentals() {\n\n }", "function task4_3() {\n var heading = \"<h1> Rules for naming JS variable </h1>\"\n var line1 = \"Variable names can only contain numbers, $,_ and 1st variables.\"\n var line2 = \"Variable names are case sensitive\"\n var line3 = \"Variable names should not be JS keywords\"\n var all = heading + \"<br>\" + line1 + \"<br>\" + line2 + \"<br>\" + line3\n\n document.write(all);\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n tiger = new Predator(100, 100, 5, color(200, 200, 0), 40, UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW, tigerImage, SHIFT);\n snake = new Predator(100, 100, 5, color(200, 100, 0), 40, 87, 83, 65, 63, snakeImage, 32);\n wolf = new Predator(100, 100, 5, color(100, 200, 0), 40, 85, 74, 72, 75, wolfImage, ENTER);\n bunny = new Prey(100, 100, 10, color(255, 100, 10), 50, bunnyImage);\n chicken = new Prey(100, 100, 8, color(255, 255, 255), 60, chickenImage);\n bee = new Prey(100, 100, 20, color(255, 255, 0), 10, beeImage);\n scoreBoard = new scoreboard(tiger.score, snake.score, wolf.score);\n}", "function setup() {\n createCanvas(381,100);\n }", "function setup() {\n const gameContainer = document.getElementById(\"game\");\n // temp\n word = words[0];\n getRandWords(words);\n setupBoard(targetWords);\n\n numWordsSpan.innerText = `${numWordsFound}/${totalWords}`;\n shuffleTiles();\n }", "function setup() {\n if (windowWidth / gX < windowHeight / gY) {\n s = (windowWidth - 5) / gX;\n } else {\n s = (windowHeight - 5) / gY;\n }\n createCanvas(s * gX, s * gY);\n\n ruleset = ECA;\n createGrid();\n\n fpsSlider = createSlider(1, 30, 5, 1);\n\n ruleSelect = createSelect();\n ruleSelect.option(\"Elementary Celular Automata (input to change rule)\");\n ruleSelect.option(\"Game Of Life\");\n ruleSelect.option(\"Brian's Brain\");\n ruleSelect.changed(changeRuleset);\n\n ruleInput = createInput('');\n ruleInput.input(changeRuleNum);\n\n randomCheckbox = createCheckbox('random start', false);\n randomCheckbox.changed(changeRandom);\n}", "function setup() {}" ]
[ "0.6215853", "0.607895", "0.5939162", "0.5936773", "0.58385456", "0.577253", "0.57572347", "0.57332367", "0.5733056", "0.5704488", "0.56910634", "0.5681246", "0.5653455", "0.5623779", "0.5623779", "0.5623179", "0.5595207", "0.559488", "0.5593485", "0.55865085", "0.55744195", "0.55636877", "0.5544898", "0.5539224", "0.55357206", "0.5519203", "0.5494648", "0.5486089", "0.547776", "0.5469433", "0.5459378", "0.5449155", "0.5446844", "0.5443634", "0.5440887", "0.5425835", "0.5419376", "0.54126525", "0.5411301", "0.5409974", "0.5402418", "0.53980404", "0.5393668", "0.53924876", "0.53848267", "0.537744", "0.53721964", "0.536735", "0.5365241", "0.5360504", "0.53553253", "0.53520143", "0.5349174", "0.53426707", "0.5338395", "0.53369963", "0.53323936", "0.53271973", "0.53236073", "0.5321543", "0.5320499", "0.5320238", "0.53165287", "0.53069586", "0.5305864", "0.5299335", "0.52992034", "0.5294814", "0.5279069", "0.5276868", "0.5274334", "0.52707505", "0.5270139", "0.5267198", "0.5251263", "0.52452254", "0.52445185", "0.522299", "0.52224886", "0.5220641", "0.5219595", "0.5215065", "0.52128613", "0.52106905", "0.520994", "0.5208491", "0.5206733", "0.52067274", "0.5206156", "0.52001846", "0.5198462", "0.5195459", "0.5195121", "0.5194833", "0.5194778", "0.5193856", "0.5190341", "0.5180755", "0.5180279", "0.5178119", "0.51767665" ]
0.0
-1
Return the courses given the particular filters
function addToCourse(course_id, session_key, user_name, students) { var status = 200; return (fetch(URL + course_id + "/", { method: 'PUT', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, body: JSON.stringify({session_key, user_name, students}) })).then((response) => { status = response.status; if (status >= ERROR_STATUS) { return response.json(); } else { return "Empty"; } }).then((json) => { if(status >= ERROR_STATUS) { return {status: false, body: json}; } else { return {status: true, body: json}; } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCourses () {\n return [\n {id: 'csc148h1'},\n {id: 'csc165h1'},\n {id: 'csc240h1'},\n {id: 'cog250y1'},\n {id: 'eng110y1'},\n {id: 'eng140y1'},\n {id: 'eng150y1'},\n {id: 'bio130h1'},\n {id: 'bio150y1'},\n {id: 'chm138h1'},\n {id: 'chm139h1'},\n {id: 'phl100y1'},\n {id: 'new232y1'}\n ];\n}", "function getEnglishCourses(courses){\n\t// let engCourses = []\n\t// courses.forEach(course => {\n\t// \tif (course.languages.indexOf(\"en\") != -1){\n\t// \t\tengCourses.push(course)\n\t// \t}\n\t// })\n\t//Shorthand version\n\tlet engCourses = courses.filter(course => course.languages.includes(\"en\"))\n\tconsole.log(\"engCourses\", engCourses)\n\treturn engCourses\n}", "function getCourses() {\n return breeze.EntityQuery\n .from(courseType.defaultResourceName)\n .using(manager)\n .execute()\n .then(function(data){\n return data.results;\n })\n }", "function getCourses(year, semester, courseType, studyType) {\n studyType = studyType || TYPE_MAJOR;\n var retCourses = [];\n for (var i = 0; i < courses.length; ++i) {\n if (courses[i].studyType == studyType && (!year || courses[i].year == year)) {\n if (!semester || semester == 0 || courses[i].semester == semester) {\n var course = courses[i];\n var type = course.type;\n if (!courseType || courseType == TYPE_ALL) {\n retCourses.push(course);\n }\n else if (courseType == TYPE_MAJOR && (type & TYPE_MAJOR)) {\n retCourses.push(course);\n }\n else if (courseType == TYPE_PUBLIC && (type & TYPE_PUBLIC)) {\n retCourses.push(course);\n }\n else if (courseType == TYPE_COMPULSORY && (type & TYPE_COMPULSORY)) {\n retCourses.push(course);\n }\n else if (courseType == TYPE_SELECTIVE && (type & TYPE_SELECTIVE)) {\n retCourses.push(course);\n }\n else if (type == courseType) {\n retCourses.push(course);\n }\n }\n }\n }\n\n //console.log(retCourses);\n return retCourses;\n }", "filterCourses(query, selectedTerm) {\n return this.props._terms.availableCourses[selectedTerm].filter(course => course.code.includes(query.replace(/ /g, '').toUpperCase()));\n }", "async function searchCourses() {\n if (!isBrowser) {\n throw 'This method requires the window object.'\n }\n\n setIsLoading(true)\n\n if (abortPreviousRequest !== undefined) {\n abortPreviousRequest()\n }\n\n const controller = new AbortController()\n const signal = controller.signal\n abortPreviousRequest = controller.abort.bind(controller)\n\n const {\n data,\n meta\n } = await fetchCourses({\n searchQuery,\n sort: searchSort,\n ...(typeof searchFilterTopicId === 'string' && searchFilterTopicId !== 'all_topics' ? { filterTopic: parseInt(searchFilterTopicId) } : {}),\n filterLevel: searchFilterLevels,\n filterLanguage: searchFilterLanguageId,\n ...(typeof searchFilterLanguageId === 'string' && searchFilterLanguageId !== 'all_languages' ? { filterLanguage: parseInt(searchFilterLanguageId) } : {}),\n pageNumber,\n }, signal)\n\n setCourses(data)\n setLastSearchQuery(searchQuery)\n setResultsMeta(meta)\n\n setIsLoading(false)\n }", "searchCourses(text){\n return function filter(value){\n return (value.search(text) !== -1);\n }\n }", "getCoursesData(filters) {\n return axios\n .get(this.apiUrl() + `/api/course-analytics/` + this.getQueryParams(filters), {\n headers: this.authHeader(),\n })\n }", "function getListCourse(){\n\t\t$http.get(app.baseUrl + \"admin/api/course/\" + $scope.categoryId).then(function(response) {\n\t\t\t$scope.courses = response.data;\n\t\t});\n\t}", "getDetailedCourseData(courseId, filters) {\n return axios\n .get(this.apiUrl() + `/api/course-analytics/${courseId}/` + this.getQueryParams(filters), {\n headers: this.authHeader(),\n })\n }", "async function getCourses() {\n\n const pageNumber = 2;\n const pageSize = 10;\n\n const courses = await Course\n .find({ author: 'Vivek', isPublished: true })\n // .find()\n // .or([ {author: 'Vivek'}, {isPublished: false} ])\n // .and([])\n\n // // starts with Vivek\n // .find({ author: /^Vivek/ })\n // // ends with Malhan\n // .find({ author: /Malhan$/i }) // i for case-insensitive\n // // contains Vivek\n // .find({ author: /.*Vivek.*/ })\n\n // pagination - to get the documents in the given page\n .skip((pageNumber - 1) * pageSize)\n .limit(pageSize)\n\n .sort({ name: 1 })\n .select({ name: 1, tags: 1, author: 1, isPublished: 1 })\n // .estimatedDocumentCount();\n console.log(courses);\n}", "function LoadUserCourses() {\n lessonFactory.LoadUserCourse($rootScope.currentUser.id).then(function (result) {\n $scope.allCourses = result;\n //$scope.allCourses = filterByUser;\n })\n }", "function filterSelectedCourse(courseTranscripts, ropCourses) {\n if (!ropCourses.length) {\n return courseTranscripts;\n }\n\n return courseTranscripts.filter(\n transcript =>\n !ropCourses.some(\n course =>\n transcript.requestId === course.requestId &&\n transcript.courseCode === course.courseCode &&\n transcript.courseTerm === course.courseTerm\n )\n );\n }", "function getCourses(req,res,next){\n courseService.getAllCourses(req).then(courses => {\n userService.getById(req.user.sub).then(x => {\n //x is our user\n let answer = [];\n if (x.role.toString().localeCompare('Guest') === 0){\n courses.forEach(element => {\n if (element.public){\n answer.push(element);\n }\n });\n res.json(answer);\n return;\n }\n let userCourses = x.courses;\n courses.forEach(element => {\n let current = userCourses.find(c => c.toString().localeCompare(element._id) == 0);\n if (current){\n answer.push(element);\n }\n });\n //Return the courses back to the user\n res.json(answer)\n }).catch(err => next(err));\n })\n}", "async function readCourses() {\n const pageNumber = 1;\n const pageSize = 10;\n const filter1 = { name: 'Angular Course' };\n const filter2 = { name: 'Node.js Course' };\n const filter3 = { name: /\\./ };\n const doubleFilter = [filter1, filter2];\n const courses = await Course.find(filter3)\n .limit(pageSize)\n .skip((pageNumber - 1) * pageSize)\n .sort({ name: 1 })\n .count();\n console.log(courses);\n}", "getCourses() {\n return axios\n .get(this.apiUrl() + \"/courses/\", {\n headers: this.authHeader(),\n })\n }", "function applyFilterByCredits() {\n var text1 = inputSearchBoxMin.value;\n var text2 = inputSearchBoxMax.value;\n if (text1 == null && text2 == null) {\n text1 = '';\n text2 = '';\n }\n clearCoursesInTable();\n var coursesFilteres = searchCourseByCredits(text1, text2, dataCourses);\n renderCoursesInTable(coursesFilteres);\n}", "function getCourses(callback) {\n uwclient.get('/courses.json', function (err, res) {\n if (err) return callback(err, null);\n else return callback(null, res.data);\n });\n}", "function displayCourses(courses, courses_container, compiled) {\n var $search_val = $cours_search.val().toLowerCase();\n\n //\t var $cat = $categorie_select.val();\n //\tvar $cat = _.map( $categorie_select.val() , function(str){ return parseInt(str) ; }); // array of cat ids\n //\tvar $cat = _.filter($cat, function(num){ return num >0; });\n\n //\t\t var $location = parseInt($location_select.val());\n //\t\tvar $location = _.map( $location_select.val() , function(str){ return parseInt(str) ; }); // array of location ids\n //\t\tvar $location = _.filter($location, function(num){ return num >0; });\n\n //\t\tvar $school = parseInt($school_select.val()); // single school id\n //\t\tvar $school = _.map( $school_select.val() , function(str){ return parseInt(str) ; }); // array of school ids\n //\t\tvar $school = _.filter($school, function(num){ return num >0; });\n\n var $school = new Array();\n var $location = new Array();\n var $cat = new Array();\n var $prof = new Array();\n\n $search_checks.each(function () {\n var $this = $(this);\n var $check_type = $this.data(\"field\");\n if ($this.is(\":checked\")) {\n if ($check_type == \"school\") {\n $school.push(parseInt($this.val()));\n } else if ($check_type == \"location\") {\n $location.push(parseInt($this.val()));\n } else if ($check_type == \"category\") {\n $cat.push(parseInt($this.val()));\n } else if ($check_type == \"professeur\") {\n $prof.push(parseInt($this.val()));\n }\n }\n });\n $school = _.filter($school, function (num) {\n return num > 0;\n });\n $location = _.filter($location, function (num) {\n return num > 0;\n });\n $cat = _.filter($cat, function (num) {\n return num > 0;\n });\n $prof = _.filter($prof, function (num) {\n return num > 0;\n });\n\n if (\n $search_val != \"\" ||\n $school.length > 0 ||\n $location.length > 0 ||\n $cat.length > 0\n ) {\n $reset_course_form.show();\n } else {\n $reset_course_form.hide();\n }\n\n var s_courses = processCourses(\n courses,\n $search_val,\n $cat,\n $location,\n $school,\n $prof\n );\n\n if (s_courses.length == 0) {\n $course_size.html(\"<p>Aucun cours trouvé </p>\");\n } else {\n $course_size.html(\"\"); // s_courses.length + ' courses found'\n }\n\n courses_container.html(compiled({ courses: s_courses }));\n $(\".single_cours_inner\").matchHeight();\n\n $(\"#back_to_top\").on(\"click\", function (e) {\n e.preventDefault();\n $(\"html, body\").animate({ scrollTop: 0 }, 500);\n });\n }", "function listCourses() {\n console.log('It is hitting listCourses')\n var request = gapi.client.classroom.courses.list({\n pageSize: 10\n });\n\n request.execute(function(resp) {\n var courses = resp.courses;\n appendPre('Courses:');\n\n if (courses.length > 0) {\n for (i = 0; i < courses.length; i++) {\n var course = courses[i];\n appendPre(course.name)\n }\n } else {\n appendPre('No courses found.');\n }\n\n });\n }", "function getCompositeCourse(handler) {\n let offset = handler.params.offset;;\n let limit = handler.params.limit;;\n let level = handler.params.level;\n\n handler.url = COMPOSITE_COURSE_URL.replace(/\\{offset\\}/i, offset).replace(/\\{limit\\}/i, limit).replace(/\\{level\\}/i, level);\n\n return network.GET(handler);\n}", "async function getCourses(){\r\n const courses= await Course\r\n //.find()\r\n //Javascript constructor that we used to store multiple values is \"ARRAY[]\"\r\n //To display author of the course is Mosh or book published is true we use \"or\" operator\r\n .or([ {author: 'Mosh'},{isPublished:true} ])\r\n \r\n //To display author of the course is Mosh and book is published is true we use \"and\" operator\r\n\r\n .and([ {author: 'Mosh'},{isPublished:true} ])\r\n\r\n\r\n .limit(10)\r\n .sort({name: 1})\r\n .select({ name:1 , tags: 1}); \r\n console.log(courses);\r\n}", "async function filterCourseByDepartmentId(username, allCourses){\n \n const data= await Repositories.getUser(username);\n const user = data.body\n const departmentId = user.department;\n const courseList = [];\n for (course of allCourses){\n \n if (course.department._id.toString() === departmentId){\n courseList.push(course);\n }\n }\n return courseList;\n}", "function getCoreCourses(courses) {\n var core = [];\n for (var i=0; i<courses.length; i++) {\n if (courses[i].type === \"Core\") {\n core.push(courses[i]);\n }\n }\n return core;\n }", "async function getCourses() {\n return await microcredapi.get(`/unit/${window.localStorage.getItem('userId')}`).then(response => {\n setCourses(response.data.units);\n })\n }", "async function getListCourse() {\n return await Course\n .find({isPublished: true})\n .or([\n {price: {$gte: 15}}\n , {name: /.*by.*/i}\n ])\n .sort({name: 1})\n .select({name: 1, author: 1});\n}", "function AppController(props) {\n const [selectedCourse, setSelectedCourse] = useState(null);\n const [filterSettings, setFilterSettings] = useState({});\n const [courses, setCourses] = useState([]);\n\n console.log(\"completed courses: \" + props.completed);\n\n // set courses in state on initial load\n useEffect(() => {\n setCourses(CourseModel.loadCourses(JSON.parse(props.courses), JSON.parse(props.completed)));\n const courseTypes = CourseModel.getCourseTypes(courses);\n // set initial filter settings\n setFilterSettings({ ...filter.getFilterSettings() });\n }, [])\n\n /**\n * Sets the selected course\n * @param {Array} courses courses\n * @param {String} id Id of course\n */\n const selectCourse = (id) => {\n if (selectedCourse === null) {\n setSelectedCourse(CourseModel.getCourseById(courses, id));\n } else {\n if (selectedCourse.id === id) {\n setSelectedCourse(null);\n } else {\n setSelectedCourse(CourseModel.getCourseById(courses, id));\n }\n }\n };\n\n /**\n * Sets filters\n * @param {String} type\n * @param {Object} params\n */\n const setFilter = (type, params) => {\n console.log(\"SET FILTER: \", type, params);\n\n filter.setFilter(type, params);\n\n const filteredCourses = filter.runFilter(courses);\n\n setCourses(filteredCourses)\n\n console.log(\n \"SET FILTER SETTINGS: \",\n filter.getFilterSettings(),\n filterSettings\n );\n setFilterSettings({ ...filter.getFilterSettings() });\n };\n\n /**\n * returns the app jsx structure\n */\n return (\n <div className=\"mark-test-style\">\n <div id=\"course-view-top\">\n <div className=\"left\">\n <CourseMap\n selectedCourse={selectedCourse}\n selectCourse={selectCourse}\n />\n <DegreeProgress\n courses={courses}\n courseBins={CourseModel.getCourseBins(courses)}\n degreeCompletion={CourseModel.getDegreeCompletion(\n courses\n )}\n />\n </div>\n\n <CourseList\n courses={courses}\n selectedCourse={selectedCourse}\n selectCourse={selectCourse}\n />\n </div>\n <div id=\"course-view-bottom\">\n <CourseInspector selectedCourse={selectedCourse} />\n <CourseControls\n filterSettings={filterSettings}\n setFilter={setFilter}\n // courseTypes={courseTypes}\n />\n </div>\n </div>\n );\n}", "getAssignments(courseId, filters) {\n return axios\n .get(this.apiUrl() + `/api/assignment-analytics/${courseId}/` + this.getQueryParams(filters), {\n headers: this.authHeader(),\n })\n }", "getStudentCourses(studentid) {\n return Boekingen.find({$and:[{Student: studentid},{Academiejaar: currentAcademiejaar }]})\n }", "getQuizzes(courseId, filters) {\n return axios\n .get(this.apiUrl() + `/api/quiz-analytics/${courseId}/` + this.getQueryParams(filters), {\n headers: this.authHeader(),\n })\n }", "static async getCourseList(){\n const request = await fetch('https://tddd27-nikha864-backend.herokuapp.com/get_courses', {\n method: 'get'\n });\n return await request.json();\n }", "function filterCourses() {\n var selector;\n var deptIndex;\n var words;\n $(\"line.link\").show();\n for (var i = 0; i < departments.length; i++) {\n deptIndex = i + 1;\n // if department is on, display it.\n if ($(\"#legend input[type='checkbox'][data-group='\"+deptIndex+\"']\").attr(\"checked\") == \"checked\") {\n $(\"circle.deptNum\" + deptIndex).show();\n }\n // if department is off, don't display it.\n else {\n selector = \"circle.deptNum\" + deptIndex + \", \";\n selector += \"line.source\" + (deptIndex + 1) + \", line.target\" + (deptIndex + 1);\n $(selector).hide();\n }\n }\n \n // get all words in textbox, hide course if it lacks these words\n words = $(\"input[name='keywordFilter']\").val()\n .replace(\",\", \" \")\n .split(\" \");\n console.debug(words);\n \n $(\"circle.node\").filter(function() {\n var allWordsInDescription = true;\n for (var i = 0; i < words.length; i++) {\n if (-1 >= this.__data__.description.toUpperCase().search(words[i].toUpperCase()))\n allWordsInDescription = false;\n }\n return (!allWordsInDescription);\n })\n .each(function() {\n var courseIndex = this.__data__.index;\n $(\"#node\" + courseIndex).hide();\n $(\"line[data-source-index='\" + courseIndex + \"']\").hide();\n $(\"line[data-target-index='\" + courseIndex + \"']\").hide();\n });\n \n \n}", "function list_all_courses_by_program(program_detail) {\n return program_detail.mandatory.concat(program_detail.optional);\n}", "function listCourses() {\n var courses = [];\n var pageToken = null;\n var optionalArgs = {\n pageToken: pageToken,\n pageSize: 100\n };\n while (true) {\n var response = Classroom.Courses.list(optionalArgs);\n var courses = response.courses;\n if (!pageToken) {\n break;\n }\n }\n if (courses.length === 0) {\n Logger.log(\"No courses found.\");\n } else {\n Logger.log(\"Courses:\");\n for (course in courses) {\n Logger.log('%s (%s)', courses[course].name, courses[course].id);\n }\n }\n}", "filterTable(timetable){\n var rooms = [];\n var courses = [];\n if(this.state.roomsFilter.length == 0) {\n rooms = this.state.rooms;\n }\n if(this.state.coursesFilter.length == 0) {\n courses = this.state.subjects;\n }\n this.state.roomsFilter.forEach(r => {rooms.push(r.value)});\n this.state.coursesFilter.forEach(c => {courses.push(c.value)});\n var filteredTimetable = [];\n\n timetable.forEach(lect => {\n if (rooms.indexOf(lect.room) != -1 && courses.indexOf(lect.name) != -1){\n filteredTimetable.push(lect);\n }\n })\n return filteredTimetable\n }", "async function getAllCourses() {\n return await Course.find({});\n}", "function getCourses(program) {\n\n // loading\n $('#spin1').show();\n\n // mongo db MLab API query\n var query = \"{\\\"programs\\\":{\\\"$in\\\":[\\\"\" + program + \"\\\"]}}\"\n\n // get listed requirements for requested program\n $.ajax({\n // don't want to asyncronously render graph without data\n async: false,\n dataType: \"json\",\n url: \"https://api.mlab.com/api/1/databases/bluetest/collections/courses3?q=\" + query + \"&apiKey=\" + API_KEY,\n success: function(progCourses) {\n //singles = data;\n courses = progCourses;\n }\n });\n\n // get user course history\n // TODO: user minerva API\n $.ajax({\n async: false,\n global: false,\n dataType: \"json\",\n url: \"user_details/user-1.json\",\n success: function(userCourses) {\n coursesTaken = userCourses;\n }\n });\n\n}", "function listTeachingYearFilters() {\n const requestOptions = {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n Authorization: authHeader(),\n };\n\n const url = '/teaching_years/';\n return axios.get(`${apiUrl}${url}`, requestOptions)\n .then(response => response.data).then(teachingYearFilters => teachingYearFilters);\n}", "function availCourses(completed_courses){\n\n\n // return array\n var ret = [];\n\n\n\n console.log(completed_courses);\n\n // for each class in class_data,\n class_data.forEach(function(course){\n //if course not in completed_courses or ret array, check for prereqs\n if(completed_courses.findIndex(c => c.course ===course.title) ==-1){\n console.log(\"NOT COMPLETED: \" + course.title);\n var met = true;\n course.prereqs.forEach(function(p){\n // if prereq not in completed_courses, prereqs not met\n if(completed_courses.findIndex(c =>c.course ===p) ==-1){\n console.log(\"didnt find \" + p+ \"for \" + course.title);\n met = false;\n }\n });\n }\n //if prereqs are met and its not in return list, add it to return list\n if(met && ret.findIndex(x=> x.title===course.title) ==-1)\n ret.push(course);\n\n });\n\n\n return ret;\n\n\n}", "getVideos(courseId, filters) {\n return axios\n .get(this.apiUrl() + `/api/video-analytics/${courseId}/` + this.getQueryParams(filters), {\n headers: this.authHeader(),\n })\n }", "async function getRecsFromFilterCheckboxes() {\n const selectedCates = getSelectedCateFilterItems();\n const selectedAreas = getSelectedAreaFilterItems();\n const recsByAreas = await getRecInfosForMultipleAreas(selectedAreas);\n const recsByCates = await getRecInfosForMultipleCates(selectedCates);\n\n if (selectedCates.length === 0 && selectedAreas.length === 0) {\n return \"no filter\";\n }\n else if (selectedCates.length === 0) {\n return recsByAreas;\n }\n else if (selectedAreas.length === 0) {\n return recsByCates;\n }\n else {\n const filteredRecs = recsInBothArrs(recsByCates, recsByAreas);\n return filteredRecs;\n }\n }", "function getEnrolledCourses(user, goto, res) {\n // get user enrolled classes\n var user_classes = user.courses;\n var class_details = [];\n var returnObj;\n\n // create query to link userClasses with courses model to get class info\n user_classes.forEach(course => {\n class_details.push(course);\n });\n\n db.collection('courses').find({courseId: {\"$in\":class_details}}).toArray(function (err, result) {\n returnObj = result;\n var gotoUrl = \"/view/\" + goto +\"\";\n return res.render(__dirname + gotoUrl, {print:result});\n });\n}", "function loadCourseList(){\n\tget(\"searchlist/load_list/\", function(){\n\t\tcourseList = arguments[0].split(\",\");\n\t});\n}", "function filterData4(r, form){\n let showOpenOnly = form.showOpenOnly ? form.showOpenOnly : false;\n result = [];\n // loop through form;\n console.log(r);\n console.log(form);\n for (crit of form.courses){\n\n // find correct data\n let info;\n for (data of r){\n // console.log(\"**************************\");\n // console.log(data);\n // console.log(crit);\n if (data[0].subject + data[0].catalog_number == crit.name){\n info = data;\n break;\n }\n }\n console.log(info);\n // make shit to push it in result\n classes = [];\n tut = [];\n for (section of info){\n if (section.section.includes(\"LEC\")){\n if ((!crit.section || crit.section == \"Any\" || crit.section == section.section)\n && (!showOpenOnly || crit.enrolled || section.enrollment_capacity - section.enrollment_total > 0)){\n classes.push(reformatApiData(section));\n }\n } else if (section.section.includes(\"TUT\")){\n // get corresponding related info;\n let r;\n if (crit.related){\n for (comp of crit.related){\n // console.log(section.section);\n // console.log(comp);\n if (comp.section && comp.section.includes(\"TUT\")){\n r = comp;\n break;\n }\n }\n }\n if (!r){\n r = {section: \"Any\"};\n }\n if ((!r.section || r.section == \"Any\" || r.section == section.section)\n && (!showOpenOnly || r.enrolled || section.enrollment_capacity - section.enrollment_total > 0)){\n tut.push(reformatApiData(section));\n }\n }\n }\n result.push({\n name: info[0].subject + info[0].catalog_number,\n title: info[0].title,\n type: \"LEC\",\n classes: classes\n });\n if (tut.length > 0) {\n result.push({\n name: info[0].subject + info[0].catalog_number,\n title: info[0].title,\n type: \"TUT\",\n classes: tut\n });\n }\n }\n return result;\n}", "getConditions(cb) {\n this.session.get({ url: this.url + '/api/filter/conditions' }, cb);\n }", "function getCourses(handler) {\n\t// Get URL from where to fetch courses json\n\tvar DHISFolder = getDHISInstallFolder();\n\tvar url = getHostRoot() + '/' + DHISFolder + '/api/systemSettings/VJFS_courses';\n\n\t// Get courses as json object and on success use handler function\n\t$.ajax({\n\t\turl: url,\n\t\tlocalCache : true,\n cacheTTL : 0.1,\n isCacheValid : function(){ \n return true;\n },\n\t\tdataType: 'json'\n\t}).success(function(courses) {\n\t\thandler(courses);\n\t}).error(function(error) {\n\t\thandler(null);\n\t});\n}", "async function getCourses() {\n\n const courses = await Course\n .find({ isPublished: true, tags: { $in: ['backend','backend'] } }) ///// course that have tags frontend or backend tags\n .limit(10)\n .sort('-price') /// 1 for ascending order,,, name: -1 for descending order\n .select('name author price') /// select properties that you want to return \n\n ///// or\n\n const courses = await Course\n .find({ isPublished: true }) ///// course that have tags frontend or backend tags\n .or([{ tags: 'frontend'},{ tags:'backend' }])\n .limit(10)\n .sort('-price') /// 1 for ascending order,,, name: -1 for descending order\n .select('name author price') /// select properties that you want to return \n\n console.log(\"courses \", courses)\n}", "getCourse(req, callback) {\n var self = this;\n var reqObj = req.body;\n var errorResponseObj = {\n status: false,\n data: {},\n };\n var responseObject = {};\n var courseTableName = \"course\";\n var condition = {};\n if (reqObj.curriculumCode && reqObj.subject) {\n condition = {\n curriculumCode: reqObj.curriculumCode,\n subject: reqObj.subject\n }\n } else {\n condition = {\n _id: ObjectId(reqObj._id),\n };\n }\n\n self.apiServiceInstance.find(\n condition,\n {},\n courseTableName,\n function (err, courseSingleData) {\n if (courseSingleData.length > 0) {\n responseObject[\"status\"] = true;\n responseObject[\"data\"] = courseSingleData;\n callback(null, responseObject);\n } else {\n errorResponseObj['error'] = err;\n callback(err, errorResponseObj);\n }\n }\n );\n }", "function showCourses() {\n\tif (xRequest.readyState == 4) {\n\t\tvar response = xRequest.responseXML;\n\t\tif (response) {\n\t\t\tvar courses = response.getElementsByTagName('course');\n\t\t\tcontainerDiv = $(\"#coursesInner\");\n\n\t\t\tif (courses.length == 0) {\n\t\t\t\tprintNoResults();\n\t\t\t} else {\n\t\t\t\tprintCourses(courses);\n\t\t\t}\n\t\t}\n\t}\n}", "function sectionate(courses) {\n\tfor (var i=0; i < courses.length; i++) {\n\t\tif (courses[i].courseNum < 100) {\n\t\t\tlowerCourses.push(courses[i]);\n\t\t}\n\t\telse if ((courses[i].courseNum >= 100) && (courses[i].courseNum < 200)) {\n\t\t\tupperCourses.push(courses[i]);\n\t\t}\n\t\telse if (courses[i].courseNum >= 200) {\n\t\t\tgradCourses.push(courses[i]);\n\t\t}\n\t\telse {\n\t\t\tnoNumCourses.push(courses[i]);\n\t\t}\n\t}\n}", "function getCourses(startIndex, endIndex, sheet, minSems) {\n if (minSems === undefined) {\n minSems = 2;\n }\n if (sheet == undefined || sheet == null) {\n sheet = SpreadsheetApp.openByUrl(\"https://docs.google.com/spreadsheets/d/11tRpkgU0JoV_qTa_KsI8yEO6aLz8KY9wtGmIQXkdaXs/edit#gid=0\").getSheets()[0];\n }\n var courses = [];\n var values = sheet.getRange(\"A:C\").getValues();\n if (startIndex == undefined || startIndex < 0) {\n startIndex = 0;\n }\n if (endIndex == undefined || endIndex > values.length) {\n endIndex = values.length;\n }\n for (var i = startIndex; i < endIndex; i++) {\n var c = new course(values[i][0], values[i][1], values[i][2]);\n //Only push if the course has some history\n if (c != undefined && c.infos.length >= minSems) {\n courses.push(c);\n }\n //Reset c to undefined. This is stupid.\n c = undefined;\n }\n return courses;\n}", "function getCourses(school, text){\n xr(text, 'div[id*=\"win0divSSR_CLSRSLT_WRK_GROUPBOX2\\\\$\"]', [{\n course_name: '.PAGROUPBOXLABELLEVEL1', \n course_nbr: '.PSLEVEL3GRIDROW span[title=\"Class Nbr\"]',\n section: '.PSLEVEL3GRIDROW span[title=\"View Details\"]',\n days_times: 'tr:nth-child(1) > td div table[class=PSLEVEL1GRIDNBONBO] td[class=PSLEVEL3GRIDROW]:nth-child(3) span',\n room: 'tr:nth-child(1) > td div table[class=PSLEVEL1GRIDNBONBO] td[class=PSLEVEL3GRIDROW]:nth-child(4) span',\n instructor: 'tr:nth-child(1) > td div table[class=PSLEVEL1GRIDNBONBO] td[class=PSLEVEL3GRIDROW]:nth-child(5) span',\n meeting_dates: 'tr:nth-child(1) > td div table[class=PSLEVEL1GRIDNBONBO] td[class=PSLEVEL3GRIDROW]:nth-child(6) span',\n status: 'tr:nth-child(1) > td div table[class=PSLEVEL1GRIDNBONBO] td[class=PSLEVEL3GRIDROW]:nth-child(7) img@alt',\n }])((err, courses) => db.courses.insert({school , courses}))\n}", "function loadCourses(enrolledCourses) {\n\t\tvar method = 'GET';\n\t\tvar req = JSON.stringify({});\n\t\tvar url = './courses?';\n\t\tvar n = enrolledCourses.length;\n\t\tfor (var i = 0; i < n - 1; i++) {\n\t\t\turl = url + 'course_id[]=' + enrolledCourses[i] + '&';\n\t\t}\n\t\turl = url + 'course_id[]=' + enrolledCourses[n - 1];\n\t\t//alert(url);\n\t\tajax(method, url, req,\n\t\t\t// Successful callback\n\t\t\tfunction (res) {\n\t\t\t\tvar availableCourses = JSON.parse(res);\n\t\t\t\t//alert(availableCourses[0]);\n\t\t\t\tif (availableCourses.length != 0 ) {\n\t\t\t\t\tlistCoursesInSelector(availableCourses);\n\t\t\t\t}\n\t\t}\n\t\t);\n\t}", "get courses() {\n // 6. key/value pairs \n return {\n appetizers: this._courses.appetizers,\n mains: this._courses.mains,\n desserts: this._courses.desserts\n }\n }", "get courses() {\n return {\n appetizers: this.appetizers,\n mains: this.mains,\n desserts: this.desserts,\n }\n }", "async function getCoursesFromApi (accountNumber) {\n var courses = await canvas.get(`/api/v1/accounts/${accountNumber}/courses`);\n return courses.map( course => limitObjectKeys(course, outputKeys) );\n }", "function filterList(allStudents) {\n if (currentFilter === \"all\" || currentFilter.length === 0) {\n return allStudents;\n } else if (currentFilter === \"prefect\") {\n const list = allStudents.filter((student) => student.isPrefect === true);\n return list;\n } else if (currentFilter === \"expelled\") {\n const list = expelledStudents;\n return list;\n } else {\n const list = allStudents.filter((student) => student.house === currentFilter);\n return list;\n }\n}", "returnCourses() {\r\n this.log(`Getting list of courses...`);\r\n return this.context\r\n .retrieve(`\r\n SELECT title, Users.firstName || \" \" || Users.lastName As user\r\n FROM Courses\r\n INNER JOIN Users\r\n ON Courses.userId = Users.id\r\n `);\r\n }", "async function getAllCourses() {\n const response = await fetch('/api/courses');\n return handleJsonResponse(response);\n}", "function getCoursesForLearningGroup(learningGroupId) {\n // get learning group (hopefully from cache)...\n return getLearningGroup(learningGroupId)\n .then(function () {\n // query that always works\n console.log(\"MON courseType.custom: \" + courseType.custom);\n var query = breeze.EntityQuery\n .from(courseType.defaultResourceName)\n // query that works in Office365 / SPO and versions of SharePoint 2013\n // that have XXX 201X applied (this CU includes a bugfix)\n .where('LearningGroupId', 'eq', learningGroupId);\n /* In case it did not work aconnell has a hack (described in #5.12): */\n // .where('LearningGroup.Id', 'eq', learningGroupId)\n // .select(courseType.custom.defaultSelect + ',LearningGroup.Id')\n // .expand('LearningGroup');\n return manager.executeQuery(query)\n .then(function (data) {\n return data.results;\n });\n });\n }", "function getFakeCoursesData(){\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tid: 1,\n\t\t\t\t\tname: 'Curso 1',\n\t\t\t\t\tdescription: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.',\n\t\t\t\t\tduration: '4 semanas'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: 2,\n\t\t\t\t\tname: 'Curso 2',\n\t\t\t\t\tdescription: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.',\n\t\t\t\t\tduration: '4 semanas'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: 3,\n\t\t\t\t\tname: 'Curso 3',\n\t\t\t\t\tdescription: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.',\n\t\t\t\t\tduration: '4 semanas'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: 4,\n\t\t\t\t\tname: 'Curso 4',\n\t\t\t\t\tdescription: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.',\n\t\t\t\t\tduration: '4 semanas'\n\t\t\t\t}\n\t\t\t];\n\t\t}", "function getCourses() {\n var path = window.location.pathname\n var fields = path.split('/')\n var collegeBack = fields[1] + \"/\" + fields[2]; \n var college = fields[2].toUpperCase(); //Retrieves the college from the path name\n\n $(\"#collegeAbbr\").text(college);\n \n $.get(path + \"/getCourses\", function (data) {\n var courses = \"\";\n\n for (var i = 0; i < data.length; i++) {\n if (college === data[i].college_abbreviation) { //Only adds courses that with the college in the path name\n courses += \" <div id='collegewrap'> <a href='\" + path + \"/\" + data[i].course_code + \"'> <div id='contentwrap'> <div class='container'> <div class='row'> <div class='col-lg-4'> <h4 class='course'>\" + data[i].course_name + \"</h4> </div> <div class='col-lg-4'></div> <div class='col-lg-4'> <h4 class='course'>\" + data[i].course_code + \"</h4> </div> </div> <div class='row'> <div class='col-xs-12'> <h5>Course Leader : \" + data[i].course_leader + \"</h5> </div> </div> </div> </div> </a> </div>\"}\n }\n\n if(courses === \"\") { //Alters the heading if there is no courses\n $(\"#courses\").prev().text(\"There are currently no courses for this college!\");\n }\n\n $(\"#courses\").html(courses);\n });\n }", "async function get_all_courses(teacherid) {\n try {\n let res = await axios.get(`/get_classes/${teacherid}`, config);\n\n return res.data.data;\n } catch (err) {\n console.error(err);\n return [];\n }\n}", "getCourses() {\n let courses = [];\n let Subjects = this.getSubjects(this.props.courses);\n for (const course of Subjects) {\n courses.push(\n <SubjectsList\n data={course}\n setCheckBoxLike={(name, on) => this.props.setCheckBoxLike(name, on)}\n />\n )\n }\n return courses;\n }", "getStudentCourse(gid) {\n let s = this.getStudent(gid);\n return s.courses;\n\n }", "getSubjectsForCourse(req, callback) {\n var self = this;\n var reqObj = req.body;\n var errorResponseObj = {\n status: false,\n message: \"Subjects are not available for this curriculum\",\n };\n var responseObject = {};\n var curriculumTableName = \"subject\";\n\n let query = {\n curriculumCode: reqObj.curriculumCode\n };\n var criteria = {\n condition: query,\n sortOrder: { _id: 1 },\n projection: { userID: 0, _id: 0, curriculumCode: 0, subjectId: 0 }\n };\n\n self.apiServiceInstance.findDataAll(\n curriculumTableName,\n criteria,\n function (err, data) {\n if (data) {\n responseObject[\"status\"] = true;\n responseObject[\"data\"] = data;\n callback(null, responseObject);\n } else {\n console.log('Subjects data not listed. Due to -', err);\n errorResponseObj['error'] = err;\n callback(err, errorResponseObj);\n }\n }\n );\n }", "get courses() {\n return {\n appetizers: this.appetizers,\n mains: this.mains,\n desserts: this.desserts\n }\n }", "function getAvailableClasses(filter) {\n let feedbackToUser = \"\";\n let queryURL = baseURL + getCoursesAPI + filter;\n\n //make ajax request\n let req = new XMLHttpRequest();\n req.open(\"GET\", queryURL, true);\n req.setRequestHeader(\"Content-type\", \"application/json\");\n req.addEventListener(\"load\", function () {\n if (req.status >=200 && req.status < 400) {\n let data = JSON.parse(req.response);\n if (data.results.length == 0) {\n feedbackToUser = \"<p>Sorry, we currently don't have any available classes.</p>\";\n } else {\n for (let someClass of data.results) {\n let courseID = someClass.courseId;\n let classURL = baseURL + coursesURLString + \"/\" + courseID + \"/\" + someClass.courseName + courseOverviewLandingpage;\n feedbackToUser += \"<div>\";\n feedbackToUser += \"<!-- Image Credit: Public domain image taken from: https://www.publicdomainpictures.net/en/view-image.php?image=151542&picture=computer-notebook-coffee Taken on: 3/8/21 -->\";\n feedbackToUser += \"<a href=\\\"\" + classURL + \"\\\"><img src=\\\"/images/poste-de-travail-pc-portable-cafe.jpg\\\" width=\\\"150\\\" height=\\\"150\\\" /></a>\";\n feedbackToUser += \"<a href=\\\"\" + classURL + \"\\\">\" + someClass.courseName + \"</a>\";\n feedbackToUser += \"</div>\";\n }\n feedbackToUser += \"<div style=\\\"clear: both;\\\"></div>\";\n }\n\n } else {\n feedbackToUser = \"<p>Sorry, there was an error in getting the available classes.</p>\";\n }\n\n document.getElementById(\"availableClasses\").innerHTML = feedbackToUser;\n });\n req.send(JSON.stringify(null));\n event.preventDefault();\n}", "function _getCourseList (callback) {\n\t\t_setNotice('loading course list...');\n\n\t\tfetch(_buildApiUrl('courselist'))\n\t\t\t.then((response) => response.json())\n\t\t\t.then((json) => {\n\t\t\t\t//console.log('json.status=' + json.status);\n\t\t\t\tif (json.status !== 'success') {\n\t\t\t\t\t_setNotice(json.message);\n\t\t\t\t}\n\t\t\t\t//console.log('json.data: ' + JSON.stringify(json.data));\n\t\t\t\tsettings.courseList = json.data.courselist;\n\t\t\t\t_setNotice('');\n\t\t\t\tcallback();\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\t_setNotice('Unexpected error loading course list');\n\t\t\t\tconsole.log(error);\n\t\t\t})\n\t}", "function search() {\r\n\t\tlet query = $(\"#searchText\").val();\r\n\t\tquery = query.toLowerCase().trim();\r\n\r\n\t\tlet matches = [];\r\n\t\t\tfor(let course of COURSES) {\r\n\t\t\t\tlet coursetitle = course.course_title;\r\n\t\t\t\tcoursetitle = course.course_title.toLowerCase(); \r\n\r\n\t\t\t\tif(coursetitle.includes(query)) {\r\n\t\t\t\t\tmatches.push(course)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tdisplayCourses(matches);\r\n}", "get courses (){\n return {\n appetizers: this.appetizers,\n mains: this.mains,\n desserts: this.desserts\n };\n }", "function getUserCourses(con) {\n return function (req, res) {\n // TODO get the courses associated with the user\n res.send(\"temp\");\n };\n}", "function getStudentCourses (req, res, next) {\n\n req.db.collection(\"courses\").aggregate([\n { \"$unwind\": \"$course_offerings\" },\n { $match: {\"course_offerings.students.student_id\": getMongoId(req.token.student_id, next)} },\n { $sort : { \"begin_data\" : 1 } }\n \n ]).toArray(sendJSON.bind(res));\n\n\n}", "get courses(){\n return {\n appetizers: this._course.appetizers,\n mains: this._course.mains,\n desserts: this._course.desserts\n }\n }", "function getAll(filter) {\n const requestOptions = {\n method: \"GET\",\n headers: authHeader.get(),\n credentials: \"include\"\n };\n\n //case filter type status ==> http://slackcart.com/api/v1/workflows/?status=<status_id>\n //case filter type kind ==> http://slackcart.com/api/v1/workflows/?kind=<kind_id>\n //case filter type multi ==> http://slackcart.com/api/v1/workflows/?answer=<field_tag>__<operator>__<value>\n //case filter type multi ==> http://slackcart.com/api/v1/workflows/?stepgroupdef=<stepgroup_id>\n\n let filters = store.getState().workflowFilters,\n filterParams = getFilterParams(filters),\n url = baseUrl + \"workflows-list/\";\n\n url += filterParams;\n\n if (filter) {\n const params = pageUrl(filter);\n url += params;\n }\n return fetch(url, requestOptions).then(handleResponse);\n}", "getFilteredComics() {\n\n }", "async function getCourses(keyword) {\n\n // request body: there are two type of results the former based on all products and the latter based on suggestions.\n let body = {\n requests: [\n {\n indexName: \"prod_all_products\",\n params: `query=${keyword}&hitsPerPage=9223372036854775807&page=0&highlightPreTag=%3Cais-highlight-0000000000%3E&highlightPostTag=%3C%2Fais-highlight-0000000000%3E&optionalFilters=query%3A${keyword}&facets=%5B%5D&tagFilters=`\n },\n {\n indexName: \"test_suggestions\",\n params: `query=${keyword}&hitsPerPage=9223372036854775807&page=0&highlightPreTag=%3Cais-highlight-0000000000%3E&highlightPostTag=%3C%2Fais-highlight-0000000000%3E&optionalFilters=query%3A${keyword}&facets=%5B%5D&tagFilters=`\n }\n ]\n };\n\n try {\n\n let response = await axios({\n method: \"post\",\n url: baseURL,\n headers: {},\n data: body\n });\n\n if (response.status == 200) {\n let data = response.data;\n\n let refinedCourses = [];\n\n //concatenating the arrays \n let rawCourses = data.results[0].hits;\n rawCourses = rawCourses.concat(data.results[1].hits);\n\n rawCourses.forEach(course => {\n\n if (course.language == 'English') {\n let {\n name,\n imageUrl,\n objectUrl,\n skills,\n productDifficultyLevel\n } = course; //destructoring\n\n let description = course._snippetResult.description.value;\n \n let refinedCourse = {\n title: name,\n category: keyword,\n description: description,\n difficulty: productDifficultyLevel,\n skills: skills,\n url_image: imageUrl,\n url: `https://www.coursera.org${objectUrl}`,\n };\n \n refinedCourses.push(refinedCourse);\n }\n });\n\n\n return refinedCourses;\n }\n } catch (err) {\n console.log(`Coursera wrapper error: ${err}`);\n }\n}", "filterCollege(campusShortName) {\n let collegeList = new Array();\n const sourceList = this.props.route.params.colleges.Colleges;\n for (let i in sourceList) {\n if (sourceList[i].CampusShortName.toUpperCase() === campusShortName.toUpperCase()) {\n collegeList.push(sourceList[i]);\n }\n }\n this.setState({collegeList: collegeList});\n }", "getStudentByCourse(courseName) {\n let st = new Set()\n for (let s of this.stumap.values()) {\n s.courses.forEach(courses => {\n courses.forEach(name => {\n if (courseName == name) {\n st.add(s);\n }\n });\n });\n }\n return st\n }", "filterContests(where, contests) {\n contests = contests || this.contests;\n contests = contests.toJSON ? contests.toJSON() : contests;\n\n // Check for where\n if (!where) {\n return [];\n }\n\n // Use sift to filter contests\n return this.sortContests(sift(where, contests));\n }", "cap(requirement) {\n this.subrequirements.filter(course => requirement.includes(course));\n }", "function loadAllApprovedCourses() {\n\t\tcoursesService.loadAllApprovedCourses()\n\t\t\t.then((allCourses) => {\n\t\t\t\tdisplayCatalog(allCourses);\n\t\t\t}).catch(handleError);\n\t}", "async function getCourses() {\n const courses = await Course\n /////// \n .find()\n // .find({ author: 'H M Usman', name: 'nodejs mongodb' }) \n //////// lets we have courses with different prices. we want the course with exact 10$ price than\n // .find({price : 10})\n ///////////\n // if we want courses with price >= 10 and <= 20 than what?\n // .find({ price: { $gte: 10, $lte: 20 } }) // here $ sign represents the implementation of operator.\n ///////////////////\n // if we want courses whose prices are equal to 10, 20, 30 dollers than? \n // .find({ price: { $in: [10, 20, 30] } })\n .limit(5)\n .sort({ name: 1 })\n .select({ name: 1, tags: 1 })\n console.log(\"Courses\" + courses)\n}", "function findCourseEntries(req,res,next){cov_24nw12t5lg.f[24]++;var id=(cov_24nw12t5lg.s[106]++,req.query.id);cov_24nw12t5lg.s[107]++;User.getUserById(id,{},function(err,user){cov_24nw12t5lg.f[25]++;cov_24nw12t5lg.s[108]++;if(err){cov_24nw12t5lg.b[46][0]++;cov_24nw12t5lg.s[109]++;res.status((cov_24nw12t5lg.b[48][0]++,err.code>=100)&&(cov_24nw12t5lg.b[48][1]++,err.code<600)?(cov_24nw12t5lg.b[47][0]++,err.code):(cov_24nw12t5lg.b[47][1]++,500)).send({success:false,message:err.message});}else{cov_24nw12t5lg.b[46][1]++;}//res.json(user);\ncov_24nw12t5lg.s[110]++;req.body.courses=user.toObject().course_list;cov_24nw12t5lg.s[111]++;req.body.prof_courses=user.toObject().teaching_course_list;cov_24nw12t5lg.s[112]++;next();});}", "function listYearFilters() {\n const requestOptions = {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n };\n\n const handleResponse = response => response.json().then((data) => {\n if (!response.ok) {\n const error = (data && data.email);\n return Promise.reject(error);\n }\n\n return data;\n });\n\n return fetch(`${apiUrl}/years/`, requestOptions)\n .then(handleResponse)\n .then(yearFilters => yearFilters);\n}", "getCourses(){\n return this.fullName + \"'s enrolled courses are: \" + this._enrolledCourses.join(', ');\n }", "investmentCategories(filter) {\n\t\tconst categories = [\n\t\t\t{id: \"Buy\", name: \"Buy\"},\n\t\t\t{id: \"Sell\", name: \"Sell\"},\n\t\t\t{id: \"DividendTo\", name: \"Dividend To\"},\n\t\t\t{id: \"AddShares\", name: \"Add Shares\"},\n\t\t\t{id: \"RemoveShares\", name: \"Remove Shares\"},\n\t\t\t{id: \"TransferTo\", name: \"Transfer To\"},\n\t\t\t{id: \"TransferFrom\", name: \"Transfer From\"}\n\t\t];\n\n\t\treturn filter ? this.filterFilter(categories, {name: filter}) : categories;\n\t}", "function findCourse(callNum) {\n for (var i = 0; i < selectedCourses.length; i++) {\n if (selectedCourses[i].callNum == callNum) {\n console.log('course found1');\n return selectedCourses[i];\n }\n }\n for (var i = 0; i < searchResults.length; i++) {\n if (searchResults[i].callNum == callNum) {\n console.log('course found2');\n return searchResults[i];\n }\n }\n\n return null;\n }", "function getCourseData() {\n let query = document.getElementById(\"courseSearch\").value;\n query = query.split(\" \").join(\"\");\n\n fetch(`https://api.sga.umbc.edu/course/${query}`)\n .then(response => response.json())\n .then(showCourseInformation)\n .catch(showSearchErrorMessage);\n}", "getActions(platformId, courseId, filters) {\n return axios\n .get(this.apiUrl() + `/actions/${platformId}/${courseId}/` + this.getQueryParams(filters), {\n headers: this.authHeader(),\n })\n }", "function get_courses(req, res, next) {\n let user_id = req.query.user_id;\n let year = req.query.year;\n let semester = req.query.semester;\n let email = req.query.email;\n\n let knex_query = knex.select('courses.course_id', 'courses.course_name', 'courses.user_id', 'courses.semester', 'courses.year', 'users.email')\n .from('courses');\n\n if(user_id === undefined) {\n knex_query.leftJoin('users', 'users.user_id', '=', 'courses.user_id');\n } else {\n knex_query.innerJoin('users', 'users.user_id', '=', 'courses.user_id')\n .andWhere('courses.user_id', '=', user_id);\n }\n\n if(year !== undefined) {\n knex_query.andWhere('courses.year', '=', year);\n }\n\n if(semester !== undefined) {\n knex_query.andWhere('courses.semester', '=', semester);\n }\n\n if(email !== undefined) {\n knex_query.andWhere('users.email', '=', email);\n }\n\n knex_query = knex_query.toSQL().toNative();\n\n let query = db.query(knex_query.sql, knex_query.bindings);\n query.then(result => {\n Promise.all(result.rows.map(course => {\n return get_forms(course).then(forms => {\n // There was an error\n if (!forms) {\n res.json({error: 'Error fetching course data'});\n return;\n } else {\n course.forms = forms;\n return course;\n }\n })\n })).then(data => {\n res.json({courseData: data});\n });\n }).catch(err => {\n console.error('Error in users: ', err);\n res.json({error: 'Error fetching course data'});\n });\n}", "function findAll(callback)\n{\n\tCourse.find(callback);\n}", "async function getCourses(){\r\n const pageNumber = 2;\r\n const pageSize=10;\r\n \r\n const courses= await Course\r\n .find({ author : 'Mosh', isPublished :true})\r\n .skip( (pageNumber-1) * pageSize )\r\n //formula for pagination is pagenumber-1 * pagesize\r\n .limit(10)\r\n .sort({name: 1})\r\n //.select({ name:1 , tags: 1}); \r\n //instead of displaying the data of documents we need to display the count of documents so we use .count()\r\n .count();\r\n console.log(courses);\r\n}", "function findCourseEntries(req,res,next){cov_24nw12t5lg.f[20]++;var id=(cov_24nw12t5lg.s[99]++,req.query.id);cov_24nw12t5lg.s[100]++;User.getUserById(id,'course_list',function(err,user){cov_24nw12t5lg.f[21]++;cov_24nw12t5lg.s[101]++;if(err){cov_24nw12t5lg.b[40][0]++;cov_24nw12t5lg.s[102]++;res.status((cov_24nw12t5lg.b[42][0]++,err.code>=100)&&(cov_24nw12t5lg.b[42][1]++,err.code<600)?(cov_24nw12t5lg.b[41][0]++,err.code):(cov_24nw12t5lg.b[41][1]++,500)).send({success:false,message:err.message});}else{cov_24nw12t5lg.b[40][1]++;}//res.json(user);\ncov_24nw12t5lg.s[103]++;req.body.courses=user.toObject().course_list;cov_24nw12t5lg.s[104]++;console.log(\"\\n\"+req.body.courses+\"\\n\");cov_24nw12t5lg.s[105]++;next();});}", "function requestCourses(tp_field, url, school, create_by_field) {\n\tvar i = 0;\n\n\t// do not update the course list when selecting additional time periods\n\tfor (i = 0; i < tp_field.length; i++) {\n\t\tif (tp_field[i].selected && tp_field[i].value == tp_id) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// clear display\n\t$(\"#coursesInstruction\").html(\"\").hide();\n\tremoveAllRows();\n\n\t// make the AJAX request\n\ttp_id = tp_field.value;\n\tif (tp_id) {\n\t\t$(\"#coursesInstruction\").html(\"<p class='xsm'>please wait <img src='/graphics/icons/waiting_bar.gif' /></p>\").show();\n\t\tfor (i = 0; i < create_by_field.length; i++) {\n\t\t\tif (create_by_field[i].checked) {\n\t\t\t\tcreate_by = create_by_field[i].value;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\txRequest = initXMLHTTPRequest();\n\t\tif (xRequest) {\n\t\t\tvar params = 'time_period_id=' + tp_id + '&school=' + school + '&create_by=' + create_by;\n\t\t\txRequest.open(\"POST\", url, true);\n\t\t\txRequest.onreadystatechange = showCourses;\n\t\t\txRequest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\t\t\txRequest.send(params);\n\t\t}\n\t}\n}", "static fetchingCourseCo(payload, keys) {\n // console.log(payload)\n return {\n type: FieldAction.FETCHCOURSESDATA,\n payload,\n keys\n }\n }", "get courses(){\n return {\n appetizers: this.appetizers,\n mains: this.mains,\n desserts: this.desserts,\n }\n }", "get courses () {\n return this._courses\n }", "securities(filter, limit) {\n\t\treturn this.securityModel.all().then(securities => this.limitToFilter(this.filterFilter(securities, {name: filter}), limit));\n\t}", "renderPage() {\n return (\n <div className=\"uhmanoa-listcourses-background\" id='list-course'>\n <Container>\n <Header as=\"h2\" textAlign=\"center\" inverted>List Courses</Header>\n <Card.Group>\n {this.props.courses.map((course, index) => <Course key={index} course={course} reviews={this.props.reviews.filter(review => (review.contactId === course._id))}/>)}\n </Card.Group>\n </Container>\n </div>\n );\n }", "getRecommendedCourses(course, rating){\n //let check = JSON.parse(JSON.stringify(this.state.compRec));\n let filtered = [];\n let check = [];\n\n if(rating !== 'No rating' && parseInt(rating, 10) >= 3){\n if(this.state.compRec.length === 0){\n //filter courses by keywords of passed in courses\n check.push(course);\n\n for(let i = 0; i < check[0].keywords.length; ++i){\n for(let j = 0; j < this.state.allCourses.length; ++j){\n for(let k = 0; k < this.state.allCourses[j].keywords.length; ++k){\n if(check[0].keywords[i] === this.state.allCourses[j].keywords[k]){\n if(filtered.length === 0){\n filtered.push(this.state.allCourses[j]);\n } else {\n if(this.checkRecsForDups(filtered, this.state.allCourses[j]) === -1){\n filtered.push(this.state.allCourses[j]);\n }\n }\n }\n }\n }\n }\n filtered = this.deleteCompletedCourses(filtered);\n let temp = this.state.compRec;\n temp.push(course);\n this.setState({compRec: temp, recommendedCourses: filtered});\n\n }else{ \n \n let duplicate = -1;\n //check for duplicates \n\n for(let i = 0; i < check.length;++i){\n if(check[i] === course.number){\n duplicate = i;\n }\n }\n\n if(duplicate === -1){\n check.push(course);\n } \n \n for(let i = 0; i < check.length; i++){\n for(let j = 0; j < check[i].keywords.length; ++j){\n for(let k = 0; k < this.state.allCourses.length; ++k){\n if(this.state.allCourses[k].keywords.includes(check[i].keywords[j])){ \n if(filtered.length === 0){\n filtered.push(this.state.allCourses[k]);\n }else{\n if(this.checkRecsForDups(filtered, this.state.allCourses[k]) === -1){\n filtered.push(this.state.allCourses[k])\n }\n }\n }\n }\n }\n }\n \n filtered = this.deleteCompletedCourses(filtered);\n if(this.checkCompRec(course) === true){\n let temp = this.state.compRec;\n temp.push(course);\n this.setState({compRec: temp, recommendedCourses: filtered});\n } else{\n this.setState({recommendedCourses: filtered});\n }\n \n }\n } else{\n //check for duplicates \n let duplicate = -1;\n check = this.state.compRec\n for(let i = 0; i < this.state.compRec.length;++i){\n if(check[i].number === course.number){\n duplicate = i;\n }\n }\n\n if(duplicate !== -1){\n check.splice(duplicate,1);\n }\n \n for(let i = 0; i < check.length; i++){\n for(let j = 0; j < check[i].keywords.length; ++j){\n for(let k = 0; k < this.state.allCourses.length; ++k){\n if(this.state.allCourses[k].keywords.includes(check[i].keywords[j])){ \n if(filtered.length === 0){\n filtered.push(this.state.allCourses[k]);\n }else{\n if(this.checkRecsForDups(filtered, this.state.allCourses[k]) === -1){\n filtered.push(this.state.allCourses[k])\n }\n }\n }\n }\n }\n }\n filtered = this.deleteCompletedCourses(filtered)\n this.setState({compRec: check, recommendedCourses: filtered});\n }\n }" ]
[ "0.6760918", "0.67289", "0.65786", "0.6450647", "0.6413308", "0.64052004", "0.6326141", "0.6216369", "0.6198658", "0.618823", "0.618702", "0.6160085", "0.6154418", "0.6147037", "0.6138319", "0.6066836", "0.60506666", "0.5967074", "0.5947476", "0.5931652", "0.5899167", "0.5898985", "0.5890975", "0.58616984", "0.58565086", "0.58546126", "0.58518004", "0.58435804", "0.58311975", "0.5801347", "0.5752137", "0.5751055", "0.5741234", "0.56975555", "0.56964624", "0.5657075", "0.5650068", "0.5630778", "0.56209075", "0.561062", "0.56099933", "0.5604697", "0.5584634", "0.5580854", "0.55806047", "0.5578118", "0.5523139", "0.5518656", "0.5507232", "0.55053395", "0.5503139", "0.54991436", "0.5483518", "0.5451002", "0.5441486", "0.5439977", "0.543056", "0.54302585", "0.5426346", "0.54181314", "0.54053265", "0.54031944", "0.53856355", "0.5374761", "0.5371409", "0.53689736", "0.53685313", "0.5362246", "0.5359399", "0.5356833", "0.5351837", "0.5314636", "0.53108454", "0.5307419", "0.52946067", "0.5290624", "0.5273627", "0.5264597", "0.5252972", "0.5250419", "0.5249055", "0.52436626", "0.5234292", "0.5230087", "0.52273065", "0.52200085", "0.5219232", "0.52122074", "0.5211491", "0.521002", "0.52059454", "0.5198194", "0.5197714", "0.51928973", "0.51903147", "0.5180603", "0.5173184", "0.5141898", "0.5133314", "0.5128249", "0.51208305" ]
0.0
-1
Find all wish lists in the dayabase
async userDisplay (req, res) { try { const displayUser = await User.findOne({ where: { userName: req.params.user }, include: ['beers', 'friends'] }) res.send(displayUser) } catch (err) { res.status(500).send({ error: 'An error has occured trying to fetch the user' }) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findLists() {}", "async getAllGiveaways() {\n // Get all giveaways from the database\n return giveawayDB.fetchEverything().array();\n }", "async function checkWishlist() {\n\t// If the current user is logged in:\n\tif (wixUsers.currentUser.loggedIn) {\n\t\t// Query the collection to find if the item was already added to the user's hiking list.\n\t\tlet wishListResult = await wixData.query(\"myhikes\")\n\t\t\t.eq(\"hike\", hike._id)\n\t\t\t.eq(\"userId\", user.id)\n\t\t\t.find();\n\n\t\t// If the item was already added to the user's hiking list:\n\t\tif(wishListResult.items.length > 0)\n\t\t\t// Show the \"inWishList\" image with a fade effect.\n\t\t\t$w('#inWishList').show('fade', {duration: 100});\n\t\t// If the product was not yet added to the user's wishlist:\n\t\telse\n\t\t\t// Show the \"notInWishList\" image with a fade effect.\n\t\t\t$w('#notInWishList').show('fade', {duration: 100});\t\n\t}\n\t// If the current user is not logged in:\n\telse {\n\t\t// Show the \"notInWishList\" image with a fade effect.\n\t\t$w('#notInWishList').show('fade', {duration: 100});\n\t}\n}", "getTodaysSpecialsList() {\n const queriedDay = getQueryString('day', window.location.href);\n if(queriedDay) {\n return Object.keys(this.props.weeklySpecials).filter(key => this.props.weeklySpecials[key].specialDay === toTitleCase(queriedDay));\n } else {\n return Object.keys(this.props.weeklySpecials).filter(key => this.props.weeklySpecials[key].specialDay === getCurrentWeekday());\n } \n }", "function listBiddableAuctions() {\n // Get the list of keys this person owns\n getAllYourPublicKeys()\n\n // Get the list of all auctions\n listAllAuctions(AUCTION_SCRIPT_ADDRESS)\n\n // Remove from the auction list, auctions signed by any of this users public keys\n\n // Return the resulting, filtered aution list\n}", "function wis (lista) {\n palabras = lista.filter(function(i){\n return /is/m.test(i)\n })\n \n return palabras\n}", "list() {\n const listings = this._listings.all();\n return Object.keys(listings).map(key => listings[key]);\n }", "async wishLists(req, res) {\n const object = await this.currentUser.wishLists();\n \n res.status(200).json(object);\n }", "function setWishlist() {\n for (let i = 0; i < wishlist.length; i++) {\n // to see if the wish is met\n let checked = wishlist[i].done === true ? 'checked': '';\n $('#wishlist-inner').append(`<p class=\"wish-labels\">${wishlist[i].description}</p>`);\n }\n}", "function listWares() {\n\t if (!wares.length > 0) {\n\t repo.getAll(function (allWares) {\n\t wares.push.apply(wares, _toConsumableArray(allWares));\n\t console.log(wares);\n\t });\n\t } else {\n\t console.log(wares);\n\t }\n\t }", "function listShowing(){\n return knex(`${table} as m`)\n .join(\"movies_theaters as mt\", \"m.movie_id\", \"mt.movie_id\")\n .select(\"m.*\")\n .where({\"mt.is_showing\": true})\n .groupBy(\"m.title\")\n}", "function getWines(event){\n if(document.getElementById(\"menu_wine\").getAttribute(\"data-status\") === \"active\" && event !== \"filter\"){\n return;\n }\n\n document.getElementById(\"menu_beer\").setAttribute(\"data-status\", \"inactive\");\n document.getElementById(\"menu_wine\").setAttribute(\"data-status\", \"active\");\n document.getElementById(\"menu_drinks\").setAttribute(\"data-status\", \"inactive\");\n\n var str = \"item.itemKind.includes('v') \"; // TODO: sökning efter faktiskt namn.\n var items = fetchFromDb(str);\n clearItems();\n printAllDrinks(items);\n update_view_dictionary();\n\n}", "function resetWishList(wishTable){\r\n\r\n\tdeleteWishCart(wishTable);\r\n\r\n for(var i = 0; i<wishItems.length; i++){\r\n \tcreateWishList(i);\r\n\t}\r\n}", "getAllIngredients() {\n var fullingredients = [];\n return this.menu.map(dish => dish.extendedIngredients.filter(ingredients => !fullingredients.includes(ingredients))).flat.map(x => x.name);\n }", "function queryList(tempTrie) {\n\n var sideBranches = Object.keys(tempTrie).filter(t=>t!=\"endOfWord\");\n\n sideBranches.forEach(branch=> {\n wordBuildingList.push(branch);\n if (\"endOfWord\" in tempTrie[branch]) {\n wordList.push(wordBuildingList.join(\"\"));\n }\n queryList(tempTrie[branch]);\n wordBuildingList.pop();\n });\n }", "allBeverages() {\n // Using a local variable to collect the items.\n var collector = [];\n\n // The DB is stored in the variable DB2, with \"spirits\" as key element. If you need to select only certain\n // items, you may introduce filter functions in the loop... see the template within comments.\n //\n for (let i = 0; i < this.DB2.spirits.length; i++) {\n collector.push([\n this.DB2.spirits[i].namn,\n this.DB2.spirits[i].varugrupp,\n ]);\n }\n //\n return collector;\n }", "meals () {\n const allMeals = this.deliveries().map(\n function (delivery) {\n return store.meals.find(\n function(meal) {\n return meal.id === delivery.mealId\n }\n )\n }\n )\n return Array.from(new Set(allMeals))\n }", "function GetAllBeats()\n{\n var beats = [\n 'f', // 1 syllable\n\n 'hh', // 2 syllables\n\n 'hqq', // 3 syllables\n 'qqh', // 3 syllables\n 'qhq', // 3 syllables\n\n 'qqqq', // 4 syllables\n\n 'qeeqq', // 5 syllables\n\n 'qeeeeq', // 6 syllables\n\n 'zzzeeee', // 7 syllables,\n\n 'eeeeqess', // 8 syllables\n\n 'tttqtttee', // 9 syllables\n\n 'ssssqsseee', // 10 syllables\n\n 'tttttteettt', // 11 syllables\n\n 'tttttttttttt' // 12 syllables\n ];\n\n return beats;\n}", "processWishlists(wishlists) {\n if(!wishlists.length) {\n return <h5 style={{marginTop: '2.5vh'}} className='center grey-text'>No wishlists available</h5>;\n }\n return wishlists.map(wishlist => {\n return (\n <WishlistCard\n key={wishlist.wishlistId}\n username={this.props.username}\n wishlist={wishlist}\n updateHandler={this.props.updateHandler}\n deleteHandler={this.props.deleteHandler}\n editable={this.props.editable} \n />\n );\n });\n }", "function gooseFilter (birds) {\r\n var geese = [\"African\", \"Roman Tufted\", \"Toulouse\", \"Pilgrim\", \"Steinbacher\"];\r\n var jadinya=[]\r\n console.log(birds)\r\n for(i=0;i<birds.length;i++){\r\n if(!geese.includes(birds[i])){\r\n jadinya.push(birds[i])\r\n }\r\n }\r\n return jadinya\r\n }", "function getAllBowsByDate(req, res) {\n // not sure on this one.\n var searchDate = req.query.date;\n db.User.find({}, function allUsers(err, allUsers) {\n if (err) { res.status(500); }\n // now we have all the users.\n matchingBows = [];\n allUsers.forEach(function(user) {\n user.bows.forEach( function(bow) {\n if (bow.date === searchDate){\n matchingBows.push(bow);\n }\n });\n });\n res.json(matchingBows);\n });\n}", "function listWidgetElements() {\n return [...document.getElementById('filtersList').querySelectorAll('[whereClause]')];\n }", "function initWishlistTabs() {\n $('.is-account-grid .wishlists li').on('click', function () {\n var targetWishlist = $(this).attr('data-target-wishlist');\n $(this).siblings('li').removeClass('is-active');\n $(this).addClass('is-active');\n $('ul.wishlist').addClass('is-hidden');\n $('#' + targetWishlist).removeClass('is-hidden');\n });\n} //Get user wishlists", "function getAllHowtos() {\n return db('howtos')\n}", "meals(){\n const neighborhoodMealIds =[];\n this.deliveries().forEach(function(delivery){\n neighborhoodMealIds.push(delivery.mealId)\n });\n let uniqueNeighborhoodMealIds = [...new Set(neighborhoodMealIds)]\n return store.meals.filter(meal => uniqueNeighborhoodMealIds.includes(meal.id))\n }", "function index(req, res, next) {\n User.findById({_id: req.session.passport.user}, function(err, user) {\n var id = user.id;\n Wishlist.find({ creator: id}, function(err, wishlists) {\n res.json(wishlists);\n })\n })\n}", "async function removeFromWishlist() {\n\t// Query the collection to find the hiking list item corresponding to the current item and current user.\n\tlet wishListResult = await wixData.query(\"myhikes\")\n\t\t.eq(\"hike\", hike._id)\n\t\t.eq(\"userId\", user.id)\n\t\t.find();\n\n\t// If a wishlist item was found:\n\tif (wishListResult.length > 0) {\n\t\t// Show the \"notInWishList\" image with a fade effect.\n\t\t$w('#notInWishList').show('fade', {duration: 100});\n\t\t// Hide the \"inWishList\" image with a fade effect.\n\t\t$w('#inWishList').hide('fade', {duration: 100});\n\t\t// Remove the wishlist item from the collection.\n\t\tawait wixData.remove(\"myhikes\", wishListResult.items[0]._id)\n\t}\n}", "getAllHikes() {\n return hikeList;\n }", "function checkForMultipleWines() {\n\tif (winePreference.length > 1) {\n\t\tfor (var i = 0; i < winePreference.length; i++) {\n\t\tcategoryFilter.push('categories(' + winePreference[i] + ')');\n\t\t}\n\t\tcategoryFilter = categoryFilter.join('+');\n\t} else categoryFilter = ['categories(' + winePreference[0] + ')']\n}", "function shoppingList(){\n let listItems = [];\n let list = document.getElementById('list-items');\n let listHTML, item = '';\n\n for(let i = 0; i < mealPlan.length; i++){\n for(let j = 0; j < mealPlan[i].ing.length; j++){\n item = mealPlan[i].ing[j].substring(mealPlan[i].ing[j].indexOf('-')+2, mealPlan[i].ing[j].length);\n if(item.length != 0){\n let check = 0;\n for(let k = 0; k <= listItems.length; k++){\n //Remove duplicates and water from shopping list\n if (item === listItems[k] || item === 'Water'){\n check += 1;\n }\n }\n if (check === 0){\n listItems.push(item);\n }\n }\n }\n }\n \n listHTML = \n '<ul>';\n\n for(let i = 0; i < listItems.length; i++){\n listHTML += \n '<li>'+listItems[i]+'</li>';\n }\n \n listHTML += \n '</ul>'; \n \n list.innerHTML = listHTML;\n}", "function toggle_day(id) {\n var tags = [\"break\", \"lunch\", \"dinner\"];\n var all_possible_elems = tags.map(function(tag) {\n return $('#' + tag + id);\n });\n var existing_elems = all_possible_elems.filter(function(elem) {\n return elem.length;\n });\n toggle_list(existing_elems);\n}", "function collectWheatSeeds()\n\t\t\t{\n\t\t\t\twheatSeedBank += randInt(1,3);\n\t\t\t\tif (randInt(1,20) == 1)\n\t\t\t\t{\n\t\t\t\t\twormBank += 5;\n\t\t\t\t}\n\t\t\t\taction(1,1,1);\n\t\t\t\tadvanceTime();\n\t\t\t\tupdateDisp();\n\t\t\t}", "allStrongBeverages(strength) {\n // Using a local variable to collect the items.\n //\n var collector = [];\n\n // The DB is stored in the variable DB2, with \"spirits\" as key element. If you need to select only certain\n // items, you may introduce filter functions in the loop... see the template within comments.\n //\n for (let i = 0; i < this.DB2.spirits.length; i++) {\n // We check if the percentage alcohol strength stored in the data base is lower than the\n // given limit strength. If the limit is set to 14, also liqueuers are listed.\n //\n if (percentToNumber(this.DB2.spirits[i].alkoholhalt) > strength) {\n // The key for the beverage name is \"namn\", and beverage type is \"varugrupp\".\n //\n collector.push([\n this.DB2.spirits[i].namn,\n this.DB2.spirits[i].varugrupp,\n ]);\n }\n }\n\n // Don't forget to return the result.\n //\n return collector;\n }", "function returnNaughtyList(students, inputHabit) {\n var naughtyList = [];\n\n // for each student\n for (var student of students) {\n // for each habit\n for (var habit of student.habits) {\n // if it matches \"inputHabit\"\n if (habit === inputHabit) {\n // push FULL name in to naughtyList\n var nameStr = student.firstName + \" \" + student.lastName;\n naughtyList.push(nameStr)\n break;\n }\n }\n }\n return naughtyList;\n}", "function filterBreeds(event) {\n //have access to event anyway, but if manipulating it should put as parameter\n const userSelection = event.target.value;\n // use filter to filter out breeds by letter\n // how to access breeds? get all elements on page that have breed\n // could add class name on creation to make easier, or use other selectors\n // if manipluating them elsewhere, would use class name to eliminate duplication\n // only works here because only lis\n const breedList = document.getElementsByTagName(\"li\");\n // debugger\n // to filter, could use filter, but the return value would be just list that match\n // would destroy all other ones and never be able to select other ones\n // instead loop through and hide ones that don't start with user selection so not removing!\n\n //forEach doesn't work, use for...of\n for (const breed of breedList) {\n //breed is html element, need to access innerText\n if (breed.innerText.startsWith(userSelection)) {\n // debugger\n breed.style.display = \"\";\n //shows any previosuly hidden breeds\n } else {\n breed.style.display = \"none\";\n }\n }\n}", "function printshowItems() {\n seanBeanShows.forEach(function(show) {\n console.log(show);\n });\n}", "async function findAllBounties() {\n try {\n // findAll returns an iterable\n const bounties = await bounty_hunters_db.bounty.findAll();\n\n // log the names of each bounty\n bounties.forEach((bounty) => {\n console.log(bounty.name);\n });\n } catch (error) {\n console.log(\"🔥🔥🔥\", error);\n }\n}", "function syncDishlist() {\n var relation = parseuser.relation(\"dishlist\");\n relation.query().find({\n success: function(list) {\n var count = 0;\n for (var i=0;i<list.length;i++) {\n if ($(\"#p\"+list[i].id).length > 0) {\n count++;\n $(\"#p\"+list[i].id).removeClass(\"fa-plus\");\n $(\"#p\"+list[i].id).addClass(\"fa-check green\");\n $(\"#\"+list[i].id).addClass(\"subtlegreen\");\n }\n }\n $(\"#yourlist\").html(count);\n }\n });\n }", "function outcomes_example_words() {\n\tvar temp, i, found = {}, ret = [];\n\n\tfor (i = 0; i < outcome_parameters.solo.length; i++) {\n\t\tdo { /* Loop prevents duplicates on list. */\n\t\t\ttemp = outcomes_random_word(outcome_parameters.solo[i].list);\n\t\t} while (found[temp] !== undefined);\n\t\tfound[temp] = 1;\n\t\tret.push(temp);\n\t}\n\n\treturn ret;\n}", "getAll () {\n const openWindows = this.getOpen().toArray()\n const closedSavedWindows = this.bookmarkIdMap.toIndexedSeq().filter((w) => !(w.open)).toArray()\n return openWindows.concat(closedSavedWindows)\n }", "function allGames(cards, facts){\n var games = allShuffles(cards).map(cards2Game);\n \n var starts = facts.filter(fact=>fact.type=='started');\n var nights = facts.filter(fact=>fact.type=='nighttime');\n\n games = games.filter(game=>starts.map(start=>start.verify(game)).reduce((a,b)=>a&&b,true));\n\n for(var card of cards){\n var temp= [];\n console.log(games);\n for(var game of games){\n if(game.players.indexOf(card) == -1){\n temp.push(game);\n }else{\n temp.push(...allMoves(card,game.players.indexOf(card),game));\n }\n }\n games = temp;\n }\n return games.filter(game=>nights.map(night=>night.verify(game)).reduce((a,b)=>a&&b,true));\n}", "function concernedTweets(tweets=[],lookedHashtag=[]){\n\t\tconcerned_tweets= tweets.filter(tweet => tweet[\"hashtags\"].match(lookedHashtag))\n\t\treturn concerned_tweets\t\t\t\n\t}", "lists() {\n const board = ReactiveCache.getBoard(this.selectedBoardId.get());\n const ret = board.lists();\n return ret;\n }", "function displayWishlist() {\n for (let i = 0; i < storedItems.length; i++) {\n displayAccessory(storedItems[i], i)\n displayAccessoryBtnRemove(i)\n console.log(\"Stored Item \", storedItems.length);\n }\n}", "function WishList({ wishes, onWishesChange }) {\n return (\n <ul className=\"wish-list\">\n {wishes.map(({ text, done }, i) => (\n <WishlistItem\n text={text}\n done={done}\n id={`wish${i}`}\n key={text}\n onDoneChange={(value) => {\n const updatedWishes = [...wishes];\n updatedWishes[i].done = value;\n onWishesChange(updatedWishes);\n }}\n />\n ))}\n </ul>\n );\n}", "getSecretQList() {\r\n this.sql_getSecretQList = `SELECT id, question FROM secret_ques_tb ORDER BY id ASC`;\r\n return this.apdao.all(this.sql_getSecretQList);\r\n }", "async function findAllActiveHunters() {\n try {\n const options = {\n where: {\n active: true,\n },\n };\n // findAll returns an iterable\n const hunters = await bounty_hunters_db.hunter.findAll();\n\n // log the names of each hunter\n hunters.forEach((hunter) => {\n console.log(hunter.name, hunter.active);\n });\n } catch (error) {\n console.log(\"🔥🔥🔥\", error);\n }\n}", "async function favoriteWinesByUser(user_id) {\n try {\n const wines = await db.any(`SELECT wines.id, wines.wine_name, wines.wine_name, wines.wine_price, wines.wine_store, wines.wine_label, wines.comments, wines.wine_rating, favorite_wines.user_id \n FROM wines \n INNER JOIN favorite_wines\n ON wines.id = favorite_wines.wine_id\n where favorite_wines.user_id=$1;`, [user_id]);\n console.log(wines)\n return wines;\n } catch (err) {\n console.log(err)\n return [];\n }\n}", "getLikedWOrds(){\n var tempLiked = this.state.likedKeys;\n for(const course of this.props.rCourses){\n for(const eKey of course.keywords){\n if(tempLiked.indexOf(eKey) === -1){\n tempLiked.push(eKey);\n }\n }\n }\n console.log(tempLiked);\n this.setState({likedKeys: tempLiked});\n }", "static getWeekdayNames() {\n const anyWeek = new MondayBasedWeek();\n const weekdays = anyWeek.days().map(\n (day) => ({\n day: MondayBasedWeek.getDay(day),\n long: this.getWeekdayLong(day),\n short: this.getWeekdayShort(day)\n })\n );\n\n return weekdays;\n }", "function getSantasNaughtyList(people, habit) {\n var newarr = []\n for(var i =0;i<students.length;i++){\n for(var j =0;j<students[i].habits.length;j++){\n if (students[i].habits[j]== habit){\n newarr.push(students[i].firstName + \" \" + students[i].lastName)\n }\n }\n }\n return newarr;\n }", "get allBees() {\n var bees = [];\n for(var i=0; i<this._places.length; i++){\n for(var j=0; j<this._places[i].length; j++){\n bees = bees.concat(this._places[i][j].bees);\n }\n }\n return bees; \n }", "function extractWX(valW, inList) {\n let extract = [];\n let useW = [];\n\n if (valW === 0)\n useW = [...w0];\n else\n useW = [...w1];\n\n for (let i = 0; i < inList.length; i++) {\n extract.push(useW[states.findIndex(function (value) {\n if (value === inList[i])\n return true;\n })]);\n }\n return extract;\n}", "getCoveredTags(sandwiches) {\n let allTags = new Set();\n\n sandwiches.forEach(sw => {\n if (Object.keys(sw).length !== 0) {\n sw.tags.forEach(tag => allTags.add(tag));\n }\n });\n\n return Array.from(allTags);\n }", "function getAllScoutHarvesters() {\n return creepManager.creeps().filter(creep => {\n return creep.memory.role === 'scoutharvester' || creep.memory.oldRole === 'scoutharvester';\n });\n}", "function searchDriver() {\n const queries = [\n\t['bre'],\n\t['bread'],\n\t['break'],\n\t['piz'],\n\t['nach'],\n\t['garbage'],\n\n\t['bre', 'piz'],\n\t['bre', 'flour'],\n ];\n for( const q of queries ) {\n\tconsole.log( \"query=[%s]\", q.join(\", \") );\n\tsearchElements( q, recipeIndex );\n }\n}", "function populateShadowBoxes() {\n // Clear the lists\n var uls = [myUL1, myUL2, myUL3, myUL4, myUL5];\n uls.forEach(function(item) {\n while(item.firstChild){\n item.removeChild(item.firstChild);\n }\n });\n\n // Populate the relationship lists\n relationshipPopulate();\n\n // Populate the My Wishlist list\n wishlistPopulate();\n}", "function getWeapons(lst) {\n\n var i = 0;\n getCurrentWeapon(i);\n\n function getCurrentWeapon(num) {\n var page = lst[num];\n nightmare\n .goto(page)\n .wait('center')\n .inject('js', 'node_modules/jquery/dist/jquery.js')\n .evaluate(function () {\n return $(\"center\").html()\n })\n .then(function(d) {\n wpn_array.push(d);\n num++;\n if(num <= lst.length -1) {\n getCurrentWeapon(num);\n }\n else {\n scrapeWeapons(wpn_array);\n }\n })\n }\n}", "async function test() {\r\n\r\n const whatISearchFor = \"jope\";\r\n\r\n //launch the browser\r\n let driver = await new Builder().forBrowser(\"chrome\").build();\r\n\r\n //open the webpage\r\n await driver.get(\"https://www.weekendshoes.ee/naistele/saapad.html\");\r\n console.log('\\x1b[33m%s\\x1b[0m',\"Avasin veebilehe!\");\r\n\r\n //get the page title and log it\r\n const pageTitle = await driver.getTitle();\r\n console.log('\\x1b[33m%s\\x1b[0m',\"Lehekülje nimi on:\", pageTitle);\r\n\r\n //set timeout for 10 seconds\r\n //await driver.manage().setTimeouts({ implicit: 10000 });\r\n\r\n //add item to wishlist\r\n await driver.manage().setTimeouts({ implicit: 10000 });\r\n const addToWishlist = await driver\r\n .findElement(\r\n By.xpath(\r\n '//*[@id=\"amasty-shopby-product-list\"]/div[3]/ol/li[14]/div/div[3]/div/div/a'\r\n )\r\n );\r\n driver.executeScript('arguments[0].click();',addToWishlist);\r\n console.log('\\x1b[33m%s\\x1b[0m',\"Lisasin ägedad saapad lemmikute nimekirja!\");\r\n\r\n // open wishlist menu\r\n await driver.manage().setTimeouts({ implicit: 10000 });\r\n const openWishlistMenu = await driver.findElement(By.xpath(`//*[@id=\"wishlist-link\"]`));\r\n driver.executeScript('arguments[0].click();',openWishlistMenu);\r\n console.log('\\x1b[33m%s\\x1b[0m',\"Leidsin südame ja klikin sellele\");\r\n\r\n //open my wishlist\r\n await driver.manage().setTimeouts({ implicit: 10000 });\r\n await driver.findElement(By.className(`action primary go-to-wishlist`)).click();\r\n console.log('\\x1b[33m%s\\x1b[0m',\"Lähen vaatan oma lemmikute nimekirja\");\r\n\r\n //open item page\r\n await driver.manage().setTimeouts({ implicit: 10000 });\r\n await driver\r\n .findElement(By.className(`page hover-image hover-image-product-id-471445`))\r\n .click();\r\n console.log('\\x1b[33m%s\\x1b[0m',\"Avan selle toote, mida osta soovin\");\r\n\r\n //open dropdown menu to choose size\r\n await driver.manage().setTimeouts({ implicit: 10000 });\r\n await driver\r\n .findElement(\r\n By.className(\r\n `selectric-wrapper selectric-super-attribute-select selectric-hover selectric-open selectric-below`\r\n )\r\n )\r\n .click();\r\n console.log('\\x1b[33m%s\\x1b[0m',\"Hakkan suurust valima\");\r\n\r\n //choose the shoe size\r\n await driver.manage().setTimeouts({ implicit: 10000 });\r\n await driver\r\n .findElement(\r\n By.xpath(\r\n '//*[@id=\"product-options-wrapper\"]/div/div/div/div/div[3]/div/ul/li[4]/div[1]'\r\n )\r\n )\r\n .click();\r\n console.log('\\x1b[33m%s\\x1b[0m',\"Valisin nr 38 saapad\");\r\n\r\n //add product to cart\r\n await driver.manage().setTimeouts({ implicit: 10000 });\r\n await driver.findElement(By.id(`product-addtocart-button`)).click();\r\n console.log('\\x1b[33m%s\\x1b[0m',\"Lisan need imelised saapad ostukorvi\");\r\n\r\n //navigate to cart\r\n await driver.manage().setTimeouts({ implicit: 10000 });\r\n await driver.findElement(By.className(`action showcart active`)).click();\r\n await driver\r\n .findElement(\r\n By.xpath('//*[@id=\"minicart-content-wrapper\"]/div[2]/div[4]/div/a/span')\r\n )\r\n .click();\r\n console.log('\\x1b[33m%s\\x1b[0m',\"Lähen oma ostukorvi vaatama\");\r\n\r\n //increase the quantity by 1\r\n await driver.manage().setTimeouts({ implicit: 10000 });\r\n await driver.findElement(By.id(`increase-cart-qty-btn-5611753`)).click();\r\n console.log('\\x1b[33m%s\\x1b[0m',\"Lisan ühed saapad veel juurde\");\r\n\r\n //remove item from cart\r\n await driver.manage().setTimeouts({ implicit: 10000 });\r\n await driver\r\n .findElement(\r\n By.xpath(`//*[@id=\"shopping-cart-table\"]/tbody/tr[1]/td[6]/a/span`)\r\n )\r\n .click();\r\n console.log('\\x1b[33m%s\\x1b[0m',\"Mõtlesin ümber, eemaldan need saapad ostukorvist\");\r\n\r\n //search for \"jope\"\r\n await driver.manage().setTimeouts({ implicit: 10000 });\r\n await driver\r\n .findElement(By.id(`search`))\r\n .sendKeys(whatISearchFor, Key.RETURN);\r\n console.log('\\x1b[33m%s\\x1b[0m',\"Otsisin parem jopesid\");\r\n\r\n //sort search result by popularity\r\n await driver.manage().setTimeouts({ implicit: 10000 });\r\n await driver.findElement(By.css(`#sorter [value=\"bestsellers\"]`)).click();\r\n console.log('\\x1b[33m%s\\x1b[0m',\"Reastasin joped populaarsuse järgi\");\r\n\r\n}", "getPastLists() {\n\n return new TotoAPI().fetch('/supermarket/pastLists?maxResults=20').then((response) => response.json());\n }", "function getWokCites(title, year){\n \n // Go to WOK web page\n iimPlay('CODE: URL GOTO=http://apps.webofknowledge.com');\n \n //Prepare search fields and click search button\n if (year && year > 0){\n iimPlay('CODE: TAG POS=1 TYPE=SELECT FORM=NAME:UA_GeneralSearch_input_form ATTR=ID:select1 CONTENT=%TI\\n' +\n 'TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:UA_GeneralSearch_input_form ATTR=ID:value(input1) CONTENT=' + title.replace(/ /g, '<SP>') + '\\n' +\n 'TAG POS=1 TYPE=INPUT:RADIO FORM=ID:UA_GeneralSearch_input_form ATTR=ID:periodRange\\n' +\n 'TAG POS=1 TYPE=SELECT FORM=NAME:UA_GeneralSearch_input_form ATTR=NAME:startYear CONTENT=%' + year + '\\n' +\n 'TAG POS=1 TYPE=SELECT FORM=NAME:UA_GeneralSearch_input_form ATTR=NAME:endYear CONTENT=%' + year + '\\n' + \n 'TAG POS=1 TYPE=INPUT:IMAGE FORM=ID:UA_GeneralSearch_input_form ATTR=SRC:http://images.webofknowledge.com/WOKRS512B4.1/images/search.gif');\n } else {\n iimPlay('CODE: TAG POS=1 TYPE=SELECT FORM=NAME:UA_GeneralSearch_input_form ATTR=ID:select1 CONTENT=%TI\\n' +\n 'TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:UA_GeneralSearch_input_form ATTR=ID:value(input1) CONTENT=' + title.replace(/ /g, '<SP>') + '\\n' +\n 'TAG POS=1 TYPE=INPUT:IMAGE FORM=ID:UA_GeneralSearch_input_form ATTR=SRC:http://images.webofknowledge.com/WOKRS512B4.1/images/search.gif');\n }\n \n //Position at \"Times Cited\" span to know if it has been found and save value in EXTRACT\n iimPlay('CODE: TAG POS=1 TYPE=SPAN ATTR=TXT:Times<SP>Cited: EXTRACT=TXT');\n var citesTextExists = iimGetLastExtract().trim();\n \n if (citesTextExists == '#EANF#'){\n return -1\n } else {\n //Try to position at Cites counter <a> to get the number, if it has no cite it wont have an <a>\n iimPlay('CODE: TAG POS=1 TYPE=A ATTR=TITLE:View<SP>all<SP>of<SP>the<SP>articles<SP>that<SP>cite<SP>this<SP>one EXTRACT=TXT');\n var citesText = iimGetLastExtract().trim();\n if (citesText == '#EANF#' || citesText == '' || citesText == '0'){\n return 0\n } else {\n return parseInt(citesText)\n }\n }\n}", "function allWeeks(text) {\n const allInput = text.split(\",\");\n const weekList = allInput.filter(v => !(v === \"\"));\n return weekList;\n}", "function getDrinks(event){\n if(document.getElementById(\"menu_drinks\").getAttribute(\"data-status\") === \"active\" && event !== \"filter\"){\n return;\n }\n\n document.getElementById(\"menu_beer\").setAttribute(\"data-status\", \"inactive\");\n document.getElementById(\"menu_wine\").setAttribute(\"data-status\", \"inactive\");\n document.getElementById(\"menu_drinks\").setAttribute(\"data-status\", \"active\");\n\n var str = \"item.itemKind.includes('Lik\\u00c3\\u00b6r') \"; // TODO: sökning efter faktiskt namn.\n var items = fetchFromDb(str);\n clearItems();\n printAllDrinks(items);\n update_view_dictionary();\n}", "function get_boats(owner) {\n const q = datastore.createQuery(BOATS);\n return datastore.runQuery(q).then( (entities) => {\n return entities[0].map(fromDatastore).filter( item => item.owner === owner );\n }); \n}", "function gooseFilter(birds) {\n var geese = [\"African\", \"Roman Tufted\", \"Toulouse\", \"Pilgrim\", \"Steinbacher\"]\n const newGeese = []\n for (let i = 0; i < birds.length; i++) {\n if (!geese.includes(birds[i])) {\n newGeese.push(birds[i])\n }\n }\n return newGeese\n}", "static async list(){\n let sql = 'Select * from theloai';\n let list =[];\n try {\n let results = await database.excute(sql);\n results.forEach(element => {\n let tl = new TheLoai();\n tl.build(element.id,element.tenTheLoai,element.moTa);\n list.push(tl);\n });\n return list;\n\n } catch (error) {\n throw error; \n } \n }", "function listAll() {\n var bgms = db.get('bgms').map(({id, name, rss, feeds}) => {\n let feed = feeds.length > 0 ? feeds[0] : {title: 'Yet', addedAt: 'Yet'}\n return {\n id,\n name,\n rss,\n latest: feed.title,\n addedAt: feed.addedAt\n }\n })\n for(let {id, name, rss, latest, addedAt} of bgms) {\n print(`ID: : ${id}`)\n print(`Name : ${name}`)\n print(`RSS : ${rss}`)\n print(`Latest : ${latest}`)\n print(`AddedAt: ${addedAt}`)\n print()\n }\n}", "function findAllTheaters() \n {\n var deferred = $q.defer();\n // GET the theaters\n $http.get(\"/api/project/theater/\")\n .success(function(response) \n {\n deferred.resolve(response);\n });\n\n return deferred.promise;\n }", "function initList() {\n allMySights = [];\n for (var j = 0; j < mySights.length; j = j + 3) {\n allMySights.push({nameofsight: mySights[j], visible: true});\n }\n}", "async function getBurgers() {\n const burgerList = await orm.selectAll()\n return burgerList.filter( burger => burger.devoured == false )\n}", "getAllIngredients() {\n this.menu.map(function (dish) {\n return dish.ingredients;\n })\n }", "getAllOnlineEntries() {\n return Array.from(this.onlineEntries.values());\n }", "function getQens(req,res,next){\n\tconsole.log('QENS list');\n\treturn function(cb){\n\t\tvar qenlist =[];\n\t\tdb.view('droplists','qens',{'group':true},function(err,body){\n\t\t\t\n\t\t\tif (!err){\n\t\t\t\t\n\t\t\t\tfor(var i = 0; i < body.rows.length; i++){\n\t\t\t\t\tvar item = body.rows[i]\n\t\t\t\t\tqenlist.push(item.key);\n\t\t\t\t}\n\t\t\t\tconsole.log('Qenlist=',qenlist);\n\t\t\t\treq.qenlist = qenlist;\n\t\t\t\treturn next();\n\t\t\t\t//return qenlist;\n\t\t\t}\n\t\t});\n\t}\n}", "function getBeers(event){\n if(document.getElementById(\"menu_beer\").getAttribute(\"data-status\") === \"active\" && event !== \"filter\"){\n return;\n }\n\n document.getElementById(\"menu_beer\").setAttribute(\"data-status\", \"active\");\n document.getElementById(\"menu_wine\").setAttribute(\"data-status\", \"inactive\");\n document.getElementById(\"menu_drinks\").setAttribute(\"data-status\", \"inactive\");\n\n var str = \"item.itemKind.includes('') \"; // TODO: sökning efter faktiskt namn.\n var items = fetchFromDb(str);\n clearItems();\n printAllDrinks(items);\n update_view_dictionary();\n}", "function getWishList() {\n var storedList = JSON.parse(localStorage.getItem(\"myWishList\"));\n if (storedList.length > 0 ) {\n document.getElementById(\"empty\").remove();\n\n //display wishlist cart items at the correct location on the current page\n for (var i = 0; i < storedList.length; i++) {\n var targetLocation = document.getElementById(\"wishlist-list\");\n var wlItem = document.createElement(\"div\");\n wlItem.className = \"wl-content\";\n wlItem.id = i;\n\n var wlItemImg = document.createElement(\"img\");\n wlItemImg.className = \"wl-content\";\n wlItemImg.src = storedList[i].src;\n wlItemImg.alt = storedList[i].alt;\n\n var wlItemTitle = document.createElement(\"h2\");\n wlItemTitle.innerHTML = storedList[i].type;\n\n var wlItemFrosting = document.createElement(\"h2\");\n wlItemFrosting.className = \"wl-option\";\n wlItemFrosting.id = \"wl-frosting\";\n wlItemFrosting.innerHTML = (\"w/ \" + storedList[i].frosting + \" frosting\");\n\n var wlItemMethod = document.createElement(\"h2\");\n wlItemFrosting.className = \"wl-option\";\n wlItemMethod.id = \"wl-method\";\n wlItemMethod.innerHTML = storedList[i].method;\n\n var wlItemQuantity = document.createElement(\"h2\");\n wlItemFrosting.className = \"wl-option\";\n wlItemQuantity.id = \"wl-quantity\";\n wlItemQuantity.innerHTML = storedList[i].quantity;\n\n var wlItemPrice = document.createElement(\"h2\");\n wlItemFrosting.className = \"wl-option\";\n wlItemPrice.id = \"cart-price\";\n wlItemPrice.innerHTML = \"$ \" + storedList[i].price;\n\n var deleteButton = document.createElement(\"button\");\n deleteButton.className = \"delete-item\";\n deleteButton.onclick = function(){\n var deleteIndex = this.parentNode.id;\n storedList.splice(deleteIndex, 1);\n localStorage.setItem(\"myWishList\", JSON.stringify(storedList));\n document.location.reload();\n };\n deleteButton.innerHTML = \"X\";\n\n wlItem.appendChild(wlItemImg);\n wlItem.appendChild(wlItemTitle);\n wlItem.appendChild(wlItemFrosting);\n wlItem.appendChild(wlItemMethod);\n wlItem.appendChild(wlItemQuantity);\n wlItem.appendChild(wlItemPrice);\n wlItem.appendChild(deleteButton);\n\n targetLocation.appendChild(wlItem);\n }\n }\n}", "function onlyEvens (list) {\n //code here\n return result;\n}", "function webMD(ailments, meds) { \n let treatment = [];\n let flag = true;\n //loop through all the meds\n for( med of meds) {\n //for each med check all ailments\n for(ailment of ailments) {\n //if that medicine treatable symptoms doesn't include ailment set flag and break out\n if(!med.treatableSymptoms.includes(ailment)) {\n flag = false;\n break;\n }\n }\n //if all medicines were found push that meds name into array also reset flag\n if(flag) treatment.push(med.name);\n flag = true;\n }\n return treatment;\n}", "function getFav() {\n resultContainer.innerHTML = ''\n fetch('http://localhost:3000/favorites').then(resp=>resp.json()).then(data=>data.forEach(element=>strictSearchByName(element.strDrink)))\n}", "function listAll() {\n var str = \"\";\n for (i in starterCheer) {\n str += `${i} ` + starterCheer[i] + \"\\n\";\n }\n return str;\n}", "function buildgoodlist()\n{\n\n // This list is used to control which programs will be placed on the visible tab\n // var outer_tabs = menu_structure.OuterTabs;\n var count = 0 ; \n\n for ( outer_tab in menu_structure.OuterTabs)\n {\n if (menu_structure.OuterTabs.hasOwnProperty(outer_tab))\n {\n if ((nawtylist.indexOf(menu_structure.OuterTabs[outer_tab].DisplayText) == -1 )&&(menu_structure.OuterTabs[outer_tab].DisplayText != undefined))\n {\n gudlist_programs[count] = outer_tab;\n count ++;\n\n }\n }\n\n }\n\n}", "function printLexemesInList(list) {\n sessionService.getSession().then(function (session) {\n var config = session.projectSettings().config;\n var ws = config.entry.fields.lexeme.inputSystems[1];\n var arr = [];\n for (var i = 0; i < list.length; i++) {\n if (angular.isDefined(list[i].lexeme[ws])) {\n arr.push(list[i].lexeme[ws].value);\n }\n }\n\n console.log(arr);\n });\n }", "function getTaskLists() {\n\n}", "function filterSmoking(){\r\n for(let i = 0; i < listings.length; i++){\r\n let l = listings[i].val;\r\n listings[i].visible = l.smoking && listings[i].visible;\r\n }\r\n}", "function getTrashList() {\n return Object.values(DB).filter((item) => item.status === TRASH)\n}", "function allMatches(words, pattern) {\n // let matchedWords = [];\n // words.forEach(word => pattern.test(word) ? matchedWords.push(word) : null);\n // console.log(matchedWords);\n return worlds.filter(word => pattern.test(word));\n}", "getAllWorkstations(knex) {\n return knex\n .select('*')\n .from('itmanager_workstations')\n }", "getWords() {\n return Array.from(this.list);\n }", "showHikeList() {\n return this.getAllHikes();\n }", "function isAllFullTimeWage(dailyWage){\n return dailyWage.includes(\"160\");\n}", "function gooseFilter(birds) {\n var geese = [\"African\", \"Roman Tufted\", \"Toulouse\", \"Pilgrim\", \"Steinbacher\"];\n var notgeese = birds.filter(function (bird) {\n return !geese.includes(bird);\n })\n\n\n return notgeese\n\n}", "function getSitelinks(entity) {\n let sitelinks = [];\n if (entity.sitelinks) {\n Object.keys(entity.sitelinks).forEach(k => {\n let language = k.replace(/wiki/, '');\n if (!/^(ceb|commons|simple)$/.test(language)) {\n sitelinks.push(`${language}:${entity.sitelinks[k].title}`);\n }\n });\n }\n return sitelinks;\n}", "usedPhrases ({start, end}) {\n const filterRow = row => row.date >= start && row.date < end\n const phrases = new Set()\n // load all the unique phrases\n for (let n = 1; n <= this.options.maxN; n++) {\n this.ngrams[n].filter(filterRow).forEach(row => {\n phrases.add(row.ngram)\n })\n }\n return [...phrases]\n }", "async function getAllAvailableWaiters(theDay) {\n let query = `SELECT username FROM waiters\n WHERE usertype = 'waiter' \n EXCEPT \n SELECT username FROM waiterdays\n WHERE day_name = '${theDay}' `;\n let results = await pool.query(query);\n\n return results.rows;\n }", "function putzolo_getToBeHiddenTextList(){\n return [\n \"invite friends to like\",\n \"sponsored\",\n \"suggested pages\",\n \"buy and sell groups\",\n \"sale groups\",\n \"suggested groups\",\n \"popular live vid\",\n \"popular vid\",\n \"page posts you\",\n \"you may like\",\n \"you may also like\",\n \"improve your news feed\",\n \"suggested people\",\n \"people you may know\",\n \"by writing a review\"\n ];\n }", "async findTips() {\n\t\tconst { client } = this;\n\t\t// @NB if @mention starts the tweet text, in_reply_to_user_id_str will not be\n\t\t// null\n\n\t\tconst params = {\n\t\t\tquery: '$woke OR $wokens OR $WOKE OR $WOKENS OR WOKENS',\n\t\t\tresult_type: 'recent',\n\t\t\tentities: 'false',\n\t\t\tcount: 100,\n\t\t\ttweetMode: 'extended',\n\t\t};\n\n\t\ttry {\n\t\t\tconst tweets = await client.searchTweets(params);\n\t\t\treturn filterTipTweets(tweets);\n\t\t} catch (error) {\n\t\t\t// Squash the error\n\t\t\t//error: {\"error\":\"Sorry, your query is too complex. Please reduce complexity and try again.\"}.\n\t\t\tconsole.error(error);\n\t\t\tthrow error;\n\t\t}\n\n\t\treturn [];\n\t}", "async getTweetQueries() {\n const list = await this.config.find({}).lean();\n list.forEach(async item => {\n await this.getTweets(this._formatQuery(item));\n });\n }", "function getIgnoreKeywords_allWords_S_Words() {\n\t\treturn [\n\t\t\t'said',\n\t\t\t'sake',\n\t\t\t'same',\n\t\t\t'saw',\n\t\t\t'say',\n\t\t\t'saying',\n\t\t\t'says',\t\n\t\t\t'scarcely',\n\t\t\t'see',\n\t\t\t'seeing',\n\t\t\t'seen',\n\t\t\t'sees',\n\t\t\t'seek',\n\t\t\t'seeked',\n\t\t\t'seeks',\n\t\t\t'seem',\t\n\t\t\t'seemed',\n\t\t\t'seeming',\n\t\t\t'seemingly',\n\t\t\t'seems',\n\t\t\t'seldom',\n\t\t\t'send',\n\t\t\t'sending',\n\t\t\t'sends',\n\t\t\t'sent',\n\t\t\t'separate',\n\t\t\t'separated',\n\t\t\t'separates',\n\t\t\t'separating',\n\t\t\t'set',\n\t\t\t'several',\n\t\t\t'shall',\n\t\t\t'shalt',\n\t\t\t'she',\n\t\t\t'she\\'d',\n\t\t\t'she\\'ll',\n\t\t\t'she\\'s',\n\t\t\t'sheer',\n\t\t\t'shew',\n\t\t\t'short',\n\t\t\t'shorter',\n\t\t\t'shortest',\n\t\t\t'shortly',\n\t\t\t'should',\n\t\t\t'show',\t\n\t\t\t'shows',\n\t\t\t'sic',\t\n\t\t\t'side',\t\n\t\t\t'sides',\n\t\t\t'siding',\n\t\t\t'signifies',\n\t\t\t'simply',\n\t\t\t'simultaneosly',\n\t\t\t'since',\n\t\t\t'sincerely',\n\t\t\t'slightly',\n\t\t\t'slowly',\n\t\t\t'so',\n\t\t\t'so-called',\n\t\t\t'socalled',\n\t\t\t'some',\n\t\t\t'somebody',\n\t\t\t'someone',\n\t\t\t'somewhat',\n\t\t\t'soon',\n\t\t\t'some',\n\t\t\t'somehow',\n\t\t\t'something',\n\t\t\t'sometimes',\n\t\t\t'sorts',\n\t\t\t'sought',\n\t\t\t'specially',\n\t\t\t'st',\n\t\t\t'stated',\n\t\t\t'steadily',\n\t\t\t'still',\n\t\t\t'stop',\n\t\t\t'strictly',\n\t\t\t'sturm', // german, 'sturm und drang'\n\t\t\t'subject',\n\t\t\t'such',\n\t\t\t'sudden',\n\t\t\t'suddenly',\n\t\t\t'suppose',\n\t\t\t'supposed',\n\t\t\t'supposedly',\n\t\t\t'supposes',\n\t\t\t'supposing',\n\t\t\t'sure',\n\t\t\t'surely',\n\t\t];\n\t}", "function filterLists(keyword) {\n\n keyword = keyword.toLowerCase();\n\n var matches = [],\n tempTitle = '',\n tempUrl = '';\n\n allLists.map(function (list) {\n tempTitle = list.title.toLowerCase();\n tempUrl = list.href.toLowerCase();\n\n if (tempTitle.match(keyword) || tempUrl.match(keyword)) {\n matches.push(list);\n }\n });\n\n populateLists(matches);\n }", "function getIgnoreKeywords_allNumberWords_upToTwenty() {\n\t\treturn [\n\t\t\t'ten',\n\t\t\t'eleven',\n\t\t\t'twelve',\n\t\t\t'thirteen',\n\t\t\t'fourteen',\n\t\t\t'fifteen',\n\t\t\t'sixteen',\n\t\t\t'seventeen',\n\t\t\t'eighteen',\n\t\t\t'nineteen',\n\t\t\t'twenty',\n\t\t];\n\t}", "function gooseFilter(birds){\n const geese = ['African', 'Roman Tufted', 'Toulouse', 'Pilgrim', 'Steinbacher'];\n return birds.filter(bird => !geese.includes(bird));\n}", "function qweryTimeContainers() { // inline time containers\n if (gSupported) return qwerySelectorAll(\n \"*[data-timecontainer], *[smil-timecontainer], *[timeContainer]\");\n // OLDIE (IE6, IE7) and no CSS Selector library\n var results = [];\n var tmp = document.getElementsByTagName(\"*\");\n var re = /^(par|seq|excl)$/i;\n for (var i = 0; i < tmp.length; i++) {\n if (re.test(tmp[i].nodeName)\n || tmp[i].getAttribute(\"data-timecontainer\")\n || tmp[i].getAttribute(\"smil-timecontainer\")\n || tmp[i].getAttribute(\"timeContainer\")) {\n results.push(tmp[i]);\n }\n }\n return results;\n }" ]
[ "0.60927945", "0.5802196", "0.56968987", "0.56936437", "0.55954665", "0.555977", "0.5555159", "0.55304885", "0.5515735", "0.548706", "0.5456238", "0.5452148", "0.54423565", "0.53665096", "0.53191316", "0.5300466", "0.52865535", "0.52622753", "0.52552134", "0.5253193", "0.5238277", "0.5229258", "0.5222707", "0.5216879", "0.5156915", "0.51308405", "0.51159257", "0.509476", "0.50940496", "0.5089414", "0.5088343", "0.50775456", "0.5056173", "0.5048791", "0.5030146", "0.50252104", "0.50251526", "0.5023424", "0.5007092", "0.5000835", "0.49997497", "0.49928188", "0.49769822", "0.49767318", "0.49737424", "0.4973479", "0.49718702", "0.4971473", "0.4970327", "0.4966684", "0.49662343", "0.49626133", "0.49599236", "0.49458924", "0.49441412", "0.493846", "0.4935683", "0.49336377", "0.49304983", "0.49274316", "0.49259692", "0.49215043", "0.49162763", "0.49104068", "0.49023128", "0.48999098", "0.4896115", "0.48839507", "0.48817298", "0.4876159", "0.48738554", "0.48665324", "0.4863866", "0.48538873", "0.48530814", "0.48517424", "0.48512006", "0.48488042", "0.4847745", "0.48459953", "0.48449928", "0.48444128", "0.4838777", "0.4831867", "0.4830123", "0.48182428", "0.48159036", "0.48154345", "0.48127094", "0.481154", "0.48106784", "0.4807649", "0.48076117", "0.4803694", "0.4798252", "0.47959638", "0.47928685", "0.47924426", "0.47915316", "0.47882172", "0.4787033" ]
0.0
-1
array function builds map info into map variable and then returns its display.
function displayMap(myMap) { var map = "\n"; for (var i = 0; i < 9; i++) { for (var j = 0; j < 6; j++) { map += myMap[i][j]; } map += "\n"; } return map; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapDisplayer() {\n $(\"#map\").empty();\n for(var idx = 0; idx < mapArrays.length; idx++) {\n var tempString = \"\";\n for(var idx2 = 0; idx2 < mapArrays[idx].length; idx2++) {\n tempString += \"<span id=\\\"location-\" + idx + \"-\" + idx2 + \"\\\" class=\\\"\" + mapArrays[idx][idx2].color + \"\\\">\" + mapArrays[idx][idx2].symbol +\"</span>\";\n }\n $(\"#map\").append(\"<p>\" + tempString + \"</p>\");\n }\n}", "function buildMapFromArray(myMap) {\r\n var num = myMap.length;\r\n// alert(num+\" \"+myMap+\" \"+myMap[0][1]);\r\n \r\n var ret = new Array();\r\n for (var i = 0; i < num; i++) {\r\n var city = new Object();\r\n city.index = i;\r\n city.x = cityRad+myMap[i][0];\r\n city.y = cityRad+myMap[i][1];\r\n ret.push(city);\r\n }\r\n return ret;\r\n}", "mapGenerate() {\n for (let i = 0; i < this.ySize; i++) {\n this.map[i] = [];\n for (let j = 0; j < this.xSize; j++) {\n let mapValue = this.empty;\n this.map[i].push(mapValue);\n }\n }\n }", "function buildValueArray(name, mod, map, fn) {\n var field = name, all = [], setMap;\n if (!loc[field]) {\n field += 's';\n }\n if (!map) {\n map = {};\n setMap = true;\n }\n forAllAlternates(field, function(alt, j, i) {\n var idx = j * mod + i, val;\n val = fn ? fn(i) : i;\n map[alt] = val;\n map[alt.toLowerCase()] = val;\n all[idx] = alt;\n });\n loc[field] = all;\n if (setMap) {\n loc[name + 'Map'] = map;\n }\n }", "function buildValueArray(name, mod, map, fn) {\n var field = name, all = [], setMap;\n if (!loc[field]) {\n field += 's';\n }\n if (!map) {\n map = {};\n setMap = true;\n }\n forAllAlternates(field, function(alt, j, i) {\n var idx = j * mod + i, val;\n val = fn ? fn(i) : i;\n map[alt] = val;\n map[alt.toLowerCase()] = val;\n all[idx] = alt;\n });\n loc[field] = all;\n if (setMap) {\n loc[name + 'Map'] = map;\n }\n }", "function summonCaptainPlanet() {\r\n\tconsole.log(map)\r\n}", "function buildMap () {\n const map = [];\n\n // Class\n map.push(\n \"Jedi\", \"Sith\",\n \"Republic\", \"Imperial\",\n \"Jedi Knight\", \"Sith Warrior\",\n \"Guardian\", \"Juggernaut\",\n \"Sentinel\", \"Marauder\",\n \"Jedi Consular\", \"Sith Inquisitor\", \"data-sprite=\\\"jc-\", \"data-sprite=\\\"si-\",\n \"Shadow\", \"Assassin\",\n \"Sage\", \"Sorcerer\", \"data-sprite=\\\"sage-\", \"data-sprite=\\\"sorc-\",\n \"Seer\", \"Corruption\",\n \"Telekinetic\", \"Lightning\",\n \"Balance\", \"Madness\",\n \"Smuggler\", \"Imperial Agent\",\n \"Gunslinger\", \"Sniper\",\n \"Scoundrel\", \"Operative\",\n \"Trooper\", \"Bounty Hunter\",\n \"Vanguard\", \"Power Tech\",\n \"Commando\", \"Mercenary\",\n );\n\n // Sage / Sorcerer\n map.push(\n // Attacks\n \"Telekinetic Throw\", \"Force Lightning\", \"Vanquish\", \"Demolish\",\n \"Sever Force\", \"Creeping Terror\", \"Weaken Mind\", \"Affliction\",\n \"Force in Balance\", \"Death Field\", \"Force Serenity\", \"Force Leach\",\n \"Disturbance\", \"Lightning Strike\", \"Project\", \"Shock\",\n \"Force Quake\", \"Force Storm\", \"Mind Crush\", \"Crushing Darkness\",\n // Controls\n \"Force Lift\", \"Whirlwind\", \"Force Stun\", \"Electrocute\",\n \"Force Wave\", \"Overload\", \"Mind Snap\", \"Jolt\",\n // Heals\n \"Force Armor\", \"Static Barrier\", \"Force Mend\", \"Unnatural Preservation\",\n \"Rejuvenate\", \"Resurgense\", \"Benevolence\", \"Dark Heal\",\n \"Restoration\", \"Expunge\", \"Revival\", \"Reanimation\",\n \"Meditation\", \"Seethe\",\n // Buff & Utils\n \"Force Valor\", \"Mark of Power\", \"Mental Alacrity\", \"Polarity Shift\",\n \"Force Potency\", \"Recklessness\", \"Force Empowerment\", \"Unlimited Power\",\n \"Vindicate\", \"Consuming Darkness\", \"Force of Will\", \"Unbreakable Will\",\n \"Rescue\", \"Extrication\",\n // Passives\n \"Rippling Force\", \"Lightning Burns\",\n \"Resonant Pulse\", \"Dark Echo\",\n // Skillful\n \"Psychic Suffusion\", \"Force Suffusion\", \"Jedi Resistance\", \"Sith Defiance\",\n \"Tectonic Master\", \"Tempest Mastery\", \"Pain Bearer\", \"Empty Body\",\n \"Benevolent Haste\", \"Dark Speed\",\n // Masterful\n \"Blockout\", \"Supression\", \"Mind Ward\", \"Corrupted Flest\",\n \"Valiance\", \"Dark Resilience\", \"Confound\", \"Conspiring Force\",\n \"Telekinetic Defense\", \"Lightning Barrier\", \"Staggering Stratagem\", \"Torturous Tactics\",\n // Heroic\n \"Egress\", \"Emersion\", \"Mental Defense\", \"Shapeless Spirit\",\n \"Metaphysical Alacrity\", \"Surging Speed\", \"Kinetic Collapse\", \"Backlash\",\n \"Containment\", \"Haunted Dreams\", \"Force Wake\", \"Electric Bindings\",\n // Legendary\n \"Swift Rejuvenation\", \"Galvanizing Cleanse\",\n \"Life Ward\", \"Corrupted Barrier\", \"Valorous Spirit\", \"Unnatural Vigor\",\n \"Ethereal Entity\", \"Shifting Silhouette\", \"Impeding Slash\", \"Enfeebling Strike\",\n // Short names\n \"skittles\", \"lightnings\" );\n\n // Vanguard / Powertech\n map.push(\n \"Transpose\", \"Translocate\"\n );\n\n const dict = new Map(), list = [];\n for ( let i = 0, len = map.length ; i < len ; i += 2 ) {\n const p = map[i], e = map[i+1], pid = '#'+idify(p), eid = '#'+idify(e);\n dict.set( p , [ new RegExp( `\\\\b${p}(?!</a>)\\\\b` , 'g' ), e ] );\n dict.set( pid, [ new RegExp( `${pid}\\\\b`, 'g' ), eid ] );\n list.push( p, pid );\n }\n list.sort( revLenSort );\n return [ dict, list ];\n}", "function CreateMapArray() {\n\tgridArr = [];\n\tfor(i=0; i<100; i++) {\n\t\tgridArr.push({open: 0, room: \"\", explored: 0, sDoor: 0, pathValue: 0, encounter: \"\", nonPC: \"\", loot: [], trapType: \"\", trapState: 0, notes: \"\"});\n\n\t}\n}", "function printArrayByMap(val){\n val.map(function(val){\n })\n return val;\n}", "function render() {\n debugMap(map, 10, 20);\n }", "mapToArray() {\n return this.map.apply(this, arguments).base;\n }", "function checkMap(){\n console.table(map);\n}", "function getMapData(data) {\n\n\tfor (var i = 0; i < data.length; i++) {\n loc[i] = data[i].loc;\n locX[i] = data[i].locx;\n locY[i] = data[i].locy;\n }\n\n//console.log(data[1]);\n}", "logMap(map) {\n for (var y = 0; y < map[0].length; y++) {\n var row = \"\";\n for (var x = 0; x < map.length; x++) {\n row += map[x][y] ? \"█\": \" \";\n }\n row += \" \";\n\n console.log(row);\n }\n }", "function map() {\n\n}", "function ArithGeo(arr) {}", "function create_map(name, code) {\n var view = '\"' + name + '\": {' + '\\n';\n view += '\"map\": \"' + escape(code) + '\"}';\n return view;\n}", "function createMap(name, width, height) {\n mapWidth = width;\n mapHeight = height;\n // pushing the height as row\n for (let i = 0; i < mapHeight; i++) {\n emptyMap.push([]);\n // pushing the width as column\n for (let y = 0; y < mapWidth; y++) {\n emptyMap[i].push(\"\");\n }\n }\n title.textContent = name;\n return emptyMap;\n }", "function mapToArray(map) {\n var map_split = map.split(/\\r\\n|\\r|\\n/)\n\n var width = map_split[0].length\n var height = map_split.length\n\n var array = new Array(height);\n for (let i = 0; i < height; i++) {\n array[i] = new Array(width);\n }\n\n for (let i = 0; i < height; i++) {\n for (let j = 0; j < width; j++) {\n if (map_split[i][j] === 'T') {\n var pos = {\n \"i\": i,\n \"j\": j\n };\n array[i][j] = ' ';\n } else {\n array[i][j] = map_split[i][j];\n }\n }\n }\n\n return {\n \"width\": width,\n \"height\": height,\n \"map\": array,\n \"pos\": pos\n }\n}", "initArrayMap() {\n for (let j = ((this.width - 1) / 2); j >= (-(this.width - 1) / 2); j--) {\n for (let i = (-(this.height - 1) / 2); i <= ((this.height - 1) / 2); i++) {\n this.arrayMap.push({\n coordX: i,\n coordY: j,\n navigable: true,\n player: {\n active: false\n },\n weapon: {\n active: false\n },\n potion: {\n active: false\n }\n });\n }\n }\n }", "function createTileMapArray()\n{\n delete fullMapArray;\n\n fullMapArray = [];\n for (var y = 0; y < MAP_TILE_HEIGHT; y++)\n {\n var rowArray = [];\n for (var x = 0; x < MAP_TILE_WIDTH; x++)\n {\n var tile = map.getTile(x, y, layer_map);\n \n if(tile != null)\n {\n var index = tile.index;\n rowArray.push(index);\n }\n }\n fullMapArray.push(rowArray);\n delete rowArray;\n }\n}", "get renderMap() {\n\t\tlet map = create2dArray(this._width, this._height);\n\t\tfor (let x=0; x<this._width; x++) {\n\t\t\tfor (let y=0; y<this._height; y++) {\n\t\t\t\tif (this._map[x][y]) map[x][y] = {fill: 'red'};\n\t\t\t}\n\t\t}\n\n\t\tmap[this._start.x][this._start.y] = {fill: 'green'};\n\t\tmap[this._end.x][this._end.y] = {fill: 'blue'};\n\n\t\treturn map;\n\t}", "function MAP() {\n\n}", "function initializeMap(height, width) {\r\n // 1, 2, 3, 4, 5, 6, 7, 8: numbers of mine near that tile\r\n // 10: no mine (cannot use 0 as 0 in tilemap represents no tile in map)\r\n // 9: bomb!\r\n var randmine = weightedRand({9:0.2, 10:0.8});\r\n var data = [];\r\n\r\n for (var y = 0; y < height; y++) {\r\n data.push([]);\r\n for (var x = 0; x < width; x++) {\r\n data[y].push(parseInt(randmine()));\r\n // if (x < width-1){\r\n // data += ',';\r\n // }\r\n }\r\n // if (y < height-1){\r\n // data += \"\\n\";\r\n // }\r\n }\r\n //console.log(typeof data[0]);\r\n return data;\r\n}", "function showOverlays(map, array) {\n if (array) {\n for (i in array) {\n array[i].setMap(map);\n }\n }\n}", "function ordenarArrayMap(array) {\r\n document.write(\"<h3> datos ordenados </h3>\");\r\n let newArray = array.map(current => current);\r\n newArray.sort();\r\n showArray(newArray);\r\n console.log(array);\r\n}", "function answerMap() {\n let alpha = numbers.map(numbers => {\n document.getElementById('map').innerHTML += ' ' + String.fromCharCode(numbers)\n })\n}", "function draw_map(m, width, height, cast) {\n mapstring = \"\";\n\n for(var i=0; i<height; i++) {\n mapstring += cast[i] + \" \";\n for(var j=0; j<width; j++) {\n if(m[i] != undefined && m[i][j] != undefined) {\n var entity = m[i][j];\n //var ch = token_table[entity];\n var ch = m[i][j] == \"true\" ? \"1 \" : \"0 \";\n mapstring += ch;\n if(ch == undefined) {\n console.log(\"Unable to find a char for [\"+entity+\"]\");\n }\n } else {\n mapstring += \".\"\n }\n }\n mapstring+=\"\\n\";\n }\n mapstring += \"\\n\";\n\n return mapstring;\n}", "function makeStrings(arr){\n matrixCheck = arr.map(function(profile){\n if (profile.age > 21){\n return profile.name + \" can go to the Matrix!\"\n } else {\n return profile.name + \" is underage!\"\n }\n\n })\n //console.log(matrixCheck)\n}", "function render_map(given_object) {\n\n //console.log(map_dt);\n given_data_second_part_3rd = given_object[\"second_part_3rd\"];\n given_data_second_part_1st = given_object[\"second_part_1st\"];\n given_data_second_part_2nd = given_object[\"second_part_2nd\"];\n given_data_third_part_1st = given_object[\"third_part_1st\"];\n given_data_third_part_2nd = given_object[\"third_part_2nd\"];\n given_data_fifth_part_1st = given_object[\"fifth_part_1st\"];\n given_data_fifth_part_2nd = given_object[\"fifth_part_2nd\"];\n given_data_fifth_part_3rd = given_object[\"fifth_part_3rd\"];\n given_data_fifth_part_4th = given_object[\"fifth_part_4th\"];\n given_data_fifth_part_5th = given_object[\"fifth_part_5th\"];\n given_data_fifth_part_6th = given_object[\"fifth_part_6th\"];\n given_data_fifth_part_7th = given_object[\"fifth_part_7th\"];\n given_data_fifth_part_8th = given_object[\"fifth_part_8th\"];\n given_data_fifth_part_9th = given_object[\"fifth_part_9th\"];\n given_data_fifth_part_10th = given_object[\"fifth_part_10th\"];\n given_data_fifth_part_11th = given_object[\"fifth_part_11th\"];\n given_data_fifth_part_12th = given_object[\"fifth_part_12th\"];\n given_data_fifth_part_13th = given_object[\"fifth_part_13th\"];\n given_data_fifth_part_14th = given_object[\"fifth_part_14th\"];\n given_data_fifth_part_15th = given_object[\"fifth_part_15th\"];\n given_data_sixth_part_1st = given_object[\"sixth_part_1st\"];\n given_data_sixth_part_2nd = given_object[\"sixth_part_2nd\"];\n given_data_sixth_part_3rd = given_object[\"sixth_part_3rd\"];\n given_data_sixth_part_4th_1 = given_object[\"sixth_part_4th_1\"];\n given_data_sixth_part_4th_2 = given_object[\"sixth_part_4th_2\"];\n given_data_sixth_part_4th_3 = given_object[\"sixth_part_4th_3\"];\n given_data_sixth_part_4th_4 = given_object[\"sixth_part_4th_4\"];\n given_data_sixth_part_5th_1 = given_object[\"sixth_part_5th_1\"];\n given_data_sixth_part_5th_2 = given_object[\"sixth_part_5th_2\"];\n given_data_sixth_part_5th_3 = given_object[\"sixth_part_5th_3\"];\n given_data_sixth_part_5th_4 = given_object[\"sixth_part_5th_4\"];\n given_data_sixth_part_6th_1 = given_object[\"sixth_part_6th_1\"];\n given_data_sixth_part_6th_2 = given_object[\"sixth_part_6th_2\"];\n given_data_sixth_part_6th_3 = given_object[\"sixth_part_6th_3\"];\n given_data_sixth_part_6th_4 = given_object[\"sixth_part_6th_4\"];\n given_data_sixth_part_7th_1 = given_object[\"sixth_part_7th_1\"];\n given_data_sixth_part_7th_2 = given_object[\"sixth_part_7th_2\"];\n given_data_sixth_part_7th_3 = given_object[\"sixth_part_7th_3\"];\n given_data_sixth_part_7th_4 = given_object[\"sixth_part_7th_4\"];\n given_data_third_part_1st_1 = given_object[\"3rd_part_1st_1\"];\n given_data_third_part_1st_2 = given_object[\"3rd_part_1st_2\"];\n given_data_third_part_1st_3 = given_object[\"3rd_part_1st_3\"];\n given_data_third_part_1st_4 = given_object[\"3rd_part_1st_4\"];\n given_data_third_part_2nd_1 = given_object[\"3rd_part_2nd_1\"];\n given_data_third_part_2nd_2 = given_object[\"3rd_part_2nd_2\"];\n given_data_third_part_2nd_3 = given_object[\"3rd_part_2nd_3\"];\n given_data_third_part_2nd_4 = given_object[\"3rd_part_2nd_4\"];\n given_data_third_part_3rd_1 = given_object[\"3rd_part_3rd_1\"];\n given_data_third_part_3rd_2 = given_object[\"3rd_part_3rd_2\"];\n given_data_third_part_3rd_3 = given_object[\"3rd_part_3rd_3\"];\n given_data_third_part_3rd_4 = given_object[\"3rd_part_3rd_4\"];\n given_data_third_part_4th_1 = given_object[\"3rd_part_4th_1\"];\n given_data_third_part_4th_2 = given_object[\"3rd_part_4th_2\"];\n given_data_third_part_4th_3 = given_object[\"3rd_part_4th_3\"];\n given_data_third_part_4th_4 = given_object[\"3rd_part_4th_4\"];\n given_data_first_part_1st_1 = given_object[\"1st_part_1st_1\"];\n given_data_first_part_1st_2 = given_object[\"1st_part_1st_2\"];\n given_data_first_part_2nd_1 = given_object[\"1st_part_2nd_1\"];\n given_data_first_part_2nd_2 = given_object[\"1st_part_2nd_2\"];\n given_data_first_part_3rd_1 = given_object[\"1st_part_3rd_1\"];\n given_data_first_part_3rd_2 = given_object[\"1st_part_3rd_2\"];\n given_data_first_part_4th_1 = given_object[\"1st_part_4th_1\"];\n given_data_first_part_4th_2 = given_object[\"1st_part_4th_2\"];\n given_data_first_part_5th_1 = given_object[\"1st_part_5th_1\"];\n given_data_first_part_5th_2 = given_object[\"1st_part_5th_2\"];\n given_data_first_part_6th_1 = given_object[\"1st_part_6th_1\"];\n given_data_first_part_6th_2 = given_object[\"1st_part_6th_2\"];\n given_data_first_part_7th_1 = given_object[\"1st_part_7th_1\"];\n given_data_first_part_7th_2 = given_object[\"1st_part_7th_2\"];\n given_data_first_part_8th_1 = given_object[\"1st_part_8th_1\"];\n given_data_first_part_8th_2 = given_object[\"1st_part_8th_2\"];\n given_data_first_part_9th_1 = given_object[\"1st_part_9th_1\"];\n given_data_first_part_9th_2 = given_object[\"1st_part_9th_2\"];\n given_data_first_part_10th_1 = given_object[\"1st_part_10th_1\"];\n given_data_first_part_10th_2 = given_object[\"1st_part_10th_2\"];\n given_data_first_part_11th_1 = given_object[\"1st_part_11th_1\"];\n given_data_first_part_11th_2 = given_object[\"1st_part_11th_2\"];\n given_data_first_part_12th_1 = given_object[\"1st_part_12th_1\"];\n given_data_first_part_12th_2 = given_object[\"1st_part_12th_2\"];\n given_data_first_part_13th_1 = given_object[\"1st_part_13th_1\"];\n given_data_first_part_13th_2 = given_object[\"1st_part_13th_2\"];\n given_data_first_part_14th_1 = given_object[\"1st_part_14th_1\"];\n given_data_first_part_14th_2 = given_object[\"1st_part_14th_2\"];\n given_data_first_part_15th_1 = given_object[\"1st_part_15th_1\"];\n given_data_first_part_15th_2 = given_object[\"1st_part_15th_2\"];\n given_data_first_part_16th_1 = given_object[\"1st_part_16th_1\"];\n given_data_first_part_16th_2 = given_object[\"1st_part_16th_2\"];\n given_data_first_part_17th_1 = given_object[\"1st_part_17th_1\"];\n given_data_first_part_17th_2 = given_object[\"1st_part_17th_2\"];\n given_data_first_part_18th_1 = given_object[\"1st_part_18th_1\"];\n given_data_first_part_18th_2 = given_object[\"1st_part_18th_2\"];\n given_data_first_part_19th_1 = given_object[\"1st_part_19th_1\"];\n given_data_first_part_19th_2 = given_object[\"1st_part_19th_2\"];\n given_data_first_part_20th_1 = given_object[\"1st_part_20th_1\"];\n given_data_first_part_20th_2 = given_object[\"1st_part_20th_2\"];\n given_data_first_part_21th_1 = given_object[\"1st_part_21th_1\"];\n given_data_first_part_21th_2 = given_object[\"1st_part_21th_2\"];\n given_data_first_part_22th_1 = given_object[\"1st_part_22th_1\"];\n given_data_first_part_22th_2 = given_object[\"1st_part_22th_2\"];\n given_data_first_part_23th_1 = given_object[\"1st_part_23th_1\"];\n given_data_first_part_23th_2 = given_object[\"1st_part_23th_2\"];\n given_data_first_part_24th_1 = given_object[\"1st_part_24th_1\"];\n given_data_first_part_24th_2 = given_object[\"1st_part_24th_2\"];\n given_data_first_part_25th_1 = given_object[\"1st_part_25th_1\"];\n given_data_first_part_25th_2 = given_object[\"1st_part_25th_2\"];\n given_data_first_part_26th_1 = given_object[\"1st_part_26th_1\"];\n given_data_first_part_26th_2 = given_object[\"1st_part_26th_2\"];\n given_data_first_part_27th_1 = given_object[\"1st_part_27th_1\"];\n given_data_first_part_27th_2 = given_object[\"1st_part_27th_2\"];\n given_data_first_part_28th_1 = given_object[\"1st_part_28th_1\"];\n given_data_first_part_28th_2 = given_object[\"1st_part_28th_2\"];\n given_data_first_part_29th_1 = given_object[\"1st_part_29th_1\"];\n given_data_first_part_29th_2 = given_object[\"1st_part_29th_2\"];\n given_data_first_part_30th_1 = given_object[\"1st_part_30th_1\"];\n given_data_first_part_30th_2 = given_object[\"1st_part_30th_2\"];\n given_data_first_part_31th_1 = given_object[\"1st_part_31th_1\"];\n given_data_first_part_31th_2 = given_object[\"1st_part_31th_2\"];\n given_data_first_part_32th_1 = given_object[\"1st_part_32th_1\"];\n given_data_first_part_32th_2 = given_object[\"1st_part_32th_2\"];\n given_data_first_part_33th_1 = given_object[\"1st_part_33th_1\"];\n given_data_first_part_33th_2 = given_object[\"1st_part_33th_2\"];\n given_data_seventh_part_1st_1 = given_object[\"7th_part_1st_1\"];\n given_data_seventh_part_1st_2 = given_object[\"7th_part_1st_2\"];\n given_data_seventh_part_2nd_1 = given_object[\"7th_part_2nd_1\"];\n given_data_seventh_part_2nd_2 = given_object[\"7th_part_2nd_2\"];\n given_data_seventh_part_3rd_1 = given_object[\"7th_part_3rd_1\"];\n given_data_seventh_part_3rd_2 = given_object[\"7th_part_3rd_2\"];\n given_data_seventh_part_4th_1 = given_object[\"7th_part_4th_1\"];\n given_data_seventh_part_4th_2 = given_object[\"7th_part_4th_2\"];\n given_data_seventh_part_5th_1 = given_object[\"7th_part_5th_1\"];\n given_data_seventh_part_5th_2 = given_object[\"7th_part_5th_2\"];\n given_data_seventh_part_6th_1 = given_object[\"7th_part_6th_1\"];\n given_data_seventh_part_6th_2 = given_object[\"7th_part_6th_2\"];\n given_data_seventh_part_7th_1 = given_object[\"7th_part_7th_1\"];\n given_data_seventh_part_7th_2 = given_object[\"7th_part_7th_2\"];\n given_data_seventh_part_8th_1 = given_object[\"7th_part_8th_1\"];\n given_data_seventh_part_8th_2 = given_object[\"7th_part_8th_2\"];\n given_data_seventh_part_9th_1 = given_object[\"7th_part_9th_1\"];\n given_data_seventh_part_9th_2 = given_object[\"7th_part_9th_2\"];\n given_data_seventh_part_10th_1 = given_object[\"7th_part_10th_1\"];\n given_data_seventh_part_10th_2 = given_object[\"7th_part_10th_2\"];\n given_data_seventh_part_11th_1 = given_object[\"7th_part_11th_1\"];\n given_data_seventh_part_11th_2 = given_object[\"7th_part_11th_2\"];\n given_data_seventh_part_12th_1 = given_object[\"7th_part_12th_1\"];\n given_data_seventh_part_12th_2 = given_object[\"7th_part_12th_2\"];\n given_data_seventh_part_13th_1 = given_object[\"7th_part_13th_1\"];\n given_data_seventh_part_13th_2 = given_object[\"7th_part_13th_2\"];\n given_data_seventh_part_14th_1 = given_object[\"7th_part_14th_1\"];\n given_data_seventh_part_14th_2 = given_object[\"7th_part_14th_2\"];\n given_data_seventh_part_15th_1 = given_object[\"7th_part_15th_1\"];\n given_data_seventh_part_15th_2 = given_object[\"7th_part_15th_2\"];\n given_data_seventh_part_16th_1 = given_object[\"7th_part_16th_1\"];\n given_data_seventh_part_16th_2 = given_object[\"7th_part_16th_2\"];\n given_data_seventh_part_17th_1 = given_object[\"7th_part_17th_1\"];\n given_data_seventh_part_17th_2 = given_object[\"7th_part_17th_2\"];\n given_data_seventh_part_18th_1 = given_object[\"7th_part_18th_1\"];\n given_data_seventh_part_18th_2 = given_object[\"7th_part_18th_2\"];\n given_data_seventh_part_19th_1 = given_object[\"7th_part_19th_1\"];\n given_data_seventh_part_19th_2 = given_object[\"7th_part_19th_2\"];\n given_data_seventh_part_20th_1 = given_object[\"7th_part_20th_1\"];\n given_data_seventh_part_20th_2 = given_object[\"7th_part_20th_2\"];\n given_data_seventh_part_21th_1 = given_object[\"7th_part_21th_1\"];\n given_data_seventh_part_21th_2 = given_object[\"7th_part_21th_2\"];\n given_data_seventh_part_22th_1 = given_object[\"7th_part_22th_1\"];\n given_data_seventh_part_22th_2 = given_object[\"7th_part_22th_2\"];\n given_data_seventh_part_23th_1 = given_object[\"7th_part_23th_1\"];\n given_data_seventh_part_23th_2 = given_object[\"7th_part_23th_2\"];\n given_data_seventh_part_24th_1 = given_object[\"7th_part_24th_1\"];\n given_data_seventh_part_24th_2 = given_object[\"7th_part_24th_2\"];\n given_data_seventh_part_25th_1 = given_object[\"7th_part_25th_1\"];\n given_data_seventh_part_25th_2 = given_object[\"7th_part_25th_2\"];\n given_data_seventh_part_26th_1 = given_object[\"7th_part_26th_1\"];\n given_data_seventh_part_26th_2 = given_object[\"7th_part_26th_2\"];\n given_data_seventh_part_27th_1 = given_object[\"7th_part_27th_1\"];\n given_data_seventh_part_27th_2 = given_object[\"7th_part_27th_2\"];\n given_data_seventh_part_28th_1 = given_object[\"7th_part_28th_1\"];\n given_data_seventh_part_28th_2 = given_object[\"7th_part_28th_2\"];\n given_data_seventh_part_29th_1 = given_object[\"7th_part_29th_1\"];\n given_data_seventh_part_29th_2 = given_object[\"7th_part_29th_2\"];\n // required part 6th block\n given_loc_data_sixth_part = given_object[\"required_part_location_6th_block\"];\n given_loc_data_fourth_part = given_object[\"required_part_location_4th_block\"];\n given_loc_data_first_part = given_object[\"required_part_location_1th_block\"];\n given_loc_data_seventh_part = given_object[\"required_part_location_7th_block\"];\n\n\n\n\n\n\n\n\n\n\n //given_data_sixth_part_6th_1\n\n //given_data_sixth_part_5th_1\n\n\n\n\n var map = L.map('map', {\n crs: L.CRS.Simple,\n minZoom: -0.60,\n maxZoom: -0.60,\n zoomControl: false\n\n\n //salert(minZoom);\n });\n\n L.tileLayer('', { attribution: '' }).addTo(map);\n myFeatureGroup = L.featureGroup().addTo(map).on(\"click\", groupClick);\n var bounds = [[-200, 0], [3300, 2500]];\n //var image = L.imageOverlay(\"{{ url_for('static', filename='white_background.jpeg')}}\", bounds).addTo(map);\n var image = L.imageOverlay(\"{{ url_for('static', filename='map3.jpg')}}\", bounds).addTo(map);\n //var image = L.VideoOverlay(\"{{ url_for('static', filename='r1.svg')}}\", bounds).addTo(map);\n //console.log(myFeatureGroup);\n\n map.fitBounds(bounds);\n var yx = L.latLng;\n var xy = function (x, y) {\n if (L.Util.isArray(x)) {\n return yx(x[1], x[0]);\n }\n return yx(y, x); // When doing xy(x, y);\n };\n\n var markers_2nd_part_3rd = given_data_second_part_3rd;\n\n // filling all markers using for loop\n for (var i = 0; i < markers_2nd_part_3rd.length; i++) {\n\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = ' <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_3rd[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const urlu = URL.createObjectURL(blob);\n var greenIcon = new LeafIcon({ iconUrl: urlu });\n // test = \"Id \" + i;\n test = markers_2nd_part_3rd[i][\"SV ID\"];\n // console.log( markers_2nd_part_3rd[i][\"SV ID\"]);\n //marker_arr = markers[i]\n //var new_marker = xy(marker_arr[0], marker_arr[1]);\n x_val = markers_2nd_part_3rd[i][\"marker_position\"];\n // console.log(\"x_val\");\n //console.log(x_val);\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n //---------------------------------------------- fill 1st part of 2nd block-----------------------------\n var markers_2nd_part_1st = given_data_second_part_1st;\n for (var i = 0; i < markers_2nd_part_1st.length; i++) {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n\n }\n });\n var svg = ' <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 36\" width=\"50\" height=\"36\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">'+markers_2nd_part_3rd[i][\"Location\"]+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n //var greenIcon = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n var greenIcon = new LeafIcon({ iconUrl: svg_url });\n\n test = markers_2nd_part_1st[i][\"SV ID\"];\n x_val = markers_2nd_part_1st[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n\n\n //---------------------------------------------- fill 2nd part of 2nd block---------------------------\n\n //required_part_location_2_of_2=[\"M/MT/FL058A2\",\"M/MT/FL059A2\",\"M/MT/FL060A2\",\"M/MT/FL060A3\",\"M/MT/FL061A2\",\"M/MT/FL062A2\",\"M/MT/FL063A2\",\"M/MT/FL063A3\",\"M/MT/FL064A2\",\"M/MT/FL065A2\",\"M/MT/FL066A2\",\"M/MT/FL066A3\",\"M/MT/FL067A2\",\"M/MT/FL068A2\",\"M/MT/FL069A2\",\"M/MT/FL069A3\",\"M/MT/FL070A2\",\"M/MT/FL071A2\",\"M/MT/FL072A2\",\"M/MT/FL072A3\",\"M/MT/FL073A2\",\"M/MT/FL074A2\"]\n\n var markers_2nd_part_2nd = given_data_second_part_2nd;\n for (var k = 0; k < markers_2nd_part_2nd.length; k++) {\n var greenIcon;\n if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL060A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 10);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL060A3\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 42);\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n //var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL063A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 57);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL063A3\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 90);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL058A2\" || markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL059A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n }\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL064A2\" || markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL065A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 97);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL070A2\" || markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL071A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 202);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL073A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 250);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n }\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL067A2\" || markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL068A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 151);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL075A2\" || markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL076A2\" || markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL077A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 296);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n }\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL079A2\" || markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL080A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 345);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n }\n\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL066A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 108);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL066A3\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 138);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL069A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 160);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL069A3\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 193);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL072A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 212);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL072A3\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 242);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL074A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 255);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL074A3\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 286);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL078A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 306);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL078A3\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 335);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL081A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 356);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL081A3\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 385);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 47);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n\n // ------------------------------filling 1st part of third block--------------------------\n // required_part_location_1_of_3=[\"M/MT/FL051A1\",\"M/MT/FL050A1\",\"M/MT/FL049A2\",\"M/MT/FL049A1\",\"M/MT/FL048A1\",\"M/MT/FL047A1\",\"M/MT/FL046A2\",\"M/MT/FL046A1\",\"M/MT/FL045A1\",\"M/MT/FL044A1\"]\n\n var markers_3rd_part_1st = given_data_third_part_1st;\n\n for (var i = 0; i < markers_3rd_part_1st.length; i++) {\n var greenIcon;\n //console.log(\"all location\")\n //console.log(markers_2nd_part_2nd[k]['Location']);\n if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL051A1\" || markers_3rd_part_1st[i]['Location'] == \"M/MT/FL050A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_3rd_part_1st[i][\"SV ID\"];\n\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n }\n\n else if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL049A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_1st[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 10);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL049A1\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_1st[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 35);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL048A1\" || markers_3rd_part_1st[i]['Location'] == \"M/MT/FL047A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log()\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_3rd_part_1st[i][\"SV ID\"];\n\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 45);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n }\n\n\n else if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL046A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_1st[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 52);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL046A1\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_1st[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 81);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL045A1\" || markers_3rd_part_1st[i]['Location'] == \"M/MT/FL044A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log()\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_3rd_part_1st[i][\"SV ID\"];\n\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 92);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n }\n\n else if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL044A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log()\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_3rd_part_1st[i][\"SV ID\"];\n\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var new_marker = xy(x_val[0] + 100, x_val[1] - 200);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n }\n\n else if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL044A3\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log()\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_3rd_part_1st[i][\"SV ID\"];\n\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var new_marker = xy(x_val[0] + 200, x_val[1] - 200);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n }\n\n\n\n\n }\n\n //----------------------------filling 2nd part for 3rd block----------------------------\n var markers_3rd_part_2nd = given_data_third_part_2nd;\n required_part_location_2_of_3 = [\"M/MT/FL044A2\", \"M/MT/FL044A3\", \"M/MT/FL044A4\", \"M/MT/FL044A5\"]\n\n for (var i = 0; i < markers_3rd_part_2nd.length; i++) {\n var greenIcon;\n //console.log(\"all location\")\n //console.log(markers_2nd_part_2nd[k]['Location']);\n if (markers_3rd_part_2nd[i]['Location'] == \"M/MT/FL044A2\" || markers_3rd_part_2nd[i]['Location'] == \"M/MT/FL044A3\" || markers_3rd_part_2nd[i]['Location'] == \"M/MT/FL044A4\" || markers_3rd_part_2nd[i]['Location'] == \"M/MT/FL044A5\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_3rd_part_2nd[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log(markers_3rd_part_2nd[i][\"Location\"]);\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_3rd_part_2nd[i][\"SV ID\"];\n\n x_val = markers_3rd_part_2nd[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n\n }\n\n }\n //given_data_fifth_part_1st\n\n\n\n //---------------------------------------filling 5th block---------------------------------------------\n //----------------------------filling 1st part for 5th block----------------------------\n // required_part_location_1_of_5=[\"M/MT/FL043A1\",\"M/MT/FL043A2\",\"M/MT/FL043A3\",\"M/MT/FL043A4\"]\n\n var markers_5th_part_1st = given_data_fifth_part_1st;\n //console.log(\"length here\");\n //console.log(markers_5th_part_1st);\n\n for (var i = 0; i < markers_5th_part_1st.length; i++) {\n var greenIcon;\n //console.log(\"all location\")\n //console.log(markers_2nd_part_2nd[k]['Location']);\n if (markers_5th_part_1st[i]['Location'] == \"M/MT/FL043A1\" || markers_5th_part_1st[i]['Location'] == \"M/MT/FL043A2\" || markers_5th_part_1st[i]['Location'] == \"M/MT/FL043A3\" || markers_5th_part_1st[i]['Location'] == \"M/MT/FL043A4\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log(markers_3rd_part_2nd[i][\"Location\"]);\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_1st[i][\"SV ID\"];\n\n x_val = markers_5th_part_1st[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n\n }\n\n }\n\n\n\n //----------------------------filling 2nd part for 5th block----------------------------\n // required_part_location_1_of_5=[\"M/MT/FL043A1\",\"M/MT/FL043A2\",\"M/MT/FL043A3\",\"M/MT/FL043A4\"]\n\n var markers_5th_part_2nd = given_data_fifth_part_2nd;\n\n for (var i = 0; i < markers_5th_part_2nd.length; i++) {\n var greenIcon;\n //console.log(\"all location\")\n //console.log(markers_2nd_part_2nd[k]['Location']);\n if (markers_5th_part_2nd[i]['Location'] == \"M/MT/FL042A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_2nd[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log(markers_3rd_part_2nd[i][\"Location\"]);\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_2nd[i][\"SV ID\"];\n\n x_val = markers_5th_part_2nd[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n\n }\n\n }\n\n\n //----------------------------filling 3rd part for 5th block----------------------------\n var markers_5th_part_3rd = given_data_fifth_part_3rd;\n\n for (var i = 0; i < markers_5th_part_3rd.length; i++) {\n var greenIcon;\n //console.log(\"all location\")\n //console.log(markers_2nd_part_2nd[k]['Location']);\n if (markers_5th_part_3rd[i]['Location'] == \"M/MT/FL041A1\" || markers_5th_part_3rd[i]['Location'] == \"M/MT/FL041A2\" || markers_5th_part_3rd[i]['Location'] == \"M/MT/FL041A3\" || markers_5th_part_3rd[i]['Location'] == \"M/MT/FL041A4\" || markers_5th_part_3rd[i]['Location'] == \"M/MT/FL041A5\" || markers_5th_part_3rd[i]['Location'] == \"M/MT/FL041A6\" || markers_5th_part_3rd[i]['Location'] == \"M/MT/FL041A7\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_3rd[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log(markers_3rd_part_2nd[i][\"Location\"]);\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_3rd[i][\"SV ID\"];\n\n x_val = markers_5th_part_3rd[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n\n }\n\n }\n\n\n //----------------------------filling 4th part for 5th block----------------------------\n var markers_5th_part_4th = given_data_fifth_part_4th;\n\n for (var i = 0; i < markers_5th_part_4th.length; i++) {\n // console.log(\"hiiii\");\n //console.log(markers_5th_part_4th);\n\n var greenIcon;\n //console.log(\"all location\")\n //console.log(markers_2nd_part_2nd[k]['Location']);\n if (markers_5th_part_4th[i]['Location'] == \"M/MT/FL040A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_4th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log(markers_3rd_part_2nd[i][\"Location\"]);\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_4th[i][\"SV ID\"];\n x_val = markers_5th_part_4th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n }\n\n }\n\n\n\n //----------------------------filling 5th part for 5th block----------------------------\n var markers_5th_part_5th = given_data_fifth_part_5th;\n //console.log(markers_5th_part_5th);\n\n for (var i = 0; i < markers_5th_part_5th.length; i++) {\n //console.log(\"hiiii soma\");\n\n var greenIcon;\n //console.log(\"all location\")\n //console.log(markers_2nd_part_2nd[k]['Location']);\n if (markers_5th_part_5th[i]['Location'] == \"M/MT/FL039A1\" || markers_5th_part_5th[i]['Location'] == \"M/MT/FL039A2\" || markers_5th_part_5th[i]['Location'] == \"M/MT/FL039A3\" || markers_5th_part_5th[i]['Location'] == \"M/MT/FL039A4\" || markers_5th_part_5th[i]['Location'] == \"M/MT/FL039A5\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_5th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log(markers_3rd_part_2nd[i][\"Location\"]);\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_5th[i][\"SV ID\"];\n x_val = markers_5th_part_5th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n }\n\n }\n //----------------------------filling 6th part for 5th block----------------------------\n var markers_5th_part_6th = given_data_fifth_part_6th;\n //required_part_location_6_of_5=[\"M/MT/FL038A1\",\"M/MT/FL037A1\",\"M/MT/FL036A1\",\"M/MT/FL035A1\",\"M/MT/FL034A1\",\"M/MT/FL033A1\",\"M/MT/FL032A1\",\"M/MT/FL031A1\",\"M/MT/FL030A1\",\"M/MT/FL029A1\",\"M/MT/FL028A1\"]\n\n for (var i = 0; i < markers_5th_part_6th.length; i++) {\n\n\n var greenIcon;\n //console.log(\"all location\")\n //console.log(markers_2nd_part_2nd[k]['Location']);\n if (markers_5th_part_6th[i]['Location'] == \"M/MT/FL038A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL037A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL036A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL035A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL034A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL033A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL032A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL031A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL030A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL029A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL028A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL027A1\") {\n\n\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_6th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log(markers_3rd_part_2nd[i][\"Location\"]);\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_6th[i][\"SV ID\"];\n x_val = markers_5th_part_6th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n // console.log(test);\n\n\n\n\n }\n }\n\n //----------------------fill 7th part of 6th block---------------------------------\n var markers_5th_part_7th = given_data_fifth_part_7th;\n // required_part_location_7_of_5=[\"M/MT/FL026A1\",\"M/MT/FL025A1\",\"M/MT/FL024A1\",\"M/MT/FL023A1\",\"M/MT/FL022A1\",\"M/MT/FL021A1\",\"M/MT/FL020A1\",\"M/MT/FL019A1\",\"M/MT/FL018A1\",\"M/MT/FL017A1\",\"M/MT/FL016A1\",\"M/MT/FL015A1\",\"M/MT/FL014A1\"]\n\n for (var i = 0; i < markers_5th_part_7th.length; i++) {\n var greenIcon;\n if (markers_5th_part_7th[i]['Location'] == \"M/MT/FL026A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL025A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL024A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL023A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL022A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL021A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL020A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL019A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL018A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL017A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL016A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL015A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL014A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_7th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_7th[i][\"SV ID\"];\n x_val = markers_5th_part_7th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------fill 7th part of 6th block---------------------------------\n var markers_5th_part_8th = given_data_fifth_part_8th;\n // console.log(\"given 5th part list\" );\n // console.log(markers_5th_part_8th);\n\n\n for (var i = 0; i < markers_5th_part_8th.length; i++) {\n var greenIcon;\n if (markers_5th_part_8th[i]['Location'] == \"M/MT/FL013A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL012A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL011A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL010A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL009A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL008A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL007A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL006A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL005A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL003A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL002A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL001A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_8th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_8th[i][\"SV ID\"];\n\n\n\n x_val = markers_5th_part_8th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n }\n\n if (markers_5th_part_8th[i]['Location'] == \"M/MT/FL004A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_8th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n test = markers_5th_part_8th[i][\"SV ID\"];\n x_val = markers_5th_part_8th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 6);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------fill 9th part of 6th block---------------------------------\n var markers_5th_part_9th = given_data_fifth_part_9th;\n\n for (var i = 0; i < markers_5th_part_9th.length; i++) {\n var greenIcon;\n if (markers_5th_part_9th[i]['Location'] == \"M/MT/FL029A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_9th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_9th[i][\"SV ID\"];\n x_val = markers_5th_part_9th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n //----------------------fill 10th part of 6th block---------------------------------\n var markers_5th_part_10th = given_data_fifth_part_10th;\n\n for (var i = 0; i < markers_5th_part_10th.length; i++) {\n var greenIcon;\n if (markers_5th_part_10th[i]['Location'] == \"M/MT/FL026A2\" || markers_5th_part_10th[i]['Location'] == \"M/MT/FL026A3\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_10th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_10th[i][\"SV ID\"];\n x_val = markers_5th_part_10th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n //----------------------fill 11th part of 6th block---------------------------------\n var markers_5th_part_11th = given_data_fifth_part_11th;\n\n for (var i = 0; i < markers_5th_part_11th.length; i++) {\n var greenIcon;\n if (markers_5th_part_11th[i]['Location'] == \"M/MT/FL021A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_11th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_11th[i][\"SV ID\"];\n x_val = markers_5th_part_11th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n var markers_5th_part_12th = given_data_fifth_part_12th;\n\n for (var i = 0; i < markers_5th_part_12th.length; i++) {\n var greenIcon;\n if (markers_5th_part_12th[i]['Location'] == \"M/MT/FL013A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_12th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_12th[i][\"SV ID\"];\n x_val = markers_5th_part_12th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n var markers_5th_part_13th = given_data_fifth_part_13th;\n\n for (var i = 0; i < markers_5th_part_13th.length; i++) {\n var greenIcon;\n if (markers_5th_part_13th[i]['Location'] == \"M/MT/FL011A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_13th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_13th[i][\"SV ID\"];\n x_val = markers_5th_part_13th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n var markers_5th_part_14th = given_data_fifth_part_14th;\n\n for (var i = 0; i < markers_5th_part_14th.length; i++) {\n var greenIcon;\n if (markers_5th_part_14th[i]['Location'] == \"M/MT/FL006A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_14th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_14th[i][\"SV ID\"];\n x_val = markers_5th_part_14th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n var markers_5th_part_15th = given_data_fifth_part_15th;\n\n for (var i = 0; i < markers_5th_part_15th.length; i++) {\n var greenIcon;\n if (markers_5th_part_15th[i]['Location'] == \"M/MT/FL005A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_15th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_15th[i][\"SV ID\"];\n x_val = markers_5th_part_15th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n\n }\n\n\n\n // code for fill 6th block\n\n var markers_6th_part_1st = given_data_sixth_part_1st;\n for (var i = 0; i < markers_6th_part_1st.length; i++) {\n var greenIcon;\n if (markers_6th_part_1st[i]['Location'] == \"M/MT/FL083A3\" || markers_6th_part_1st[i]['Location'] == \"M/MT/FL083A2\" || markers_6th_part_1st[i]['Location'] == \"M/MT/FL083A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_6th_part_1st[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_6th_part_1st[i][\"SV ID\"];\n x_val = markers_6th_part_1st[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n\n }\n\n\n //---------------------------------------------------------\n var markers_6th_part_2nd = given_data_sixth_part_2nd;\n for (var i = 0; i < markers_6th_part_2nd.length; i++) {\n var greenIcon;\n if (markers_6th_part_2nd[i]['Location'] == \"M/MT/FL084A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL085A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL086A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL087A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL088A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL089A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL090A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL091A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL092A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL093A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL093A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL094A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL095A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL096A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL097A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_6th_part_2nd[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_6th_part_2nd[i][\"SV ID\"];\n x_val = markers_6th_part_2nd[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n\n }\n //-------------------------------------------------------------------\n\n //given_data_sixth_part_4th_1\n var markers_6th_part_3rd = given_data_sixth_part_3rd;\n for (var i = 0; i < markers_6th_part_3rd.length; i++) {\n var greenIcon;\n if (markers_6th_part_3rd[i]['Location'] == \"M/MT/FL084A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_6th_part_3rd[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_6th_part_3rd[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_3rd[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 10);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_6th_part_3rd[i]['Location'] == \"M/MT/FL084A3\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_6th_part_3rd[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_6th_part_3rd[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_3rd[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 40);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n else if (markers_6th_part_3rd[i]['Location'] == \"M/MT/FL085A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_6th_part_3rd[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_6th_part_3rd[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_3rd[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 60);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_6th_part_3rd[i]['Location'] == \"M/MT/FL085A3\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_6th_part_3rd[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_6th_part_3rd[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_3rd[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 90);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n else {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_6th_part_3rd[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_6th_part_3rd[i][\"SV ID\"];\n x_val = markers_6th_part_3rd[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 97);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n\n\n\n\n }\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_4th_1 = given_data_sixth_part_4th_1;\n for (var i = 0; i < markers_6th_part_4th_1.length; i++) {\n var greenIcon;\n if (markers_6th_part_4th_1[i]['Location'] == \"M/MT/MD101A1\" || markers_6th_part_4th_1[i]['Location'] == \"M/MT/MD101A2\" || markers_6th_part_4th_1[i]['Location'] == \"M/MT/MD101A3\" || markers_6th_part_4th_1[i]['Location'] == \"M/MT/MD101A4\") {\n var loc = markers_6th_part_4th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_4th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_4th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n\n //-------------------------------filling 6th block 4_2----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_4th_2 = given_data_sixth_part_4th_2;\n for (var i = 0; i < markers_6th_part_4th_2.length; i++) {\n var greenIcon;\n if (markers_6th_part_4th_2[i]['Location'] == \"M/MT/MD101B1\" || markers_6th_part_4th_2[i]['Location'] == \"M/MT/MD101B2\" || markers_6th_part_4th_2[i]['Location'] == \"M/MT/MD101B3\" || markers_6th_part_4th_2[i]['Location'] == \"M/MT/MD101B4\") {\n var loc = markers_6th_part_4th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_4th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_4th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n\n //-------------------------------filling 6th block 4_3----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_4th_3 = given_data_sixth_part_4th_3;\n for (var i = 0; i < markers_6th_part_4th_3.length; i++) {\n var greenIcon;\n if (markers_6th_part_4th_3[i]['Location'] == \"M/MT/MD101C1\" || markers_6th_part_4th_3[i]['Location'] == \"M/MT/MD101C2\" || markers_6th_part_4th_3[i]['Location'] == \"M/MT/MD101C3\" || markers_6th_part_4th_3[i]['Location'] == \"M/MT/MD101C4\") {\n var loc = markers_6th_part_4th_3[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_4th_3[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_4th_3[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n\n\n //--------------------------------end 6th block-------------------------------------\n\n\n\n //-------------------------------filling 6th block 4_4----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_4th_4 = given_data_sixth_part_4th_4;\n for (var i = 0; i < markers_6th_part_4th_4.length; i++) {\n var greenIcon;\n if (markers_6th_part_4th_4[i]['Location'] == \"M/MT/MD101D1\" || markers_6th_part_4th_4[i]['Location'] == \"M/MT/MD101D2\" || markers_6th_part_4th_4[i]['Location'] == \"M/MT/MD101D3\" || markers_6th_part_4th_4[i]['Location'] == \"M/MT/MD101D4\") {\n var loc = markers_6th_part_4th_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_4th_4[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_4th_4[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n\n\n //--------------------------------end 6th block-------------------------------------\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_5th_1 = given_data_sixth_part_5th_1;\n for (var i = 0; i < markers_6th_part_5th_1.length; i++) {\n var greenIcon;\n if (markers_6th_part_5th_1[i]['Location'] == \"M/MT/MD102A1\" || markers_6th_part_5th_1[i]['Location'] == \"M/MT/MD102A2\" || markers_6th_part_5th_1[i]['Location'] == \"M/MT/MD102A3\" || markers_6th_part_5th_1[i]['Location'] == \"M/MT/MD102A4\") {\n var loc = markers_6th_part_5th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_5th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_5th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_5th_2 = given_data_sixth_part_5th_2;\n for (var i = 0; i < markers_6th_part_5th_2.length; i++) {\n var greenIcon;\n if (markers_6th_part_5th_2[i]['Location'] == \"M/MT/MD102B1\" || markers_6th_part_5th_2[i]['Location'] == \"M/MT/MD102B2\" || markers_6th_part_5th_2[i]['Location'] == \"M/MT/MD102B3\" || markers_6th_part_5th_2[i]['Location'] == \"M/MT/MD102B4\") {\n var loc = markers_6th_part_5th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_5th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_5th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_5th_3 = given_data_sixth_part_5th_3;\n for (var i = 0; i < markers_6th_part_5th_3.length; i++) {\n var greenIcon;\n if (markers_6th_part_5th_3[i]['Location'] == \"M/MT/MD102C1\" || markers_6th_part_5th_3[i]['Location'] == \"M/MT/MD102C2\" || markers_6th_part_5th_3[i]['Location'] == \"M/MT/MD102C3\" || markers_6th_part_5th_3[i]['Location'] == \"M/MT/MD102C4\") {\n var loc = markers_6th_part_5th_3[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_5th_3[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_5th_3[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_5th_4 = given_data_sixth_part_5th_4;\n for (var i = 0; i < markers_6th_part_5th_4.length; i++) {\n var greenIcon;\n if (markers_6th_part_5th_4[i]['Location'] == \"M/MT/MD102D1\" || markers_6th_part_5th_4[i]['Location'] == \"M/MT/MD102D2\" || markers_6th_part_5th_4[i]['Location'] == \"M/MT/MD102D3\" || markers_6th_part_5th_4[i]['Location'] == \"M/MT/MD102D4\") {\n var loc = markers_6th_part_5th_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_5th_4[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_5th_4[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_6th_1 = given_data_sixth_part_6th_1;\n for (var i = 0; i < markers_6th_part_6th_1.length; i++) {\n var greenIcon;\n if (markers_6th_part_6th_1[i]['Location'] == \"M/MT/MD103A1\" || markers_6th_part_6th_1[i]['Location'] == \"M/MT/MD103A2\" || markers_6th_part_6th_1[i]['Location'] == \"M/MT/MD103A3\" || markers_6th_part_6th_1[i]['Location'] == \"M/MT/MD103A4\") {\n var loc = markers_6th_part_6th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_6th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_6th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_6th_2 = given_data_sixth_part_6th_2;\n for (var i = 0; i < markers_6th_part_6th_2.length; i++) {\n var greenIcon;\n if (markers_6th_part_6th_2[i]['Location'] == \"M/MT/MD103B1\" || markers_6th_part_6th_2[i]['Location'] == \"M/MT/MD103B2\" || markers_6th_part_6th_2[i]['Location'] == \"M/MT/MD103B3\" || markers_6th_part_6th_2[i]['Location'] == \"M/MT/MD103B4\") {\n var loc = markers_6th_part_6th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_6th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_6th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_6th_3 = given_data_sixth_part_6th_3;\n for (var i = 0; i < markers_6th_part_6th_3.length; i++) {\n var greenIcon;\n if (markers_6th_part_6th_3[i]['Location'] == \"M/MT/MD103C1\" || markers_6th_part_6th_3[i]['Location'] == \"M/MT/MD103C2\" || markers_6th_part_6th_3[i]['Location'] == \"M/MT/MD103C3\" || markers_6th_part_6th_3[i]['Location'] == \"M/MT/MD103C4\") {\n var loc = markers_6th_part_6th_3[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_6th_3[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_6th_3[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_6th_4 = given_data_sixth_part_6th_4;\n for (var i = 0; i < markers_6th_part_6th_4.length; i++) {\n var greenIcon;\n if (markers_6th_part_6th_4[i]['Location'] == \"M/MT/MD103D1\" || markers_6th_part_6th_4[i]['Location'] == \"M/MT/MD103D2\" || markers_6th_part_6th_4[i]['Location'] == \"M/MT/MD103D3\" || markers_6th_part_6th_4[i]['Location'] == \"M/MT/MD103D4\") {\n var loc = markers_6th_part_6th_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_6th_4[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_6th_4[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_7th_1 = given_data_sixth_part_7th_1;\n for (var i = 0; i < markers_6th_part_7th_1.length; i++) {\n var greenIcon;\n if (markers_6th_part_7th_1[i]['Location'] == \"M/MT/MD104A1\" || markers_6th_part_7th_1[i]['Location'] == \"M/MT/MD104A2\" || markers_6th_part_7th_1[i]['Location'] == \"M/MT/MD104A3\" || markers_6th_part_7th_1[i]['Location'] == \"M/MT/MD104A4\") {\n var loc = markers_6th_part_7th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_7th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_7th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_7th_2 = given_data_sixth_part_7th_2;\n for (var i = 0; i < markers_6th_part_7th_2.length; i++) {\n var greenIcon;\n if (markers_6th_part_7th_2[i]['Location'] == \"M/MT/MD104B1\" || markers_6th_part_7th_2[i]['Location'] == \"M/MT/MD104B2\" || markers_6th_part_7th_2[i]['Location'] == \"M/MT/MD104B3\" || markers_6th_part_7th_2[i]['Location'] == \"M/MT/MD104B4\") {\n var loc = markers_6th_part_7th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_7th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_7th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_7th_3 = given_data_sixth_part_7th_3;\n for (var i = 0; i < markers_6th_part_7th_3.length; i++) {\n var greenIcon;\n if (markers_6th_part_7th_3[i]['Location'] == \"M/MT/MD104C1\" || markers_6th_part_7th_3[i]['Location'] == \"M/MT/MD104C2\" || markers_6th_part_7th_3[i]['Location'] == \"M/MT/MD104C3\" || markers_6th_part_7th_3[i]['Location'] == \"M/MT/MD104C4\") {\n var loc = markers_6th_part_7th_3[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_7th_3[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_7th_3[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_7th_4 = given_data_sixth_part_7th_4;\n for (var i = 0; i < markers_6th_part_6th_4.length; i++) {\n var greenIcon;\n if (markers_6th_part_7th_4[i]['Location'] == \"M/MT/MD104D1\" || markers_6th_part_7th_4[i]['Location'] == \"M/MT/MD104D2\" || markers_6th_part_7th_4[i]['Location'] == \"M/MT/MD104D3\" || markers_6th_part_7th_4[i]['Location'] == \"M/MT/MD104D4\") {\n var loc = markers_6th_part_7th_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_7th_4[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_7th_4[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n }\n\n // ----------------------required partloc name render here of 6th block\n var markers_6th_loc_data = given_loc_data_sixth_part;\n for (var i = 0; i < markers_6th_loc_data.length; i++) {\n var greenIcon;\n if (markers_6th_loc_data[i]['part_location'] == \"M/MT/MD101\" || markers_6th_loc_data[i]['part_location'] == \"M/MT/MD102\" || markers_6th_loc_data[i]['part_location'] == \"M/MT/MD103\" || markers_6th_loc_data[i]['part_location'] == \"M/MT/MD104\") {\n //var loc = markers_6th_part_7th_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [200, 20],\n\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" height=\"20\" width=\"200\" viewBox=\"0 0 200 20\"><text x=\"3\" y=\"10\" fill=\"black\" font-size=\"8\" font-weight=\"700\">' + markers_6th_loc_data[i]['part_location'] + '</text></svg>';\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">'+loc+'</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = \"location\"\n var new_marker = xy(markers_6th_loc_data[i]['x_val'], markers_6th_loc_data[i]['y_val']);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n }\n\n\n //------------------part loc 4th block here ---------------------\n // ----------------------required partloc name render here of 6th block\n var markers_4th_loc_data = given_loc_data_fourth_part;\n for (var i = 0; i < markers_4th_loc_data.length; i++) {\n var greenIcon;\n if (markers_4th_loc_data[i]['part_location'] == \"M/MT/MD105\" || markers_4th_loc_data[i]['part_location'] == \"M/MT/MD106\" || markers_4th_loc_data[i]['part_location'] == \"M/MT/MD107\" || markers_4th_loc_data[i]['part_location'] == \"M/MT/MD108\") {\n //var loc = markers_6th_part_7th_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [200, 20],\n\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" height=\"20\" width=\"200\" viewBox=\"0 0 200 20\"><text x=\"3\" y=\"10\" fill=\"black\" font-size=\"8\" font-weight=\"700\">' + markers_4th_loc_data[i]['part_location'] + '</text></svg>';\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">'+loc+'</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = \"location\"\n var new_marker = xy(markers_4th_loc_data[i]['x_val'], markers_4th_loc_data[i]['y_val']);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n }\n\n // ----------------------required partloc name render here of 6th block\n var markers_1st_loc_data = given_loc_data_first_part;\n for (var i = 0; i < markers_1st_loc_data.length; i++) {\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [200, 10] }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" height=\"10\" width=\"200\" viewBox=\"0 0 200 10\"><text x=\"3\" y=\"10\" fill=\"black\" font-size=\"6\" font-weight=\"600\">' + markers_1st_loc_data[i]['part_location'] + '</text></svg>';\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">'+loc+'</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = \"location\"\n var new_marker = xy(markers_1st_loc_data[i]['x_val'], markers_1st_loc_data[i]['y_val']);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n // ---------------------------------------------required partloc name render here of 6th block------------------\n var markers_7th_loc_data = given_loc_data_seventh_part;\n for (var i = 0; i < markers_7th_loc_data.length; i++) {\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [200, 10] }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" height=\"10\" width=\"200\" viewBox=\"0 0 200 10\"><text x=\"3\" y=\"10\" fill=\"black\" font-size=\"6\" font-weight=\"600\">' + markers_7th_loc_data[i]['part_location'] + '</text></svg>';\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">'+loc+'</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = \"location\"\n var new_marker = xy(markers_7th_loc_data[i]['x_val'], markers_7th_loc_data[i]['y_val']);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n // ---------------------------------partloc render end here of 6th block\n //--------------------------------end 6th block--------------------------------------\n\n //-----------------------------------------filling 3rd block m/mt/md105-----------------------------------------\n var markers_3rd_part_1st_1 = given_data_third_part_1st_1;\n\n for (var i = 0; i < markers_3rd_part_1st_1.length; i++) {\n if (markers_3rd_part_1st_1[i]['Location'] == \"M/MT/MD105D1\" || markers_3rd_part_1st_1[i]['Location'] == \"M/MT/MD105D2\" || markers_3rd_part_1st_1[i]['Location'] == \"M/MT/MD105D3\" || markers_3rd_part_1st_1[i]['Location'] == \"M/MT/MD105D4\") {\n var loc = markers_3rd_part_1st_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_1st_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_1st_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_3rd_part_1st_2 = given_data_third_part_1st_2;\n\n for (var i = 0; i < markers_3rd_part_1st_2.length; i++) {\n if (markers_3rd_part_1st_2[i]['Location'] == \"M/MT/MD105C1\" || markers_3rd_part_1st_2[i]['Location'] == \"M/MT/MD105C2\" || markers_3rd_part_1st_2[i]['Location'] == \"M/MT/MD105C3\" || markers_3rd_part_1st_2[i]['Location'] == \"M/MT/MD105C4\") {\n var loc = markers_3rd_part_1st_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_1st_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_1st_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n\n\n var markers_3rd_part_1st_3 = given_data_third_part_1st_3;\n for (var i = 0; i < markers_3rd_part_1st_3.length; i++) {\n var greenIcon;\n if (markers_3rd_part_1st_3[i]['Location'] == \"M/MT/MD105B1\" || markers_3rd_part_1st_3[i]['Location'] == \"M/MT/MD105B2\" || markers_3rd_part_1st_3[i]['Location'] == \"M/MT/MD105B3\" || markers_3rd_part_1st_3[i]['Location'] == \"M/MT/MD105B4\") {\n var loc = markers_3rd_part_1st_3[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_1st_3[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_1st_3[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n var markers_3rd_part_1st_4 = given_data_third_part_1st_4;\n for (var i = 0; i < markers_3rd_part_1st_4.length; i++) {\n var greenIcon;\n if (markers_3rd_part_1st_4[i]['Location'] == \"M/MT/MD105A1\" || markers_3rd_part_1st_4[i]['Location'] == \"M/MT/MD105A2\" || markers_3rd_part_1st_4[i]['Location'] == \"M/MT/MD105A3\" || markers_3rd_part_1st_4[i]['Location'] == \"M/MT/MD105A4\") {\n var loc = markers_3rd_part_1st_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_1st_4[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_1st_4[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n }\n //-----------------------------------------end m/mt/md105--------------------------------------------------------------\n\n\n //-----------------------------------------filling 3rd block m/mt/md106-----------------------------------------\n var markers_3rd_part_2nd_1 = given_data_third_part_2nd_1;\n\n for (var i = 0; i < markers_3rd_part_2nd_1.length; i++) {\n if (markers_3rd_part_2nd_1[i]['Location'] == \"M/MT/MD106D1\" || markers_3rd_part_2nd_1[i]['Location'] == \"M/MT/MD106D2\" || markers_3rd_part_2nd_1[i]['Location'] == \"M/MT/MD106D3\" || markers_3rd_part_2nd_1[i]['Location'] == \"M/MT/MD106D4\") {\n var loc = markers_3rd_part_2nd_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_2nd_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_2nd_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_3rd_part_2nd_2 = given_data_third_part_2nd_2;\n\n for (var i = 0; i < markers_3rd_part_2nd_2.length; i++) {\n if (markers_3rd_part_2nd_2[i]['Location'] == \"M/MT/MD106C1\" || markers_3rd_part_2nd_2[i]['Location'] == \"M/MT/MD106C2\" || markers_3rd_part_2nd_2[i]['Location'] == \"M/MT/MD106C3\" || markers_3rd_part_2nd_2[i]['Location'] == \"M/MT/MD106C4\") {\n var loc = markers_3rd_part_2nd_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_2nd_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_2nd_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n\n\n var markers_3rd_part_2nd_3 = given_data_third_part_2nd_3;\n for (var i = 0; i < markers_3rd_part_2nd_3.length; i++) {\n var greenIcon;\n if (markers_3rd_part_2nd_3[i]['Location'] == \"M/MT/MD106B1\" || markers_3rd_part_2nd_3[i]['Location'] == \"M/MT/MD106B2\" || markers_3rd_part_2nd_3[i]['Location'] == \"M/MT/MD106B3\" || markers_3rd_part_2nd_3[i]['Location'] == \"M/MT/MD106B4\") {\n var loc = markers_3rd_part_2nd_3[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_2nd_3[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_2nd_3[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n var markers_3rd_part_2nd_4 = given_data_third_part_2nd_4;\n for (var i = 0; i < markers_3rd_part_2nd_4.length; i++) {\n var greenIcon;\n if (markers_3rd_part_2nd_4[i]['Location'] == \"M/MT/MD106A1\" || markers_3rd_part_2nd_4[i]['Location'] == \"M/MT/MD106A2\" || markers_3rd_part_2nd_4[i]['Location'] == \"M/MT/MD106A3\" || markers_3rd_part_2nd_4[i]['Location'] == \"M/MT/MD106A4\") {\n var loc = markers_3rd_part_2nd_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_2nd_4[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_2nd_4[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n }\n\n\n\n //-----------------------------------------end m/mt/md106--------------------------------------------------------------\n\n\n //-----------------------------------------filling 3rd block m/mt/md107-----------------------------------------\n var markers_3rd_part_3rd_1 = given_data_third_part_3rd_1;\n\n for (var i = 0; i < markers_3rd_part_3rd_1.length; i++) {\n if (markers_3rd_part_3rd_1[i]['Location'] == \"M/MT/MD107D1\" || markers_3rd_part_3rd_1[i]['Location'] == \"M/MT/MD107D2\" || markers_3rd_part_3rd_1[i]['Location'] == \"M/MT/MD107D3\" || markers_3rd_part_3rd_1[i]['Location'] == \"M/MT/MD107D4\") {\n var loc = markers_3rd_part_3rd_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_3rd_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_3rd_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_3rd_part_3rd_2 = given_data_third_part_3rd_2;\n\n for (var i = 0; i < markers_3rd_part_3rd_2.length; i++) {\n if (markers_3rd_part_3rd_2[i]['Location'] == \"M/MT/MD107C1\" || markers_3rd_part_3rd_2[i]['Location'] == \"M/MT/MD107C2\" || markers_3rd_part_3rd_2[i]['Location'] == \"M/MT/MD107C3\" || markers_3rd_part_3rd_2[i]['Location'] == \"M/MT/MD107C4\") {\n var loc = markers_3rd_part_3rd_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_3rd_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_3rd_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n\n\n var markers_3rd_part_3rd_3 = given_data_third_part_3rd_3;\n for (var i = 0; i < markers_3rd_part_3rd_3.length; i++) {\n if (markers_3rd_part_3rd_3[i]['Location'] == \"M/MT/MD107B1\" || markers_3rd_part_3rd_3[i]['Location'] == \"M/MT/MD107B2\" || markers_3rd_part_3rd_3[i]['Location'] == \"M/MT/MD107B3\" || markers_3rd_part_3rd_3[i]['Location'] == \"M/MT/MD107B4\") {\n var loc = markers_3rd_part_3rd_3[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_3rd_3[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_3rd_3[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n var markers_3rd_part_3rd_4 = given_data_third_part_3rd_4;\n for (var i = 0; i < markers_3rd_part_3rd_4.length; i++) {\n if (markers_3rd_part_3rd_4[i]['Location'] == \"M/MT/MD107A1\" || markers_3rd_part_3rd_4[i]['Location'] == \"M/MT/MD107A2\" || markers_3rd_part_3rd_4[i]['Location'] == \"M/MT/MD107A3\" || markers_3rd_part_3rd_4[i]['Location'] == \"M/MT/MD107A4\") {\n var loc = markers_3rd_part_3rd_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_3rd_4[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_3rd_4[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n }\n\n\n\n //-----------------------------------------end m/mt/md107--------------------------------------------------------------\n\n\n //-----------------------------------------filling 3rd block m/mt/md108-----------------------------------------\n var markers_3rd_part_4th_1 = given_data_third_part_4th_1;\n\n\n for (var i = 0; i < markers_3rd_part_4th_1.length; i++) {\n if (markers_3rd_part_4th_1[i]['Location'] == \"M/MT/MD108D1\" || markers_3rd_part_4th_1[i]['Location'] == \"M/MT/MD108D2\" || markers_3rd_part_4th_1[i]['Location'] == \"M/MT/MD108D3\" || markers_3rd_part_4th_1[i]['Location'] == \"M/MT/MD108D4\") {\n var loc = markers_3rd_part_4th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_4th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_4th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_3rd_part_4th_2 = given_data_third_part_4th_2;\n\n for (var i = 0; i < markers_3rd_part_4th_2.length; i++) {\n if (markers_3rd_part_4th_2[i]['Location'] == \"M/MT/MD108C1\" || markers_3rd_part_4th_2[i]['Location'] == \"M/MT/MD108C2\" || markers_3rd_part_4th_2[i]['Location'] == \"M/MT/MD108C3\" || markers_3rd_part_4th_2[i]['Location'] == \"M/MT/MD108C4\") {\n var loc = markers_3rd_part_4th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_4th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_4th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n\n\n var markers_3rd_part_4th_3 = given_data_third_part_4th_3;\n for (var i = 0; i < markers_3rd_part_4th_3.length; i++) {\n if (markers_3rd_part_4th_3[i]['Location'] == \"M/MT/MD108B1\" || markers_3rd_part_4th_3[i]['Location'] == \"M/MT/MD108B2\" || markers_3rd_part_4th_3[i]['Location'] == \"M/MT/MD108B3\" || markers_3rd_part_4th_3[i]['Location'] == \"M/MT/MD108B4\") {\n var loc = markers_3rd_part_4th_3[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_4th_3[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_4th_3[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n var markers_3rd_part_4th_4 = given_data_third_part_4th_4;\n for (var i = 0; i < markers_3rd_part_4th_4.length; i++) {\n if (markers_3rd_part_4th_4[i]['Location'] == \"M/MT/MD108A1\" || markers_3rd_part_4th_4[i]['Location'] == \"M/MT/MD108A2\" || markers_3rd_part_4th_4[i]['Location'] == \"M/MT/MD108A3\" || markers_3rd_part_4th_4[i]['Location'] == \"M/MT/MD108A4\") {\n var loc = markers_3rd_part_4th_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_4th_4[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_4th_4[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n }\n\n\n\n //-----------------------------------------end m/mt/md107--------------------------------------------------------------\n\n\n //given_data_first_part_1st_1\n //-------------------------------------------filling 1st block--------------------------------------------------\n var markers_1st_part_1st_1 = given_data_first_part_1st_1;\n\n\n for (var i = 0; i < markers_1st_part_1st_1.length; i++) {\n if (markers_1st_part_1st_1[i]['Location'] == \"M/MT/FR064D2\" || markers_1st_part_1st_1[i]['Location'] == \"M/MT/FR064C2\" || markers_1st_part_1st_1[i]['Location'] == \"M/MT/FR064B2\" || markers_1st_part_1st_1[i]['Location'] == \"M/MT/FR064A2\") {\n var loc = markers_1st_part_1st_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_1st_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_1st_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_1st_2 = given_data_first_part_1st_2;\n\n\n for (var i = 0; i < markers_1st_part_1st_2.length; i++) {\n if (markers_1st_part_1st_2[i]['Location'] == \"M/MT/FR064D1\" || markers_1st_part_1st_2[i]['Location'] == \"M/MT/FR064C1\" || markers_1st_part_1st_2[i]['Location'] == \"M/MT/FR064B1\" || markers_1st_part_1st_2[i]['Location'] == \"M/MT/FR064A1\") {\n var loc = markers_1st_part_1st_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n }\n });\n x_val = markers_1st_part_1st_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_1st_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //---------------------------------------------1st part 2nd block------------------------------------------\n var markers_1st_part_2nd_1 = given_data_first_part_2nd_1;\n for (var i = 0; i < markers_1st_part_2nd_1.length; i++) {\n if (markers_1st_part_2nd_1[i]['Location'] == \"M/MT/FR063D2\" || markers_1st_part_2nd_1[i]['Location'] == \"M/MT/FR063C2\" || markers_1st_part_2nd_1[i]['Location'] == \"M/MT/FR063B2\" || markers_1st_part_2nd_1[i]['Location'] == \"M/MT/FR063A2\") {\n var loc = markers_1st_part_2nd_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_2nd_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_2nd_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_2nd_2 = given_data_first_part_2nd_2;\n\n\n for (var i = 0; i < markers_1st_part_2nd_2.length; i++) {\n if (markers_1st_part_2nd_2[i]['Location'] == \"M/MT/FR063D1\" || markers_1st_part_2nd_2[i]['Location'] == \"M/MT/FR063C1\" || markers_1st_part_2nd_2[i]['Location'] == \"M/MT/FR063B1\" || markers_1st_part_2nd_2[i]['Location'] == \"M/MT/FR063A1\") {\n var loc = markers_1st_part_2nd_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_2nd_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_2nd_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n //----------------------------------3rd part of first block----------------------------------------------\n var markers_1st_part_3rd_1 = given_data_first_part_3rd_1;\n for (var i = 0; i < markers_1st_part_3rd_1.length; i++) {\n if (markers_1st_part_3rd_1[i]['Location'] == \"M/MT/FR062D2\" || markers_1st_part_3rd_1[i]['Location'] == \"M/MT/FR062C2\" || markers_1st_part_3rd_1[i]['Location'] == \"M/MT/FR062B2\" || markers_1st_part_3rd_1[i]['Location'] == \"M/MT/FR062A2\") {\n var loc = markers_1st_part_3rd_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_3rd_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_3rd_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_3rd_2 = given_data_first_part_3rd_2;\n\n\n for (var i = 0; i < markers_1st_part_3rd_2.length; i++) {\n if (markers_1st_part_3rd_2[i]['Location'] == \"M/MT/FR062D1\" || markers_1st_part_3rd_2[i]['Location'] == \"M/MT/FR062C1\" || markers_1st_part_3rd_2[i]['Location'] == \"M/MT/FR062B1\" || markers_1st_part_3rd_2[i]['Location'] == \"M/MT/FR062A1\") {\n var loc = markers_1st_part_3rd_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_3rd_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_3rd_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n //----------------------------------4th part of first block----------------------------------------------\n var markers_1st_part_4th_1 = given_data_first_part_4th_1;\n\n //console.log(\"check sonath\");\n //console.log(markers_1st_part_4th_1);\n for (var i = 0; i < markers_1st_part_4th_1.length; i++) {\n\n\n if (markers_1st_part_4th_1[i]['Location'] == \"M/MT/FR061D2\" || markers_1st_part_4th_1[i]['Location'] == \"M/MT/FR061C2\" || markers_1st_part_4th_1[i]['Location'] == \"M/MT/FR061B2\" || markers_1st_part_4th_1[i]['Location'] == \"M/MT/FR061A2\") {\n var loc = markers_1st_part_4th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_4th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_4th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n }\n }\n\n\n var markers_1st_part_4th_2 = given_data_first_part_4th_2;\n\n\n for (var i = 0; i < markers_1st_part_4th_2.length; i++) {\n if (markers_1st_part_4th_2[i]['Location'] == \"M/MT/FR061D1\" || markers_1st_part_4th_2[i]['Location'] == \"M/MT/FR061C1\" || markers_1st_part_4th_2[i]['Location'] == \"M/MT/FR061B1\" || markers_1st_part_4th_2[i]['Location'] == \"M/MT/FR061A1\") {\n var loc = markers_1st_part_4th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_4th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_4th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n\n //----------------------------------5th part of first block----------------------------------------------\n var markers_1st_part_5th_1 = given_data_first_part_5th_1;\n for (var i = 0; i < markers_1st_part_5th_1.length; i++) {\n if (markers_1st_part_5th_1[i]['Location'] == \"M/MT/FR060D2\" || markers_1st_part_5th_1[i]['Location'] == \"M/MT/FR060C2\" || markers_1st_part_5th_1[i]['Location'] == \"M/MT/FR060B2\" || markers_1st_part_5th_1[i]['Location'] == \"M/MT/FR060A2\") {\n var loc = markers_1st_part_5th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_5th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_5th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_5th_2 = given_data_first_part_5th_2;\n\n\n for (var i = 0; i < markers_1st_part_5th_2.length; i++) {\n if (markers_1st_part_5th_2[i]['Location'] == \"M/MT/FR060D1\" || markers_1st_part_5th_2[i]['Location'] == \"M/MT/FR060C1\" || markers_1st_part_5th_2[i]['Location'] == \"M/MT/FR060B1\" || markers_1st_part_5th_2[i]['Location'] == \"M/MT/FR060A1\") {\n var loc = markers_1st_part_5th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_5th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_5th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------6th part of first block----------------------------------------------\n var markers_1st_part_6th_1 = given_data_first_part_6th_1;\n for (var i = 0; i < markers_1st_part_6th_1.length; i++) {\n if (markers_1st_part_6th_1[i]['Location'] == \"M/MT/FR059D2\" || markers_1st_part_6th_1[i]['Location'] == \"M/MT/FR059C2\" || markers_1st_part_6th_1[i]['Location'] == \"M/MT/FR059B2\" || markers_1st_part_6th_1[i]['Location'] == \"M/MT/FR059A2\") {\n var loc = markers_1st_part_6th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_6th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_6th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_6th_2 = given_data_first_part_6th_2;\n\n\n for (var i = 0; i < markers_1st_part_6th_2.length; i++) {\n if (markers_1st_part_6th_2[i]['Location'] == \"M/MT/FR059D1\" || markers_1st_part_6th_2[i]['Location'] == \"M/MT/FR059C1\" || markers_1st_part_6th_2[i]['Location'] == \"M/MT/FR059B1\" || markers_1st_part_6th_2[i]['Location'] == \"M/MT/FR059A1\") {\n var loc = markers_1st_part_6th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_6th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_6th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------7th part of first block----------------------------------------------\n var markers_1st_part_7th_1 = given_data_first_part_7th_1;\n for (var i = 0; i < markers_1st_part_7th_1.length; i++) {\n if (markers_1st_part_7th_1[i]['Location'] == \"M/MT/FR058D2\" || markers_1st_part_7th_1[i]['Location'] == \"M/MT/FR058C2\" || markers_1st_part_7th_1[i]['Location'] == \"M/MT/FR058B2\" || markers_1st_part_7th_1[i]['Location'] == \"M/MT/FR058A2\") {\n var loc = markers_1st_part_7th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_7th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_7th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_7th_2 = given_data_first_part_7th_2;\n\n\n for (var i = 0; i < markers_1st_part_7th_2.length; i++) {\n if (markers_1st_part_7th_2[i]['Location'] == \"M/MT/FR058D1\" || markers_1st_part_7th_2[i]['Location'] == \"M/MT/FR058C1\" || markers_1st_part_7th_2[i]['Location'] == \"M/MT/FR058B1\" || markers_1st_part_7th_2[i]['Location'] == \"M/MT/FR058A1\") {\n var loc = markers_1st_part_7th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_7th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_7th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------8th part of first block----------------------------------------------\n var markers_1st_part_8th_1 = given_data_first_part_8th_1;\n for (var i = 0; i < markers_1st_part_8th_1.length; i++) {\n if (markers_1st_part_8th_1[i]['Location'] == \"M/MT/FR057D2\" || markers_1st_part_8th_1[i]['Location'] == \"M/MT/FR057C2\" || markers_1st_part_8th_1[i]['Location'] == \"M/MT/FR057B2\" || markers_1st_part_8th_1[i]['Location'] == \"M/MT/FR057A2\") {\n var loc = markers_1st_part_8th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_8th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_8th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_8th_2 = given_data_first_part_8th_2;\n for (var i = 0; i < markers_1st_part_8th_2.length; i++) {\n if (markers_1st_part_8th_2[i]['Location'] == \"M/MT/FR057D1\" || markers_1st_part_8th_2[i]['Location'] == \"M/MT/FR057C1\" || markers_1st_part_8th_2[i]['Location'] == \"M/MT/FR057B1\" || markers_1st_part_8th_2[i]['Location'] == \"M/MT/FR057A1\") {\n var loc = markers_1st_part_8th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_8th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_8th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------9th part of first block----------------------------------------------\n var markers_1st_part_9th_1 = given_data_first_part_9th_1;\n for (var i = 0; i < markers_1st_part_9th_1.length; i++) {\n if (markers_1st_part_9th_1[i]['Location'] == \"M/MT/FR056D2\" || markers_1st_part_9th_1[i]['Location'] == \"M/MT/FR056C2\" || markers_1st_part_9th_1[i]['Location'] == \"M/MT/FR056B2\" || markers_1st_part_9th_1[i]['Location'] == \"M/MT/FR056A2\") {\n var loc = markers_1st_part_9th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_9th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_9th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_9th_2 = given_data_first_part_9th_2;\n for (var i = 0; i < markers_1st_part_9th_2.length; i++) {\n if (markers_1st_part_9th_2[i]['Location'] == \"M/MT/FR056D1\" || markers_1st_part_9th_2[i]['Location'] == \"M/MT/FR056C1\" || markers_1st_part_9th_2[i]['Location'] == \"M/MT/FR056B1\" || markers_1st_part_9th_2[i]['Location'] == \"M/MT/FR056A1\") {\n var loc = markers_1st_part_9th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_9th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_9th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------10th part of first block----------------------------------------------\n var markers_1st_part_10th_1 = given_data_first_part_10th_1;\n for (var i = 0; i < markers_1st_part_10th_1.length; i++) {\n if (markers_1st_part_10th_1[i]['Location'] == \"M/MT/FR055D2\" || markers_1st_part_10th_1[i]['Location'] == \"M/MT/FR055C2\" || markers_1st_part_10th_1[i]['Location'] == \"M/MT/FR055B2\" || markers_1st_part_10th_1[i]['Location'] == \"M/MT/FR055A2\") {\n var loc = markers_1st_part_10th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_10th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_10th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_10th_2 = given_data_first_part_10th_2;\n for (var i = 0; i < markers_1st_part_10th_2.length; i++) {\n if (markers_1st_part_10th_2[i]['Location'] == \"M/MT/FR055D1\" || markers_1st_part_10th_2[i]['Location'] == \"M/MT/FR055C1\" || markers_1st_part_10th_2[i]['Location'] == \"M/MT/FR055B1\" || markers_1st_part_10th_2[i]['Location'] == \"M/MT/FR055A1\") {\n var loc = markers_1st_part_10th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_10th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_10th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------11th part of first block----------------------------------------------\n var markers_1st_part_11th_1 = given_data_first_part_11th_1;\n for (var i = 0; i < markers_1st_part_11th_1.length; i++) {\n if (markers_1st_part_11th_1[i]['Location'] == \"M/MT/FR054D2\" || markers_1st_part_11th_1[i]['Location'] == \"M/MT/FR054C2\" || markers_1st_part_11th_1[i]['Location'] == \"M/MT/FR054B2\" || markers_1st_part_11th_1[i]['Location'] == \"M/MT/FR054A2\") {\n var loc = markers_1st_part_11th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_11th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_11th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_11th_2 = given_data_first_part_11th_2;\n for (var i = 0; i < markers_1st_part_11th_2.length; i++) {\n if (markers_1st_part_11th_2[i]['Location'] == \"M/MT/FR054D1\" || markers_1st_part_11th_2[i]['Location'] == \"M/MT/FR054C1\" || markers_1st_part_11th_2[i]['Location'] == \"M/MT/FR054B1\" || markers_1st_part_11th_2[i]['Location'] == \"M/MT/FR054A1\") {\n var loc = markers_1st_part_11th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_11th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_11th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------12th part of first block----------------------------------------------\n var markers_1st_part_12th_1 = given_data_first_part_12th_1;\n for (var i = 0; i < markers_1st_part_12th_1.length; i++) {\n if (markers_1st_part_12th_1[i]['Location'] == \"M/MT/FR053D2\" || markers_1st_part_12th_1[i]['Location'] == \"M/MT/FR053C2\" || markers_1st_part_12th_1[i]['Location'] == \"M/MT/FR053B2\" || markers_1st_part_12th_1[i]['Location'] == \"M/MT/FR053A2\") {\n var loc = markers_1st_part_12th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_12th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_12th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_12th_2 = given_data_first_part_12th_2;\n for (var i = 0; i < markers_1st_part_12th_2.length; i++) {\n if (markers_1st_part_12th_2[i]['Location'] == \"M/MT/FR053D1\" || markers_1st_part_12th_2[i]['Location'] == \"M/MT/FR053C1\" || markers_1st_part_12th_2[i]['Location'] == \"M/MT/FR053B1\" || markers_1st_part_12th_2[i]['Location'] == \"M/MT/FR053A1\") {\n var loc = markers_1st_part_12th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_12th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_12th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n\n //----------------------------------13th part of first block----------------------------------------------\n var markers_1st_part_13th_1 = given_data_first_part_13th_1;\n for (var i = 0; i < markers_1st_part_13th_1.length; i++) {\n if (markers_1st_part_13th_1[i]['Location'] == \"M/MT/FR052D2\" || markers_1st_part_13th_1[i]['Location'] == \"M/MT/FR052C2\" || markers_1st_part_13th_1[i]['Location'] == \"M/MT/FR052B2\" || markers_1st_part_13th_1[i]['Location'] == \"M/MT/FR052A2\") {\n var loc = markers_1st_part_13th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_13th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_13th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_13th_2 = given_data_first_part_13th_2;\n for (var i = 0; i < markers_1st_part_13th_2.length; i++) {\n if (markers_1st_part_13th_2[i]['Location'] == \"M/MT/FR052D1\" || markers_1st_part_13th_2[i]['Location'] == \"M/MT/FR052C1\" || markers_1st_part_13th_2[i]['Location'] == \"M/MT/FR052B1\" || markers_1st_part_13th_2[i]['Location'] == \"M/MT/FR052A1\") {\n var loc = markers_1st_part_13th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_13th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_13th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------14th part of first block----------------------------------------------\n var markers_1st_part_14th_1 = given_data_first_part_14th_1;\n for (var i = 0; i < markers_1st_part_14th_1.length; i++) {\n if (markers_1st_part_14th_1[i]['Location'] == \"M/MT/FR051D2\" || markers_1st_part_14th_1[i]['Location'] == \"M/MT/FR051C2\" || markers_1st_part_14th_1[i]['Location'] == \"M/MT/FR051B2\" || markers_1st_part_14th_1[i]['Location'] == \"M/MT/FR051A2\") {\n var loc = markers_1st_part_14th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_14th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_14th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_14th_2 = given_data_first_part_14th_2;\n for (var i = 0; i < markers_1st_part_14th_2.length; i++) {\n if (markers_1st_part_14th_2[i]['Location'] == \"M/MT/FR051D1\" || markers_1st_part_14th_2[i]['Location'] == \"M/MT/FR051C1\" || markers_1st_part_14th_2[i]['Location'] == \"M/MT/FR051B1\" || markers_1st_part_14th_2[i]['Location'] == \"M/MT/FR051A1\") {\n var loc = markers_1st_part_14th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_14th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_14th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------15th part of first block----------------------------------------------\n var markers_1st_part_15th_1 = given_data_first_part_15th_1;\n\n for (var i = 0; i < markers_1st_part_15th_1.length; i++) {\n if (markers_1st_part_15th_1[i]['Location'] == \"M/MT/FR050D2\" || markers_1st_part_15th_1[i]['Location'] == \"M/MT/FR050C2\" || markers_1st_part_15th_1[i]['Location'] == \"M/MT/FR050B2\" || markers_1st_part_15th_1[i]['Location'] == \"M/MT/FR050A2\") {\n var loc = markers_1st_part_15th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_15th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_15th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_15th_2 = given_data_first_part_15th_2;\n for (var i = 0; i < markers_1st_part_15th_2.length; i++) {\n if (markers_1st_part_15th_2[i]['Location'] == \"M/MT/FR050D1\" || markers_1st_part_15th_2[i]['Location'] == \"M/MT/FR050C1\" || markers_1st_part_15th_2[i]['Location'] == \"M/MT/FR050B1\" || markers_1st_part_15th_2[i]['Location'] == \"M/MT/FR050A1\") {\n var loc = markers_1st_part_15th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_15th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_15th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------16th part of first block----------------------------------------------\n var markers_1st_part_16th_1 = given_data_first_part_16th_1;\n\n for (var i = 0; i < markers_1st_part_16th_1.length; i++) {\n if (markers_1st_part_16th_1[i]['Location'] == \"M/MT/FR049D2\" || markers_1st_part_16th_1[i]['Location'] == \"M/MT/FR049C2\" || markers_1st_part_16th_1[i]['Location'] == \"M/MT/FR049B2\" || markers_1st_part_16th_1[i]['Location'] == \"M/MT/FR049A2\") {\n var loc = markers_1st_part_16th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_16th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_16th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_16th_2 = given_data_first_part_16th_2;\n for (var i = 0; i < markers_1st_part_16th_2.length; i++) {\n if (markers_1st_part_16th_2[i]['Location'] == \"M/MT/FR049D1\" || markers_1st_part_16th_2[i]['Location'] == \"M/MT/FR049C1\" || markers_1st_part_16th_2[i]['Location'] == \"M/MT/FR049B1\" || markers_1st_part_16th_2[i]['Location'] == \"M/MT/FR049A1\") {\n var loc = markers_1st_part_16th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_16th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_16th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------17th part of first block----------------------------------------------\n var markers_1st_part_17th_1 = given_data_first_part_17th_1;\n\n for (var i = 0; i < markers_1st_part_17th_1.length; i++) {\n if (markers_1st_part_17th_1[i]['Location'] == \"M/MT/FR048D2\" || markers_1st_part_17th_1[i]['Location'] == \"M/MT/FR048C2\" || markers_1st_part_17th_1[i]['Location'] == \"M/MT/FR048B2\" || markers_1st_part_17th_1[i]['Location'] == \"M/MT/FR048A2\") {\n var loc = markers_1st_part_17th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_17th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_17th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_17th_2 = given_data_first_part_17th_2;\n for (var i = 0; i < markers_1st_part_17th_2.length; i++) {\n if (markers_1st_part_17th_2[i]['Location'] == \"M/MT/FR048D1\" || markers_1st_part_17th_2[i]['Location'] == \"M/MT/FR048C1\" || markers_1st_part_17th_2[i]['Location'] == \"M/MT/FR048B1\" || markers_1st_part_17th_2[i]['Location'] == \"M/MT/FR048A1\") {\n var loc = markers_1st_part_17th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_17th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_17th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------18th part of first block----------------------------------------------\n var markers_1st_part_18th_1 = given_data_first_part_18th_1;\n\n for (var i = 0; i < markers_1st_part_18th_1.length; i++) {\n if (markers_1st_part_18th_1[i]['Location'] == \"M/MT/FR047D2\" || markers_1st_part_18th_1[i]['Location'] == \"M/MT/FR047C2\" || markers_1st_part_18th_1[i]['Location'] == \"M/MT/FR047B2\" || markers_1st_part_18th_1[i]['Location'] == \"M/MT/FR047A2\") {\n var loc = markers_1st_part_18th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_18th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_18th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_18th_2 = given_data_first_part_18th_2;\n for (var i = 0; i < markers_1st_part_18th_2.length; i++) {\n if (markers_1st_part_18th_2[i]['Location'] == \"M/MT/FR047D1\" || markers_1st_part_18th_2[i]['Location'] == \"M/MT/FR047C1\" || markers_1st_part_18th_2[i]['Location'] == \"M/MT/FR047B1\" || markers_1st_part_18th_2[i]['Location'] == \"M/MT/FR047A1\") {\n var loc = markers_1st_part_18th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_18th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_18th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------19th part of first block----------------------------------------------\n var markers_1st_part_19th_1 = given_data_first_part_19th_1;\n\n for (var i = 0; i < markers_1st_part_19th_1.length; i++) {\n if (markers_1st_part_19th_1[i]['Location'] == \"M/MT/FR046D2\" || markers_1st_part_19th_1[i]['Location'] == \"M/MT/FR046C2\" || markers_1st_part_19th_1[i]['Location'] == \"M/MT/FR046B2\" || markers_1st_part_19th_1[i]['Location'] == \"M/MT/FR046A2\") {\n var loc = markers_1st_part_19th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_19th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_19th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_19th_2 = given_data_first_part_19th_2;\n for (var i = 0; i < markers_1st_part_19th_2.length; i++) {\n if (markers_1st_part_19th_2[i]['Location'] == \"M/MT/FR046D1\" || markers_1st_part_19th_2[i]['Location'] == \"M/MT/FR046C1\" || markers_1st_part_19th_2[i]['Location'] == \"M/MT/FR046B1\" || markers_1st_part_19th_2[i]['Location'] == \"M/MT/FR046A1\") {\n var loc = markers_1st_part_19th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_19th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_19th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------20th part of first block----------------------------------------------\n var markers_1st_part_20th_1 = given_data_first_part_20th_1;\n\n for (var i = 0; i < markers_1st_part_20th_1.length; i++) {\n if (markers_1st_part_20th_1[i]['Location'] == \"M/MT/FR045D2\" || markers_1st_part_20th_1[i]['Location'] == \"M/MT/FR045C2\" || markers_1st_part_20th_1[i]['Location'] == \"M/MT/FR045B2\" || markers_1st_part_20th_1[i]['Location'] == \"M/MT/FR045A2\") {\n var loc = markers_1st_part_20th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_20th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_20th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_20th_2 = given_data_first_part_20th_2;\n for (var i = 0; i < markers_1st_part_20th_2.length; i++) {\n\n if (markers_1st_part_20th_2[i]['Location'] == \"M/MT/FR045D1\" || markers_1st_part_20th_2[i]['Location'] == \"M/MT/FR045C1\" || markers_1st_part_20th_2[i]['Location'] == \"M/MT/FR045B1\" || markers_1st_part_20th_2[i]['Location'] == \"M/MT/FR045A1\") {\n var loc = markers_1st_part_20th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_20th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_20th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------21th part of first block----------------------------------------------\n var markers_1st_part_21th_1 = given_data_first_part_21th_1;\n\n for (var i = 0; i < markers_1st_part_21th_1.length; i++) {\n if (markers_1st_part_21th_1[i]['Location'] == \"M/MT/FR044D2\" || markers_1st_part_21th_1[i]['Location'] == \"M/MT/FR044C2\" || markers_1st_part_21th_1[i]['Location'] == \"M/MT/FR044B2\" || markers_1st_part_21th_1[i]['Location'] == \"M/MT/FR044A2\") {\n var loc = markers_1st_part_21th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_21th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_21th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_21th_2 = given_data_first_part_21th_2;\n for (var i = 0; i < markers_1st_part_21th_2.length; i++) {\n\n if (markers_1st_part_21th_2[i]['Location'] == \"M/MT/FR044D1\" || markers_1st_part_21th_2[i]['Location'] == \"M/MT/FR044C1\" || markers_1st_part_21th_2[i]['Location'] == \"M/MT/FR044B1\" || markers_1st_part_21th_2[i]['Location'] == \"M/MT/FR044A1\") {\n var loc = markers_1st_part_21th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_21th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_21th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------22th part of first block----------------------------------------------\n var markers_1st_part_22th_1 = given_data_first_part_22th_1;\n\n for (var i = 0; i < markers_1st_part_22th_1.length; i++) {\n if (markers_1st_part_22th_1[i]['Location'] == \"M/MT/FR043D2\" || markers_1st_part_22th_1[i]['Location'] == \"M/MT/FR043C2\" || markers_1st_part_22th_1[i]['Location'] == \"M/MT/FR043B2\" || markers_1st_part_22th_1[i]['Location'] == \"M/MT/FR043A2\") {\n var loc = markers_1st_part_22th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_22th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_22th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_22th_2 = given_data_first_part_22th_2;\n for (var i = 0; i < markers_1st_part_22th_2.length; i++) {\n\n if (markers_1st_part_22th_2[i]['Location'] == \"M/MT/FR043D1\" || markers_1st_part_22th_2[i]['Location'] == \"M/MT/FR043C1\" || markers_1st_part_22th_2[i]['Location'] == \"M/MT/FR043B1\" || markers_1st_part_22th_2[i]['Location'] == \"M/MT/FR043A1\") {\n var loc = markers_1st_part_22th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_22th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_22th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------23th part of first block----------------------------------------------\n var markers_1st_part_23th_1 = given_data_first_part_23th_1;\n\n for (var i = 0; i < markers_1st_part_23th_1.length; i++) {\n if (markers_1st_part_23th_1[i]['Location'] == \"M/MT/FR042D2\" || markers_1st_part_23th_1[i]['Location'] == \"M/MT/FR042C2\" || markers_1st_part_23th_1[i]['Location'] == \"M/MT/FR042B2\" || markers_1st_part_23th_1[i]['Location'] == \"M/MT/FR042A2\") {\n var loc = markers_1st_part_23th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_23th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_23th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_23th_2 = given_data_first_part_23th_2;\n for (var i = 0; i < markers_1st_part_23th_2.length; i++) {\n\n if (markers_1st_part_23th_2[i]['Location'] == \"M/MT/FR042D1\" || markers_1st_part_23th_2[i]['Location'] == \"M/MT/FR042C1\" || markers_1st_part_23th_2[i]['Location'] == \"M/MT/FR042B1\" || markers_1st_part_23th_2[i]['Location'] == \"M/MT/FR042A1\") {\n var loc = markers_1st_part_23th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_23th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_23th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------24th part of first block----------------------------------------------\n var markers_1st_part_24th_1 = given_data_first_part_24th_1;\n\n for (var i = 0; i < markers_1st_part_24th_1.length; i++) {\n if (markers_1st_part_24th_1[i]['Location'] == \"M/MT/FR041D2\" || markers_1st_part_24th_1[i]['Location'] == \"M/MT/FR041C2\" || markers_1st_part_24th_1[i]['Location'] == \"M/MT/FR041B2\" || markers_1st_part_24th_1[i]['Location'] == \"M/MT/FR041A2\") {\n var loc = markers_1st_part_24th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_24th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_24th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_24th_2 = given_data_first_part_24th_2;\n for (var i = 0; i < markers_1st_part_24th_2.length; i++) {\n\n if (markers_1st_part_24th_2[i]['Location'] == \"M/MT/FR041D1\" || markers_1st_part_24th_2[i]['Location'] == \"M/MT/FR041C1\" || markers_1st_part_24th_2[i]['Location'] == \"M/MT/FR041B1\" || markers_1st_part_24th_2[i]['Location'] == \"M/MT/FR041A1\") {\n var loc = markers_1st_part_24th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_24th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_24th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------25th part of first block----------------------------------------------\n var markers_1st_part_25th_1 = given_data_first_part_25th_1;\n\n for (var i = 0; i < markers_1st_part_25th_1.length; i++) {\n if (markers_1st_part_25th_1[i]['Location'] == \"M/MT/FR040D2\" || markers_1st_part_25th_1[i]['Location'] == \"M/MT/FR040C2\" || markers_1st_part_25th_1[i]['Location'] == \"M/MT/FR040B2\" || markers_1st_part_25th_1[i]['Location'] == \"M/MT/FR040A2\") {\n var loc = markers_1st_part_25th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_25th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_25th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_25th_2 = given_data_first_part_25th_2;\n for (var i = 0; i < markers_1st_part_25th_2.length; i++) {\n\n if (markers_1st_part_25th_2[i]['Location'] == \"M/MT/FR040D1\" || markers_1st_part_25th_2[i]['Location'] == \"M/MT/FR040C1\" || markers_1st_part_25th_2[i]['Location'] == \"M/MT/FR040B1\" || markers_1st_part_25th_2[i]['Location'] == \"M/MT/FR040A1\") {\n var loc = markers_1st_part_25th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_25th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_25th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n //----------------------------------26th part of first block----------------------------------------------\n var markers_1st_part_26th_1 = given_data_first_part_26th_1;\n\n for (var i = 0; i < markers_1st_part_26th_1.length; i++) {\n if (markers_1st_part_26th_1[i]['Location'] == \"M/MT/FR039D2\" || markers_1st_part_26th_1[i]['Location'] == \"M/MT/FR039C2\" || markers_1st_part_26th_1[i]['Location'] == \"M/MT/FR039B2\" || markers_1st_part_26th_1[i]['Location'] == \"M/MT/FR039A2\") {\n var loc = markers_1st_part_26th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_26th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_26th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_26th_2 = given_data_first_part_26th_2;\n for (var i = 0; i < markers_1st_part_26th_2.length; i++) {\n\n if (markers_1st_part_26th_2[i]['Location'] == \"M/MT/FR039D1\" || markers_1st_part_26th_2[i]['Location'] == \"M/MT/FR039C1\" || markers_1st_part_26th_2[i]['Location'] == \"M/MT/FR039B1\" || markers_1st_part_26th_2[i]['Location'] == \"M/MT/FR039A1\") {\n var loc = markers_1st_part_26th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_26th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_26th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------27th part of first block----------------------------------------------\n var markers_1st_part_27th_1 = given_data_first_part_27th_1;\n\n for (var i = 0; i < markers_1st_part_27th_1.length; i++) {\n if (markers_1st_part_27th_1[i]['Location'] == \"M/MT/FR038D2\" || markers_1st_part_27th_1[i]['Location'] == \"M/MT/FR038C2\" || markers_1st_part_27th_1[i]['Location'] == \"M/MT/FR038B2\" || markers_1st_part_27th_1[i]['Location'] == \"M/MT/FR038A2\") {\n var loc = markers_1st_part_27th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_27th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_27th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_27th_2 = given_data_first_part_27th_2;\n for (var i = 0; i < markers_1st_part_27th_2.length; i++) {\n\n if (markers_1st_part_27th_2[i]['Location'] == \"M/MT/FR038D1\" || markers_1st_part_27th_2[i]['Location'] == \"M/MT/FR038C1\" || markers_1st_part_27th_2[i]['Location'] == \"M/MT/FR038B1\" || markers_1st_part_27th_2[i]['Location'] == \"M/MT/FR038A1\") {\n var loc = markers_1st_part_27th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_27th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_27th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------28th part of first block----------------------------------------------\n var markers_1st_part_28th_1 = given_data_first_part_28th_1;\n\n for (var i = 0; i < markers_1st_part_28th_1.length; i++) {\n if (markers_1st_part_28th_1[i]['Location'] == \"M/MT/FR037D2\" || markers_1st_part_28th_1[i]['Location'] == \"M/MT/FR037C2\" || markers_1st_part_28th_1[i]['Location'] == \"M/MT/FR037B2\" || markers_1st_part_28th_1[i]['Location'] == \"M/MT/FR037A2\") {\n var loc = markers_1st_part_28th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_28th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_28th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_28th_2 = given_data_first_part_28th_2;\n for (var i = 0; i < markers_1st_part_28th_2.length; i++) {\n\n if (markers_1st_part_28th_2[i]['Location'] == \"M/MT/FR037D1\" || markers_1st_part_28th_2[i]['Location'] == \"M/MT/FR037C1\" || markers_1st_part_28th_2[i]['Location'] == \"M/MT/FR037B1\" || markers_1st_part_28th_2[i]['Location'] == \"M/MT/FR037A1\") {\n var loc = markers_1st_part_28th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_28th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_28th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------29th part of first block----------------------------------------------\n var markers_1st_part_29th_1 = given_data_first_part_29th_1;\n\n for (var i = 0; i < markers_1st_part_29th_1.length; i++) {\n if (markers_1st_part_29th_1[i]['Location'] == \"M/MT/FR036D2\" || markers_1st_part_29th_1[i]['Location'] == \"M/MT/FR036C2\" || markers_1st_part_29th_1[i]['Location'] == \"M/MT/FR036B2\" || markers_1st_part_29th_1[i]['Location'] == \"M/MT/FR036A2\") {\n var loc = markers_1st_part_29th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_29th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_29th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_29th_2 = given_data_first_part_29th_2;\n for (var i = 0; i < markers_1st_part_29th_2.length; i++) {\n\n if (markers_1st_part_29th_2[i]['Location'] == \"M/MT/FR036D1\" || markers_1st_part_29th_2[i]['Location'] == \"M/MT/FR036C1\" || markers_1st_part_29th_2[i]['Location'] == \"M/MT/FR036B1\" || markers_1st_part_29th_2[i]['Location'] == \"M/MT/FR036A1\") {\n var loc = markers_1st_part_29th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_29th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_29th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------30th part of first block----------------------------------------------\n var markers_1st_part_30th_1 = given_data_first_part_30th_1;\n\n for (var i = 0; i < markers_1st_part_30th_1.length; i++) {\n if (markers_1st_part_30th_1[i]['Location'] == \"M/MT/FR035D2\" || markers_1st_part_30th_1[i]['Location'] == \"M/MT/FR035C2\" || markers_1st_part_30th_1[i]['Location'] == \"M/MT/FR035B2\" || markers_1st_part_30th_1[i]['Location'] == \"M/MT/FR035A2\") {\n var loc = markers_1st_part_30th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_30th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_30th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_30th_2 = given_data_first_part_30th_2;\n for (var i = 0; i < markers_1st_part_30th_2.length; i++) {\n\n if (markers_1st_part_30th_2[i]['Location'] == \"M/MT/FR035D1\" || markers_1st_part_30th_2[i]['Location'] == \"M/MT/FR035C1\" || markers_1st_part_30th_2[i]['Location'] == \"M/MT/FR035B1\" || markers_1st_part_30th_2[i]['Location'] == \"M/MT/FR035A1\") {\n var loc = markers_1st_part_30th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_30th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_30th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n //----------------------------------31th part of first block----------------------------------------------\n var markers_1st_part_31th_1 = given_data_first_part_31th_1;\n\n for (var i = 0; i < markers_1st_part_31th_1.length; i++) {\n if (markers_1st_part_31th_1[i]['Location'] == \"M/MT/FR034D2\" || markers_1st_part_31th_1[i]['Location'] == \"M/MT/FR034C2\" || markers_1st_part_31th_1[i]['Location'] == \"M/MT/FR034B2\" || markers_1st_part_31th_1[i]['Location'] == \"M/MT/FR034A2\") {\n var loc = markers_1st_part_31th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_31th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_31th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_31th_2 = given_data_first_part_31th_2;\n for (var i = 0; i < markers_1st_part_31th_2.length; i++) {\n\n if (markers_1st_part_31th_2[i]['Location'] == \"M/MT/FR034D1\" || markers_1st_part_31th_2[i]['Location'] == \"M/MT/FR034C1\" || markers_1st_part_31th_2[i]['Location'] == \"M/MT/FR034B1\" || markers_1st_part_31th_2[i]['Location'] == \"M/MT/FR034A1\") {\n var loc = markers_1st_part_31th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_31th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_31th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------32th part of first block----------------------------------------------\n var markers_1st_part_32th_1 = given_data_first_part_32th_1;\n\n for (var i = 0; i < markers_1st_part_32th_1.length; i++) {\n if (markers_1st_part_32th_1[i]['Location'] == \"M/MT/FR033D2\" || markers_1st_part_32th_1[i]['Location'] == \"M/MT/FR033C2\" || markers_1st_part_32th_1[i]['Location'] == \"M/MT/FR033B2\" || markers_1st_part_32th_1[i]['Location'] == \"M/MT/FR033A2\") {\n var loc = markers_1st_part_32th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_32th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_32th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_32th_2 = given_data_first_part_32th_2;\n for (var i = 0; i < markers_1st_part_32th_2.length; i++) {\n\n if (markers_1st_part_32th_2[i]['Location'] == \"M/MT/FR033D1\" || markers_1st_part_32th_2[i]['Location'] == \"M/MT/FR033C1\" || markers_1st_part_32th_2[i]['Location'] == \"M/MT/FR033B1\" || markers_1st_part_32th_2[i]['Location'] == \"M/MT/FR033A1\") {\n var loc = markers_1st_part_32th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_32th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_32th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n\n //----------------------------------33th part of first block----------------------------------------------\n var markers_1st_part_33th_1 = given_data_first_part_33th_1;\n\n for (var i = 0; i < markers_1st_part_33th_1.length; i++) {\n if (markers_1st_part_33th_1[i]['Location'] == \"M/MT/FR032D2\" || markers_1st_part_33th_1[i]['Location'] == \"M/MT/FR032C2\" || markers_1st_part_33th_1[i]['Location'] == \"M/MT/FR032B2\" || markers_1st_part_33th_1[i]['Location'] == \"M/MT/FR032A2\") {\n var loc = markers_1st_part_33th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_33th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_33th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_33th_2 = given_data_first_part_33th_2;\n for (var i = 0; i < markers_1st_part_33th_2.length; i++) {\n\n if (markers_1st_part_33th_2[i]['Location'] == \"M/MT/FR032D1\" || markers_1st_part_33th_2[i]['Location'] == \"M/MT/FR032C1\" || markers_1st_part_33th_2[i]['Location'] == \"M/MT/FR032B1\" || markers_1st_part_33th_2[i]['Location'] == \"M/MT/FR032A1\") {\n var loc = markers_1st_part_33th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_33th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_33th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n\n //----------------------------------filling 7th block small boxes-----------------------------------\n //----------------------------------1th part of 7th block----------------------------------------------\n var markers_7th_part_1st_1 = given_data_seventh_part_1st_1;\n\n for (var i = 0; i < markers_7th_part_1st_1.length; i++) {\n if (markers_7th_part_1st_1[i]['Location'] == \"M/MT/FR029D2\" || markers_7th_part_1st_1[i]['Location'] == \"M/MT/FR029C2\" || markers_7th_part_1st_1[i]['Location'] == \"M/MT/FR029B2\" || markers_7th_part_1st_1[i]['Location'] == \"M/MT/FR029A2\") {\n var loc = markers_7th_part_1st_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_1st_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_1st_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_7th_part_1st_2 = given_data_seventh_part_1st_2;\n for (var i = 0; i < markers_7th_part_1st_2.length; i++) {\n\n if (markers_7th_part_1st_2[i]['Location'] == \"M/MT/FR029D1\" || markers_7th_part_1st_2[i]['Location'] == \"M/MT/FR029C1\" || markers_7th_part_1st_2[i]['Location'] == \"M/MT/FR029B1\" || markers_7th_part_1st_2[i]['Location'] == \"M/MT/FR029A1\") {\n var loc = markers_7th_part_1st_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_1st_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_1st_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n\n //----------------------------------2nd part of 7th block----------------------------------------------\n var markers_7th_part_2nd_1 = given_data_seventh_part_2nd_1;\n\n for (var i = 0; i < markers_7th_part_2nd_1.length; i++) {\n if (markers_7th_part_2nd_1[i]['Location'] == \"M/MT/FR028D2\" || markers_7th_part_2nd_1[i]['Location'] == \"M/MT/FR028C2\" || markers_7th_part_2nd_1[i]['Location'] == \"M/MT/FR028B2\" || markers_7th_part_2nd_1[i]['Location'] == \"M/MT/FR028A2\") {\n var loc = markers_7th_part_1st_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_2nd_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_2nd_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_7th_part_2nd_2 = given_data_seventh_part_2nd_2;\n for (var i = 0; i < markers_7th_part_2nd_2.length; i++) {\n\n if (markers_7th_part_2nd_2[i]['Location'] == \"M/MT/FR028D1\" || markers_7th_part_2nd_2[i]['Location'] == \"M/MT/FR028C1\" || markers_7th_part_2nd_2[i]['Location'] == \"M/MT/FR028B1\" || markers_7th_part_2nd_2[i]['Location'] == \"M/MT/FR028A1\") {\n var loc = markers_7th_part_2nd_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_2nd_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_2nd_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n //----------------------------------3rd part of 7th block----------------------------------------------\n var markers_7th_part_3rd_1 = given_data_seventh_part_3rd_1;\n\n for (var i = 0; i < markers_7th_part_3rd_1.length; i++) {\n if (markers_7th_part_3rd_1[i]['Location'] == \"M/MT/FR027D2\" || markers_7th_part_3rd_1[i]['Location'] == \"M/MT/FR027C2\" || markers_7th_part_3rd_1[i]['Location'] == \"M/MT/FR027B2\" || markers_7th_part_3rd_1[i]['Location'] == \"M/MT/FR027A2\") {\n var loc = markers_7th_part_3rd_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_3rd_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_3rd_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_7th_part_3rd_2 = given_data_seventh_part_3rd_2;\n for (var i = 0; i < markers_7th_part_3rd_2.length; i++) {\n\n if (markers_7th_part_3rd_2[i]['Location'] == \"M/MT/FR027D1\" || markers_7th_part_3rd_2[i]['Location'] == \"M/MT/FR027C1\" || markers_7th_part_3rd_2[i]['Location'] == \"M/MT/FR027B1\" || markers_7th_part_3rd_2[i]['Location'] == \"M/MT/FR027A1\") {\n var loc = markers_7th_part_3rd_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_3rd_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_3rd_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n\n\n //----------------------------------4th part of 7th block----------------------------------------------\n var markers_7th_part_4th_1 = given_data_seventh_part_4th_1;\n\n for (var i = 0; i < markers_7th_part_4th_1.length; i++) {\n if (markers_7th_part_4th_1[i]['Location'] == \"M/MT/FR026D2\" || markers_7th_part_4th_1[i]['Location'] == \"M/MT/FR026C2\" || markers_7th_part_4th_1[i]['Location'] == \"M/MT/FR026B2\" || markers_7th_part_4th_1[i]['Location'] == \"M/MT/FR026A2\") {\n var loc = markers_7th_part_4th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_4th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_4th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_7th_part_4th_2 = given_data_seventh_part_4th_2;\n for (var i = 0; i < markers_7th_part_4th_2.length; i++) {\n\n if (markers_7th_part_4th_2[i]['Location'] == \"M/MT/FR026D1\" || markers_7th_part_4th_2[i]['Location'] == \"M/MT/FR026C1\" || markers_7th_part_4th_2[i]['Location'] == \"M/MT/FR026B1\" || markers_7th_part_4th_2[i]['Location'] == \"M/MT/FR026A1\") {\n var loc = markers_7th_part_4th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_4th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_4th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------5th part of 7th block----------------------------------------------\n var markers_7th_part_5th_1 = given_data_seventh_part_5th_1;\n\n for (var i = 0; i < markers_7th_part_5th_1.length; i++) {\n if (markers_7th_part_5th_1[i]['Location'] == \"M/MT/FR025D2\" || markers_7th_part_5th_1[i]['Location'] == \"M/MT/FR025C2\" || markers_7th_part_5th_1[i]['Location'] == \"M/MT/FR025B2\" || markers_7th_part_5th_1[i]['Location'] == \"M/MT/FR025A2\") {\n var loc = markers_7th_part_5th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_5th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_5th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_7th_part_5th_2 = given_data_seventh_part_5th_2;\n for (var i = 0; i < markers_7th_part_5th_2.length; i++) {\n\n if (markers_7th_part_5th_2[i]['Location'] == \"M/MT/FR025D1\" || markers_7th_part_5th_2[i]['Location'] == \"M/MT/FR025C1\" || markers_7th_part_5th_2[i]['Location'] == \"M/MT/FR025B1\" || markers_7th_part_5th_2[i]['Location'] == \"M/MT/FR025A1\") {\n var loc = markers_7th_part_5th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_5th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_5th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n //----------------------------------6th part of 7th block----------------------------------------------\n var markers_7th_part_6th_1 = given_data_seventh_part_6th_1;\n for (var i = 0; i < markers_7th_part_6th_1.length; i++) {\n if (markers_7th_part_6th_1[i]['Location'] == \"M/MT/FR024D2\" || markers_7th_part_6th_1[i]['Location'] == \"M/MT/FR024C2\" || markers_7th_part_6th_1[i]['Location'] == \"M/MT/FR024B2\" || markers_7th_part_6th_1[i]['Location'] == \"M/MT/FR024A2\") {\n var loc = markers_7th_part_6th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_6th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_6th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_6th_2 = given_data_seventh_part_6th_2;\n for (var i = 0; i < markers_7th_part_6th_2.length; i++) {\n if (markers_7th_part_6th_2[i]['Location'] == \"M/MT/FR024D1\" || markers_7th_part_6th_2[i]['Location'] == \"M/MT/FR024C1\" || markers_7th_part_6th_2[i]['Location'] == \"M/MT/FR024B1\" || markers_7th_part_6th_2[i]['Location'] == \"M/MT/FR024A1\") {\n var loc = markers_7th_part_5th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n x_val = markers_7th_part_6th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_6th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------7th part of 7th block----------------------------------------------\n var markers_7th_part_7th_1 = given_data_seventh_part_7th_1;\n for (var i = 0; i < markers_7th_part_7th_1.length; i++) {\n if (markers_7th_part_7th_1[i]['Location'] == \"M/MT/FR023D2\" || markers_7th_part_7th_1[i]['Location'] == \"M/MT/FR023C2\" || markers_7th_part_7th_1[i]['Location'] == \"M/MT/FR023B2\" || markers_7th_part_7th_1[i]['Location'] == \"M/MT/FR023A2\") {\n var loc = markers_7th_part_7th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_7th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_7th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_7th_2 = given_data_seventh_part_7th_2;\n for (var i = 0; i < markers_7th_part_7th_2.length; i++) {\n if (markers_7th_part_7th_2[i]['Location'] == \"M/MT/FR023D1\" || markers_7th_part_7th_2[i]['Location'] == \"M/MT/FR023C1\" || markers_7th_part_7th_2[i]['Location'] == \"M/MT/FR023B1\" || markers_7th_part_7th_2[i]['Location'] == \"M/MT/FR023A1\") {\n var loc = markers_7th_part_7th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n x_val = markers_7th_part_7th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_7th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------8th part of 7th block----------------------------------------------\n var markers_7th_part_8th_1 = given_data_seventh_part_8th_1;\n for (var i = 0; i < markers_7th_part_8th_1.length; i++) {\n if (markers_7th_part_8th_1[i]['Location'] == \"M/MT/FR022D2\" || markers_7th_part_8th_1[i]['Location'] == \"M/MT/FR022C2\" || markers_7th_part_8th_1[i]['Location'] == \"M/MT/FR022B2\" || markers_7th_part_8th_1[i]['Location'] == \"M/MT/FR022A2\") {\n var loc = markers_7th_part_8th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_8th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_8th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_8th_2 = given_data_seventh_part_8th_2;\n for (var i = 0; i < markers_7th_part_8th_2.length; i++) {\n if (markers_7th_part_8th_2[i]['Location'] == \"M/MT/FR022D1\" || markers_7th_part_8th_2[i]['Location'] == \"M/MT/FR022C1\" || markers_7th_part_8th_2[i]['Location'] == \"M/MT/FR022B1\" || markers_7th_part_8th_2[i]['Location'] == \"M/MT/FR022A1\") {\n var loc = markers_7th_part_8th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n x_val = markers_7th_part_8th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_8th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------9th part of 7th block----------------------------------------------\n var markers_7th_part_9th_1 = given_data_seventh_part_9th_1;\n for (var i = 0; i < markers_7th_part_9th_1.length; i++) {\n if (markers_7th_part_9th_1[i]['Location'] == \"M/MT/FR021D2\" || markers_7th_part_9th_1[i]['Location'] == \"M/MT/FR021C2\" || markers_7th_part_9th_1[i]['Location'] == \"M/MT/FR021B2\" || markers_7th_part_9th_1[i]['Location'] == \"M/MT/FR021A2\") {\n var loc = markers_7th_part_9th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_9th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_9th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_9th_2 = given_data_seventh_part_9th_2;\n for (var i = 0; i < markers_7th_part_9th_2.length; i++) {\n if (markers_7th_part_9th_2[i]['Location'] == \"M/MT/FR021D1\" || markers_7th_part_9th_2[i]['Location'] == \"M/MT/FR021C1\" || markers_7th_part_9th_2[i]['Location'] == \"M/MT/FR021B1\" || markers_7th_part_9th_2[i]['Location'] == \"M/MT/FR021A1\") {\n var loc = markers_7th_part_9th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_9th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_9th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------10th part of 7th block----------------------------------------------\n var markers_7th_part_10th_1 = given_data_seventh_part_10th_1;\n for (var i = 0; i < markers_7th_part_10th_1.length; i++) {\n if (markers_7th_part_10th_1[i]['Location'] == \"M/MT/FR020D2\" || markers_7th_part_10th_1[i]['Location'] == \"M/MT/FR020C2\" || markers_7th_part_10th_1[i]['Location'] == \"M/MT/FR020B2\" || markers_7th_part_10th_1[i]['Location'] == \"M/MT/FR020A2\") {\n var loc = markers_7th_part_10th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_10th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_10th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_10th_2 = given_data_seventh_part_10th_2;\n for (var i = 0; i < markers_7th_part_10th_2.length; i++) {\n if (markers_7th_part_10th_2[i]['Location'] == \"M/MT/FR020D1\" || markers_7th_part_10th_2[i]['Location'] == \"M/MT/FR020C1\" || markers_7th_part_10th_2[i]['Location'] == \"M/MT/FR020B1\" || markers_7th_part_10th_2[i]['Location'] == \"M/MT/FR020A1\") {\n var loc = markers_7th_part_10th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_10th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_10th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------11th part of 7th block----------------------------------------------\n var markers_7th_part_11th_1 = given_data_seventh_part_11th_1;\n for (var i = 0; i < markers_7th_part_11th_1.length; i++) {\n if (markers_7th_part_11th_1[i]['Location'] == \"M/MT/FR019D2\" || markers_7th_part_11th_1[i]['Location'] == \"M/MT/FR019C2\" || markers_7th_part_11th_1[i]['Location'] == \"M/MT/FR019B2\" || markers_7th_part_11th_1[i]['Location'] == \"M/MT/FR019A2\") {\n var loc = markers_7th_part_11th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_11th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_11th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_11th_2 = given_data_seventh_part_11th_2;\n for (var i = 0; i < markers_7th_part_11th_2.length; i++) {\n if (markers_7th_part_11th_2[i]['Location'] == \"M/MT/FR019D1\" || markers_7th_part_11th_2[i]['Location'] == \"M/MT/FR019C1\" || markers_7th_part_11th_2[i]['Location'] == \"M/MT/FR019B1\" || markers_7th_part_11th_2[i]['Location'] == \"M/MT/FR019A1\") {\n var loc = markers_7th_part_11th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_11th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_11th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------12th part of 7th block----------------------------------------------\n var markers_7th_part_12th_1 = given_data_seventh_part_12th_1;\n for (var i = 0; i < markers_7th_part_12th_1.length; i++) {\n if (markers_7th_part_12th_1[i]['Location'] == \"M/MT/FR018D2\" || markers_7th_part_12th_1[i]['Location'] == \"M/MT/FR018C2\" || markers_7th_part_12th_1[i]['Location'] == \"M/MT/FR018B2\" || markers_7th_part_12th_1[i]['Location'] == \"M/MT/FR018A2\") {\n var loc = markers_7th_part_11th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_12th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_12th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_12th_2 = given_data_seventh_part_12th_2;\n for (var i = 0; i < markers_7th_part_12th_2.length; i++) {\n if (markers_7th_part_12th_2[i]['Location'] == \"M/MT/FR018D1\" || markers_7th_part_12th_2[i]['Location'] == \"M/MT/FR018C1\" || markers_7th_part_12th_2[i]['Location'] == \"M/MT/FR018B1\" || markers_7th_part_12th_2[i]['Location'] == \"M/MT/FR018A1\") {\n var loc = markers_7th_part_12th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_12th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_12th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------13th part of 7th block----------------------------------------------\n var markers_7th_part_13th_1 = given_data_seventh_part_13th_1;\n for (var i = 0; i < markers_7th_part_13th_1.length; i++) {\n if (markers_7th_part_13th_1[i]['Location'] == \"M/MT/FR017D2\" || markers_7th_part_13th_1[i]['Location'] == \"M/MT/FR017C2\" || markers_7th_part_13th_1[i]['Location'] == \"M/MT/FR017B2\" || markers_7th_part_13th_1[i]['Location'] == \"M/MT/FR017A2\") {\n var loc = markers_7th_part_13th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_13th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_13th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_13th_2 = given_data_seventh_part_13th_2;\n for (var i = 0; i < markers_7th_part_13th_2.length; i++) {\n if (markers_7th_part_13th_2[i]['Location'] == \"M/MT/FR017D1\" || markers_7th_part_13th_2[i]['Location'] == \"M/MT/FR017C1\" || markers_7th_part_13th_2[i]['Location'] == \"M/MT/FR017B1\" || markers_7th_part_13th_2[i]['Location'] == \"M/MT/FR017A1\") {\n var loc = markers_7th_part_13th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_13th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_13th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------14th part of 7th block----------------------------------------------\n var markers_7th_part_14th_1 = given_data_seventh_part_14th_1;\n for (var i = 0; i < markers_7th_part_14th_1.length; i++) {\n if (markers_7th_part_14th_1[i]['Location'] == \"M/MT/FR016D2\" || markers_7th_part_14th_1[i]['Location'] == \"M/MT/FR016C2\" || markers_7th_part_14th_1[i]['Location'] == \"M/MT/FR016B2\" || markers_7th_part_14th_1[i]['Location'] == \"M/MT/FR016A2\") {\n var loc = markers_7th_part_14th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_14th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_14th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_14th_2 = given_data_seventh_part_14th_2;\n for (var i = 0; i < markers_7th_part_14th_2.length; i++) {\n if (markers_7th_part_14th_2[i]['Location'] == \"M/MT/FR016D1\" || markers_7th_part_14th_2[i]['Location'] == \"M/MT/FR016C1\" || markers_7th_part_14th_2[i]['Location'] == \"M/MT/FR016B1\" || markers_7th_part_14th_2[i]['Location'] == \"M/MT/FR016A1\") {\n var loc = markers_7th_part_14th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_14th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_14th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------15th part of 7th block----------------------------------------------\n var markers_7th_part_15th_1 = given_data_seventh_part_15th_1;\n for (var i = 0; i < markers_7th_part_15th_1.length; i++) {\n if (markers_7th_part_15th_1[i]['Location'] == \"M/MT/FR015D2\" || markers_7th_part_15th_1[i]['Location'] == \"M/MT/FR015C2\" || markers_7th_part_15th_1[i]['Location'] == \"M/MT/FR015B2\" || markers_7th_part_15th_1[i]['Location'] == \"M/MT/FR015A2\") {\n var loc = markers_7th_part_15th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_15th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_15th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_15th_2 = given_data_seventh_part_15th_2;\n for (var i = 0; i < markers_7th_part_15th_2.length; i++) {\n if (markers_7th_part_15th_2[i]['Location'] == \"M/MT/FR015D1\" || markers_7th_part_15th_2[i]['Location'] == \"M/MT/FR015C1\" || markers_7th_part_15th_2[i]['Location'] == \"M/MT/FR015B1\" || markers_7th_part_15th_2[i]['Location'] == \"M/MT/FR015A1\") {\n var loc = markers_7th_part_15th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_15th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_15th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------16th part of 7th block----------------------------------------------\n var markers_7th_part_16th_1 = given_data_seventh_part_16th_1;\n for (var i = 0; i < markers_7th_part_16th_1.length; i++) {\n if (markers_7th_part_16th_1[i]['Location'] == \"M/MT/FR014D2\" || markers_7th_part_16th_1[i]['Location'] == \"M/MT/FR014C2\" || markers_7th_part_16th_1[i]['Location'] == \"M/MT/FR014B2\" || markers_7th_part_16th_1[i]['Location'] == \"M/MT/FR014A2\") {\n var loc = markers_7th_part_16th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_16th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_16th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_16th_2 = given_data_seventh_part_16th_2;\n for (var i = 0; i < markers_7th_part_16th_2.length; i++) {\n if (markers_7th_part_16th_2[i]['Location'] == \"M/MT/FR014D1\" || markers_7th_part_16th_2[i]['Location'] == \"M/MT/FR014C1\" || markers_7th_part_16th_2[i]['Location'] == \"M/MT/FR014B1\" || markers_7th_part_16th_2[i]['Location'] == \"M/MT/FR014A1\") {\n var loc = markers_7th_part_16th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_16th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_16th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------17th part of 7th block----------------------------------------------\n var markers_7th_part_17th_1 = given_data_seventh_part_17th_1;\n for (var i = 0; i < markers_7th_part_17th_1.length; i++) {\n if (markers_7th_part_17th_1[i]['Location'] == \"M/MT/FR013D2\" || markers_7th_part_17th_1[i]['Location'] == \"M/MT/FR013C2\" || markers_7th_part_17th_1[i]['Location'] == \"M/MT/FR013B2\" || markers_7th_part_17th_1[i]['Location'] == \"M/MT/FR013A2\") {\n var loc = markers_7th_part_17th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_17th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_17th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_17th_2 = given_data_seventh_part_17th_2;\n for (var i = 0; i < markers_7th_part_17th_2.length; i++) {\n if (markers_7th_part_17th_2[i]['Location'] == \"M/MT/FR013D1\" || markers_7th_part_17th_2[i]['Location'] == \"M/MT/FR013C1\" || markers_7th_part_17th_2[i]['Location'] == \"M/MT/FR013B1\" || markers_7th_part_17th_2[i]['Location'] == \"M/MT/FR013A1\") {\n var loc = markers_7th_part_17th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_17th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_17th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n //----------------------------------18th part of 7th block----------------------------------------------\n var markers_7th_part_18th_1 = given_data_seventh_part_18th_1;\n for (var i = 0; i < markers_7th_part_18th_1.length; i++) {\n if (markers_7th_part_18th_1[i]['Location'] == \"M/MT/FR012D2\" || markers_7th_part_18th_1[i]['Location'] == \"M/MT/FR012C2\" || markers_7th_part_18th_1[i]['Location'] == \"M/MT/FR012B2\" || markers_7th_part_18th_1[i]['Location'] == \"M/MT/FR012A2\") {\n var loc = markers_7th_part_18th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_18th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_18th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_18th_2 = given_data_seventh_part_18th_2;\n for (var i = 0; i < markers_7th_part_18th_2.length; i++) {\n if (markers_7th_part_18th_2[i]['Location'] == \"M/MT/FR012D1\" || markers_7th_part_18th_2[i]['Location'] == \"M/MT/FR012C1\" || markers_7th_part_18th_2[i]['Location'] == \"M/MT/FR012B1\" || markers_7th_part_18th_2[i]['Location'] == \"M/MT/FR012A1\") {\n var loc = markers_7th_part_18th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_18th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_18th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------19th part of 7th block----------------------------------------------\n var markers_7th_part_19th_1 = given_data_seventh_part_19th_1;\n for (var i = 0; i < markers_7th_part_19th_1.length; i++) {\n if (markers_7th_part_19th_1[i]['Location'] == \"M/MT/FR011D2\" || markers_7th_part_19th_1[i]['Location'] == \"M/MT/FR011C2\" || markers_7th_part_19th_1[i]['Location'] == \"M/MT/FR011B2\" || markers_7th_part_19th_1[i]['Location'] == \"M/MT/FR011A2\") {\n var loc = markers_7th_part_19th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_19th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_19th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_19th_2 = given_data_seventh_part_19th_2;\n for (var i = 0; i < markers_7th_part_19th_2.length; i++) {\n if (markers_7th_part_19th_2[i]['Location'] == \"M/MT/FR011D1\" || markers_7th_part_19th_2[i]['Location'] == \"M/MT/FR011C1\" || markers_7th_part_19th_2[i]['Location'] == \"M/MT/FR011B1\" || markers_7th_part_19th_2[i]['Location'] == \"M/MT/FR011A1\") {\n var loc = markers_7th_part_19th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_19th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_19th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------20th part of 7th block----------------------------------------------\n var markers_7th_part_20th_1 = given_data_seventh_part_20th_1;\n for (var i = 0; i < markers_7th_part_20th_1.length; i++) {\n if (markers_7th_part_20th_1[i]['Location'] == \"M/MT/FR010D2\" || markers_7th_part_20th_1[i]['Location'] == \"M/MT/FR010C2\" || markers_7th_part_20th_1[i]['Location'] == \"M/MT/FR010B2\" || markers_7th_part_20th_1[i]['Location'] == \"M/MT/FR010A2\") {\n var loc = markers_7th_part_20th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_20th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_20th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_20th_2 = given_data_seventh_part_20th_2;\n for (var i = 0; i < markers_7th_part_20th_2.length; i++) {\n if (markers_7th_part_20th_2[i]['Location'] == \"M/MT/FR010D1\" || markers_7th_part_20th_2[i]['Location'] == \"M/MT/FR010C1\" || markers_7th_part_20th_2[i]['Location'] == \"M/MT/FR010B1\" || markers_7th_part_20th_2[i]['Location'] == \"M/MT/FR010A1\") {\n var loc = markers_7th_part_20th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_20th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_20th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------21th part of 7th block----------------------------------------------\n var markers_7th_part_21th_1 = given_data_seventh_part_21th_1;\n for (var i = 0; i < markers_7th_part_21th_1.length; i++) {\n if (markers_7th_part_21th_1[i]['Location'] == \"M/MT/FR009D2\" || markers_7th_part_21th_1[i]['Location'] == \"M/MT/FR009C2\" || markers_7th_part_21th_1[i]['Location'] == \"M/MT/FR009B2\" || markers_7th_part_21th_1[i]['Location'] == \"M/MT/FR009A2\") {\n var loc = markers_7th_part_21th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_21th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_21th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_21th_2 = given_data_seventh_part_21th_2;\n for (var i = 0; i < markers_7th_part_21th_2.length; i++) {\n if (markers_7th_part_21th_2[i]['Location'] == \"M/MT/FR009D1\" || markers_7th_part_21th_2[i]['Location'] == \"M/MT/FR009C1\" || markers_7th_part_21th_2[i]['Location'] == \"M/MT/FR009B1\" || markers_7th_part_21th_2[i]['Location'] == \"M/MT/FR009A1\") {\n var loc = markers_7th_part_21th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_21th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_21th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n\n //----------------------------------22th part of 7th block----------------------------------------------\n var markers_7th_part_22th_1 = given_data_seventh_part_22th_1;\n for (var i = 0; i < markers_7th_part_22th_1.length; i++) {\n if (markers_7th_part_22th_1[i]['Location'] == \"M/MT/FR008D2\" || markers_7th_part_22th_1[i]['Location'] == \"M/MT/FR008C2\" || markers_7th_part_22th_1[i]['Location'] == \"M/MT/FR008B2\" || markers_7th_part_22th_1[i]['Location'] == \"M/MT/FR008A2\") {\n var loc = markers_7th_part_22th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_22th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_22th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_22th_2 = given_data_seventh_part_22th_2;\n for (var i = 0; i < markers_7th_part_22th_2.length; i++) {\n if (markers_7th_part_22th_2[i]['Location'] == \"M/MT/FR008D1\" || markers_7th_part_22th_2[i]['Location'] == \"M/MT/FR008C1\" || markers_7th_part_22th_2[i]['Location'] == \"M/MT/FR008B1\" || markers_7th_part_22th_2[i]['Location'] == \"M/MT/FR008A1\") {\n var loc = markers_7th_part_22th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_22th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_22th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------23th part of 7th block----------------------------------------------\n var markers_7th_part_23th_1 = given_data_seventh_part_23th_1;\n for (var i = 0; i < markers_7th_part_23th_1.length; i++) {\n if (markers_7th_part_23th_1[i]['Location'] == \"M/MT/FR007D2\" || markers_7th_part_23th_1[i]['Location'] == \"M/MT/FR007C2\" || markers_7th_part_23th_1[i]['Location'] == \"M/MT/FR007B2\" || markers_7th_part_23th_1[i]['Location'] == \"M/MT/FR007A2\") {\n var loc = markers_7th_part_23th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_23th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_23th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_23th_2 = given_data_seventh_part_23th_2;\n for (var i = 0; i < markers_7th_part_23th_2.length; i++) {\n if (markers_7th_part_23th_2[i]['Location'] == \"M/MT/FR007D1\" || markers_7th_part_23th_2[i]['Location'] == \"M/MT/FR007C1\" || markers_7th_part_23th_2[i]['Location'] == \"M/MT/FR007B1\" || markers_7th_part_23th_2[i]['Location'] == \"M/MT/FR007A1\") {\n var loc = markers_7th_part_23th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_23th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_23th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------24th part of 7th block----------------------------------------------\n var markers_7th_part_24th_1 = given_data_seventh_part_24th_1;\n for (var i = 0; i < markers_7th_part_24th_1.length; i++) {\n if (markers_7th_part_24th_1[i]['Location'] == \"M/MT/FR006D2\" || markers_7th_part_24th_1[i]['Location'] == \"M/MT/FR006C2\" || markers_7th_part_24th_1[i]['Location'] == \"M/MT/FR006B2\" || markers_7th_part_24th_1[i]['Location'] == \"M/MT/FR006A2\") {\n var loc = markers_7th_part_24th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_24th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_24th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_24th_2 = given_data_seventh_part_24th_2;\n for (var i = 0; i < markers_7th_part_24th_2.length; i++) {\n if (markers_7th_part_24th_2[i]['Location'] == \"M/MT/FR006D1\" || markers_7th_part_24th_2[i]['Location'] == \"M/MT/FR006C1\" || markers_7th_part_24th_2[i]['Location'] == \"M/MT/FR006B1\" || markers_7th_part_24th_2[i]['Location'] == \"M/MT/FR006A1\") {\n var loc = markers_7th_part_24th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_24th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_24th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------25th part of 7th block----------------------------------------------\n var markers_7th_part_25th_1 = given_data_seventh_part_25th_1;\n for (var i = 0; i < markers_7th_part_25th_1.length; i++) {\n if (markers_7th_part_25th_1[i]['Location'] == \"M/MT/FR005D2\" || markers_7th_part_25th_1[i]['Location'] == \"M/MT/FR005C2\" || markers_7th_part_25th_1[i]['Location'] == \"M/MT/FR005B2\" || markers_7th_part_25th_1[i]['Location'] == \"M/MT/FR005A2\") {\n var loc = markers_7th_part_25th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_25th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_25th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_25th_2 = given_data_seventh_part_25th_2;\n for (var i = 0; i < markers_7th_part_25th_2.length; i++) {\n if (markers_7th_part_25th_2[i]['Location'] == \"M/MT/FR005D1\" || markers_7th_part_25th_2[i]['Location'] == \"M/MT/FR005C1\" || markers_7th_part_25th_2[i]['Location'] == \"M/MT/FR005B1\" || markers_7th_part_25th_2[i]['Location'] == \"M/MT/FR005A1\") {\n var loc = markers_7th_part_25th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_25th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_25th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n //----------------------------------26th part of 7th block----------------------------------------------\n var markers_7th_part_26th_1 = given_data_seventh_part_26th_1;\n for (var i = 0; i < markers_7th_part_26th_1.length; i++) {\n if (markers_7th_part_26th_1[i]['Location'] == \"M/MT/FR004D2\" || markers_7th_part_26th_1[i]['Location'] == \"M/MT/FR004C2\" || markers_7th_part_26th_1[i]['Location'] == \"M/MT/FR004B2\" || markers_7th_part_26th_1[i]['Location'] == \"M/MT/FR004A2\") {\n var loc = markers_7th_part_26th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_26th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_26th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_26th_2 = given_data_seventh_part_26th_2;\n for (var i = 0; i < markers_7th_part_26th_2.length; i++) {\n if (markers_7th_part_26th_2[i]['Location'] == \"M/MT/FR004D1\" || markers_7th_part_26th_2[i]['Location'] == \"M/MT/FR004C1\" || markers_7th_part_26th_2[i]['Location'] == \"M/MT/FR004B1\" || markers_7th_part_26th_2[i]['Location'] == \"M/MT/FR004A1\") {\n var loc = markers_7th_part_26th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_26th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_26th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------27th part of 7th block----------------------------------------------\n var markers_7th_part_27th_1 = given_data_seventh_part_27th_1;\n for (var i = 0; i < markers_7th_part_27th_1.length; i++) {\n if (markers_7th_part_27th_1[i]['Location'] == \"M/MT/FR003D2\" || markers_7th_part_27th_1[i]['Location'] == \"M/MT/FR003C2\" || markers_7th_part_27th_1[i]['Location'] == \"M/MT/FR003B2\" || markers_7th_part_27th_1[i]['Location'] == \"M/MT/FR003A2\") {\n var loc = markers_7th_part_27th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_27th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_27th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_27th_2 = given_data_seventh_part_27th_2;\n for (var i = 0; i < markers_7th_part_27th_2.length; i++) {\n if (markers_7th_part_27th_2[i]['Location'] == \"M/MT/FR003D1\" || markers_7th_part_27th_2[i]['Location'] == \"M/MT/FR003C1\" || markers_7th_part_27th_2[i]['Location'] == \"M/MT/FR003B1\" || markers_7th_part_27th_2[i]['Location'] == \"M/MT/FR003A1\") {\n var loc = markers_7th_part_27th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_27th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_27th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------28th part of 7th block----------------------------------------------\n var markers_7th_part_28th_1 = given_data_seventh_part_28th_1;\n for (var i = 0; i < markers_7th_part_28th_1.length; i++) {\n if (markers_7th_part_28th_1[i]['Location'] == \"M/MT/FR002D2\" || markers_7th_part_28th_1[i]['Location'] == \"M/MT/FR002C2\" || markers_7th_part_28th_1[i]['Location'] == \"M/MT/FR002B2\" || markers_7th_part_28th_1[i]['Location'] == \"M/MT/FR002A2\") {\n var loc = markers_7th_part_28th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_28th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_28th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_28th_2 = given_data_seventh_part_28th_2;\n for (var i = 0; i < markers_7th_part_28th_2.length; i++) {\n if (markers_7th_part_28th_2[i]['Location'] == \"M/MT/FR002D1\" || markers_7th_part_28th_2[i]['Location'] == \"M/MT/FR002C1\" || markers_7th_part_28th_2[i]['Location'] == \"M/MT/FR002B1\" || markers_7th_part_28th_2[i]['Location'] == \"M/MT/FR002A1\") {\n var loc = markers_7th_part_28th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_28th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_28th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------29th part of 7th block----------------------------------------------\n var markers_7th_part_29th_1 = given_data_seventh_part_29th_1;\n for (var i = 0; i < markers_7th_part_29th_1.length; i++) {\n if (markers_7th_part_29th_1[i]['Location'] == \"M/MT/FR001D2\" || markers_7th_part_29th_1[i]['Location'] == \"M/MT/FR001C2\" || markers_7th_part_29th_1[i]['Location'] == \"M/MT/FR001B2\" || markers_7th_part_29th_1[i]['Location'] == \"M/MT/FR001A2\") {\n var loc = markers_7th_part_29th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_29th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_29th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_29th_2 = given_data_seventh_part_29th_2;\n for (var i = 0; i < markers_7th_part_29th_2.length; i++) {\n if (markers_7th_part_29th_2[i]['Location'] == \"M/MT/FR001D1\" || markers_7th_part_29th_2[i]['Location'] == \"M/MT/FR001C1\" || markers_7th_part_29th_2[i]['Location'] == \"M/MT/FR001B1\" || markers_7th_part_29th_2[i]['Location'] == \"M/MT/FR001A1\") {\n var loc = markers_7th_part_29th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_29th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_29th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n\n\n\n\n\n\n // given_loc_data_sixth_part=given_object[\"required_part_location_6th_block\"];\n\n //------------------------------------------extra code-------------------------\n // code for render road\n //image size height 3300 and width 1800\n // intial 3 points are:-1=[80,50],2=[700,50],3=[1450,50]\n /* var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n \n var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"\" fill=\"red\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">road</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"red\" opacity=\"1\" fill=\"red\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], {type: 'image/svg+xml'});\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url});\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = \"cover_Id=\";\n \n \n x_val_1=[50,50];\n x_val_1_end=[50,3100];\n x_val_2=[1100,50];\n x_val_2_end=[1100,3100];\n x_val_3=[1950,50];\n x_val_3_end=[1950,3100];\n \n \n \n\n\n var new_marker_1 = xy(x_val_1[0], x_val_1[1]);\n var new_marker_2= xy(x_val_2[0], x_val_2[1]);\n var new_marker_3= xy(x_val_3[0], x_val_3[1]);\n var new_marker_1_end = xy(x_val_1_end[0], x_val_1_end[1]);\n var new_marker_3_end = xy(x_val_3_end[0], x_val_3_end[1]);\n var new_marker_2_end= xy(x_val_2_end[0], x_val_2_end[1]);\n\n\n\n\n var given_marker1 = L.marker(new_marker_1, { icon: greenIcon2 })\n var given_marker2 = L.marker(new_marker_2, { icon: greenIcon2 })\n var given_marker3 = L.marker(new_marker_3, { icon: greenIcon2 })\n var given_marker1_end = L.marker(new_marker_1_end, { icon: greenIcon2 })\n var given_marker3_end = L.marker(new_marker_3_end, { icon: greenIcon2 })\n var given_marker2_end = L.marker(new_marker_2_end, { icon: greenIcon2 })\n\n\n\n\n given_marker1.addTo(myFeatureGroup)\n given_marker2.addTo(myFeatureGroup)\n given_marker3.addTo(myFeatureGroup)\n given_marker1_end.addTo(myFeatureGroup)\n given_marker3_end.addTo(myFeatureGroup)\n given_marker2_end.addTo(myFeatureGroup)*/\n\n\n\n\n //given_marker.test = test;\n\n\n\n\n\n\n\n\n\n\n\n //------------------------------------------onclick function here--------------------------------------\n\n\n}", "function load_map(array) {\n\n for (var i = 0; i < grid.children.length; i++) {\n grid.getChildAt(i).gotoAndStop(array[i]);\n }\n\n renderer.render(stage);\n}", "function showMap() {\n let showMap = emptyMap.forEach((xRows, x) => {\n let mapRow = document.createElement(\"div\");\n mapRow.className = `row`;\n targetMap.appendChild(mapRow);\n xRows.forEach((yRows, y) => {\n let addBlock = (mapRow.innerHTML += mapBlock);\n let getLastBlock = mapRow.querySelector(\"div.block:last-of-type\");\n getLastBlock.classList.add(`x${x}`, `y${y}`);\n if (yRows) {\n addItem.className = yRows;\n getLastBlock.appendChild(addItem);\n }\n return addBlock;\n });\n });\n return showMap;\n }", "function useMap(inputArr) {\n inputArr.map((obj) => {\n console.log(obj);\n });\n\n}", "level1()\r\n {\r\n var map = \r\n [\r\n [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],\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\r\n [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],\r\n [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\r\n [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],\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\r\n [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],\r\n [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\r\n [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],\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\r\n [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],\r\n [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\r\n [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],\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\r\n [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],\r\n /*\r\n [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\r\n [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],\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\r\n [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],\r\n [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\r\n [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],\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\r\n [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],\r\n [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\r\n [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],\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\r\n [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],\r\n [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\r\n [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],\r\n [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],\r\n */\r\n ]\r\n\r\n /*\r\n Function that creates tiles of the map based on the map 2D array\r\n TODO -> create a separate function, so that we can create multiple different maps that use\r\n the same function\r\n */\r\n for(var x = 0; x < this.cols; x++)\r\n {\r\n var row = [];\r\n for(var y = 0; y < this.rows; y++)\r\n {\r\n var newTile = new Tile(x * 30, y * 30);\r\n if(map[y][x] == 0)\r\n newTile.placable = false;\r\n\r\n row.push(newTile);\r\n }\r\n this.canvas.push(row);\r\n }\r\n }", "function getABMarkers(){\n try{\n top4 = []\n let city1 = document.querySelector('#ab_city1').innerText\n top4.push(city1)\n let city2 = document.querySelector('#ab_city2').innerText\n top4.push(city2)\n let city3 = document.querySelector('#ab_city3').innerText\n top4.push(city3)\n let city4 = document.querySelector('#ab_city4').innerText\n top4.push(city4)\n //console.log(top4)\n let prov = 'ab'\n initMap(top4, prov)\n }catch{\n window.alert(\"Sorry, something has gone horribly wrong\")\n }\n }", "function mapCodeInfo(mapcode) {\n var head = mapcode.split(':')[0];\n var body = mapcode.split(':')[1];\n\n var head = head.split('.');\n var dims = head[0].split('x');\n var m = parseInt(dims[0]);\n var n = parseInt(dims[1]);\n if (head[1][0] != 'c') {console.log('head[1][0] was ' + head[1][0] + ' expected c');}\n if (head[2][0] != 'r') {console.log('head[2][0] was ' + head[2][0] + ' expected r');}\n if (head[3][0] != 'w') {console.log('head[3][0] was ' + head[3][0] + ' expected w');}\n var walls = parseInt(head[3].slice(1));\n if (head[4][0] != 't') {console.log('head[4][0] was ' + head[4][0] + ' expected t');}\n var name = head[5];\n\n // Figure out name\n if (name == '') {\n if (m == 13 && n == 7) {\n name = 'Simple';\n } else if (m == 15 && n == 9) {\n name = 'Normal';\n } else if (m == 19 && n == 9) {\n name = 'Complex';\n } else {\n console.log(\"can't figure out name of map\");\n }\n }\n\n // Result\n var result = {};\n result.mapType = name;\n result.walls = walls;\n\n var body_split = body.split('.').slice(0, -1);\n for (var k = 0; k < body_split.length; k++) {\n var item = body_split[k];\n var type = item[item.length - 1];\n resultIncr(result, type);\n }\n\n // Count number of checkpoints/TPs\n var cps = 0;\n for (var i = 0; i < 5; i++) {\n if (result[tiles.CHECKPOINTS[i]]) {\n cps += 1;\n }\n }\n result.cps = cps;\n\n var tps = 0;\n for (var i = 0; i < 5; i++) {\n if (result[tiles.TELE_INS[i]]) {\n tps += 1;\n }\n }\n result.tps = tps;\n\n\n return result;\n}", "function createInfoData(i)\n{\n var content = \"\";\n content = \"<font face='Tahoma'><small>\" +\n \"<b><a href=\\\"javascript:openWindow('../displaymap.html?zoom=11&latitude=\" + pointarray[i].latitude + \"&longitude=\" + pointarray[i].longitude + \"&end', '\" + pointarray[i].text + \"', 640, 480);\\\">\" +\n pointarray[i].text + \n \"</a></b><br>\" +\n pointarray[i].latstr + \"<br>\" +\n pointarray[i].lngstr + \"</small></font>\";\n//GLog.write(\"Content:\" + content);\n return content;\n}", "function downloadMap(){\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n ctx.fillStyle = \"black\";\r\n ctx.fillRect(0, 0, 1000, 1000);\r\n ctx.fillStyle = \"green\";\r\n ctx.font = \"50px Arial\";\r\n\r\n ctx.fillText(\"Creating map... Please wait...\",50,300);\r\n //download map to display\r\n\r\n //1. fill x and y array\r\n //2. fill map array with xy value as place holders (mainly to get correct array size)\r\n //3. call scale map\r\n //4. fill coordOG array\r\n //5. call scale coord\r\n\r\n}", "function generateMap() {\n for (let x = 0; x < mapSize; x++) {\n map.push([]);\n for (let y = 0; y < mapSize; y++) {\n map[x].push(new Tile(x, y));\n }\n }\n\n generateOutline();\n}", "function arrayBuild(){\n\t/*\n\t * evtl moechte man in einer spaeteren Version manuell ein Array definieren, welches eine groessere Map\n\t * beherbergen kann als das canvas, deswegen gibt es diese beiden Variablen, welche in erster Version\n\t * lediglich mit der Dimension des Standard Arrays belegt werden.\n\t */\n\tvar arrayColumns;\n\tvar arrayRows;\n\n\n\t// In diesem Block finden die Berechnungen statt, welche die Dimension des Spielfeldes berechnen sollen.\n\t// In der ersten Version des SPiels soll sich das Spielfeld aus der Größe des Canvas ableiten.\n\t// In spaeteren Versionen soll das Spielfeld auch groesser gewählt werden können.\n\t{\n\t\t// Die Dimension des Arrays leitet sich aus der Anzahl der Hexatiles in einer Zeile und der Anzahl der Hexatiles in\n\t\t// einer Spalte ab.\n\t\tarrayDimensionLine = cellsInLine + (Math.round(cellsInColumn / 2) - 1);\n\t\tarrayDimensionColumn = arrayDimensionLine;\n\t\t// Bei dieser Berechnungsart ist die Matrix quadratisch und deswegen gibt es genausoviele Spalten wie Zeilen\n\t\tarrayRows = arrayDimensionLine;\n\t\tarrayColumns = arrayDimensionColumn;\n\t}\n\n\t// An dieser Stelle wird das Spielfeld als ein Array mit der berechneten Größe definiert\n\tgameField = new Array(arrayRows);\n\t// Die Anzahl der existierenden Minen zurücksetzen\n\texsistingMines = 0;\n\t// Dann wird jedes Feld des Arrays durchlaufen\n\tfor(var i = 0; i < arrayRows; i++ ){\n\t\t// und ebenfalls als Array der berechneten Größe definiert\n\t\tgameField[i] = new Array(arrayColumns);\n\t\t// Anschließend werden also alle Spalten der eben erzeugten Zeile durchlaufen \n\t\tfor(var j = 0; j < arrayColumns; j++){\n\t\t\t// Und geprüft, ob die entsprechenden Zelle mit einem Hexatile versehen werden muss.\n\t\t\tif(hexatileOnMap(i,j)) {\n\t\t\t\t// Wenn ja, dann wird ein Hexatile an der entsprechenden Zelle erzeugt und mit \n\t\t\t\t// Koordinaten versehen, welche sich von den Original Koordinaten unterscheiden,\n\t\t\t\t// jedoch notwendig sind, damit dich die hexatiles resourcenschonend selbst \n\t\t\t\t// zeichnen und verwalten können.\n\t\t\t\tgameField[i][j] = new Hexatile(i - (cellsInLine - 1),j);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t{// Die Mienen erzeugen\n\t\t// berechnen, wieviele Mienen erzeugt werden müssen\n\t\tminesToGo = ((cellsInLine * cellsInColumn) * difficulty) / 100;\n\t\t\n\t\t// solange noch Mienen erzeugt werden müssen..\n\t\twhile (minesToGo > 0) {\n\t\t\t// ...zufällig eine Zeile ermitteln,...\n\t\t\tline = Math.round(Math.random() * (arrayRows));\n\t\t\t// ...zufällig eine Spalte ermitteln...\n\t\t\tcolumn = Math.round(Math.random() * (arrayColumns));\n\t\t\t\n\t\t\t// ...und prüfen, ob die so ermittelte Zelle auf dem Spielfeld liegt und noch keine Miene ist.\n\t\t\tif (hexatileOnMap(line, column) && !gameField[line][column].isMine) {\n\t\t\t\t// Die Zelle zu einer Miene machen\n\t\t\t\tgameField[line][column].isMine = true;\n\t\t\t\t// Die Anzahl der zu produzierenden Mienen herunterzählen\n\t\t\t\tminesToGo--;\n\t\t\t\t// Die Anzahl der exsistierenden Mienen hochzählen\n\t\t\t\texsistingMines++;\n\t\t\t}\n\t\t}\n\t}\n\n}", "function createOutput() {\n //Create mapshapes\n var mapshape=\"{{Mapframe|width=500|height=500|group=map1}}\\r\\n\";\n var titles = document.getElementsByClassName(\"dname\");\n //console.log(titles);\n //console.log(wikidataIds.length)\n var wikidataId;\n var fill;\n var title;\n\n for (var i = 0; i < wikidataIds.length; i++) {\n if (wikidataIds[i].length !=0) {\n wikidataId=wikidataIds[i];\n fill = \"{{StdColor|T\"+(i+1)+\"}}\"; //Use StdColor syntax of Wikivoyage\n //fill = stdColors[i];\n title = titles[i].value;\n\n mapshape += \"{{Mapshape|type=geoshape|wikidata=\" + wikidataId + \"|group=map1|fill=\" + fill + \"|title=\" + title + \"}}\\r\\n\";\n }\n }\n document.getElementById(\"textareabox\").innerHTML = mapshape;\n}", "function mapCreator(ySize, xSize) {\n mapArrays = [];\n\tfor(var idx = 0; idx < ySize; idx++) {\n \tmapArrays[idx] = [];\n \tfor(var idx2 = 0; idx2 < xSize; idx2++) {\n \t// Locations could be pushed here.\n var tempLocation = new Location(idx, idx2);\n \tmapArrays[idx].push(tempLocation);\n }\n }\n}", "function doMap() {\n const nameEmailArray = people.results.map((person) => {\n return {\n name: person.name,\n email: person.email,\n };\n });\n console.log(nameEmailArray);\n return nameEmailArray;\n}", "get mapOut() {\n\t return _objectSpread({}, this.props.mapOut, {\n\t [this.rootKey]: internalMapOut\n\t });\n\t }", "function map(x, y) {\n var map = [];\n for(i = 0; i <= size; i++) {\n if(i <= size) {\n return 'X';\n }\n }\n}", "function Map() {}", "function parseMap(map) {\r\n\tvar dataMap = [];\r\n\tlog(0, 'New map parsed');\r\n\tfor (var i = 0; i < map.length; i++) {\r\n\t\tdataMap.push([]);\r\n\t\tfor (var i2 = 0; i2 < map[i].length; i2++) {\r\n\t\t\tvar type = map[i][i2];\r\n\t\t\tvar obj = {\r\n\t\t\t\ttype: type,\r\n\t\t\t\tx: i2,\r\n\t\t\t\ty: i,\r\n\t\t\t\tcanHaveGun: type == 'g',\r\n\t\t\t\tcanHaveItem: type == 'i',\r\n\t\t\t\tcanSpawnOn: type == 's',\r\n\t\t\t\tgun: undefined,\r\n\t\t\t\titem: undefined,\r\n\t\t\t\thp: settings.blockHP\r\n\t\t\t};\r\n\t\t\tdataMap[i].push(obj);\r\n\t\t}\r\n\t}\r\n\treturn dataMap;\r\n}", "function newMap() {\n\t\t'use strict';\n\n\t\t// resulting map\n\t\tvar map = [];\n\n\t\t// number of rows and columns\n\t\tgameMetrics.x = 16;\n\t\tgameMetrics.y = Math.floor(gameMetrics.x / Config.boardRatio);\n\n\t\t// populate map with -1\n\t\tfor (var i = 0; i < gameMetrics.y; i++) {\n\t\t\tvar row = [];\n\t\t\tfor (var j = 0; j < gameMetrics.x; j++) {\n\t\t\t\trow.push(-1);\n\t\t\t}\n\t\t\tmap.push(row);\n\t\t}\n\t\treturn map;\n\n\t}", "function mapArray(){\n \n var lines = mapData.split(\"\\n\");\n $.each(lines, function(n, elem) {\n var cityname = elem.slice(0, elem.indexOf(\" \"));\n north = \"\";\n south = \"\";\n east =\"\";\n west = \"\";\n var val = elem.split(' ');\n $.each(val, function(d, dat) {\n Temp = dat;\n GetDir();\n });\n if(cityname != \"\"){\n Citys.push({\n CityName: cityname,\n North: north,\n South: south,\n East: east,\n West: west,\n Monsters: \"\",\n });\n }\n });\n GetMonsters();\n}", "function renderMap(map){\n\tfor (var r = 0; r <= map.tiles.length; r++) {\n if (map.tiles[r] !== undefined) {\n for (var b = 0; b <= map.tiles[r].length; b++) {\n if (map.tiles[r][b] !== undefined) {\n map.tiles[r][b].image.x = r * map.tileSize;\n map.tiles[r][b].image.y = b * map.tileSize;\n map.container.addChild(map.tiles[r][b].image);\n }\n }\n }\n }\n}", "function answer_map(ans_arr, opt_arr){\n var _res = '';\n for(var r = 0 ; r< ans_arr.length ;r++){\n if(opt_arr[ans_arr[r]])\n _res += opt_arr[ans_arr[r]];\n }\n return _res;\n}", "function myMap(arr, callback){\n var mapArr = [];\n for (var i=0; i<arr.length; i++){\n var data = callback(arr[i]);\n mapArr.push(data);\n }\n return mapArr;\n}", "function MapDisplay() {\n //setup map dims from html form\n let mapHeight = document.getElementById('height').value;\n let mapWidth = document.getElementById('width').value;\n\n var mapArray = FullMap(mapHeight, mapWidth);\n\n const mapTable = document.getElementById(\"mapTable\");\n \n //clears old map, if it exists\n while(mapTable.firstChild) {\n mapTable.removeChild(mapTable.firstChild);\n }\n \n //draw the map out\n for (let i = 0; i < mapArray.length; i++ ) {\n var newRow = mapTable.insertRow(i);\n newRow.setAttribute(\"id\", \"mapRow\");\n\n for (let j = 0; j < mapArray[i].length; j++) {\n var newCell = newRow.insertCell(j);\n if (mapArray[i][j].cellValue == 1) {\n newCell.setAttribute(\"id\", \"mapCellWall\");\n }\n else {\n newCell.setAttribute(\"id\", \"mapCellSpace\");\n }\n }\n }\n}", "function _b(){this.__data__={array:[],map:null}}", "formatBoard() {\n\t\treturn map2DArray(this.props.boardState.boardArray, boardCellData)\n\t}", "function buildMap() {\n\t// https://maps.google.com/maps?q=225+delaware+avenue,+Buffalo,+NY&hl=en&sll=42.746632,-75.770041&sspn=5.977525,8.591309&t=h&hnear=225+Delaware+Ave,+Buffalo,+Erie,+New+York+14202&z=16\n\t// API key console\n\t// https://code.google.com/apis/console\n\t// BfloFRED API Key : key=AIzaSyBMSezbmos0W2n6BQutkFvNjkF5NTPd0-Q\n\n\tif (sw > bp) {\n\t\t// If map doesn't already exist\n\t\tif ($('.map-container').length < 1) {\n\t\t\tbuildEmbed();\n\t\t}\n\t} else {\n\t\t// If static image doesn't exist\n\t\tif ($('.static-map-img').length < 1) {\n\t\t\tbuildStatic();\n\t\t}\n\t}\n}", "function makeMap(data) {\r\n var mapData = {};\r\n // Link mobile phone dataset with countrycodes and categorize the mobile phone dataset\r\n for (i = 0; i < data.length; i++){\r\n var object = data[i];\r\n\r\n\r\n for (j = 0; j < countryCodes.length; j++){\r\n // [\"...\"] to be able to walk over strings\r\n if (object[\"Mobile cellular subscriptions (per 100 people)\"] == countryCodes[j][2]){\r\n object.countryCodes = countryCodes[j][1]\r\n }\r\n }\r\n\r\n // Within the Countrycode object, create a fillkey and add the countryname and # of cellphones\r\n // No Data (to append to Json, source: http://stackoverflow.com/questions/736590/add-new-attribute-element-to-json-object-using-javascript)\r\n if (object[\"2011\"] == null){\r\n mapData[object.countryCodes] = {fillKey: \"noData\",\r\n name: object[\"Mobile cellular subscriptions (per 100 people)\"],\r\n cellphones: object[\"2011\"]}\r\n }\r\n\r\n // 0-33 phones per 100 people ()\r\n if (0 < object[\"2011\"] && object[\"2011\"] <= 33){\r\n mapData[object.countryCodes] = {fillKey: \"phones0To33\",\r\n name: object[\"Mobile cellular subscriptions (per 100 people)\"],\r\n cellphones: object[\"2011\"]}\r\n } \r\n\r\n // 34-66 Phones per 100 people\r\n if (34 <= object[\"2011\"] && object[\"2011\"] <= 66){\r\n mapData[object.countryCodes] = {fillKey: \"phones34To66\",\r\n name: object[\"Mobile cellular subscriptions (per 100 people)\"],\r\n cellphones: object[\"2011\"]}\r\n }\r\n\r\n // 67-99 phones per 100 people\r\n if (67 <= object[\"2011\"] && object[\"2011\"] <= 100){\r\n mapData[object.countryCodes] = {fillKey: \"phones67To99\",\r\n name: object[\"Mobile cellular subscriptions (per 100 people)\"],\r\n cellphones: object[\"2011\"]}\r\n }\r\n\r\n // 100 - 133 phones per 100 people\r\n if (100 <= object[\"2011\"] && object[\"2011\"] <= 133){\r\n mapData[object.countryCodes] = {fillKey: \"phones100To133\",\r\n name: object[\"Mobile cellular subscriptions (per 100 people)\"],\r\n cellphones: object[\"2011\"]}\r\n }\r\n\r\n // 134+ phones per 100 people\r\n if (134 <= object[\"2011\"]){\r\n mapData[object.countryCodes] = {fillKey: \"phones134AndMore\",\r\n name: object[\"Mobile cellular subscriptions (per 100 people)\"],\r\n cellphones: object[\"2011\"]}\r\n }\r\n }\r\n \r\n // Creating the map\r\n var map = new Datamap ({\r\n element: document.getElementById('container'),\r\n\r\n // Fill the countries with the right colors (https://www.w3schools.com/colors/colors_hexadecimal.asp)\r\n fills: {\r\n 'noData': \"grey\",\r\n 'phones0To33': \"#33f40c\",\r\n 'phones34To66': \"#20a420\",\r\n 'phones67To99': \"#207b20\",\r\n 'phones100To133': \"#205b20\",\r\n 'phones134AndMore': \"#203020\",\r\n defaultFill: \"grey\" \r\n },\r\n // Input data\r\n data: mapData,\r\n // Styling\r\n geographyConfig: {\r\n borderColor: 'black',\r\n highlightBorderColor: 'white',\r\n highlightOnHover: true,\r\n highlightFillColor: false,\r\n popupTemplate: function(geography, mapData) {\r\n return '<div class=\"hoverinfo\">' + 'Number of cellphones: '\r\n + mapData.cellphones + '<br> Country name: ' + mapData.name \r\n }\r\n }\r\n\r\n });\r\n\r\n // Creating a legend \r\n map.legend({\r\n legendTitle: \"# Phones per 100 people\",\r\n labels: {\r\n noData: \"No data in dataset\",\r\n phones0To33: \"0-33\",\r\n phones34To66: \"34-66\",\r\n phones67To99: \"67-99\",\r\n phones100To133: \"100-133\",\r\n phones134AndMore: \"134+\"\r\n }\r\n });\r\n}", "generateMap(num) {\n return [...Array(num + 2).keys()].map(i => Array(num + 2).fill(\"W\"));\n }", "function map(o) {\n return format(o, true);\n}", "function mapArray(rows, columns) {\r\n // create a multidimensional array \r\n var map = new Array(parseInt(rows)); // determine rows for map\r\n for(var i = 0; i < map.length; i++)\r\n map[i] = new Array(parseInt(columns)); // determine columns\r\n // Initialize the array\r\n for(var countRow = 0; countRow < map.length; countRow++) {\r\n for(var countCol = 0; countCol < map[countRow].length; countCol++) { \r\n var mazeCell = {\r\n exit: false\r\n , entrance: false\r\n , borderTop: true\r\n , borderBottom: true \r\n , borderRight: true\r\n , borderLeft: true\r\n , djSteps: 0\r\n , onPath: false \r\n , visited: false\r\n , column: 0\r\n , row: 0\r\n } \r\n map[countRow][countCol] = mazeCell;\r\n }\r\n }\r\n \r\n\r\n return AldousBroderArray(map);\r\n}", "function genHeatMapData() {\n\tlistOfLat = filteredData.LAT\n\tlistOfLong = filteredData.LONG\n\t//console.log(listOfLat)\n\tmapData = []\n\tfor ( var key in listOfLat) {\n\t\tif (listOfLat.hasOwnProperty(key) && listOfLong.hasOwnProperty(key)) {\n\t\t\tmapData.push(loc2GoogleLoc(listOfLat[key], listOfLong[key]))\n\t\t} else {\n\t\t\tconsole.log(\"Invalid Data\")\n\t\t}\n\n\t}\n\t//mapData.push({location: myLatLng, weight: 150000})\n\n\treturn mapData\n}", "function makeMap(arr, callback) {\n validationFunctions.validateParametersAndThrowError('The function expects 2 parameters: \\n 1. array \\n 2. callback function',\n !Array.isArray(arguments[0]), !validationFunctions.isFunction(arguments[1]));\n\n var resultArr = [];\n\n for (var i = 0; i < arr.length; i++) {\n resultArr.push(callback(arr[i], i, arr));\n }\n\n return resultArr;\n}", "function Map() {\n\t\n}", "function Map() {\n\t\n}", "function populatePageFromArray() {\n // Clear the current cities display\n $(\"#results\").empty();\n destroyMap();\n // Hide map if there are no cities currently\n if (myCities.length === 0) {\n $(\"#my-map\").attr(\"style\", \"display: none\");\n }\n else {\n $(\"#my-map\").attr(\"style\", \"display: auto\");\n }\n // Get current time and weather for all cities and then display info for all cities\n getCurrentTimeAndWeatherForAll(function() {\n myCities.forEach(function(city) {\n displayCityInfo(city);\n });\n });\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.481313870000000E+02, -0.119050638000000E+03),\n new google.maps.LatLng( 0.481308040000000E+02, -0.119051590000000E+03),\n new google.maps.LatLng( 0.481311690000000E+02, -0.119053159000000E+03),\n new google.maps.LatLng( 0.481384690000000E+02, -0.119064397000000E+03),\n new google.maps.LatLng( 0.481384690000000E+02, -0.119064397000000E+03),\n new google.maps.LatLng( 0.481383780000000E+02, -0.119062237000000E+03),\n new google.maps.LatLng( 0.481340360000000E+02, -0.119053767000000E+03),\n new google.maps.LatLng( 0.481313870000000E+02, -0.119050638000000E+03),\n ];\n\n return zipCoords\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.463090570000000E+02, -0.119254227000000E+03),\n new google.maps.LatLng( 0.463152570000000E+02, -0.119255227000000E+03),\n new google.maps.LatLng( 0.463215570000000E+02, -0.119253527000000E+03),\n new google.maps.LatLng( 0.463218570000000E+02, -0.119252627000000E+03),\n new google.maps.LatLng( 0.463212570000000E+02, -0.119251827000000E+03),\n new google.maps.LatLng( 0.463121570000000E+02, -0.119251527000000E+03),\n new google.maps.LatLng( 0.463093570000000E+02, -0.119253227000000E+03),\n new google.maps.LatLng( 0.463090570000000E+02, -0.119254227000000E+03),\n ];\n\n return zipCoords\n}", "buildHumans(array) {\n const _map = {};\n for(let person of array){\n const _key = person.name.split(' ').reverse().join('_').toLowerCase();\n _map[_key] = person;\n }\n return _map;\n }", "render(){\n let coordsArray = [];\n let GoogleMap = (coordsArray) => ( \n <GoogleMapComponent coordsArray={coordsArray} />\n );\n \n let coords = {\n olat:RoutesStore.origin.lat,\n olng:RoutesStore.origin.lng,\n dlat:RoutesStore.destination.lat,\n dlng:RoutesStore.destination.lng\n };\n \n coordsArray.push(coords);\n \n return(\n <GoogleMap coords={coordsArray} />\n ); \n }", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.482327670000000E+02, -0.117126872000000E+03),\n new google.maps.LatLng( 0.482332720000000E+02, -0.117130532000000E+03),\n new google.maps.LatLng( 0.482351490000000E+02, -0.117137269000000E+03),\n new google.maps.LatLng( 0.482383740000000E+02, -0.117143697000000E+03),\n new google.maps.LatLng( 0.482364950000000E+02, -0.117133777000000E+03),\n new google.maps.LatLng( 0.482333380000000E+02, -0.117126803000000E+03),\n new google.maps.LatLng( 0.482327670000000E+02, -0.117126872000000E+03),\n ];\n\n return zipCoords\n}", "function generateMapGraphics(map, val) {\n let barrierStore = [];\n for (let i = 0; i < map.length; i++) {\n for (let j = 0; j < map[i].length; j++) {\n if (map[i][j] === val) {\n barrierStore.push({ x: j, y: i });\n }\n }\n }\n return barrierStore;\n }", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.486654400000000E+02, -0.118063254000000E+03),\n new google.maps.LatLng( 0.486658510000000E+02, -0.118060495000000E+03),\n new google.maps.LatLng( 0.486650060000000E+02, -0.118057149000000E+03),\n new google.maps.LatLng( 0.486645260000000E+02, -0.118057046000000E+03),\n new google.maps.LatLng( 0.486624680000000E+02, -0.118068359000000E+03),\n new google.maps.LatLng( 0.486632600000000E+02, -0.118070864000000E+03),\n new google.maps.LatLng( 0.486641590000000E+02, -0.118070499000000E+03),\n new google.maps.LatLng( 0.486654400000000E+02, -0.118063254000000E+03),\n ];\n\n return zipCoords\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.466443960000000E+02, -0.119415740000000E+03),\n new google.maps.LatLng( 0.466459730000000E+02, -0.119418427000000E+03),\n new google.maps.LatLng( 0.466530110000000E+02, -0.119423469000000E+03),\n new google.maps.LatLng( 0.466538560000000E+02, -0.119423302000000E+03),\n new google.maps.LatLng( 0.466551360000000E+02, -0.119421743000000E+03),\n new google.maps.LatLng( 0.466544500000000E+02, -0.119418955000000E+03),\n new google.maps.LatLng( 0.466521420000000E+02, -0.119416865000000E+03),\n new google.maps.LatLng( 0.466471150000000E+02, -0.119414843000000E+03),\n new google.maps.LatLng( 0.466458120000000E+02, -0.119414910000000E+03),\n new google.maps.LatLng( 0.466443960000000E+02, -0.119415740000000E+03),\n ];\n\n return zipCoords\n}", "function makeStrings(arr){\r\n return arr.map(matrix => {\r\n if (matrix.age > 17){\r\n return matrix.name + \" can go to The Matrix\"\r\n } else {\r\n return matrix.name + \" is under age!!\"\r\n }\r\n })\r\n }", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.466351870000000E+02, -0.119412924000000E+03),\n new google.maps.LatLng( 0.466358500000000E+02, -0.119413786000000E+03),\n new google.maps.LatLng( 0.466401000000000E+02, -0.119414116000000E+03),\n new google.maps.LatLng( 0.466463150000000E+02, -0.119413782000000E+03),\n new google.maps.LatLng( 0.466466350000000E+02, -0.119413350000000E+03),\n new google.maps.LatLng( 0.466459950000000E+02, -0.119411957000000E+03),\n new google.maps.LatLng( 0.466395510000000E+02, -0.119410866000000E+03),\n new google.maps.LatLng( 0.466365120000000E+02, -0.119410801000000E+03),\n new google.maps.LatLng( 0.466351870000000E+02, -0.119412924000000E+03),\n ];\n\n return zipCoords\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.487776893511001E+02, -0.122573203357158E+03),\n new google.maps.LatLng( 0.487775879934002E+02, -0.122573589999958E+03),\n new google.maps.LatLng( 0.487775879934002E+02, -0.122573589999958E+03),\n new google.maps.LatLng( 0.487796850000000E+02, -0.122577236000000E+03),\n new google.maps.LatLng( 0.487796850000000E+02, -0.122577236000000E+03),\n new google.maps.LatLng( 0.487800750000000E+02, -0.122575206000000E+03),\n new google.maps.LatLng( 0.487798150000000E+02, -0.122574260000000E+03),\n new google.maps.LatLng( 0.487776893511001E+02, -0.122573203357158E+03),\n ];\n\n return zipCoords\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.479419050000000E+02, -0.117718257000000E+03),\n new google.maps.LatLng( 0.479388200000000E+02, -0.117717745000000E+03),\n new google.maps.LatLng( 0.479315760000000E+02, -0.117718523000000E+03),\n new google.maps.LatLng( 0.479272800000000E+02, -0.117716785000000E+03),\n new google.maps.LatLng( 0.479230520000000E+02, -0.117715797000000E+03),\n new google.maps.LatLng( 0.479213380000000E+02, -0.117716680000000E+03),\n new google.maps.LatLng( 0.479204690000000E+02, -0.117718583000000E+03),\n new google.maps.LatLng( 0.479205360000000E+02, -0.117726029000000E+03),\n new google.maps.LatLng( 0.479211520000000E+02, -0.117728987000000E+03),\n new google.maps.LatLng( 0.479174270000000E+02, -0.117728609000000E+03),\n new google.maps.LatLng( 0.479152120000000E+02, -0.117724801000000E+03),\n new google.maps.LatLng( 0.479134520000000E+02, -0.117723202000000E+03),\n new google.maps.LatLng( 0.479110070000000E+02, -0.117722690000000E+03),\n new google.maps.LatLng( 0.479089500000000E+02, -0.117724422000000E+03),\n new google.maps.LatLng( 0.479034390000000E+02, -0.117732337000000E+03),\n new google.maps.LatLng( 0.479009960000000E+02, -0.117726796000000E+03),\n new google.maps.LatLng( 0.478983910000000E+02, -0.117724381000000E+03),\n new google.maps.LatLng( 0.478976830000000E+02, -0.117724380000000E+03),\n new google.maps.LatLng( 0.478966310000000E+02, -0.117724923000000E+03),\n new google.maps.LatLng( 0.478929960000000E+02, -0.117730323000000E+03),\n new google.maps.LatLng( 0.478905960000000E+02, -0.117732496000000E+03),\n new google.maps.LatLng( 0.478866420000000E+02, -0.117733546000000E+03),\n new google.maps.LatLng( 0.478855470000000E+02, -0.117727055000000E+03),\n new google.maps.LatLng( 0.478829450000000E+02, -0.117718696000000E+03),\n new google.maps.LatLng( 0.478807970000000E+02, -0.117716860000000E+03),\n new google.maps.LatLng( 0.478771180000000E+02, -0.117715364000000E+03),\n new google.maps.LatLng( 0.478753850000000E+02, -0.117710844000000E+03),\n new google.maps.LatLng( 0.478753400000000E+02, -0.117708704000000E+03),\n new google.maps.LatLng( 0.478765250000000E+02, -0.117708705000000E+03),\n new google.maps.LatLng( 0.478798620000000E+02, -0.117706362000000E+03),\n new google.maps.LatLng( 0.478789350000000E+02, -0.117702547000000E+03),\n new google.maps.LatLng( 0.478789350000000E+02, -0.117702547000000E+03),\n new google.maps.LatLng( 0.478763860000000E+02, -0.117701401000000E+03),\n new google.maps.LatLng( 0.478763860000000E+02, -0.117701401000000E+03),\n new google.maps.LatLng( 0.478738570000000E+02, -0.117701097000000E+03),\n new google.maps.LatLng( 0.478726230000000E+02, -0.117701403000000E+03),\n new google.maps.LatLng( 0.478643040000000E+02, -0.117705543000000E+03),\n new google.maps.LatLng( 0.478634580000000E+02, -0.117704490000000E+03),\n new google.maps.LatLng( 0.478622700000000E+02, -0.117704252000000E+03),\n new google.maps.LatLng( 0.478557110000000E+02, -0.117706559000000E+03),\n new google.maps.LatLng( 0.478528540000000E+02, -0.117708391000000E+03),\n new google.maps.LatLng( 0.478490360000000E+02, -0.117713245000000E+03),\n new google.maps.LatLng( 0.478472070000000E+02, -0.117716401000000E+03),\n new google.maps.LatLng( 0.478405290000000E+02, -0.117732962000000E+03),\n new google.maps.LatLng( 0.478352220000000E+02, -0.117741781000000E+03),\n new google.maps.LatLng( 0.478333920000000E+02, -0.117746633000000E+03),\n new google.maps.LatLng( 0.478346940000000E+02, -0.117753863000000E+03),\n new google.maps.LatLng( 0.478345590000000E+02, -0.117758039000000E+03),\n new google.maps.LatLng( 0.478338620000000E+02, -0.117761019000000E+03),\n new google.maps.LatLng( 0.478338620000000E+02, -0.117761019000000E+03),\n new google.maps.LatLng( 0.478346970000000E+02, -0.117759498000000E+03),\n new google.maps.LatLng( 0.478422170000000E+02, -0.117762172000000E+03),\n new google.maps.LatLng( 0.478457150000000E+02, -0.117765768000000E+03),\n new google.maps.LatLng( 0.478485980000000E+02, -0.117774694000000E+03),\n new google.maps.LatLng( 0.478527350000000E+02, -0.117780124000000E+03),\n new google.maps.LatLng( 0.478601860000000E+02, -0.117783583000000E+03),\n new google.maps.LatLng( 0.478678440000000E+02, -0.117791255000000E+03),\n new google.maps.LatLng( 0.478752700000000E+02, -0.117788771000000E+03),\n new google.maps.LatLng( 0.478752700000000E+02, -0.117785918000000E+03),\n new google.maps.LatLng( 0.478756780000000E+02, -0.117784967000000E+03),\n new google.maps.LatLng( 0.478775050000000E+02, -0.117781229000000E+03),\n new google.maps.LatLng( 0.478793100000000E+02, -0.117779394000000E+03),\n new google.maps.LatLng( 0.478886100000000E+02, -0.117777587000000E+03),\n new google.maps.LatLng( 0.478999210000000E+02, -0.117771836000000E+03),\n new google.maps.LatLng( 0.479071860000000E+02, -0.117766494000000E+03),\n new google.maps.LatLng( 0.479111420000000E+02, -0.117771827000000E+03),\n new google.maps.LatLng( 0.479142260000000E+02, -0.117771519000000E+03),\n new google.maps.LatLng( 0.479190950000000E+02, -0.117773148000000E+03),\n new google.maps.LatLng( 0.479190950000000E+02, -0.117773148000000E+03),\n new google.maps.LatLng( 0.479222230000000E+02, -0.117767535000000E+03),\n new google.maps.LatLng( 0.479210100000000E+02, -0.117761417000000E+03),\n new google.maps.LatLng( 0.479240020000000E+02, -0.117759204000000E+03),\n new google.maps.LatLng( 0.479250970000000E+02, -0.117755293000000E+03),\n new google.maps.LatLng( 0.479255750000000E+02, -0.117750275000000E+03),\n new google.maps.LatLng( 0.479268580000000E+02, -0.117744734000000E+03),\n new google.maps.LatLng( 0.479290310000000E+02, -0.117740656000000E+03),\n new google.maps.LatLng( 0.479298080000000E+02, -0.117741065000000E+03),\n new google.maps.LatLng( 0.479309040000000E+02, -0.117742732000000E+03),\n new google.maps.LatLng( 0.479362520000000E+02, -0.117742433000000E+03),\n new google.maps.LatLng( 0.479394970000000E+02, -0.117741042000000E+03),\n new google.maps.LatLng( 0.479390640000000E+02, -0.117739579000000E+03),\n new google.maps.LatLng( 0.479376700000000E+02, -0.117738864000000E+03),\n new google.maps.LatLng( 0.479363900000000E+02, -0.117739202000000E+03),\n new google.maps.LatLng( 0.479360930000000E+02, -0.117738793000000E+03),\n new google.maps.LatLng( 0.479355450000000E+02, -0.117737534000000E+03),\n new google.maps.LatLng( 0.479368260000000E+02, -0.117736447000000E+03),\n new google.maps.LatLng( 0.479432970000000E+02, -0.117734788000000E+03),\n new google.maps.LatLng( 0.479454640000000E+02, -0.117735674000000E+03),\n new google.maps.LatLng( 0.479461500000000E+02, -0.117735403000000E+03),\n new google.maps.LatLng( 0.479466770000000E+02, -0.117731866000000E+03),\n new google.maps.LatLng( 0.479452850000000E+02, -0.117725469000000E+03),\n new google.maps.LatLng( 0.479433900000000E+02, -0.117720536000000E+03),\n new google.maps.LatLng( 0.479419050000000E+02, -0.117718257000000E+03),\n ];\n\n return zipCoords\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.490003632277298E+02, -0.117429502617754E+03),\n new google.maps.LatLng( 0.490001609301037E+02, -0.117354524042634E+03),\n new google.maps.LatLng( 0.490001609301037E+02, -0.117354524042634E+03),\n new google.maps.LatLng( 0.489983050000000E+02, -0.117353026000000E+03),\n new google.maps.LatLng( 0.489881370000000E+02, -0.117349928000000E+03),\n new google.maps.LatLng( 0.489796830000000E+02, -0.117349297000000E+03),\n new google.maps.LatLng( 0.489734670000000E+02, -0.117351791000000E+03),\n new google.maps.LatLng( 0.489708840000000E+02, -0.117355016000000E+03),\n new google.maps.LatLng( 0.489708840000000E+02, -0.117355016000000E+03),\n new google.maps.LatLng( 0.489677300000000E+02, -0.117358206000000E+03),\n new google.maps.LatLng( 0.489661730000000E+02, -0.117364487000000E+03),\n new google.maps.LatLng( 0.489637610000000E+02, -0.117367258000000E+03),\n new google.maps.LatLng( 0.489622880000000E+02, -0.117364690000000E+03),\n new google.maps.LatLng( 0.489610320000000E+02, -0.117363960000000E+03),\n new google.maps.LatLng( 0.489507740000000E+02, -0.117360099000000E+03),\n new google.maps.LatLng( 0.489488790000000E+02, -0.117358536000000E+03),\n new google.maps.LatLng( 0.489484910000000E+02, -0.117357218000000E+03),\n new google.maps.LatLng( 0.489445380000000E+02, -0.117356174000000E+03),\n new google.maps.LatLng( 0.489359240000000E+02, -0.117355334000000E+03),\n new google.maps.LatLng( 0.489323540000000E+02, -0.117367017000000E+03),\n new google.maps.LatLng( 0.489307560000000E+02, -0.117364554000000E+03),\n new google.maps.LatLng( 0.489304600000000E+02, -0.117361294000000E+03),\n new google.maps.LatLng( 0.489281080000000E+02, -0.117358587000000E+03),\n new google.maps.LatLng( 0.489229440000000E+02, -0.117357438000000E+03),\n new google.maps.LatLng( 0.489195390000000E+02, -0.117360208000000E+03),\n new google.maps.LatLng( 0.489171170000000E+02, -0.117360553000000E+03),\n new google.maps.LatLng( 0.489134160000000E+02, -0.117358851000000E+03),\n new google.maps.LatLng( 0.489037490000000E+02, -0.117359605000000E+03),\n new google.maps.LatLng( 0.489015090000000E+02, -0.117363311000000E+03),\n new google.maps.LatLng( 0.489011610000000E+02, -0.117373049000000E+03),\n new google.maps.LatLng( 0.488983750000000E+02, -0.117380843000000E+03),\n new google.maps.LatLng( 0.488946260000000E+02, -0.117380570000000E+03),\n new google.maps.LatLng( 0.488903540000000E+02, -0.117382168000000E+03),\n new google.maps.LatLng( 0.488869740000000E+02, -0.117384390000000E+03),\n new google.maps.LatLng( 0.488837290000000E+02, -0.117384116000000E+03),\n new google.maps.LatLng( 0.488749200000000E+02, -0.117385962000000E+03),\n new google.maps.LatLng( 0.488733910000000E+02, -0.117386774000000E+03),\n new google.maps.LatLng( 0.488739620000000E+02, -0.117387377000000E+03),\n new google.maps.LatLng( 0.488722880000000E+02, -0.117392956000000E+03),\n new google.maps.LatLng( 0.488686160000000E+02, -0.117400065000000E+03),\n new google.maps.LatLng( 0.488651220000000E+02, -0.117405263000000E+03),\n new google.maps.LatLng( 0.488505000000000E+02, -0.117418359000000E+03),\n new google.maps.LatLng( 0.488455880000000E+02, -0.117420888000000E+03),\n new google.maps.LatLng( 0.488387910000000E+02, -0.117425258000000E+03),\n new google.maps.LatLng( 0.488338890000000E+02, -0.117431449000000E+03),\n new google.maps.LatLng( 0.488326280000000E+02, -0.117438307000000E+03),\n new google.maps.LatLng( 0.488326280000000E+02, -0.117438307000000E+03),\n new google.maps.LatLng( 0.488292740000000E+02, -0.117437714000000E+03),\n new google.maps.LatLng( 0.488260070000000E+02, -0.117438025000000E+03),\n new google.maps.LatLng( 0.488172310000000E+02, -0.117441312000000E+03),\n new google.maps.LatLng( 0.488106050000000E+02, -0.117440378000000E+03),\n new google.maps.LatLng( 0.488083200000000E+02, -0.117442280000000E+03),\n new google.maps.LatLng( 0.488067660000000E+02, -0.117444390000000E+03),\n new google.maps.LatLng( 0.488022420000000E+02, -0.117447088000000E+03),\n new google.maps.LatLng( 0.488014870000000E+02, -0.117446880000000E+03),\n new google.maps.LatLng( 0.488002300000000E+02, -0.117447398000000E+03),\n new google.maps.LatLng( 0.487975340000000E+02, -0.117450234000000E+03),\n new google.maps.LatLng( 0.487930540000000E+02, -0.117455766000000E+03),\n new google.maps.LatLng( 0.487914310000000E+02, -0.117460192000000E+03),\n new google.maps.LatLng( 0.487946990000000E+02, -0.117461680000000E+03),\n new google.maps.LatLng( 0.487951100000000E+02, -0.117462822000000E+03),\n new google.maps.LatLng( 0.487898490000000E+02, -0.117477378000000E+03),\n new google.maps.LatLng( 0.487871740000000E+02, -0.117481526000000E+03),\n new google.maps.LatLng( 0.487814090000000E+02, -0.117495385000000E+03),\n new google.maps.LatLng( 0.487765180000000E+02, -0.117497523000000E+03),\n new google.maps.LatLng( 0.487746910000000E+02, -0.117496760000000E+03),\n new google.maps.LatLng( 0.487728870000000E+02, -0.117494891000000E+03),\n new google.maps.LatLng( 0.487717690000000E+02, -0.117491641000000E+03),\n new google.maps.LatLng( 0.487719520000000E+02, -0.117489809000000E+03),\n new google.maps.LatLng( 0.487707190000000E+02, -0.117487388000000E+03),\n new google.maps.LatLng( 0.487690980000000E+02, -0.117486073000000E+03),\n new google.maps.LatLng( 0.487665620000000E+02, -0.117485103000000E+03),\n new google.maps.LatLng( 0.487630430000000E+02, -0.117484927000000E+03),\n new google.maps.LatLng( 0.487612610000000E+02, -0.117484268000000E+03),\n new google.maps.LatLng( 0.487530150000000E+02, -0.117476141000000E+03),\n new google.maps.LatLng( 0.487512800000000E+02, -0.117471232000000E+03),\n new google.maps.LatLng( 0.487485260000000E+02, -0.117469987000000E+03),\n new google.maps.LatLng( 0.487467210000000E+02, -0.117469848000000E+03),\n new google.maps.LatLng( 0.487389280000000E+02, -0.117474783000000E+03),\n new google.maps.LatLng( 0.487344010000000E+02, -0.117481653000000E+03),\n new google.maps.LatLng( 0.487330730000000E+02, -0.117485313000000E+03),\n new google.maps.LatLng( 0.487323830000000E+02, -0.117496159000000E+03),\n new google.maps.LatLng( 0.487342770000000E+02, -0.117500548000000E+03),\n new google.maps.LatLng( 0.487357430000000E+02, -0.117506896000000E+03),\n new google.maps.LatLng( 0.487333240000000E+02, -0.117514844000000E+03),\n new google.maps.LatLng( 0.487333730000000E+02, -0.117523479000000E+03),\n new google.maps.LatLng( 0.487301990000000E+02, -0.117529768000000E+03),\n new google.maps.LatLng( 0.487296290000000E+02, -0.117537851000000E+03),\n new google.maps.LatLng( 0.487302910000000E+02, -0.117541941000000E+03),\n new google.maps.LatLng( 0.487321660000000E+02, -0.117545097000000E+03),\n new google.maps.LatLng( 0.487327540000000E+02, -0.117551075000000E+03),\n new google.maps.LatLng( 0.487325560000000E+02, -0.117562754000000E+03),\n new google.maps.LatLng( 0.487278680000000E+02, -0.117563453000000E+03),\n new google.maps.LatLng( 0.487287170000000E+02, -0.117567141000000E+03),\n new google.maps.LatLng( 0.487302940000000E+02, -0.117569698000000E+03),\n new google.maps.LatLng( 0.487319520000000E+02, -0.117579102000000E+03),\n new google.maps.LatLng( 0.487316860000000E+02, -0.117580751000000E+03),\n new google.maps.LatLng( 0.487291730000000E+02, -0.117581717000000E+03),\n new google.maps.LatLng( 0.487240320000000E+02, -0.117576673000000E+03),\n new google.maps.LatLng( 0.487233460000000E+02, -0.117579988000000E+03),\n new google.maps.LatLng( 0.487234370000000E+02, -0.117583925000000E+03),\n new google.maps.LatLng( 0.487259240000000E+02, -0.117594702000000E+03),\n new google.maps.LatLng( 0.487237770000000E+02, -0.117593354000000E+03),\n new google.maps.LatLng( 0.487219260000000E+02, -0.117591418000000E+03),\n new google.maps.LatLng( 0.487202820000000E+02, -0.117587480000000E+03),\n new google.maps.LatLng( 0.487154630000000E+02, -0.117578672000000E+03),\n new google.maps.LatLng( 0.487133440000000E+02, -0.117578806000000E+03),\n new google.maps.LatLng( 0.487089280000000E+02, -0.117576495000000E+03),\n new google.maps.LatLng( 0.487084940000000E+02, -0.117576081000000E+03),\n new google.maps.LatLng( 0.487086770000000E+02, -0.117574113000000E+03),\n new google.maps.LatLng( 0.487063010000000E+02, -0.117571282000000E+03),\n new google.maps.LatLng( 0.487048840000000E+02, -0.117572455000000E+03),\n new google.maps.LatLng( 0.487034440000000E+02, -0.117575320000000E+03),\n new google.maps.LatLng( 0.487021870000000E+02, -0.117576390000000E+03),\n new google.maps.LatLng( 0.486970000000000E+02, -0.117577424000000E+03),\n new google.maps.LatLng( 0.486922920000000E+02, -0.117582185000000E+03),\n new google.maps.LatLng( 0.486927720000000E+02, -0.117583083000000E+03),\n new google.maps.LatLng( 0.486937780000000E+02, -0.117583014000000E+03),\n new google.maps.LatLng( 0.486951720000000E+02, -0.117582463000000E+03),\n new google.maps.LatLng( 0.486974340000000E+02, -0.117580185000000E+03),\n new google.maps.LatLng( 0.486984620000000E+02, -0.117579840000000E+03),\n new google.maps.LatLng( 0.486996500000000E+02, -0.117581014000000E+03),\n new google.maps.LatLng( 0.487010200000000E+02, -0.117585675000000E+03),\n new google.maps.LatLng( 0.486970670000000E+02, -0.117587986000000E+03),\n new google.maps.LatLng( 0.486923140000000E+02, -0.117589606000000E+03),\n new google.maps.LatLng( 0.486915140000000E+02, -0.117589640000000E+03),\n new google.maps.LatLng( 0.486901430000000E+02, -0.117588776000000E+03),\n new google.maps.LatLng( 0.486847740000000E+02, -0.117588118000000E+03),\n new google.maps.LatLng( 0.486826720000000E+02, -0.117588634000000E+03),\n new google.maps.LatLng( 0.486818030000000E+02, -0.117588082000000E+03),\n new google.maps.LatLng( 0.486778750000000E+02, -0.117576624000000E+03),\n new google.maps.LatLng( 0.486783550000000E+02, -0.117572691000000E+03),\n new google.maps.LatLng( 0.486789270000000E+02, -0.117571311000000E+03),\n new google.maps.LatLng( 0.486807550000000E+02, -0.117569724000000E+03),\n new google.maps.LatLng( 0.486829490000000E+02, -0.117560751000000E+03),\n new google.maps.LatLng( 0.486828340000000E+02, -0.117556024000000E+03),\n new google.maps.LatLng( 0.486824260000000E+02, -0.117555123000000E+03),\n new google.maps.LatLng( 0.486804800000000E+02, -0.117549537000000E+03),\n new google.maps.LatLng( 0.486806620000000E+02, -0.117546396000000E+03),\n new google.maps.LatLng( 0.486812330000000E+02, -0.117545050000000E+03),\n new google.maps.LatLng( 0.486828330000000E+02, -0.117544015000000E+03),\n new google.maps.LatLng( 0.486836090000000E+02, -0.117540288000000E+03),\n new google.maps.LatLng( 0.486809570000000E+02, -0.117533905000000E+03),\n new google.maps.LatLng( 0.486789910000000E+02, -0.117531283000000E+03),\n new google.maps.LatLng( 0.486771160000000E+02, -0.117527316000000E+03),\n new google.maps.LatLng( 0.486784620000000E+02, -0.117520863000000E+03),\n new google.maps.LatLng( 0.486811130000000E+02, -0.117518342000000E+03),\n new google.maps.LatLng( 0.486806970000000E+02, -0.117508784000000E+03),\n new google.maps.LatLng( 0.486719000000000E+02, -0.117492913000000E+03),\n new google.maps.LatLng( 0.486682030000000E+02, -0.117481179000000E+03),\n new google.maps.LatLng( 0.486679750000000E+02, -0.117480006000000E+03),\n new google.maps.LatLng( 0.486685930000000E+02, -0.117476488000000E+03),\n new google.maps.LatLng( 0.486703530000000E+02, -0.117476558000000E+03),\n new google.maps.LatLng( 0.486697140000000E+02, -0.117472866000000E+03),\n new google.maps.LatLng( 0.486697140000000E+02, -0.117472866000000E+03),\n new google.maps.LatLng( 0.486659500000000E+02, -0.117475711000000E+03),\n new google.maps.LatLng( 0.486585030000000E+02, -0.117475720000000E+03),\n new google.maps.LatLng( 0.486506730000000E+02, -0.117490061000000E+03),\n new google.maps.LatLng( 0.486481580000000E+02, -0.117492093000000E+03),\n new google.maps.LatLng( 0.486473810000000E+02, -0.117493782000000E+03),\n new google.maps.LatLng( 0.486465320000000E+02, -0.117499712000000E+03),\n new google.maps.LatLng( 0.486465320000000E+02, -0.117499712000000E+03),\n new google.maps.LatLng( 0.486562270000000E+02, -0.117499695000000E+03),\n new google.maps.LatLng( 0.486558480000000E+02, -0.117629241000000E+03),\n new google.maps.LatLng( 0.486590990000000E+02, -0.117629261000000E+03),\n new google.maps.LatLng( 0.486621410000000E+02, -0.117634639000000E+03),\n new google.maps.LatLng( 0.486642670000000E+02, -0.117637362000000E+03),\n new google.maps.LatLng( 0.486657300000000E+02, -0.117638395000000E+03),\n new google.maps.LatLng( 0.486662560000000E+02, -0.117638188000000E+03),\n new google.maps.LatLng( 0.486662100000000E+02, -0.117637187000000E+03),\n new google.maps.LatLng( 0.486656360000000E+02, -0.117632980000000E+03),\n new google.maps.LatLng( 0.486649050000000E+02, -0.117632083000000E+03),\n new google.maps.LatLng( 0.486649270000000E+02, -0.117631256000000E+03),\n new google.maps.LatLng( 0.486660240000000E+02, -0.117629875000000E+03),\n new google.maps.LatLng( 0.486678740000000E+02, -0.117629305000000E+03),\n new google.maps.LatLng( 0.487043920000000E+02, -0.117629405000000E+03),\n new google.maps.LatLng( 0.487076810000000E+02, -0.117634937000000E+03),\n new google.maps.LatLng( 0.487097390000000E+02, -0.117636938000000E+03),\n new google.maps.LatLng( 0.487120470000000E+02, -0.117635590000000E+03),\n new google.maps.LatLng( 0.487111090000000E+02, -0.117632379000000E+03),\n new google.maps.LatLng( 0.487112730000000E+02, -0.117629422000000E+03),\n new google.maps.LatLng( 0.487426830000000E+02, -0.117629512000000E+03),\n new google.maps.LatLng( 0.487429110000000E+02, -0.117595383000000E+03),\n new google.maps.LatLng( 0.487424640000000E+02, -0.117563527000000E+03),\n new google.maps.LatLng( 0.487499110000000E+02, -0.117564062000000E+03),\n new google.maps.LatLng( 0.488366990000000E+02, -0.117563619000000E+03),\n new google.maps.LatLng( 0.488368190000000E+02, -0.117498576000000E+03),\n new google.maps.LatLng( 0.489227860000000E+02, -0.117498868000000E+03),\n new google.maps.LatLng( 0.489230680000000E+02, -0.117430203000000E+03),\n new google.maps.LatLng( 0.489705600000000E+02, -0.117430154000000E+03),\n new google.maps.LatLng( 0.490003632277298E+02, -0.117429502617754E+03),\n ];\n\n return zipCoords\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.479632090000000E+02, -0.122109385000000E+03),\n new google.maps.LatLng( 0.479606920000000E+02, -0.122107859000000E+03),\n new google.maps.LatLng( 0.479542830000000E+02, -0.122108286000000E+03),\n new google.maps.LatLng( 0.479537560000000E+02, -0.122110148000000E+03),\n new google.maps.LatLng( 0.479549620000000E+02, -0.122114527000000E+03),\n new google.maps.LatLng( 0.479635980000000E+02, -0.122114786000000E+03),\n new google.maps.LatLng( 0.479635980000000E+02, -0.122110117000000E+03),\n new google.maps.LatLng( 0.479632090000000E+02, -0.122109385000000E+03),\n ];\n\n return zipCoords\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.464670130000000E+02, -0.122174355000000E+03),\n new google.maps.LatLng( 0.464695090000000E+02, -0.122171771000000E+03),\n new google.maps.LatLng( 0.464695090000000E+02, -0.122171771000000E+03),\n new google.maps.LatLng( 0.464685260000000E+02, -0.122169853000000E+03),\n new google.maps.LatLng( 0.464643590000000E+02, -0.122165444000000E+03),\n new google.maps.LatLng( 0.464643590000000E+02, -0.122165444000000E+03),\n new google.maps.LatLng( 0.464633860000000E+02, -0.122165761000000E+03),\n new google.maps.LatLng( 0.464633860000000E+02, -0.122165761000000E+03),\n new google.maps.LatLng( 0.464670130000000E+02, -0.122174355000000E+03),\n ];\n\n return zipCoords\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.485547070000000E+02, -0.122925607000000E+03),\n new google.maps.LatLng( 0.485554390000000E+02, -0.122928051000000E+03),\n new google.maps.LatLng( 0.485592780000000E+02, -0.122928807000000E+03),\n new google.maps.LatLng( 0.485605800000000E+02, -0.122927706000000E+03),\n new google.maps.LatLng( 0.485606710000000E+02, -0.122926054000000E+03),\n new google.maps.LatLng( 0.485600770000000E+02, -0.122924470000000E+03),\n new google.maps.LatLng( 0.485576550000000E+02, -0.122922853000000E+03),\n new google.maps.LatLng( 0.485569690000000E+02, -0.122922818000000E+03),\n new google.maps.LatLng( 0.485547070000000E+02, -0.122925607000000E+03),\n ];\n\n return zipCoords\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.475909680000000E+02, -0.120186898000000E+03),\n new google.maps.LatLng( 0.475898910000000E+02, -0.120188019000000E+03),\n new google.maps.LatLng( 0.475884980000000E+02, -0.120191330000000E+03),\n new google.maps.LatLng( 0.475861290000000E+02, -0.120193283000000E+03),\n new google.maps.LatLng( 0.475872200000000E+02, -0.120187467000000E+03),\n new google.maps.LatLng( 0.475968710000000E+02, -0.120168822000000E+03),\n new google.maps.LatLng( 0.475976980000000E+02, -0.120159641000000E+03),\n new google.maps.LatLng( 0.475972520000000E+02, -0.120140974000000E+03),\n new google.maps.LatLng( 0.475983230000000E+02, -0.120139360000000E+03),\n new google.maps.LatLng( 0.475991030000000E+02, -0.120136507000000E+03),\n new google.maps.LatLng( 0.475989240000000E+02, -0.120133567000000E+03),\n new google.maps.LatLng( 0.475958400000000E+02, -0.120132388000000E+03),\n new google.maps.LatLng( 0.475925280000000E+02, -0.120133067000000E+03),\n new google.maps.LatLng( 0.475856330000000E+02, -0.120140638000000E+03),\n new google.maps.LatLng( 0.475843070000000E+02, -0.120138985000000E+03),\n new google.maps.LatLng( 0.475857190000000E+02, -0.120130306000000E+03),\n new google.maps.LatLng( 0.475836670000000E+02, -0.120121237000000E+03),\n new google.maps.LatLng( 0.475837150000000E+02, -0.120115733000000E+03),\n new google.maps.LatLng( 0.475813400000000E+02, -0.120114381000000E+03),\n new google.maps.LatLng( 0.475777080000000E+02, -0.120115019000000E+03),\n new google.maps.LatLng( 0.475757890000000E+02, -0.120114714000000E+03),\n new google.maps.LatLng( 0.475723410000000E+02, -0.120111301000000E+03),\n new google.maps.LatLng( 0.475673400000000E+02, -0.120108293000000E+03),\n new google.maps.LatLng( 0.475635250000000E+02, -0.120110348000000E+03),\n new google.maps.LatLng( 0.475602810000000E+02, -0.120111391000000E+03),\n new google.maps.LatLng( 0.475566270000000E+02, -0.120110579000000E+03),\n new google.maps.LatLng( 0.475554850000000E+02, -0.120108351000000E+03),\n new google.maps.LatLng( 0.475554630000000E+02, -0.120107271000000E+03),\n new google.maps.LatLng( 0.475571100000000E+02, -0.120100490000000E+03),\n new google.maps.LatLng( 0.475570650000000E+02, -0.120098060000000E+03),\n new google.maps.LatLng( 0.475559920000000E+02, -0.120096608000000E+03),\n new google.maps.LatLng( 0.475540500000000E+02, -0.120096641000000E+03),\n new google.maps.LatLng( 0.475514470000000E+02, -0.120094716000000E+03),\n new google.maps.LatLng( 0.475512650000000E+02, -0.120090836000000E+03),\n new google.maps.LatLng( 0.475502600000000E+02, -0.120088508000000E+03),\n new google.maps.LatLng( 0.475474740000000E+02, -0.120088844000000E+03),\n new google.maps.LatLng( 0.475435910000000E+02, -0.120087054000000E+03),\n new google.maps.LatLng( 0.475412390000000E+02, -0.120081925000000E+03),\n new google.maps.LatLng( 0.475353240000000E+02, -0.120078922000000E+03),\n new google.maps.LatLng( 0.475342730000000E+02, -0.120080911000000E+03),\n new google.maps.LatLng( 0.475342950000000E+02, -0.120083610000000E+03),\n new google.maps.LatLng( 0.475333580000000E+02, -0.120087656000000E+03),\n new google.maps.LatLng( 0.475300450000000E+02, -0.120093152000000E+03),\n new google.maps.LatLng( 0.475296470000000E+02, -0.120095149000000E+03),\n new google.maps.LatLng( 0.475296470000000E+02, -0.120095149000000E+03),\n new google.maps.LatLng( 0.475281470000000E+02, -0.120099896000000E+03),\n new google.maps.LatLng( 0.475281000000000E+02, -0.120103876000000E+03),\n new google.maps.LatLng( 0.475255620000000E+02, -0.120110079000000E+03),\n new google.maps.LatLng( 0.475335780000000E+02, -0.120113964000000E+03),\n new google.maps.LatLng( 0.475355640000000E+02, -0.120117003000000E+03),\n new google.maps.LatLng( 0.475370700000000E+02, -0.120121187000000E+03),\n new google.maps.LatLng( 0.475355580000000E+02, -0.120129957000000E+03),\n new google.maps.LatLng( 0.475339610000000E+02, -0.120133534000000E+03),\n new google.maps.LatLng( 0.475313450000000E+02, -0.120136214000000E+03),\n new google.maps.LatLng( 0.475284110000000E+02, -0.120135631000000E+03),\n new google.maps.LatLng( 0.475242300000000E+02, -0.120133781000000E+03),\n new google.maps.LatLng( 0.475239310000000E+02, -0.120133199000000E+03),\n new google.maps.LatLng( 0.475269860000000E+02, -0.120133186000000E+03),\n new google.maps.LatLng( 0.475216010000000E+02, -0.120126177000000E+03),\n new google.maps.LatLng( 0.475206940000000E+02, -0.120115200000000E+03),\n new google.maps.LatLng( 0.475198730000000E+02, -0.120110883000000E+03),\n new google.maps.LatLng( 0.475198730000000E+02, -0.120110883000000E+03),\n new google.maps.LatLng( 0.475188690000000E+02, -0.120109837000000E+03),\n new google.maps.LatLng( 0.475161080000000E+02, -0.120100697000000E+03),\n new google.maps.LatLng( 0.475163170000000E+02, -0.120092369000000E+03),\n new google.maps.LatLng( 0.475122500000000E+02, -0.120094355000000E+03),\n new google.maps.LatLng( 0.475069040000000E+02, -0.120098432000000E+03),\n new google.maps.LatLng( 0.474998500000000E+02, -0.120099640000000E+03),\n new google.maps.LatLng( 0.474974590000000E+02, -0.120099126000000E+03),\n new google.maps.LatLng( 0.474893510000000E+02, -0.120095852000000E+03),\n new google.maps.LatLng( 0.474827270000000E+02, -0.120094400000000E+03),\n new google.maps.LatLng( 0.474787760000000E+02, -0.120092983000000E+03),\n new google.maps.LatLng( 0.474747800000000E+02, -0.120088736000000E+03),\n new google.maps.LatLng( 0.474711250000000E+02, -0.120088161000000E+03),\n new google.maps.LatLng( 0.474711250000000E+02, -0.120088161000000E+03),\n new google.maps.LatLng( 0.474686810000000E+02, -0.120085365000000E+03),\n new google.maps.LatLng( 0.474665800000000E+02, -0.120084286000000E+03),\n new google.maps.LatLng( 0.474642270000000E+02, -0.120084791000000E+03),\n new google.maps.LatLng( 0.474595230000000E+02, -0.120083678000000E+03),\n new google.maps.LatLng( 0.474562350000000E+02, -0.120079971000000E+03),\n new google.maps.LatLng( 0.474544990000000E+02, -0.120076940000000E+03),\n new google.maps.LatLng( 0.474518040000000E+02, -0.120075020000000E+03),\n new google.maps.LatLng( 0.474438550000000E+02, -0.120074918000000E+03),\n new google.maps.LatLng( 0.474415480000000E+02, -0.120075557000000E+03),\n new google.maps.LatLng( 0.474383950000000E+02, -0.120079058000000E+03),\n new google.maps.LatLng( 0.474346950000000E+02, -0.120080505000000E+03),\n new google.maps.LatLng( 0.474316800000000E+02, -0.120080066000000E+03),\n new google.maps.LatLng( 0.474289850000000E+02, -0.120078786000000E+03),\n new google.maps.LatLng( 0.474296460000000E+02, -0.120084307000000E+03),\n new google.maps.LatLng( 0.474316780000000E+02, -0.120089492000000E+03),\n new google.maps.LatLng( 0.474330020000000E+02, -0.120096360000000E+03),\n new google.maps.LatLng( 0.474310100000000E+02, -0.120105885000000E+03),\n new google.maps.LatLng( 0.474295930000000E+02, -0.120108206000000E+03),\n new google.maps.LatLng( 0.474290890000000E+02, -0.120111977000000E+03),\n new google.maps.LatLng( 0.474303660000000E+02, -0.120117296000000E+03),\n new google.maps.LatLng( 0.474320100000000E+02, -0.120119755000000E+03),\n new google.maps.LatLng( 0.474337450000000E+02, -0.120120700000000E+03),\n new google.maps.LatLng( 0.474337450000000E+02, -0.120120700000000E+03),\n new google.maps.LatLng( 0.474346180000000E+02, -0.120120467000000E+03),\n new google.maps.LatLng( 0.474365780000000E+02, -0.120121308000000E+03),\n new google.maps.LatLng( 0.474430860000000E+02, -0.120125255000000E+03),\n new google.maps.LatLng( 0.474445020000000E+02, -0.120134264000000E+03),\n new google.maps.LatLng( 0.474435000000000E+02, -0.120139787000000E+03),\n new google.maps.LatLng( 0.474443240000000E+02, -0.120142749000000E+03),\n new google.maps.LatLng( 0.474465640000000E+02, -0.120147462000000E+03),\n new google.maps.LatLng( 0.474467390000000E+02, -0.120153129000000E+03),\n new google.maps.LatLng( 0.474455160000000E+02, -0.120154972000000E+03),\n new google.maps.LatLng( 0.474455160000000E+02, -0.120154972000000E+03),\n new google.maps.LatLng( 0.474455160000000E+02, -0.120155369000000E+03),\n new google.maps.LatLng( 0.474455160000000E+02, -0.120155369000000E+03),\n new google.maps.LatLng( 0.474460640000000E+02, -0.120154837000000E+03),\n new google.maps.LatLng( 0.474472760000000E+02, -0.120157260000000E+03),\n new google.maps.LatLng( 0.474466830000000E+02, -0.120162514000000E+03),\n new google.maps.LatLng( 0.474470030000000E+02, -0.120163794000000E+03),\n new google.maps.LatLng( 0.474477340000000E+02, -0.120164601000000E+03),\n new google.maps.LatLng( 0.474496990000000E+02, -0.120165274000000E+03),\n new google.maps.LatLng( 0.474510250000000E+02, -0.120168540000000E+03),\n new google.maps.LatLng( 0.474522170000000E+02, -0.120175650000000E+03),\n new google.maps.LatLng( 0.474522170000000E+02, -0.120175650000000E+03),\n new google.maps.LatLng( 0.474633610000000E+02, -0.120175777000000E+03),\n new google.maps.LatLng( 0.474635670000000E+02, -0.120196931000000E+03),\n new google.maps.LatLng( 0.474780260000000E+02, -0.120196898000000E+03),\n new google.maps.LatLng( 0.474782760000000E+02, -0.120213071000000E+03),\n new google.maps.LatLng( 0.474811770000000E+02, -0.120213275000000E+03),\n new google.maps.LatLng( 0.474834140000000E+02, -0.120216544000000E+03),\n new google.maps.LatLng( 0.474834830000000E+02, -0.120217319000000E+03),\n new google.maps.LatLng( 0.474824780000000E+02, -0.120218464000000E+03),\n new google.maps.LatLng( 0.474823400000000E+02, -0.120219643000000E+03),\n new google.maps.LatLng( 0.474840070000000E+02, -0.120223891000000E+03),\n new google.maps.LatLng( 0.474878430000000E+02, -0.120228443000000E+03),\n new google.maps.LatLng( 0.474880940000000E+02, -0.120229016000000E+03),\n new google.maps.LatLng( 0.474876370000000E+02, -0.120229959000000E+03),\n new google.maps.LatLng( 0.474847360000000E+02, -0.120229047000000E+03),\n new google.maps.LatLng( 0.474833210000000E+02, -0.120226923000000E+03),\n new google.maps.LatLng( 0.474804650000000E+02, -0.120226180000000E+03),\n new google.maps.LatLng( 0.474760110000000E+02, -0.120226750000000E+03),\n new google.maps.LatLng( 0.474740230000000E+02, -0.120227827000000E+03),\n new google.maps.LatLng( 0.474712360000000E+02, -0.120228533000000E+03),\n new google.maps.LatLng( 0.474697270000000E+02, -0.120227376000000E+03),\n new google.maps.LatLng( 0.474133010000000E+02, -0.120167488000000E+03),\n new google.maps.LatLng( 0.473919770000000E+02, -0.120134126000000E+03),\n new google.maps.LatLng( 0.473913670000000E+02, -0.120133796000000E+03),\n new google.maps.LatLng( 0.473913720000000E+02, -0.120135564000000E+03),\n new google.maps.LatLng( 0.473941610000000E+02, -0.120139228000000E+03),\n new google.maps.LatLng( 0.473963350000000E+02, -0.120150698000000E+03),\n new google.maps.LatLng( 0.473984610000000E+02, -0.120154229000000E+03),\n new google.maps.LatLng( 0.473986210000000E+02, -0.120155608000000E+03),\n new google.maps.LatLng( 0.473985540000000E+02, -0.120159712000000E+03),\n new google.maps.LatLng( 0.473913120000000E+02, -0.120159716000000E+03),\n new google.maps.LatLng( 0.473914300000000E+02, -0.120181177000000E+03),\n new google.maps.LatLng( 0.473881710000000E+02, -0.120181219000000E+03),\n new google.maps.LatLng( 0.473769260000000E+02, -0.120173399000000E+03),\n new google.maps.LatLng( 0.473760570000000E+02, -0.120176471000000E+03),\n new google.maps.LatLng( 0.473766510000000E+02, -0.120184845000000E+03),\n new google.maps.LatLng( 0.473777250000000E+02, -0.120189149000000E+03),\n new google.maps.LatLng( 0.473776330000000E+02, -0.120191604000000E+03),\n new google.maps.LatLng( 0.473771540000000E+02, -0.120192142000000E+03),\n new google.maps.LatLng( 0.473762940000000E+02, -0.120189335000000E+03),\n new google.maps.LatLng( 0.473738020000000E+02, -0.120171405000000E+03),\n new google.maps.LatLng( 0.473721240000000E+02, -0.120170524000000E+03),\n new google.maps.LatLng( 0.473721240000000E+02, -0.120170524000000E+03),\n new google.maps.LatLng( 0.473725580000000E+02, -0.120180535000000E+03),\n new google.maps.LatLng( 0.473740660000000E+02, -0.120187999000000E+03),\n new google.maps.LatLng( 0.473758290000000E+02, -0.120190562000000E+03),\n new google.maps.LatLng( 0.473764680000000E+02, -0.120192478000000E+03),\n new google.maps.LatLng( 0.473780210000000E+02, -0.120202131000000E+03),\n new google.maps.LatLng( 0.473781560000000E+02, -0.120212724000000E+03),\n new google.maps.LatLng( 0.473788400000000E+02, -0.120219417000000E+03),\n new google.maps.LatLng( 0.473807120000000E+02, -0.120225001000000E+03),\n new google.maps.LatLng( 0.473797260000000E+02, -0.120230852000000E+03),\n new google.maps.LatLng( 0.473802490000000E+02, -0.120237411000000E+03),\n new google.maps.LatLng( 0.473815710000000E+02, -0.120245148000000E+03),\n new google.maps.LatLng( 0.473825730000000E+02, -0.120250026000000E+03),\n new google.maps.LatLng( 0.473866190000000E+02, -0.120263768000000E+03),\n new google.maps.LatLng( 0.473920840000000E+02, -0.120277958000000E+03),\n new google.maps.LatLng( 0.473935020000000E+02, -0.120283810000000E+03),\n new google.maps.LatLng( 0.473956040000000E+02, -0.120286804000000E+03),\n new google.maps.LatLng( 0.473992140000000E+02, -0.120290167000000E+03),\n new google.maps.LatLng( 0.474048800000000E+02, -0.120293226000000E+03),\n new google.maps.LatLng( 0.474165080000000E+02, -0.120296183000000E+03),\n new google.maps.LatLng( 0.474235430000000E+02, -0.120298773000000E+03),\n new google.maps.LatLng( 0.474315620000000E+02, -0.120304930000000E+03),\n new google.maps.LatLng( 0.474442410000000E+02, -0.120309171000000E+03),\n new google.maps.LatLng( 0.474548180000000E+02, -0.120313413000000E+03),\n new google.maps.LatLng( 0.474606890000000E+02, -0.120315031000000E+03),\n new google.maps.LatLng( 0.474629040000000E+02, -0.120315536000000E+03),\n new google.maps.LatLng( 0.474704660000000E+02, -0.120314963000000E+03),\n new google.maps.LatLng( 0.474786890000000E+02, -0.120312267000000E+03),\n new google.maps.LatLng( 0.474801970000000E+02, -0.120312738000000E+03),\n new google.maps.LatLng( 0.474872780000000E+02, -0.120309199000000E+03),\n new google.maps.LatLng( 0.475034750000000E+02, -0.120305867000000E+03),\n new google.maps.LatLng( 0.475074260000000E+02, -0.120303742000000E+03),\n new google.maps.LatLng( 0.475183000000000E+02, -0.120301245000000E+03),\n new google.maps.LatLng( 0.475304070000000E+02, -0.120294226000000E+03),\n new google.maps.LatLng( 0.475380580000000E+02, -0.120288793000000E+03),\n new google.maps.LatLng( 0.475399990000000E+02, -0.120286633000000E+03),\n new google.maps.LatLng( 0.475415060000000E+02, -0.120283157000000E+03),\n new google.maps.LatLng( 0.475412080000000E+02, -0.120281808000000E+03),\n new google.maps.LatLng( 0.475404540000000E+02, -0.120281606000000E+03),\n new google.maps.LatLng( 0.475402940000000E+02, -0.120279953000000E+03),\n new google.maps.LatLng( 0.475424360000000E+02, -0.120265480000000E+03),\n new google.maps.LatLng( 0.475446260000000E+02, -0.120260181000000E+03),\n new google.maps.LatLng( 0.475489650000000E+02, -0.120255082000000E+03),\n new google.maps.LatLng( 0.475522770000000E+02, -0.120254403000000E+03),\n new google.maps.LatLng( 0.475546530000000E+02, -0.120255210000000E+03),\n new google.maps.LatLng( 0.475570740000000E+02, -0.120255241000000E+03),\n new google.maps.LatLng( 0.475741410000000E+02, -0.120246371000000E+03),\n new google.maps.LatLng( 0.475756270000000E+02, -0.120244212000000E+03),\n new google.maps.LatLng( 0.475763130000000E+02, -0.120240635000000E+03),\n new google.maps.LatLng( 0.475784620000000E+02, -0.120238544000000E+03),\n new google.maps.LatLng( 0.475834880000000E+02, -0.120235746000000E+03),\n new google.maps.LatLng( 0.476008520000000E+02, -0.120228061000000E+03),\n new google.maps.LatLng( 0.476008520000000E+02, -0.120228061000000E+03),\n new google.maps.LatLng( 0.476000990000000E+02, -0.120223737000000E+03),\n new google.maps.LatLng( 0.476012420000000E+02, -0.120221070000000E+03),\n new google.maps.LatLng( 0.476014250000000E+02, -0.120219449000000E+03),\n new google.maps.LatLng( 0.476008340000000E+02, -0.120202900000000E+03),\n new google.maps.LatLng( 0.476001720000000E+02, -0.120201988000000E+03),\n new google.maps.LatLng( 0.475982760000000E+02, -0.120201008000000E+03),\n new google.maps.LatLng( 0.475946210000000E+02, -0.120195807000000E+03),\n new google.maps.LatLng( 0.475909680000000E+02, -0.120186898000000E+03),\n ];\n\n return zipCoords\n}", "function getBCMarkers(){\n try{\n top4 = []\n let city1 = document.querySelector('#bc_city1').innerText\n top4.push(city1)\n let city2 = document.querySelector('#bc_city2').innerText\n top4.push(city2)\n let city3 = document.querySelector('#bc_city3').innerText\n top4.push(city3)\n let city4 = document.querySelector('#bc_city4').innerText\n top4.push(city4)\n //console.log(top4)\n let prov = 'bc'\n initMap(top4, prov)\n }catch{\n window.alert(\"Sorry, something has gone horribly wrong\")\n }\n }", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.467764130000000E+02, -0.119797223000000E+03),\n new google.maps.LatLng( 0.467806400000000E+02, -0.119798951000000E+03),\n new google.maps.LatLng( 0.467920850000000E+02, -0.119800579000000E+03),\n new google.maps.LatLng( 0.467948720000000E+02, -0.119799214000000E+03),\n new google.maps.LatLng( 0.467965620000000E+02, -0.119785975000000E+03),\n new google.maps.LatLng( 0.467982040000000E+02, -0.119776459000000E+03),\n new google.maps.LatLng( 0.468002350000000E+02, -0.119769205000000E+03),\n new google.maps.LatLng( 0.468029460000000E+02, -0.119751594000000E+03),\n new google.maps.LatLng( 0.468028310000000E+02, -0.119746071000000E+03),\n new google.maps.LatLng( 0.467941790000000E+02, -0.119732090000000E+03),\n new google.maps.LatLng( 0.467925570000000E+02, -0.119731590000000E+03),\n new google.maps.LatLng( 0.467894960000000E+02, -0.119731687000000E+03),\n new google.maps.LatLng( 0.467839900000000E+02, -0.119730219000000E+03),\n new google.maps.LatLng( 0.467731870000000E+02, -0.119720966000000E+03),\n new google.maps.LatLng( 0.467669530000000E+02, -0.119711718000000E+03),\n new google.maps.LatLng( 0.467677100000000E+02, -0.119697688000000E+03),\n new google.maps.LatLng( 0.467718900000000E+02, -0.119700249000000E+03),\n new google.maps.LatLng( 0.467844100000000E+02, -0.119703112000000E+03),\n new google.maps.LatLng( 0.467867400000000E+02, -0.119704777000000E+03),\n new google.maps.LatLng( 0.467883150000000E+02, -0.119708702000000E+03),\n new google.maps.LatLng( 0.467934320000000E+02, -0.119711332000000E+03),\n new google.maps.LatLng( 0.467965620000000E+02, -0.119711966000000E+03),\n new google.maps.LatLng( 0.467985950000000E+02, -0.119711734000000E+03),\n new google.maps.LatLng( 0.468010400000000E+02, -0.119708474000000E+03),\n new google.maps.LatLng( 0.468017490000000E+02, -0.119704982000000E+03),\n new google.maps.LatLng( 0.468014980000000E+02, -0.119703052000000E+03),\n new google.maps.LatLng( 0.467996940000000E+02, -0.119699592000000E+03),\n new google.maps.LatLng( 0.468006310000000E+02, -0.119690941000000E+03),\n new google.maps.LatLng( 0.468029620000000E+02, -0.119687814000000E+03),\n new google.maps.LatLng( 0.468068680000000E+02, -0.119676402000000E+03),\n new google.maps.LatLng( 0.468101800000000E+02, -0.119672540000000E+03),\n new google.maps.LatLng( 0.468120080000000E+02, -0.119671409000000E+03),\n new google.maps.LatLng( 0.468123270000000E+02, -0.119669246000000E+03),\n new google.maps.LatLng( 0.468123270000000E+02, -0.119669246000000E+03),\n new google.maps.LatLng( 0.468114130000000E+02, -0.119664754000000E+03),\n new google.maps.LatLng( 0.468024110000000E+02, -0.119662229000000E+03),\n new google.maps.LatLng( 0.468007430000000E+02, -0.119662795000000E+03),\n new google.maps.LatLng( 0.467976830000000E+02, -0.119665624000000E+03),\n new google.maps.LatLng( 0.467952410000000E+02, -0.119665319000000E+03),\n new google.maps.LatLng( 0.467949440000000E+02, -0.119494168000000E+03),\n new google.maps.LatLng( 0.467949440000000E+02, -0.119494168000000E+03),\n new google.maps.LatLng( 0.467902210000000E+02, -0.119495983000000E+03),\n new google.maps.LatLng( 0.467852860000000E+02, -0.119495545000000E+03),\n new google.maps.LatLng( 0.467665050000000E+02, -0.119495592000000E+03),\n new google.maps.LatLng( 0.467664520000000E+02, -0.119558817000000E+03),\n new google.maps.LatLng( 0.467808930000000E+02, -0.119558782000000E+03),\n new google.maps.LatLng( 0.467811190000000E+02, -0.119580434000000E+03),\n new google.maps.LatLng( 0.467749730000000E+02, -0.119580598000000E+03),\n new google.maps.LatLng( 0.467676830000000E+02, -0.119591935000000E+03),\n new google.maps.LatLng( 0.467665600000000E+02, -0.119601410000000E+03),\n new google.maps.LatLng( 0.467377230000000E+02, -0.119601162000000E+03),\n new google.maps.LatLng( 0.467375770000000E+02, -0.119619938000000E+03),\n new google.maps.LatLng( 0.467358630000000E+02, -0.119628070000000E+03),\n new google.maps.LatLng( 0.467371650000000E+02, -0.119633488000000E+03),\n new google.maps.LatLng( 0.467441420000000E+02, -0.119633635000000E+03),\n new google.maps.LatLng( 0.467408940000000E+02, -0.119638367000000E+03),\n new google.maps.LatLng( 0.467372180000000E+02, -0.119642657000000E+03),\n new google.maps.LatLng( 0.467304440000000E+02, -0.119642529000000E+03),\n new google.maps.LatLng( 0.466949120000000E+02, -0.119691999000000E+03),\n new google.maps.LatLng( 0.466923310000000E+02, -0.119693393000000E+03),\n new google.maps.LatLng( 0.466903660000000E+02, -0.119686287000000E+03),\n new google.maps.LatLng( 0.466825300000000E+02, -0.119692064000000E+03),\n new google.maps.LatLng( 0.466823240000000E+02, -0.119690105000000E+03),\n new google.maps.LatLng( 0.466782350000000E+02, -0.119683034000000E+03),\n new google.maps.LatLng( 0.466770920000000E+02, -0.119682171000000E+03),\n new google.maps.LatLng( 0.466754930000000E+02, -0.119682039000000E+03),\n new google.maps.LatLng( 0.466731860000000E+02, -0.119682603000000E+03),\n new google.maps.LatLng( 0.466688900000000E+02, -0.119686254000000E+03),\n new google.maps.LatLng( 0.466557980000000E+02, -0.119704172000000E+03),\n new google.maps.LatLng( 0.466536500000000E+02, -0.119707986000000E+03),\n new google.maps.LatLng( 0.466489590000000E+02, -0.119733928000000E+03),\n new google.maps.LatLng( 0.466474730000000E+02, -0.119735353000000E+03),\n new google.maps.LatLng( 0.466461250000000E+02, -0.119735352000000E+03),\n new google.maps.LatLng( 0.466436690000000E+02, -0.119733721000000E+03),\n new google.maps.LatLng( 0.466436690000000E+02, -0.119733721000000E+03),\n new google.maps.LatLng( 0.466386960000000E+02, -0.119745860000000E+03),\n new google.maps.LatLng( 0.466369610000000E+02, -0.119752951000000E+03),\n new google.maps.LatLng( 0.466355080000000E+02, -0.119780315000000E+03),\n new google.maps.LatLng( 0.466313780000000E+02, -0.119804395000000E+03),\n new google.maps.LatLng( 0.466273800000000E+02, -0.119822502000000E+03),\n new google.maps.LatLng( 0.466274400000000E+02, -0.119856127000000E+03),\n new google.maps.LatLng( 0.466282350000000E+02, -0.119866872000000E+03),\n new google.maps.LatLng( 0.466298040000000E+02, -0.119873636000000E+03),\n new google.maps.LatLng( 0.466317080000000E+02, -0.119880983000000E+03),\n new google.maps.LatLng( 0.466319860000000E+02, -0.119889107000000E+03),\n new google.maps.LatLng( 0.466331310000000E+02, -0.119894612000000E+03),\n new google.maps.LatLng( 0.466354630000000E+02, -0.119899054000000E+03),\n new google.maps.LatLng( 0.466399190000000E+02, -0.119903926000000E+03),\n new google.maps.LatLng( 0.466418840000000E+02, -0.119905451000000E+03),\n new google.maps.LatLng( 0.466442830000000E+02, -0.119906113000000E+03),\n new google.maps.LatLng( 0.466457910000000E+02, -0.119907672000000E+03),\n new google.maps.LatLng( 0.466468650000000E+02, -0.119907704000000E+03),\n new google.maps.LatLng( 0.466537830000000E+02, -0.119895491000000E+03),\n new google.maps.LatLng( 0.466562740000000E+02, -0.119899504000000E+03),\n new google.maps.LatLng( 0.466687970000000E+02, -0.119913666000000E+03),\n new google.maps.LatLng( 0.466740520000000E+02, -0.119921364000000E+03),\n new google.maps.LatLng( 0.466839450000000E+02, -0.119932680000000E+03),\n new google.maps.LatLng( 0.466891070000000E+02, -0.119937063000000E+03),\n new google.maps.LatLng( 0.466951140000000E+02, -0.119940549000000E+03),\n new google.maps.LatLng( 0.466994770000000E+02, -0.119941811000000E+03),\n new google.maps.LatLng( 0.466999110000000E+02, -0.119941147000000E+03),\n new google.maps.LatLng( 0.467029950000000E+02, -0.119942177000000E+03),\n new google.maps.LatLng( 0.467034060000000E+02, -0.119943273000000E+03),\n new google.maps.LatLng( 0.467025160000000E+02, -0.119943571000000E+03),\n new google.maps.LatLng( 0.467028580000000E+02, -0.119945630000000E+03),\n new google.maps.LatLng( 0.467047540000000E+02, -0.119947258000000E+03),\n new google.maps.LatLng( 0.467046170000000E+02, -0.119949516000000E+03),\n new google.maps.LatLng( 0.467049820000000E+02, -0.119950214000000E+03),\n new google.maps.LatLng( 0.467065350000000E+02, -0.119950912000000E+03),\n new google.maps.LatLng( 0.467072210000000E+02, -0.119950547000000E+03),\n new google.maps.LatLng( 0.467070380000000E+02, -0.119949451000000E+03),\n new google.maps.LatLng( 0.467097790000000E+02, -0.119949219000000E+03),\n new google.maps.LatLng( 0.467106240000000E+02, -0.119950548000000E+03),\n new google.maps.LatLng( 0.467096190000000E+02, -0.119951743000000E+03),\n new google.maps.LatLng( 0.467060780000000E+02, -0.119952871000000E+03),\n new google.maps.LatLng( 0.467033140000000E+02, -0.119952870000000E+03),\n new google.maps.LatLng( 0.467035190000000E+02, -0.119953733000000E+03),\n new google.maps.LatLng( 0.467075620000000E+02, -0.119956391000000E+03),\n new google.maps.LatLng( 0.467100029041016E+02, -0.119953695013477E+03),\n new google.maps.LatLng( 0.467187340000000E+02, -0.119951646000000E+03),\n new google.maps.LatLng( 0.467183220000000E+02, -0.119952609000000E+03),\n new google.maps.LatLng( 0.467103500000000E+02, -0.119954665000000E+03),\n new google.maps.LatLng( 0.467095040000000E+02, -0.119956956000000E+03),\n new google.maps.LatLng( 0.467096410000000E+02, -0.119957853000000E+03),\n new google.maps.LatLng( 0.467117420000000E+02, -0.119959481000000E+03),\n new google.maps.LatLng( 0.467160590000000E+02, -0.119961044000000E+03),\n new google.maps.LatLng( 0.467206960000000E+02, -0.119961645000000E+03),\n new google.maps.LatLng( 0.467207190000000E+02, -0.119962277000000E+03),\n new google.maps.LatLng( 0.467191890000000E+02, -0.119962475000000E+03),\n new google.maps.LatLng( 0.467192340000000E+02, -0.119963106000000E+03),\n new google.maps.LatLng( 0.467224550000000E+02, -0.119964370000000E+03),\n new google.maps.LatLng( 0.467251500000000E+02, -0.119964505000000E+03),\n new google.maps.LatLng( 0.467258120000000E+02, -0.119965634000000E+03),\n new google.maps.LatLng( 0.467247390000000E+02, -0.119965966000000E+03),\n new google.maps.LatLng( 0.467247160000000E+02, -0.119966564000000E+03),\n new google.maps.LatLng( 0.467272510000000E+02, -0.119967263000000E+03),\n new google.maps.LatLng( 0.467328710000000E+02, -0.119967266000000E+03),\n new google.maps.LatLng( 0.467348810000000E+02, -0.119966105000000E+03),\n new google.maps.LatLng( 0.467368920000000E+02, -0.119963780000000E+03),\n new google.maps.LatLng( 0.467423310000000E+02, -0.119955077000000E+03),\n new google.maps.LatLng( 0.467466710000000E+02, -0.119954016000000E+03),\n new google.maps.LatLng( 0.467475170000000E+02, -0.119954349000000E+03),\n new google.maps.LatLng( 0.467474250000000E+02, -0.119955213000000E+03),\n new google.maps.LatLng( 0.467450030000000E+02, -0.119958568000000E+03),\n new google.maps.LatLng( 0.467413010000000E+02, -0.119962022000000E+03),\n new google.maps.LatLng( 0.467386050000000E+02, -0.119966605000000E+03),\n new google.maps.LatLng( 0.467383530000000E+02, -0.119968865000000E+03),\n new google.maps.LatLng( 0.467439720000000E+02, -0.119969001000000E+03),\n new google.maps.LatLng( 0.467498530000000E+02, -0.119967790000000E+03),\n new google.maps.LatLng( 0.467567660000000E+02, -0.119964183000000E+03),\n new google.maps.LatLng( 0.467603070000000E+02, -0.119960661000000E+03),\n new google.maps.LatLng( 0.467624090000000E+02, -0.119956673000000E+03),\n new google.maps.LatLng( 0.467655860000000E+02, -0.119947798000000E+03),\n new google.maps.LatLng( 0.467682130000000E+02, -0.119944175000000E+03),\n new google.maps.LatLng( 0.467718010000000E+02, -0.119940086000000E+03),\n new google.maps.LatLng( 0.467784940000000E+02, -0.119933901000000E+03),\n new google.maps.LatLng( 0.467811210000000E+02, -0.119933202000000E+03),\n new google.maps.LatLng( 0.467866720000000E+02, -0.119926318000000E+03),\n new google.maps.LatLng( 0.467889330000000E+02, -0.119925120000000E+03),\n new google.maps.LatLng( 0.467929990000000E+02, -0.119924687000000E+03),\n new google.maps.LatLng( 0.467995100000000E+02, -0.119925650000000E+03),\n new google.maps.LatLng( 0.468007660000000E+02, -0.119924552000000E+03),\n new google.maps.LatLng( 0.468041010000000E+02, -0.119923587000000E+03),\n new google.maps.LatLng( 0.468109540000000E+02, -0.119923718000000E+03),\n new google.maps.LatLng( 0.468119820000000E+02, -0.119924250000000E+03),\n new google.maps.LatLng( 0.468129870000000E+02, -0.119923718000000E+03),\n new google.maps.LatLng( 0.468145860000000E+02, -0.119921555000000E+03),\n new google.maps.LatLng( 0.468163450000000E+02, -0.119918060000000E+03),\n new google.maps.LatLng( 0.468173270000000E+02, -0.119917461000000E+03),\n new google.maps.LatLng( 0.468183550000000E+02, -0.119917727000000E+03),\n new google.maps.LatLng( 0.468195430000000E+02, -0.119920788000000E+03),\n new google.maps.LatLng( 0.468207080000000E+02, -0.119919756000000E+03),\n new google.maps.LatLng( 0.468213270000000E+02, -0.119917276000000E+03),\n new google.maps.LatLng( 0.468213270000000E+02, -0.119917276000000E+03),\n new google.maps.LatLng( 0.468112930000000E+02, -0.119912732000000E+03),\n new google.maps.LatLng( 0.467982240000000E+02, -0.119902677000000E+03),\n new google.maps.LatLng( 0.467935410000000E+02, -0.119895915000000E+03),\n new google.maps.LatLng( 0.467954130000000E+02, -0.119893752000000E+03),\n new google.maps.LatLng( 0.467957980000000E+02, -0.119886200000000E+03),\n new google.maps.LatLng( 0.467910690000000E+02, -0.119885473000000E+03),\n new google.maps.LatLng( 0.467892880000000E+02, -0.119886605000000E+03),\n new google.maps.LatLng( 0.467859080000000E+02, -0.119887506000000E+03),\n new google.maps.LatLng( 0.467781250000000E+02, -0.119887263000000E+03),\n new google.maps.LatLng( 0.467741150000000E+02, -0.119884437000000E+03),\n new google.maps.LatLng( 0.467740470000000E+02, -0.119878307000000E+03),\n new google.maps.LatLng( 0.467767420000000E+02, -0.119877872000000E+03),\n new google.maps.LatLng( 0.467782480000000E+02, -0.119876156000000E+03),\n new google.maps.LatLng( 0.467796870000000E+02, -0.119873643000000E+03),\n new google.maps.LatLng( 0.467809220000000E+02, -0.119869253000000E+03),\n new google.maps.LatLng( 0.467849210000000E+02, -0.119868327000000E+03),\n new google.maps.LatLng( 0.467912970000000E+02, -0.119864242000000E+03),\n new google.maps.LatLng( 0.467920330000000E+02, -0.119853001000000E+03),\n new google.maps.LatLng( 0.467890900000000E+02, -0.119840392000000E+03),\n new google.maps.LatLng( 0.467855730000000E+02, -0.119833107000000E+03),\n new google.maps.LatLng( 0.467839530000000E+02, -0.119819105000000E+03),\n new google.maps.LatLng( 0.467826970000000E+02, -0.119816544000000E+03),\n new google.maps.LatLng( 0.467770310000000E+02, -0.119811123000000E+03),\n new google.maps.LatLng( 0.467772140000000E+02, -0.119803774000000E+03),\n new google.maps.LatLng( 0.467764130000000E+02, -0.119797223000000E+03),\n new google.maps.LatLng( 0.467764130000000E+02, -0.119797223000000E+03),\n new google.maps.LatLng( 0.467739690000000E+02, -0.119798554000000E+03),\n new google.maps.LatLng( 0.467729410000000E+02, -0.119798455000000E+03),\n new google.maps.LatLng( 0.467711360000000E+02, -0.119797857000000E+03),\n new google.maps.LatLng( 0.467702450000000E+02, -0.119796593000000E+03),\n new google.maps.LatLng( 0.467694000000000E+02, -0.119796361000000E+03),\n new google.maps.LatLng( 0.467678920000000E+02, -0.119798090000000E+03),\n new google.maps.LatLng( 0.467664760000000E+02, -0.119801415000000E+03),\n new google.maps.LatLng( 0.467665410000000E+02, -0.119842774000000E+03),\n new google.maps.LatLng( 0.467576090000000E+02, -0.119843035000000E+03),\n new google.maps.LatLng( 0.467595520000000E+02, -0.119836853000000E+03),\n new google.maps.LatLng( 0.467616330000000E+02, -0.119825219000000E+03),\n new google.maps.LatLng( 0.467606970000000E+02, -0.119817273000000E+03),\n new google.maps.LatLng( 0.467596000000000E+02, -0.119811023000000E+03),\n new google.maps.LatLng( 0.467539580000000E+02, -0.119811024000000E+03),\n new google.maps.LatLng( 0.467543000000000E+02, -0.119804310000000E+03),\n new google.maps.LatLng( 0.467522440000000E+02, -0.119799822000000E+03),\n new google.maps.LatLng( 0.467510080000000E+02, -0.119790749000000E+03),\n new google.maps.LatLng( 0.467466760000000E+02, -0.119786669000000E+03),\n new google.maps.LatLng( 0.467488910000000E+02, -0.119780286000000E+03),\n new google.maps.LatLng( 0.467514390000000E+02, -0.119777154000000E+03),\n new google.maps.LatLng( 0.467539300000000E+02, -0.119775557000000E+03),\n new google.maps.LatLng( 0.467562340000000E+02, -0.119767910000000E+03),\n new google.maps.LatLng( 0.467649380000000E+02, -0.119768102000000E+03),\n new google.maps.LatLng( 0.467657600000000E+02, -0.119767137000000E+03),\n new google.maps.LatLng( 0.467663990000000E+02, -0.119764843000000E+03),\n new google.maps.LatLng( 0.467664510000000E+02, -0.119788083000000E+03),\n new google.maps.LatLng( 0.467696720000000E+02, -0.119786652000000E+03),\n new google.maps.LatLng( 0.467716600000000E+02, -0.119786418000000E+03),\n new google.maps.LatLng( 0.467720940000000E+02, -0.119786750000000E+03),\n new google.maps.LatLng( 0.467753840000000E+02, -0.119790406000000E+03),\n new google.maps.LatLng( 0.467764130000000E+02, -0.119797223000000E+03),\n ];\n\n return zipCoords\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.477317121007947E+02, -0.122549908635166E+03),\n new google.maps.LatLng( 0.477306190000000E+02, -0.122550233000000E+03),\n new google.maps.LatLng( 0.477260030000000E+02, -0.122553960000000E+03),\n new google.maps.LatLng( 0.477201080000000E+02, -0.122561278000000E+03),\n new google.maps.LatLng( 0.477172510000000E+02, -0.122562700000000E+03),\n new google.maps.LatLng( 0.477128400000000E+02, -0.122567207000000E+03),\n new google.maps.LatLng( 0.477128400000000E+02, -0.122567207000000E+03),\n new google.maps.LatLng( 0.477139580000000E+02, -0.122570806000000E+03),\n new google.maps.LatLng( 0.477216840000000E+02, -0.122569779000000E+03),\n new google.maps.LatLng( 0.477225160000000E+02, -0.122575358000000E+03),\n new google.maps.LatLng( 0.477283800000000E+02, -0.122576183000000E+03),\n new google.maps.LatLng( 0.477297740000000E+02, -0.122575743000000E+03),\n new google.maps.LatLng( 0.477355790000000E+02, -0.122572051000000E+03),\n new google.maps.LatLng( 0.477414400000000E+02, -0.122571031000000E+03),\n new google.maps.LatLng( 0.477442410000000E+02, -0.122573814000000E+03),\n new google.maps.LatLng( 0.477441859946594E+02, -0.122553960865509E+03),\n new google.maps.LatLng( 0.477441859946594E+02, -0.122553960865509E+03),\n new google.maps.LatLng( 0.477317121007947E+02, -0.122549908635166E+03),\n ];\n\n return zipCoords\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.472889990000000E+02, -0.117268914000000E+03),\n new google.maps.LatLng( 0.472887740000000E+02, -0.117227988000000E+03),\n new google.maps.LatLng( 0.472993560000000E+02, -0.117228300000000E+03),\n new google.maps.LatLng( 0.473032640000000E+02, -0.117228000000000E+03),\n new google.maps.LatLng( 0.473034080000000E+02, -0.117187141000000E+03),\n new google.maps.LatLng( 0.473052150000000E+02, -0.117182706000000E+03),\n new google.maps.LatLng( 0.473061520000000E+02, -0.117181463000000E+03),\n new google.maps.LatLng( 0.473084830000000E+02, -0.117179816000000E+03),\n new google.maps.LatLng( 0.473095790000000E+02, -0.117175447000000E+03),\n new google.maps.LatLng( 0.473093730000000E+02, -0.117173599000000E+03),\n new google.maps.LatLng( 0.473014650000000E+02, -0.117169132000000E+03),\n new google.maps.LatLng( 0.472911800000000E+02, -0.117172057000000E+03),\n new google.maps.LatLng( 0.472862440000000E+02, -0.117175048000000E+03),\n new google.maps.LatLng( 0.472828150000000E+02, -0.117174041000000E+03),\n new google.maps.LatLng( 0.472850080000000E+02, -0.117164703000000E+03),\n new google.maps.LatLng( 0.472880700000000E+02, -0.117162384000000E+03),\n new google.maps.LatLng( 0.472929610000000E+02, -0.117164296000000E+03),\n new google.maps.LatLng( 0.473325250000000E+02, -0.117163743000000E+03),\n new google.maps.LatLng( 0.473331390000000E+02, -0.117152816000000E+03),\n new google.maps.LatLng( 0.473408180000000E+02, -0.117152744000000E+03),\n new google.maps.LatLng( 0.473471950000000E+02, -0.117153279000000E+03),\n new google.maps.LatLng( 0.473472600000000E+02, -0.117110361000000E+03),\n new google.maps.LatLng( 0.473327100000000E+02, -0.117110435000000E+03),\n new google.maps.LatLng( 0.473326880006389E+02, -0.117039872049436E+03),\n new google.maps.LatLng( 0.473326880006389E+02, -0.117039872049436E+03),\n new google.maps.LatLng( 0.472592720000000E+02, -0.117040019000000E+03),\n new google.maps.LatLng( 0.472592720000000E+02, -0.117040019000000E+03),\n new google.maps.LatLng( 0.472594220000000E+02, -0.117057693000000E+03),\n new google.maps.LatLng( 0.472594320000000E+02, -0.117058520000000E+03),\n new google.maps.LatLng( 0.472595140000000E+02, -0.117181297000000E+03),\n new google.maps.LatLng( 0.472595140000000E+02, -0.117181297000000E+03),\n new google.maps.LatLng( 0.472596960000000E+02, -0.117239514000000E+03),\n new google.maps.LatLng( 0.472734100000000E+02, -0.117239092000000E+03),\n new google.maps.LatLng( 0.472742540000000E+02, -0.117243055000000E+03),\n new google.maps.LatLng( 0.472743990000000E+02, -0.117283600000000E+03),\n new google.maps.LatLng( 0.472764570000000E+02, -0.117284271000000E+03),\n new google.maps.LatLng( 0.472790390000000E+02, -0.117283027000000E+03),\n new google.maps.LatLng( 0.472824650000000E+02, -0.117274863000000E+03),\n new google.maps.LatLng( 0.472889990000000E+02, -0.117268914000000E+03),\n ];\n\n return zipCoords\n}", "function member_init(arr, bounds) {\n\t\t// var center = bounds.getCenter();\n\t\tvar infowindow = new google.maps.InfoWindow();\n\t\t\n\t\tvar markerArray = [];\n\t\t\n\t\tfor(var i in arr) {\n\t\t\t// console.log(arr[i].location);\n\t\t\tif (arr[i].lat && arr[i].lng) {\n\n\t\t\t\t// console.log(typeof(arr[i].lat))\n\t\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\t\t// need the parseFloat to convert from the Sql string\n\t\t\t\t\tposition: {lat: parseFloat(arr[i].lat), lng: parseFloat(arr[i].lng)},\n\t\t\t\t\tcontent: \"<div style='color: #333'><h4>\"+arr[i].name+\"</h4>\\\n\t\t\t \t\t\t<p>\"+arr[i].town+\" \"+arr[i].state+\"</p></div>\"\n\t\t\t\t})\n\t\t\t\tbounds.extend(marker.position);\n\t\t\t\t// console.log(marker.position)\n\t\t\t\t\n\t\t\t\t// Listeners for events on markers\n\t\t\t\tgoogle.maps.event.addListener(marker, 'click', function () {\n\t\t\t\t\t// if(infowindow){\n\t\t\t\t\t// \tinfowindow.close();\n\t\t\t\t\t// }\n\t\t infowindow.setContent(this.content);\n\t\t infowindow.open(this.getMap(), this);\n\t\t });\n\t\t google.maps.event.addListener(marker, 'mouseover', function () {\n\t\t infowindow.setContent(this.content);\n\t\t infowindow.open(this.getMap(), this);\n\t\t });\n\n\t\t // This is good stuff, closes the infowindow on mouse out\n\t\t google.maps.event.addListener(marker, 'mouseout', function () {\n\t\t infowindow.close();\n\t\t });\n\t\t \n\t\t\t\tmarkerArray.push(marker);\n\t\t\t}\n\t\t} // end for each loop\n\n\t\tvar center = bounds.getCenter();\n\t\tvar map = new google.maps.Map(document.getElementById('umap'), {\n\t\t\tcenter: center, \n\t\t\tzoom: 8,\n\t\t\tscrollwheel: false \n\t\t})\n\t\tmap.fitBounds(bounds)\n\n\t\tgoogle.maps.event.addListener(map, 'click', function() {\n\t infowindow.close();\n\t });\n\t var cent;\n\t google.maps.event.addListener(map, 'idle', function(){\n\t \tcent = map.getCenter();\n\t })\n\t google.maps.event.addDomListener(window, 'resize', function() {\n\t\t\tmap.setCenter(cent);\n\t\t});\n\n\t\tfor(var i in markerArray) {\n\t\t\tmarkerArray[i].setMap(map);\n\t\t}\n\t}", "function drawDetailMap() {\r\n\r\n\t// sub function to get unique list of school and the first record for each school (before array)\r\n\tfunction reformat (array) {\r\n\r\n\t\tvar lookup = {};\r\n\t\tvar schools = [];\r\n\r\n\t\tfor (var item, i = 0; item = array[i++];) {\r\n\t\t\tvar id = item.school_id;\r\n\r\n\t\t\tif (!(id in lookup)) {\r\n\t\t\tlookup[id] = 1;\r\n\t\t\tschools.push({\r\n\t\t\t\tschool_id: item.school_id,\r\n\t\t\t\tinfo: {\r\n\t\t\t\t\tname: item.school,\r\n\t\t\t\t\taddress: item.address,\r\n\t\t\t\t\tcity: item.city,\r\n\t\t\t\t\tstate: item.state,\r\n\t\t\t\t\tzip: item.zip,\r\n\t\t\t\t\tlevel: item.level,\r\n\t\t\t\t\tlat: +item.latitude,\r\n\t\t\t\t\tlon: +item.longitude\r\n\t\t\t\t},\r\n\t\t\t\tbefore: [{\r\n\t\t\t\t\tshort_year: item.short_year,\r\n\t\t\t\t\twhite: item.white,\r\n\t\t\t\t\tblack: item.black,\r\n\t\t\t\t\tother: item.other,\r\n\t\t\t\t\thispanic: item.hispanic,\r\n\t\t\t\t\ttotal: item.total\r\n\t\t\t\t}]\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar after = jLinq.from(array)\r\n\t\t\t.equals(\"short_year\", \"14-15\")\r\n\t\t\t.select(\r\n\t\t\t\tfunction(d){\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tschool_id: d.school_id,\r\n\t\t\t\t\t\tshort_year: d.short_year,\r\n\t\t\t\t\t\twhite: d.white,\r\n\t\t\t\t\t\tblack: d.black,\r\n\t\t\t\t\t\tother: d.other,\r\n\t\t\t\t\t\thispanic: d.hispanic,\r\n\t\t\t\t\t\ttotal: d.total\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n \t\tvar BeforeAfterDataSet = jlinq.from(schools)\r\n\t\t\t.join(\r\n\t\t\t\tafter,\r\n\t\t\t\t\"after\",\r\n\t\t\t\t\"school_id\",\r\n\t\t\t\t\"school_id\")\r\n\t\t\t.select();\r\n\r\n\t\t\treturn BeforeAfterDataSet;\r\n \t} \r\n\r\n \t// run the reformat function on the raw data to transform data for the leaflet part\r\n \tvar school_data = reformat(raw_data);\r\n\r\n\r\n\t// Set the map's boundaries \r\n\t// SW 37.2304,-80.429 (Blacksburg) ; NE 40.217,-74.774 (Trenton) ; C 38.527515, -76.971666 (La Plata)\r\n\r\n\tvar southWest = new L.LatLng(37.2304, -80.429),\r\n\t\tnorthEast = new L.LatLng(40.217, -74.774),\r\n\t\tbounds = new L.LatLngBounds(southWest, northEast);\r\n\r\n\tvar minZ = 9,\r\n\t\tmaxZ = 17;\r\n\r\n\t// build the map in the map-container div\r\n\tvar $map = new L.Map('map', {\r\n\t\tcenter: new L.LatLng(38.527515, -76.971666),\r\n\t\tzoom: 10,\r\n\t\tminZoom: minZ,\r\n\t\tmaxZoom: maxZ,\r\n\t\tmaxBounds: bounds,\r\n\t\ttouchZoom: false,\r\n\t\tdoubleClickZoom: false,\r\n\t\ttapTolerance: 30\r\n\t});\r\n\r\n\tvar url = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';\r\n\tvar attrib ='Map data © <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors';\r\n\tvar layer = new L.TileLayer(url, {minZoom: minZ, maxZoom: maxZ, attribution: attrib});\t\t\r\n\r\n\t// add the OSM layer on top of the Leaflet Map\r\n\t$map.addLayer(layer);\r\n\r\n\t// function for background color on the dots in the map, based on the school level\r\n\tfunction getSchoolLevel(array) {\r\n\t\tif (array.info.level == 'E') {\r\n\t\t\t// brown\r\n\t\t\tschool_colors = '#A34E24'\r\n\t\t}\r\n\t\telse if (array.info.level == 'M') {\r\n\t\t\t// orange\r\n\t\t\tschool_colors = '#EA7D24'\r\n\t\t}\r\n\t\telse if (array.info.level == 'H') {\r\n\t\t\t// green\r\n\t\t\tschool_colors = '#796E24'\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// purple\r\n\t\t\tschool_colors = '#9B539C'\r\n\t\t}\r\n\t\treturn school_colors;\r\n\t}\r\n\r\n\t// function to set position of hover box on map points\r\n\tfunction getPosition(event) {\r\n\t\tposX = event.clientX;\r\n\t\tposY = event.clientY;\r\n\t\t$('#map-hover-box').css({\r\n\t\t\t'left': posX - ($('#map-hover-box').outerWidth(true) / 2),\r\n\t\t\t'top': posY + 15\r\n\t\t});\r\n\t}\r\n\r\n\t// function to show hover box on hover of map points\r\n\tfunction initHover() {\r\n\t\t$('#map-hover-box').show();\r\n\t\t$(document).bind('mousemove', getPosition);\r\n\t}\r\n\r\n\t// function to hide hover box on hover of map points\r\n\tfunction endHover() {\r\n\t\t$('#map-hover-box').hide();\r\n\t\t$(document).unbind('mousemove', getPosition);\r\n\t}\r\n\r\n\t// dummy dot to just create the variable\r\n\tdot = L.CircleMarker.extend([0, 0], {\r\n\t\toptions: {\r\n\t\t\tid: ''\r\n\t\t}\t\t\r\n\t});\r\n\r\n\t//dummy zoom dot to just create the variable\r\n\tzoomDot = new L.CircleMarker([0, 0], {\r\n\t\tstroke: true,\r\n\t\tcolor: '#000',\r\n\t\tweight: 4,\r\n\t\topacity: 1,\r\n\t\tfillOpacity: '0',\r\n\t\tSVG: true,\r\n\t\tVML: true,\r\n\t\tradius: 10,\r\n\t}).addTo($map);\r\n\r\n\t// place a dot on the map and add an item in the list for each school in the school_data var, include tooltip and jQuery triggers\r\n\t$.each(school_data, function(i) {\r\n\t\tif (school_data[i].info) {\r\n\t\t\t$school = new dot([school_data[i].info.lat, school_data[i].info.lon], {\r\n\t\t\t\tstroke: true,\r\n\t\t\t\tcolor: '#222',\r\n\t\t\t\tweight: 1,\r\n\t\t\t\topacity: 1,\r\n\t\t\t\t//fillColor: '#777',\r\n\t\t\t\tfillColor: getSchoolLevel(school_data[i]),\r\n\t\t\t\tfillOpacity: '0.9',\r\n\t\t\t\tSVG: true,\r\n\t\t\t\tVML: true,\r\n\t\t\t\tradius: 5,\r\n\t\t\t\tid: i\r\n\t\t\t}).on('click', function() {\r\n\t\t\t\t$('#' + i).trigger('click');\r\n\t\t\t}).on('tap', function() {\r\n\t\t\t\t$('#' + i).trigger('click');\r\n\t\t\t}).on('mouseover', function(e) {\r\n\t\t\t\tinitHover();\r\n\t\t\t\tlayer = e.target;\r\n\t\t\t\tlayer.setStyle({\r\n\t\t\t\t\tweight: 3,\r\n\t\t\t\t\tcolor: '#000'\r\n\t\t\t\t});\r\n\t\t\t\tlayer.bringToFront();\r\n\t\t\t\t$('#map-hover-box').html(\"<b>\" + school_data[i].info.name + \"</b><br>\"\r\n\t\t\t\t\t\t + school_data[i].info.address + \"<br>\" \r\n\t\t\t\t\t\t + school_data[i].info.city + \", \" + school_data[i].info.state + \"&nbsp\" + school_data[i].info.zip + \"<br>\");\r\n\t\t\t}).on('mouseout', function(e) {\r\n\t\t\t\tvar layer = e.target;\r\n\t\t\t\tlayer.setStyle({\r\n\t\t\t\t\tweight: 1,\r\n\t\t\t\t\tcolor: '#222'\r\n\t\t\t\t});\r\n\t\t\t\tlayer.bringToBack();\r\n\t\t\t\tendHover();\r\n\t\t\t}).addTo($map);\r\n\r\n\t\t\t$('#school-list > ul').append('<li class = \"school-listing\" id=\"' + i + '\"><h5 class = \"upper ral heavier black\">' + school_data[i].info.name + '</h5></li>')\r\n\t\t}\r\n\t});\r\n\r\n\t// display before/after data on the school when a dot is clicked or the school on the list is clicked\r\n\t$('.school-listing').click(function() {\r\n\t\tif ( $(this).hasClass('selected-school') ) {\r\n\t\t\treturn false\r\n\t\t}\r\n\t\t$('.school-listing .inner').remove()\r\n\t\t$('.school-listing').removeClass('selected-school');\r\n\t\t$(this).addClass('selected-school');\r\n\r\n\t\ti = $(this).attr('id')\r\n\t\tzoomCoordinates = [school_data[i].info.lat, school_data[i].info.lon]\r\n\t\tzoomDot.setLatLng(zoomCoordinates);\r\n\t\t$map.setView(zoomCoordinates, 12)\r\n\t\r\n\t\t$(this).append (\r\n\t\t\t'<div class = \"inner upper ral normal black\">' \r\n\t\t\t\t+ school_data[i].info.address + ', ' + school_data[i].info.city + ', ' + school_data[i].info.state + '&nbsp;' + school_data[i].info.zip + '<br/>'\r\n\t\t\t\t\t+ '<br/>'\r\n\t\t\t\t\t+ '<table>'\r\n\t\t\t\t\t\t+ '<tr class = \"heavier\">'\r\n\t\t\t\t\t\t\t+ '<td> Year </td> <td> White </td> <td> Black </td> <td> Other </td> <td> Hispanic </td> <td> Total </td>'\r\n\t\t\t\t\t\t+ '</tr>'\r\n\t\t\t\t\t\t+ '<tr>'\r\n\t\t\t\t\t\t\t+ '<td>' + school_data[i].before[0].short_year + ' (#) </td>' \t\t\t\t\r\n\t\t\t\t\t\t\t+ '<td class = \"white\"> ' + school_data[i].before[0].white + '</td>' \r\n\t\t\t\t\t\t\t+ '<td class = \"black\"> ' + school_data[i].before[0].black + '</td>' \r\n\t\t\t\t\t\t\t+ '<td class = \"other\"> ' + school_data[i].before[0].other + '</td>'\r\n\t\t\t\t\t\t\t+ '<td class = \"hispanic\"> ' + school_data[i].before[0].hispanic + '</td>' \r\n\t\t\t\t\t\t\t+ '<td> ' + school_data[i].before[0].total + '</td>'\r\n\t\t\t\t\t\t+ '</tr>'\r\n\t\t\t\t\t\t+ '<tr>'\r\n\t\t\t\t\t\t\t+ '<td>' + school_data[i].before[0].short_year + ' (%) </td>' \t\t\t\t\r\n\t\t\t\t\t\t\t+ '<td class = \"white\"> ' + ((school_data[i].before[0].white / school_data[i].before[0].total) * 100).toFixed(2) + '% </td>' \r\n\t\t\t\t\t\t\t+ '<td class = \"black\"> ' + ((school_data[i].before[0].black / school_data[i].before[0].total) * 100).toFixed(2) + '% </td>' \r\n\t\t\t\t\t\t\t+ '<td class = \"other\"> ' + ((school_data[i].before[0].other / school_data[i].before[0].total) * 100).toFixed(2) + '% </td>'\r\n\t\t\t\t\t\t\t+ '<td class = \"hispanic\"> ' + ((school_data[i].before[0].hispanic / school_data[i].before[0].total) * 100).toFixed(2) + '% </td>' \r\n\t\t\t\t\t\t\t+ '<td> &nbsp; </td>'\r\n\t\t\t\t\t\t+ '</tr>'\r\n\t\t\t\t\t\t+ '<tr><td colspan=6>&nbsp;</td></tr>'\r\n\t\t\t\t\t\t+ '<tr>'\r\n\t\t\t\t\t\t\t+ '<td>' + school_data[i].after[0].short_year + ' (#) </td>' \t\t\t\t\r\n\t\t\t\t\t\t\t+ '<td class = \"white\"> ' + school_data[i].after[0].white + '</td>' \r\n\t\t\t\t\t\t\t+ '<td class = \"black\"> ' + school_data[i].after[0].black + '</td>' \r\n\t\t\t\t\t\t\t+ '<td class = \"other\"> ' + school_data[i].after[0].other + '</td>'\r\n\t\t\t\t\t\t\t+ '<td class = \"hispanic\"> ' + school_data[i].after[0].hispanic + '</td>' \r\n\t\t\t\t\t\t\t+ '<td> ' + school_data[i].after[0].total + '</td>'\r\n\t\t\t\t\t\t+ '</tr>' \r\n\t\t\t\t\t\t+ '<tr>'\r\n\t\t\t\t\t\t\t+ '<td>' + school_data[i].after[0].short_year + ' (%) </td>' \t\t\t\t\r\n\t\t\t\t\t\t\t+ '<td class = \"white\"> ' + ((school_data[i].after[0].white / school_data[i].after[0].total) * 100).toFixed(2) + '% </td>' \r\n\t\t\t\t\t\t\t+ '<td class = \"black\"> ' + ((school_data[i].after[0].black / school_data[i].after[0].total) * 100).toFixed(2) + '% </td>' \r\n\t\t\t\t\t\t\t+ '<td class = \"other\"> ' + ((school_data[i].after[0].other / school_data[i].after[0].total) * 100).toFixed(2) + '% </td>'\r\n\t\t\t\t\t\t\t+ '<td class = \"hispanic\"> ' + ((school_data[i].after[0].hispanic / school_data[i].after[0].total) * 100).toFixed(2) + '% </td>' \r\n\t\t\t\t\t\t\t+ '<td> &nbsp; </td>'\r\n\t\t\t\t\t\t+ '</tr>'\t\t\t\t\t\r\n\t\t\t\t\t+ '</table>'\t\t\t\r\n\t\t\t+ '</div>'\r\n\t\t)\r\n\r\n\t\t$('.selected-school')[0].scrollIntoView()\r\n\t\t$('#school-list').scrollTop($('#school-list').scrollTop() - 33)\r\n\t\t$(document).scrollTop($(document).scrollTop() - 120)\r\n\r\n\t})\r\n} // closes the draw function", "function DecodeMap(width, height, rawMap) {\r\n //Create 2D array of true/false values for if there is a wall from the rawMap\r\n result = []\r\n for (var h = 0; h < height; h++) {\r\n boolRow = []\r\n for (var w = 0; w < width; w++) {\r\n tileValue = rawMap.substring((h * width) + w, (h * width) + w + 1);\r\n if (tileValue == \"1\") {\r\n boolRow.push(true)\r\n } else {\r\n boolRow.push(false)\r\n }\r\n }\r\n result.push(boolRow)\r\n }\r\n\r\n return result;\r\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.473830570000000E+02, -0.119086364000000E+03),\n new google.maps.LatLng( 0.473694350000000E+02, -0.119086665000000E+03),\n new google.maps.LatLng( 0.473506750000000E+02, -0.119085916000000E+03),\n new google.maps.LatLng( 0.473020300000000E+02, -0.119085959000000E+03),\n new google.maps.LatLng( 0.472994710000000E+02, -0.119088007000000E+03),\n new google.maps.LatLng( 0.472970930000000E+02, -0.119091566000000E+03),\n new google.maps.LatLng( 0.472921120000000E+02, -0.119092369000000E+03),\n new google.maps.LatLng( 0.472895300000000E+02, -0.119094080000000E+03),\n new google.maps.LatLng( 0.472872900000000E+02, -0.119096430000000E+03),\n new google.maps.LatLng( 0.472871270000000E+02, -0.119106672000000E+03),\n new google.maps.LatLng( 0.472619230000000E+02, -0.119106953000000E+03),\n new google.maps.LatLng( 0.472616330000000E+02, -0.119086546000000E+03),\n new google.maps.LatLng( 0.472259030000000E+02, -0.119087337000000E+03),\n new google.maps.LatLng( 0.471744700000000E+02, -0.119086776000000E+03),\n new google.maps.LatLng( 0.471596170000000E+02, -0.119087037000000E+03),\n new google.maps.LatLng( 0.471592070000000E+02, -0.119085429000000E+03),\n new google.maps.LatLng( 0.471593450000000E+02, -0.119044492000000E+03),\n new google.maps.LatLng( 0.471292520000000E+02, -0.119044635000000E+03),\n new google.maps.LatLng( 0.471300970000000E+02, -0.119043530000000E+03),\n new google.maps.LatLng( 0.471302720000000E+02, -0.118981103000000E+03),\n new google.maps.LatLng( 0.471302720000000E+02, -0.118981103000000E+03),\n new google.maps.LatLng( 0.471155220000000E+02, -0.118981074000000E+03),\n new google.maps.LatLng( 0.471155220000000E+02, -0.118981074000000E+03),\n new google.maps.LatLng( 0.471156110000000E+02, -0.119023425000000E+03),\n new google.maps.LatLng( 0.471022580000000E+02, -0.119023425000000E+03),\n new google.maps.LatLng( 0.471022590000000E+02, -0.119044774000000E+03),\n new google.maps.LatLng( 0.470978210000000E+02, -0.119044750000000E+03),\n new google.maps.LatLng( 0.470982100000000E+02, -0.119053383000000E+03),\n new google.maps.LatLng( 0.470989650000000E+02, -0.119054722000000E+03),\n new google.maps.LatLng( 0.471016840000000E+02, -0.119056428000000E+03),\n new google.maps.LatLng( 0.471019810000000E+02, -0.119058034000000E+03),\n new google.maps.LatLng( 0.470985310000000E+02, -0.119062618000000E+03),\n new google.maps.LatLng( 0.470951260000000E+02, -0.119062518000000E+03),\n new google.maps.LatLng( 0.470941430000000E+02, -0.119062886000000E+03),\n new google.maps.LatLng( 0.470935950000000E+02, -0.119063722000000E+03),\n new google.maps.LatLng( 0.470935950000000E+02, -0.119066867000000E+03),\n new google.maps.LatLng( 0.470947140000000E+02, -0.119073895000000E+03),\n new google.maps.LatLng( 0.470898460000000E+02, -0.119082525000000E+03),\n new google.maps.LatLng( 0.470868750000000E+02, -0.119083928000000E+03),\n new google.maps.LatLng( 0.470864850000000E+02, -0.119091121000000E+03),\n new google.maps.LatLng( 0.470857550000000E+02, -0.119086939000000E+03),\n new google.maps.LatLng( 0.470854950000000E+02, -0.119077117000000E+03),\n new google.maps.LatLng( 0.470839290000000E+02, -0.119076501000000E+03),\n new google.maps.LatLng( 0.470716350000000E+02, -0.119076965000000E+03),\n new google.maps.LatLng( 0.470716790000000E+02, -0.119087601000000E+03),\n new google.maps.LatLng( 0.470569640000000E+02, -0.119087594000000E+03),\n new google.maps.LatLng( 0.470544960000000E+02, -0.119088060000000E+03),\n new google.maps.LatLng( 0.470496730000000E+02, -0.119094075000000E+03),\n new google.maps.LatLng( 0.470475470000000E+02, -0.119098921000000E+03),\n new google.maps.LatLng( 0.470466770000000E+02, -0.119102397000000E+03),\n new google.maps.LatLng( 0.470424230000000E+02, -0.119111620000000E+03),\n new google.maps.LatLng( 0.470359770000000E+02, -0.119115357000000E+03),\n new google.maps.LatLng( 0.470325950000000E+02, -0.119115889000000E+03),\n new google.maps.LatLng( 0.470311100000000E+02, -0.119115085000000E+03),\n new google.maps.LatLng( 0.470299900000000E+02, -0.119116020000000E+03),\n new google.maps.LatLng( 0.470231330000000E+02, -0.119126942000000E+03),\n new google.maps.LatLng( 0.470233880000000E+02, -0.119133792000000E+03),\n new google.maps.LatLng( 0.470227270000000E+02, -0.119136633000000E+03),\n new google.maps.LatLng( 0.470222010000000E+02, -0.119137001000000E+03),\n new google.maps.LatLng( 0.470217670000000E+02, -0.119136300000000E+03),\n new google.maps.LatLng( 0.470216730000000E+02, -0.119131756000000E+03),\n new google.maps.LatLng( 0.470212380000000E+02, -0.119130453000000E+03),\n new google.maps.LatLng( 0.470206210000000E+02, -0.119130053000000E+03),\n new google.maps.LatLng( 0.470177650000000E+02, -0.119130290000000E+03),\n new google.maps.LatLng( 0.470173100000000E+02, -0.119132963000000E+03),\n new google.maps.LatLng( 0.470187280000000E+02, -0.119136136000000E+03),\n new google.maps.LatLng( 0.470178600000000E+02, -0.119137239000000E+03),\n new google.maps.LatLng( 0.470165120000000E+02, -0.119137073000000E+03),\n new google.maps.LatLng( 0.470135630000000E+02, -0.119134571000000E+03),\n new google.maps.LatLng( 0.470115070000000E+02, -0.119135642000000E+03),\n new google.maps.LatLng( 0.470086760000000E+02, -0.119140187000000E+03),\n new google.maps.LatLng( 0.470077860000000E+02, -0.119142526000000E+03),\n new google.maps.LatLng( 0.470079230000000E+02, -0.119143829000000E+03),\n new google.maps.LatLng( 0.470089290000000E+02, -0.119144930000000E+03),\n new google.maps.LatLng( 0.470084510000000E+02, -0.119149373000000E+03),\n new google.maps.LatLng( 0.470037210000000E+02, -0.119150513000000E+03),\n new google.maps.LatLng( 0.470033330000000E+02, -0.119150246000000E+03),\n new google.maps.LatLng( 0.470003060000000E+02, -0.119153088000000E+03),\n new google.maps.LatLng( 0.469933830000000E+02, -0.119161512000000E+03),\n new google.maps.LatLng( 0.469907790000000E+02, -0.119166055000000E+03),\n new google.maps.LatLng( 0.469917620000000E+02, -0.119169527000000E+03),\n new google.maps.LatLng( 0.469917620000000E+02, -0.119169527000000E+03),\n new google.maps.LatLng( 0.469940470000000E+02, -0.119170695000000E+03),\n new google.maps.LatLng( 0.469943440000000E+02, -0.119171530000000E+03),\n new google.maps.LatLng( 0.469916260000000E+02, -0.119181115000000E+03),\n new google.maps.LatLng( 0.469920830000000E+02, -0.119185456000000E+03),\n new google.maps.LatLng( 0.469959440000000E+02, -0.119189030000000E+03),\n new google.maps.LatLng( 0.469936590000000E+02, -0.119193571000000E+03),\n new google.maps.LatLng( 0.469917610000000E+02, -0.119204257000000E+03),\n new google.maps.LatLng( 0.469923320000000E+02, -0.119205293000000E+03),\n new google.maps.LatLng( 0.469970610000000E+02, -0.119208333000000E+03),\n new google.maps.LatLng( 0.469988880000000E+02, -0.119213711000000E+03),\n new google.maps.LatLng( 0.469985220000000E+02, -0.119214280000000E+03),\n new google.maps.LatLng( 0.469970140000000E+02, -0.119212975000000E+03),\n new google.maps.LatLng( 0.469964440000000E+02, -0.119210571000000E+03),\n new google.maps.LatLng( 0.469942966793945E+02, -0.119207851896289E+03),\n new google.maps.LatLng( 0.469918750000000E+02, -0.119206494000000E+03),\n new google.maps.LatLng( 0.469894530000000E+02, -0.119207595000000E+03),\n new google.maps.LatLng( 0.469889120000000E+02, -0.119208719000000E+03),\n new google.maps.LatLng( 0.469896340000000E+02, -0.119213773000000E+03),\n new google.maps.LatLng( 0.469904790000000E+02, -0.119215710000000E+03),\n new google.maps.LatLng( 0.469928090000000E+02, -0.119218551000000E+03),\n new google.maps.LatLng( 0.469932650000000E+02, -0.119219953000000E+03),\n new google.maps.LatLng( 0.469912730000000E+02, -0.119232073000000E+03),\n new google.maps.LatLng( 0.469903130000000E+02, -0.119233141000000E+03),\n new google.maps.LatLng( 0.469892150000000E+02, -0.119235711000000E+03),\n new google.maps.LatLng( 0.469871990000000E+02, -0.119245827000000E+03),\n new google.maps.LatLng( 0.469869280000000E+02, -0.119257238000000E+03),\n new google.maps.LatLng( 0.469895830000000E+02, -0.119267955000000E+03),\n new google.maps.LatLng( 0.469944060000000E+02, -0.119277803000000E+03),\n new google.maps.LatLng( 0.469951600000000E+02, -0.119278003000000E+03),\n new google.maps.LatLng( 0.469957540000000E+02, -0.119277368000000E+03),\n new google.maps.LatLng( 0.469956620000000E+02, -0.119274195000000E+03),\n new google.maps.LatLng( 0.469958450000000E+02, -0.119273894000000E+03),\n new google.maps.LatLng( 0.469966680000000E+02, -0.119274228000000E+03),\n new google.maps.LatLng( 0.469976730000000E+02, -0.119278736000000E+03),\n new google.maps.LatLng( 0.469970800000000E+02, -0.119281241000000E+03),\n new google.maps.LatLng( 0.469972860000000E+02, -0.119282777000000E+03),\n new google.maps.LatLng( 0.469991600000000E+02, -0.119285682000000E+03),\n new google.maps.LatLng( 0.470074060000000E+02, -0.119294324000000E+03),\n new google.maps.LatLng( 0.470108340000000E+02, -0.119297162000000E+03),\n new google.maps.LatLng( 0.470202250000000E+02, -0.119301770000000E+03),\n new google.maps.LatLng( 0.470305530000000E+02, -0.119308686000000E+03),\n new google.maps.LatLng( 0.470374300000000E+02, -0.119316940000000E+03),\n new google.maps.LatLng( 0.470436670000000E+02, -0.119326668000000E+03),\n new google.maps.LatLng( 0.470435290000000E+02, -0.119331447000000E+03),\n new google.maps.LatLng( 0.470427280000000E+02, -0.119335625000000E+03),\n new google.maps.LatLng( 0.470419376207031E+02, -0.119335431601172E+03),\n new google.maps.LatLng( 0.470419070000000E+02, -0.119331580000000E+03),\n new google.maps.LatLng( 0.470426150000000E+02, -0.119331681000000E+03),\n new google.maps.LatLng( 0.470426150000000E+02, -0.119330912000000E+03),\n new google.maps.LatLng( 0.470411990000000E+02, -0.119325865000000E+03),\n new google.maps.LatLng( 0.470401710000000E+02, -0.119325263000000E+03),\n new google.maps.LatLng( 0.470387090000000E+02, -0.119325697000000E+03),\n new google.maps.LatLng( 0.470355550000000E+02, -0.119331177000000E+03),\n new google.maps.LatLng( 0.470348920000000E+02, -0.119333917000000E+03),\n new google.maps.LatLng( 0.470362170000000E+02, -0.119335087000000E+03),\n new google.maps.LatLng( 0.470397112083008E+02, -0.119336369380273E+03),\n new google.maps.LatLng( 0.470414650000000E+02, -0.119338658000000E+03),\n new google.maps.LatLng( 0.470418110000000E+02, -0.119347657000000E+03),\n new google.maps.LatLng( 0.470388404357422E+02, -0.119349440988867E+03),\n new google.maps.LatLng( 0.470383058357422E+02, -0.119348818788867E+03),\n new google.maps.LatLng( 0.470353220000000E+02, -0.119348856000000E+03),\n new google.maps.LatLng( 0.470346590000000E+02, -0.119349591000000E+03),\n new google.maps.LatLng( 0.470367820000000E+02, -0.119355039000000E+03),\n new google.maps.LatLng( 0.470373310000000E+02, -0.119353870000000E+03),\n new google.maps.LatLng( 0.470386380191406E+02, -0.119352768932617E+03),\n new google.maps.LatLng( 0.470402080000000E+02, -0.119358719000000E+03),\n new google.maps.LatLng( 0.470394980000000E+02, -0.119362093000000E+03),\n new google.maps.LatLng( 0.470348810000000E+02, -0.119366200000000E+03),\n new google.maps.LatLng( 0.470336920000000E+02, -0.119368572000000E+03),\n new google.maps.LatLng( 0.470343990000000E+02, -0.119370344000000E+03),\n new google.maps.LatLng( 0.470364780000000E+02, -0.119371014000000E+03),\n new google.maps.LatLng( 0.470375970000000E+02, -0.119372519000000E+03),\n new google.maps.LatLng( 0.470378930000000E+02, -0.119374157000000E+03),\n new google.maps.LatLng( 0.470382590000000E+02, -0.119374224000000E+03),\n new google.maps.LatLng( 0.470384420000000E+02, -0.119372487000000E+03),\n new google.maps.LatLng( 0.470388060000000E+02, -0.119375228000000E+03),\n new google.maps.LatLng( 0.470379840000000E+02, -0.119375528000000E+03),\n new google.maps.LatLng( 0.470364530000000E+02, -0.119375192000000E+03),\n new google.maps.LatLng( 0.470379190000000E+02, -0.119378180000000E+03),\n new google.maps.LatLng( 0.470391060000000E+02, -0.119376975000000E+03),\n new google.maps.LatLng( 0.470395150000000E+02, -0.119375262000000E+03),\n new google.maps.LatLng( 0.470400400000000E+02, -0.119375733000000E+03),\n new google.maps.LatLng( 0.470396770000000E+02, -0.119377309000000E+03),\n new google.maps.LatLng( 0.470403870000000E+02, -0.119380383000000E+03),\n new google.maps.LatLng( 0.470409590000000E+02, -0.119382254000000E+03),\n new google.maps.LatLng( 0.470417130000000E+02, -0.119382487000000E+03),\n new google.maps.LatLng( 0.470417590000000E+02, -0.119385262000000E+03),\n new google.maps.LatLng( 0.470414170000000E+02, -0.119385529000000E+03),\n new google.maps.LatLng( 0.470425140000000E+02, -0.119387199000000E+03),\n new google.maps.LatLng( 0.470428800000000E+02, -0.119387065000000E+03),\n new google.maps.LatLng( 0.470429700000000E+02, -0.119384626000000E+03),\n new google.maps.LatLng( 0.470434960000000E+02, -0.119385761000000E+03),\n new google.maps.LatLng( 0.470448220000000E+02, -0.119386729000000E+03),\n new google.maps.LatLng( 0.470456440000000E+02, -0.119386528000000E+03),\n new google.maps.LatLng( 0.470460090000000E+02, -0.119384857000000E+03),\n new google.maps.LatLng( 0.470473120000000E+02, -0.119386627000000E+03),\n new google.maps.LatLng( 0.470463760000000E+02, -0.119388800000000E+03),\n new google.maps.LatLng( 0.470469470000000E+02, -0.119389000000000E+03),\n new google.maps.LatLng( 0.470479520000000E+02, -0.119388030000000E+03),\n new google.maps.LatLng( 0.470486610000000E+02, -0.119388330000000E+03),\n new google.maps.LatLng( 0.470490040000000E+02, -0.119389533000000E+03),\n new google.maps.LatLng( 0.470507860000000E+02, -0.119389833000000E+03),\n new google.maps.LatLng( 0.470518380000000E+02, -0.119390901000000E+03),\n new google.maps.LatLng( 0.470513570000000E+02, -0.119388996000000E+03),\n new google.maps.LatLng( 0.470525000000000E+02, -0.119389697000000E+03),\n new google.maps.LatLng( 0.470526600000000E+02, -0.119391034000000E+03),\n new google.maps.LatLng( 0.470518380000000E+02, -0.119391871000000E+03),\n new google.maps.LatLng( 0.470509095575195E+02, -0.119391061316992E+03),\n new google.maps.LatLng( 0.470494390000000E+02, -0.119391137000000E+03),\n new google.maps.LatLng( 0.470511990000000E+02, -0.119393543000000E+03),\n new google.maps.LatLng( 0.470488680000000E+02, -0.119392943000000E+03),\n new google.maps.LatLng( 0.470480460000000E+02, -0.119394481000000E+03),\n new google.maps.LatLng( 0.470504450000000E+02, -0.119394112000000E+03),\n new google.maps.LatLng( 0.470517710000000E+02, -0.119395247000000E+03),\n new google.maps.LatLng( 0.470518850000000E+02, -0.119396584000000E+03),\n new google.maps.LatLng( 0.470525480000000E+02, -0.119397286000000E+03),\n new google.maps.LatLng( 0.470522740000000E+02, -0.119398489000000E+03),\n new google.maps.LatLng( 0.470513380000000E+02, -0.119398523000000E+03),\n new google.maps.LatLng( 0.470513380000000E+02, -0.119399192000000E+03),\n new google.maps.LatLng( 0.470519780000000E+02, -0.119399860000000E+03),\n new google.maps.LatLng( 0.470531890000000E+02, -0.119399291000000E+03),\n new google.maps.LatLng( 0.470530980000000E+02, -0.119400462000000E+03),\n new google.maps.LatLng( 0.470519550000000E+02, -0.119401031000000E+03),\n new google.maps.LatLng( 0.470516820000000E+02, -0.119402301000000E+03),\n new google.maps.LatLng( 0.470524360000000E+02, -0.119403504000000E+03),\n new google.maps.LatLng( 0.470532810000000E+02, -0.119402367000000E+03),\n new google.maps.LatLng( 0.470547210000000E+02, -0.119403703000000E+03),\n new google.maps.LatLng( 0.470535570000000E+02, -0.119409420000000E+03),\n new google.maps.LatLng( 0.470545400000000E+02, -0.119409721000000E+03),\n new google.maps.LatLng( 0.470554980000000E+02, -0.119405441000000E+03),\n new google.maps.LatLng( 0.470552020000000E+02, -0.119407781000000E+03),\n new google.maps.LatLng( 0.470557500000000E+02, -0.119407948000000E+03),\n new google.maps.LatLng( 0.470559790000000E+02, -0.119409152000000E+03),\n new google.maps.LatLng( 0.470547450000000E+02, -0.119411024000000E+03),\n new google.maps.LatLng( 0.470544720000000E+02, -0.119413398000000E+03),\n new google.maps.LatLng( 0.470548370000000E+02, -0.119413565000000E+03),\n new google.maps.LatLng( 0.470553170000000E+02, -0.119410924000000E+03),\n new google.maps.LatLng( 0.470563680000000E+02, -0.119411157000000E+03),\n new google.maps.LatLng( 0.470561400000000E+02, -0.119413932000000E+03),\n new google.maps.LatLng( 0.470579900000000E+02, -0.119414032000000E+03),\n new google.maps.LatLng( 0.470586300000000E+02, -0.119415202000000E+03),\n new google.maps.LatLng( 0.470578310000000E+02, -0.119419081000000E+03),\n new google.maps.LatLng( 0.470567800000000E+02, -0.119419850000000E+03),\n new google.maps.LatLng( 0.470561860000000E+02, -0.119418980000000E+03),\n new google.maps.LatLng( 0.470557300000000E+02, -0.119421756000000E+03),\n new google.maps.LatLng( 0.470565520000000E+02, -0.119421722000000E+03),\n new google.maps.LatLng( 0.470569860000000E+02, -0.119422190000000E+03),\n new google.maps.LatLng( 0.470562100000000E+02, -0.119425801000000E+03),\n new google.maps.LatLng( 0.470545190000000E+02, -0.119426035000000E+03),\n new google.maps.LatLng( 0.470524630000000E+02, -0.119425434000000E+03),\n new google.maps.LatLng( 0.470525090000000E+02, -0.119424030000000E+03),\n new google.maps.LatLng( 0.470531250000000E+02, -0.119423094000000E+03),\n new google.maps.LatLng( 0.470531710000000E+02, -0.119424264000000E+03),\n new google.maps.LatLng( 0.470535140000000E+02, -0.119424097000000E+03),\n new google.maps.LatLng( 0.470545640000000E+02, -0.119416373000000E+03),\n new google.maps.LatLng( 0.470540380000000E+02, -0.119416507000000E+03),\n new google.maps.LatLng( 0.470532160000000E+02, -0.119418714000000E+03),\n new google.maps.LatLng( 0.470526220000000E+02, -0.119421389000000E+03),\n new google.maps.LatLng( 0.470532390000000E+02, -0.119420252000000E+03),\n new google.maps.LatLng( 0.470532620000000E+02, -0.119421255000000E+03),\n new google.maps.LatLng( 0.470526910000000E+02, -0.119422626000000E+03),\n new google.maps.LatLng( 0.470521430000000E+02, -0.119421222000000E+03),\n new google.maps.LatLng( 0.470528040000000E+02, -0.119416140000000E+03),\n new google.maps.LatLng( 0.470522100000000E+02, -0.119416341000000E+03),\n new google.maps.LatLng( 0.470520500000000E+02, -0.119416006000000E+03),\n new google.maps.LatLng( 0.470521190000000E+02, -0.119414268000000E+03),\n new google.maps.LatLng( 0.470503590000000E+02, -0.119410525000000E+03),\n new google.maps.LatLng( 0.470497190000000E+02, -0.119410793000000E+03),\n new google.maps.LatLng( 0.470495590000000E+02, -0.119411695000000E+03),\n new google.maps.LatLng( 0.470480970000000E+02, -0.119410727000000E+03),\n new google.maps.LatLng( 0.470472740000000E+02, -0.119410928000000E+03),\n new google.maps.LatLng( 0.470468630000000E+02, -0.119411997000000E+03),\n new google.maps.LatLng( 0.470478230000000E+02, -0.119413200000000E+03),\n new google.maps.LatLng( 0.470490340000000E+02, -0.119413601000000E+03),\n new google.maps.LatLng( 0.470487150000000E+02, -0.119416576000000E+03),\n new google.maps.LatLng( 0.470484410000000E+02, -0.119417011000000E+03),\n new google.maps.LatLng( 0.470461100000000E+02, -0.119414638000000E+03),\n new google.maps.LatLng( 0.470460870000000E+02, -0.119416477000000E+03),\n new google.maps.LatLng( 0.470453340000000E+02, -0.119418115000000E+03),\n new google.maps.LatLng( 0.470461560000000E+02, -0.119419251000000E+03),\n new google.maps.LatLng( 0.470466902000000E+02, -0.119417599114062E+03),\n new google.maps.LatLng( 0.470473210000000E+02, -0.119417212000000E+03),\n new google.maps.LatLng( 0.470479150000000E+02, -0.119418415000000E+03),\n new google.maps.LatLng( 0.470478930000000E+02, -0.119420420000000E+03),\n new google.maps.LatLng( 0.470495140000000E+02, -0.119415907000000E+03),\n new google.maps.LatLng( 0.470499030000000E+02, -0.119417211000000E+03),\n new google.maps.LatLng( 0.470494000000000E+02, -0.119417645000000E+03),\n new google.maps.LatLng( 0.470488980000000E+02, -0.119420821000000E+03),\n new google.maps.LatLng( 0.470499582162109E+02, -0.119419049157031E+03),\n new google.maps.LatLng( 0.470501090000000E+02, -0.119421122000000E+03),\n new google.maps.LatLng( 0.470512730000000E+02, -0.119414736000000E+03),\n new google.maps.LatLng( 0.470515710000000E+02, -0.119416876000000E+03),\n new google.maps.LatLng( 0.470501320000000E+02, -0.119422894000000E+03),\n new google.maps.LatLng( 0.470502240000000E+02, -0.119424900000000E+03),\n new google.maps.LatLng( 0.470493560000000E+02, -0.119425100000000E+03),\n new google.maps.LatLng( 0.470487840000000E+02, -0.119424164000000E+03),\n new google.maps.LatLng( 0.470451970000000E+02, -0.119424433000000E+03),\n new google.maps.LatLng( 0.470440090000000E+02, -0.119422260000000E+03),\n new google.maps.LatLng( 0.470425020000000E+02, -0.119427842000000E+03),\n new google.maps.LatLng( 0.470420680000000E+02, -0.119427809000000E+03),\n new google.maps.LatLng( 0.470420450000000E+02, -0.119427274000000E+03),\n new google.maps.LatLng( 0.470432780000000E+02, -0.119422963000000E+03),\n new google.maps.LatLng( 0.470423499472656E+02, -0.119424266874219E+03),\n new google.maps.LatLng( 0.470427980000000E+02, -0.119421357000000E+03),\n new google.maps.LatLng( 0.470421810000000E+02, -0.119421057000000E+03),\n new google.maps.LatLng( 0.470415870000000E+02, -0.119422093000000E+03),\n new google.maps.LatLng( 0.470417930000000E+02, -0.119423464000000E+03),\n new google.maps.LatLng( 0.470409250000000E+02, -0.119426172000000E+03),\n new google.maps.LatLng( 0.470413130000000E+02, -0.119420923000000E+03),\n new google.maps.LatLng( 0.470399870000000E+02, -0.119417014000000E+03),\n new google.maps.LatLng( 0.470391190000000E+02, -0.119416479000000E+03),\n new google.maps.LatLng( 0.470376800000000E+02, -0.119418218000000E+03),\n new google.maps.LatLng( 0.470370170000000E+02, -0.119418285000000E+03),\n new google.maps.LatLng( 0.470364460000000E+02, -0.119416848000000E+03),\n new google.maps.LatLng( 0.470354630000000E+02, -0.119417182000000E+03),\n new google.maps.LatLng( 0.470351670000000E+02, -0.119418018000000E+03),\n new google.maps.LatLng( 0.470365380000000E+02, -0.119420056000000E+03),\n new google.maps.LatLng( 0.470374290000000E+02, -0.119420089000000E+03),\n new google.maps.LatLng( 0.470379310000000E+02, -0.119418819000000E+03),\n new google.maps.LatLng( 0.470393250000000E+02, -0.119417783000000E+03),\n new google.maps.LatLng( 0.470408790000000E+02, -0.119423799000000E+03),\n new google.maps.LatLng( 0.470402400000000E+02, -0.119425470000000E+03),\n new google.maps.LatLng( 0.470381150000000E+02, -0.119426740000000E+03),\n new google.maps.LatLng( 0.470364240000000E+02, -0.119427008000000E+03),\n new google.maps.LatLng( 0.470359220000000E+02, -0.119425203000000E+03),\n new google.maps.LatLng( 0.470354190000000E+02, -0.119425404000000E+03),\n new google.maps.LatLng( 0.470339800000000E+02, -0.119432422000000E+03),\n new google.maps.LatLng( 0.470348710000000E+02, -0.119432555000000E+03),\n new google.maps.LatLng( 0.470357160000000E+02, -0.119431453000000E+03),\n new google.maps.LatLng( 0.470360820000000E+02, -0.119434661000000E+03),\n new google.maps.LatLng( 0.470356250000000E+02, -0.119436565000000E+03),\n new google.maps.LatLng( 0.470330430000000E+02, -0.119438971000000E+03),\n new google.maps.LatLng( 0.470314670000000E+02, -0.119439940000000E+03),\n new google.maps.LatLng( 0.470284280000000E+02, -0.119438771000000E+03),\n new google.maps.LatLng( 0.470266920000000E+02, -0.119434728000000E+03),\n new google.maps.LatLng( 0.470223050000000E+02, -0.119432523000000E+03),\n new google.maps.LatLng( 0.470189690000000E+02, -0.119429215000000E+03),\n new google.maps.LatLng( 0.470074280000000E+02, -0.119410579000000E+03),\n new google.maps.LatLng( 0.470074510000000E+02, -0.119408976000000E+03),\n new google.maps.LatLng( 0.470086850000000E+02, -0.119409610000000E+03),\n new google.maps.LatLng( 0.470087760000000E+02, -0.119408675000000E+03),\n new google.maps.LatLng( 0.470058500000000E+02, -0.119404034000000E+03),\n new google.maps.LatLng( 0.470054390000000E+02, -0.119404101000000E+03),\n new google.maps.LatLng( 0.470044340000000E+02, -0.119406239000000E+03),\n new google.maps.LatLng( 0.470029480000000E+02, -0.119403468000000E+03),\n new google.maps.LatLng( 0.470006150000000E+02, -0.119392381000000E+03),\n new google.maps.LatLng( 0.469993510000000E+02, -0.119376531000000E+03),\n new google.maps.LatLng( 0.469977270000000E+02, -0.119374416000000E+03),\n new google.maps.LatLng( 0.469958600000000E+02, -0.119362159000000E+03),\n new google.maps.LatLng( 0.469948560000000E+02, -0.119358952000000E+03),\n new google.maps.LatLng( 0.469859040000000E+02, -0.119347992000000E+03),\n new google.maps.LatLng( 0.469842420000000E+02, -0.119349393000000E+03),\n new google.maps.LatLng( 0.469833890000000E+02, -0.119351529000000E+03),\n new google.maps.LatLng( 0.469833890000000E+02, -0.119351529000000E+03),\n new google.maps.LatLng( 0.469823570000000E+02, -0.119361778000000E+03),\n new google.maps.LatLng( 0.469807530000000E+02, -0.119370657000000E+03),\n new google.maps.LatLng( 0.469793390000000E+02, -0.119384892000000E+03),\n new google.maps.LatLng( 0.469800490000000E+02, -0.119387729000000E+03),\n new google.maps.LatLng( 0.469810550000000E+02, -0.119388763000000E+03),\n new google.maps.LatLng( 0.469816760000000E+02, -0.119400781000000E+03),\n new google.maps.LatLng( 0.469787090000000E+02, -0.119415438000000E+03),\n new google.maps.LatLng( 0.469774530000000E+02, -0.119419411000000E+03),\n new google.maps.LatLng( 0.469760820000000E+02, -0.119421114000000E+03),\n new google.maps.LatLng( 0.469717420000000E+02, -0.119441510000000E+03),\n new google.maps.LatLng( 0.469703480000000E+02, -0.119445848000000E+03),\n new google.maps.LatLng( 0.469690220000000E+02, -0.119447818000000E+03),\n new google.maps.LatLng( 0.469694420000000E+02, -0.119452723000000E+03),\n new google.maps.LatLng( 0.469689700000000E+02, -0.119462668000000E+03),\n new google.maps.LatLng( 0.469647080000000E+02, -0.119469395000000E+03),\n new google.maps.LatLng( 0.469651680000000E+02, -0.119481111000000E+03),\n new google.maps.LatLng( 0.469647090000000E+02, -0.119486890000000E+03),\n new google.maps.LatLng( 0.469659790000000E+02, -0.119489059000000E+03),\n new google.maps.LatLng( 0.469667040000000E+02, -0.119492937000000E+03),\n new google.maps.LatLng( 0.469665250000000E+02, -0.119494737000000E+03),\n new google.maps.LatLng( 0.469665250000000E+02, -0.119494737000000E+03),\n new google.maps.LatLng( 0.469669940000000E+02, -0.119498048000000E+03),\n new google.maps.LatLng( 0.469628200000000E+02, -0.119513153000000E+03),\n new google.maps.LatLng( 0.469615430000000E+02, -0.119521497000000E+03),\n new google.maps.LatLng( 0.469619320000000E+02, -0.119522431000000E+03),\n new google.maps.LatLng( 0.469624800000000E+02, -0.119521997000000E+03),\n new google.maps.LatLng( 0.469632790000000E+02, -0.119518626000000E+03),\n new google.maps.LatLng( 0.469631180000000E+02, -0.119516356000000E+03),\n new google.maps.LatLng( 0.469637120000000E+02, -0.119515989000000E+03),\n new google.maps.LatLng( 0.469651750000000E+02, -0.119518357000000E+03),\n new google.maps.LatLng( 0.469655230000000E+02, -0.119535678000000E+03),\n new google.maps.LatLng( 0.469675790000000E+02, -0.119545456000000E+03),\n new google.maps.LatLng( 0.469684020000000E+02, -0.119547558000000E+03),\n new google.maps.LatLng( 0.469718520000000E+02, -0.119551063000000E+03),\n new google.maps.LatLng( 0.469730860000000E+02, -0.119557571000000E+03),\n new google.maps.LatLng( 0.469750130000000E+02, -0.119557900000000E+03),\n new google.maps.LatLng( 0.469998610000000E+02, -0.119557632000000E+03),\n new google.maps.LatLng( 0.470305520000000E+02, -0.119556927000000E+03),\n new google.maps.LatLng( 0.470305520000000E+02, -0.119556927000000E+03),\n new google.maps.LatLng( 0.471004840000000E+02, -0.119555852000000E+03),\n new google.maps.LatLng( 0.471032030000000E+02, -0.119560001000000E+03),\n new google.maps.LatLng( 0.471031430000000E+02, -0.119615008000000E+03),\n new google.maps.LatLng( 0.471022820000000E+02, -0.119620962000000E+03),\n new google.maps.LatLng( 0.471037690000000E+02, -0.119620964000000E+03),\n new google.maps.LatLng( 0.471037690000000E+02, -0.119620964000000E+03),\n new google.maps.LatLng( 0.471041720000000E+02, -0.119617795000000E+03),\n new google.maps.LatLng( 0.471038070000000E+02, -0.119611897000000E+03),\n new google.maps.LatLng( 0.471038800000000E+02, -0.119566290000000E+03),\n new google.maps.LatLng( 0.471045970000000E+02, -0.119559700000000E+03),\n new google.maps.LatLng( 0.471066760000000E+02, -0.119555885000000E+03),\n new google.maps.LatLng( 0.471330270000000E+02, -0.119555677000000E+03),\n new google.maps.LatLng( 0.471331310000000E+02, -0.119512958000000E+03),\n new google.maps.LatLng( 0.471626710000000E+02, -0.119512328000000E+03),\n new google.maps.LatLng( 0.471625860000000E+02, -0.119533766000000E+03),\n new google.maps.LatLng( 0.471777330000000E+02, -0.119533356000000E+03),\n new google.maps.LatLng( 0.471808390000000E+02, -0.119529300000000E+03),\n new google.maps.LatLng( 0.471841950000000E+02, -0.119522496000000E+03),\n new google.maps.LatLng( 0.471882600000000E+02, -0.119518740000000E+03),\n new google.maps.LatLng( 0.471895840000000E+02, -0.119515353000000E+03),\n new google.maps.LatLng( 0.471895130000000E+02, -0.119507678000000E+03),\n new google.maps.LatLng( 0.471859940000000E+02, -0.119505671000000E+03),\n new google.maps.LatLng( 0.471845550000000E+02, -0.119506075000000E+03),\n new google.maps.LatLng( 0.471829320000000E+02, -0.119504368000000E+03),\n new google.maps.LatLng( 0.471823210000000E+02, -0.119502267000000E+03),\n new google.maps.LatLng( 0.472087980000000E+02, -0.119483736000000E+03),\n new google.maps.LatLng( 0.472159030000000E+02, -0.119485553000000E+03),\n new google.maps.LatLng( 0.472237380000000E+02, -0.119486769000000E+03),\n new google.maps.LatLng( 0.472273020000000E+02, -0.119486806000000E+03),\n new google.maps.LatLng( 0.472318490000000E+02, -0.119486173000000E+03),\n new google.maps.LatLng( 0.472428850000000E+02, -0.119483232000000E+03),\n new google.maps.LatLng( 0.472037130000000E+02, -0.119447995000000E+03),\n new google.maps.LatLng( 0.472032100000000E+02, -0.119447157000000E+03),\n new google.maps.LatLng( 0.472030510000000E+02, -0.119441927000000E+03),\n new google.maps.LatLng( 0.472055180000000E+02, -0.119440788000000E+03),\n new google.maps.LatLng( 0.472057610000000E+02, -0.119435315000000E+03),\n new google.maps.LatLng( 0.472057610000000E+02, -0.119435315000000E+03),\n new google.maps.LatLng( 0.471977960000000E+02, -0.119432641000000E+03),\n new google.maps.LatLng( 0.471927470000000E+02, -0.119430429000000E+03),\n new google.maps.LatLng( 0.471908520000000E+02, -0.119428921000000E+03),\n new google.maps.LatLng( 0.471886130000000E+02, -0.119426877000000E+03),\n new google.maps.LatLng( 0.471834030000000E+02, -0.119420544000000E+03),\n new google.maps.LatLng( 0.471802490000000E+02, -0.119415518000000E+03),\n new google.maps.LatLng( 0.471782830000000E+02, -0.119411029000000E+03),\n new google.maps.LatLng( 0.471762020000000E+02, -0.119401112000000E+03),\n new google.maps.LatLng( 0.471761080000000E+02, -0.119393573000000E+03),\n new google.maps.LatLng( 0.471768120000000E+02, -0.119384692000000E+03),\n new google.maps.LatLng( 0.471807180000000E+02, -0.119364335000000E+03),\n new google.maps.LatLng( 0.471813390000000E+02, -0.119356160000000E+03),\n new google.maps.LatLng( 0.471800170000000E+02, -0.119349960000000E+03),\n new google.maps.LatLng( 0.471771630000000E+02, -0.119344327000000E+03),\n new google.maps.LatLng( 0.471744220000000E+02, -0.119341009000000E+03),\n new google.maps.LatLng( 0.471725480000000E+02, -0.119340673000000E+03),\n new google.maps.LatLng( 0.471696920000000E+02, -0.119343619000000E+03),\n new google.maps.LatLng( 0.471599350000000E+02, -0.119347131000000E+03),\n new google.maps.LatLng( 0.471572840000000E+02, -0.119348502000000E+03),\n new google.maps.LatLng( 0.471515480000000E+02, -0.119353555000000E+03),\n new google.maps.LatLng( 0.471461720000000E+02, -0.119353170000000E+03),\n new google.maps.LatLng( 0.471355320000000E+02, -0.119351066000000E+03),\n new google.maps.LatLng( 0.471306890000000E+02, -0.119350694000000E+03),\n new google.maps.LatLng( 0.471243950000000E+02, -0.119348620000000E+03),\n new google.maps.LatLng( 0.471198370000000E+02, -0.119345570000000E+03),\n new google.maps.LatLng( 0.471149950000000E+02, -0.119341985000000E+03),\n new google.maps.LatLng( 0.471103970000000E+02, -0.119331092000000E+03),\n new google.maps.LatLng( 0.471036200000000E+02, -0.119324343000000E+03),\n new google.maps.LatLng( 0.471012130000000E+02, -0.119327130000000E+03),\n new google.maps.LatLng( 0.470998720000000E+02, -0.119330366000000E+03),\n new google.maps.LatLng( 0.470993920000000E+02, -0.119332540000000E+03),\n new google.maps.LatLng( 0.471003970000000E+02, -0.119333277000000E+03),\n new google.maps.LatLng( 0.471000540000000E+02, -0.119334247000000E+03),\n new google.maps.LatLng( 0.470967180000000E+02, -0.119334915000000E+03),\n new google.maps.LatLng( 0.470950730000000E+02, -0.119333174000000E+03),\n new google.maps.LatLng( 0.470944570000000E+02, -0.119331300000000E+03),\n new google.maps.LatLng( 0.470929040000000E+02, -0.119329292000000E+03),\n new google.maps.LatLng( 0.470833300000000E+02, -0.119332064000000E+03),\n new google.maps.LatLng( 0.470702610000000E+02, -0.119333831000000E+03),\n new google.maps.LatLng( 0.470652810000000E+02, -0.119328546000000E+03),\n new google.maps.LatLng( 0.470636590000000E+02, -0.119324901000000E+03),\n new google.maps.LatLng( 0.470632020000000E+02, -0.119320956000000E+03),\n new google.maps.LatLng( 0.470637050000000E+02, -0.119319351000000E+03),\n new google.maps.LatLng( 0.470676120000000E+02, -0.119318750000000E+03),\n new google.maps.LatLng( 0.470704230000000E+02, -0.119317178000000E+03),\n new google.maps.LatLng( 0.470862100000000E+02, -0.119299116000000E+03),\n new google.maps.LatLng( 0.470915560000000E+02, -0.119295469000000E+03),\n new google.maps.LatLng( 0.471012890000000E+02, -0.119290313000000E+03),\n new google.maps.LatLng( 0.471015630000000E+02, -0.119290982000000E+03),\n new google.maps.LatLng( 0.471008100000000E+02, -0.119299883000000E+03),\n new google.maps.LatLng( 0.471019070000000E+02, -0.119299983000000E+03),\n new google.maps.LatLng( 0.471062700000000E+02, -0.119293089000000E+03),\n new google.maps.LatLng( 0.471062010000000E+02, -0.119292152000000E+03),\n new google.maps.LatLng( 0.471055840000000E+02, -0.119291717000000E+03),\n new google.maps.LatLng( 0.471024550000000E+02, -0.119293491000000E+03),\n new google.maps.LatLng( 0.471027740000000E+02, -0.119289442000000E+03),\n new google.maps.LatLng( 0.471055760000000E+02, -0.119286869000000E+03),\n new google.maps.LatLng( 0.471085530000000E+02, -0.119285156000000E+03),\n new google.maps.LatLng( 0.471096960000000E+02, -0.119285155000000E+03),\n new google.maps.LatLng( 0.471255480000000E+02, -0.119275669000000E+03),\n new google.maps.LatLng( 0.471258220000000E+02, -0.119275000000000E+03),\n new google.maps.LatLng( 0.471265760000000E+02, -0.119275769000000E+03),\n new google.maps.LatLng( 0.471258460000000E+02, -0.119278749000000E+03),\n new google.maps.LatLng( 0.471248630000000E+02, -0.119280159000000E+03),\n new google.maps.LatLng( 0.471180810000000E+02, -0.119285854000000E+03),\n new google.maps.LatLng( 0.471122790000000E+02, -0.119292016000000E+03),\n new google.maps.LatLng( 0.470956930000000E+02, -0.119307880000000E+03),\n new google.maps.LatLng( 0.470904600000000E+02, -0.119311660000000E+03),\n new google.maps.LatLng( 0.470859140000000E+02, -0.119316310000000E+03),\n new google.maps.LatLng( 0.470833770000000E+02, -0.119322364000000E+03),\n new google.maps.LatLng( 0.470835820000000E+02, -0.119323602000000E+03),\n new google.maps.LatLng( 0.470858220000000E+02, -0.119324071000000E+03),\n new google.maps.LatLng( 0.470892720000000E+02, -0.119321998000000E+03),\n new google.maps.LatLng( 0.470960120000000E+02, -0.119320761000000E+03),\n new google.maps.LatLng( 0.471012440000000E+02, -0.119320361000000E+03),\n new google.maps.LatLng( 0.471045350000000E+02, -0.119317317000000E+03),\n new google.maps.LatLng( 0.471089440000000E+02, -0.119310959000000E+03),\n new google.maps.LatLng( 0.471128510000000E+02, -0.119306709000000E+03),\n new google.maps.LatLng( 0.471192030000000E+02, -0.119301821000000E+03),\n new google.maps.LatLng( 0.471198880000000E+02, -0.119301921000000E+03),\n new google.maps.LatLng( 0.471192720000000E+02, -0.119304565000000E+03),\n new google.maps.LatLng( 0.471205970000000E+02, -0.119303829000000E+03),\n new google.maps.LatLng( 0.471240460000000E+02, -0.119298640000000E+03),\n new google.maps.LatLng( 0.471248630000000E+02, -0.119294554000000E+03),\n new google.maps.LatLng( 0.471306220000000E+02, -0.119282395000000E+03),\n new google.maps.LatLng( 0.471327000000000E+02, -0.119279180000000E+03),\n new google.maps.LatLng( 0.471348020000000E+02, -0.119279111000000E+03),\n new google.maps.LatLng( 0.471328840000000E+02, -0.119282360000000E+03),\n new google.maps.LatLng( 0.471300530000000E+02, -0.119289159000000E+03),\n new google.maps.LatLng( 0.471257820000000E+02, -0.119302618000000E+03),\n new google.maps.LatLng( 0.471313340000000E+02, -0.119305631000000E+03),\n new google.maps.LatLng( 0.471369550000000E+02, -0.119311389000000E+03),\n new google.maps.LatLng( 0.471379610000000E+02, -0.119312996000000E+03),\n new google.maps.LatLng( 0.471400170000000E+02, -0.119318722000000E+03),\n new google.maps.LatLng( 0.471395820000000E+02, -0.119321669000000E+03),\n new google.maps.LatLng( 0.471362690000000E+02, -0.119324213000000E+03),\n new google.maps.LatLng( 0.471345790000000E+02, -0.119324213000000E+03),\n new google.maps.LatLng( 0.471355160000000E+02, -0.119319692000000E+03),\n new google.maps.LatLng( 0.471362700000000E+02, -0.119318755000000E+03),\n new google.maps.LatLng( 0.471362470000000E+02, -0.119315842000000E+03),\n new google.maps.LatLng( 0.471351960000000E+02, -0.119313766000000E+03),\n new google.maps.LatLng( 0.471290040000000E+02, -0.119309481000000E+03),\n new google.maps.LatLng( 0.471210080000000E+02, -0.119310859000000E+03),\n new google.maps.LatLng( 0.471181750000000E+02, -0.119312398000000E+03),\n new google.maps.LatLng( 0.471127820000000E+02, -0.119320430000000E+03),\n new google.maps.LatLng( 0.471123250000000E+02, -0.119321769000000E+03),\n new google.maps.LatLng( 0.471207560000000E+02, -0.119326491000000E+03),\n new google.maps.LatLng( 0.471253440000000E+02, -0.119329835000000E+03),\n new google.maps.LatLng( 0.471270600000000E+02, -0.119333651000000E+03),\n new google.maps.LatLng( 0.471307840000000E+02, -0.119338139000000E+03),\n new google.maps.LatLng( 0.471348270000000E+02, -0.119341054000000E+03),\n new google.maps.LatLng( 0.471368380000000E+02, -0.119341625000000E+03),\n new google.maps.LatLng( 0.471443090000000E+02, -0.119341562000000E+03),\n new google.maps.LatLng( 0.471486500000000E+02, -0.119340224000000E+03),\n new google.maps.LatLng( 0.471577900000000E+02, -0.119334468000000E+03),\n new google.maps.LatLng( 0.471606470000000E+02, -0.119333128000000E+03),\n new google.maps.LatLng( 0.471664040000000E+02, -0.119331891000000E+03),\n new google.maps.LatLng( 0.471713850000000E+02, -0.119332129000000E+03),\n new google.maps.LatLng( 0.471751320000000E+02, -0.119333437000000E+03),\n new google.maps.LatLng( 0.471802720000000E+02, -0.119337929000000E+03),\n new google.maps.LatLng( 0.471819850000000E+02, -0.119340209000000E+03),\n new google.maps.LatLng( 0.471851590000000E+02, -0.119346780000000E+03),\n new google.maps.LatLng( 0.471877570000000E+02, -0.119360019000000E+03),\n new google.maps.LatLng( 0.471879150000000E+02, -0.119365416000000E+03),\n new google.maps.LatLng( 0.471854230000000E+02, -0.119378752000000E+03),\n new google.maps.LatLng( 0.471814990000000E+02, -0.119392530000000E+03),\n new google.maps.LatLng( 0.471807710000000E+02, -0.119399835000000E+03),\n new google.maps.LatLng( 0.471819610000000E+02, -0.119406671000000E+03),\n new google.maps.LatLng( 0.471855040000000E+02, -0.119414578000000E+03),\n new google.maps.LatLng( 0.471891140000000E+02, -0.119419671000000E+03),\n new google.maps.LatLng( 0.471914220000000E+02, -0.119421715000000E+03),\n new google.maps.LatLng( 0.471974080000000E+02, -0.119426138000000E+03),\n new google.maps.LatLng( 0.472013830000000E+02, -0.119428383000000E+03),\n new google.maps.LatLng( 0.472052900000000E+02, -0.119429255000000E+03),\n new google.maps.LatLng( 0.472108190000000E+02, -0.119429153000000E+03),\n new google.maps.LatLng( 0.472144970000000E+02, -0.119428315000000E+03),\n new google.maps.LatLng( 0.472221280000000E+02, -0.119425564000000E+03),\n new google.maps.LatLng( 0.472242980000000E+02, -0.119425564000000E+03),\n new google.maps.LatLng( 0.472277710000000E+02, -0.119427005000000E+03),\n new google.maps.LatLng( 0.472309240000000E+02, -0.119430125000000E+03),\n new google.maps.LatLng( 0.472322720000000E+02, -0.119432338000000E+03),\n new google.maps.LatLng( 0.472340770000000E+02, -0.119436263000000E+03),\n new google.maps.LatLng( 0.472363840000000E+02, -0.119443709000000E+03),\n new google.maps.LatLng( 0.472433510000000E+02, -0.119452870000000E+03),\n new google.maps.LatLng( 0.472433510000000E+02, -0.119452870000000E+03),\n new google.maps.LatLng( 0.472438300000000E+02, -0.119454514000000E+03),\n new google.maps.LatLng( 0.472469300000000E+02, -0.119457484000000E+03),\n new google.maps.LatLng( 0.472572530000000E+02, -0.119450318000000E+03),\n new google.maps.LatLng( 0.472729410000000E+02, -0.119470597000000E+03),\n new google.maps.LatLng( 0.473206420000000E+02, -0.119482422000000E+03),\n new google.maps.LatLng( 0.473206420000000E+02, -0.119482422000000E+03),\n new google.maps.LatLng( 0.473212100000000E+02, -0.119449357000000E+03),\n new google.maps.LatLng( 0.473200020000000E+02, -0.119442638000000E+03),\n new google.maps.LatLng( 0.473192790000000E+02, -0.119442540000000E+03),\n new google.maps.LatLng( 0.473131330000000E+02, -0.119447712000000E+03),\n new google.maps.LatLng( 0.473027830000000E+02, -0.119448751000000E+03),\n new google.maps.LatLng( 0.472974830000000E+02, -0.119446869000000E+03),\n new google.maps.LatLng( 0.472862190000000E+02, -0.119445658000000E+03),\n new google.maps.LatLng( 0.472855580000000E+02, -0.119443610000000E+03),\n new google.maps.LatLng( 0.472798450000000E+02, -0.119442670000000E+03),\n new google.maps.LatLng( 0.472691760000000E+02, -0.119446495000000E+03),\n new google.maps.LatLng( 0.472649030000000E+02, -0.119446930000000E+03),\n new google.maps.LatLng( 0.472630800000000E+02, -0.119446278000000E+03),\n new google.maps.LatLng( 0.473464850000000E+02, -0.119388580000000E+03),\n new google.maps.LatLng( 0.473393740000000E+02, -0.119387186000000E+03),\n new google.maps.LatLng( 0.473350560000000E+02, -0.119386854000000E+03),\n new google.maps.LatLng( 0.473299600000000E+02, -0.119382826000000E+03),\n new google.maps.LatLng( 0.473251120000000E+02, -0.119376140000000E+03),\n new google.maps.LatLng( 0.473244500000000E+02, -0.119372943000000E+03),\n new google.maps.LatLng( 0.473207540000000E+02, -0.119362087000000E+03),\n new google.maps.LatLng( 0.473203900000000E+02, -0.119357819000000E+03),\n new google.maps.LatLng( 0.473208240000000E+02, -0.119357516000000E+03),\n new google.maps.LatLng( 0.473221260000000E+02, -0.119357989000000E+03),\n new google.maps.LatLng( 0.473224660000000E+02, -0.119364642000000E+03),\n new google.maps.LatLng( 0.473283580000000E+02, -0.119369688000000E+03),\n new google.maps.LatLng( 0.473327640000000E+02, -0.119375792000000E+03),\n new google.maps.LatLng( 0.473373580000000E+02, -0.119372891000000E+03),\n new google.maps.LatLng( 0.473371990000000E+02, -0.119370706000000E+03),\n new google.maps.LatLng( 0.473326570000000E+02, -0.119361124000000E+03),\n new google.maps.LatLng( 0.473301910000000E+02, -0.119357593000000E+03),\n new google.maps.LatLng( 0.473257140000000E+02, -0.119355975000000E+03),\n new google.maps.LatLng( 0.473213500000000E+02, -0.119356307000000E+03),\n new google.maps.LatLng( 0.473207110000000E+02, -0.119355568000000E+03),\n new google.maps.LatLng( 0.473207130000000E+02, -0.119348714000000E+03),\n new google.maps.LatLng( 0.473241920000000E+02, -0.119341546000000E+03),\n new google.maps.LatLng( 0.473236670000000E+02, -0.119303220000000E+03),\n new google.maps.LatLng( 0.473260890000000E+02, -0.119303757000000E+03),\n new google.maps.LatLng( 0.473343140000000E+02, -0.119303185000000E+03),\n new google.maps.LatLng( 0.473399800000000E+02, -0.119303453000000E+03),\n new google.maps.LatLng( 0.473442990000000E+02, -0.119305066000000E+03),\n new google.maps.LatLng( 0.473512210000000E+02, -0.119309503000000E+03),\n new google.maps.LatLng( 0.473524710000000E+02, -0.119309218000000E+03),\n new google.maps.LatLng( 0.473576410000000E+02, -0.119309839000000E+03),\n new google.maps.LatLng( 0.473713700000000E+02, -0.119332205000000E+03),\n new google.maps.LatLng( 0.473725790000000E+02, -0.119338293000000E+03),\n new google.maps.LatLng( 0.473753100000000E+02, -0.119342055000000E+03),\n new google.maps.LatLng( 0.473803510000000E+02, -0.119346498000000E+03),\n new google.maps.LatLng( 0.473820970000000E+02, -0.119349192000000E+03),\n new google.maps.LatLng( 0.473820970000000E+02, -0.119349192000000E+03),\n new google.maps.LatLng( 0.473807850000000E+02, -0.119277238000000E+03),\n new google.maps.LatLng( 0.473953610000000E+02, -0.119277161000000E+03),\n new google.maps.LatLng( 0.473950100000000E+02, -0.119255964000000E+03),\n new google.maps.LatLng( 0.474100740000000E+02, -0.119255946000000E+03),\n new google.maps.LatLng( 0.474097090000000E+02, -0.119255534000000E+03),\n new google.maps.LatLng( 0.474082700000000E+02, -0.119212756000000E+03),\n new google.maps.LatLng( 0.474078690000000E+02, -0.119172261000000E+03),\n new google.maps.LatLng( 0.474078690000000E+02, -0.119172261000000E+03),\n new google.maps.LatLng( 0.474078350000000E+02, -0.119128715000000E+03),\n new google.maps.LatLng( 0.473830570000000E+02, -0.119086364000000E+03),\n ];\n\n return zipCoords\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.490000932993622E+02, -0.119919242571380E+03),\n new google.maps.LatLng( 0.490004480000000E+02, -0.119876195000000E+03),\n new google.maps.LatLng( 0.490002690000000E+02, -0.119702016000000E+03),\n new google.maps.LatLng( 0.490002580000000E+02, -0.119701218000000E+03),\n new google.maps.LatLng( 0.490002593472647E+02, -0.119591856929598E+03),\n new google.maps.LatLng( 0.490002600404256E+02, -0.119535591210914E+03),\n new google.maps.LatLng( 0.490002600404256E+02, -0.119535591210914E+03),\n new google.maps.LatLng( 0.489991960000000E+02, -0.119534914000000E+03),\n new google.maps.LatLng( 0.489956110000000E+02, -0.119537102000000E+03),\n new google.maps.LatLng( 0.489929850000000E+02, -0.119541858000000E+03),\n new google.maps.LatLng( 0.489845130000000E+02, -0.119546511000000E+03),\n new google.maps.LatLng( 0.489835990000000E+02, -0.119546511000000E+03),\n new google.maps.LatLng( 0.489811780000000E+02, -0.119543181000000E+03),\n new google.maps.LatLng( 0.489815430000000E+02, -0.119540994000000E+03),\n new google.maps.LatLng( 0.489833920000000E+02, -0.119536518000000E+03),\n new google.maps.LatLng( 0.489832550000000E+02, -0.119534783000000E+03),\n new google.maps.LatLng( 0.489795300000000E+02, -0.119525762000000E+03),\n new google.maps.LatLng( 0.489812640000000E+02, -0.119521146000000E+03),\n new google.maps.LatLng( 0.489837300000000E+02, -0.119518889000000E+03),\n new google.maps.LatLng( 0.489851220000000E+02, -0.119516285000000E+03),\n new google.maps.LatLng( 0.489847760000000E+02, -0.119508408000000E+03),\n new google.maps.LatLng( 0.489828570000000E+02, -0.119506432000000E+03),\n new google.maps.LatLng( 0.489816920000000E+02, -0.119506607000000E+03),\n new google.maps.LatLng( 0.489757050000000E+02, -0.119511583000000E+03),\n new google.maps.LatLng( 0.489747400000000E+02, -0.119511746000000E+03),\n new google.maps.LatLng( 0.489730030000000E+02, -0.119510030000000E+03),\n new google.maps.LatLng( 0.489714910000000E+02, -0.119504145000000E+03),\n new google.maps.LatLng( 0.489701640000000E+02, -0.119502116000000E+03),\n new google.maps.LatLng( 0.489690670000000E+02, -0.119501183000000E+03),\n new google.maps.LatLng( 0.489686800000000E+02, -0.119501552000000E+03),\n new google.maps.LatLng( 0.489658590000000E+02, -0.119501442000000E+03),\n new google.maps.LatLng( 0.489627690000000E+02, -0.119498803000000E+03),\n new google.maps.LatLng( 0.489627690000000E+02, -0.119498803000000E+03),\n new google.maps.LatLng( 0.489628220000000E+02, -0.119499592000000E+03),\n new google.maps.LatLng( 0.489628220000000E+02, -0.119499592000000E+03),\n new google.maps.LatLng( 0.489644660000000E+02, -0.119500670000000E+03),\n new google.maps.LatLng( 0.489644660000000E+02, -0.119500670000000E+03),\n new google.maps.LatLng( 0.489661820000000E+02, -0.119502044000000E+03),\n new google.maps.LatLng( 0.489683740000000E+02, -0.119501833000000E+03),\n new google.maps.LatLng( 0.489702930000000E+02, -0.119502837000000E+03),\n new google.maps.LatLng( 0.489715280000000E+02, -0.119505333000000E+03),\n new google.maps.LatLng( 0.489727180000000E+02, -0.119510190000000E+03),\n new google.maps.LatLng( 0.489746370000000E+02, -0.119512478000000E+03),\n new google.maps.LatLng( 0.489759620000000E+02, -0.119512269000000E+03),\n new google.maps.LatLng( 0.489787470000000E+02, -0.119510496000000E+03),\n new google.maps.LatLng( 0.489812130000000E+02, -0.119507996000000E+03),\n new google.maps.LatLng( 0.489825150000000E+02, -0.119507960000000E+03),\n new google.maps.LatLng( 0.489839780000000E+02, -0.119510387000000E+03),\n new google.maps.LatLng( 0.489840260000000E+02, -0.119516807000000E+03),\n new google.maps.LatLng( 0.489814000000000E+02, -0.119519481000000E+03),\n new google.maps.LatLng( 0.489791630000000E+02, -0.119523681000000E+03),\n new google.maps.LatLng( 0.489787530000000E+02, -0.119526075000000E+03),\n new google.maps.LatLng( 0.489791880000000E+02, -0.119529996000000E+03),\n new google.maps.LatLng( 0.489797140000000E+02, -0.119531244000000E+03),\n new google.maps.LatLng( 0.489816560000000E+02, -0.119533153000000E+03),\n new google.maps.LatLng( 0.489823410000000E+02, -0.119534922000000E+03),\n new google.maps.LatLng( 0.489821820000000E+02, -0.119536588000000E+03),\n new google.maps.LatLng( 0.489802410000000E+02, -0.119542209000000E+03),\n new google.maps.LatLng( 0.489801960000000E+02, -0.119546616000000E+03),\n new google.maps.LatLng( 0.489815670000000E+02, -0.119552688000000E+03),\n new google.maps.LatLng( 0.489812470000000E+02, -0.119555880000000E+03),\n new google.maps.LatLng( 0.489823670000000E+02, -0.119558031000000E+03),\n new google.maps.LatLng( 0.489857010000000E+02, -0.119561779000000E+03),\n new google.maps.LatLng( 0.489865450000000E+02, -0.119573093000000E+03),\n new google.maps.LatLng( 0.489883720000000E+02, -0.119578264000000E+03),\n new google.maps.LatLng( 0.489893070000000E+02, -0.119583296000000E+03),\n new google.maps.LatLng( 0.489892380000000E+02, -0.119587773000000E+03),\n new google.maps.LatLng( 0.489879800000000E+02, -0.119593081000000E+03),\n new google.maps.LatLng( 0.489878870000000E+02, -0.119599606000000E+03),\n new google.maps.LatLng( 0.489860330000000E+02, -0.119605851000000E+03),\n new google.maps.LatLng( 0.489860750000000E+02, -0.119615637000000E+03),\n new google.maps.LatLng( 0.489830790000000E+02, -0.119623059000000E+03),\n new google.maps.LatLng( 0.489827480000000E+02, -0.119626187000000E+03),\n new google.maps.LatLng( 0.489812090000000E+02, -0.119631128000000E+03),\n new google.maps.LatLng( 0.489794290000000E+02, -0.119633593000000E+03),\n new google.maps.LatLng( 0.489750910000000E+02, -0.119637309000000E+03),\n new google.maps.LatLng( 0.489728310000000E+02, -0.119638318000000E+03),\n new google.maps.LatLng( 0.489677620000000E+02, -0.119642346000000E+03),\n new google.maps.LatLng( 0.489663010000000E+02, -0.119643214000000E+03),\n new google.maps.LatLng( 0.489618700000000E+02, -0.119643842000000E+03),\n new google.maps.LatLng( 0.489551560000000E+02, -0.119648703000000E+03),\n new google.maps.LatLng( 0.489533300000000E+02, -0.119649502000000E+03),\n new google.maps.LatLng( 0.489526680000000E+02, -0.119651340000000E+03),\n new google.maps.LatLng( 0.489462740000000E+02, -0.119656476000000E+03),\n new google.maps.LatLng( 0.489441510000000E+02, -0.119656512000000E+03),\n new google.maps.LatLng( 0.489404290000000E+02, -0.119659426000000E+03),\n new google.maps.LatLng( 0.489385330000000E+02, -0.119659601000000E+03),\n new google.maps.LatLng( 0.489369570000000E+02, -0.119658908000000E+03),\n new google.maps.LatLng( 0.489374360000000E+02, -0.119658561000000E+03),\n new google.maps.LatLng( 0.489386930000000E+02, -0.119658838000000E+03),\n new google.maps.LatLng( 0.489396060000000E+02, -0.119658629000000E+03),\n new google.maps.LatLng( 0.489400400000000E+02, -0.119658005000000E+03),\n new google.maps.LatLng( 0.489416610000000E+02, -0.119657866000000E+03),\n new google.maps.LatLng( 0.489439450000000E+02, -0.119655645000000E+03),\n new google.maps.LatLng( 0.489463200000000E+02, -0.119655401000000E+03),\n new google.maps.LatLng( 0.489476900000000E+02, -0.119654118000000E+03),\n new google.maps.LatLng( 0.489494480000000E+02, -0.119653492000000E+03),\n new google.maps.LatLng( 0.489527820000000E+02, -0.119649606000000E+03),\n new google.maps.LatLng( 0.489602480000000E+02, -0.119643566000000E+03),\n new google.maps.LatLng( 0.489626460000000E+02, -0.119642385000000E+03),\n new google.maps.LatLng( 0.489646790000000E+02, -0.119642591000000E+03),\n new google.maps.LatLng( 0.489659120000000E+02, -0.119642209000000E+03),\n new google.maps.LatLng( 0.489681270000000E+02, -0.119641062000000E+03),\n new google.maps.LatLng( 0.489787890000000E+02, -0.119633038000000E+03),\n new google.maps.LatLng( 0.489802960000000E+02, -0.119631024000000E+03),\n new google.maps.LatLng( 0.489811170000000E+02, -0.119628803000000E+03),\n new google.maps.LatLng( 0.489828050000000E+02, -0.119622017000000E+03),\n new google.maps.LatLng( 0.489856180000000E+02, -0.119614456000000E+03),\n new google.maps.LatLng( 0.489852560000000E+02, -0.119606891000000E+03),\n new google.maps.LatLng( 0.489872700000000E+02, -0.119599051000000E+03),\n new google.maps.LatLng( 0.489876600000000E+02, -0.119593255000000E+03),\n new google.maps.LatLng( 0.489888720000000E+02, -0.119586558000000E+03),\n new google.maps.LatLng( 0.489888050000000E+02, -0.119582879000000E+03),\n new google.maps.LatLng( 0.489882120000000E+02, -0.119579409000000E+03),\n new google.maps.LatLng( 0.489857690000000E+02, -0.119573301000000E+03),\n new google.maps.LatLng( 0.489858150000000E+02, -0.119565076000000E+03),\n new google.maps.LatLng( 0.489848790000000E+02, -0.119561224000000E+03),\n new google.maps.LatLng( 0.489821610000000E+02, -0.119559072000000E+03),\n new google.maps.LatLng( 0.489808820000000E+02, -0.119556435000000E+03),\n new google.maps.LatLng( 0.489810640000000E+02, -0.119552271000000E+03),\n new google.maps.LatLng( 0.489798990000000E+02, -0.119548351000000E+03),\n new google.maps.LatLng( 0.489795560000000E+02, -0.119543597000000E+03),\n new google.maps.LatLng( 0.489799210000000E+02, -0.119541030000000E+03),\n new google.maps.LatLng( 0.489813140000000E+02, -0.119538080000000E+03),\n new google.maps.LatLng( 0.489818160000000E+02, -0.119535373000000E+03),\n new google.maps.LatLng( 0.489810160000000E+02, -0.119533569000000E+03),\n new google.maps.LatLng( 0.489788910000000E+02, -0.119531210000000E+03),\n new google.maps.LatLng( 0.489782510000000E+02, -0.119527359000000E+03),\n new google.maps.LatLng( 0.489788660000000E+02, -0.119523022000000E+03),\n new google.maps.LatLng( 0.489814460000000E+02, -0.119518509000000E+03),\n new google.maps.LatLng( 0.489833860000000E+02, -0.119516460000000E+03),\n new google.maps.LatLng( 0.489836360000000E+02, -0.119511567000000E+03),\n new google.maps.LatLng( 0.489822640000000E+02, -0.119509001000000E+03),\n new google.maps.LatLng( 0.489760080000000E+02, -0.119513275000000E+03),\n new google.maps.LatLng( 0.489747060000000E+02, -0.119513206000000E+03),\n new google.maps.LatLng( 0.489733810000000E+02, -0.119512202000000E+03),\n new google.maps.LatLng( 0.489715760000000E+02, -0.119509706000000E+03),\n new google.maps.LatLng( 0.489704540000000E+02, -0.119504745000000E+03),\n new google.maps.LatLng( 0.489682610000000E+02, -0.119503013000000E+03),\n new google.maps.LatLng( 0.489666850000000E+02, -0.119502841000000E+03),\n new google.maps.LatLng( 0.489648330000000E+02, -0.119501733000000E+03),\n new google.maps.LatLng( 0.489648330000000E+02, -0.119501733000000E+03),\n new google.maps.LatLng( 0.489640580000000E+02, -0.119504474000000E+03),\n new google.maps.LatLng( 0.489615690000000E+02, -0.119506073000000E+03),\n new google.maps.LatLng( 0.489599490000000E+02, -0.119509161000000E+03),\n new google.maps.LatLng( 0.489576000000000E+02, -0.119519013000000E+03),\n new google.maps.LatLng( 0.489563900000000E+02, -0.119520332000000E+03),\n new google.maps.LatLng( 0.489465230000000E+02, -0.119518711000000E+03),\n new google.maps.LatLng( 0.489447870000000E+02, -0.119517602000000E+03),\n new google.maps.LatLng( 0.489354440000000E+02, -0.119513970000000E+03),\n new google.maps.LatLng( 0.489273580000000E+02, -0.119513596000000E+03),\n new google.maps.LatLng( 0.489273360000000E+02, -0.119515988000000E+03),\n new google.maps.LatLng( 0.489294840000000E+02, -0.119518932000000E+03),\n new google.maps.LatLng( 0.489302840000000E+02, -0.119522156000000E+03),\n new google.maps.LatLng( 0.489313160000000E+02, -0.119536298000000E+03),\n new google.maps.LatLng( 0.489302430000000E+02, -0.119539765000000E+03),\n new google.maps.LatLng( 0.489268640000000E+02, -0.119546560000000E+03),\n new google.maps.LatLng( 0.489260420000000E+02, -0.119547738000000E+03),\n new google.maps.LatLng( 0.489226620000000E+02, -0.119550096000000E+03),\n new google.maps.LatLng( 0.489206290000000E+02, -0.119549091000000E+03),\n new google.maps.LatLng( 0.489172480000000E+02, -0.119543825000000E+03),\n new google.maps.LatLng( 0.489122690000000E+02, -0.119541159000000E+03),\n new google.maps.LatLng( 0.489077230000000E+02, -0.119536967000000E+03),\n new google.maps.LatLng( 0.489029720000000E+02, -0.119535896000000E+03),\n new google.maps.LatLng( 0.489013050000000E+02, -0.119536174000000E+03),\n new google.maps.LatLng( 0.488992950000000E+02, -0.119539500000000E+03),\n new google.maps.LatLng( 0.489033840000000E+02, -0.119541231000000E+03),\n new google.maps.LatLng( 0.489020830000000E+02, -0.119544661000000E+03),\n new google.maps.LatLng( 0.489005750000000E+02, -0.119547017000000E+03),\n new google.maps.LatLng( 0.488977200000000E+02, -0.119548819000000E+03),\n new google.maps.LatLng( 0.488971950000000E+02, -0.119552803000000E+03),\n new google.maps.LatLng( 0.488979720000000E+02, -0.119555887000000E+03),\n new google.maps.LatLng( 0.489004390000000E+02, -0.119559593000000E+03),\n new google.maps.LatLng( 0.489012380000000E+02, -0.119566175000000E+03),\n new google.maps.LatLng( 0.489006440000000E+02, -0.119568912000000E+03),\n new google.maps.LatLng( 0.488898180000000E+02, -0.119569915000000E+03),\n new google.maps.LatLng( 0.488869180000000E+02, -0.119567663000000E+03),\n new google.maps.LatLng( 0.488804540000000E+02, -0.119565827000000E+03),\n new google.maps.LatLng( 0.488768690000000E+02, -0.119566450000000E+03),\n new google.maps.LatLng( 0.488756350000000E+02, -0.119568077000000E+03),\n new google.maps.LatLng( 0.488754300000000E+02, -0.119570708000000E+03),\n new google.maps.LatLng( 0.488715690000000E+02, -0.119572237000000E+03),\n new google.maps.LatLng( 0.488700840000000E+02, -0.119572687000000E+03),\n new google.maps.LatLng( 0.488607200000000E+02, -0.119572373000000E+03),\n new google.maps.LatLng( 0.488481820000000E+02, -0.119567835000000E+03),\n new google.maps.LatLng( 0.488416040000000E+02, -0.119563855000000E+03),\n new google.maps.LatLng( 0.488355960000000E+02, -0.119564097000000E+03),\n new google.maps.LatLng( 0.488328100000000E+02, -0.119562297000000E+03),\n new google.maps.LatLng( 0.488315080000000E+02, -0.119560637000000E+03),\n new google.maps.LatLng( 0.488324360000000E+02, -0.119558894000000E+03),\n new google.maps.LatLng( 0.488298180000000E+02, -0.119555482000000E+03),\n new google.maps.LatLng( 0.488221690000000E+02, -0.119556186000000E+03),\n new google.maps.LatLng( 0.488221690000000E+02, -0.119556186000000E+03),\n new google.maps.LatLng( 0.488205220000000E+02, -0.119555932000000E+03),\n new google.maps.LatLng( 0.488178040000000E+02, -0.119553131000000E+03),\n new google.maps.LatLng( 0.488138070000000E+02, -0.119554377000000E+03),\n new google.maps.LatLng( 0.488131950000000E+02, -0.119555156000000E+03),\n new google.maps.LatLng( 0.488129160000000E+02, -0.119559875000000E+03),\n new google.maps.LatLng( 0.488134420000000E+02, -0.119564440000000E+03),\n new google.maps.LatLng( 0.488181690000000E+02, -0.119574921000000E+03),\n new google.maps.LatLng( 0.488175520000000E+02, -0.119577376000000E+03),\n new google.maps.LatLng( 0.488180760000000E+02, -0.119581249000000E+03),\n new google.maps.LatLng( 0.488196290000000E+02, -0.119584768000000E+03),\n new google.maps.LatLng( 0.488202430000000E+02, -0.119593875000000E+03),\n new google.maps.LatLng( 0.488175680000000E+02, -0.119604041000000E+03),\n new google.maps.LatLng( 0.488175200000000E+02, -0.119609298000000E+03),\n new google.maps.LatLng( 0.488158280000000E+02, -0.119609436000000E+03),\n new google.maps.LatLng( 0.488154670000000E+02, -0.119603659000000E+03),\n new google.maps.LatLng( 0.488160180000000E+02, -0.119593526000000E+03),\n new google.maps.LatLng( 0.488127090000000E+02, -0.119581974000000E+03),\n new google.maps.LatLng( 0.488121610000000E+02, -0.119581662000000E+03),\n new google.maps.LatLng( 0.488109050000000E+02, -0.119582837000000E+03),\n new google.maps.LatLng( 0.488015160000000E+02, -0.119583248000000E+03),\n new google.maps.LatLng( 0.487971990000000E+02, -0.119584664000000E+03),\n new google.maps.LatLng( 0.487963310000000E+02, -0.119585458000000E+03),\n new google.maps.LatLng( 0.487961260000000E+02, -0.119586461000000E+03),\n new google.maps.LatLng( 0.487959420000000E+02, -0.119590194000000E+03),\n new google.maps.LatLng( 0.487969690000000E+02, -0.119592822000000E+03),\n new google.maps.LatLng( 0.488029950000000E+02, -0.119604339000000E+03),\n new google.maps.LatLng( 0.488050270000000E+02, -0.119606347000000E+03),\n new google.maps.LatLng( 0.488057100000000E+02, -0.119610670000000E+03),\n new google.maps.LatLng( 0.488043380000000E+02, -0.119615025000000E+03),\n new google.maps.LatLng( 0.488042450000000E+02, -0.119617722000000E+03),\n new google.maps.LatLng( 0.488054320000000E+02, -0.119620039000000E+03),\n new google.maps.LatLng( 0.488083540000000E+02, -0.119622360000000E+03),\n new google.maps.LatLng( 0.488088090000000E+02, -0.119625265000000E+03),\n new google.maps.LatLng( 0.488063220000000E+02, -0.119626687000000E+03),\n new google.maps.LatLng( 0.488038560000000E+02, -0.119627139000000E+03),\n new google.maps.LatLng( 0.488011610000000E+02, -0.119627211000000E+03),\n new google.maps.LatLng( 0.487994710000000E+02, -0.119626764000000E+03),\n new google.maps.LatLng( 0.487969110000000E+02, -0.119624178000000E+03),\n new google.maps.LatLng( 0.487969800000000E+02, -0.119623452000000E+03),\n new google.maps.LatLng( 0.487987160000000E+02, -0.119621380000000E+03),\n new google.maps.LatLng( 0.487991740000000E+02, -0.119619375000000E+03),\n new google.maps.LatLng( 0.487985590000000E+02, -0.119617577000000E+03),\n new google.maps.LatLng( 0.487967320000000E+02, -0.119615259000000E+03),\n new google.maps.LatLng( 0.487904080000000E+02, -0.119611172000000E+03),\n new google.maps.LatLng( 0.487786900000000E+02, -0.119610366000000E+03),\n new google.maps.LatLng( 0.487748740000000E+02, -0.119615511000000E+03),\n new google.maps.LatLng( 0.487740730000000E+02, -0.119619208000000E+03),\n new google.maps.LatLng( 0.487716270000000E+02, -0.119622971000000E+03),\n new google.maps.LatLng( 0.487679500000000E+02, -0.119622898000000E+03),\n new google.maps.LatLng( 0.487621500000000E+02, -0.119627188000000E+03),\n new google.maps.LatLng( 0.487613060000000E+02, -0.119628847000000E+03),\n new google.maps.LatLng( 0.487651910000000E+02, -0.119633749000000E+03),\n new google.maps.LatLng( 0.487650800000000E+02, -0.119639208000000E+03),\n new google.maps.LatLng( 0.487664740000000E+02, -0.119641556000000E+03),\n new google.maps.LatLng( 0.487673190000000E+02, -0.119642212000000E+03),\n new google.maps.LatLng( 0.487683240000000E+02, -0.119641831000000E+03),\n new google.maps.LatLng( 0.487691230000000E+02, -0.119642659000000E+03),\n new google.maps.LatLng( 0.487699700000000E+02, -0.119646182000000E+03),\n new google.maps.LatLng( 0.487669330000000E+02, -0.119649709000000E+03),\n new google.maps.LatLng( 0.487617040000000E+02, -0.119653686000000E+03),\n new google.maps.LatLng( 0.487550350000000E+02, -0.119656695000000E+03),\n new google.maps.LatLng( 0.487550350000000E+02, -0.119656695000000E+03),\n new google.maps.LatLng( 0.487558680000000E+02, -0.119658138000000E+03),\n new google.maps.LatLng( 0.487513360000000E+02, -0.119659979000000E+03),\n new google.maps.LatLng( 0.487501520000000E+02, -0.119661493000000E+03),\n new google.maps.LatLng( 0.487498940000000E+02, -0.119662676000000E+03),\n new google.maps.LatLng( 0.487520110000000E+02, -0.119662586000000E+03),\n new google.maps.LatLng( 0.487610880000000E+02, -0.119657762000000E+03),\n new google.maps.LatLng( 0.487671860000000E+02, -0.119653751000000E+03),\n new google.maps.LatLng( 0.487770970000000E+02, -0.119649390000000E+03),\n new google.maps.LatLng( 0.487810940000000E+02, -0.119649976000000E+03),\n new google.maps.LatLng( 0.487842230000000E+02, -0.119649593000000E+03),\n new google.maps.LatLng( 0.487864380000000E+02, -0.119648313000000E+03),\n new google.maps.LatLng( 0.487876930000000E+02, -0.119646584000000E+03),\n new google.maps.LatLng( 0.487896570000000E+02, -0.119645960000000E+03),\n new google.maps.LatLng( 0.487964650000000E+02, -0.119647579000000E+03),\n new google.maps.LatLng( 0.487955520000000E+02, -0.119650207000000E+03),\n new google.maps.LatLng( 0.487931300000000E+02, -0.119650416000000E+03),\n new google.maps.LatLng( 0.487917150000000E+02, -0.119652491000000E+03),\n new google.maps.LatLng( 0.487922880000000E+02, -0.119660234000000E+03),\n new google.maps.LatLng( 0.487905980000000E+02, -0.119662654000000E+03),\n new google.maps.LatLng( 0.487921530000000E+02, -0.119669671000000E+03),\n new google.maps.LatLng( 0.487931580000000E+02, -0.119672229000000E+03),\n new google.maps.LatLng( 0.487941170000000E+02, -0.119672712000000E+03),\n new google.maps.LatLng( 0.487950990000000E+02, -0.119674544000000E+03),\n new google.maps.LatLng( 0.488011290000000E+02, -0.119695494000000E+03),\n new google.maps.LatLng( 0.487985240000000E+02, -0.119708668000000E+03),\n new google.maps.LatLng( 0.487947610000000E+02, -0.119716602000000E+03),\n new google.maps.LatLng( 0.487957620000000E+02, -0.119721433000000E+03),\n new google.maps.LatLng( 0.487984290000000E+02, -0.119722805000000E+03),\n new google.maps.LatLng( 0.487988180000000E+02, -0.119720869000000E+03),\n new google.maps.LatLng( 0.487994800000000E+02, -0.119721423000000E+03),\n new google.maps.LatLng( 0.488041600000000E+02, -0.119728202000000E+03),\n new google.maps.LatLng( 0.488042510000000E+02, -0.119728998000000E+03),\n new google.maps.LatLng( 0.488024900000000E+02, -0.119735184000000E+03),\n new google.maps.LatLng( 0.488027860000000E+02, -0.119737397000000E+03),\n new google.maps.LatLng( 0.488041540000000E+02, -0.119740892000000E+03),\n new google.maps.LatLng( 0.488038800000000E+02, -0.119742101000000E+03),\n new google.maps.LatLng( 0.488030340000000E+02, -0.119742619000000E+03),\n new google.maps.LatLng( 0.488008880000000E+02, -0.119742513000000E+03),\n new google.maps.LatLng( 0.487981910000000E+02, -0.119745241000000E+03),\n new google.maps.LatLng( 0.487992630000000E+02, -0.119751187000000E+03),\n new google.maps.LatLng( 0.487992910000000E+02, -0.119758720000000E+03),\n new google.maps.LatLng( 0.487983100000000E+02, -0.119761072000000E+03),\n new google.maps.LatLng( 0.487917990000000E+02, -0.119758970000000E+03),\n new google.maps.LatLng( 0.487894010000000E+02, -0.119759422000000E+03),\n new google.maps.LatLng( 0.487889930000000E+02, -0.119766923000000E+03),\n new google.maps.LatLng( 0.487892680000000E+02, -0.119768408000000E+03),\n new google.maps.LatLng( 0.487907990000000E+02, -0.119771034000000E+03),\n new google.maps.LatLng( 0.487904360000000E+02, -0.119776911000000E+03),\n new google.maps.LatLng( 0.487907120000000E+02, -0.119783547000000E+03),\n new google.maps.LatLng( 0.487919920000000E+02, -0.119787936000000E+03),\n new google.maps.LatLng( 0.487932270000000E+02, -0.119802765000000E+03),\n new google.maps.LatLng( 0.487927930000000E+02, -0.119821706000000E+03),\n new google.maps.LatLng( 0.487911490000000E+02, -0.119821706000000E+03),\n new google.maps.LatLng( 0.487895260000000E+02, -0.119827235000000E+03),\n new google.maps.LatLng( 0.487897780000000E+02, -0.119828514000000E+03),\n new google.maps.LatLng( 0.487912620000000E+02, -0.119829310000000E+03),\n new google.maps.LatLng( 0.487912160000000E+02, -0.119830762000000E+03),\n new google.maps.LatLng( 0.487900740000000E+02, -0.119832663000000E+03),\n new google.maps.LatLng( 0.487879720000000E+02, -0.119834459000000E+03),\n new google.maps.LatLng( 0.487836790000000E+02, -0.119836151000000E+03),\n new google.maps.LatLng( 0.487818280000000E+02, -0.119839951000000E+03),\n new google.maps.LatLng( 0.487809370000000E+02, -0.119840469000000E+03),\n new google.maps.LatLng( 0.487784940000000E+02, -0.119839431000000E+03),\n new google.maps.LatLng( 0.487759600000000E+02, -0.119835109000000E+03),\n new google.maps.LatLng( 0.487745210000000E+02, -0.119834936000000E+03),\n new google.maps.LatLng( 0.487718250000000E+02, -0.119837042000000E+03),\n new google.maps.LatLng( 0.487714130000000E+02, -0.119838459000000E+03),\n new google.maps.LatLng( 0.487735810000000E+02, -0.119846926000000E+03),\n new google.maps.LatLng( 0.487777370000000E+02, -0.119851662000000E+03),\n new google.maps.LatLng( 0.487782160000000E+02, -0.119853045000000E+03),\n new google.maps.LatLng( 0.487779870000000E+02, -0.119854427000000E+03),\n new google.maps.LatLng( 0.487760440000000E+02, -0.119856291000000E+03),\n new google.maps.LatLng( 0.487757220000000E+02, -0.119862545000000E+03),\n new google.maps.LatLng( 0.487784140000000E+02, -0.119869597000000E+03),\n new google.maps.LatLng( 0.487771100000000E+02, -0.119871565000000E+03),\n new google.maps.LatLng( 0.487734320000000E+02, -0.119873841000000E+03),\n new google.maps.LatLng( 0.487692750000000E+02, -0.119875460000000E+03),\n new google.maps.LatLng( 0.487656500000000E+02, -0.119882484000000E+03),\n new google.maps.LatLng( 0.487617920000000E+02, -0.119885805000000E+03),\n new google.maps.LatLng( 0.487573420000000E+02, -0.119894790000000E+03),\n new google.maps.LatLng( 0.487564310000000E+02, -0.119901456000000E+03),\n new google.maps.LatLng( 0.487585570000000E+02, -0.119908951000000E+03),\n new google.maps.LatLng( 0.487586030000000E+02, -0.119910920000000E+03),\n new google.maps.LatLng( 0.487558420000000E+02, -0.119919141000000E+03),\n new google.maps.LatLng( 0.487554310000000E+02, -0.119922042000000E+03),\n new google.maps.LatLng( 0.487560020000000E+02, -0.119922767000000E+03),\n new google.maps.LatLng( 0.487602730000000E+02, -0.119923733000000E+03),\n new google.maps.LatLng( 0.487628540000000E+02, -0.119926461000000E+03),\n new google.maps.LatLng( 0.487628080000000E+02, -0.119927568000000E+03),\n new google.maps.LatLng( 0.487609130000000E+02, -0.119930090000000E+03),\n new google.maps.LatLng( 0.487605020000000E+02, -0.119931644000000E+03),\n new google.maps.LatLng( 0.487608670000000E+02, -0.119934269000000E+03),\n new google.maps.LatLng( 0.487624430000000E+02, -0.119938967000000E+03),\n new google.maps.LatLng( 0.487658690000000E+02, -0.119940867000000E+03),\n new google.maps.LatLng( 0.487667590000000E+02, -0.119937205000000E+03),\n new google.maps.LatLng( 0.487700710000000E+02, -0.119932230000000E+03),\n new google.maps.LatLng( 0.487728340000000E+02, -0.119930986000000E+03),\n new google.maps.LatLng( 0.487774930000000E+02, -0.119934924000000E+03),\n new google.maps.LatLng( 0.487771960000000E+02, -0.119941628000000E+03),\n new google.maps.LatLng( 0.487787490000000E+02, -0.119942768000000E+03),\n new google.maps.LatLng( 0.487805070000000E+02, -0.119941697000000E+03),\n new google.maps.LatLng( 0.487814430000000E+02, -0.119942181000000E+03),\n new google.maps.LatLng( 0.487906690000000E+02, -0.119953553000000E+03),\n new google.maps.LatLng( 0.487906460000000E+02, -0.119954936000000E+03),\n new google.maps.LatLng( 0.487915360000000E+02, -0.119957183000000E+03),\n new google.maps.LatLng( 0.487925870000000E+02, -0.119957563000000E+03),\n new google.maps.LatLng( 0.488052620000000E+02, -0.119954734000000E+03),\n new google.maps.LatLng( 0.488064270000000E+02, -0.119950101000000E+03),\n new google.maps.LatLng( 0.488158130000000E+02, -0.119941736000000E+03),\n new google.maps.LatLng( 0.488162250000000E+02, -0.119940284000000E+03),\n new google.maps.LatLng( 0.488153570000000E+02, -0.119940595000000E+03),\n new google.maps.LatLng( 0.488145350000000E+02, -0.119940180000000E+03),\n new google.maps.LatLng( 0.488147630000000E+02, -0.119939488000000E+03),\n new google.maps.LatLng( 0.488161790000000E+02, -0.119938693000000E+03),\n new google.maps.LatLng( 0.488214100000000E+02, -0.119938624000000E+03),\n new google.maps.LatLng( 0.488242180000000E+02, -0.119940215000000E+03),\n new google.maps.LatLng( 0.488257940000000E+02, -0.119944573000000E+03),\n new google.maps.LatLng( 0.488257710000000E+02, -0.119948239000000E+03),\n new google.maps.LatLng( 0.488262500000000E+02, -0.119950003000000E+03),\n new google.maps.LatLng( 0.488273460000000E+02, -0.119951492000000E+03),\n new google.maps.LatLng( 0.488293100000000E+02, -0.119951838000000E+03),\n new google.maps.LatLng( 0.488342650000000E+02, -0.119954158000000E+03),\n new google.maps.LatLng( 0.488380780000000E+02, -0.119957100000000E+03),\n new google.maps.LatLng( 0.488443350000000E+02, -0.119956618000000E+03),\n new google.maps.LatLng( 0.488529910000000E+02, -0.119952469000000E+03),\n new google.maps.LatLng( 0.488570910000000E+02, -0.119947319000000E+03),\n new google.maps.LatLng( 0.488588560000000E+02, -0.119943456000000E+03),\n new google.maps.LatLng( 0.488610850000000E+02, -0.119935392000000E+03),\n new google.maps.LatLng( 0.488621280000000E+02, -0.119935649000000E+03),\n new google.maps.LatLng( 0.488658320000000E+02, -0.119939664000000E+03),\n new google.maps.LatLng( 0.488708500000000E+02, -0.119942666000000E+03),\n new google.maps.LatLng( 0.488718420000000E+02, -0.119941729000000E+03),\n new google.maps.LatLng( 0.488729000000000E+02, -0.119937725000000E+03),\n new google.maps.LatLng( 0.488748730000000E+02, -0.119935802000000E+03),\n new google.maps.LatLng( 0.488756150000000E+02, -0.119935792000000E+03),\n new google.maps.LatLng( 0.488776310000000E+02, -0.119937319000000E+03),\n new google.maps.LatLng( 0.488807140000000E+02, -0.119941053000000E+03),\n new google.maps.LatLng( 0.488830410000000E+02, -0.119945856000000E+03),\n new google.maps.LatLng( 0.488841050000000E+02, -0.119949011000000E+03),\n new google.maps.LatLng( 0.488842530000000E+02, -0.119952312000000E+03),\n new google.maps.LatLng( 0.488851620000000E+02, -0.119953868000000E+03),\n new google.maps.LatLng( 0.488894620000000E+02, -0.119957663000000E+03),\n new google.maps.LatLng( 0.488925800000000E+02, -0.119957344000000E+03),\n new google.maps.LatLng( 0.488938610000000E+02, -0.119958302000000E+03),\n new google.maps.LatLng( 0.488971500000000E+02, -0.119964167000000E+03),\n new google.maps.LatLng( 0.488986050000000E+02, -0.119965858000000E+03),\n new google.maps.LatLng( 0.489015130000000E+02, -0.119965714000000E+03),\n new google.maps.LatLng( 0.489027340000000E+02, -0.119963026000000E+03),\n new google.maps.LatLng( 0.489084670000000E+02, -0.119962998000000E+03),\n new google.maps.LatLng( 0.489131540000000E+02, -0.119965196000000E+03),\n new google.maps.LatLng( 0.489168860000000E+02, -0.119967672000000E+03),\n new google.maps.LatLng( 0.489221230000000E+02, -0.119972203000000E+03),\n new google.maps.LatLng( 0.489308190000000E+02, -0.119976288000000E+03),\n new google.maps.LatLng( 0.489321420000000E+02, -0.119974955000000E+03),\n new google.maps.LatLng( 0.489387170000000E+02, -0.119975121000000E+03),\n new google.maps.LatLng( 0.489408850000000E+02, -0.119977860000000E+03),\n new google.maps.LatLng( 0.489438550000000E+02, -0.119979774000000E+03),\n new google.maps.LatLng( 0.489463630000000E+02, -0.119978617000000E+03),\n new google.maps.LatLng( 0.489540180000000E+02, -0.119970550000000E+03),\n new google.maps.LatLng( 0.489559950000000E+02, -0.119965931000000E+03),\n new google.maps.LatLng( 0.489642980000000E+02, -0.119941603000000E+03),\n new google.maps.LatLng( 0.489643600000000E+02, -0.119939774000000E+03),\n new google.maps.LatLng( 0.489623330000000E+02, -0.119929949000000E+03),\n new google.maps.LatLng( 0.489624430000000E+02, -0.119928694000000E+03),\n new google.maps.LatLng( 0.489644930000000E+02, -0.119924968000000E+03),\n new google.maps.LatLng( 0.489689210000000E+02, -0.119924677000000E+03),\n new google.maps.LatLng( 0.489708820000000E+02, -0.119926382000000E+03),\n new google.maps.LatLng( 0.489720200000000E+02, -0.119930389000000E+03),\n new google.maps.LatLng( 0.489740620000000E+02, -0.119932812000000E+03),\n new google.maps.LatLng( 0.489760200000000E+02, -0.119933035000000E+03),\n new google.maps.LatLng( 0.489771980000000E+02, -0.119931949000000E+03),\n new google.maps.LatLng( 0.489780640000000E+02, -0.119929439000000E+03),\n new google.maps.LatLng( 0.489813530000000E+02, -0.119923909000000E+03),\n new google.maps.LatLng( 0.489931340000000E+02, -0.119920313000000E+03),\n new google.maps.LatLng( 0.490000932993622E+02, -0.119919242571380E+03),\n ];\n\n return zipCoords\n}", "function debugMap(map, x, y, color, font) {\n game.debug.text('map: ' + map.properties.map_name, x, y, color, font);\n game.debug.text('layers: ' + map.layers.length, x, y + game.debug.lineHeight, color, font);\n game.debug.text('tilesize: ' + map.tileWidth + 'x' + map.tileHeight, x, y + (game.debug.lineHeight * 2), color, font);\n game.debug.text('size (tiles): ' + map.width + 'x' + map.height, x, y + (game.debug.lineHeight * 3), color, font);\n game.debug.text('size (pixels): ' + map.widthInPixels + 'x' + map.heightInPixels, x, y + (game.debug.lineHeight * 4), color, font);\n }", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.475335440000000E+02, -0.118479862000000E+03),\n new google.maps.LatLng( 0.475322410000000E+02, -0.118480704000000E+03),\n new google.maps.LatLng( 0.475301850000000E+02, -0.118480432000000E+03),\n new google.maps.LatLng( 0.475241540000000E+02, -0.118475232000000E+03),\n new google.maps.LatLng( 0.475237880000000E+02, -0.118474557000000E+03),\n new google.maps.LatLng( 0.475245900000000E+02, -0.118469328000000E+03),\n new google.maps.LatLng( 0.475243620000000E+02, -0.118464369000000E+03),\n new google.maps.LatLng( 0.475192900000000E+02, -0.118459542000000E+03),\n new google.maps.LatLng( 0.475177590000000E+02, -0.118459407000000E+03),\n new google.maps.LatLng( 0.475163880000000E+02, -0.118459946000000E+03),\n new google.maps.LatLng( 0.475190410000000E+02, -0.118443046000000E+03),\n new google.maps.LatLng( 0.475176240000000E+02, -0.118434985000000E+03),\n new google.maps.LatLng( 0.475150420000000E+02, -0.118432049000000E+03),\n new google.maps.LatLng( 0.475112710000000E+02, -0.118431476000000E+03),\n new google.maps.LatLng( 0.475042560000000E+02, -0.118431612000000E+03),\n new google.maps.LatLng( 0.475045060000000E+02, -0.118422170000000E+03),\n new google.maps.LatLng( 0.475054200000000E+02, -0.118420819000000E+03),\n new google.maps.LatLng( 0.475232900000000E+02, -0.118420983000000E+03),\n new google.maps.LatLng( 0.475234710000000E+02, -0.118409175000000E+03),\n new google.maps.LatLng( 0.475229630000000E+02, -0.118392645000000E+03),\n new google.maps.LatLng( 0.475257970000000E+02, -0.118393014000000E+03),\n new google.maps.LatLng( 0.475309170000000E+02, -0.118395202000000E+03),\n new google.maps.LatLng( 0.475334520000000E+02, -0.118391657000000E+03),\n new google.maps.LatLng( 0.475342280000000E+02, -0.118389666000000E+03),\n new google.maps.LatLng( 0.475374040000000E+02, -0.118389022000000E+03),\n new google.maps.LatLng( 0.475374090000000E+02, -0.118403128000000E+03),\n new google.maps.LatLng( 0.475379820000000E+02, -0.118407109000000E+03),\n new google.maps.LatLng( 0.475396280000000E+02, -0.118409538000000E+03),\n new google.maps.LatLng( 0.475436770000000E+02, -0.118404903000000E+03),\n new google.maps.LatLng( 0.475448870000000E+02, -0.118401238000000E+03),\n new google.maps.LatLng( 0.475446510000000E+02, -0.118399298000000E+03),\n new google.maps.LatLng( 0.475452260000000E+02, -0.118394372000000E+03),\n new google.maps.LatLng( 0.475463990000000E+02, -0.118392709000000E+03),\n new google.maps.LatLng( 0.475508280000000E+02, -0.118389524000000E+03),\n new google.maps.LatLng( 0.475508280000000E+02, -0.118389524000000E+03),\n new google.maps.LatLng( 0.475506560000000E+02, -0.118385061000000E+03),\n new google.maps.LatLng( 0.475515240000000E+02, -0.118383034000000E+03),\n new google.maps.LatLng( 0.475519800000000E+02, -0.118380097000000E+03),\n new google.maps.LatLng( 0.475517340000000E+02, -0.118358079000000E+03),\n new google.maps.LatLng( 0.475327210000000E+02, -0.118358230000000E+03),\n new google.maps.LatLng( 0.475285610000000E+02, -0.118358058000000E+03),\n new google.maps.LatLng( 0.475231920000000E+02, -0.118356839000000E+03),\n new google.maps.LatLng( 0.474937590000000E+02, -0.118356547000000E+03),\n new google.maps.LatLng( 0.474932410000000E+02, -0.118289313000000E+03),\n new google.maps.LatLng( 0.474921900000000E+02, -0.118287931000000E+03),\n new google.maps.LatLng( 0.475059680000000E+02, -0.118288461000000E+03),\n new google.maps.LatLng( 0.475147890000000E+02, -0.118292774000000E+03),\n new google.maps.LatLng( 0.475240220000000E+02, -0.118292232000000E+03),\n new google.maps.LatLng( 0.475277690000000E+02, -0.118290678000000E+03),\n new google.maps.LatLng( 0.475353800000000E+02, -0.118288718000000E+03),\n new google.maps.LatLng( 0.475414350000000E+02, -0.118288310000000E+03),\n new google.maps.LatLng( 0.475509850000000E+02, -0.118279935000000E+03),\n new google.maps.LatLng( 0.475503100000000E+02, -0.118250321000000E+03),\n new google.maps.LatLng( 0.475361190000000E+02, -0.118249426000000E+03),\n new google.maps.LatLng( 0.475364880000000E+02, -0.118242306000000E+03),\n new google.maps.LatLng( 0.475361470000000E+02, -0.118238998000000E+03),\n new google.maps.LatLng( 0.475296600000000E+02, -0.118232345000000E+03),\n new google.maps.LatLng( 0.475184880000000E+02, -0.118223092000000E+03),\n new google.maps.LatLng( 0.475145350000000E+02, -0.118221234000000E+03),\n new google.maps.LatLng( 0.475111300000000E+02, -0.118222177000000E+03),\n new google.maps.LatLng( 0.475109240000000E+02, -0.118221738000000E+03),\n new google.maps.LatLng( 0.475322510000000E+02, -0.118199683000000E+03),\n new google.maps.LatLng( 0.475421010000000E+02, -0.118193476000000E+03),\n new google.maps.LatLng( 0.475462370000000E+02, -0.118188582000000E+03),\n new google.maps.LatLng( 0.475528420000000E+02, -0.118182708000000E+03),\n new google.maps.LatLng( 0.475527730000000E+02, -0.118175383000000E+03),\n new google.maps.LatLng( 0.475523380000000E+02, -0.118174067000000E+03),\n new google.maps.LatLng( 0.475445670000000E+02, -0.118164516000000E+03),\n new google.maps.LatLng( 0.475251880000000E+02, -0.118164221000000E+03),\n new google.maps.LatLng( 0.475201610000000E+02, -0.118167968000000E+03),\n new google.maps.LatLng( 0.475134200000000E+02, -0.118171715000000E+03),\n new google.maps.LatLng( 0.475125290000000E+02, -0.118172626000000E+03),\n new google.maps.LatLng( 0.475116610000000E+02, -0.118174953000000E+03),\n new google.maps.LatLng( 0.475032960000000E+02, -0.118176372000000E+03),\n new google.maps.LatLng( 0.474960590000000E+02, -0.118173400000000E+03),\n new google.maps.LatLng( 0.474940220000000E+02, -0.118171824000000E+03),\n new google.maps.LatLng( 0.474930860000000E+02, -0.118182041000000E+03),\n new google.maps.LatLng( 0.474901150000000E+02, -0.118186222000000E+03),\n new google.maps.LatLng( 0.474787570000000E+02, -0.118186189000000E+03),\n new google.maps.LatLng( 0.474741680000000E+02, -0.118187690000000E+03),\n new google.maps.LatLng( 0.474692530000000E+02, -0.118185020000000E+03),\n new google.maps.LatLng( 0.474641770000000E+02, -0.118184402000000E+03),\n new google.maps.LatLng( 0.474641530000000E+02, -0.118166203000000E+03),\n new google.maps.LatLng( 0.474670040000000E+02, -0.118145273000000E+03),\n new google.maps.LatLng( 0.474690140000000E+02, -0.118141227000000E+03),\n new google.maps.LatLng( 0.474717070000000E+02, -0.118132697000000E+03),\n new google.maps.LatLng( 0.474730050000000E+02, -0.118126077000000E+03),\n new google.maps.LatLng( 0.474729490000000E+02, -0.118123890000000E+03),\n new google.maps.LatLng( 0.474707930000000E+02, -0.118115918000000E+03),\n new google.maps.LatLng( 0.474681210000000E+02, -0.118112713000000E+03),\n new google.maps.LatLng( 0.474666590000000E+02, -0.118111701000000E+03),\n new google.maps.LatLng( 0.474657430000000E+02, -0.118115508000000E+03),\n new google.maps.LatLng( 0.474584720000000E+02, -0.118121903000000E+03),\n new google.maps.LatLng( 0.474360990000000E+02, -0.118121878000000E+03),\n new google.maps.LatLng( 0.474356180000000E+02, -0.118123157000000E+03),\n new google.maps.LatLng( 0.474353450000000E+02, -0.118127715000000E+03),\n new google.maps.LatLng( 0.474360100000000E+02, -0.118131857000000E+03),\n new google.maps.LatLng( 0.474355300000000E+02, -0.118132801000000E+03),\n new google.maps.LatLng( 0.474142540000000E+02, -0.118132857000000E+03),\n new google.maps.LatLng( 0.474126320000000E+02, -0.118135551000000E+03),\n new google.maps.LatLng( 0.474084980000000E+02, -0.118139461000000E+03),\n new google.maps.LatLng( 0.473996320000000E+02, -0.118143339000000E+03),\n new google.maps.LatLng( 0.473952920000000E+02, -0.118148088000000E+03),\n new google.maps.LatLng( 0.473933040000000E+02, -0.118148258000000E+03),\n new google.maps.LatLng( 0.473879770000000E+02, -0.118143652000000E+03),\n new google.maps.LatLng( 0.473879770000000E+02, -0.118143652000000E+03),\n new google.maps.LatLng( 0.473414100000000E+02, -0.118143591000000E+03),\n new google.maps.LatLng( 0.473399050000000E+02, -0.118145173000000E+03),\n new google.maps.LatLng( 0.473410000000000E+02, -0.118148130000000E+03),\n new google.maps.LatLng( 0.473410700000000E+02, -0.118152131000000E+03),\n new google.maps.LatLng( 0.473389240000000E+02, -0.118161110000000E+03),\n new google.maps.LatLng( 0.473394510000000E+02, -0.118164875000000E+03),\n new google.maps.LatLng( 0.473409830000000E+02, -0.118169918000000E+03),\n new google.maps.LatLng( 0.473407990000000E+02, -0.118173348000000E+03),\n new google.maps.LatLng( 0.473387200000000E+02, -0.118180139000000E+03),\n new google.maps.LatLng( 0.473349490000000E+02, -0.118184140000000E+03),\n new google.maps.LatLng( 0.473340810000000E+02, -0.118186326000000E+03),\n new google.maps.LatLng( 0.473342180000000E+02, -0.118196915000000E+03),\n new google.maps.LatLng( 0.473342180000000E+02, -0.118196915000000E+03),\n new google.maps.LatLng( 0.473337380000000E+02, -0.118234273000000E+03),\n new google.maps.LatLng( 0.473337380000000E+02, -0.118234273000000E+03),\n new google.maps.LatLng( 0.473333330000000E+02, -0.118251765000000E+03),\n new google.maps.LatLng( 0.473000710000000E+02, -0.118251370000000E+03),\n new google.maps.LatLng( 0.473000710000000E+02, -0.118251370000000E+03),\n new google.maps.LatLng( 0.473006990000000E+02, -0.118253179000000E+03),\n new google.maps.LatLng( 0.472987400000000E+02, -0.118266787000000E+03),\n new google.maps.LatLng( 0.472957250000000E+02, -0.118271930000000E+03),\n new google.maps.LatLng( 0.472952240000000E+02, -0.118276700000000E+03),\n new google.maps.LatLng( 0.472984490000000E+02, -0.118289968000000E+03),\n new google.maps.LatLng( 0.472988380000000E+02, -0.118296787000000E+03),\n new google.maps.LatLng( 0.472963940000000E+02, -0.118307807000000E+03),\n new google.maps.LatLng( 0.472945660000000E+02, -0.118311972000000E+03),\n new google.maps.LatLng( 0.472917090000000E+02, -0.118312543000000E+03),\n new google.maps.LatLng( 0.472895480000000E+02, -0.118311294000000E+03),\n new google.maps.LatLng( 0.472895940000000E+02, -0.118296791000000E+03),\n new google.maps.LatLng( 0.472610630000000E+02, -0.118296587000000E+03),\n new google.maps.LatLng( 0.472610630000000E+02, -0.118296587000000E+03),\n new google.maps.LatLng( 0.472609900000000E+02, -0.118313622000000E+03),\n new google.maps.LatLng( 0.472609710000000E+02, -0.118321942000000E+03),\n new google.maps.LatLng( 0.472609710000000E+02, -0.118321942000000E+03),\n new google.maps.LatLng( 0.472640760000000E+02, -0.118337689000000E+03),\n new google.maps.LatLng( 0.472682200000000E+02, -0.118337692000000E+03),\n new google.maps.LatLng( 0.472736510000000E+02, -0.118341689000000E+03),\n new google.maps.LatLng( 0.472744500000000E+02, -0.118342663000000E+03),\n new google.maps.LatLng( 0.472749980000000E+02, -0.118345450000000E+03),\n new google.maps.LatLng( 0.472798420000000E+02, -0.118347771000000E+03),\n new google.maps.LatLng( 0.472828590000000E+02, -0.118347639000000E+03),\n new google.maps.LatLng( 0.472853720000000E+02, -0.118349152000000E+03),\n new google.maps.LatLng( 0.472861030000000E+02, -0.118351402000000E+03),\n new google.maps.LatLng( 0.472855300000000E+02, -0.118354962000000E+03),\n new google.maps.LatLng( 0.472858890000000E+02, -0.118358544000000E+03),\n new google.maps.LatLng( 0.472858890000000E+02, -0.118358544000000E+03),\n new google.maps.LatLng( 0.472937090000000E+02, -0.118360645000000E+03),\n new google.maps.LatLng( 0.472955140000000E+02, -0.118361588000000E+03),\n new google.maps.LatLng( 0.473026540000000E+02, -0.118368972000000E+03),\n new google.maps.LatLng( 0.473026540000000E+02, -0.118368972000000E+03),\n new google.maps.LatLng( 0.473036000000000E+02, -0.118368349000000E+03),\n new google.maps.LatLng( 0.473035980000000E+02, -0.118359792000000E+03),\n new google.maps.LatLng( 0.473017780000000E+02, -0.118356990000000E+03),\n new google.maps.LatLng( 0.473012080000000E+02, -0.118353866000000E+03),\n new google.maps.LatLng( 0.473019180000000E+02, -0.118347382000000E+03),\n new google.maps.LatLng( 0.473063730000000E+02, -0.118337025000000E+03),\n new google.maps.LatLng( 0.473119790000000E+02, -0.118327933000000E+03),\n new google.maps.LatLng( 0.473149960000000E+02, -0.118325951000000E+03),\n new google.maps.LatLng( 0.473160470000000E+02, -0.118321281000000E+03),\n new google.maps.LatLng( 0.473183100000000E+02, -0.118315735000000E+03),\n new google.maps.LatLng( 0.473332790000000E+02, -0.118315637000000E+03),\n new google.maps.LatLng( 0.473332990000000E+02, -0.118337050000000E+03),\n new google.maps.LatLng( 0.473332990000000E+02, -0.118337050000000E+03),\n new google.maps.LatLng( 0.473917290000000E+02, -0.118336537000000E+03),\n new google.maps.LatLng( 0.473910520000000E+02, -0.118250609000000E+03),\n new google.maps.LatLng( 0.474059980000000E+02, -0.118250351000000E+03),\n new google.maps.LatLng( 0.474059230000000E+02, -0.118295375000000E+03),\n new google.maps.LatLng( 0.474068370000000E+02, -0.118324526000000E+03),\n new google.maps.LatLng( 0.474063780000000E+02, -0.118336308000000E+03),\n new google.maps.LatLng( 0.474066180000000E+02, -0.118382039000000E+03),\n new google.maps.LatLng( 0.473771740000000E+02, -0.118437212000000E+03),\n new google.maps.LatLng( 0.473771740000000E+02, -0.118437212000000E+03),\n new google.maps.LatLng( 0.473773300000000E+02, -0.118465405000000E+03),\n new google.maps.LatLng( 0.474355810000000E+02, -0.118464089000000E+03),\n new google.maps.LatLng( 0.474646020000000E+02, -0.118464104000000E+03),\n new google.maps.LatLng( 0.474641890000000E+02, -0.118473372000000E+03),\n new google.maps.LatLng( 0.474648470000000E+02, -0.118484829000000E+03),\n new google.maps.LatLng( 0.474643200000000E+02, -0.118487996000000E+03),\n new google.maps.LatLng( 0.474355140000000E+02, -0.118557267000000E+03),\n new google.maps.LatLng( 0.474355940000000E+02, -0.118611862000000E+03),\n new google.maps.LatLng( 0.474326880000000E+02, -0.118620615000000E+03),\n new google.maps.LatLng( 0.474304260000000E+02, -0.118620174000000E+03),\n new google.maps.LatLng( 0.474220420000000E+02, -0.118633924000000E+03),\n new google.maps.LatLng( 0.474209000000000E+02, -0.118634464000000E+03),\n new google.maps.LatLng( 0.474221570000000E+02, -0.118635574000000E+03),\n new google.maps.LatLng( 0.474284420000000E+02, -0.118636982000000E+03),\n new google.maps.LatLng( 0.474306120000000E+02, -0.118636980000000E+03),\n new google.maps.LatLng( 0.474319140000000E+02, -0.118635329000000E+03),\n new google.maps.LatLng( 0.474367140000000E+02, -0.118636739000000E+03),\n new google.maps.LatLng( 0.474496950000000E+02, -0.118642217000000E+03),\n new google.maps.LatLng( 0.474508840000000E+02, -0.118644979000000E+03),\n new google.maps.LatLng( 0.474505210000000E+02, -0.118650875000000E+03),\n new google.maps.LatLng( 0.474475300000000E+02, -0.118661521000000E+03),\n new google.maps.LatLng( 0.474452000000000E+02, -0.118666036000000E+03),\n new google.maps.LatLng( 0.474441720000000E+02, -0.118676782000000E+03),\n new google.maps.LatLng( 0.474790890000000E+02, -0.118677383000000E+03),\n new google.maps.LatLng( 0.474793350000000E+02, -0.118720830000000E+03),\n new google.maps.LatLng( 0.475073810000000E+02, -0.118720474000000E+03),\n new google.maps.LatLng( 0.475080900000000E+02, -0.118718586000000E+03),\n new google.maps.LatLng( 0.475076610000000E+02, -0.118685232000000E+03),\n new google.maps.LatLng( 0.475082050000000E+02, -0.118656364000000E+03),\n new google.maps.LatLng( 0.474786990000000E+02, -0.118655736000000E+03),\n new google.maps.LatLng( 0.474783080000000E+02, -0.118653182000000E+03),\n new google.maps.LatLng( 0.474788950000000E+02, -0.118634811000000E+03),\n new google.maps.LatLng( 0.474825510000000E+02, -0.118634707000000E+03),\n new google.maps.LatLng( 0.474876710000000E+02, -0.118635983000000E+03),\n new google.maps.LatLng( 0.474937940000000E+02, -0.118635033000000E+03),\n new google.maps.LatLng( 0.475080370000000E+02, -0.118634982000000E+03),\n new google.maps.LatLng( 0.475080370000000E+02, -0.118634982000000E+03),\n new google.maps.LatLng( 0.475077940000000E+02, -0.118589804000000E+03),\n new google.maps.LatLng( 0.475025870000000E+02, -0.118570546000000E+03),\n new google.maps.LatLng( 0.475020390000000E+02, -0.118565925000000E+03),\n new google.maps.LatLng( 0.475021300000000E+02, -0.118561778000000E+03),\n new google.maps.LatLng( 0.475028610000000E+02, -0.118558675000000E+03),\n new google.maps.LatLng( 0.475045060000000E+02, -0.118554831000000E+03),\n new google.maps.LatLng( 0.475080480000000E+02, -0.118549839000000E+03),\n new google.maps.LatLng( 0.475080200000000E+02, -0.118542516000000E+03),\n new google.maps.LatLng( 0.475117710000000E+02, -0.118535706000000E+03),\n new google.maps.LatLng( 0.475143530000000E+02, -0.118534726000000E+03),\n new google.maps.LatLng( 0.475213200000000E+02, -0.118525918000000E+03),\n new google.maps.LatLng( 0.475214620000000E+02, -0.118520273000000E+03),\n new google.maps.LatLng( 0.475245870000000E+02, -0.118514080000000E+03),\n new google.maps.LatLng( 0.475276100000000E+02, -0.118509890000000E+03),\n new google.maps.LatLng( 0.475281950000000E+02, -0.118507727000000E+03),\n new google.maps.LatLng( 0.475279770000000E+02, -0.118505929000000E+03),\n new google.maps.LatLng( 0.475298780000000E+02, -0.118499698000000E+03),\n new google.maps.LatLng( 0.475330820000000E+02, -0.118492481000000E+03),\n new google.maps.LatLng( 0.475351500000000E+02, -0.118489668000000E+03),\n new google.maps.LatLng( 0.475351500000000E+02, -0.118489668000000E+03),\n new google.maps.LatLng( 0.475342940000000E+02, -0.118489581000000E+03),\n new google.maps.LatLng( 0.475352550000000E+02, -0.118486984000000E+03),\n new google.maps.LatLng( 0.475351650000000E+02, -0.118484520000000E+03),\n new google.maps.LatLng( 0.475337720000000E+02, -0.118482190000000E+03),\n new google.maps.LatLng( 0.475335440000000E+02, -0.118479862000000E+03),\n new google.maps.LatLng( 0.475005530000000E+02, -0.118551561000000E+03),\n new google.maps.LatLng( 0.475011010000000E+02, -0.118553213000000E+03),\n new google.maps.LatLng( 0.474986520000000E+02, -0.118560871000000E+03),\n new google.maps.LatLng( 0.474979210000000E+02, -0.118561276000000E+03),\n new google.maps.LatLng( 0.474962300000000E+02, -0.118561006000000E+03),\n new google.maps.LatLng( 0.474951100000000E+02, -0.118562152000000E+03),\n new google.maps.LatLng( 0.474925050000000E+02, -0.118569772000000E+03),\n new google.maps.LatLng( 0.474827010000000E+02, -0.118580254000000E+03),\n new google.maps.LatLng( 0.474814890000000E+02, -0.118583793000000E+03),\n new google.maps.LatLng( 0.474794750000000E+02, -0.118594207000000E+03),\n new google.maps.LatLng( 0.474811410000000E+02, -0.118601153000000E+03),\n new google.maps.LatLng( 0.474802720000000E+02, -0.118602905000000E+03),\n new google.maps.LatLng( 0.474797920000000E+02, -0.118602904000000E+03),\n new google.maps.LatLng( 0.474791300000000E+02, -0.118602466000000E+03),\n new google.maps.LatLng( 0.474781060000000E+02, -0.118589049000000E+03),\n new google.maps.LatLng( 0.474789980000000E+02, -0.118583320000000E+03),\n new google.maps.LatLng( 0.474851470000000E+02, -0.118570815000000E+03),\n new google.maps.LatLng( 0.474904940000000E+02, -0.118562927000000E+03),\n new google.maps.LatLng( 0.474982410000000E+02, -0.118553554000000E+03),\n new google.maps.LatLng( 0.474992690000000E+02, -0.118549878000000E+03),\n new google.maps.LatLng( 0.475001990000000E+02, -0.118550313000000E+03),\n new google.maps.LatLng( 0.475005530000000E+02, -0.118551561000000E+03),\n ];\n\n return zipCoords\n}", "function makeMap() {\r\n\tif (map == \"\") {\r\n\t\tgenNewMap();\r\n\t}\r\n\r\n\tconstructMap();\r\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.482119130000000E+02, -0.119717734000000E+03),\n new google.maps.LatLng( 0.482165690000000E+02, -0.119717385000000E+03),\n new google.maps.LatLng( 0.482197930000000E+02, -0.119718680000000E+03),\n new google.maps.LatLng( 0.482233810000000E+02, -0.119717897000000E+03),\n new google.maps.LatLng( 0.482242260000000E+02, -0.119716421000000E+03),\n new google.maps.LatLng( 0.482387430000000E+02, -0.119716056000000E+03),\n new google.maps.LatLng( 0.482398710000000E+02, -0.119719891000000E+03),\n new google.maps.LatLng( 0.482390940000000E+02, -0.119721668000000E+03),\n new google.maps.LatLng( 0.482433410000000E+02, -0.119723690000000E+03),\n new google.maps.LatLng( 0.482481150000000E+02, -0.119724411000000E+03),\n new google.maps.LatLng( 0.482547560000000E+02, -0.119723486000000E+03),\n new google.maps.LatLng( 0.482623390000000E+02, -0.119721576000000E+03),\n new google.maps.LatLng( 0.482659030000000E+02, -0.119719765000000E+03),\n new google.maps.LatLng( 0.482688730000000E+02, -0.119717167000000E+03),\n new google.maps.LatLng( 0.482797250000000E+02, -0.119702767000000E+03),\n new google.maps.LatLng( 0.482817130000000E+02, -0.119697360000000E+03),\n new google.maps.LatLng( 0.482805250000000E+02, -0.119696675000000E+03),\n new google.maps.LatLng( 0.482758200000000E+02, -0.119695921000000E+03),\n new google.maps.LatLng( 0.482741070000000E+02, -0.119695032000000E+03),\n new google.maps.LatLng( 0.482739240000000E+02, -0.119694416000000E+03),\n new google.maps.LatLng( 0.482738330000000E+02, -0.119690481000000E+03),\n new google.maps.LatLng( 0.482762090000000E+02, -0.119684220000000E+03),\n new google.maps.LatLng( 0.482749060000000E+02, -0.119678300000000E+03),\n new google.maps.LatLng( 0.482755460000000E+02, -0.119676555000000E+03),\n new google.maps.LatLng( 0.482755460000000E+02, -0.119676555000000E+03),\n new google.maps.LatLng( 0.482742900000000E+02, -0.119677205000000E+03),\n new google.maps.LatLng( 0.482740150000000E+02, -0.119676692000000E+03),\n new google.maps.LatLng( 0.482726120000000E+02, -0.119668292000000E+03),\n new google.maps.LatLng( 0.482736970000000E+02, -0.119665629000000E+03),\n new google.maps.LatLng( 0.482706580000000E+02, -0.119663198000000E+03),\n new google.maps.LatLng( 0.482644720000000E+02, -0.119664086000000E+03),\n new google.maps.LatLng( 0.482613020000000E+02, -0.119654984000000E+03),\n new google.maps.LatLng( 0.482579690000000E+02, -0.119649578000000E+03),\n new google.maps.LatLng( 0.482509880000000E+02, -0.119652926000000E+03),\n new google.maps.LatLng( 0.482468620000000E+02, -0.119653072000000E+03),\n new google.maps.LatLng( 0.482455590000000E+02, -0.119651397000000E+03),\n new google.maps.LatLng( 0.482466090000000E+02, -0.119649140000000E+03),\n new google.maps.LatLng( 0.482464950000000E+02, -0.119648216000000E+03),\n new google.maps.LatLng( 0.482403040000000E+02, -0.119646032000000E+03),\n new google.maps.LatLng( 0.482359200000000E+02, -0.119648292000000E+03),\n new google.maps.LatLng( 0.482311460000000E+02, -0.119649731000000E+03),\n new google.maps.LatLng( 0.482288160000000E+02, -0.119649425000000E+03),\n new google.maps.LatLng( 0.482265090000000E+02, -0.119647991000000E+03),\n new google.maps.LatLng( 0.482246820000000E+02, -0.119647992000000E+03),\n new google.maps.LatLng( 0.482195200000000E+02, -0.119650491000000E+03),\n new google.maps.LatLng( 0.482135580000000E+02, -0.119646667000000E+03),\n new google.maps.LatLng( 0.482084600000000E+02, -0.119636590000000E+03),\n new google.maps.LatLng( 0.482084800000000E+02, -0.119629140000000E+03),\n new google.maps.LatLng( 0.482102140000000E+02, -0.119626951000000E+03),\n new google.maps.LatLng( 0.482098920000000E+02, -0.119625142000000E+03),\n new google.maps.LatLng( 0.482040970000000E+02, -0.119612799000000E+03),\n new google.maps.LatLng( 0.482037090000000E+02, -0.119610509000000E+03),\n new google.maps.LatLng( 0.481979560000000E+02, -0.119604558000000E+03),\n new google.maps.LatLng( 0.481973620000000E+02, -0.119603123000000E+03),\n new google.maps.LatLng( 0.481972200000000E+02, -0.119600687000000E+03),\n new google.maps.LatLng( 0.481994820000000E+02, -0.119594980000000E+03),\n new google.maps.LatLng( 0.482017180000000E+02, -0.119592958000000E+03),\n new google.maps.LatLng( 0.482007010000000E+02, -0.119591304000000E+03),\n new google.maps.LatLng( 0.481986000000000E+02, -0.119589868000000E+03),\n new google.maps.LatLng( 0.481980520000000E+02, -0.119590106000000E+03),\n new google.maps.LatLng( 0.481972520000000E+02, -0.119592361000000E+03),\n new google.maps.LatLng( 0.481957440000000E+02, -0.119593146000000E+03),\n new google.maps.LatLng( 0.481930260000000E+02, -0.119592905000000E+03),\n new google.maps.LatLng( 0.481897600000000E+02, -0.119591331000000E+03),\n new google.maps.LatLng( 0.481851470000000E+02, -0.119586887000000E+03),\n new google.maps.LatLng( 0.481841190000000E+02, -0.119586443000000E+03),\n new google.maps.LatLng( 0.481816520000000E+02, -0.119586442000000E+03),\n new google.maps.LatLng( 0.481724680000000E+02, -0.119591116000000E+03),\n new google.maps.LatLng( 0.481706630000000E+02, -0.119590739000000E+03),\n new google.maps.LatLng( 0.481685860000000E+02, -0.119585718000000E+03),\n new google.maps.LatLng( 0.481634570000000E+02, -0.119586979000000E+03),\n new google.maps.LatLng( 0.481634370000000E+02, -0.119579285000000E+03),\n new google.maps.LatLng( 0.481384130000000E+02, -0.119579288000000E+03),\n new google.maps.LatLng( 0.481225510000000E+02, -0.119579902000000E+03),\n new google.maps.LatLng( 0.481138710000000E+02, -0.119579455000000E+03),\n new google.maps.LatLng( 0.480923540000000E+02, -0.119579413000000E+03),\n new google.maps.LatLng( 0.480923320000000E+02, -0.119568638000000E+03),\n new google.maps.LatLng( 0.480934060000000E+02, -0.119563353000000E+03),\n new google.maps.LatLng( 0.480882210000000E+02, -0.119564205000000E+03),\n new google.maps.LatLng( 0.480827160000000E+02, -0.119565875000000E+03),\n new google.maps.LatLng( 0.480799980000000E+02, -0.119565943000000E+03),\n new google.maps.LatLng( 0.480775920000000E+02, -0.119565435000000E+03),\n new google.maps.LatLng( 0.480775920000000E+02, -0.119565435000000E+03),\n new google.maps.LatLng( 0.480729620000000E+02, -0.119564374000000E+03),\n new google.maps.LatLng( 0.480717970000000E+02, -0.119562703000000E+03),\n new google.maps.LatLng( 0.480704040000000E+02, -0.119558682000000E+03),\n new google.maps.LatLng( 0.480683710000000E+02, -0.119556262000000E+03),\n new google.maps.LatLng( 0.480623860000000E+02, -0.119551117000000E+03),\n new google.maps.LatLng( 0.480544580000000E+02, -0.119547268000000E+03),\n new google.maps.LatLng( 0.480532020000000E+02, -0.119546962000000E+03),\n new google.maps.LatLng( 0.480514880000000E+02, -0.119547371000000E+03),\n new google.maps.LatLng( 0.480514880000000E+02, -0.119547371000000E+03),\n new google.maps.LatLng( 0.480458470000000E+02, -0.119556401000000E+03),\n new google.maps.LatLng( 0.480398400000000E+02, -0.119563588000000E+03),\n new google.maps.LatLng( 0.480348590000000E+02, -0.119575508000000E+03),\n new google.maps.LatLng( 0.480306550000000E+02, -0.119580820000000E+03),\n new google.maps.LatLng( 0.480268840000000E+02, -0.119586778000000E+03),\n new google.maps.LatLng( 0.480238910000000E+02, -0.119592871000000E+03),\n new google.maps.LatLng( 0.480188000000000E+02, -0.119600857000000E+03),\n new google.maps.LatLng( 0.480136070000000E+02, -0.119607062000000E+03),\n new google.maps.LatLng( 0.480096310000000E+02, -0.119610531000000E+03),\n new google.maps.LatLng( 0.480006280000000E+02, -0.119616649000000E+03),\n new google.maps.LatLng( 0.479995250000000E+02, -0.119618390000000E+03),\n new google.maps.LatLng( 0.479987460000000E+02, -0.119620941000000E+03),\n new google.maps.LatLng( 0.479976750000000E+02, -0.119634317000000E+03),\n new google.maps.LatLng( 0.480007960000000E+02, -0.119649827000000E+03),\n new google.maps.LatLng( 0.480023510000000E+02, -0.119654795000000E+03),\n new google.maps.LatLng( 0.480048870000000E+02, -0.119658981000000E+03),\n new google.maps.LatLng( 0.480100740000000E+02, -0.119664901000000E+03),\n new google.maps.LatLng( 0.480148490000000E+02, -0.119672560000000E+03),\n new google.maps.LatLng( 0.480210860000000E+02, -0.119683964000000E+03),\n new google.maps.LatLng( 0.480244660000000E+02, -0.119688561000000E+03),\n new google.maps.LatLng( 0.480287150000000E+02, -0.119691285000000E+03),\n new google.maps.LatLng( 0.480305880000000E+02, -0.119691932000000E+03),\n new google.maps.LatLng( 0.480323920000000E+02, -0.119691762000000E+03),\n new google.maps.LatLng( 0.480384230000000E+02, -0.119687335000000E+03),\n new google.maps.LatLng( 0.480455730000000E+02, -0.119679637000000E+03),\n new google.maps.LatLng( 0.480540690000000E+02, -0.119676501000000E+03),\n new google.maps.LatLng( 0.480584550000000E+02, -0.119674013000000E+03),\n new google.maps.LatLng( 0.480651240000000E+02, -0.119669241000000E+03),\n new google.maps.LatLng( 0.480678650000000E+02, -0.119668116000000E+03),\n new google.maps.LatLng( 0.480813420000000E+02, -0.119665009000000E+03),\n new google.maps.LatLng( 0.480823020000000E+02, -0.119669168000000E+03),\n new google.maps.LatLng( 0.480861400000000E+02, -0.119674552000000E+03),\n new google.maps.LatLng( 0.480928560000000E+02, -0.119680894000000E+03),\n new google.maps.LatLng( 0.480939290000000E+02, -0.119679087000000E+03),\n new google.maps.LatLng( 0.480966930000000E+02, -0.119680211000000E+03),\n new google.maps.LatLng( 0.480960310000000E+02, -0.119683519000000E+03),\n new google.maps.LatLng( 0.480880130000000E+02, -0.119697872000000E+03),\n new google.maps.LatLng( 0.480864360000000E+02, -0.119703053000000E+03),\n new google.maps.LatLng( 0.480860690000000E+02, -0.119705917000000E+03),\n new google.maps.LatLng( 0.480882150000000E+02, -0.119709770000000E+03),\n new google.maps.LatLng( 0.480899750000000E+02, -0.119708032000000E+03),\n new google.maps.LatLng( 0.480927610000000E+02, -0.119711478000000E+03),\n new google.maps.LatLng( 0.480944040000000E+02, -0.119716422000000E+03),\n new google.maps.LatLng( 0.480987430000000E+02, -0.119719391000000E+03),\n new google.maps.LatLng( 0.480994070000000E+02, -0.119713936000000E+03),\n new google.maps.LatLng( 0.481005730000000E+02, -0.119710970000000E+03),\n new google.maps.LatLng( 0.481046620000000E+02, -0.119706846000000E+03),\n new google.maps.LatLng( 0.481054160000000E+02, -0.119704869000000E+03),\n new google.maps.LatLng( 0.481060340000000E+02, -0.119696547000000E+03),\n new google.maps.LatLng( 0.481045040000000E+02, -0.119693784000000E+03),\n new google.maps.LatLng( 0.481037510000000E+02, -0.119691227000000E+03),\n new google.maps.LatLng( 0.481042760000000E+02, -0.119689180000000E+03),\n new google.maps.LatLng( 0.481164960000000E+02, -0.119682393000000E+03),\n new google.maps.LatLng( 0.481256920000000E+02, -0.119679725000000E+03),\n new google.maps.LatLng( 0.481334120000000E+02, -0.119674128000000E+03),\n new google.maps.LatLng( 0.481352390000000E+02, -0.119673377000000E+03),\n new google.maps.LatLng( 0.481371120000000E+02, -0.119674059000000E+03),\n new google.maps.LatLng( 0.481403100000000E+02, -0.119672488000000E+03),\n new google.maps.LatLng( 0.481462710000000E+02, -0.119668766000000E+03),\n new google.maps.LatLng( 0.481478460000000E+02, -0.119666342000000E+03),\n new google.maps.LatLng( 0.481503590000000E+02, -0.119665283000000E+03),\n new google.maps.LatLng( 0.481550410000000E+02, -0.119664360000000E+03),\n new google.maps.LatLng( 0.481590620000000E+02, -0.119668045000000E+03),\n new google.maps.LatLng( 0.481682680000000E+02, -0.119671901000000E+03),\n new google.maps.LatLng( 0.481743900000000E+02, -0.119675314000000E+03),\n new google.maps.LatLng( 0.481793700000000E+02, -0.119678968000000E+03),\n new google.maps.LatLng( 0.481829560000000E+02, -0.119679172000000E+03),\n new google.maps.LatLng( 0.481880040000000E+02, -0.119678044000000E+03),\n new google.maps.LatLng( 0.481914530000000E+02, -0.119680606000000E+03),\n new google.maps.LatLng( 0.481937830000000E+02, -0.119684227000000E+03),\n new google.maps.LatLng( 0.481975970000000E+02, -0.119691846000000E+03),\n new google.maps.LatLng( 0.482064350000000E+02, -0.119703807000000E+03),\n new google.maps.LatLng( 0.482087620000000E+02, -0.119714879000000E+03),\n new google.maps.LatLng( 0.482119130000000E+02, -0.119717734000000E+03),\n ];\n\n return zipCoords\n}", "function ReloadMap () {\n\tif ( document.getElementById('change').innerText == 'Reload Map') {\n\t\t// Setting arrays to nothing in them //\n\t\tstrtxArray.length = 0;\n\t\tstrtyArray.length = 0;\n\t\tstopxArray.length = 0;\n\t\tstopyArray.length = 0;\n\t\t// End of setting array to Zero //\n\t\tarrowTypeArray.length = 0;\n\t\tclickcount = 0;\n\t\tvalidClick = 1;\n\t\tprevX = -1;\n\t\tprevY = -1;\n\t\tclearInterval(animate_interval);\n\t\tanimate_loop = 0;\n\t\tclearInterval(doAnimate);\n\t\tclearInterval(animate_loop);\n\t\tGetMapCursorPos();\n\t\tGetCurPosDraw();\n\t\t\n\n\t\tmyAnimate2();\n\t\tdoAnimate();\n\t\tdrawImage();\t\t\n\t\t\n\t\tconsole.log(\"arrayX=\" + ' ' + strtxArray[strtxArray.length]);\n\t\tconsole.log(\"arrayY=\" + ' ' + strtyArray[strtyArray.length]);\n\t} else {\n\t\tdocument.getElementById('change').innerHTML = 'Reload Map';\n\t\tdrawImage();\n\t\t}\n }", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.459437740000000E+02, -0.122786352000000E+03),\n new google.maps.LatLng( 0.459400930000000E+02, -0.122786682000000E+03),\n new google.maps.LatLng( 0.459355210000000E+02, -0.122788125000000E+03),\n new google.maps.LatLng( 0.459280010000000E+02, -0.122792257000000E+03),\n new google.maps.LatLng( 0.459246410000000E+02, -0.122797697000000E+03),\n new google.maps.LatLng( 0.459247790000000E+02, -0.122798647000000E+03),\n new google.maps.LatLng( 0.459336490000000E+02, -0.122797825000000E+03),\n new google.maps.LatLng( 0.459368260000000E+02, -0.122796153000000E+03),\n new google.maps.LatLng( 0.459437740000000E+02, -0.122786352000000E+03),\n ];\n\n return zipCoords\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.469875680000000E+02, -0.119237254000000E+03),\n new google.maps.LatLng( 0.469854950000000E+02, -0.119225457000000E+03),\n new google.maps.LatLng( 0.469897240000000E+02, -0.119218248000000E+03),\n new google.maps.LatLng( 0.469881720000000E+02, -0.119213805000000E+03),\n new google.maps.LatLng( 0.469884150000000E+02, -0.119208344000000E+03),\n new google.maps.LatLng( 0.469884150000000E+02, -0.119208344000000E+03),\n new google.maps.LatLng( 0.469848150000000E+02, -0.119205891000000E+03),\n new google.maps.LatLng( 0.469843820000000E+02, -0.119194671000000E+03),\n new google.maps.LatLng( 0.469786470000000E+02, -0.119197809000000E+03),\n new google.maps.LatLng( 0.469770930000000E+02, -0.119197841000000E+03),\n new google.maps.LatLng( 0.469720890000000E+02, -0.119196672000000E+03),\n new google.maps.LatLng( 0.469665600000000E+02, -0.119191764000000E+03),\n new google.maps.LatLng( 0.469645490000000E+02, -0.119179347000000E+03),\n new google.maps.LatLng( 0.469608020000000E+02, -0.119187492000000E+03),\n new google.maps.LatLng( 0.469547470000000E+02, -0.119191563000000E+03),\n new google.maps.LatLng( 0.469513650000000E+02, -0.119191629000000E+03),\n new google.maps.LatLng( 0.469450810000000E+02, -0.119189927000000E+03),\n new google.maps.LatLng( 0.469406940000000E+02, -0.119188225000000E+03),\n new google.maps.LatLng( 0.469394140000000E+02, -0.119186824000000E+03),\n new google.maps.LatLng( 0.469384310000000E+02, -0.119186657000000E+03),\n new google.maps.LatLng( 0.469293830000000E+02, -0.119193728000000E+03),\n new google.maps.LatLng( 0.469281940000000E+02, -0.119196530000000E+03),\n new google.maps.LatLng( 0.469227560000000E+02, -0.119202231000000E+03),\n new google.maps.LatLng( 0.469218870000000E+02, -0.119204299000000E+03),\n new google.maps.LatLng( 0.469218870000000E+02, -0.119204299000000E+03),\n new google.maps.LatLng( 0.469234470000000E+02, -0.119208705000000E+03),\n new google.maps.LatLng( 0.469269350000000E+02, -0.119210838000000E+03),\n new google.maps.LatLng( 0.469343370000000E+02, -0.119219414000000E+03),\n new google.maps.LatLng( 0.469525690000000E+02, -0.119222262000000E+03),\n new google.maps.LatLng( 0.469570140000000E+02, -0.119229473000000E+03),\n new google.maps.LatLng( 0.469566650000000E+02, -0.119233608000000E+03),\n new google.maps.LatLng( 0.469556040000000E+02, -0.119234011000000E+03),\n new google.maps.LatLng( 0.469552570000000E+02, -0.119243921000000E+03),\n new google.maps.LatLng( 0.469600530000000E+02, -0.119246564000000E+03),\n new google.maps.LatLng( 0.469663360000000E+02, -0.119248874000000E+03),\n new google.maps.LatLng( 0.469680970000000E+02, -0.119252083000000E+03),\n new google.maps.LatLng( 0.469724180000000E+02, -0.119257486000000E+03),\n new google.maps.LatLng( 0.469779940000000E+02, -0.119259250000000E+03),\n new google.maps.LatLng( 0.469812610000000E+02, -0.119257311000000E+03),\n new google.maps.LatLng( 0.469817630000000E+02, -0.119255340000000E+03),\n new google.maps.LatLng( 0.469817820000000E+02, -0.119250428000000E+03),\n new google.maps.LatLng( 0.469840900000000E+02, -0.119248461000000E+03),\n new google.maps.LatLng( 0.469841020000000E+02, -0.119247538000000E+03),\n new google.maps.LatLng( 0.469841020000000E+02, -0.119247538000000E+03),\n new google.maps.LatLng( 0.469840000000000E+02, -0.119246124000000E+03),\n new google.maps.LatLng( 0.469853520000000E+02, -0.119239849000000E+03),\n new google.maps.LatLng( 0.469871800000000E+02, -0.119239717000000E+03),\n new google.maps.LatLng( 0.469875680000000E+02, -0.119237254000000E+03),\n ];\n\n return zipCoords\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.474522170000000E+02, -0.120175650000000E+03),\n new google.maps.LatLng( 0.474510250000000E+02, -0.120168540000000E+03),\n new google.maps.LatLng( 0.474496990000000E+02, -0.120165274000000E+03),\n new google.maps.LatLng( 0.474477340000000E+02, -0.120164601000000E+03),\n new google.maps.LatLng( 0.474470030000000E+02, -0.120163794000000E+03),\n new google.maps.LatLng( 0.474466830000000E+02, -0.120162514000000E+03),\n new google.maps.LatLng( 0.474472760000000E+02, -0.120157260000000E+03),\n new google.maps.LatLng( 0.474460640000000E+02, -0.120154837000000E+03),\n new google.maps.LatLng( 0.474455160000000E+02, -0.120155369000000E+03),\n new google.maps.LatLng( 0.474455160000000E+02, -0.120155369000000E+03),\n new google.maps.LatLng( 0.474468870000000E+02, -0.120157025000000E+03),\n new google.maps.LatLng( 0.474470250000000E+02, -0.120157967000000E+03),\n new google.maps.LatLng( 0.474463640000000E+02, -0.120163390000000E+03),\n new google.maps.LatLng( 0.474474600000000E+02, -0.120164804000000E+03),\n new google.maps.LatLng( 0.474487630000000E+02, -0.120165241000000E+03),\n new google.maps.LatLng( 0.474488330000000E+02, -0.120175612000000E+03),\n new google.maps.LatLng( 0.474522170000000E+02, -0.120175650000000E+03),\n ];\n\n return zipCoords\n}", "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.468683030000000E+02, -0.117970753000000E+03),\n new google.maps.LatLng( 0.468691870000000E+02, -0.117969375000000E+03),\n new google.maps.LatLng( 0.468691430000000E+02, -0.117965783000000E+03),\n new google.maps.LatLng( 0.468679660000000E+02, -0.117958701000000E+03),\n new google.maps.LatLng( 0.468697310000000E+02, -0.117951752000000E+03),\n new google.maps.LatLng( 0.468722720000000E+02, -0.117949184000000E+03),\n new google.maps.LatLng( 0.468743270000000E+02, -0.117948781000000E+03),\n new google.maps.LatLng( 0.468792490000000E+02, -0.117945187000000E+03),\n new google.maps.LatLng( 0.468865860000000E+02, -0.117936753000000E+03),\n new google.maps.LatLng( 0.468881630000000E+02, -0.117931286000000E+03),\n new google.maps.LatLng( 0.468925290000000E+02, -0.117929318000000E+03),\n new google.maps.LatLng( 0.468995910000000E+02, -0.117927883000000E+03),\n new google.maps.LatLng( 0.469053050000000E+02, -0.117929182000000E+03),\n new google.maps.LatLng( 0.469084820000000E+02, -0.117929082000000E+03),\n new google.maps.LatLng( 0.469121620000000E+02, -0.117927914000000E+03),\n new google.maps.LatLng( 0.469127790000000E+02, -0.117920675000000E+03),\n new google.maps.LatLng( 0.469125050000000E+02, -0.117918474000000E+03),\n new google.maps.LatLng( 0.469071550000000E+02, -0.117911839000000E+03),\n new google.maps.LatLng( 0.469066520000000E+02, -0.117910038000000E+03),\n new google.maps.LatLng( 0.469087970000000E+02, -0.117900299000000E+03),\n new google.maps.LatLng( 0.469123380000000E+02, -0.117895092000000E+03),\n new google.maps.LatLng( 0.469122400000000E+02, -0.117879616000000E+03),\n new google.maps.LatLng( 0.469125820000000E+02, -0.117877848000000E+03),\n new google.maps.LatLng( 0.469132220000000E+02, -0.117876913000000E+03),\n new google.maps.LatLng( 0.469141820000000E+02, -0.117876498000000E+03),\n new google.maps.LatLng( 0.469154850000000E+02, -0.117872886000000E+03),\n new google.maps.LatLng( 0.469140960000000E+02, -0.117862845000000E+03),\n new google.maps.LatLng( 0.469119810000000E+02, -0.117839325000000E+03),\n new google.maps.LatLng( 0.468883200000000E+02, -0.117846751000000E+03),\n new google.maps.LatLng( 0.468781690000000E+02, -0.117852879000000E+03),\n new google.maps.LatLng( 0.468748790000000E+02, -0.117854110000000E+03),\n new google.maps.LatLng( 0.468667640000000E+02, -0.117855638000000E+03),\n new google.maps.LatLng( 0.468544200000000E+02, -0.117859326000000E+03),\n new google.maps.LatLng( 0.468548780000000E+02, -0.117836532000000E+03),\n new google.maps.LatLng( 0.468531250000000E+02, -0.117833836000000E+03),\n new google.maps.LatLng( 0.468527370000000E+02, -0.117829838000000E+03),\n new google.maps.LatLng( 0.468541790000000E+02, -0.117821009000000E+03),\n new google.maps.LatLng( 0.468560760000000E+02, -0.117817377000000E+03),\n new google.maps.LatLng( 0.468571270000000E+02, -0.117806981000000E+03),\n new google.maps.LatLng( 0.468559150000000E+02, -0.117797518000000E+03),\n new google.maps.LatLng( 0.468617400000000E+02, -0.117775690000000E+03),\n new google.maps.LatLng( 0.468658470000000E+02, -0.117757123000000E+03),\n new google.maps.LatLng( 0.468658990000000E+02, -0.117731694000000E+03),\n new google.maps.LatLng( 0.468652140000000E+02, -0.117727528000000E+03),\n new google.maps.LatLng( 0.468633230000000E+02, -0.117703099000000E+03),\n new google.maps.LatLng( 0.468618070000000E+02, -0.117703336000000E+03),\n new google.maps.LatLng( 0.468607180000000E+02, -0.117700099000000E+03),\n new google.maps.LatLng( 0.468607410000000E+02, -0.117698766000000E+03),\n new google.maps.LatLng( 0.468633240000000E+02, -0.117690303000000E+03),\n new google.maps.LatLng( 0.468644210000000E+02, -0.117680638000000E+03),\n new google.maps.LatLng( 0.468607180000000E+02, -0.117675207000000E+03),\n new google.maps.LatLng( 0.468535850000000E+02, -0.117661948000000E+03),\n new google.maps.LatLng( 0.468507480000000E+02, -0.117654719000000E+03),\n new google.maps.LatLng( 0.468451190000000E+02, -0.117633435000000E+03),\n new google.maps.LatLng( 0.468434720000000E+02, -0.117630737000000E+03),\n new google.maps.LatLng( 0.468316310000000E+02, -0.117632015000000E+03),\n new google.maps.LatLng( 0.468249810000000E+02, -0.117634952000000E+03),\n new google.maps.LatLng( 0.468205710000000E+02, -0.117638454000000E+03),\n new google.maps.LatLng( 0.468168010000000E+02, -0.117640355000000E+03),\n new google.maps.LatLng( 0.468146530000000E+02, -0.117641089000000E+03),\n new google.maps.LatLng( 0.468103270000000E+02, -0.117641259000000E+03),\n new google.maps.LatLng( 0.468107650000000E+02, -0.117637363000000E+03),\n new google.maps.LatLng( 0.468108550000000E+02, -0.117625380000000E+03),\n new google.maps.LatLng( 0.468139850000000E+02, -0.117619894000000E+03),\n new google.maps.LatLng( 0.468193810000000E+02, -0.117615638000000E+03),\n new google.maps.LatLng( 0.468219190000000E+02, -0.117614542000000E+03),\n new google.maps.LatLng( 0.468252370000000E+02, -0.117607952000000E+03),\n new google.maps.LatLng( 0.468253980000000E+02, -0.117604688000000E+03),\n new google.maps.LatLng( 0.468282350000000E+02, -0.117598995000000E+03),\n new google.maps.LatLng( 0.468290120000000E+02, -0.117598629000000E+03),\n new google.maps.LatLng( 0.468318000000000E+02, -0.117598731000000E+03),\n new google.maps.LatLng( 0.468352070000000E+02, -0.117596069000000E+03),\n new google.maps.LatLng( 0.468351870000000E+02, -0.117583811000000E+03),\n new google.maps.LatLng( 0.468407190000000E+02, -0.117576352000000E+03),\n new google.maps.LatLng( 0.468438980000000E+02, -0.117575054000000E+03),\n new google.maps.LatLng( 0.468491440000000E+02, -0.117576368000000E+03),\n new google.maps.LatLng( 0.468491440000000E+02, -0.117576368000000E+03),\n new google.maps.LatLng( 0.468479210000000E+02, -0.117570457000000E+03),\n new google.maps.LatLng( 0.468440350000000E+02, -0.117559197000000E+03),\n new google.maps.LatLng( 0.468422520000000E+02, -0.117548637000000E+03),\n new google.maps.LatLng( 0.468424340000000E+02, -0.117541174000000E+03),\n new google.maps.LatLng( 0.468431420000000E+02, -0.117540574000000E+03),\n new google.maps.LatLng( 0.468446490000000E+02, -0.117534910000000E+03),\n new google.maps.LatLng( 0.468446480000000E+02, -0.117529246000000E+03),\n new google.maps.LatLng( 0.468431610000000E+02, -0.117526816000000E+03),\n new google.maps.LatLng( 0.468411040000000E+02, -0.117525085000000E+03),\n new google.maps.LatLng( 0.468398000000000E+02, -0.117522521000000E+03),\n new google.maps.LatLng( 0.468395710000000E+02, -0.117520822000000E+03),\n new google.maps.LatLng( 0.468404150000000E+02, -0.117516758000000E+03),\n new google.maps.LatLng( 0.468396590000000E+02, -0.117513560000000E+03),\n new google.maps.LatLng( 0.468336670000000E+02, -0.117505373000000E+03),\n new google.maps.LatLng( 0.468329590000000E+02, -0.117506381000000E+03),\n new google.maps.LatLng( 0.468325720000000E+02, -0.117509237000000E+03),\n new google.maps.LatLng( 0.468311330000000E+02, -0.117513368000000E+03),\n new google.maps.LatLng( 0.468238250000000E+02, -0.117527961000000E+03),\n new google.maps.LatLng( 0.468218370000000E+02, -0.117529993000000E+03),\n new google.maps.LatLng( 0.468097460000000E+02, -0.117537026000000E+03),\n new google.maps.LatLng( 0.468082600000000E+02, -0.117538658000000E+03),\n new google.maps.LatLng( 0.468051080000000E+02, -0.117549244000000E+03),\n new google.maps.LatLng( 0.468035090000000E+02, -0.117558832000000E+03),\n new google.maps.LatLng( 0.467898160000000E+02, -0.117559466000000E+03),\n new google.maps.LatLng( 0.467772900000000E+02, -0.117573641000000E+03),\n new google.maps.LatLng( 0.467749810000000E+02, -0.117575237000000E+03),\n new google.maps.LatLng( 0.467712100000000E+02, -0.117576833000000E+03),\n new google.maps.LatLng( 0.467688090000000E+02, -0.117576799000000E+03),\n new google.maps.LatLng( 0.467613570000000E+02, -0.117571807000000E+03),\n new google.maps.LatLng( 0.467608090000000E+02, -0.117567051000000E+03),\n new google.maps.LatLng( 0.467629360000000E+02, -0.117555708000000E+03),\n new google.maps.LatLng( 0.467639180000000E+02, -0.117552714000000E+03),\n new google.maps.LatLng( 0.467666150000000E+02, -0.117547724000000E+03),\n new google.maps.LatLng( 0.467672770000000E+02, -0.117542734000000E+03),\n new google.maps.LatLng( 0.467648990000000E+02, -0.117539807000000E+03),\n new google.maps.LatLng( 0.467634580000000E+02, -0.117534320000000E+03),\n new google.maps.LatLng( 0.467657170000000E+02, -0.117520779000000E+03),\n new google.maps.LatLng( 0.467666940000000E+02, -0.117507938000000E+03),\n new google.maps.LatLng( 0.467660080000000E+02, -0.117506675000000E+03),\n new google.maps.LatLng( 0.467599940000000E+02, -0.117503089000000E+03),\n new google.maps.LatLng( 0.467507590000000E+02, -0.117502201000000E+03),\n new google.maps.LatLng( 0.467493310000000E+02, -0.117509088000000E+03),\n new google.maps.LatLng( 0.467478920000000E+02, -0.117512447000000E+03),\n new google.maps.LatLng( 0.467441230000000E+02, -0.117518503000000E+03),\n new google.maps.LatLng( 0.467425010000000E+02, -0.117520466000000E+03),\n new google.maps.LatLng( 0.467404440000000E+02, -0.117521974000000E+03),\n new google.maps.LatLng( 0.467401020000000E+02, -0.117523427000000E+03),\n new google.maps.LatLng( 0.467408790000000E+02, -0.117526652000000E+03),\n new google.maps.LatLng( 0.467451330000000E+02, -0.117531139000000E+03),\n new google.maps.LatLng( 0.467474890000000E+02, -0.117541678000000E+03),\n new google.maps.LatLng( 0.467446560000000E+02, -0.117549594000000E+03),\n new google.maps.LatLng( 0.467468730000000E+02, -0.117577427000000E+03),\n new google.maps.LatLng( 0.467460260000000E+02, -0.117584576000000E+03),\n new google.maps.LatLng( 0.467415660000000E+02, -0.117595048000000E+03),\n new google.maps.LatLng( 0.467371060000000E+02, -0.117602226000000E+03),\n new google.maps.LatLng( 0.467358020000000E+02, -0.117603389000000E+03),\n new google.maps.LatLng( 0.467339720000000E+02, -0.117609306000000E+03),\n new google.maps.LatLng( 0.467331690000000E+02, -0.117615222000000E+03),\n new google.maps.LatLng( 0.467309480000000E+02, -0.117622832000000E+03),\n new google.maps.LatLng( 0.467287530000000E+02, -0.117626501000000E+03),\n new google.maps.LatLng( 0.467281390000000E+02, -0.117632422000000E+03),\n new google.maps.LatLng( 0.467262680000000E+02, -0.117640501000000E+03),\n new google.maps.LatLng( 0.467208530000000E+02, -0.117649148000000E+03),\n new google.maps.LatLng( 0.467191400000000E+02, -0.117652771000000E+03),\n new google.maps.LatLng( 0.467186150000000E+02, -0.117654998000000E+03),\n new google.maps.LatLng( 0.467198980000000E+02, -0.117666863000000E+03),\n new google.maps.LatLng( 0.467198760000000E+02, -0.117671948000000E+03),\n new google.maps.LatLng( 0.467176590000000E+02, -0.117679261000000E+03),\n new google.maps.LatLng( 0.467123560000000E+02, -0.117686406000000E+03),\n new google.maps.LatLng( 0.467080810000000E+02, -0.117687005000000E+03),\n new google.maps.LatLng( 0.467080810000000E+02, -0.117687005000000E+03),\n new google.maps.LatLng( 0.467051550000000E+02, -0.117688865000000E+03),\n new google.maps.LatLng( 0.467044470000000E+02, -0.117690228000000E+03),\n new google.maps.LatLng( 0.467029150000000E+02, -0.117700262000000E+03),\n new google.maps.LatLng( 0.467024790000000E+02, -0.117712224000000E+03),\n new google.maps.LatLng( 0.467002100000000E+02, -0.117727273000000E+03),\n new google.maps.LatLng( 0.467002100000000E+02, -0.117727273000000E+03),\n new google.maps.LatLng( 0.467010330000000E+02, -0.117729267000000E+03),\n new google.maps.LatLng( 0.467045750000000E+02, -0.117733656000000E+03),\n new google.maps.LatLng( 0.467062190000000E+02, -0.117737712000000E+03),\n new google.maps.LatLng( 0.467070390000000E+02, -0.117741832000000E+03),\n new google.maps.LatLng( 0.467088420000000E+02, -0.117746985000000E+03),\n new google.maps.LatLng( 0.467154710000000E+02, -0.117752957000000E+03),\n new google.maps.LatLng( 0.467182130000000E+02, -0.117749654000000E+03),\n new google.maps.LatLng( 0.467263300000000E+02, -0.117744511000000E+03),\n new google.maps.LatLng( 0.467290980000000E+02, -0.117739428000000E+03),\n new google.maps.LatLng( 0.467305390000000E+02, -0.117737834000000E+03),\n new google.maps.LatLng( 0.467365760000000E+02, -0.117734316000000E+03),\n new google.maps.LatLng( 0.467371640000000E+02, -0.117745155000000E+03),\n new google.maps.LatLng( 0.467369790000000E+02, -0.117751038000000E+03),\n new google.maps.LatLng( 0.467362710000000E+02, -0.117753234000000E+03),\n new google.maps.LatLng( 0.467325930000000E+02, -0.117756063000000E+03),\n new google.maps.LatLng( 0.467240260000000E+02, -0.117767540000000E+03),\n new google.maps.LatLng( 0.467200950000000E+02, -0.117769039000000E+03),\n new google.maps.LatLng( 0.467150680000000E+02, -0.117774261000000E+03),\n new google.maps.LatLng( 0.467138350000000E+02, -0.117777485000000E+03),\n new google.maps.LatLng( 0.467092650000000E+02, -0.117783669000000E+03),\n new google.maps.LatLng( 0.466985910000000E+02, -0.117789589000000E+03),\n new google.maps.LatLng( 0.466930830000000E+02, -0.117791949000000E+03),\n new google.maps.LatLng( 0.466892200000000E+02, -0.117794674000000E+03),\n new google.maps.LatLng( 0.466882830000000E+02, -0.117796070000000E+03),\n new google.maps.LatLng( 0.466867760000000E+02, -0.117801982000000E+03),\n new google.maps.LatLng( 0.466854270000000E+02, -0.117804175000000E+03),\n new google.maps.LatLng( 0.466800100000000E+02, -0.117809490000000E+03),\n new google.maps.LatLng( 0.466770610000000E+02, -0.117810686000000E+03),\n new google.maps.LatLng( 0.466743180000000E+02, -0.117815700000000E+03),\n new google.maps.LatLng( 0.466743180000000E+02, -0.117815700000000E+03),\n new google.maps.LatLng( 0.466732890000000E+02, -0.117816663000000E+03),\n new google.maps.LatLng( 0.466718260000000E+02, -0.117819453000000E+03),\n new google.maps.LatLng( 0.466710260000000E+02, -0.117827189000000E+03),\n new google.maps.LatLng( 0.466715730000000E+02, -0.117833499000000E+03),\n new google.maps.LatLng( 0.466702240000000E+02, -0.117837716000000E+03),\n new google.maps.LatLng( 0.466681200000000E+02, -0.117840039000000E+03),\n new google.maps.LatLng( 0.466678910000000E+02, -0.117842662000000E+03),\n new google.maps.LatLng( 0.466690550000000E+02, -0.117847777000000E+03),\n new google.maps.LatLng( 0.466745360000000E+02, -0.117859835000000E+03),\n new google.maps.LatLng( 0.466765900000000E+02, -0.117866346000000E+03),\n new google.maps.LatLng( 0.466770470000000E+02, -0.117883158000000E+03),\n new google.maps.LatLng( 0.466809360000000E+02, -0.117891424000000E+03),\n new google.maps.LatLng( 0.466802200000000E+02, -0.117899343000000E+03),\n new google.maps.LatLng( 0.466803690000000E+02, -0.117902617000000E+03),\n new google.maps.LatLng( 0.466792270000000E+02, -0.117906370000000E+03),\n new google.maps.LatLng( 0.466798450000000E+02, -0.117909824000000E+03),\n new google.maps.LatLng( 0.466824510000000E+02, -0.117909524000000E+03),\n new google.maps.LatLng( 0.466835930000000E+02, -0.117907796000000E+03),\n new google.maps.LatLng( 0.466847580000000E+02, -0.117904308000000E+03),\n new google.maps.LatLng( 0.466960950000000E+02, -0.117903770000000E+03),\n new google.maps.LatLng( 0.466994100000000E+02, -0.117904664000000E+03),\n new google.maps.LatLng( 0.467003710000000E+02, -0.117906923000000E+03),\n new google.maps.LatLng( 0.467017420000000E+02, -0.117907089000000E+03),\n new google.maps.LatLng( 0.467097860000000E+02, -0.117901269000000E+03),\n new google.maps.LatLng( 0.467109270000000E+02, -0.117896317000000E+03),\n new google.maps.LatLng( 0.467118440000000E+02, -0.117895370000000E+03),\n new google.maps.LatLng( 0.467109740000000E+02, -0.117899175000000E+03),\n new google.maps.LatLng( 0.467107470000000E+02, -0.117903827000000E+03),\n new google.maps.LatLng( 0.467132390000000E+02, -0.117904724000000E+03),\n new google.maps.LatLng( 0.467136050000000E+02, -0.117906019000000E+03),\n new google.maps.LatLng( 0.467144510000000E+02, -0.117906551000000E+03),\n new google.maps.LatLng( 0.467190440000000E+02, -0.117905052000000E+03),\n new google.maps.LatLng( 0.467222210000000E+02, -0.117904818000000E+03),\n new google.maps.LatLng( 0.467224730000000E+02, -0.117906712000000E+03),\n new google.maps.LatLng( 0.467204110000000E+02, -0.117914557000000E+03),\n new google.maps.LatLng( 0.467124420000000E+02, -0.117920044000000E+03),\n new google.maps.LatLng( 0.467043050000000E+02, -0.117926990000000E+03),\n new google.maps.LatLng( 0.467082590000000E+02, -0.117932572000000E+03),\n new google.maps.LatLng( 0.467091740000000E+02, -0.117932805000000E+03),\n new google.maps.LatLng( 0.467115060000000E+02, -0.117931276000000E+03),\n new google.maps.LatLng( 0.467138830000000E+02, -0.117932971000000E+03),\n new google.maps.LatLng( 0.467141350000000E+02, -0.117934898000000E+03),\n new google.maps.LatLng( 0.467147750000000E+02, -0.117935230000000E+03),\n new google.maps.LatLng( 0.467149120000000E+02, -0.117935961000000E+03),\n new google.maps.LatLng( 0.467127620000000E+02, -0.117940148000000E+03),\n new google.maps.LatLng( 0.467128760000000E+02, -0.117941910000000E+03),\n new google.maps.LatLng( 0.467181570000000E+02, -0.117942276000000E+03),\n new google.maps.LatLng( 0.467202370000000E+02, -0.117943938000000E+03),\n new google.maps.LatLng( 0.467162820000000E+02, -0.117949222000000E+03),\n new google.maps.LatLng( 0.467083490000000E+02, -0.117955833000000E+03),\n new google.maps.LatLng( 0.467048060000000E+02, -0.117960250000000E+03),\n new google.maps.LatLng( 0.467018340000000E+02, -0.117962641000000E+03),\n new google.maps.LatLng( 0.466977390000000E+02, -0.117971510000000E+03),\n new google.maps.LatLng( 0.466960920000000E+02, -0.117977289000000E+03),\n new google.maps.LatLng( 0.466917470000000E+02, -0.117981472000000E+03),\n new google.maps.LatLng( 0.466887740000000E+02, -0.117985954000000E+03),\n new google.maps.LatLng( 0.466875380000000E+02, -0.117990735000000E+03),\n new google.maps.LatLng( 0.466875800000000E+02, -0.118001947000000E+03),\n new google.maps.LatLng( 0.466856390000000E+02, -0.118008460000000E+03),\n new google.maps.LatLng( 0.466820310000000E+02, -0.118016068000000E+03),\n new google.maps.LatLng( 0.466770940000000E+02, -0.118014877000000E+03),\n new google.maps.LatLng( 0.466723180000000E+02, -0.118017571000000E+03),\n new google.maps.LatLng( 0.466703290000000E+02, -0.118017041000000E+03),\n new google.maps.LatLng( 0.466689810000000E+02, -0.118018205000000E+03),\n new google.maps.LatLng( 0.466675190000000E+02, -0.118020863000000E+03),\n new google.maps.LatLng( 0.466631990000000E+02, -0.118023124000000E+03),\n new google.maps.LatLng( 0.466607310000000E+02, -0.118025283000000E+03),\n new google.maps.LatLng( 0.466576230000000E+02, -0.118026547000000E+03),\n new google.maps.LatLng( 0.466562520000000E+02, -0.118027876000000E+03),\n new google.maps.LatLng( 0.466531440000000E+02, -0.118027944000000E+03),\n new google.maps.LatLng( 0.466500120000000E+02, -0.118026917000000E+03),\n new google.maps.LatLng( 0.466503770000000E+02, -0.118025788000000E+03),\n new google.maps.LatLng( 0.466533930000000E+02, -0.118022599000000E+03),\n new google.maps.LatLng( 0.466565930000000E+02, -0.118021070000000E+03),\n new google.maps.LatLng( 0.466572780000000E+02, -0.118019608000000E+03),\n new google.maps.LatLng( 0.466570030000000E+02, -0.118017185000000E+03),\n new google.maps.LatLng( 0.466593110000000E+02, -0.118016652000000E+03),\n new google.maps.LatLng( 0.466591050000000E+02, -0.118016155000000E+03),\n new google.maps.LatLng( 0.466575280000000E+02, -0.118015492000000E+03),\n new google.maps.LatLng( 0.466568640000000E+02, -0.118013833000000E+03),\n new google.maps.LatLng( 0.466573670000000E+02, -0.118012903000000E+03),\n new google.maps.LatLng( 0.466617550000000E+02, -0.118009480000000E+03),\n new google.maps.LatLng( 0.466641540000000E+02, -0.118009245000000E+03),\n new google.maps.LatLng( 0.466642680000000E+02, -0.118008547000000E+03),\n new google.maps.LatLng( 0.466632840000000E+02, -0.118006257000000E+03),\n new google.maps.LatLng( 0.466636490000000E+02, -0.118003169000000E+03),\n new google.maps.LatLng( 0.466678080000000E+02, -0.118001448000000E+03),\n new google.maps.LatLng( 0.466692720000000E+02, -0.117995831000000E+03),\n new google.maps.LatLng( 0.466701410000000E+02, -0.117994636000000E+03),\n new google.maps.LatLng( 0.466689290000000E+02, -0.117995731000000E+03),\n new google.maps.LatLng( 0.466680042578125E+02, -0.117998940756445E+03),\n new google.maps.LatLng( 0.466665730000000E+02, -0.118001516000000E+03),\n new google.maps.LatLng( 0.466636020000000E+02, -0.118002206000000E+03),\n new google.maps.LatLng( 0.466626660000000E+02, -0.118003336000000E+03),\n new google.maps.LatLng( 0.466623010000000E+02, -0.118005660000000E+03),\n new google.maps.LatLng( 0.466610900000000E+02, -0.118006525000000E+03),\n new google.maps.LatLng( 0.466601070000000E+02, -0.118008152000000E+03),\n new google.maps.LatLng( 0.466588960000000E+02, -0.118008519000000E+03),\n new google.maps.LatLng( 0.466566800000000E+02, -0.118010215000000E+03),\n new google.maps.LatLng( 0.466559030000000E+02, -0.118012008000000E+03),\n new google.maps.LatLng( 0.466536870000000E+02, -0.118012409000000E+03),\n new google.maps.LatLng( 0.466528190000000E+02, -0.118014165000000E+03),\n new google.maps.LatLng( 0.466530250000000E+02, -0.118015430000000E+03),\n new google.maps.LatLng( 0.466508770000000E+02, -0.118015797000000E+03),\n new google.maps.LatLng( 0.466490930000000E+02, -0.118014139000000E+03),\n new google.maps.LatLng( 0.466480850000000E+02, -0.118008795000000E+03),\n new google.maps.LatLng( 0.466463930000000E+02, -0.118007668000000E+03),\n new google.maps.LatLng( 0.466437190000000E+02, -0.118007173000000E+03),\n new google.maps.LatLng( 0.466412050000000E+02, -0.118007807000000E+03),\n new google.maps.LatLng( 0.466405640000000E+02, -0.118007044000000E+03),\n new google.maps.LatLng( 0.466404720000000E+02, -0.118005385000000E+03),\n new google.maps.LatLng( 0.466360600000000E+02, -0.118003963000000E+03),\n new google.maps.LatLng( 0.466351640000000E+02, -0.118000591000000E+03),\n new google.maps.LatLng( 0.466332480000000E+02, -0.118002040000000E+03),\n new google.maps.LatLng( 0.466328890000000E+02, -0.118000737000000E+03),\n new google.maps.LatLng( 0.466248700000000E+02, -0.118000778000000E+03),\n new google.maps.LatLng( 0.466245010000000E+02, -0.118000363000000E+03),\n new google.maps.LatLng( 0.466278120000000E+02, -0.117989283000000E+03),\n new google.maps.LatLng( 0.466276070000000E+02, -0.117987524000000E+03),\n new google.maps.LatLng( 0.466258250000000E+02, -0.117985001000000E+03),\n new google.maps.LatLng( 0.466253590000000E+02, -0.117980422000000E+03),\n new google.maps.LatLng( 0.466277030000000E+02, -0.117975414000000E+03),\n new google.maps.LatLng( 0.466339900000000E+02, -0.117969910000000E+03),\n new google.maps.LatLng( 0.466381280000000E+02, -0.117964801000000E+03),\n new google.maps.LatLng( 0.466411490000000E+02, -0.117951494000000E+03),\n new google.maps.LatLng( 0.466422920000000E+02, -0.117948309000000E+03),\n new google.maps.LatLng( 0.466468640000000E+02, -0.117943265000000E+03),\n new google.maps.LatLng( 0.466493100000000E+02, -0.117938087000000E+03),\n new google.maps.LatLng( 0.466501320000000E+02, -0.117934402000000E+03),\n new google.maps.LatLng( 0.466561670000000E+02, -0.117925604000000E+03),\n new google.maps.LatLng( 0.466581780000000E+02, -0.117919961000000E+03),\n new google.maps.LatLng( 0.466632970000000E+02, -0.117915145000000E+03),\n new google.maps.LatLng( 0.466563030000000E+02, -0.117916342000000E+03),\n new google.maps.LatLng( 0.466539480000000E+02, -0.117915712000000E+03),\n new google.maps.LatLng( 0.466509310000000E+02, -0.117913689000000E+03),\n new google.maps.LatLng( 0.466488030000000E+02, -0.117905159000000E+03),\n new google.maps.LatLng( 0.466477050000000E+02, -0.117903235000000E+03),\n new google.maps.LatLng( 0.466476130000000E+02, -0.117899650000000E+03),\n new google.maps.LatLng( 0.466464460000000E+02, -0.117897096000000E+03),\n new google.maps.LatLng( 0.466428800000000E+02, -0.117897231000000E+03),\n new google.maps.LatLng( 0.466405480000000E+02, -0.117895705000000E+03),\n new google.maps.LatLng( 0.466388570000000E+02, -0.117895441000000E+03),\n new google.maps.LatLng( 0.466370060000000E+02, -0.117896040000000E+03),\n new google.maps.LatLng( 0.466359770000000E+02, -0.117895510000000E+03),\n new google.maps.LatLng( 0.466336220000000E+02, -0.117896507000000E+03),\n new google.maps.LatLng( 0.466327760000000E+02, -0.117896110000000E+03),\n new google.maps.LatLng( 0.466317010000000E+02, -0.117894551000000E+03),\n new google.maps.LatLng( 0.466288440000000E+02, -0.117894951000000E+03),\n new google.maps.LatLng( 0.466244050000000E+02, -0.117892469000000E+03),\n new google.maps.LatLng( 0.466203010000000E+02, -0.117893534000000E+03),\n new google.maps.LatLng( 0.466180610000000E+02, -0.117893204000000E+03),\n new google.maps.LatLng( 0.466160500000000E+02, -0.117894134000000E+03),\n new google.maps.LatLng( 0.466141070000000E+02, -0.117893904000000E+03),\n new google.maps.LatLng( 0.466113870000000E+02, -0.117892646000000E+03),\n new google.maps.LatLng( 0.466097860000000E+02, -0.117890490000000E+03),\n new google.maps.LatLng( 0.466090320000000E+02, -0.117890889000000E+03),\n new google.maps.LatLng( 0.466087590000000E+02, -0.117894041000000E+03),\n new google.maps.LatLng( 0.466102920000000E+02, -0.117900540000000E+03),\n new google.maps.LatLng( 0.466058590000000E+02, -0.117908139000000E+03),\n new google.maps.LatLng( 0.466049910000000E+02, -0.117908802000000E+03),\n new google.maps.LatLng( 0.466009910000000E+02, -0.117909700000000E+03),\n new google.maps.LatLng( 0.466012190000000E+02, -0.117907411000000E+03),\n new google.maps.LatLng( 0.466006470000000E+02, -0.117907345000000E+03),\n new google.maps.LatLng( 0.465998020000000E+02, -0.117908241000000E+03),\n new google.maps.LatLng( 0.465985440000000E+02, -0.117905523000000E+03),\n new google.maps.LatLng( 0.465958240000000E+02, -0.117903766000000E+03),\n new google.maps.LatLng( 0.465941540000000E+02, -0.117900849000000E+03),\n new google.maps.LatLng( 0.465939250000000E+02, -0.117898694000000E+03),\n new google.maps.LatLng( 0.465931250000000E+02, -0.117897833000000E+03),\n new google.maps.LatLng( 0.465935460000000E+02, -0.117890561000000E+03),\n new google.maps.LatLng( 0.465935460000000E+02, -0.117890561000000E+03),\n new google.maps.LatLng( 0.465922960000000E+02, -0.117895000000000E+03),\n new google.maps.LatLng( 0.465919910000000E+02, -0.117900571000000E+03),\n new google.maps.LatLng( 0.465929650000000E+02, -0.117925509000000E+03),\n new google.maps.LatLng( 0.465929650000000E+02, -0.117925509000000E+03),\n new google.maps.LatLng( 0.465933590000000E+02, -0.117923895000000E+03),\n new google.maps.LatLng( 0.465978620000000E+02, -0.117923530000000E+03),\n new google.maps.LatLng( 0.465927420000000E+02, -0.117926349000000E+03),\n new google.maps.LatLng( 0.465945020000000E+02, -0.117936297000000E+03),\n new google.maps.LatLng( 0.465948900000000E+02, -0.117941802000000E+03),\n new google.maps.LatLng( 0.465940200000000E+02, -0.117953640000000E+03),\n new google.maps.LatLng( 0.465905630000000E+02, -0.117977711000000E+03),\n new google.maps.LatLng( 0.465901220000000E+02, -0.117990641000000E+03),\n new google.maps.LatLng( 0.465908030000000E+02, -0.118001057000000E+03),\n new google.maps.LatLng( 0.465904220000000E+02, -0.118014325000000E+03),\n new google.maps.LatLng( 0.465886440000000E+02, -0.118027357000000E+03),\n new google.maps.LatLng( 0.465860740000000E+02, -0.118026807000000E+03),\n new google.maps.LatLng( 0.465860740000000E+02, -0.118026807000000E+03),\n new google.maps.LatLng( 0.465859470000000E+02, -0.118028950000000E+03),\n new google.maps.LatLng( 0.465859470000000E+02, -0.118028950000000E+03),\n new google.maps.LatLng( 0.465879350000000E+02, -0.118029048000000E+03),\n new google.maps.LatLng( 0.465870910000000E+02, -0.118034751000000E+03),\n new google.maps.LatLng( 0.465841890000000E+02, -0.118042013000000E+03),\n new google.maps.LatLng( 0.465820640000000E+02, -0.118045925000000E+03),\n new google.maps.LatLng( 0.465791160000000E+02, -0.118052490000000E+03),\n new google.maps.LatLng( 0.465774710000000E+02, -0.118058225000000E+03),\n new google.maps.LatLng( 0.465766250000000E+02, -0.118064258000000E+03),\n new google.maps.LatLng( 0.465757330000000E+02, -0.118068202000000E+03),\n new google.maps.LatLng( 0.465755960000000E+02, -0.118071020000000E+03),\n new google.maps.LatLng( 0.465773530000000E+02, -0.118088854000000E+03),\n new google.maps.LatLng( 0.465762330000000E+02, -0.118090610000000E+03),\n new google.maps.LatLng( 0.465756820000000E+02, -0.118095052000000E+03),\n new google.maps.LatLng( 0.465747670000000E+02, -0.118097836000000E+03),\n new google.maps.LatLng( 0.465723430000000E+02, -0.118101679000000E+03),\n new google.maps.LatLng( 0.465704910000000E+02, -0.118103434000000E+03),\n new google.maps.LatLng( 0.465624660000000E+02, -0.118109725000000E+03),\n new google.maps.LatLng( 0.465602480000000E+02, -0.118111976000000E+03),\n new google.maps.LatLng( 0.465591500000000E+02, -0.118114493000000E+03),\n new google.maps.LatLng( 0.465585080000000E+02, -0.118118502000000E+03),\n new google.maps.LatLng( 0.465582990000000E+02, -0.118123738000000E+03),\n new google.maps.LatLng( 0.465592850000000E+02, -0.118131377000000E+03),\n new google.maps.LatLng( 0.465595610000000E+02, -0.118138137000000E+03),\n new google.maps.LatLng( 0.465594710000000E+02, -0.118141749000000E+03),\n new google.maps.LatLng( 0.465590390000000E+02, -0.118146687000000E+03),\n new google.maps.LatLng( 0.465579670000000E+02, -0.118153745000000E+03),\n new google.maps.LatLng( 0.465569170000000E+02, -0.118158021000000E+03),\n new google.maps.LatLng( 0.465566670000000E+02, -0.118164151000000E+03),\n new google.maps.LatLng( 0.465580620000000E+02, -0.118171275000000E+03),\n new google.maps.LatLng( 0.465598910000000E+02, -0.118175217000000E+03),\n new google.maps.LatLng( 0.465621090000000E+02, -0.118177503000000E+03),\n new google.maps.LatLng( 0.465668630000000E+02, -0.118181149000000E+03),\n new google.maps.LatLng( 0.465680060000000E+02, -0.118182342000000E+03),\n new google.maps.LatLng( 0.465765080000000E+02, -0.118194837000000E+03),\n new google.maps.LatLng( 0.465864720000000E+02, -0.118207603000000E+03),\n new google.maps.LatLng( 0.465908590000000E+02, -0.118212214000000E+03),\n new google.maps.LatLng( 0.465921170000000E+02, -0.118212347000000E+03),\n new google.maps.LatLng( 0.465995010000000E+02, -0.118207939000000E+03),\n new google.maps.LatLng( 0.466016500000000E+02, -0.118205984000000E+03),\n new google.maps.LatLng( 0.466034330000000E+02, -0.118202370000000E+03),\n new google.maps.LatLng( 0.466066330000000E+02, -0.118198922000000E+03),\n new google.maps.LatLng( 0.466093540000000E+02, -0.118196734000000E+03),\n new google.maps.LatLng( 0.466106790000000E+02, -0.118196270000000E+03),\n new google.maps.LatLng( 0.466161880000000E+02, -0.118196237000000E+03),\n new google.maps.LatLng( 0.466211930000000E+02, -0.118197366000000E+03),\n new google.maps.LatLng( 0.466222220000000E+02, -0.118197665000000E+03),\n new google.maps.LatLng( 0.466243680000000E+02, -0.118198826000000E+03),\n new google.maps.LatLng( 0.466267000000000E+02, -0.118202905000000E+03),\n new google.maps.LatLng( 0.466278430000000E+02, -0.118205494000000E+03),\n new google.maps.LatLng( 0.466325960000000E+02, -0.118212828000000E+03),\n new google.maps.LatLng( 0.466341950000000E+02, -0.118215781000000E+03),\n new google.maps.LatLng( 0.466349260000000E+02, -0.118216014000000E+03),\n new google.maps.LatLng( 0.466369380000000E+02, -0.118214721000000E+03),\n new google.maps.LatLng( 0.466388120000000E+02, -0.118213925000000E+03),\n new google.maps.LatLng( 0.466395890000000E+02, -0.118214224000000E+03),\n new google.maps.LatLng( 0.466404800000000E+02, -0.118215951000000E+03),\n new google.maps.LatLng( 0.466407410000000E+02, -0.118218037000000E+03),\n new google.maps.LatLng( 0.466421760000000E+02, -0.118220878000000E+03),\n new google.maps.LatLng( 0.466427510000000E+02, -0.118221323000000E+03),\n new google.maps.LatLng( 0.466441400000000E+02, -0.118221444000000E+03),\n new google.maps.LatLng( 0.466455790000000E+02, -0.118222117000000E+03),\n new google.maps.LatLng( 0.466468390000000E+02, -0.118224946000000E+03),\n new google.maps.LatLng( 0.466484670000000E+02, -0.118226491000000E+03),\n new google.maps.LatLng( 0.466497770000000E+02, -0.118227143000000E+03),\n new google.maps.LatLng( 0.466510940000000E+02, -0.118227418000000E+03),\n new google.maps.LatLng( 0.466532010000000E+02, -0.118227052000000E+03),\n new google.maps.LatLng( 0.466550550000000E+02, -0.118228699000000E+03),\n new google.maps.LatLng( 0.466577380000000E+02, -0.118229307000000E+03),\n new google.maps.LatLng( 0.466625450000000E+02, -0.118226769000000E+03),\n new google.maps.LatLng( 0.466628690000000E+02, -0.118224386000000E+03),\n new google.maps.LatLng( 0.466630690000000E+02, -0.118223821000000E+03),\n new google.maps.LatLng( 0.466637220000000E+02, -0.118223427000000E+03),\n new google.maps.LatLng( 0.466676540000000E+02, -0.118223131000000E+03),\n new google.maps.LatLng( 0.466683820000000E+02, -0.118223751000000E+03),\n new google.maps.LatLng( 0.466712410000000E+02, -0.118223864000000E+03),\n new google.maps.LatLng( 0.466740890000000E+02, -0.118222774000000E+03),\n new google.maps.LatLng( 0.466764810000000E+02, -0.118218166000000E+03),\n new google.maps.LatLng( 0.466781590000000E+02, -0.118217295000000E+03),\n new google.maps.LatLng( 0.466789170000000E+02, -0.118217208000000E+03),\n new google.maps.LatLng( 0.466860030000000E+02, -0.118221002000000E+03),\n new google.maps.LatLng( 0.466904090000000E+02, -0.118222611000000E+03),\n new google.maps.LatLng( 0.466937590000000E+02, -0.118225932000000E+03),\n new google.maps.LatLng( 0.467000330000000E+02, -0.118229029000000E+03),\n new google.maps.LatLng( 0.467028830000000E+02, -0.118231221000000E+03),\n new google.maps.LatLng( 0.467075330000000E+02, -0.118233731000000E+03),\n new google.maps.LatLng( 0.467124110000000E+02, -0.118236002000000E+03),\n new google.maps.LatLng( 0.467167520000000E+02, -0.118238708000000E+03),\n new google.maps.LatLng( 0.467185760000000E+02, -0.118240306000000E+03),\n new google.maps.LatLng( 0.467218520000000E+02, -0.118242212000000E+03),\n new google.maps.LatLng( 0.467281830000000E+02, -0.118245354000000E+03),\n new google.maps.LatLng( 0.467316410000000E+02, -0.118248176000000E+03),\n new google.maps.LatLng( 0.467334050000000E+02, -0.118248873000000E+03),\n new google.maps.LatLng( 0.467340890000000E+02, -0.118248310000000E+03),\n new google.maps.LatLng( 0.467345230000000E+02, -0.118245589000000E+03),\n new google.maps.LatLng( 0.467350100000000E+02, -0.118244370000000E+03),\n new google.maps.LatLng( 0.467373280000000E+02, -0.118241290000000E+03),\n new google.maps.LatLng( 0.467376290000000E+02, -0.118240341000000E+03),\n new google.maps.LatLng( 0.467375120000000E+02, -0.118239418000000E+03),\n new google.maps.LatLng( 0.467343010000000E+02, -0.118235956000000E+03),\n new google.maps.LatLng( 0.467338610000000E+02, -0.118235280000000E+03),\n new google.maps.LatLng( 0.467336280000000E+02, -0.118234261000000E+03),\n new google.maps.LatLng( 0.467344660000000E+02, -0.118230265000000E+03),\n new google.maps.LatLng( 0.467360270000000E+02, -0.118227741000000E+03),\n new google.maps.LatLng( 0.467363610000000E+02, -0.118226801000000E+03),\n new google.maps.LatLng( 0.467364660000000E+02, -0.118222830000000E+03),\n new google.maps.LatLng( 0.467370370000000E+02, -0.118218018000000E+03),\n new google.maps.LatLng( 0.467377950000000E+02, -0.118215061000000E+03),\n new google.maps.LatLng( 0.467383130000000E+02, -0.118210911000000E+03),\n new google.maps.LatLng( 0.467399590000000E+02, -0.118204852000000E+03),\n new google.maps.LatLng( 0.467432440000000E+02, -0.118202596000000E+03),\n new google.maps.LatLng( 0.467434340000000E+02, -0.118202772000000E+03),\n new google.maps.LatLng( 0.467434340000000E+02, -0.118202772000000E+03),\n new google.maps.LatLng( 0.467460340000000E+02, -0.118200180000000E+03),\n new google.maps.LatLng( 0.467501920000000E+02, -0.118193695000000E+03),\n new google.maps.LatLng( 0.467512940000000E+02, -0.118189638000000E+03),\n new google.maps.LatLng( 0.467498700000000E+02, -0.118186463000000E+03),\n new google.maps.LatLng( 0.467479550000000E+02, -0.118184253000000E+03),\n new google.maps.LatLng( 0.467473390000000E+02, -0.118181394000000E+03),\n new google.maps.LatLng( 0.467466060000000E+02, -0.118166231000000E+03),\n new google.maps.LatLng( 0.467469020000000E+02, -0.118162107000000E+03),\n new google.maps.LatLng( 0.467513140000000E+02, -0.118156882000000E+03),\n new google.maps.LatLng( 0.467536220000000E+02, -0.118155019000000E+03),\n new google.maps.LatLng( 0.467559990000000E+02, -0.118156680000000E+03),\n new google.maps.LatLng( 0.467595190000000E+02, -0.118155747000000E+03),\n new google.maps.LatLng( 0.467590000000000E+02, -0.118147867000000E+03),\n new google.maps.LatLng( 0.467590000000000E+02, -0.118147867000000E+03),\n new google.maps.LatLng( 0.467603160000000E+02, -0.118144271000000E+03),\n new google.maps.LatLng( 0.467601750000000E+02, -0.118136156000000E+03),\n new google.maps.LatLng( 0.467611760000000E+02, -0.118126841000000E+03),\n new google.maps.LatLng( 0.467645160000000E+02, -0.118117483000000E+03),\n new google.maps.LatLng( 0.467665510000000E+02, -0.118115754000000E+03),\n new google.maps.LatLng( 0.467675120000000E+02, -0.118113327000000E+03),\n new google.maps.LatLng( 0.467686320000000E+02, -0.118111964000000E+03),\n new google.maps.LatLng( 0.467703250000000E+02, -0.118111367000000E+03),\n new google.maps.LatLng( 0.467719940000000E+02, -0.118109572000000E+03),\n new google.maps.LatLng( 0.467731840000000E+02, -0.118106546000000E+03),\n new google.maps.LatLng( 0.467726370000000E+02, -0.118102620000000E+03),\n new google.maps.LatLng( 0.467758610000000E+02, -0.118098197000000E+03),\n new google.maps.LatLng( 0.467788790000000E+02, -0.118095006000000E+03),\n new google.maps.LatLng( 0.467766410000000E+02, -0.118086553000000E+03),\n new google.maps.LatLng( 0.467762770000000E+02, -0.118074043000000E+03),\n new google.maps.LatLng( 0.467754550000000E+02, -0.118072613000000E+03),\n new google.maps.LatLng( 0.467738320000000E+02, -0.118072879000000E+03),\n new google.maps.LatLng( 0.467723230000000E+02, -0.118070517000000E+03),\n new google.maps.LatLng( 0.467702670000000E+02, -0.118055846000000E+03),\n new google.maps.LatLng( 0.467684610000000E+02, -0.118049326000000E+03),\n new google.maps.LatLng( 0.467683010000000E+02, -0.118046731000000E+03),\n new google.maps.LatLng( 0.467686430000000E+02, -0.118045467000000E+03),\n new google.maps.LatLng( 0.467711570000000E+02, -0.118041873000000E+03),\n new google.maps.LatLng( 0.467743340000000E+02, -0.118041705000000E+03),\n new google.maps.LatLng( 0.467768710000000E+02, -0.118040906000000E+03),\n new google.maps.LatLng( 0.467810300000000E+02, -0.118038874000000E+03),\n new google.maps.LatLng( 0.467847320000000E+02, -0.118036045000000E+03),\n new google.maps.LatLng( 0.467880680000000E+02, -0.118027024000000E+03),\n new google.maps.LatLng( 0.467872210000000E+02, -0.118024696000000E+03),\n new google.maps.LatLng( 0.467834490000000E+02, -0.118022070000000E+03),\n new google.maps.LatLng( 0.467828550000000E+02, -0.118020972000000E+03),\n new google.maps.LatLng( 0.467833340000000E+02, -0.118018277000000E+03),\n new google.maps.LatLng( 0.467847040000000E+02, -0.118015613000000E+03),\n new google.maps.LatLng( 0.467904850000000E+02, -0.118012613000000E+03),\n new google.maps.LatLng( 0.467914450000000E+02, -0.118012612000000E+03),\n new google.maps.LatLng( 0.467926110000000E+02, -0.118013277000000E+03),\n new google.maps.LatLng( 0.467938240000000E+02, -0.118015771000000E+03),\n new google.maps.LatLng( 0.467970240000000E+02, -0.118017532000000E+03),\n new google.maps.LatLng( 0.467995160000000E+02, -0.118017896000000E+03),\n new google.maps.LatLng( 0.468032860000000E+02, -0.118016529000000E+03),\n new google.maps.LatLng( 0.468045200000000E+02, -0.118016528000000E+03),\n new google.maps.LatLng( 0.468118810000000E+02, -0.118019751000000E+03),\n new google.maps.LatLng( 0.468138470000000E+02, -0.118019816000000E+03),\n new google.maps.LatLng( 0.468150350000000E+02, -0.118018416000000E+03),\n new google.maps.LatLng( 0.468148040000000E+02, -0.118011525000000E+03),\n new google.maps.LatLng( 0.468225090000000E+02, -0.117997528000000E+03),\n new google.maps.LatLng( 0.468251890000000E+02, -0.117998952000000E+03),\n new google.maps.LatLng( 0.468279350000000E+02, -0.117997984000000E+03),\n new google.maps.LatLng( 0.468300140000000E+02, -0.117996391000000E+03),\n new google.maps.LatLng( 0.468322960000000E+02, -0.117991960000000E+03),\n new google.maps.LatLng( 0.468380810000000E+02, -0.117993603000000E+03),\n new google.maps.LatLng( 0.468380720000000E+02, -0.117999903000000E+03),\n new google.maps.LatLng( 0.468387540000000E+02, -0.118003275000000E+03),\n new google.maps.LatLng( 0.468394400000000E+02, -0.118004107000000E+03),\n new google.maps.LatLng( 0.468433940000000E+02, -0.118004835000000E+03),\n new google.maps.LatLng( 0.468477370000000E+02, -0.118004631000000E+03),\n new google.maps.LatLng( 0.468481940000000E+02, -0.118004431000000E+03),\n new google.maps.LatLng( 0.468492440000000E+02, -0.118001059000000E+03),\n new google.maps.LatLng( 0.468492750000000E+02, -0.118001012000000E+03),\n new google.maps.LatLng( 0.468525050000000E+02, -0.117994489000000E+03),\n new google.maps.LatLng( 0.468574140000000E+02, -0.117988770000000E+03),\n new google.maps.LatLng( 0.468610530000000E+02, -0.117988229000000E+03),\n new google.maps.LatLng( 0.468618530000000E+02, -0.117987600000000E+03),\n new google.maps.LatLng( 0.468632970000000E+02, -0.117976873000000E+03),\n new google.maps.LatLng( 0.468672540000000E+02, -0.117970807000000E+03),\n new google.maps.LatLng( 0.468683030000000E+02, -0.117970753000000E+03),\n ];\n\n return zipCoords\n}" ]
[ "0.6364121", "0.62733495", "0.6261396", "0.6255166", "0.62296975", "0.61836725", "0.6159762", "0.6087654", "0.6000221", "0.5974674", "0.59659064", "0.59278524", "0.59248453", "0.59232867", "0.5892943", "0.58537066", "0.5846781", "0.582977", "0.58139", "0.58085155", "0.5806239", "0.580202", "0.5799335", "0.5787258", "0.57566947", "0.57554984", "0.57414234", "0.57356215", "0.5702703", "0.5698769", "0.56945354", "0.5694436", "0.56898135", "0.56872654", "0.5677208", "0.5644181", "0.5629889", "0.5622746", "0.56167775", "0.56079656", "0.55992806", "0.55708665", "0.55547243", "0.5552529", "0.5531206", "0.552085", "0.5515324", "0.5506525", "0.5501563", "0.549486", "0.54933524", "0.5489831", "0.5477745", "0.54729915", "0.54683316", "0.54665095", "0.5460743", "0.54599047", "0.54592526", "0.5456212", "0.54465085", "0.54337984", "0.54302907", "0.54302907", "0.54219425", "0.5413315", "0.53790563", "0.5378078", "0.53768545", "0.53657323", "0.53480625", "0.53434926", "0.5340791", "0.534042", "0.53400517", "0.5337779", "0.5334343", "0.5333762", "0.5332123", "0.5323228", "0.5320448", "0.5319765", "0.5318721", "0.5318523", "0.5315979", "0.5315194", "0.53149396", "0.5314316", "0.5314293", "0.5313952", "0.5313942", "0.53136224", "0.531283", "0.5311299", "0.53110635", "0.5310475", "0.5310427", "0.5310259", "0.5309961", "0.53093594" ]
0.66575354
0
The render function generates the registration form
render() { return ( <View style= {styles.register}> <Text style={styles.header}>REGISTER</Text> <TextInput style = {styles.textInput} placeholder= "First Name" onChangeText= { (fname) => this.setState ( {fname} ) } underlineColorAndroid= {'transparent'}/> <TextInput style = {styles.textInput} placeholder= "Last Name" onChangeText= { (lname) => this.setState ( {lname} ) } underlineColorAndroid= {'transparent'}/> <TextInput style = {styles.textInput} placeholder= "Age" onChangeText= { (age) => this.setState ( {age} ) } underlineColorAndroid= {'transparent'}/> <TextInput style = {styles.textInput} placeholder= "Gender" onChangeText= { (gender) => this.setState ( {gender} ) } underlineColorAndroid= {'transparent'}/> <TextInput style = {styles.textInput} placeholder= "Favorite Borough" onChangeText= { (favBorough) => this.setState ( {favBorough} ) } underlineColorAndroid= {'transparent'}/> <TextInput style = {styles.textInput} placeholder= "Username" keyboardType='username' onChangeText= { (username) => this.setState ( {username} ) } underlineColorAndroid= {'transparent'}/> <TextInput style = {styles.textInput} placeholder= "Password" secureTextEntry={true} onChangeText= { (password) => this.setState ( {password} ) } underlineColorAndroid= {'transparent'}/> <TextInput style = {styles.textInput} placeholder= "Confirm Password" secureTextEntry={true} onChangeText= { (cPassword) => this.setState ( {cPassword} ) } underlineColorAndroid= {'transparent'}/> <View style={styles.overallButtonContainer}> <TouchableOpacity style={styles.btn} onPress={this.register}> <Text style={styles.buttonText}> Register</Text> </TouchableOpacity> <TouchableOpacity style={styles.btn} onPress={ () => {this.props.navigation.navigate('Home')} }> <Text style={styles.buttonText}> Cancel</Text> </TouchableOpacity> </View> <Text>{this.getErrorMessages()}</Text> <Text>{this.isFieldInError()}</Text> <Text>{this.getErrorsInField()}</Text> </View> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n\t\treturn this.renderRegisterPage();\n\t}", "function getFormRegister(request,response) {\n response.render('pages/login/signUp')\n}", "function loadRegisteData() {\n const registerBody = document.getElementById(\"registerBody\");\n\n const registerContainer = createSection(registerBody, \"section\", \"registerContainer\",\"registerContainer\");\n const registerForm = createForm(registerContainer, \"registerForm\" , \"#\");\n\n createSection(registerForm, \"h1\", \"registerHeader\",\"registerHeader\", \"Register Here\");\n\n createSection(registerForm, \"label\", \"usernameLabel\", \"usernameLabel\", \"Username:\");\n createRegisterInput(registerForm, \"text\", \"username\",\"username\", \"Username\", \"[A-Za-z0-9.-]+\", \"only uppercase and lowercase letters and numbers and dash\", true);\n\n createSection(registerForm, \"label\", \"passwordLabel\", \"passwordLabel\", \"Password:\");\n createRegisterInput(registerForm, \"password\", \"password\",\"password\", \"Password\", \"(?=.*d)(?=.*[a-z])(?=.*[A-Z]).{8,}\", \"At least one number and one uppercase and lowercase letter, and at least 8 or more characters\", true);\n\n createSection(registerForm, \"label\", \"forenameLabel\", \"forenameLabel\", \"Forename:\");\n createRegisterInput(registerForm, \"text\", \"forename\",\"forename\", \"Forename\", \"[A-Za-z]+\", \"Forename: letters only\", true);\n\n createSection(registerForm, \"label\", \"surnameLabel\", \"surnameLabel\", \"Surname:\");\n createRegisterInput(registerForm, \"text\", \"surname\",\"surname\", \"Surname\", \"[A-Za-z]+\", \"Surname: letters only\", true);\n\n createSection(registerForm, \"label\", \"emailLabel\", \"emailLabel\", \"Email Address:\");\n createRegisterInput(registerForm, \"email\", \"email\",\"email\", \"Email Address\", \"[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$\", \"xyz@something.com\", true);\n\n createSection(registerForm, \"label\", \"phoneNumLabel\", \"phoneNumLabel\", \"Phone Number:\");\n createRegisterInput(registerForm, \"tel\", \"phoneNum\",\"phoneNum\", \"Phone Number\", \"^d{10}$\", \"10 numeric characters only\", true);\n\n const registerButtonContainer = createSection(registerForm, \"div\", \"registerButtonContainer\", \"registerButtonContainer\");\n createButton(registerButtonContainer, \"submit\", \"registerButton\",\"regBut\", grabEverything, \"Register\");\n\n const registerMessages = createSection(registerBody, \"section\", \"registerMessages\",\"registerMessages\");\n createSection(registerMessages, \"section\", \"errorsContainer\",\"errors\");\n\n return \"loadRegisteData\";\n}", "function signUpTemplate() {\n return `<form class=\"signUpForm\" autocomplete=\"on\">\n <div class=\"loginError\"></div>\n <legend class=\"loginRegisterTitle\">Welcome, aboard!</legend>\n <label for=\"username\">USERNAME:</label>\n <input class=\"usernameSignUp\" type=\"text\" name=\"username\" pattern=\".{1,}\" required title=\"1 characters minimum\" required>\n <br>\n <label for=\"password\">PASSWORD:</label>\n <input class=\"passwordSignUp\" type=\"password\" name=\"password\" pattern=\".{10, 72}\" required title=\"10 characters minimum\" required>\n <br>\n <label for=\"firstName\">FIRST NAME:</label>\n <input class=\"firstnameSignUp\" type=\"text\" name=\"firstName\" required>\n <br>\n <label for=\"lastName\">LAST NAME:</label>\n <input class=\"lastnameSignUp\" type=\"text\" name=\"lastName\" required>\n <br>\n <label for=\"email\">EMAIL:</label>\n <input class=\"emailSignUp\" type=\"email\" name=\"email\" required>\n <br>\n <button class=\"loginButton signingUpNewAccount\" type=\"submit\">Submit</button>\n </form>\n <a href=\"#\" id=\"login\"><p class=\"toggleReg\">Login!</p></a>`;\n}", "renderRegistration()\n {\n return (\n <div id=\"registration\">\n <Registration\n callback={this.registerCallback}\n />\n </div>\n );\n }", "renderRegister() {\n return (\n <div className=\"col-md-6 log-reg\">\n <h2 className=\"text-center\">Registrarse</h2>\n <form>\n <label className=\"col-form-label col-md-6\">\n Correo\n </label>\n <input name=\"emailReg\" type=\"text\" onChange={this.handleInputChange.bind(this)} value={this.state.emailReg}/>\n <label className=\"col-form-label col-md-6\">\n Contraseña\n </label>\n <input name=\"passwordReg\" type=\"password\" onChange={this.handleInputChange.bind(this)} value={this.state.passwordReg}/>\n <label className=\"col-form-label col-md-6\">\n Confirmar Contraseña\n </label>\n <input name=\"passwordConf\" type=\"password\" onChange={this.handleInputChange.bind(this)} value={this.state.passwordConf}/>\n <div className=\"row justify-content-center align-self-center\">\n <button type=\"button\" className=\"btn-format\" onClick={this.handleRegisterClick.bind(this)}>Registrar</button>\n </div>\n </form>\n </div>\n );\n }", "function showRegister() {\n clearErrorMsg();\n showLinks(['loginLink']);\n showView('registerForm');\n}", "render(){\n return (\n\n <form>\n <label>\n Name:\n <input type=\"text\" name=\"name\" placeholder=\"Full Name\" onChange={this.registerUser}/>\n </label>\n <label>\n Specialty:\n <input type=\"text\" name=\"specialty\"\n placeholder=\"Profession/work\" onChange={this.registerUser}/>\n </label>\n <label>\n Location:\n <input type=\"text\" name=\"tag\" placeholder=\"i.e. Uptown, Chicago\" onChange={this.registerUser}/>\n </label>\n <label>\n Contact:\n <input type=\"text\" name=\"tag\"\n placeholder=\"email/phone number\" onChange={this.registerUser}/>\n </label>\n <input type='submit'/>\n </form>\n\n\n )\n }", "render() {\n\t\treturn (\n\t\t\t<div className=\"new-user-form\">\n\t\t\t\t<Form>\n\t\t\t\t\t<Form.Input\n\t\t\t\t\tonChange={this.handleChange}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tplaceholder=\"User Name\"\n\t\t\t\t\trequired />\n\t\t\t\t\t<Button id=\"create-user-button\" type=\"submit\">*</Button>\n\t\t\t\t</Form>\n\t\t\t</div>\n\t\t\t)\n\t\t//Need to ensure that this button is actually used for game creation, not just ROOM creation\n\t}", "function RegisterForm(){ \n return (\n <div>\n <h1>register form</h1>\n {/* <h3>{street} {city}, {state} {zip}</h3>\n <button >Register</button>\n <button>Close List</button> */}\n </div>\n );\n \n }", "function createRegistrationForm(){\n registrationForm = new MyForm(\n templates.tNewForm,\n [\n {\n id : 'registrate',\n class : 'btn btn-primary',\n name : 'Registrate',\n action : registrationUser\n },\n {\n id : 'cancel',\n class : 'btn btn-primary',\n name : 'Cancel',\n action : function(e){\n e.preventDefault();\n registrationForm.hide();\n }\n }\n ]\n );\n validation(registrationForm.form);\n }", "function signupForm(req, res) {\n res.render('sign-up.ejs');\n}", "render() {\n return (\n <Container>\n <Grid textAlign=\"center\" verticalAlign=\"middle\" centered columns={2}>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\">\n Register your account\n </Header>\n <Form onSubmit={this.handleSubmit}>\n <Segment stacked>\n <Form.Input\n label=\"First Name\"\n icon=\"user\"\n iconPosition=\"left\"\n name=\"firstName\"\n type=\"text\"\n placeholder=\"First Name\"\n onChange={this.handleChange}\n />\n <Form.Input\n label=\"Last Name\"\n icon=\"user\"\n iconPosition=\"left\"\n name=\"lastName\"\n type=\"text\"\n placeholder=\"Last Name\"\n onChange={this.handleChange}\n />\n <Form.Select fluid label='Student or Faculty' options={sf_options} placeholder='Student or Faculty'/>\n <Form.Select fluid label='Proficiency' options={prof_options} placeholder='Native Speaker or Learning'/>\n <Form.TextArea\n label=\"Description\"\n name=\"desc\"\n placeholder=\"Tell us about yourself..\"\n onChange={this.handleChange}\n />\n <Form.Input\n label=\"Email\"\n icon=\"user\"\n iconPosition=\"left\"\n name=\"email\"\n type=\"email\"\n placeholder=\"email@hawaii.edu\"\n onChange={this.handleChange}\n />\n <Form.Input\n label=\"Password\"\n icon=\"lock\"\n iconPosition=\"left\"\n name=\"password\"\n placeholder=\"Password\"\n type=\"password\"\n onChange={this.handleChange}\n />\n <Form.Button content=\"Submit\" />\n </Segment>\n </Form>\n <Message>\n Already have an account? Login <Link to=\"/signin\">here</Link>\n </Message>\n {this.state.error === '' ? (\n ''\n ) : (\n <Message\n error\n header=\"Registration was not successful\"\n content={this.state.error}\n />\n )}\n </Grid.Column>\n </Grid>\n </Container>\n );\n }", "render() {\n\t\tconst { form } = this.state;\n\t\treturn (\n\t\t\t<div className=\"walkin-box\" style={walkInBoxStyles.container}>\n\t\t\t\t<form onSubmit={this.onFormSubmit}>\n\t\t\t\t\t<Row>\n\t\t\t\t\t\t<Col span={14} offset={5}>\n\t\t\t\t\t\t\t<Card title=\"New Registration\" noHovering=\"true\">\n\t\t\t\t\t\t\t\t<Row>\n\t\t\t\t\t\t\t\t\t<Col span={11}>\n\t\t\t\t\t\t\t\t\t\t<Row style={walkInBoxStyles.row}>\n\t\t\t\t\t\t\t\t\t\t\t<Col\n\t\t\t\t\t\t\t\t\t\t\t\tspan={10}\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={walkInBoxStyles.label}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"req\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tFirst Name:\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t<Col span={14}>\n\t\t\t\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={form.qrFirstName}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ev => this.onInputChange(ev, \"qrFirstName\")}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t\t\t\t<Row style={walkInBoxStyles.row}>\n\t\t\t\t\t\t\t\t\t\t\t<Col\n\t\t\t\t\t\t\t\t\t\t\t\tspan={10}\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={walkInBoxStyles.label}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"req\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tLast Name:\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t<Col span={14}>\n\t\t\t\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={form.qrLastName}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ev => this.onInputChange(ev, \"qrLastName\")}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t\t\t\t<Row style={walkInBoxStyles.row}>\n\t\t\t\t\t\t\t\t\t\t\t<Col\n\t\t\t\t\t\t\t\t\t\t\t\tspan={10}\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={walkInBoxStyles.label}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"req\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tPhone:\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t<Col span={14}>\n\t\t\t\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={form.qrPhone}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ev => this.onInputChange(ev, \"qrPhone\")}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t\t\t\t<Row style={walkInBoxStyles.row}>\n\t\t\t\t\t\t\t\t\t\t\t<Col\n\t\t\t\t\t\t\t\t\t\t\t\tspan={10}\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={walkInBoxStyles.label}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"req\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tEmail:\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t<Col span={14}>\n\t\t\t\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={form.qrEmail}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ev => this.onInputChange(ev, \"qrEmail\")}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t\t\t\t<Row style={walkInBoxStyles.row}>\n\t\t\t\t\t\t\t\t\t\t\t<Col\n\t\t\t\t\t\t\t\t\t\t\t\tspan={10}\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={walkInBoxStyles.label}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"req\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tCompany:\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t<Col span={14}>\n\t\t\t\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={form.qrCompany}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ev => this.onInputChange(ev, \"qrCompany\")}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t\t\t\t<Row style={walkInBoxStyles.row}>\n\t\t\t\t\t\t\t\t\t\t\t<Col\n\t\t\t\t\t\t\t\t\t\t\t\tspan={10}\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={walkInBoxStyles.label}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"req\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tCompany Size:\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t<Col span={14}>\n\t\t\t\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ width: \"100%\" }}\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={form.qrCompanySize}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ev =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.onInputChange(ev, \"qrCompanySize\")}\n\t\t\t\t\t\t\t\t\t\t\t\t\tdropdownMatchSelectWidth={false}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{this.generateDropdown(company_size)}\n\t\t\t\t\t\t\t\t\t\t\t\t</Select>\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t\t\t\t<Row style={walkInBoxStyles.row}>\n\t\t\t\t\t\t\t\t\t\t\t<Col\n\t\t\t\t\t\t\t\t\t\t\t\tspan={10}\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={walkInBoxStyles.label}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"req\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tCompany Type:\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t<Col span={14}>\n\t\t\t\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ width: \"100%\" }}\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={form.qrCompanyType}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ev =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.onInputChange(ev, \"qrCompanyType\")}\n\t\t\t\t\t\t\t\t\t\t\t\t\tdropdownMatchSelectWidth={false}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{this.generateDropdown(company_type)}\n\t\t\t\t\t\t\t\t\t\t\t\t</Select>\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t\t\t\t{this.state.event.coworking\n\t\t\t\t\t\t\t\t\t\t\t? <Row style={walkInBoxStyles.row}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Col\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tspan={10}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={walkInBoxStyles.label}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"req\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tAWS Account ID:\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Col span={14}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={form.qrAccountID}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ev =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.onInputChange(ev, \"qrAccountID\")}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t\t\t\t\t: \"\"}\n\t\t\t\t\t\t\t\t\t\t{!this.state.event.coworking && this.state.settings.prereg\n\t\t\t\t\t\t\t\t\t\t\t? <Row style={walkInBoxStyles.row}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Col\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tspan={17}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={walkInBoxStyles.optInLabel}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"req\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tAllow Sponsor Communication?\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Col span={7}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ width: \"100%\" }}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={form.qrPartnerQuestion}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ev =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.onInputChange(ev, \"qrPartnerQuestion\")}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdropdownMatchSelectWidth={false}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Option value=\"Yes\">Yes</Option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Option value=\"No\">No</Option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Select>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t\t\t\t\t: \"\"}\n\t\t\t\t\t\t\t\t\t</Col>\n\n\t\t\t\t\t\t\t\t\t<Col span={11} offset={2}>\n\t\t\t\t\t\t\t\t\t\t<Row style={walkInBoxStyles.row}>\n\t\t\t\t\t\t\t\t\t\t\t<Col\n\t\t\t\t\t\t\t\t\t\t\t\tspan={10}\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={walkInBoxStyles.label}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"req\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tJob Title:\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t<Col span={14}>\n\t\t\t\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={form.qrTitle}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ev => this.onInputChange(ev, \"qrTitle\")}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t\t\t\t<Row style={walkInBoxStyles.row}>\n\t\t\t\t\t\t\t\t\t\t\t<Col\n\t\t\t\t\t\t\t\t\t\t\t\tspan={10}\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={walkInBoxStyles.label}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"req\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tJob Role:\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t<Col span={14}>\n\t\t\t\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ width: \"100%\" }}\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={form.qrJobRole}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ev => this.onInputChange(ev, \"qrJobRole\")}\n\t\t\t\t\t\t\t\t\t\t\t\t\tdropdownMatchSelectWidth={false}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{this.generateDropdown(job_role)}\n\t\t\t\t\t\t\t\t\t\t\t\t</Select>\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t\t\t\t<Row style={walkInBoxStyles.row}>\n\t\t\t\t\t\t\t\t\t\t\t<Col\n\t\t\t\t\t\t\t\t\t\t\t\tspan={10}\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={walkInBoxStyles.label}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"req\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tIndustry:\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t<Col span={14}>\n\t\t\t\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ width: \"100%\" }}\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={form.qrIndustry}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ev => this.onInputChange(ev, \"qrIndustry\")}\n\t\t\t\t\t\t\t\t\t\t\t\t\tdropdownMatchSelectWidth={false}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{this.generateDropdown(industry)}\n\t\t\t\t\t\t\t\t\t\t\t\t</Select>\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t\t\t\t<Row style={walkInBoxStyles.row}>\n\t\t\t\t\t\t\t\t\t\t\t<Col\n\t\t\t\t\t\t\t\t\t\t\t\tspan={10}\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={walkInBoxStyles.label}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"req\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tCountry:\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t<Col span={14}>\n\t\t\t\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ width: \"100%\" }}\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={this.selectCountry}\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={form.qrCountry}\n\t\t\t\t\t\t\t\t\t\t\t\t\tdropdownMatchSelectWidth={false}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{this.generateDropdown(countryList)}\n\t\t\t\t\t\t\t\t\t\t\t\t</Select>\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t\t\t\t{!this.state.showStateOther\n\t\t\t\t\t\t\t\t\t\t\t? <Row style={walkInBoxStyles.row}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Col\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tspan={10}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={walkInBoxStyles.label}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"req\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tState:\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Col span={14}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ width: \"100%\" }}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={form.qrState}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ev => this.onInputChange(ev, \"qrState\")}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdropdownMatchSelectWidth={false}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{this.generateStateDropdown()}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Select>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t\t\t\t\t: <Row style={walkInBoxStyles.row}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Col span={10} style={walkInBoxStyles.label}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tState Other:\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Col span={14}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={form.qrStateOther}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ev =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.onInputChange(ev, \"qrStateOther\")}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t\t</Row>}\n\t\t\t\t\t\t\t\t\t\t<Row style={walkInBoxStyles.row}>\n\t\t\t\t\t\t\t\t\t\t\t<Col\n\t\t\t\t\t\t\t\t\t\t\t\tspan={10}\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={walkInBoxStyles.label}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"req\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tZip Code:\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t<Col span={14}>\n\t\t\t\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={form.qrZip}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ev => this.onInputChange(ev, \"qrZip\")}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t\t\t\t<Row style={walkInBoxStyles.row}>\n\t\t\t\t\t\t\t\t\t\t\t<Col\n\t\t\t\t\t\t\t\t\t\t\t\tspan={10}\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={walkInBoxStyles.longLabel}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"req\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tLevel of AWS Usage:\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t\t<Col span={14}>\n\t\t\t\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ width: \"100%\" }}\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={form.qrLevel}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ev => this.onInputChange(ev, \"qrLevel\")}\n\t\t\t\t\t\t\t\t\t\t\t\t\tdropdownMatchSelectWidth={false}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{this.generateDropdown(levels)}\n\t\t\t\t\t\t\t\t\t\t\t\t</Select>\n\t\t\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t</Row>\n\n\t\t\t\t\t\t\t\t<Row style={{ marginTop: \"15px\" }}>\n\t\t\t\t\t\t\t\t\t<Col span={24} style={{ textAlign: \"right\" }}>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tonClick={this.onFormSubmit}\n\t\t\t\t\t\t\t\t\t\t\thtmlType=\"submit\"\n\t\t\t\t\t\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\t\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"register-btn\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\tRegister<Icon type=\"right\" />\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t</Col>\n\t\t\t\t\t</Row>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t);\n\t}", "function Registration(){\n\treturn(\n\t<>\n\t <Header />\n\t\t<main>\n\t\t <h1> Register to attend</h1>\n\t\t \n\t\t <form action=\"\" method=\"POST\" name=\"registration\">\n\t\t\t <div className=\"form-group row\">\n\t\t <label className=\"form-label col-12 col-sm-2\" htmlFor=\"fname\">First name</label>\n\t\t <div className=\"col-12 col-sm-10\">\n\t\t <input type=\"text\" className=\"form-control\" name=\"fname\" id=\"fname\" />\n\t\t </div>\n\t\t\t </div>\n\t\t\t \n\t\t\t <div className=\"form-group row\">\n\t\t <label className=\"form-label col-12 col-sm-2\" htmlFor=\"lname\">Last name</label>\n\t\t <div className=\"col-12 col-sm-10\">\n\t\t <input type=\"text\" className=\"form-control\" name=\"lname\" id=\"lname\" />\n\t\t </div>\n\t\t\t </div>\n\t\t\t \n\t\t\t <div className=\"form-group row\">\n\t\t <label className=\"form-label col-12 col-sm-2\" htmlFor=\"experience\">Experience</label>\n\t\t <div className=\"col-12 col-sm-10\">\n\t\t <input type=\"text\" className=\"form-control\" name=\"experience\" id=\"experience\" />\n\t\t </div>\n\t\t\t </div>\n\t\t\t \n\t\t\t <div className=\"form-group row\">\n\t\t <label className=\"form-label col-12 col-sm-2\" htmlFor=\"speciality\">Speciality</label>\n\t\t <div className=\"col-12 col-sm-10\">\n\t\t <input type=\"text\" className=\"form-control\" name=\"speciality\" id=\"speciality\" />\n\t\t </div>\n\t\t\t </div>\n\t\t\t \n\t\t\t <div className=\"form-group row\">\n\t\t <label className=\"form-label col-12 col-sm-2\" htmlFor=\"picture\">Picture</label>\n\t\t <div className=\"col-12 col-sm-10\">\n\t\t <input type=\"file\" className=\"form-control\" name=\"picture\" id=\"picture\" />\n\t\t </div>\n\t\t\t </div>\n\t\t\t <div className=\"row\">\n\t\t\t <div className=\"col-12 offset-sm-2\">\n\t\t\t <input type=\"submit\" className=\"btn btn-success\" name=\"submit\" />\n\t\t\t </div>\n\t\t\t </div>\n\t\t </form>\n\t\t\n\t\t \n\t\t</main>\n\t\t<Footer />\n\t</>\n\t);\n}", "function registrationForm()\r\n{\r\n // hiding the elements\r\n textboxOne.style.display = \"none\";\r\n textboxTwo.style.display = \"none\";\r\n buttonOne.style.display = \"none\";\r\n messageOne.style.display = \"none\";\r\n linkOne.style.display = \"none\";\r\n contactUs.style.display = \"none\";\r\n\r\n // displaying the view title\r\n viewTitle.innerHTML = \"REGISTER\";\r\n viewTitle.style.display = \"block\";\r\n\r\n // creating the elements to be displayed in the registration form\r\n let regForm = \"<form><div class='row'>\";\r\n regForm += \"<div class='col-lg-5'>\";\r\n regForm += \"<p class='label'> Name\";\r\n regForm += \"<input type='text' class='form-control' id='name' placeholder='enter your forename...' required></p>\"; \r\n regForm += \"<p class='label'> Surname\";\r\n regForm += \"<input type='text' class='form-control' id='surname' placeholder='enter your surname...' required></p>\";\r\n regForm += \"<p class='label'> Date of Birth\";\r\n regForm += \"<input type='text' class='form-control' id='dob' placeholder='yyyy-mm-dd' required></p>\";\r\n regForm += \"<p class='label'> Gender\";\r\n regForm += \"<select class='form-control' id='gender'> <option>F</option> <option>M</option> </select></p>\"; \r\n regForm += \"<p class='label'> City\";\r\n regForm += \"<input type='text' class='form-control' id='city' placeholder='enter your city...' required></p>\"; \r\n regForm += \"<p class='label'> Country\";\r\n regForm += \"<select class='form-control' id='country'>\";\r\n for (let i = 0; i < countryArray.length; i++) \r\n {\r\n // adding the options in the Countries drop down list\r\n regForm +=\"<option>\" + countryArray[i] + \"</option>\";\r\n }\r\n regForm += \"</select></p>\"; \r\n regForm += \"<p class='label'> Level of Education\";\r\n regForm += \"<select class='form-control' id='educLevel'> <option>Secondary</option> <option>Post-Secondary</option> <option>Tertiary</option> <option>Post-Tertiary</option> </select></p>\"; \r\n regForm += \"<p class='label'> Area(s) of Studies\"; // NOT REQUIRED\r\n regForm += \"<input type='text' class='form-control' id='studyArea' placeholder='area/s of studies...'></p>\";\r\n regForm += \"<p><span class='label'> Topics of Interest </span>\";\r\n regForm += \"<span> (tick one or more) </span></p>\";\r\n regForm += \"</div>\";\r\n regForm += \"</div>\";\r\n\r\n regForm += \"<div class='row'>\"; \r\n regForm += \"<div class='form-check col-lg-3 check-box-align'><input type='checkbox' class='form-check-input check-box-align' id='science'> <label class='form-check-label' for='science'>Science</label></div>\";\r\n regForm += \"<div class='form-check col-lg-3 check-box-align'><input type='checkbox' class='form-check-input check-box-align' id='medicine'> <label class='form-check-label' for='medicine'>Medicine</label></div>\";\r\n regForm += \"<div class='form-check col-lg-3 check-box-align'><input type='checkbox' class='form-check-input check-box-align' id='travel'> <label class='form-check-label' for='travel'>Travel</label></div>\";\r\n regForm += \"<div class='form-check col-lg-3 check-box-align'><input type='checkbox' class='form-check-input check-box-align' id='education'> <label class='form-check-label' for='education'>Education</label></div>\";\r\n regForm += \"</div><div class='row'>\"; \r\n regForm += \"<div class='form-check col-lg-3 check-box-align'><input type='checkbox' class='form-check-input check-box-align' id='sports'> <label class='form-check-label' for='sports'>Sports</label></div>\";\r\n regForm += \"<div class='form-check col-lg-3 check-box-align'><input type='checkbox' class='form-check-input check-box-align' id='nutrition'> <label class='form-check-label' for='nutrition'>Nutrition</label></div>\";\r\n regForm += \"<div class='form-check col-lg-3 check-box-align'><input type='checkbox' class='form-check-input check-box-align' id='economy'> <label class='form-check-label' for='economy'>Economy</label></div>\";\r\n regForm += \"<div class='form-check col-lg-3 check-box-align'><input type='checkbox' class='form-check-input check-box-align' id='environment'> <label class='form-check-label' for='environment'>Environment</label></div>\";\r\n regForm += \"</div><br><br>\";\r\n\r\n regForm += \"<div class='row'>\";\r\n regForm += \"<div class='col-lg-5'>\";\r\n regForm += \"<p class='label'> Email\";\r\n regForm += \"<p><input type='text' class='form-control' id='email' placeholder='enter your email...' required></p>\"; \r\n regForm += \"<p class='label'> Password\";\r\n regForm += \"<input type='password' class='form-control' id='password' placeholder='enter a password...' required></p>\";\r\n regForm += \"</div>\";\r\n regForm += \"</div>\";\r\n\r\n regForm += \"<div class='row'>\";\r\n regForm += \"<div class='col-lg-5'>\";\r\n regForm += \"<p class='message-text' id='regFormMsg'></p>\";\r\n regForm += \"</div>\";\r\n regForm += \"<div class='col-lg-3'>\";\r\n regForm += \"<p><button onclick='return checkEmail()' type='button' class='btn-lg btn-secondary mb-2'> Register </button></p>\";\r\n regForm += \"</div>\";\r\n regForm += \"</div></form>\";\r\n\r\n mainContainer.innerHTML = regForm; \r\n mainContainer.style.display = \"block\"; \r\n}", "function renderRegister(req, res) {\n if (! auth.isAuthenticated(req)) {\n //Show the registration form.\n res.render('register', {\n message: getFlashFromReq(req),\n next: req.query.next,\n title: 'Ready to play?',\n mode: 'register'\n });\n }\n else if (User.isGuest(req.user.username)) {\n //Show the 'conversion' form.\n res.render('register', {\n message: getFlashFromReq(req),\n next: req.query.next,\n title: 'Ready to play?',\n mode: 'convert'\n });\n }\n else {\n //Redirect to 'next' URL (or base page).\n res.redirect(req.query.next || base_page);\n }\n}", "register(request, response) {\n\t\tresponse.render('auth/register');\n\t}", "renderFields() {\n return _.map(confirmRegisterFields, ({ name, label, type }) => <Field component={FormField} type='text' key={name} name={name} label={label} htmltype={type} />)\n \n }", "function RegisterPanel() {\n Panel.call(this, $('<section class=\"register container-fluid\" style=\"display: none;\">'\n +'<h2>Register</h2>'\n +'<form class=\"register__form\">'\n + '<div class=\"row\">'\n + '<div class=\"col-sm-12 col-lg-6 input-group form-group\">'\n + '<div class=\"input-group-prepend\">'\n + '<div class=\"input-group-text\">Name</div>'\n + '</div>'\n + '<input class=\"form-control\" type=\"text\" name=\"name\" placeholder=\"John\" required=\"\">'\n + '</div>'\n + '<div class=\"col-sm-12 col-lg-6 form-group input-group\">'\n + '<div class=\"input-group-prepend\">'\n + '<div class=\"input-group-text\">Surname</div>'\n + '</div>'\n + '<input class=\"form-control\" type=\"text\" placeholder=\"Doe\" required=\"\">'\n + '</div>'\n + '<div class=\"col-sm-12 form-group input-group\">'\n + '<div class=\"input-group-prepend\">'\n + '<div class=\"input-group-text\">Email</div>'\n + '</div>'\n + '<input class=\"form-control\" type=\"email\" name=\"email\" placeholder=\"something@example.com\" required=\"\">'\n + '</div>'\n + '<div class=\"col-sm-12 col-lg-6 form-group input-group\">'\n + '<div class=\"input-group-prepend\">'\n + '<div class=\"input-group-text\">Password</div>'\n + '</div>'\n + '<input class=\"form-control\" type=\"password\" name=\"password\" placeholder=\"example\" required=\"\">'\n + '</div>'\n + '<div class=\"col-sm-12 col-lg-6 form-group input-group\">'\n + '<div class=\"input-group-prepend\">'\n + '<div class=\"input-group-text\">Confirm Password</div>'\n + '</div>'\n + '<input class=\"form-control\" type=\"password\" name=\"passwordConfirmation\" placeholder=\"example\" required=\"\">'\n + '</div>'\n + '<div class=\"col-sm-12 form-group\">'\n + '<button class=\"btn btn-default\" type=\"submit\">Register</button>'\n + '</div>'\n + '</div>'\n +'</form>'\n +'<section class=\"error\" style=\"display: none;\"></section>'\n +'</section>'));\n\n var $container = this.$element;\n\n var $form = $container.find('form');\n this.__$form__ = $form;\n\n var $inputs = $form.find('input');\n\n this.__$nameInput__ = $($inputs[0]);\n\n this.__$surnameInput__ = $($inputs[1]);\n\n this.__$emailInput__ = $($inputs[2]);\n\n this.__$passwordInput__ = $($inputs[3]);\n\n this.__$passwordConfirmationInput__ = $($inputs[4]);\n\n var errorPanel = new ErrorPanel;\n $container.append(errorPanel.$element);\n this.__errorPanel__ = errorPanel;\n\n var $loginLink = $('<a href=\"#\" class=\"register__login-link btn btn-warning\">Login</a>');\n $container.append($loginLink);\n this.__$loginLink__ = $loginLink;\n}", "render() {\n const options = [\n { key: 'm', text: 'Mānoa', value: 'Mānoa' },\n { key: 'h', text: 'Hilo', value: 'Hilo' },\n { key: 'ha', text: 'Hawaiʻi', value: 'Hawaiʻi' },\n { key: 'ho', text: 'Honolulu', value: 'Honolulu' },\n { key: 'k', text: 'Kapiʻolani', value: 'Kapiʻolani' },\n { key: 'ka', text: 'Kauaʻi', value: 'Kauaʻi' },\n { key: 'le', text: 'Leeward', value: 'Leeward' },\n { key: 'ma', text: 'Maui', value: 'Maui' },\n { key: 'wi', text: 'Windward', value: 'Windward' },\n { key: 'wo', text: 'West Oʻahu', value: 'West Oʻahu' },\n ];\n\n // if correct authentication, redirect to from: page instead of signup screen\n if (this.state.redirectToReferer) {\n return <Redirect to={'/signin'}/>;\n }\n return (\n <Container>\n <Grid textAlign=\"center\" verticalAlign=\"middle\" centered columns={2}>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\">\n Register your account\n </Header>\n <Form onSubmit={this.handleSubmit} inverted>\n <Segment stacked inverted>\n <Header as=\"h5\" textAlign=\"center\">\n Account Information\n </Header>\n <Form.Input\n label=\"Email\"\n icon=\"user\"\n iconPosition=\"left\"\n required\n name=\"email\"\n type=\"email\"\n placeholder=\"E-mail address\"\n onChange={this.handleChange}\n />\n <Form.Input\n label=\"Password\"\n icon=\"lock\"\n iconPosition=\"left\"\n required\n name=\"password\"\n placeholder=\"Password\"\n type=\"password\"\n onChange={this.handleChange}\n />\n <Form.Input\n label=\"repassword\"\n icon=\"lock\"\n iconPosition=\"left\"\n name=\"repassword\"\n required\n placeholder=\"repassword\"\n type=\"password\"\n onChange={this.handleChange}\n />\n\n <Header as=\"h5\" textAlign=\"center\">\n Student Information\n </Header>\n <Form.Group widths={'equal'}>\n <Form.Input fluid label='First name' placeholder='First name' name=\"firstName\"\n type=\"firstName\"\n onChange={this.handleChange} required/>\n <Form.Input fluid label='Last name' placeholder='Last name' name=\"lastName\"\n type=\"lastName\"\n onChange={this.handleChange} required/>\n </Form.Group>\n <Form.Group widths={'equal'}>\n <Form.Select\n fluid\n label='Campus'\n options={options}\n required\n placeholder='Campus'\n name=\"campus\"\n type=\"campus\"\n onChange={this.handleChange}\n />\n </Form.Group>\n <Form.Button content=\"Submit\"/>\n </Segment>\n </Form>\n <Message color='black'>\n Have an account with us? <Link to=\"/signin\">Sign in</Link>\n </Message>\n\n {this.state.error === '' ? (\n ''\n ) : (\n <Message\n error\n header=\"Registration was not successful\"\n content={this.state.error}\n />\n )}\n </Grid.Column>\n </Grid>\n </Container>\n );\n }", "function register(){ // rencer the register screen, hide main\n document.getElementById(\"main\").style.display = \"none\";\n\tlet src = document.getElementById(\"registerTemplate\").innerHTML;\n\tlet template = Handlebars.compile(src);\n\tlet context = {}; // {{ N/A }}\n\tlet html = template(context);\n\trender(html);\n\tlet registerButton = document.getElementById(\"registerButton\");\n\tregisterButton.addEventListener(\"click\", (e) => {\n\t\te.preventDefault();\n\t\tregisterClick();\n\t});\n}", "render() {\n\t\treturn (\n\t\t\t<SignUp\n\t\t\t\t{...this.props}\n\t\t\t\t{...this.state}\n\t\t\t\tonSubmit={this.handleSubmit}\n\t\t\t\tonBack={this.handleCancel}\n\t\t\t\tonChange={this.handleChange}\n\t\t\t\tonRangeChange={this.handleRangeChange}\n\t\t\t\tonUserSelection={this.handleUserSelection}\n\t\t\t\tonCreate={this.createInterest}\n\t\t\t\tonTodoSelection={this.handleJournoInterestSelection}\n\t\t\t\tonCreateCompany={this.createPrCompany}\n\t\t\t\tonCompanySelection={this.handleCompanySelection}\n\t\t\t\tonCreatePosition={this.createPosition}\n\t\t\t\tonPositionSelection={this.handlePositionSelection}\n\t\t\t\tonChangeSelect={this.onSelectOutlet}\n\t\t\t\tchangeInput={this.onInputChange}\n\t\t\t\tfilterCompany={this.filterCompany}\n\t\t\t\tfilterPosition={this.filterPosition}\n\t\t\t/>\n\t\t);\n\t}", "render() {\n return (\n <div className=\"container dritaContainer\">\n <RegForm\n handleFirstName={this.handleFirstName}\n handleLastName={this.handleLastName}\n handleAddOne={this.handleAddOne}\n handleAddTwo={this.handleAddTwo}\n handleCity={this.handleCity}\n handleState={this.handleState}\n handleZip={this.handleZip}\n handlePhone={this.handlePhone}\n handleEmail={this.handleEmail}\n handlePassword={this.handlePassword}\n // handleInputChange={this.handleInputChange}\n // handleInputChange={this.handleInputChange}\n handleFormSubmit={this.handleFormSubmit}\n />\n <br/>\n </div>\n )\n }", "function display_register_form(id) {\n if(id != null) {\n highlight(id);\n }\n \n var regform =\n \"<div class='formularz'><form method='post' class = 'input'>\";\n regform +=\n \"<h2>Zarejestruj się</h2><input type='text' name='nazwa' placeholder='Nazwa użytkownika' required ><br>\";\n regform +=\n \"<input type='password' name='haslo' placeholder='Hasło' required><br>\";\n regform +=\n \"<input type='button' value='Zarejestruj' onclick='register(this.form)'>\";\n regform += \"</form>\";\n document.getElementById(\"content\").innerHTML = regform;\n}", "function createRegistration(context) {\n if (!validator.isRegFormValid(context.params)) {\n $('input[name=\"password\"]').val('');\n $('input[name=\"repeatPass\"]').val('');\n return;\n }\n\n const username = this.params.username;\n const password = this.params.password;\n\n userModel.register(username, password)\n .then(function (response) {\n userModel.saveSession(response);\n handler.showInfo(`You was register successfully!`);\n\n viewController.renderHomePage(context);\n })\n .catch(userModel.handleError);\n }", "render() {\n return (\n <div id=\"RegistrationScreen\">\n <div id=\"registrationForm\">\n <h1>BUDGHETTO</h1>\n <form action=\"\" onSubmit={this.handleSubmit}>\n <label htmlFor=\"username\">\n Username\n </label>\n <input defaultValue=\"newuser@budghetto.space\" type=\"<strong>email</strong>\" id=\"username\" placeholder=\"example@budghetto.space\"></input>\n <label htmlFor=\"password\">\n Password\n </label>\n <input type=\"password\" id=\"password\" pattern=\"^.{3,}$\"></input>\n <label htmlFor=\"repassword\">\n Retype password\n </label>\n <input type=\"password\" id=\"repassword\"></input>\n <input type=\"submit\" id=\"submit\" value=\"Sign up\"></input>\n </form>\n <input type=\"button\" id=\"cancel\" value=\"Cancel\" onClick={ () => browserHistory.push('/') }/>\n </div>\n </div>\n );\n }", "render() {\n this.eventBusCollector.on(NEWREPOSITORY.fail, newRepositoryView._fail);\n\n super.render({});\n\n const form = document.forms.newRepository;\n\n const nameInput = form['rep-name'];\n\n nameInput.CustomValidation = new CustomValidation(nameInput);\n nameInput.CustomValidation.validityChecks = repNameValidityChecks;\n\n const inputs = this.root.querySelectorAll('input[name=\"rep-name\"]');\n\n const validate = () => {\n inputs.forEach((input) => {\n input.CustomValidation.checkInput();\n });\n };\n\n document.querySelector('button[type=\"submit\"]').addEventListener('click', validate, false);\n this.eventCollector.addEvent(document.querySelector('button[type=\"submit\"]'), 'click', validate, false);\n\n const submitFunc = (e) => {\n validate();\n e.preventDefault();\n const descriptionInputValue = form['rep-description'].value;\n const isPublicInputValue = form['rep-status'].value;\n this.eventBus.emit(NEWREPOSITORY.submit, {\n name: nameInput.value,\n description: descriptionInputValue,\n is_public: (isPublicInputValue === 'public'),\n });\n };\n\n document.forms.newRepository.addEventListener('submit', submitFunc, false);\n this.eventCollector.addEvent(document.forms.newRepository, 'submit', submitFunc, false);\n }", "render() {\n const { canSubmit, username, displayName, email, password, confirmPassword } = this.state;\n const { handlePrev, handleNext, goToSignIn } = this.props;\n\n return (\n <div className='form-container'>\n <Header title='INSCRIPTION' handlePrev={handlePrev} chevronLeft />\n <form action='/auth/signup' method='post'>\n <Input inputText=\"Nom d'utilisateur\"\n type='text'\n name='username'\n value={username.text}\n onChange={(e) => this.handleChange(e)}\n onBlur={this.checkNamesErrors}\n errForm={username.errForm}\n errMsg={username.errMsg} />\n <Input inputText=\"Nom d'affichage\"\n type='text'\n name='displayName'\n value={displayName.text}\n onChange={(e) => this.handleChange(e)}\n onBlur={this.checkNamesErrors}\n errForm={displayName.errForm}\n errMsg={displayName.errMsg} />\n <Input inputText='Email'\n type='email'\n name='email'\n value={email.text}\n onChange={(e) => this.handleChange(e)} />\n <Input inputText='Mot de passe'\n type='password'\n name='password'\n value={password.text}\n onChange={(e) => this.handleChange(e)}\n onBlur={this.checkPasswordsErrors}\n errForm={password.errForm}\n errMsg={password.errMsg} />\n <Input inputText='Confirmer le mot de passe'\n type='password'\n name='confirmPassword'\n value={confirmPassword.text}\n onChange={(e) => this.handleChange(e)}\n onBlur={this.checkPasswordsErrors}\n errForm={confirmPassword.errForm}\n errMsg={confirmPassword.errMsg} />\n <Button\n // disabled={!canSubmit}\n buttonText='Créer un compte'\n // onClick={handleNext}\n type='submit'\n chevronRight />\n </form>\n <p className='sign-link' onClick={goToSignIn}>Déjà enregistré? Se connecter</p>\n </div>\n )\n }", "render() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<h2>{this.state.message}</h2>\n\t\t\t\t<form onSubmit={this.handleSubmit} className='registration-form'>\n\t\t\t\t\t<div className='username'>\n\t\t\t\t\t\t<label htmlFor='username'>Username</label>\n\t\t\t\t\t\t<input type='text' className='input-words' name='username' onChange={this.handleChange} placeholder='Enter Username' />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className='email'>\n\t\t\t\t\t\t<label htmlFor='email'>Email</label>\n\t\t\t\t\t\t<input type='email' className='input-words' name='email' onChange={this.handleChange} placeholder='Enter Email' />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className='password'>\n\t\t\t\t\t\t<label htmlFor='password'>Password</label>\n\t\t\t\t\t\t<input type='password' className='input-words' name='password' onChange={this.handleChange} placeholder='Enter Password' />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className='currentZip'>\n\t\t\t\t\t\t<label htmlFor='currentZip'>Zip Code</label>\n\t\t\t\t\t\t<input type='number' className='input-words' name='currentZip' onChange={this.handleChange} placeholder='Current Zip' />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className='walkabilityImportance'>\n\t\t\t\t\t\t<label htmlFor='walkabilityImportance'>Importance of Walkability</label>\n\t\t\t\t\t\t<input type='number' className='input-numbers' name='walkabilityImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className='medianDesiredAge'>\n\t\t\t\t\t\t<label htmlFor='medianDesiredAge'>Desired Median Age</label>\n\t\t\t\t\t\t<input type='number' className='input-words' name='medianDesiredAge' onChange={this.handleChange} placeholder='Desired Age of Neighbors' />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className='medianAgeImportance'>\n\t\t\t\t\t\t<label htmlFor='medianAgeImportance'>Importance of Neighborhood Age</label>\n\t\t\t\t\t\t<input type='number' className='input-numbers' name='medianAgeImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className='diversityImportance'>\n\t\t\t\t\t\t<label htmlFor='diversityImportance'>Importance of Diversity</label>\n\t\t\t\t\t\t<input type='number' className='input-numbers' name='diversityImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className='houseValueImportance'>\n\t\t\t\t\t\t<label htmlFor='houseValueImportance'>Importance of House Costs to Income</label>\n\t\t\t\t\t\t<input type='number' className='input-numbers' name='houseValueImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className='desiredWeather'>\n\t\t\t\t\t\t<label htmlFor='desiredWeather'>Desired Weather: 1 for Colder, 2 for the Same, 3 for Warmer</label>\n\t\t\t\t\t\t<input type='number' className='input-numbers' name='desiredWeather' onChange={this.handleChange} placeholder='1, 2, or 3' />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className='weatherImportance'>\n\t\t\t\t\t\t<label htmlFor='weatherImportance'>Importance of Weather</label>\n\t\t\t\t\t\t<input type='number' className='input-numbers' name='weatherImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className='nearbyAmenities'>\n\t\t\t\t\t\t<label htmlFor='nearbyAmenities'>Important Things Nearby</label>\n\t\t\t\t\t\t<input type='text' className='input-words' name='nearbyAmenities' min='1' max='5' onChange={this.handleChange} placeholder='What Do You Want To Live Near' />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className='amenitiesImportance'>\n\t\t\t\t\t\t<label htmlFor='amenitiesImportance'>Importance of Those Things</label>\n\t\t\t\t\t\t<input type='number' className='input-numbers' name='amenitiesImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' />\n\t\t\t\t\t</div>\n\t\t\t\t\t<button>Register</button>\n\t\t\t\t</form>\n\t\t\t\t<button onClick={this.props.hideReg}>Already Registered?</button>\n\t\t\t</div>\n\t\t)\n\t}", "render(){\n\t\t\tconsole.log(this.props);\n\t\t\tlet specificFieldsPresent\n\t\t\tconst registered = this.state.registered;\n\t\t\tconsole.log(this.state.specificFields);\n\n\t\t\tif (this.props.specificFields.length > 0) {\n\t\t specificFieldsPresent = true;\n\t\t } else {\n\t\t specificFieldsPresent = false;\n\t\t }\n\t\t console.log(specificFieldsPresent)\n\n\t\t\n\n\t\t\treturn(\n\t\t\t\t<div className=\"container\">\n\n\t\t \t\t\t{registered ? (\n\t\t \t\t\t\t<h5> You are registered for this event! </h5>\n\t\t \t\t\t\t\n\t\t\t\t\t\t):(\n\t\t\t\t\t\t<div className = \"registrationForm\">\n\t\t\t\t\t\t{specificFieldsPresent ? (\n\t\t\t\t\t\t\t<form onSubmit={this.handleSpecificFieldsRegistration}>\n\t\t\t\t\t\t\t\t{this.state.specificFields.map((specificField,idx) =>(\n\t \t\t\t\t\t\t\t\t\t<div className=\"specificFieldDiv\">\n\t \t\t\t\t\t\t\t\t\t\t<SingleInput\n\t \t\t\t\t\t\t\t\t\t\tinputType={'text'}\n\t \t\t\t\t\t\t\t\t\t\ttitle={specificField.fieldName}\n\t \t\t\t\t\t\t\t\t\t\tvalue={specificField.response}\n\t \t\t\t\t\t\n\t \t\t\t\t\t\t\t\t\t\tcontrolFunc={this.handleSpecificResponseChange(idx)}\n\t \t\t\t\t\t\t\t\t\t\t />\n\t \t\t\t\t\t\t\t\t\t</div>\n\n\t \t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t type=\"submit\"\n\t\t\t\t\t\t\t className=\"btn btn-primary float-right\"\n\t\t\t\t\t\t\t value=\"Submit\">\n\n\t\t\t\t\t\t\t Register\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</form>\n\n\t\t\t\t\t\t\t):(\n\t\t\t\t\t\t\t<form onSubmit={this.handleEasyRegistration}>\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t type=\"submit\"\n\t\t\t\t\t\t\t\t className=\"btn btn-primary float-right\"\n\t\t\t\t\t\t\t\t value=\"Submit\">\n\n\t\t\t\t\t\t\t\t Register\n\t\t\t\t\t\t\t\t\t</Button>\t\n\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t)}\t\n\t \t\t\t\t\t\t \n\t\t\t\t</div> \n\t\t\t)\n\t\t}", "function registration_show() {\r\n\t// clear the input fields\r\n\tvar dom = document.getElementById(REGISTRATION_INPUTID_FIRSTNAME);\r\n\tif (dom) { dom.value = ''; }\r\n\tdom = document.getElementById(REGISTRATION_INPUTID_LASTNAME);\r\n\tif (dom) { dom.value = ''; }\r\n\tdom = document.getElementById(REGISTRATION_INPUTID_EMAIL);\r\n\tif (dom) { dom.value = ''; }\r\n\tdom = document.getElementById(REGISTRATION_INPUTID_USER);\r\n\tif (dom) { dom.value = ''; }\r\n\tdom = document.getElementById(REGISTRATION_INPUTID_PASSWORD);\r\n\tif (dom) { dom.value = ''; }\r\n\tdom = document.getElementById(REGISTRATION_INPUTID_PASSWORD1);\r\n\tif (dom) { dom.value = ''; }\r\n\tdom = document.getElementById(REGISTRATION_BUTTONID_SEND);\r\n\tif (dom) { dom.disabled = false; }\r\n\tdom = document.getElementById(REGISTRATION_BUTTONID_LOGIN);\r\n\tif (dom) { dom.disabled = false; }\t\r\n\tdom = document.getElementById(REGISTRATION_OUTPUTID_STATUS);\r\n\tif (dom) {\r\n\t\tdom.innerHTML = '';\r\n\t\tdom.className = 'error error-hidden';\r\n\t}\r\n\t\r\n\t// show the registration form\r\n\tdom = document.getElementById(REGISTRATIONID);\r\n\tif (dom) {\r\n\t\tdom.className = '';\r\n\t}\r\n}", "function renderSignupPage() {\n return `\n\t<section class=\"signup-page-screen\" aria-live=\"assertive\">\n\t\t\t<form role=\"form\" class=\"signup\">\n\t\t\t\t<fieldset name=\"signup-info\">\n\t\t\t\t\t<div class=\"login-header\">\n <legend>Sign Up</legend>\n <hr class=\"style-two\">\n\t\t\t\t </div>\n\t\t\t\t <p id='notification'></p>\n\t\t\t\t\t<label for=\"email\" required>Email</label>\n\t\t\t\t\t<input type=\"email\" name=\"email\" id=\"email\" placeholder=\"Email address\" required=\"\">\n\t\t\t\t\t<label for=\"password\" required>Password</label>\n\t\t\t\t\t<input type=\"password\" name=\"password\" id=\"password\" placeholder=\"Password\" required>\n\t\t\t\t\t<label for=\"password-confirm\" required>Confirm password</label>\n\t\t\t\t\t<input type=\"password\" name=\"password\" id=\"password-confirm\" placeholder=\"Confirm password\" required >\n\t\t\t\t</fieldset>\n\t\t\t\t<button type=\"submit\" class=\"js-signup-button\">Sign up</button>\n <p>Already have an account? <a href=\"#\" class=\"nav-login\">Log in</p></a>\n\t\t\t</form>\n\t\t</section>\n\t`;\n}", "render() {\n return (\n <div className=\"col-sm-5 col-xs-12 registration_main\">\n <div className=\"registration_head\">\n <span>Vous souhaitez tester notre plateforme ?</span>\n <Link to=\"/register\" className=\"btn-primary login\">Demander une démo</Link>\n </div>\n <div className=\"registration_con\">\n <span className=\"logo\"><img src={logoImg} className=\"img-responsive\" alt=\"visiretail\" /> </span>\n <h1>Simplifiez le déploiement de votre marketing digital</h1>\n <div className=\"form_main\">\n <form action=\"#/app/home\">\n <div className=\"form_raw\">\n <label>Username</label>\n <input type=\"text\" className=\"form-control\" required />\n </div>\n <div className=\"form_raw\">\n <label> Mot de passe</label>\n <input type=\"password\" className=\"form-control\" required />\n </div>\n <button className=\"btn-primary\">connexion</button>\n <a href=\"#\" className=\"fogot\">Mot de passe oublié ?</a>\n </form>\n </div>\n </div>\n </div>\n );\n }", "function renderizaOk() {\n const nomeOk = criaP();\n const userOk = criaP();\n const senhaOk = criaP();\n const titulo = document.createElement('h3');\n render();\n\n // Renderizando as Informações do Usuário\n function render() {\n nomeOk.innerHTML = `<b>Nome</b> : ${inputNome.value.trim()}`;\n userOk.innerHTML = `<b>Username</b> : ${inputUser.value}`;\n senhaOk.innerHTML = `<b>Senha</b> : ${inputSenha.value}`;\n titulo.innerText = 'Usuário criado com sucesso!';\n\n divRenderiza.appendChild(titulo);\n divRenderiza.appendChild(nomeOk);\n divRenderiza.appendChild(userOk);\n divRenderiza.appendChild(senhaOk);\n }\n }", "render() {\r\n return (\r\n <div className=\"container\">\r\n <hr className=\"mt-5\"></hr>\r\n <h3 className=\"text-primary text-center\">Get Started with Registration</h3>\r\n\r\n {/* JSX for showing progress bar start */}\r\n <div className=\"container text-center mt-4\">\r\n <hr className=\"\" style={{ border: '1px dotted blue', width: '66%', marginTop: '5%' }}></hr>\r\n <div className=\"row\" style={{ marginTop: '-3.5%' }}>\r\n <div className=\"col-md-4\">\r\n <span className=\"fa-stack fa-lg\">\r\n <i className=\"fa fa-circle fa-stack-2x text-primary bg-white\"></i>\r\n <span className=\"fa-stack-1x fa-inverse\">1</span>\r\n </span>\r\n <p>YOUR DETAILS</p>\r\n </div>\r\n <div className=\"col-md-4\">\r\n <span className=\"fa-stack fa-lg\">\r\n <i className=\"far fa-circle fa-stack-2x text-primary bg-white\"></i>\r\n <span className=\"fa-stack-1x fa-inverse text-primary\">2</span>\r\n </span>\r\n <p>VERIFY</p>\r\n </div>\r\n <div className=\"col-md-4\">\r\n <span className=\"fa-stack fa-lg \">\r\n <i className=\"far fa-circle fa-stack-2x text-primary bg-white\"></i>\r\n <span className=\"fa-stack-1x fa-inverse text-primary\">3</span>\r\n </span>\r\n <p>BUSINESS DETAILS</p>\r\n </div>\r\n </div>\r\n </div>\r\n {/* JSX for showing progress bar end */}\r\n\r\n <div className=\"card mt-4 shadow\">\r\n <div className=\"card-body\">\r\n\r\n {/* JSX for showing form input and select option fields start */}\r\n <form className=\"container\" onSubmit={this.handleFormSubmit} onClick={this.checkPassword}>\r\n <div className=\"row\">\r\n <div className=\"col-md-6\">\r\n <Input\r\n type={'text'}\r\n title={'First Name'}\r\n value={this.state.registration.firstName.value}\r\n touched={this.state.registration.firstName.touched}\r\n valid={this.state.registration.firstName.valid}\r\n changed={this.handleChange}\r\n name={'firstName'} />\r\n </div>\r\n <div className=\"col-md-6\">\r\n <Input\r\n type={'text'}\r\n title={'Last Name'}\r\n value={this.state.registration.lastName.value}\r\n changed={this.handleChange}\r\n touched={this.state.registration.lastName.touched}\r\n valid={this.state.registration.lastName.valid}\r\n name={'lastName'} />\r\n </div>\r\n <div className=\"col-md-6\">\r\n <Input\r\n type={'text'}\r\n title={'Company Email(Username)'}\r\n value={this.state.registration.userName.value}\r\n changed={this.handleChange}\r\n touched={this.state.registration.userName.touched}\r\n valid={this.state.registration.userName.valid}\r\n name={'userName'} />\r\n </div>\r\n <div className=\"col-md-6\">\r\n <Input\r\n type={'text'}\r\n title={'Company Name'}\r\n value={this.state.registration.companyName.value}\r\n touched={this.state.registration.companyName.touched}\r\n valid={this.state.registration.companyName.valid}\r\n changed={this.handleChange}\r\n name={'companyName'} />\r\n </div>\r\n <div className=\"col-md-6\">\r\n <Input\r\n type={'password'}\r\n title={'Password'}\r\n value={this.state.registration.password.value}\r\n touched={this.state.registration.password.touched}\r\n valid={this.state.registration.password.valid}\r\n changed={this.handleChange}\r\n name={'password'} />\r\n </div>\r\n <div className=\"col-md-6\">\r\n <Input\r\n type={'password'}\r\n title={'Confirm Password'}\r\n value={this.state.registration.confirmPassword.value}\r\n touched={this.state.registration.confirmPassword.touched}\r\n valid={this.state.registration.confirmPassword.valid}\r\n changed={this.handleChange}\r\n name={'confirmPassword'} />\r\n </div>\r\n </div>\r\n <center><span className=\"text-danger\">*</span>These fields are required</center>\r\n <Button title={'NEXT'} type=\"submit\" disab={!this.state.formIsValid}></Button>\r\n </form>\r\n {/* JSX for showing form input and select option fields end */}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n }", "async function create(req, res) {\n res.render(\"register\");\n}", "render() {\n return (\n <div className=\"registration-page\">\n\n <RegisterForm \n handleChanges={this.handleChanges}\n submitLogin={this.handleSubmit}\n login={this.state.login}\n />\n\n <div className=\"view-bottom-image\">\n <img src=\"../images/refugee7.png\" alt=\"Syrian Refugees coming ashore in a boat\"/>\n </div>\n\n </div> \n );\n }", "function registrationsNew(req, res) {\n res.render('registrations/new'); // render this to the screen\n}", "generateUserDetailForm() {\n const { formValidationStates, formFields, isCreating } = this.state;\n\n return (\n <Panel>\n <Panel.Heading>\n <Panel.Title componentClass=\"h3\">2. Fill out your details</Panel.Title>\n </Panel.Heading>\n <Panel.Body>\n <form onSubmit={this.handleSubmit.bind(this)}>\n <FormGroup controlId={USERNAME_ID}>\n <ControlLabel>Username</ControlLabel>\n <FormControl type={\"text\"} value={formFields[USERNAME_ID]} disabled />\n </FormGroup>\n <RegisterFormField\n id={FIRST_NAME_ID}\n validationState={formValidationStates[FIRST_NAME_ID]}\n handleChange={this.handleChange.bind(this, FIRST_NAME_ID)}\n name={\"First Name\"}\n type={\"text\"}\n placeholder={\"Enter your first name\"}\n maxLength={FIRST_NAME_LENGTH_MAX}\n />\n <RegisterFormField\n id={LAST_NAME_ID}\n validationState={formValidationStates[LAST_NAME_ID]}\n handleChange={this.handleChange.bind(this, LAST_NAME_ID)}\n name={\"Last Name\"}\n type={\"text\"}\n placeholder={\"Enter your last name\"}\n maxLength={LAST_NAME_LENGTH_MAX}\n />\n <FormGroup controlId={PASSWORD_ID} validationState={formValidationStates[PASSWORD_ID]}>\n <span>\n <ControlLabel>Password</ControlLabel>\n <OverlayTrigger trigger={['hover', 'focus']} placement=\"top\"\n overlay={Register.generatePasswordPopover()}>\n <Glyphicon glyph=\"info-sign\" style={{ paddingLeft: '5px' }}/>\n </OverlayTrigger>\n </span>\n <FormControl\n type={\"password\"}\n placeholder={\"Enter a password\"}\n onChange={this.handleChange.bind(this, PASSWORD_ID)}\n required={true}\n minLength={PASSWORD_LENGTH_MIN}\n maxLength={PASSWORD_LENGTH_MAX}\n />\n </FormGroup>\n <RegisterFormField\n id={CONFIRM_PASSWORD_ID}\n validationState={formValidationStates[CONFIRM_PASSWORD_ID]}\n handleChange={this.handleChange.bind(this, CONFIRM_PASSWORD_ID)}\n name={\"Confirm Password\"}\n type={\"password\"}\n placeholder={\"Enter your password again\"}\n minLength={PASSWORD_LENGTH_MIN}\n maxLength={PASSWORD_LENGTH_MAX}\n />\n <div className={\"buttonContainer\"}>\n <div style={{ paddingRight: '10px' }}>\n <Button onClick={this.onChangeUsername.bind(this)}>Change Username</Button>\n </div>\n <Button bsStyle=\"primary\" type=\"submit\" disabled={isCreating}>\n { isCreating ? 'Registering...' : 'Register' }\n </Button>\n </div>\n </form>\n </Panel.Body>\n </Panel>\n )\n }", "function renderUserPage(type) {\n switch (type) {\n case 'register':\n return [\n '<section>',\n '<h2>Registreren</h2>',\n '<form method=\"post\" action=\"/user/register\" class=\"user-form\">',\n '<fieldset>',\n '<label>',\n 'Gebruikersnaam',\n '<input type=\"text\" name=\"username\">',\n '</label>',\n '<label>',\n 'Wachtwoord',\n '<input type=\"password\" name=\"password\">',\n '</label>',\n '<label>',\n 'Herhaal wachtwoord',\n '<input type=\"password\" name=\"passwordcopy\">',\n '</label>',\n '<input type=\"submit\">',\n '</fieldset>',\n '<fieldset>',\n '<p>Al een account? <a href=\"/user/login\">Log in</a>!</p>',\n '</fieldset>',\n '</form>',\n '</section>'\n ].join('\\n');\n break;\n case 'login':\n return [\n '<section>',\n '<h2>Inloggen</h2>',\n '<form method=\"post\" action=\"/user/login\" class=\"user-form\">',\n '<fieldset>',\n '<label>',\n 'Gebruikersnaam',\n '<input type=\"text\" name=\"username\">',\n '</label>',\n '<label>',\n 'Wachtwoord',\n '<input type=\"password\" name=\"password\">',\n '</label>',\n '<input type=\"submit\">',\n '</fieldset>',\n '<fieldset>',\n '<p>Nog geen account? <a href=\"/user/register\">Registreer</a>!</p>',\n '</fieldset>',\n '</form>',\n '</section>'\n ].join('\\n');\n break;\n }\n}", "function showPersonForm(req, res){\n res.render('add-person.ejs');\n}", "fill_the_mandatory_fields_for_registration(){\n Action.setValueInTextBox(this.lastName,\"Last Name\",faker.randomString(6));\n Action.setValueInTextBox(this.firstName,\"First Name\",faker.randomString(6));\n Action.selectDropdown(this.legalSex, \"Legal Sex\", 'Male', 'VisibleText');\n Action.setValueInTextBox(this.dob, \"DOB\", 't-20');\n Action.setValueInTextBox(this.homePhone, \"Home Phone\", faker.randomNumber(10));\n Action.setValueInTextBox(this.mobilePhone, \"Mobile Phone\", faker.randomNumber(10));\n Action.setValueInTextBox(this.patientEmail, \"Patient Email\", faker.randomMail());\n Action.selectRadioButton(this.consentToText, \"Consent To Text\", 'No');\n Action.selectDropdown(this.usualProvider, \"Usual Provider\", 'Carolan_M', 'VisibleText');\n Action.selectRadioButton(this.consentToCall, \"Consent To Call\", 'No');\n Action.selectDropdown(this.guarantorRelationship, \"Guarantor Relationship\", 'Self','VisibleText');\n }", "function showRegister(req, res){\n \n var userstat_si_so=\"<a class=\\\"index\\\" id=\\\"signin\\\" href=\\\"/login\\\">התחבר</a>\";\n var userstat_su_un=\"<a class=\\\"index\\\" id=\\\"signup\\\" href=\\\"/register\\\">הרשם</a>\"+\" | \";\n \n //check if the user is conected\n if (req.isAuthenticated()){\n userstat_su_un = \" שלום \"+req.user.local.username+\" | \";\n userstat_si_so = \"<a class=\\\"index\\\" id=\\\"signout\\\" href=\\\"/logout\\\">התנתק</a>\";\n \n res.render('pages/register', {message: req.flash('signupMessage'),userstat_su_un:userstat_su_un ,userstat_si_so:userstat_si_so});\n// ,'errors: req.flash('errors')});\n // res.render('pages/register', {userstat_su_un:userstat_su_un ,userstat_si_so:userstat_si_so,\n // errors: req.flash('errors'),message: req.flash('signupMessage')});\n }\n \n // return a view with data in case user didn't connect\n else{\n \n res.render('pages/register', {message: req.flash('signupMessage'), userstat_su_un: userstat_su_un ,userstat_si_so:userstat_si_so });\n// ,errors: req.flash('errors') });\n }\n//\tres.render('pages/register', {\n// \t\terrors: req.flash('errors')\n// \t});\n}", "render() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<form onSubmit={this.handleSubmit}>\t\t\t \n\t\t\t\t <label>\n\t\t\t\t Email:\n\t\t\t\t <input id=\"username\" type=\"text\" name=\"email\" onKeyUp={this.handleChange} />\n\t\t\t\t </label>\n\t\t\t\t <label>\n\t\t\t\t Password:\n\t\t\t\t <input id=\"password\" type=\"password\" name=\"password\" onKeyUp={this.handleChange} />\n\t\t\t\t </label>\n\t\t\t\t <input type=\"submit\" value=\"Submit\" />\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t\t);\n\t\t}", "function renderForm() {\n userForm.appendChild(formElem);\n\n labelElem.setAttribute('for', 'username');\n labelElem.innerText = \"Enter Name:\";\n formElem.appendChild(labelElem);\n\n inputElem.setAttribute('id', 'username');\n inputElem.setAttribute('type', 'text');\n formElem.appendChild(inputElem);\n\n submit.textContent = \"Start Game\";\n submit.setAttribute('value', 'Start Game');\n formElem.appendChild(submit);\n}", "function createRegistration(context) {\n if (!validator.isRegFormValid(context.params)) {\n $('input[name=\"password\"]').val('');\n $('input[name=\"repeatPass\"]').val('');\n return;\n }\n\n const userData ={\n username: context.params.username,\n password: context.params.password,\n email: context.params.email,\n avatarUrl: context.params.avatarUrl\n };\n\n userModel.register(userData)\n .then(function (response) {\n userModel.saveSession(response);\n handler.showInfo(`User registration successful.`);\n context.redirect('#/home');\n })\n .catch(handler.handleError);\n }", "function RegistrationForm(props) {\n // Updates the state with the inputted values from the registration form\n function update(ev) {\n let tgt = $(ev.target);\n let data = {};\n data[tgt.attr('name')] = tgt.val();\n props.dispatch({\n type: 'UPDATE_REGISTRATION_FORM',\n data: data,\n });\n }\n\n // Sends a request to create a user with the values from the form\n function submit(ev) {\n api.create_user(props.form);\n }\n\n // Clears and closes the registration form\n function cancel() {\n props.dispatch({\n type: 'CLEAR_FORM',\n });\n $(\"#registration\").hide();\n $(\"#login\").show();\n }\n\n return (\n <div>\n <div className=\"container\" id=\"registration\">\n <FormGroup>\n <Input type=\"email\" className=\"form-control\" name=\"email\"\n placeholder=\"email\" required=\"\" autoFocus=\"\"\n value={props.form.email} onChange={update} />\n <Input type=\"text\" className=\"form-control\" name=\"name\"\n placeholder=\"full name\" required=\"\"\n value={props.form.name} onChange={update} />\n <Input type=\"text\" className=\"form-control\" name=\"username\"\n placeholder=\"username\" required=\"\"\n value={props.form.username} onChange={update} />\n <Input type=\"password\" className=\"form-control\" name=\"password\"\n placeholder=\"password\" required=\"\"\n value={props.form.password} onChange={update} />\n <InputGroup>\n <InputGroupAddon addonType=\"prepend\">$</InputGroupAddon>\n <Input type=\"number\" className=\"form-control\" name=\"budget\"\n placeholder=\"budget\" step=\"100\" min=\"0\" onChange={update} />\n </InputGroup>\n <br />\n <Button className=\"btn btn-lg btn-primary btn-block\"\n onClick={submit}>\n SUBMIT\n </Button>\n <br />\n <p><a href=\"javascript:void(0)\" onClick={cancel}>Cancel</a></p>\n </FormGroup>\n </div>\n </div>\n );\n}", "render(){\n return(\n <div>\n {this.state.name}<br />\n {this.state.email}<br />\n {this.state.password}<br />\n {this.state.logEmail}<br />\n {this.state.logPassword}<br />\n <br />\n \n SignUp check\n \n </div>\n )\n }", "render() {\n const { value } = this.state;\n if (this.state.finished) {\n return <Redirect to=\"/userhome\"/>;\n }\n return (\n <Container className=\"signup-format\">\n <Grid textAlign=\"center\" verticalAlign=\"middle\" centered columns={2}>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\" inverted>\n <p className=\"consistent-font\">Register your account</p>\n </Header>\n <Form onSubmit={this.handleSubmit} color='black' inverted>\n <Segment stacked inverted>\n <Form.Input\n label=\"Email\"\n icon=\"user\"\n iconPosition=\"left\"\n name=\"email\"\n type=\"email\"\n placeholder=\"E-mail address\"\n onChange={this.handleChange}\n />\n <Form.Input\n label=\"Password\"\n icon=\"lock\"\n iconPosition=\"left\"\n name=\"password\"\n placeholder=\"Password\"\n type=\"password\"\n onChange={this.handleChange}\n />\n <Form.Field>\n <Dropdown placeholder='Are you a customer or a vendor?'\n name=\"role\"\n type=\"role\"\n fluid\n selection\n options={roleOption}\n value={value}\n onChange={this.handleChange}/>\n </Form.Field>\n <Form.Button content=\"Submit\"/>\n </Segment>\n </Form>\n <Message className=\"consistent-font\" color='black' inverted=\"true\">\n Already have an account? Login <Link to=\"/signin\">here</Link>\n </Message>\n {this.state.error === '' ? (\n ''\n ) : (\n <Message\n error\n header=\"Registration was not successful\"\n content={this.state.error}\n />\n )}\n </Grid.Column>\n </Grid>\n </Container>\n );\n }", "render() {\n return (\n <div>\n <div className='container'>\n <div className='form-div'>\n <center>\n <h1><b>SignUp</b></h1>\n </center>\n <form onSubmit={this.onSubmit}>\n <input type=\"text\"\n placeholder=\"Full Name\"\n onChange={this.changeFullName}\n value={this.state.fullName}\n className='form-control form-group'\n />\n <input type='text'\n placeholder='Username'\n onChange={this.changeUserName}\n value={this.state.username}\n className=\"form-control form-group\"\n />\n\n <input type='email'\n placeholder='Email'\n onChange={this.changeEmail}\n value={this.state.email}\n className=\"form-control form-group\"\n />\n\n <input type='password'\n placeholder='Password'\n onChange={this.changePassword}\n value={this.state.password}\n className=\"form-control form-group\"\n />\n\n <input type='submit' className=\"'btn btn-danger btn block\" value='Submit' />\n\n </form>\n </div>\n </div>\n </div>\n );\n }", "render() {\n //put the state in the variable; instead of using this.state for each variable\n const {username, password, firstname, lastname, email, phone, address} = this.state\n return (\n <div class=\"form-container\">\n <form>\n <div style={{ marginTop: 100 }}>\n <h3>User Registration</h3>\n </div>\n <div>\n <label>First Name</label>\n <input type = \"text\" value={firstname} onChange={this.handlerFirstnameChange}/>\n </div>\n <div>\n <label>Username</label>\n <input type = \"text\" value={username} onChange={this.handlerLastnameChange}/>\n </div>\n <div>\n <label>Phone no. </label>\n <input type = \"text\" value={phone} onChange={this.handlerPhoneChange}/>\n </div>\n <div>\n <label>Email </label>\n <input type = \"text\" value={email} onChange={this.handlerEmailChange}/>\n </div>\n <div>\n <label>Address </label>\n <input type = \"text\" value={address} onChange={this.handlerAddressChange}/>\n </div>\n <div>\n <label>Password </label>\n <input type = \"password\" value ={password} onChange={this.handlerPasswordChange}/>\n </div>\n <button onClick={this.handleSubmit}>Submit</button>\n <button onClick={this.handleHome}>Home</button>\n </form>\n </div>\n );\n }", "afterRender() {\n document.forms['signupForm'].addEventListener('submit', (e) => {\n e.preventDefault();\n\n const birthDate = new Date(e.target.elements['birthDate'].value);\n const userData = {\n email: e.target.elements['email'].value,\n password: e.target.elements['password'].value,\n nickname: e.target.elements['nickname'].value,\n first_name: e.target.elements['firstName'].value,\n last_name: e.target.elements['lastName'].value,\n phone: e.target.elements['phone'].value,\n gender_orientation: e.target.elements['gender'].value,\n city: e.target.elements['city'].value,\n country: e.target.elements['country'].value,\n date_of_birth_day: birthDate.getDate(),\n date_of_birth_month: birthDate.getMonth() + 1,\n date_of_birth_year: birthDate.getFullYear(),\n };\n\n // prevent sending an http-request to the server if not all user data is provided\n for (let key in userData) {\n if (!userData[key]) return;\n }\n\n this._authService.signup(userData)\n .then((response) => {\n console.log(response);\n })\n .catch((err) => {\n console.log(err);\n });\n });\n }", "render(){\n //generate props to pass to UI\n const props = this._generateProps()\n\n return( <SignupForm { ...props } submitHandler = {this.submitHandler} handleChange = {this.handleChange}/>);\n }", "render() {\r\n return(ViewsiteFormJSX.call(this));\r\n }", "render() {\n return (\n <div className=\"pageSetup\">\n <div id=\"LoginFormDiv\">\n <div id=\"LoginFormWithoutFooter\">\n <div id=\"MainPageTitle\"><a id=\"LoginPageTitle\" href=\"#/portal\">HARMONI</a></div>\n <div className={\"wrapper\"}>\n <div className={\"registerContainer\"}>\n <div className=\"card RegisterPageCard\">\n <div className=\"card-body\">\n <h1 id={\"regTitle\"}>Registrer</h1>\n <form>\n <div className=\"form-group\" id=\"RegisterPageFormGroup\">\n <div id=\"RegisterPageFormFieldsDiv\">\n <label htmlFor=\"exampleInputEmail1\">Navn: </label>\n <input type=\"name\" name={\"name\"} className=\"form-control\"\n id=\"firstNameInput\"\n onChange={this.handleTextChange.bind(this)}\n aria-describedby=\"emailHelp\" placeholder=\"Navn...\"\n onKeyPress={this.keyPressed}/>\n </div>\n <div id=\"RegisterPageFormFieldsDiv\">\n <label htmlFor=\"exampleInputEmail1\">E-post: </label>\n <input type=\"email\" name={\"email\"} className=\"form-control\"\n id=\"emailInput\"\n onChange={this.handleTextChange.bind(this)}\n aria-describedby=\"emailHelp\" placeholder=\"E-post...\"\n onKeyPress={this.keyPressed}/>\n </div>\n <div id=\"RegisterPageFormFieldsDiv\">\n <label htmlFor=\"exampleInputEmail1\">Telefon:</label>\n <input type=\"tel\" pattern={\"[0-9]{8}\"} name={\"phone\"}\n className=\"form-control\" id=\"exampleInputEmail1\"\n onChange={this.handleTextChange.bind(this)}\n aria-describedby=\"emailHelp\" placeholder=\"Telefon...\"\n onKeyPress={this.keyPressed}/>\n </div>\n <div id=\"RegisterPageFormFieldsDiv\">\n <label htmlFor=\"exampleInputEmail1\">Profilbilde:</label>\n <input type=\"file\" id={\"imageUpload\"}\n accept={\"image/jpeg, image/jpg, image/png\"}/>\n </div>\n <div id=\"RegisterPageFormFieldsDiv\">\n <label htmlFor=\"exampleInputPassword1\">Passord:</label>\n <input type=\"password\" name=\"password\" className=\"form-control\"\n className=\"passwordInput\"\n onChange={this.handleTextChange.bind(this)}\n placeholder=\"Passord...\" onKeyPress={this.keyPressed}/>\n </div>\n <div id=\"RegisterPageFormFieldsDiv\">\n <label htmlFor=\"exampleInputPassword1\">Gjenta passord:</label>\n <input type=\"password\" name={\"repeatedPassword\"}\n className=\"form-control\" className=\"passwordInput\"\n onChange={this.handleTextChange.bind(this)}\n placeholder=\"Gjenta passord...\"\n onKeyPress={this.keyPressed}/>\n </div>\n <div id=\"RegisterPageFormButtonDiv\">\n <button type=\"button\"\n className={\"login-button\"}\n className=\"btn btn-outline-dark\"\n onClick={this.regUser.bind(this)}\n disabled={this.state.name === \"\" || this.state.email === \"\"\n || this.state.phone === \"\" || this.state.password === \"\" || this.state.repeatedPassword === \"\"}>Registrer\n </button>\n <button type=\"button\" className={\"login-button\"} className=\"btn btn-outline-dark\"\n onClick={() => window.location.href = \"#/login\"}>\n Logg inn\n </button>\n </div>\n </div>\n </form>\n\n </div>\n </div>\n </div>\n </div>\n </div>\n <div>\n <FooterTransparent/>\n </div>\n </div>\n </div>\n );\n }", "render () {\n return (\n <form noValidate autoComplete=\"new-password\">\n <NoAutofillHack />\n {this.fields.map(this.renderField)}\n <div>\n <Button variant=\"raised\" onClick={this.handleSubmit}>Submit</Button>\n </div>\n </form>\n )\n }", "render() {\n\n\t\t// Create array of Field components from referenced by key\n\t\tvar fields = [];\n\t\tfor (var key in this.props.form.fields) {\n\t\t\tfields.push(\n\t\t\t\t<Field field={this.props.form.fields[key]} key={key} ref={key} />\n\t\t\t);\n\t\t}\n\t\t// Render view\n\t\treturn (\n\t\t\t<div className=\"row\">\n\t\t\t\t<h2>{this.props.form.title}</h2>\n\t\t\t\t<form onSubmit={this.handleSubmit}>\n\t\t\t\t\t{fields}\n\t\t\t\t\t{ this.state.errorMessage\n\t\t\t\t\t\t? <div className=\"errorMessage\">{this.state.errorMessage}</div>\n\t\t\t\t\t\t: null }\n\t\t\t\t\t<input type=\"submit\" className=\"submit\" value={this.state.buttonText} />\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t);\n \t}", "renderField(){\n const errors = this.validateForm(this.state);\n const { email, password } = errors;\n const { emailTouched, passwordTouched } = this.state.touched;\n const { submitRequest } = this.state;\n\n return (\n <form className='form' onSubmit={this.sumbitForm.bind(this)}>\n <fieldset className='form-container'>\n <h1 className='form-title'>Register</h1>\n <div className='form-control'>\n <label className='label-text'>Email:</label>\n <input\n type=\"text\"\n value={this.state.email}\n onBlur={this.handleBlur('emailTouched')}\n onChange={(e) => this.setState({ email: e.target.value})}\n />\n <p className='has-error'>{emailTouched || submitRequest ? email : ''}</p>\n </div>\n <div className='form-control'>\n <label className='label-text'>Password:</label>\n <input\n type='password'\n value={this.state.password}\n onBlur={this.handleBlur('passwordTouched')}\n onChange={(e) => this.setState({ password: e.target.value})}\n />\n <p className='has-error'>{passwordTouched || submitRequest ? password : ''}</p>\n </div>\n <button className='button-submit' type='submit'>Register</button>\n <p className='register-back-text'>You already have an account? Click\n <Link to='/'> here </Link>\n to login</p>\n </fieldset>\n </form>\n )\n }", "function showRegistration() {\n $('#login-logo').show();\n $('nav').hide();\n $('section').hide();\n $('input').removeClass('error');\n $('input').val('');\n $(REGISTER_CONTENT).show();\n}", "function registerPage() {\n\t\tsignPg.style.display = \"none\"\n\t\tregPg.style.display = \"block\";\n\t\tmyOutput.style.display = \"none\";\n\n\t\t//Create the captcha\n\t\tgenerateCaptcha();\n\t}", "function RegistrationPage() {\n return (\n <div>\n <Form1 />\n </div>\n )\n}", "render() {\n return (\n <div>\n <h4>Signup</h4>\n <TextField name=\"name\" floatingLabelText=\"Name\" value={this.state.name} onChange={this.setProperty} errorText={this.usernameValid()}/>\n <TextField name=\"email\" floatingLabelText=\"Email\" value={this.state.email} onChange={this.setProperty}/>\n <TextField name=\"password\" floatingLabelText=\"Password\" type=\"password\" value={this.state.password} onChange={this.setProperty}/>\n <RaisedButton label=\"Sign Up\" onClick={this.signUp}/>\n <pre>{JSON.stringify(this.state.response, null, 2)}</pre>\n <ButtonLink to=\"/welcome\">Back</ButtonLink>\n </div>\n )\n }", "renderExtraFields() {\r\n if (this.props.formType === \"Sign Up\") return (\r\n <>\r\n <label htmlFor=\"form-email\">Email:</label>\r\n <input id=\"form-email\" type=\"email\"\r\n placeholder=\"Email\"\r\n //value={this.state.email}\r\n onChange={this.handleChange(\"email\")}\r\n />\r\n\r\n <label htmlFor=\"form-firstName\">First Name:</label>\r\n <input id=\"form-firstName\" type=\"text\"\r\n placeholder=\"First name\"\r\n //value={this.state.firstName}\r\n onChange={this.handleChange(\"firstName\")}\r\n />\r\n\r\n <label htmlFor=\"form-lastName\">Last Name:</label>\r\n <input id=\"form-lastName\" type=\"text\"\r\n placeholder=\"Last name\"\r\n //value={this.state.lastName}\r\n onChange={this.handleChange(\"lastName\")}\r\n />\r\n </>\r\n );\r\n }", "render(){\n // todo add the components\n return( <LoginForm/>);\n \n // Todo add the Form \n }", "render () {\n let formType = this.props.formType\n\n let options = {\n fields: {\n }\n }\n\n let username = {\n label: I18n.t('LoginForm.username'),\n maxLength: 12,\n editable: !this.props.form.isFetching,\n hasError: this.props.form.fields.usernameHasError,\n error: this.props.form.fields.usernameErrorMsg\n }\n\n let nationalid = {\n label: I18n.t('LoginForm.nationalid'),\n maxLength: 14,\n editable: !this.props.form.isFetching,\n hasError: this.props.form.fields.nationalidHasError,\n error: this.props.form.fields.nationalidErrorMsg\n }\n\n let mobile = {\n label: I18n.t('LoginForm.mobile'),\n maxLength: 11,\n editable: !this.props.form.isFetching,\n hasError: this.props.form.fields.mobileHasError,\n error: this.props.form.fields.mobileErrorMsg\n }\n //SAVED FOR LATER\n let country = {\n label: I18n.t('Country.label'),\n\n }\n\n\n\n let email = {\n label: I18n.t('LoginForm.email'),\n keyboardType: 'email-address',\n editable: !this.props.form.isFetching,\n hasError: this.props.form.fields.emailHasError,\n error: this.props.form.fields.emailErrorMsg\n }\n\n let secureTextEntry = !this.props.form.fields.showPassword\n\n let password = {\n label: I18n.t('LoginForm.password'),\n maxLength: 12,\n secureTextEntry: secureTextEntry,\n editable: !this.props.form.isFetching,\n hasError: this.props.form.fields.passwordHasError,\n error: this.props.form.fields.passwordErrorMsg\n }\n\n let passwordAgain = {\n label: I18n.t('LoginForm.password_again'),\n secureTextEntry: secureTextEntry,\n maxLength: 12,\n editable: !this.props.form.isFetching,\n hasError: this.props.form.fields.passwordAgainHasError,\n error: this.props.form.fields.passwordAgainErrorMsg\n }\n\n let loginForm;\n switch (formType) {\n /**\n * ### Registration\n * The registration form has 4 fields\n */\n case (REGISTER):\n loginForm = t.struct({\n //country: t.String,\n nationalid: t.String,\n email: t.String,\n mobile: t.String,\n password: t.String,\n passwordAgain: t.String\n });\n\n //options.fields['country'] = country\n //options.fields['country'].placeholder = I18n.t('Country.label')\n //options.fields['country'].autoCapitalize = 'none'\n options.fields['nationalid'] = nationalid\n options.fields['nationalid'].placeholder = I18n.t('LoginForm.nationalid')\n options.fields['nationalid'].autoCapitalize = 'none'\n options.fields['mobile'] = mobile\n options.fields['mobile'].placeholder = I18n.t('LoginForm.mobile')\n options.fields['mobile'].autoCapitalize = 'none'\n options.fields['email'] = email\n options.fields['email'].placeholder = I18n.t('LoginForm.email')\n options.fields['email'].autoCapitalize = 'none'\n options.fields['password'] = password\n options.fields['password'].placeholder = I18n.t('LoginForm.password')\n options.fields['passwordAgain'] = passwordAgain\n options.fields['passwordAgain'].placeholder = I18n.t('LoginForm.password_again')\n break\n\n /**\n * ### Login\n * The login form has only 2 fields\n */\n case (LOGIN):\n loginForm = t.struct({\n email: t.String,\n password: t.String\n })\n options.fields['email'] = email\n options.fields['email'].placeholder = I18n.t('LoginForm.email')\n options.fields['email'].autoCapitalize = 'none'\n options.fields['password'] = password\n options.fields['password'].placeholder = I18n.t('LoginForm.password')\n break\n\n /**\n * ### Reset password\n * The password reset form has only 1 field\n */\n case (FORGOT_PASSWORD):\n loginForm = t.struct({\n email: t.String\n })\n options.fields['email'] = email\n options.fields['email'].autoCapitalize = 'none'\n options.fields['email'].placeholder = I18n.t('LoginForm.email')\n break\n } // switch\n /**\n * ### Return\n * returns the Form component with the correct structures\n */\n return <View>\n <Form\n ref='form'\n type={loginForm}\n options={options}\n value={this.props.value}\n onChange={this.props.onChange}\n />\n </View>\n }", "render() {\n return (\n <div className=\"signup_reg_page\">\n <form className=\"Form\" onSubmit={this.handleSubmit}>\n <h2>Login to your account</h2>\n <hr />\n <h3> Sign In to Get access to the shops. </h3>\n <div className=\"form-group \">\n <label htmlFor=\"email\">Email address</label>\n <input\n type=\"email\"\n className=\"form-control\"\n name=\"email\"\n placeholder=\"Email\"\n value={this.state.email}\n onChange={this.handleUserInput}\n />\n </div>\n <div className=\"form-group \">\n <label htmlFor=\"password\">Password</label>\n <input\n type=\"password\"\n className=\"form-control\"\n name=\"password\"\n placeholder=\"Password\"\n value={this.state.password}\n onChange={this.handleUserInput}\n />\n </div>\n <div>\n <button\n type=\"submit\"\n name=\"signin\"\n className=\"btn btn-primary\"\n disabled={!this.state.formValid}\n >\n {\" \"}\n Sign In{\" \"}\n </button>\n </div>{\" \"}\n <FormErrors formErrors={this.state.formErrors} />\n <hr className=\"Form\" />\n <h5>\n Not register yet <Link to=\"/signup\">Sign UP</Link>\n </h5>\n </form>\n </div>\n );\n }", "onSubmit() {\n this.attemptRegistration();\n }", "function register_data() {\n var win_register;\n if (!win_register) {\n var form_register = Ext.widget('form', {\n layout : {\n type : 'vbox',\n align : 'stretch'\n },\n border : false,\n autoScroll : false,\n bodyPadding: 10,\n\n fieldDefaults :{\n labelWidth: 120,\n labelStyle: 'font-weight:bold',\n msgTarget : 'side'\n },\n defaults : {\n margins : '0 0 5 0'\n },\n\t\t\t\t\titems : [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\txtype\t: 'hiddenfield',\n\t\t\t\t\t\t\tname\t: 'xt_type',\n\t\t\t\t\t\t\tvalue\t: 'register',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n xtype\t\t\t\t: 'combo',\n id\t\t\t\t\t: 'xt_rpa',\n name\t\t\t\t: 'xt_rpa',\n fieldLabel\t\t\t: 'SELECT RPA',\n emptyText\t\t\t: 'SELECT RPA',\n beforeLabelTextTpl\t: required+' ',\n labelSeparator\t\t: '',\n typeAhead\t\t\t: true,\n editable\t\t\t: true,\n queryMode\t\t\t: 'local',\n store\t\t\t\t: ds_rpadata,\n displayField\t\t: 'rpaname2',\n valueField\t\t\t: 'id_rpa',\n\t\t\t\t\t\t\tallowBlank\t\t\t: false,\n listConfig\t\t\t:{\n getInnerTpl\t: function() {\n return '<div>{rpaname2}</div>';\n }\n },\n \n },\n {\n xtype \t\t\t\t: 'datefield',\n id\t\t\t\t\t: 'xt_date',\n name\t\t\t\t: 'xt_date',\n emptyText\t\t\t: 'SELECT DATE',\n fieldLabel\t\t\t: 'DATE',\n beforeLabelTextTpl\t: required+' ',\n labelSeparator\t\t: '',\n allowBlank \t: false,\n format\t\t\t\t: 'd F Y',\n submitFormat\t\t: 'Y-m-d',\n mode\t\t\t\t: 'local', \n editable\t\t\t: false,\n width\t\t\t\t: 350,\n\t\t\t\t\t\t\tminValue\t\t\t: new Date()\n },\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\txtype\t: 'container',\n\t\t\t\t\t\t\tflex\t: 1,\n\t\t\t\t\t\t\tid\t\t: 'cont-2',\n\t\t\t\t\t\t\tlayout\t: 'anchor',\n\t\t\t\t\t\t\tpadding\t: '5 0 5 0',\n\t\t\t\t\t\t\titems: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\txtype\t: 'container',\n\t\t\t\t\t\t\t\t\tflex\t: 1,\n\t\t\t\t\t\t\t\t\tid\t\t: 'cont-3',\n\t\t\t\t\t\t\t\t\tlayout\t: 'hbox',\n\t\t\t\t\t\t\t\t\tpadding\t: '0 0 5 0',\n\t\t\t\t\t\t\t\t\titems: [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\txtype\t\t\t\t: 'timefield',\n\t\t\t\t\t\t\t\t\t\t\tid\t\t\t\t\t: 'xt_starttime',\n\t\t\t\t\t\t\t\t\t\t\tname\t\t\t\t: 'xt_starttime',\n\t\t\t\t\t\t\t\t\t\t\temptyText\t\t\t: 'START',\n\t\t\t\t\t\t\t\t\t\t\tfieldLabel\t\t\t: 'TIME',\n\t\t\t\t\t\t\t\t\t\t\tbeforeLabelTextTpl\t: required+' ',\n\t\t\t\t\t\t\t\t\t\t\tlabelSeparator\t\t: '',\n\t\t\t\t\t\t\t\t\t\t\tminValue\t\t\t: '08:10',\n\t\t\t\t\t\t\t\t\t\t\tmaxValue\t\t\t: '17:30',\n\t\t\t\t\t\t\t\t\t\t\tincrement\t\t\t: 15,\n\t\t\t\t\t\t\t\t\t\t\tformat\t\t\t\t: 'H:i',\n\t\t\t\t\t\t\t\t\t\t\twidth\t\t\t\t: 250,\n\t\t\t\t\t\t\t\t\t\t\tallowBlank\t\t\t: false,\n\t\t\t\t\t\t\t\t\t\t\tlisteners\t\t\t:{\n\t\t\t\t\t\t\t\t\t\t\t\tselect : function(){\n\t\t\t\t\t\t\t\t\t\t\t\t\tExt.getCmp('xt_endtime').enable();\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\tchange : function(f, new_val){\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar valtime = Ext.getCmp('xt_starttime').getValue();\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (valtime == null){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tExt.getCmp('xt_endtime').reset();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tExt.getCmp('xt_endtime').disable();\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar sttimetemp = Ext.Date.format(Ext.getCmp('xt_starttime').getValue(), 'H:i');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar jam\t\t = (parseInt(sttimetemp.substring(0, 2)));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar menit\t = sttimetemp.substring(3, 5);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (jam >= 24){ jam = jam-24 }else{ jam = jam; }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (jam <= 9){ var sttime = '0'+jam+':'+menit; }else{ var sttime = jam+':'+menit; }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tExt.getCmp('xt_endtime').setMinValue( sttime );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tExt.getCmp('xt_endtime').reset();\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\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{xtype : 'label', html : '&nbsp;-&nbsp;'},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\txtype\t\t\t\t: 'timefield',\n\t\t\t\t\t\t\t\t\t\t\tid\t\t\t\t\t: 'xt_endtime',\n\t\t\t\t\t\t\t\t\t\t\tname\t\t\t\t: 'xt_endtime',\n\t\t\t\t\t\t\t\t\t\t\temptyText\t\t\t: 'END',\n\t\t\t\t\t\t\t\t\t\t\tallowBlank\t\t\t: false,\n\t\t\t\t\t\t\t\t\t\t\tdisabled\t\t\t: true,\n\t\t\t\t\t\t\t\t\t\t\tincrement\t\t\t: 15,\n\t\t\t\t\t\t\t\t\t\t\tformat\t\t\t\t: 'H:i',\n\t\t\t\t\t\t\t\t\t\t\tminValue\t\t\t: '08:10',\n\t\t\t\t\t\t\t\t\t\t\tmaxValue\t\t\t: '17:30',\n\t\t\t\t\t\t\t\t\t\t\twidth\t\t\t\t: 130,\n\t\t\t\t\t\t\t\t\t\t\tallowBlank\t\t\t: false,\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}\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\txtype\t: 'textfield',\n\t\t\t\t\t\t\tid\t\t: 'xt_dept',\n\t\t\t\t\t\t\tname\t: 'xt_dept',\n\t\t\t\t\t\t\tfieldLabel\t: 'DEPARTMENT',\n\t\t\t\t\t\t\temptyText: 'DEPARTMENT',\n\t\t\t\t\t\t\tallowBlank\t\t\t: false,\n\t\t\t\t\t\t\tbeforeLabelTextTpl:required+' ',\n\t\t\t\t\t\t\tlabelSeparator: '',\n\t\t\t\t\t\t\twidth: 350,\n\t\t\t\t\t\t\tlisteners \t: {\n change : function(f, new_val) {\n f.setValue(new_val.toUpperCase());\n }\n }\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\txtype\t\t\t\t: 'textfield',\n\t\t\t\t\t\t\tid\t\t\t\t\t: 'xt_incharge',\n\t\t\t\t\t\t\tname\t\t\t\t: 'xt_incharge',\n\t\t\t\t\t\t\tfieldLabel\t\t\t: 'INCHARGE',\n\t\t\t\t\t\t\temptyText \t\t\t: 'INCHARGE / USERNAME',\n\t\t\t\t\t\t\tbeforeLabelTextTpl\t:required+' ',\n\t\t\t\t\t\t\tlabelSeparator\t\t: '',\n\t\t\t\t\t\t\twidth\t\t\t\t: 350,\n\t\t\t\t\t\t\tallowBlank\t\t\t: false,\n\t\t\t\t\t\t\tlisteners \t: {\n change : function(f, new_val) {\n f.setValue(new_val.toUpperCase());\n }\n }\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\txtype\t: 'textareafield',\n\t\t\t\t\t\t\tid\t\t: 'xt_purpose',\n\t\t\t\t\t\t\tname\t: 'xt_purpose',\n\t\t\t\t\t\t\tfieldLabel\t: 'PURPOSE',\n\t\t\t\t\t\t\temptyText\t: 'PURPOSE',\n\t\t\t\t\t\t\tbeforeLabelTextTpl:required+' ',\n\t\t\t\t\t\t\tlabelSeparator: '',\n\t\t\t\t\t\t\twidth: 350,\n\t\t\t\t\t\t\tallowBlank\t\t\t: false,\n\t\t\t\t\t\t\tlisteners \t: {\n change : function(f, new_val) {\n f.setValue(new_val.toUpperCase());\n }\n }\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\txtype\t: 'textareafield',\n\t\t\t\t\t\t\tid\t\t: 'xt_remark',\n\t\t\t\t\t\t\tname\t: 'xt_remark',\n\t\t\t\t\t\t\tfieldLabel\t: 'REMARK',\n\t\t\t\t\t\t\temptyText\t: 'REMARK',\n\t\t\t\t\t\t\tbeforeLabelTextTpl:'&nbsp;&nbsp;&nbsp;',\n\t\t\t\t\t\t\tlabelSeparator: '',\n\t\t\t\t\t\t\twidth: 350,\n\t\t\t\t\t\t\tallowBlank\t\t\t: true,\n\t\t\t\t\t\t\tlisteners \t: {\n change : function(f, new_val) {\n f.setValue(new_val.toUpperCase());\n }\n }\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n buttons : [\n {\n text : 'Reset',\n iconCls\t: 'icon-reset-icon8',\n handler : function() {\n this.up('form').getForm().reset();\n }\n },\n {\n text \t: 'Save',\n iconCls\t\t: 'icon-save-icon8',\n formBind\t: true,\n handler \t: function() {\n\t\t\t\t\t\t\t\tvar form = this.up('form').getForm();\n var popwindow = this.up('window');\n if (form.isValid()) {\n form.submit({\n url : 'resp/resp_rpa.php',\n waitMsg : 'Sending your data...',\n submitEmptyText : false,\n\n success : function(form, action) {\n Ext.getCmp('xt_rpa').focus(false, 1000);\n ds_view.loadPage(1);\n popwindow.close();\n \n Ext.Msg.show({\n title : 'Success',\n icon\t: Ext.Msg.INFO,\n msg : action.result.msg,\n buttons : Ext.Msg.OK\n });\n },\n\n failure : function(form, action) {\n Ext.Msg.show({\n title : 'Failure',\n icon\t: Ext.Msg.ERROR,\n msg : action.result.msg,\n buttons : Ext.Msg.OK\n });\n\t\t\t\t\t\t\t\t\t\t\tExt.getCmp('xt_starttime').focus();\n }\n });\n }\n }\n }\n ]\n });\n\n win_register = Ext.widget('window', {\n title : 'INPUT DATA',\n width\t\t\t : 430,\n autoheight\t\t: true,\n modal\t\t\t : false,\n constrain : true,\n layout : 'fit',\n animateTarget : 'btn_register',\n items : form_register,\n\t\t\t\t\tbodyStyle \t: { background :'rgba(122, 0, 61, 1); padding-bottom: 5px;'},\n listeners : {\n activate:function(){\n Ext.getCmp('btn_refresh').disable();\n Ext.getCmp('btn_search').disable();\n Ext.getCmp('btn_register').disable();\n Ext.getCmp('btn_update').disable();\n Ext.getCmp('btn_cancel').disable();\n },\n close:function(){\n Ext.getCmp('btn_refresh').enable();\n Ext.getCmp('btn_search').enable();\n Ext.getCmp('btn_register').enable();\n Ext.getCmp('btn_update').enable();\n\t\t\t\t\t\t\t\tExt.getCmp('btn_cancel').enable();\n }\n }\n });\n }\n win_register.show();\n }", "renderPage() {\n return (\n <div id=\"signup-page\" style={{width: \"40rem\"}}>\n <Grid textAlign=\"center\" verticalAlign=\"middle\" centered>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\">\n Edit my info\n </Header>\n <Form onSubmit={this.submit}>\n <Segment stacked>\n <Form.Input\n label=\"Name\"\n id=\"signup-form-password\"\n name=\"name\"\n placeholder=\"Your name\"\n onChange={this.handleChange}\n value={this.state?.name}\n disabled\n />\n <Form.Group widths=\"equal\">\n <Form.Field\n label=\"Gender\"\n control=\"select\"\n onChange={this.genderOnChange}\n value={this.state?.gender}\n >\n <option value=\"male\">Male</option>\n <option value=\"female\">Female</option>\n </Form.Field>\n </Form.Group>\n <Form.Group>\n <label>Are you vaccinated?</label>\n <Form.Radio\n label=\"Yes\"\n value={true}\n name=\"vaccinated\"\n checked={this.state?.vaccinated}\n onChange={this.handleChange}\n />\n <Form.Radio\n label=\"No\"\n value={false}\n name=\"vaccinated\"\n checked={!this.state?.vaccinated}\n onChange={this.handleChange}\n />\n </Form.Group>\n <Form.Input\n label=\"what type of vaccine did you recieve? (optional)\"\n id=\"signup-form-password\"\n name=\"vaccineType\"\n placeholder=\"e.g. Pfizer, Moderna, Johnson and Johnson\"\n value={this.state?.vaccineType}\n onChange={this.handleChange}\n />\n <Form.Input\n label=\"What is the lot number (optional)\"\n id=\"signup-form-password\"\n name=\"vaccineLot\"\n placeholder=\"1001-101\"\n value={this.state?.vaccineLot}\n onChange={this.handleChange}\n />\n <Form.Button\n id=\"signup-form-submit\"\n content=\"Submit\"\n onSubmit={this.submit}\n />\n </Segment>\n </Form>\n </Grid.Column>\n </Grid>\n </div>\n );\n }", "render() {\n return (\n <div className='user-info-block'>\n <label className='user-name-label'>{`Name`}</label>\n <div>\n {this.renderUserNameField()}\n </div>\n <label className='user-email-label'>{`Email`}</label>\n <div>\n {this.renderUserEmailField()}\n </div>\n </div>\n );\n }", "displayRegistration(mod, eq) {\n const { registrations } = this.state;\n return (\n <React.Fragment>\n {registrations.map((registration, index) => (\n <RegistrationCard\n key={registration.id}\n registration={{\n id: registration.id,\n port: registration.port,\n vessel: registration.vessel,\n tonnage: registration.tonnage,\n propulsion: registration.propulsion,\n yard_number: registration.yard_number,\n vessel_length: registration.vessel_length,\n hulls: registration.hulls,\n purpose: registration.purpose,\n start_date: registration.start_date,\n expiration_date: registration.expiration_date,\n owner: registration.owner\n }}\n index={index + 1}\n />\n ))}\n </React.Fragment>\n );\n }", "render() {\n return (\n <div className='all-page-background' style={ { padding: '4em' } }>\n <Container>\n <Grid textAlign=\"center\" verticalAlign=\"middle\" centered columns={2}>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\">\n Register your account\n </Header>\n <Form onSubmit={this.handleSubmit}>\n <Segment inverted className=\"blue-background\" stacked>\n <Form.Input\n label=\"First Name\"\n icon=\"lock\"\n iconPosition=\"left\"\n name=\"firstname\"\n placeholder=\"firstname\"\n type=\"firstname\"\n />\n <Form.Input\n label=\"Last Name\"\n icon=\"lock\"\n iconPosition=\"left\"\n name=\"lastname\"\n placeholder=\"lastname\"\n type=\"lastname\"\n />\n <Form.Input\n label=\"Email\"\n icon=\"user\"\n iconPosition=\"left\"\n name=\"email\"\n type=\"email\"\n placeholder=\"E-mail address\"\n onChange={this.handleChange}\n />\n <Form.Input\n label=\"Password\"\n icon=\"lock\"\n iconPosition=\"left\"\n name=\"password\"\n placeholder=\"Password\"\n type=\"password\"\n onChange={this.handleChange}\n />\n <Segment textAlign='center' inverted className=\"blue-background\">\n <Form.Button content=\"Submit\"/>\n </Segment>\n </Segment>\n </Form>\n <Segment textAlign='center' inverted className=\"blue-background\">\n <Button>\n <Link to=\"/signin\" className=\"link\">Already have an account? Login here</Link>\n </Button>\n {this.state.error === '' ? (\n ''\n ) : (\n <Message\n error\n header=\"Registration was not successful\"\n content={this.state.error}\n />\n )}\n </Segment>\n </Grid.Column>\n </Grid>\n </Container>\n </div>\n );\n }", "function studentSignup(req, res){\n res.render(\"signup\", {});\n}", "render() {\r\n\t\treturn (\r\n\t\t\t<div className=\"Login\" align=\"center\">\r\n\t\t\t\t{this.state.newUser === null ?\r\n\t\t\t\t\t<form onSubmit={this.handleSubmit}>\r\n\t\t\t\t\t<FormGroup controlId=\"email\" bsSize=\"medium\">\r\n\t\t\t\t\t\t<ControlLabel>Email</ControlLabel>\r\n\t\t\t\t\t\t<FormControl autoFocus type=\"email\" value={this.state.email} onChange={this.handleChange} />\r\n\t\t\t\t\t</FormGroup>\r\n\t\t\t\t\t<FormGroup controlId=\"password\" bsSize=\"medium\">\r\n\t\t\t\t\t\t<ControlLabel>Password</ControlLabel>\r\n\t\t\t\t\t\t<FormControl value={this.state.password} onChange={this.handleChange} type=\"password\" />\r\n\t\t\t\t\t</FormGroup>\r\n\t\t\t\t\t<LoaderButton block bsSize=\"small\" disabled={!this.validateForm()} type=\"submit\" isLoading={this.state.isLoading} text=\"Login\" loadingText=\"Logging in…\" />\r\n\t\t\t\t\t</form>\r\n\t\t\t\t: this.renderConfirmationForm()\r\n\t\t\t\t}\r\n\t\t\t</div>\r\n\t\t);\r\n\t}", "render() {\n super.render();\n\n this.eventBusCollector.on(SIGNIN.fail, SignInView._fail);\n\n const usernameInput = document.forms.signIn.username;\n const passwordInput = document.forms.signIn.password;\n\n const func = (e) => {\n e.preventDefault();\n this.eventBus.emit(SIGNIN.submit, {\n login: usernameInput.value,\n password: passwordInput.value,\n });\n };\n\n document.forms.SignIn.addEventListener('submit', func, false);\n this.eventCollector.addEvent(document.forms.SignIn, 'submit', func, false);\n }", "signup(request, response) {\n const viewData = {\n title: \"Login to the Service\",\n };\n response.render(\"signup\", viewData);\n }", "render() {\n this.create()\n\n this.element.appendChild(this.dom)\n\n // Create <ul> to better organize the form\n this.ul = document.createElement(\"ul\")\n this.dom.appendChild(this.ul)\n\n // Create the fields from json file\n Object.entries(this.mock.fields).forEach(\n ([key, value]) => this.createElement(value)\n )\n\n this.bind()\n }", "render() {\n return (\n <SignUpForm\n onSubmit={this.processForm}\n onChange={this.changeUser}\n errors={this.state.errors}\n user={this.state.user}\n />\n );\n }", "function renderButton() {\n gapi.signin2.render('signin2', {\n 'scope': 'profile email',\n 'width': 250,\n 'height': 40,\n 'longtitle': true,\n 'theme': 'dark',\n 'onsuccess': onSuccess,\n 'onfailure': onFailure\n });\n\n gapi.signin2.render('registrar-gmail', {\n 'scope': 'profile email',\n 'width': 250,\n 'height': 40,\n 'longtitle': true,\n 'theme': 'dark',\n 'onsuccess': onSuccess,\n 'onfailure': onFailure\n });\n}", "function show_register(){\n\t// hier neues pw confirmen\n\tvar text=$(\"<div></div>\");\n\tvar input=$(\"<input></input>\");\n\n\tvar form=$(\"<form></form>\");\n\tform.attr(\"methode\",\"post\");\n\tform.attr(\"target\",\"dummy\");\n\tform.attr(\"action\",\" \");\n\tform.attr(\"id\",\"register_form\");\n\n\tform.submit(function(){\n\t\treturn function(){\n\t\t\tvar l_name=$(\"#l_name\").val();\n\t\t\tvar l_email=$(\"#l_email\").val();\n\t\t\tvar l_pw=$(\"#l_pw\").val();\n\t\t\tvar l_pw_conf=$(\"#l_pw_conf\").val();\n\t\t\tvar ok=1;\n\t\t\tvar msg=\"Request send...\";\n\t\t\n\t\t\tif(l_name==\"\"){\n\t\t\t\tok=0;\n\t\t\t\tmsg=\"You have to enter a username\";\n\t\t\t} else if(l_email==\"\"){\n\t\t\t\tok=0;\n\t\t\t\tmsg=\"You have to enter a eMail adress, otherwise I can't send you evidence\";\n\t\t\t} else if(l_pw==\"\" || l_pw_conf==\"\"){\n\t\t\t\tok=0;\n\t\t\t\tmsg=\"You have to supply a password and confirm it\";\n\t\t\t} else if(l_pw!=l_pw_conf){\n\t\t\t\tok=0;\n\t\t\t\tmsg=\"Your password don't match\";\n\t\t\t}\n\n\t\t\tvar hash_pw = CryptoJS.MD5(l_pw).toString(CryptoJS.enc.Hex);\n\n\n\t\t\tif(ok==1){\n\t\t\t\tvar cmd_data = { \"cmd\":\"new_register\", \"user\":l_name, \"email\":l_email, \"pw\":hash_pw };\n\t\t\t\tcon.send(JSON.stringify(cmd_data));\n\t\t\t};\n\t\t\t\n\t\t\t$(\"#register_msg\").text(msg);\n\t\t\tevent.preventDefault();\n\t\t}\n\t}());\t\t\n\n\n\ttext=$(\"<div></div>\");\n\ttext.html(\"Username:<br>\");\n\tinput=$(\"<input></input>\");\n\tinput.attr(\"id\",\"l_name\");\n\tinput.val($(\"#login\").val());\n\tform.append(text);\t\t\t\t\n\tform.append(input);\n\n\ttext=$(\"<div></div>\");\n\ttext.html(\"eMail:<br>\");\n\tinput=$(\"<input></input>\");\n\tinput.attr(\"id\",\"l_email\");\n\tform.append(text);\t\t\t\t\n\tform.append(input);\n\n\ttext=$(\"<div></div>\");\n\ttext.html(\"Password:<br>\");\n\tinput=$(\"<input></input>\");\n\tinput.val($(\"#pw\").val());\n\tinput.attr(\"id\",\"l_pw\");\n\tinput.attr(\"type\",\"password\");\n\tform.append(text);\t\t\t\t\n\tform.append(input);\n\n\ttext=$(\"<div></div>\");\n\ttext.html(\"Confirm password:<br>\");\n\tinput=$(\"<input></input>\");\n\tinput.attr(\"id\",\"l_pw_conf\");\n\tinput.attr(\"type\",\"password\");\n\tform.append(text);\t\t\t\t\n\tform.append(input);\n\n\tvar submit=$(\"<input></input>\");\n\tsubmit.attr(\"type\",\"submit\").attr(\"value\",\"register\");\n\ttext=$(\"<div></div>\");\n\ttext.attr(\"id\",\"register_msg\");\n\ttext.html(\"\");\n\tform.append(submit);\n\tform.append(text);\n\t\t\t\t\n\tshow_fancybox(form,\"register_input_box\");\n}", "render() {\n this.formElement.setAttribute(\"id\", this._id);\n this.formElement.setAttribute(\"method\", this._method);\n if (this._acceptFiles) {\n this.formElement.setAttribute(\"enctype\", \"multipart-form-data\");\n }\n\n // Append all of the field in collection\n this._fieldCollection.getFields().forEach((fieldObject, id) => {\n this.formElement.append(fieldObject.render());\n });\n\n // Sets event handler\n this._setEventHandler();\n\n return this.formElement;\n }", "function displayRegister() {\n Reddcoin.messenger.getReddidStatus(function(data){\n Reddcoin.popup.updateRegister({action: 'open'});\n Reddcoin.popup.updateRegister({registration: data});\n });\n}", "render(){\n\t\tif(this.has_elements){\n\t\t\tthis.$title.html(this.form_data.title);\n\t\t\tthis.$pb_form.hide();\n\t\t\tthis.create_reset_button();\n\t\t\tthis.create_submit_button();\n\t\t\tthis.$content_container.append(this.$wrapper);\n\t\t}\n\t}", "render() {\n let tokens = \"\";\n this.permissions.forEach(p => tokens = tokens + Permission.render(p));\n if(tokens === \"\") tokens = \"<h3>No tokens found for this user</h3>\";\n\n let cert = \"\";\n this.certificate.forEach(c => cert = cert + this.renderCert(c));\n if(cert === \"\") cert = \"<h3>No certificates found for this user</h3>\";\n\n return \"<div class='user'><div class='userName'>\"+ this.name +\n '</div><button class=\"collapsible\"> Tokens: </button><div class=\"content\">' + tokens +\"</div> <button class='collapsible'> Certificates: </button><div class='content'>\" + cert +\"</div></div>\";\n }", "render() {\n return html`\n <slot name=\"input\"></slot>\n <div class=\"choice-field__graphic-container\">${this._choiceGraphicTemplate()}</div>\n <div class=\"choice-field__label\">\n <slot name=\"label\"></slot>\n </div>\n <small class=\"choice-field__help-text\">\n <slot name=\"help-text\"></slot>\n </small>\n ${this._afterTemplate()}\n `;\n }", "registered(req, res) {\n res.render('user/registered');\n }", "render() {\n\treturn html`\n\t<form onsubmit=\"javascript: return false;\" id=\"form1\" method=\"POST\">\n\tUID: <input type=\"text\" id=\"uid\" name=\"uid\" value=\"${this.user.uid}\" readonly>\n\t<br>\n\tUsername: <input type=\"text\" id=\"uname\" name=\"uname\" value=\"${this.user.uname}\">\n\t<br>\n\tFirst name: <input type=\"text\" id=\"firstName\" name=\"firstName\" value=\"${this.user.firstName}\">\n\t<br>\n\tLast name: <input type=\"text\" id=\"lastName\" name=\"lastName\" value=\"${this.user.lastName}\">\n\t<br>\n\tPassword new: <input type=\"text\" id=\"pwd\" name=\"pwd\">\n\t<br>\n\tPassword old: <input type=\"text\" id=\"oldpwd\" name=\"oldpwd\">\n\t<br>\n\t<input type=\"submit\" form=\"form1\" value=\"Submit\" @click=${this.changeUserData}>\n\t`;\n }", "render () {\n return (\n <form className=\"theForm\">\n <h1>Welcome to your one stop shop for make up reviews!</h1>\n <br />\n <h2>If you're new here why not SIGN UP</h2>\n <br />\n <div className=\"panel panel-default\">\n <FormErrors formErrors={this.state.formErrors} />\n </div>\n <div className={`form-group ${this.errorClass(this.state.formErrors.email)}`}>\n <label htmlFor=\"email\">Email address</label>\n <input type=\"email\" required className=\"form-control\" name=\"email\"\n placeholder=\"Email\"\n value={this.state.email}\n onChange={this.handleUserInput} />\n </div>\n <div className={`form-group ${this.errorClass(this.state.formErrors.password)}`}>\n <label htmlFor=\"password\">Password</label>\n <input type=\"password\" className=\"form-control\" name=\"password\"\n placeholder=\"Password\"\n value={this.state.password}\n onChange={this.handleUserInput} />\n </div>\n <button type=\"submit\" className=\"btn btn-primary\" disabled={!this.state.formValid}>Sign up</button>\n </form>\n )\n }", "async handleRegistration(event) {\n try {\n\n //prevent actual submit and page refresh\n event.preventDefault();\n\n const userRepository = new UserRepository();\n\n const firstName = $(this).find(\"[name='register-firstname']\").val();\n const lastName = $(this).find(\"[name='register-lastname']\").val();\n const username = $(this).find(\"[name='register-username']\").val();\n const password = $(this).find(\"[name='register-password']\").val();\n const passwordRepeat = $(this).find(\"[name='register-passwordrepeat']\").val();\n\n if (!firstName || !lastName || !username || !password) {\n notificationManager.alert(\"warning\", \"Vul alle velden in!\");\n return false;\n }\n\n if (password.length < 6) {\n notificationManager.alert(\"warning\", \"Wachtwoord is te kort!\");\n return false;\n }\n\n if (password != passwordRepeat) {\n notificationManager.alert(\"warning\", \"Wachtwoorden komen niet overeen!\");\n return false;\n }\n\n const user = await userRepository.register(firstName.toLowerCase(), lastName.toLowerCase(), username.toLowerCase(), password);\n\n notificationManager.alert(\"success\", \"U bent geregistreerd!\");\n sessionManager.set(\"userID\", user.userID);\n location.reload();\n } catch (e) {\n (e.code === 401) ? notificationManager.alert(\"error\", e.reason) : console.log(e);\n }\n }", "render() {\n return (\n <div>\n <form className=\"form-style-5\">\n <legend> Sign up / Sign in </legend>\n <div>\n <label htmlFor=\"userName\">UserName</label>\n <input name=\"userName\" component=\"input\" type=\"text\" />\n </div>\n <div>\n <label htmlFor=\"password\">Password</label>\n <input name=\"password\" component=\"input\" type=\"text\" />\n </div>\n <button type=\"submit\">SignUp</button>\n <button type=\"submit\">SignIn</button>\n </form>\n </div>\n )\n }", "render() {\n return (\n <div>\n <Signup />\n </div>\n );\n }", "function createUserScreen(){\n const view = document.createElement('div');\n view.setAttribute('class','signInView');\n\n let inputs = {};\n ['name','email address','password','confirm password'].forEach(function (label){\n inputs[label] = appendLabel(view, label, 'register');\n })\n\n let termsClicked = true;\n\n const terms = document.createElement('div');\n terms.setAttribute('class','termsField');\n view.appendChild(terms);\n\n const termsButton = document.createElement('img');\n termsButton.setAttribute('class','termsButton');\n terms.appendChild(termsButton);\n\n const termsText = document.createElement('div');\n termsText.setAttribute('class','termsText');\n termsText.innerHTML = 'I have read and accept Bespin FM\\'s <a href=\"../terms.html\" target=\"_blank\" id=\"terms\" ' +\n 'class=\"terms\">Terms and Conditions</a>';\n terms.appendChild(termsText);\n\n terms.onclick = function (){\n termsClicked = !termsClicked;\n if (termsClicked){\n termsButton.src = 'media/check.png';\n termsButton.style.backgroundColor = '#a2d7f1';\n }\n else{\n termsButton.src = 'media/check_faded.png';\n termsButton.style.backgroundColor = 'white';\n }\n }\n terms.click();\n\n const submit = document.createElement('div');\n submit.setAttribute('class','signInSubmit');\n submit.textContent = 'Submit';\n view.appendChild(submit);\n\n submit.onclick = function (){\n createUser(inputs['name'].value,inputs['email address'].value,inputs['password'].value);\n }\n\n return view;\n}", "function render() {\n\n\t\t\t}", "render() {\n const {errors} = this.state\n return (\n <Container className=\"SignupForm\">\n \n\n <h2 className=\"PageHeading\"> Sign Up </h2> \n <Form className=\"form\">\n <Col>\n <FormGroup row>\n <Label for=\"device-label\" sm={5}>Device Name</Label>\n <Col sm={12}> \n <Input \n value= {this.state.device_name}\n onChange={this.onChange}\n type=\"text\"\n name=\"device_name\"\n className=\"form-control\" \n placeholder = \"Enter Device Name\"\n />\n </Col> \n </FormGroup>\n {/*\n <div className=\"form-group\">\n <label className=\"control-label\">Email</label>\n <input\n value= {this.state.email}\n onChange={this.onChange}\n type=\"text\"\n name=\"email\"\n className=\"form-control\"\n />\n </div>\n */}\n <FormGroup row>\n <Label for=\"password\" sm={2}>Password</Label>\n <Col sm={12}>\n <Input\n value= {this.state.password}\n onChange={this.onChange}\n type=\"password\"\n name=\"password\"\n className=\"form-control\"\n placeholder = \"Enter Password\"\n />\n </Col>\n {/* {errors.message && <span className=\"err-block\">{errors.message}</span>} */}\n </FormGroup>\n </Col>\n{/*\n <div className=\"form-group\">\n <label className=\"control-label\">Confirm Password</label>\n <input\n value= {this.state.passwordConfirm}\n onChange={this.onChange}\n type=\"password\"\n name=\"passwordConfirm\"\n className=\"form-control\"\n />s\n </div>\n*/}\n <div className=\"button-grp\">\n <Button color=\"danger\" onClick={this.onSubmit}>\n Sign Up\n </Button>\n </div>\n </Form>\n </Container> \n );\n }", "function RegisterForm({onSubmit}) {\n const [name, setName] = useState(\"\");\n const [email, setEmail] = useState(\"\");\n const [password, setPassword] = useState(\"\");\n\n return (\n <div className=\"card \">\n <div className=\"card-body bg-warning rounded\">\n <h4 className=\"card-title\">Sign up</h4>\n <div>\n <div className=\"form-group\">\n <input \n type=\"text\"\n className=\"form-control\"\n value={name}\n onChange={ e => setName(e.target.value) }\n placeholder=\"Name\"/>\n </div>\n\n <div className=\"form-group\">\n <input\n type=\"email\"\n value={email}\n onChange={ e => setEmail(e.target.value) }\n className=\"form-control\"\n placeholder=\"Email\"/>\n </div>\n\n <div className=\"form-group\">\n <input \n type=\"password\" \n placeholder=\"Password\" \n className=\"form-control\" \n value={password}\n onChange={e => setPassword(e.target.value)} />\n </div>\n\n <div className=\"form-group\">\n <img src=\"parenthood1.svg\" class=\"rounded float-right\" width=\"50\" height=\"50\"alt=\"logo\"/>\n <button \n className=\"btn btn-success float-left\"\n onClick={e => onSubmit({name, email, password})}>\n Create account\n </button>\n </div>\n\n </div>\n </div>\n </div>\n );\n}", "function showSignupForm(req, res){\n\t// render the page and pass in any flash data if it exists\n res.render('pages/signup', { message: req.flash('signupMessage') });\n}", "function renderNewGardenForm(){\n\tmain.appendChild(gFormDiv)\n}", "function Register() {\n const [registerForm, setRegisterForm] = useState({\n name: '',\n email: '',\n password: '',\n });\n const dispatch = useDispatch();\n let history = useHistory();\n\n const onRegister = (e) => {\n e.preventDefault();\n dispatch(registerUser(registerForm));\n // Si se registro con exito, se envia a la pagina de Login para que ingrese.\n history.push('/login');\n };\n\n const onChangeRegister = (e) => {\n const { name, value } = e.target;\n setRegisterForm({ ...registerForm, [name]: value });\n };\n\n return (\n <Container className=\"mr-3 margin-top\">\n <h1 className=\"text-center mt-3 mb-3\">Register</h1>\n\n <Row className=\"mt-3 mb-3\">\n <Col></Col>\n <Col xs={6}>\n <Form onSubmit={(e) => onRegister(e)}>\n <Form.Group className=\"mb-2\" controlId=\"formBasicName\">\n <Form.Control\n type=\"name\"\n name=\"name\"\n placeholder=\"Enter your Name\"\n onChange={onChangeRegister}\n />\n </Form.Group>\n <Form.Group className=\"mb-2\" controlId=\"formBasicEmail\">\n <Form.Control\n type=\"email\"\n name=\"email\"\n placeholder=\"Enter email\"\n onChange={onChangeRegister}\n />\n </Form.Group>\n <Form.Group className=\"mb-1\" controlId=\"formBasicPassword\">\n <Form.Control\n type=\"password\"\n name=\"password\"\n placeholder=\"Password\"\n onChange={onChangeRegister}\n />\n </Form.Group>\n <Button variant=\"primary\" type=\"submit\" className=\"mt-3 mb-3\">\n Create Account\n </Button>\n <p className=\"mt-1 mb-3\">\n If you already have an account\n <Link to={`/login`}> CLICK HERE </Link> to access your account.\n </p>\n </Form>\n </Col>\n <Col></Col>\n </Row>\n </Container>\n );\n}", "function Register(event) {\n event.preventDefault();\n CollapseElements(error_message);\n\n const agreed_to_terms = sign_form[4].checked;\n console.log(\"Agreed to terms: \" + agreed_to_terms);\n\n if (!agreed_to_terms) {\n ShowFormError(\"You have to agree with Terms of Use.\");\n return;\n }\n\n const email = sign_form[2].value;\n if (!email) {\n ShowFormError(\"Email is empty.\");\n return;\n }\n const user = JSON.parse(localStorage.getItem(email));\n console.log(\"user read : \" + user);\n\n if (user) {\n ShowFormError(\"The user with this email already exists\");\n } else {\n const name = sign_form[0].value;\n const surname = sign_form[1].value;\n const password = sign_form[3].value;\n\n if (\n !CheckIfStringsNotEmpty(\n [\"Name\", \"Surname\", \"Password\"],\n name,\n surname,\n password\n )\n )\n return;\n\n user_data = {\n email: email,\n name: name,\n surname: surname,\n password: HashText(password),\n lists: [],\n };\n\n console.log(\"Hashed password to \" + HashText(password));\n\n try {\n localStorage.setItem(email, JSON.stringify(user_data));\n console.log(\"Registered: \" + email);\n current_user_data = user_data;\n console.log(JSON.stringify(current_user_data));\n SetClassVisible(\"loggedIn\", true);\n SetClassVisible(\"loggedOut\", false);\n ShowDashboard();\n } catch (error) {\n ShowFormError(\"Error while signing up.\");\n console.log(\"Error while signing up: \" + error);\n }\n }\n}", "render(){\n return(\n <Form onSubmit={this.signUp}>\n <Title>Sign up for our newsletter</Title>\n <Input\n onChange={this.handleChange}\n name=\"firstName\"\n type=\"text\"\n placeholder=\"First Name\"\n value={this.state.firstName} />\n <Input\n onChange={this.handleChange}\n name=\"lastName\"\n type=\"text\"\n placeholder=\"Last Name\"\n value={this.state.lastName} />\n <Input\n onChange={this.handleChange}\n name=\"email\"\n type=\"email\"\n placeholder=\"email address\"\n value={this.state.email} />\n <Button>Submit</Button>\n <div>First Name: {this.state.firstName} </div>\n <div>Last Name: {this.state.lastName}</div>\n </Form>\n )\n }" ]
[ "0.7329158", "0.71377826", "0.68123585", "0.66666824", "0.6649705", "0.6644622", "0.66394496", "0.6614284", "0.66094273", "0.66061246", "0.65974647", "0.6571575", "0.6569441", "0.6493935", "0.64841235", "0.64510125", "0.6427592", "0.6405365", "0.64046896", "0.6379968", "0.6375244", "0.63646", "0.63402647", "0.6337059", "0.6333838", "0.63229877", "0.6316502", "0.6314346", "0.6295164", "0.6289421", "0.6265244", "0.62592685", "0.6249449", "0.62385714", "0.621268", "0.62119067", "0.6207853", "0.6207168", "0.6205775", "0.620282", "0.6198168", "0.6191768", "0.6183917", "0.61755925", "0.6168876", "0.6165644", "0.6153588", "0.615029", "0.61451596", "0.6143941", "0.61407477", "0.6125507", "0.61230433", "0.6122378", "0.61186886", "0.6113977", "0.6111625", "0.61101586", "0.61006606", "0.6077446", "0.6058839", "0.6044227", "0.6026926", "0.6009855", "0.5992518", "0.59911215", "0.5990245", "0.5975465", "0.5973332", "0.59590805", "0.5951924", "0.59503615", "0.59414566", "0.5936076", "0.593026", "0.59219235", "0.59138405", "0.5911849", "0.5903917", "0.5883829", "0.5882628", "0.5876642", "0.5869043", "0.5845065", "0.5841514", "0.5835872", "0.58352417", "0.5827667", "0.58125746", "0.5805205", "0.57960814", "0.57952327", "0.5790398", "0.578377", "0.5778354", "0.577032", "0.57695603", "0.5768944", "0.5766399", "0.5763286", "0.5760644" ]
0.0
-1
Defines a helper function that will control our generator
function async(generator) { // Creates an iterator through which we'll control the generator const iterator = generator(); // Defines the function that will handle each value generated by the genrator function handle(iteratorResult) { // Stops when the generator has no more results if (iteratorResult.done) { return; } const iteratorValue = iteratorResult.value; // If the generated value is a promise, register a suucess and a failure callback. // This is the asynchronous part. // If the promise succeeds, great, resume the generator and send in the promised value. // If there's an error, through an exception to the generator. if (iteratorValue instanceof Promise) { iteratorValue.then((res) => handle(iterator.next(res))).catch((err) => iterator.throw(err)); } } // Restarts the generator execution. try { handle(iterator.next()); } catch (err) { iterator.throw(err); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Generator(){}", "function Generator(){}", "function Generator(){}", "function Generator(){}", "function Generator(){}", "function Generator(){}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}" ]
[ "0.7378487", "0.7378487", "0.7378487", "0.7378487", "0.7378487", "0.7378487", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967", "0.73513967" ]
0.0
-1
Defines the function that will handle each value generated by the genrator
function handle(iteratorResult) { // Stops when the generator has no more results if (iteratorResult.done) { return; } const iteratorValue = iteratorResult.value; // If the generated value is a promise, register a suucess and a failure callback. // This is the asynchronous part. // If the promise succeeds, great, resume the generator and send in the promised value. // If there's an error, through an exception to the generator. if (iteratorValue instanceof Promise) { iteratorValue.then((res) => handle(iterator.next(res))).catch((err) => iterator.throw(err)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gen() {\nfor (var i = 0; i < stuff; i++) {\n return randomValue\n }\n}", "function createFareMultiplier(integar){\nreturn function (Multiplier) {\n return Multiplier * integar;\n }}", "function value() { }", "function Generator() {} // 84", "function genM() {\n \"use strict\";\n return function () {\n return this.field;\n };\n}", "function Do(gen) {\n function step(value) {\n const result = gen.next(value)\n if (result.done) {\n return result.value\n }\n return result.value.bind(step)\n }\n return step()\n }", "function Generator() {} // 80", "map(f) {\n\treturn f(this.value);\n }", "function Generator(){}", "function Generator(){}", "function Generator(){}", "function Generator(){}", "function Generator(){}", "function Generator(){}", "function Generator() {\n // YOUR CODE HERE\n}", "function Generator() {\n // YOUR CODE HERE\n}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}" ]
[ "0.6247035", "0.6099559", "0.596092", "0.59592307", "0.5929242", "0.58667994", "0.58055407", "0.5767642", "0.576255", "0.576255", "0.576255", "0.576255", "0.576255", "0.576255", "0.5747744", "0.5747744", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394", "0.56834394" ]
0.0
-1
Write a function to find the rectangular intersection of two given love rectangles. O(1) time and O(1) space
function findOverlap(x1, width1, x2, width2) { let startX = Math.max(x1, x2); let endX = Math.min(x1 + width1, x2 + width2); if (startX > endX) { return {startPoint: null, range: null}; } else { return {startPoint: startX, range: endX-startX} } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function intersectRects(rect1,rect2){var res={left:Math.max(rect1.left,rect2.left),right:Math.min(rect1.right,rect2.right),top:Math.max(rect1.top,rect2.top),bottom:Math.min(rect1.bottom,rect2.bottom)};if(res.left<res.right&&res.top<res.bottom){return res;}return false;}", "function intersect(rectangle1, rectangle2) {\n let x1 = Math.max(rectangle1.x, rectangle2.x);\n let y1 = Math.max(rectangle1.y, rectangle2.y);\n let x2 = Math.min(rectangle1.x + rectangle1.width, rectangle2.x + rectangle2.width);\n let y2 = Math.min(rectangle1.y + rectangle1.height, rectangle2.y + rectangle2.height);\n if (x2 >= x1 && y2 >= y1)\n return { x: x1, y: y1, width: x2 - x1, height: y2 - y1 };\n else\n return { x: 0, y: 0, width: 0, height: 0 };\n}", "intersection(_rect) {\n return new HRect(\n Math.max(this.left, _rect.left), Math.max(this.top, _rect.top),\n Math.min(this.right, _rect.right), Math.min(this.bottom, _rect.bottom)\n );\n }", "function constructIntersection(rectangle1, rectangle2) {\n let x1 = Math.max(rectangle1.x, rectangle2.x);\n let y1 = Math.max(rectangle1.y, rectangle2.y);\n let x2 = Math.min(rectangle1.x + rectangle1.width, rectangle2.x + rectangle2.width);\n let y2 = Math.min(rectangle1.y + rectangle1.height, rectangle2.y + rectangle2.height);\n if (x2 >= x1 && y2 >= y1)\n return { x: x1, y: y1, width: x2 - x1, height: y2 - y1 };\n else\n return { x: 0, y: 0, width: 0, height: 0 };\n}", "function rectIntersection(x1, y1, w1, h1, x2, y2, w2, h2) {\n if (x1 <= x2 + w2 && x1 + w1 >= x2 && y1 <= y2 + h2 && y1 + h1 >= y2) {\n return true;\n }\n return false;\n}", "function intersection(rect1, rect2) {\n return (\n within(rect1.x, rect1.x + rect1.width, rect2.x, rect2.x + rect2.width) &&\n within(rect1.y, rect1.y + rect1.height, rect2.y, rect2.y + rect2.height);\n );\n}", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n}", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n}", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n}", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n}", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n}", "function intersectRects(rect1, rect2) {\n\tvar res = {\n\t\tleft: Math.max(rect1.left, rect2.left),\n\t\tright: Math.min(rect1.right, rect2.right),\n\t\ttop: Math.max(rect1.top, rect2.top),\n\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t};\n\n\tif (res.left < res.right && res.top < res.bottom) {\n\t\treturn res;\n\t}\n\treturn false;\n}", "function intersectRects(rect1, rect2) {\n\tvar res = {\n\t\tleft: Math.max(rect1.left, rect2.left),\n\t\tright: Math.min(rect1.right, rect2.right),\n\t\ttop: Math.max(rect1.top, rect2.top),\n\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t};\n\n\tif (res.left < res.right && res.top < res.bottom) {\n\t\treturn res;\n\t}\n\treturn false;\n}", "function intersectRects(rect1, rect2) {\n\tvar res = {\n\t\tleft: Math.max(rect1.left, rect2.left),\n\t\tright: Math.min(rect1.right, rect2.right),\n\t\ttop: Math.max(rect1.top, rect2.top),\n\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t};\n\n\tif (res.left < res.right && res.top < res.bottom) {\n\t\treturn res;\n\t}\n\treturn false;\n}", "function intersectRects(rect1, rect2) {\n\tvar res = {\n\t\tleft: Math.max(rect1.left, rect2.left),\n\t\tright: Math.min(rect1.right, rect2.right),\n\t\ttop: Math.max(rect1.top, rect2.top),\n\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t};\n\n\tif (res.left < res.right && res.top < res.bottom) {\n\t\treturn res;\n\t}\n\treturn false;\n}", "function intersectRects(rect1, rect2) {\n\tvar res = {\n\t\tleft: Math.max(rect1.left, rect2.left),\n\t\tright: Math.min(rect1.right, rect2.right),\n\t\ttop: Math.max(rect1.top, rect2.top),\n\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t};\n\n\tif (res.left < res.right && res.top < res.bottom) {\n\t\treturn res;\n\t}\n\treturn false;\n}", "function intersectRects(rect1, rect2) {\n\tvar res = {\n\t\tleft: Math.max(rect1.left, rect2.left),\n\t\tright: Math.min(rect1.right, rect2.right),\n\t\ttop: Math.max(rect1.top, rect2.top),\n\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t};\n\n\tif (res.left < res.right && res.top < res.bottom) {\n\t\treturn res;\n\t}\n\treturn false;\n}", "function intersectRects(rect1, rect2) {\n\tvar res = {\n\t\tleft: Math.max(rect1.left, rect2.left),\n\t\tright: Math.min(rect1.right, rect2.right),\n\t\ttop: Math.max(rect1.top, rect2.top),\n\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t};\n\n\tif (res.left < res.right && res.top < res.bottom) {\n\t\treturn res;\n\t}\n\treturn false;\n}", "function intersectRects(rect1, rect2) {\n\tvar res = {\n\t\tleft: Math.max(rect1.left, rect2.left),\n\t\tright: Math.min(rect1.right, rect2.right),\n\t\ttop: Math.max(rect1.top, rect2.top),\n\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t};\n\n\tif (res.left < res.right && res.top < res.bottom) {\n\t\treturn res;\n\t}\n\treturn false;\n}", "function intersect (r1, r2) {\n return r1.left < r2.right\n && r1.right > r2.left\n && r1.top < r2.bottom\n && r1.bottom > r2.top;\n }", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n\n return false;\n }", "function intersect(x1,y1,x2,y2,x3,y3,x4,y4){\r\n s1x = x2 - x1;\r\n s1y = y2 - y1;\r\n\r\n s2x = x4 - x3;\r\n s2y = y4 - y3;\r\n\r\n s1 = ((-s1y * (x1 - x3)) + (s1x * (y1 - y3))) / ((-s2x * s1y) + (s1x * s2y))\r\n s2 = (( s2x * (y1 - y3)) - (s2y * (x1 - x3))) / ((-s2x * s1y) + (s1x * s2y))\r\n\r\n if ((s1 >= 0)*(s1 <= 1)*(s2 >= 0)*(s2 <= 1))\r\n {\r\n return [(x1 + (s2*s1x)),(y1 + (s2*s1y))];\r\n }\r\n else \r\n {\r\n return null;;\r\n }\r\n}", "function intersectRects(rect1, rect2) {\n\t\tvar res = {\n\t\t\tleft: Math.max(rect1.left, rect2.left),\n\t\t\tright: Math.min(rect1.right, rect2.right),\n\t\t\ttop: Math.max(rect1.top, rect2.top),\n\t\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t\t};\n\n\t\tif (res.left < res.right && res.top < res.bottom) {\n\t\t\treturn res;\n\t\t}\n\t\treturn false;\n\t}", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n }", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n }", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n }", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n }", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom),\n };\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n }", "function intersects(x1, y1, w1, h1, x2, y2, w2, h2)\n{\nif(y2 + h2 < y1 ||\nx2 + w2 < x1 ||\nx2 > x1 + w1 ||\ny2 > y1 + h1)\n{\nreturn false;\n}\nreturn true;\n}", "function xIntersection(e1, e2, o)\r\n{\r\n var ix1, iy2, iw, ih, intersect = true;\r\n var e1x1 = xPageX(e1);\r\n var e1x2 = e1x1 + xWidth(e1);\r\n var e1y1 = xPageY(e1);\r\n var e1y2 = e1y1 + xHeight(e1);\r\n var e2x1 = xPageX(e2);\r\n var e2x2 = e2x1 + xWidth(e2);\r\n var e2y1 = xPageY(e2);\r\n var e2y2 = e2y1 + xHeight(e2);\r\n // horizontal\r\n if (e1x1 <= e2x1) {\r\n ix1 = e2x1;\r\n if (e1x2 < e2x1) intersect = false;\r\n else iw = Math.min(e1x2, e2x2) - e2x1;\r\n }\r\n else {\r\n ix1 = e1x1;\r\n if (e2x2 < e1x1) intersect = false;\r\n else iw = Math.min(e1x2, e2x2) - e1x1;\r\n }\r\n // vertical\r\n if (e1y2 >= e2y2) {\r\n iy2 = e2y2;\r\n if (e1y1 > e2y2) intersect = false;\r\n else ih = e2y2 - Math.max(e1y1, e2y1);\r\n }\r\n else {\r\n iy2 = e1y2;\r\n if (e2y1 > e1y2) intersect = false;\r\n else ih = e1y2 - Math.max(e1y1, e2y1);\r\n }\r\n // intersected rectangle\r\n if (intersect && typeof(o)=='object') {\r\n o.x = ix1;\r\n o.y = iy2 - ih;\r\n o.w = iw;\r\n o.h = ih;\r\n }\r\n return intersect;\r\n}", "function find_1d_intersection(a, b) {\n return {\n \"l\": clamp(a, b.l),\n \"r\": clamp(a, b.r)\n };\n}", "function intersect$1(a, b) {\n return !(\n a.x2 - 1 < b.x1 ||\n a.x1 + 1 > b.x2 ||\n a.y2 - 1 < b.y1 ||\n a.y1 + 1 > b.y2\n );\n }", "function rectangleCollision(rect1,rect2) {\n // Rects defined as [x,y,width,height]\n var r1 = {\n x1: rect1[0],\n y1: rect1[1],\n w: rect1[2],\n h: rect1[3],\n x2: rect1[0] + rect1[2],\n y2: rect1[1] + rect1[3]\n };\n var r2 = {\n x1: rect2[0],\n y1: rect2[1],\n w: rect2[2],\n h: rect2[3],\n x2: rect2[0] + rect2[2],\n y2: rect2[1] + rect2[3]\n };\n\n // Inside degrees assumind r2 bigger\n /*\n 0 - Full left/top\n 1 - part left/top\n 2 - inside\n 3- part right\n 4- full right/down\n */\n var horizontalIn = 0;\n var verticalIn = 0;\n\n if (r1.x2 < r2.x1) {\n horizontalIn = 0\n }else if ((r1.x2 > r2.x1) && (r1.x1 < r2.x1)) {\n horizontalIn = 1;\n }else if ((r1.x2 < r2.x2) && (r1.x1 > r2.x1)) {\n horizontalIn = 2;\n }else if ((r1.x2 > r2.x2) && (r1.x1 < r2.x2)) {\n horizontalIn = 3;\n }else if (r1.x1 > r2.x2) {\n horizontalIn = 4;\n }\n\n if (r1.y2 < r2.y1) {\n verticalIn = 0\n }else if ((r1.y2 > r2.y1) && (r1.y1 < r2.y1)) {\n verticalIn = 1;\n }else if ((r1.y2 < r2.y2) && (r1.y1 > r2.y1)) {\n verticalIn = 2;\n }else if ((r1.y2 > r2.y2) && (r1.y1 < r2.y2)) {\n verticalIn = 3;\n }else if (r1.y1 > r2.y2) {\n verticalIn = 4;\n }\n\n // If neither then not in\n if (horizontalIn == 0 || verticalIn == 0 || horizontalIn == 4 || verticalIn == 4) {\n return 0;\n }\n // Fully in\n else if(horizontalIn == 2 && verticalIn==2){\n return -1;\n }\n // Priority to horizontalIn\n else if(horizontalIn == 1){\n return 1;\n }\n else if (horizontalIn == 3) {\n return 2;\n }\n // horizontalIn as 2 for full in\n else {\n if (verticalIn == 1) {\n return 3;\n }else if (verticalIn == 3) {\n return 4;\n }\n\n }\n}", "function intersect(rect1, rect2) {\n rect1left = rect1.x + 3;\n rect1top = rect1.y + 5;\n rect1right = rect1.x + rect1.width - 3;\n rect1bottom = rect1.y + rect1.height - 5;\n\n rect2left = rect2.x + 3;\n rect2top = rect2.y + 5;\n rect2right = rect2.x + rect2.width - 3;\n rect2bottom = rect2.y + rect2.height - 5;\n\n return !(\n rect1left > rect2right ||\n rect1right < rect2left ||\n rect1top > rect2bottom ||\n rect1bottom < rect2top\n );\n }", "function checkIntersection(r1, r2) {\n console.log(`checking instersetions`);\n let intersects = !(\n r2.left > r1.right ||\n r2.right < r1.left ||\n r2.top > r1.bottom ||\n r2.bottom < r1.top\n );\n if (!intersects) {\n console.log(intersects);\n return false;\n }\n\n let leftX = Math.max(r1.x, r2.x);\n let rightX = Math.min(r1.x + r1.w, r2.x + r2.w);\n let topY = Math.max(r1.y, r2.y);\n let bottomY = Math.min(r1.y + r1.h, r2.y + r2.h);\n\n if (leftX < rightX && topY < bottomY) {\n rect4 = new Block(leftX, topY, rightX - leftX, bottomY - topY, true);\n let a1 = r1.area;\n let a2 = r2.area;\n let a3 = rect4.area;\n if (a1 == a2) return true;\n return !(a3 >= a2 || a3 >= a1);\n } else {\n intersects = false;\n return intersects;\n // Rectangles do not overlap, or overlap has an area of zero (edge/corner overlap)\n }\n console.log(intersects);\n return intersects;\n}", "function findIntersect(r1x1, r1y1, r1x2, r1y2, r2x1, r2y1, r2x2, r2y2) {\r\n\r\n if (r2x1 == r2x2) {\r\n return findIntersectY(r1x1, r1y1, r1x2, r1y2, r2x1);\r\n }\r\n if (r2y1 == r2y2) {\r\n return findIntersectX(r1x1, r1y1, r1x2, r1y2, r2y1);\r\n }\r\n\r\n // m = (y1 - y2) / (x1 - x2) // <-- how to find the slope\r\n // y = mx + b // the 'classic' linear equation\r\n // b = y - mx // how to find b (the y-intersect)\r\n // x = (y - b)/m // how to find x\r\n var r1m = (r1y1 - r1y2) / (r1x1 - r1x2);\r\n var r1b = r1y1 - (r1m * r1x1);\r\n var r2m = (r2y1 - r2y2) / (r2x1 - r2x2);\r\n var r2b = r2y1 - (r2m * r2x1);\r\n\r\n var x = (r2b - r1b) / (r1m - r2m);\r\n var y = r1m * x + r1b;\r\n\r\n return {x: x, y: y};\r\n }", "function intersectRect(r1, r2) {\n\treturn !(\n\t\tr2.left > r1.right ||\n\t\tr2.right < r1.left ||\n\t\tr2.top > r1.bottom ||\n\t\tr2.bottom < r1.top\n\t);\n}", "function intersect(a, b) {\n return !(\n a.x2 - 1 < b.x1 ||\n a.x1 + 1 > b.x2 ||\n a.y2 - 1 < b.y1 ||\n a.y1 + 1 > b.y2\n );\n}", "function intersect(a, b) {\n return !(\n a.x2 - 1 < b.x1 ||\n a.x1 + 1 > b.x2 ||\n a.y2 - 1 < b.y1 ||\n a.y1 + 1 > b.y2\n );\n}", "intersects(otherRectangle: _Rectangle): boolean {\n return !(\n this.right < otherRectangle.left ||\n this.bottom < otherRectangle.top ||\n this.left > otherRectangle.right ||\n this.top > otherRectangle.bottom\n )\n }", "function has_intersection(x1, x2, y1, y2, bound){\n\t \n\t//top edge\n\tvar tx = (bound.min_y - y1) * (x2-x1)/(y2-x2) + x1;\n\tif((tx >= x1 && tx <= x2 || tx <= x1 && tx >= x2) && tx >= bound.min_x && tx <= bound.max_x){\n\t\treturn true;\n\t}\n\t\n\t//bottom edge\n\tvar bx = (bound.max_y - y1) * (x2-x1)/(y2-x2) + x1;\n\tif((bx >= x1 && bx <= x2 || bx <= x1 && bx >= x2) && bx >= bound.min_x && bx <= bound.max_x){\n\t\treturn true;\n\t}\n\t//left edge\n\tvar ly = (bound.min_x - x1) * (y2-x2) / (x2 - x1) + x1;\n\tif((ly >= y1 && ly <= y2 || ly <= y1 && ly >= y2) && ly >= bound.min_y && ly <= bound.max_y){\n\t\treturn true;\n\t}\n\t//right edge\n\tvar ry = (bound.max_x - x1) * (y2-x2) / (x2 - x1) + x1;\n\tif((ry >= y1 && ry <= y2 || ry <= y1 && ry >= y2) && ry >= bound.min_y && ry <= bound.max_y){\n\t\treturn true;\n\t}\n\treturn false;\n}", "function intersect(x, y, objects) {\n for (const object of objects) {\n const [start, end] = getStartEnd(object.boundingBox);\n if (start.x <= x && x <= end.x && start.y <= y && y <= end.y) {\n return object;\n }\n }\n}", "function intersect(start0, end0, start1, end1) {\n if (equalArrays(start0,start1) || equalArrays(start0,end1) || equalArrays(end0,start1) || equalArrays(end1,start1)) return null;\n var x0 = start0[0],\n y0 = start0[1],\n x1 = end0[0],\n y1 = end0[1],\n x2 = start1[0],\n y2 = start1[1],\n x3 = end1[0],\n y3 = end1[1];\n var denom = (x0 - x1) * (y2 - y3) - (y0 - y1) * (x2 - x3);\n if (denom == 0) return null;\n var x4 = ((x0 * y1 - y0 * x1) * (x2 - x3) - (x0 - x1) * (x2 * y3 - y2 * x3)) / denom;\n var y4 = ((x0 * y1 - y0 * x1) * (y2 - y3) - (y0 - y1) * (x2 * y3 - y2 * x3)) / denom;\n return [x4, y4];\n}", "function rectIntersection(rectA, rectB) {\n\t\t// condition:\n\t\tif (rectA.left <= rectB.right && rectA.right >= rectB.left &&\n\t\t\trectA.top <= rectB.bottom && rectA.bottom >= rectB.top ) {\n\n\t\t\treturn rectIntArea(rectA, rectB);\n\t\t}\n\t\treturn 0;\n\t}", "function rectIntersects(rect1, rect2) {\r\n return (rect1[TOP_LEFT][X] <= rect2[BOTTOM_RIGHT][X] &&\r\n rect2[TOP_LEFT][X] <= rect1[BOTTOM_RIGHT][X] &&\r\n rect1[TOP_LEFT][Y] <= rect2[BOTTOM_RIGHT][Y] &&\r\n rect2[TOP_LEFT][Y] <= rect1[BOTTOM_RIGHT][Y]);\r\n}", "function subtract(rect1, rect2) {\n // Calculate a set of rects such that their union is rect1-rect2.\n let [x11, x12, y11, y12] = rect1\n let [x21, x22, y21, y22] = rect2\n\n let rects = []\n // Let's look at the options for x. There are six:\n // 1. x11<x12<x21<x22\n // 2. x11<x21<x12<x22\n // 3. x21<x11<x12<x22\n // 4. x11<x21<x22<x12\n // 5. x21<x11<x22<x12\n // 6. x21<x22<x11<x12\n // (where inequalities are sometimes strict and sometimes weak)\n\n // Options 1 and 6: no overlap at all\n // Strong inequality, because if they are equal then there's an overlap of 1.\n if (x12 < x21 || x22 < x11) {\n // Ditch immediately. There is no overlap between the two rects.\n return [rect1]\n }\n\n // Option 3: rect1 is completely inside rect2. Keep the rects as is.\n else if (x21 <= x11 && x12 <= x22) {\n }\n\n /* previously...\n // Option 4: rect2 is completely inside rect1. Split out the left and right parts of rect1 and set it to be just the middle.\n else if (x11 <= x21 && x22 <= x12) {\n rects.push([x11, x21-1, y11, y12])\n rects.push([x22+1, x12, y11, y12])\n x11 = x21\n x12 = x22\n }\n\n // Option 2: Right part of rect2 overlaps with the left part of rect1. Create\n // a rectangle that is just the right part of rect1\n else if (x11 < x21) {\n rects.push([x11, x21-1, y11, y12])\n x11 = x21\n }\n\n // Option 5: Same as 2 but with the directions reversed\n else if (x22 < x12) {\n rects.push([x22+1, x12, y11, y12])\n x12 = x22\n }*/\n\n // Handle options 2, 4, 5 simultaneously:\n else {\n if (x11 < x21) {\n rects.push([x11, x21-1, y11, y12])\n x11 = x21\n }\n if (x22 < x12) {\n rects.push([x22+1, x12, y11, y12])\n x12 = x22\n }\n }\n\n\n // OK, now copy that over for y.\n if (y12 < y21 || y22 < y11) {\n return [rect1]\n }\n else if (y21 <= y11 && y12 <= y22) {\n }\n else {\n if (y11 < y21) {\n rects.push([x11, x12, y11, y21-1])\n y11 = y21\n }\n if (y22 < y12) {\n rects.push([x11, x12, y22+1, y12])\n y12 = y22\n }\n }\n\n return rects\n \n /* Old version for posterity\n if (x21 <= x11) {\n // rect2 starts to the left of rect1. Split rect1 into two, and only deal\n // with the left-hand side from now on. Unless rect2 ends to the right of\n // rect1, then don't do that.\n if (x22 >= x12 || x22 < x11) {\n // Nothing\n } else {\n rects.push([x22+1, x12, y11, y12])\n x12 = x22\n }\n } else if (x21 < x22) {\n // rect2 starts in the middle of rect1. Same kind of split except in the\n // other direction, and no need to worry about that special case.\n rects.push([x11, x21-1, y11, y12])\n x11 = x21-1\n } else {\n // rect2's leftmost corner is to the right of all of rect1, so just return rect1.\n return [rect1]\n }\n if (y21 <= y11) {\n // rect2 starts to the left of rect1. Split rect1 into two, and only deal\n // with the left-hand side from now on. Unless rect2 ends to the right of\n // rect1, then don't do that.\n if (y22 >= y12 || x22 < x11) {\n // Nothing\n } else {\n rects.push([x11, x12, y22+1, y12])\n y12 = y22\n }\n } else if (y21 < y22) {\n // rect2 starts in the middle of rect1. Same kind of split except in the\n // other direction, and no need to worry about that special case.\n rects.push([x11, x12, y11, y21-1])\n y11 = y21-1\n } else {\n // rect2's leftmost corner is to the right of all of rect1, so just return rect1.\n return [rect1]\n }\n return [...rects, [x11, x12, y11, y12]]*/\n}", "function objectsOverlap(obj1, obj2){\n let obj1_b = obj1['boundingBox'];\n let obj2_b = obj2['boundingBox'];\n\n if(!obj1_b || !obj2_b)//one of the two objs has no bounding box\n return 0;\n\n //first consider the case in which the overlap is not possible, so the result is 0\n if(obj1_b['br']['x'] < obj2_b['bl']['x'] || obj1_b['bl']['x'] > obj2_b['br']['x'])//considering x\n // when the gFaceRect finished before the start of azure one (or the opposite)\n return 0;\n\n else if(obj1_b['bl']['y'] < obj2_b['tl']['y'] || obj1_b['tl']['y'] > obj2_b['bl']['y'])//considering y\n // when the gFaceRect finished before the start of azure one (or the opposite)\n return 0;\n\n else{ //there is an overlap\n\n // remind that\n // - x goes from 0 -> N (left -> right)\n // - y goes from 0 -> N (top -> bottom)\n let xc1 = Math.max(obj1_b['bl']['x'], obj2_b['bl']['x']);\n let xc2 = Math.min(obj1_b['br']['x'], obj2_b['br']['x']);\n let yc1 = Math.max(obj1_b['bl']['y'], obj2_b['bl']['y']);\n let yc2 = Math.min(obj1_b['tl']['y'], obj2_b['tl']['y']);\n let xg1 = obj1_b['bl']['x'];\n let xg2 = obj1_b['br']['x'];\n let yg1 = obj1_b['bl']['y'];\n let yg2 = obj1_b['tl']['y'];\n\n let areaO = (xc2-xc1) * (yc2 - yc1); //area covered by the overlapping\n let areaI = (xg2-xg1) * (yg2 - yg1); //area covered by the first bounding box\n\n return areaO/areaI;\n }\n}", "function intersects(a, b) {\n if ((a.h && b.h) || (a.v && b.v)) return;\n\n const h = a.h ? a : b;\n const v = a.v ? a : b;\n const hasIntersection = (h.y >= v.ymin && h.y <= v.ymax) \n && (v.x >= h.xmin && v.x <= h.xmax);\n if (hasIntersection) {\n return [v.x, h.y];\n }\n}", "function findIntersectX(r1x1, r1y1, r1x2, r1y2, y) {\r\n if (r1x1 == r1x2) {\r\n return {x: r1x1, y: y};\r\n }\r\n var r1m = (r1y1 - r1y2) / (r1x1 - r1x2);\r\n var r1b = r1y1 - (r1m * r1x1);\r\n\r\n // y = mx + b // your old friend, linear equation\r\n // x = (y - b)/m // linear equation solved for x\r\n var x = (y - r1b) / r1m;\r\n\r\n return {x: x, y: y};\r\n\r\n }", "function square_square_overlap(rect1, rect2) {\n // rect: pos (lower left), size (w || h)\n // test each corner of one rect against dimension bounds of other\n // crit: if ANY corner is inside BOTH dimensions (x, y)\n\n // 1. calculate each point of rect2\n var list_of_points = [];\n list_of_points.push({x: rect2.pos.x, y: rect2.pos.y});\n list_of_points.push({x: rect2.pos.x + rect2.size, y: rect2.pos.y});\n list_of_points.push({x: rect2.pos.x, y: rect2.pos.y + rect2.size});\n list_of_points.push({x: rect2.pos.x + rect2.size, y: rect2.pos.y + rect2.size});\n\n // test each point, break if any overlap\n for (let i = 0; i < list_of_points.length; i++) {\n const c = list_of_points[i];\n if ((c.x >= rect1.pos.x && c.x <= rect1.pos.x + rect1.size) \n && ( c.y >= rect1.pos.y && c.y <= rect1.pos.y + rect1.size)) {\n return true;\n }\n }\n\n return false;\n}", "function intersect(e1, e2) {\n return (area(e1.u, e1.v, e2.u) > 0 && area(e1.u, e1.v, e2.v) < 0)\n || (area(e1.u, e1.v, e2.u) < 0 && area(e1.u, e1.v, e2.v) > 0);\n}", "function hitTestRectangle(r1, r2) {\n\n //Define the variables we'll need to calculate\n let hit, combinedHalfWidths, combinedHalfHeights, vx, vy;\n\n //hit will determine whether there's a collision\n hit = false;\n\n //Find the center points of each sprite\n r1.centerX = r1.x + r1.width / 8;\n r1.centerY = r1.y + r1.height / 8;\n r2.centerX = r2.x + r2.width / 8;\n r2.centerY = r2.y + r2.height / 8;\n\n //Find the half-widths and half-heights of each sprite\n r1.halfWidth = r1.width / 8;\n r1.halfHeight = r1.height / 8;\n r2.halfWidth = r2.width / 8;\n r2.halfHeight = r2.height / 8;\n\n //Calculate the distance vector between the sprites\n vx = r1.centerX - r2.centerX;\n vy = r1.centerY - r2.centerY;\n\n //Figure out the combined half-widths and half-heights\n combinedHalfWidths = r1.halfWidth + r2.halfWidth;\n combinedHalfHeights = r1.halfHeight + r2.halfHeight;\n\n //Check for a collision on the x axis\n if (Math.abs(vx) < combinedHalfWidths) {\n\n //A collision might be occuring. Check for a collision on the y axis\n if (Math.abs(vy) < combinedHalfHeights) {\n\n //There's definitely a collision happening\n hit = true;\n } else {\n\n //There's no collision on the y axis\n hit = false;\n }\n } else {\n\n //There's no collision on the x axis\n hit = false;\n }\n\n //`hit` will be either `true` or `false`\n return hit;\n}", "function hitTestRectangle(r1, r2) {\n\n //Define the variables we'll need to calculate\n var hit, combinedHalfWidths, combinedHalfHeights, vx, vy;\n //hit will determine whether there's a collision\n hit = false;\n\n //Find the center points of each sprite\n r1.centerX = r1.x + r1.width / 2;\n r1.centerY = r1.y + r1.height / 2;\n r2.centerX = r2.x + r2.width / 2;\n r2.centerY = r2.y + r2.height / 2;\n\n //Find the half-widths and half-heights of each sprite\n r1.halfWidth = r1.width / 2;\n r1.halfHeight = r1.height / 2;\n r2.halfWidth = r2.width / 2;\n r2.halfHeight = r2.height / 2;\n\n //Calculate the distance vector between the sprites\n vx = r1.centerX - r2.centerX;\n vy = r1.centerY - r2.centerY;\n\n //Figure out the combined half-widths and half-heights\n combinedHalfWidths = r1.halfWidth + r2.halfWidth;\n combinedHalfHeights = r1.halfHeight + r2.halfHeight;\n\n //Check for a collision on the x axis\n if (Math.abs(vx) < combinedHalfWidths) {\n //A collision might be occuring. Check for a collision on the y axis\n if (Math.abs(vy) < combinedHalfHeights) {\n //There's definitely a collision happening\n hit = true;\n } else {\n //There's no collision on the y axis\n hit = false;\n }\n } else {\n //There's no collision on the x axis\n hit = false;\n }\n //`hit` will be either `true` or `false`\n return hit;\n}", "function hitTestRectangle(r1, r2) { \n //Define the variables we'll need to calculate\n let hit, combinedHalfWidths, combinedHalfHeights, vx, vy; \n //hit will determine whether there's a collision\n hit = false; \n //Find the center points of each sprite\n r1.centerX = r1.x + r1.width / 2;\n r1.centerY = r1.y + r1.height / 2;\n r2.centerX = r2.x + r2.width / 2;\n r2.centerY = r2.y + r2.height / 2; \n //Find the half-widths and half-heights of each sprite\n r1.halfWidth = r1.width / 2;\n r1.halfHeight = r1.height / 2;\n r2.halfWidth = r2.width / 2;\n r2.halfHeight = r2.height / 2; \n //Calculate the distance vector between the sprites\n vx = r1.centerX - r2.centerX;\n vy = r1.centerY - r2.centerY; \n //Figure out the combined half-widths and half-heights\n combinedHalfWidths = r1.halfWidth + r2.halfWidth;\n combinedHalfHeights = r1.halfHeight + r2.halfHeight; \n //Check for a collision on the x axis\n if (Math.abs(vx) < combinedHalfWidths) { \n //A collision might be occurring. Check for a collision on the y axis\n if (Math.abs(vy) < combinedHalfHeights) { \n //There's definitely a collision happening\n hit = true;\n } else {\n \n //There's no collision on the y axis\n hit = false;\n }\n } else {\n \n //There's no collision on the x axis\n hit = false;\n }\n \n //`hit` will be either `true` or `false`\n return hit;\n}", "function isWithinBounds(rectArr, rect2) {\n var match = null;\n rectArr.forEach(rect1 => {\n var r1 = {\n top: rect1.position().y,\n bottom: rect1.position().y + rect1.height(),\n left: rect1.position().x,\n right: rect1.position().x + rect1.width()\n };\n var r2 = {\n top: rect2.position().y,\n bottom: rect2.position().y + rect2.height(),\n left: rect2.position().x,\n right: rect2.position().x + rect2.width()\n };\n\n if(!(r2.left > r1.right || \n r2.right < r1.left || \n r2.top > r1.bottom ||\n r2.bottom < r1.top)) {\n match = rect1;\n }\n });\n \n return match;\n}", "function doesIntersect(p0, b0, p1, b1) {\r\n\t\tif(p0.x + b0.width - 1 < p1.x) return false;\r\n\t\tif(p0.y + b0.height - 1 < p1.y) return false;\r\n\t\t\r\n\t\tif(p1.x + b1.width - 1 < p0.x) return false;\r\n\t\tif(p1.y + b1.height - 1 < p0.y) return false;\r\n\t\t\r\n\t\treturn true;\r\n\t}", "function detectObject(rect1, rect2) {\n\nvar objId = -1;\n \n if (rect2.left < rect1.right && \n rect2.right > rect1.left) { \n \n objId = rect2.id;\n } \n \n return objId;\n \n\n}", "function intersection(a, b){\n return(\n // replace this line with your code\n );\n}", "function lineRectIntersect2(line, rect) {\n // check left\n var leftLine = {start:{x: rect.x, y: rect.y}, end:{x: rect.x, y: rect.y + rect.h}};\n var intersectionPoint = intersection.intersect(line,leftLine);\n if (intersectionPoint.y >= leftLine.start.y && intersectionPoint.y <= leftLine.end.y && line.start.x <= leftLine.start.x ) {\n return intersectionPoint;\n }\n\n // check top\n var topLine = {start:{x: rect.x, y: rect.y}, end:{x: rect.x + rect.w, y: rect.y}};\n intersectionPoint = intersection.intersect(line, topLine);\n if (intersectionPoint.x >= topLine.start.x && intersectionPoint.x <= topLine.end.x && line.start.y <= topLine.start.y) {\n return intersectionPoint;\n }\n\n // check right\n var rightLine = {start:{x: rect.x + rect.w ,y: rect.y }, end:{x: rect.x + rect.w, y: rect.y + rect.h}};\n intersectionPoint = intersection.intersect(line, rightLine);\n if (intersectionPoint.y >= rightLine.start.y && intersectionPoint.y < rightLine.end.y && line.start.x >= rightLine.start.x) {\n return intersectionPoint;\n }\n\n // check down\n var down = {start:{x: rect.x, y: rect.y + rect.h}, end:{x: rect.x + rect.w, y: rect.y + rect.h}};\n intersectionPoint = intersection.intersect(line, down);\n return intersectionPoint;\n}", "function find_intersection(m, s) {\n // find the 1d intersections on the number line in x an y dimensions\n var x = find_1d_intersection({ \"l\" : m.tl.x, \"r\" : m.br.x }, { \"l\": s.tl.x, \"r\": s.br.x });\n var y = find_1d_intersection({ \"l\" : m.tl.y, \"r\" : m.br.y }, { \"l\": s.tl.y, \"r\": s.br.y });\n\n // return an object that knows its corners \n // tl - top left, br - bottom right, etc.\n return {\n \"tl\": { \"x\" : x.l, \"y\" : y.l },\n \"tr\": { \"x\" : x.r, \"y\" : y.l },\n \"bl\": { \"x\" : x.l, \"y\" : y.r },\n \"br\": { \"x\" : x.r, \"y\" : y.r },\n };\n}", "function boxIntersect(red, blue, visit, full) {\n var n = red.length\n var m = blue.length\n\n //If either array is empty, then we can skip this whole thing\n if(n <= 0 || m <= 0) {\n return\n }\n\n //Compute dimension, if it is 0 then we skip\n var d = (red[0].length)>>>1\n if(d <= 0) {\n return\n }\n\n var retval\n\n //Convert red boxes\n var redList = pool.mallocDouble(2*d*n)\n var redIds = pool.mallocInt32(n)\n n = convertBoxes(red, d, redList, redIds)\n\n if(n > 0) {\n if(d === 1 && full) {\n //Special case: 1d complete\n sweep.init(n)\n retval = sweep.sweepComplete(\n d, visit, \n 0, n, redList, redIds,\n 0, n, redList, redIds)\n } else {\n\n //Convert blue boxes\n var blueList = pool.mallocDouble(2*d*m)\n var blueIds = pool.mallocInt32(m)\n m = convertBoxes(blue, d, blueList, blueIds)\n\n if(m > 0) {\n sweep.init(n+m)\n\n if(d === 1) {\n //Special case: 1d bipartite\n retval = sweep.sweepBipartite(\n d, visit, \n 0, n, redList, redIds,\n 0, m, blueList, blueIds)\n } else {\n //General case: d>1\n retval = boxIntersectIter(\n d, visit, full,\n n, redList, redIds,\n m, blueList, blueIds)\n }\n\n pool.free(blueList)\n pool.free(blueIds)\n }\n }\n\n pool.free(redList)\n pool.free(redIds)\n }\n\n return retval\n}", "function boxIntersect(red, blue, visit, full) {\n var n = red.length\n var m = blue.length\n\n //If either array is empty, then we can skip this whole thing\n if(n <= 0 || m <= 0) {\n return\n }\n\n //Compute dimension, if it is 0 then we skip\n var d = (red[0].length)>>>1\n if(d <= 0) {\n return\n }\n\n var retval\n\n //Convert red boxes\n var redList = pool.mallocDouble(2*d*n)\n var redIds = pool.mallocInt32(n)\n n = convertBoxes(red, d, redList, redIds)\n\n if(n > 0) {\n if(d === 1 && full) {\n //Special case: 1d complete\n sweep.init(n)\n retval = sweep.sweepComplete(\n d, visit, \n 0, n, redList, redIds,\n 0, n, redList, redIds)\n } else {\n\n //Convert blue boxes\n var blueList = pool.mallocDouble(2*d*m)\n var blueIds = pool.mallocInt32(m)\n m = convertBoxes(blue, d, blueList, blueIds)\n\n if(m > 0) {\n sweep.init(n+m)\n\n if(d === 1) {\n //Special case: 1d bipartite\n retval = sweep.sweepBipartite(\n d, visit, \n 0, n, redList, redIds,\n 0, m, blueList, blueIds)\n } else {\n //General case: d>1\n retval = boxIntersectIter(\n d, visit, full,\n n, redList, redIds,\n m, blueList, blueIds)\n }\n\n pool.free(blueList)\n pool.free(blueIds)\n }\n }\n\n pool.free(redList)\n pool.free(redIds)\n }\n\n return retval\n}", "function getCommonRectangle(rectangles) {\n var length = rectangles.length;\n if (length !== 0) {\n var minX = void 0;\n var minY = void 0;\n var maxX = void 0;\n var maxY = void 0;\n for (var i = 0; i < length; i++) {\n var rectangle = rectangles[i];\n minX = min(rectangle.x, minX);\n minY = min(rectangle.y, minY);\n maxX = max(rectangle.x + rectangle.width, maxX);\n maxY = max(rectangle.y + rectangle.height, maxY);\n }\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };\n }\n}", "boxesIntersect(x, y, w, h){\n\n\t\t// loop through existing boxes\n\t\tfor(let i = 0; i < this.polygons.length; i ++){\n\n\t\t\t// if the box intersects the existing i-th box...\n\t\t\tif(x < this.polygons[i][1][0] && x + w > this.polygons[i][0][0] && y < this.polygons[i][3][1] && y + h > this.polygons[i][0][1]){\n\n\t\t\t\t// return true\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// if we reach the end of the loop, return false\n\t\treturn false;\n\t}", "intersection(start, end, sideStart, sideEnd) {\n let line = end.clone().subtract(start)\n let side = sideEnd.clone().subtract(sideStart)\n let lineCrossSidePerp = line.x * side.y - line.y * side.x\n\n // if line Cross side === 0, it means the lines are parallel so have infinite intersection points\n if (lineCrossSidePerp === 0) {\n return null\n }\n\n const diff = sideStart.clone().subtract(start)\n let t = (diff.x * side.y - diff.y * side.x) / lineCrossSidePerp\n if (t < 0 || t >= 1) {\n return null\n }\n\n const u = (diff.x * line.y - diff.y * line.x) / lineCrossSidePerp\n if (u < 0 || u >= 1) {\n return null\n }\n\n return start.clone().add(line.clone().multiply(new Victor(t, t)))\n }", "function calcIntersections(player, rayAngle, vertical)\r\n\t{\r\n\t\trayAngle %= 6.283185307179586;\r\n\t\tif(rayAngle < 0) rayAngle += 6.283185307179586;\r\n\t\r\n\t\tvar rayFacingNegative = vertical ? \r\n\t\t\t\t\t\t\t\t!(rayAngle > 6.283185307179586 * 0.75 || rayAngle < 6.283185307179586 * 0.25) :\r\n\t\t\t\t\t\t\t\t(rayAngle < 0 || rayAngle > Math.PI);\r\n\t\tvar slope = vertical ? Math.sin(rayAngle) / Math.cos(rayAngle) : Math.cos(rayAngle) / Math.sin(rayAngle);\r\n\t\t\r\n\t\tvar Xa = rayFacingNegative ? -1 : 1;\r\n\t\tvar Ya = Xa * slope;\r\n\t\tif(!vertical)\r\n\t\t{\r\n\t\t\tYa = rayFacingNegative ? -1 : 1;\r\n\t\t\tXa = Ya * slope;\r\n\t\t}\t\r\n\t\tvar isFound = false;\r\n\t\r\n\t\t// This is the first block to check if something is there.\r\n\t\tvar initialA = vertical ? (rayFacingNegative ? Math.floor(player.x) : Math.ceil(player.x)) : (rayFacingNegative ? Math.ceil(player.y) : Math.floor(player.y)),\r\n\t\t\tinitialB = vertical ? player.y + (initialA - player.x) * slope : player.x + (initialA - player.y) * slope;\r\n\t\tvar startingCoordinates = {\r\n\t\t\tx: vertical ? initialA : initialB,\r\n\t\t\ty: vertical ? initialB : initialA\r\n\t\t};\r\n\t\r\n\t\tvar checkMap = function(coordinate, mapArray){\r\n\t\t\tvar x = Math.floor(coordinate.x + (vertical ? (rayFacingNegative ? -1 : 0): 0)),\r\n\t\t\t\ty = Math.floor(coordinate.y + (!vertical ? (rayFacingNegative ? -1 : 0): 0)), \r\n\t\t\t\tbounds = (y * world.size) + x;\r\n\t\t\tif(x < world.size && y < world.size && x >= 0 && y >= 0){\r\n\t\t\t\tif(bounds >= 0 && bounds < mapArray.length){\r\n\t\t\t\t\treturn mapArray[bounds];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn 2;\r\n\t\t};\r\n\t\t\r\n\t\t// This doesn't do ceil operator, because we need the precision for texel calcs.\r\n\t\tvar takeStep = function(dX, dY, coordinate){\r\n\t\t\tcoordinate.x += dX;\r\n\t\t\tcoordinate.y += dY;\r\n\t\t\treturn coordinate;\r\n\t\t};\t\r\n\t\r\n\t\tvar tempCoordinates = { x: 0, y: 0 };\r\n\t\t// check for block in coordinates, if so, return that block coordinate\r\n\t\t// if not, take a step and check until it hits or is out of bounds.\r\n\t\tif(vertical ? checkMap(startingCoordinates, map) != 1 : true)\r\n\t\t\twhile(!isFound){\r\n\t\t\t\ttempCoordinates = takeStep(Xa, Ya, startingCoordinates);\r\n\t\t\t\tswitch(checkMap(tempCoordinates, map))\r\n\t\t\t\t{\r\n\t\t\t\t\tcase 1: startingCoordinates = tempCoordinates; isFound = true; break;\r\n\t\t\t\t\tcase 2: startingCoordinates = { x: -10000, y: -10000 }; isFound = true; break;\r\n\t\t\t\t\tdefault: break;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\tvar distanceFromPlayerX = startingCoordinates.x - player.x,\r\n\t\t\tdistanceFromPlayerY = startingCoordinates.y - player.y;\r\n\t\treturn { x: Math.floor(startingCoordinates.x), \r\n\t\t\t\ty: Math.floor(startingCoordinates.y), \r\n\t\t\t\tdist: distanceFromPlayerX * distanceFromPlayerX + distanceFromPlayerY * distanceFromPlayerY,\r\n\t\t\t\tactCoords: startingCoordinates };\r\n\t}", "function hitTestRectangle(r1, r2) {\n\n //Define the variables we'll need to calculate\n var hit, combinedHalfWidths, combinedHalfHeights, vx, vy, globalZero;\n\n //hit will determine whether there's a collision\n hit = false;\n\n //Find the center points of each sprite\n globalZero = new PIXI.Point(0, 0);\n r1.centerX = r1.toGlobal(globalZero).x;\n r1.centerY = r1.toGlobal(globalZero).y;\n r2.centerX = r2.toGlobal(globalZero).x;\n r2.centerY = r2.toGlobal(globalZero).y;\n\n // Find the half-widths and half-heights of each sprite\n // note: modiified the width and height by a descale factor found in globals.js\n r1.halfWidth = r1.width*HITBOX_SIZE_FACTOR / 2;\n r1.halfHeight = r1.height*HITBOX_SIZE_FACTOR / 2;\n r2.halfWidth = r2.width*HITBOX_SIZE_FACTOR / 2;\n r2.halfHeight = r2.height*HITBOX_SIZE_FACTOR / 2;\n\n //Calculate the distance vector between the sprites\n vx = r1.centerX - r2.centerX;\n vy = r1.centerY - r2.centerY;\n\n //Figure out the combined half-widths and half-heights\n combinedHalfWidths = r1.halfWidth + r2.halfWidth;\n combinedHalfHeights = r1.halfHeight + r2.halfHeight;\n\n //Check for a collision on the x axis\n if (Math.abs(vx) < combinedHalfWidths) {\n\n //A collision might be occuring. Check for a collision on the y axis\n if (Math.abs(vy) < combinedHalfHeights) {\n\n //There's definitely a collision happening\n hit = true;\n } else {\n\n //There's no collision on the y axis\n hit = false;\n }\n } else {\n\n //There's no collision on the x axis\n hit = false;\n }\n\n //`hit` will be either `true` or `false`\n return hit;\n}", "function intersect(a, b, edge, bbox) {\n return edge & 8 ? [a[0] + (b[0] - a[0]) * (bbox[3] - a[1]) / (b[1] - a[1]), bbox[3]] : // top\n edge & 4 ? [a[0] + (b[0] - a[0]) * (bbox[1] - a[1]) / (b[1] - a[1]), bbox[1]] : // bottom\n edge & 2 ? [bbox[2], a[1] + (b[1] - a[1]) * (bbox[2] - a[0]) / (b[0] - a[0])] : // right\n edge & 1 ? [bbox[0], a[1] + (b[1] - a[1]) * (bbox[0] - a[0]) / (b[0] - a[0])] : // left\n null;\n}", "function intersect(a, b, edge, bbox) {\n return edge & 8 ? [a[0] + (b[0] - a[0]) * (bbox[3] - a[1]) / (b[1] - a[1]), bbox[3]] : // top\n edge & 4 ? [a[0] + (b[0] - a[0]) * (bbox[1] - a[1]) / (b[1] - a[1]), bbox[1]] : // bottom\n edge & 2 ? [bbox[2], a[1] + (b[1] - a[1]) * (bbox[2] - a[0]) / (b[0] - a[0])] : // right\n edge & 1 ? [bbox[0], a[1] + (b[1] - a[1]) * (bbox[0] - a[0]) / (b[0] - a[0])] : // left\n null;\n}", "function intersect(a, b, edge, bbox) {\n return edge & 8 ? [a[0] + (b[0] - a[0]) * (bbox[3] - a[1]) / (b[1] - a[1]), bbox[3]] : // top\n edge & 4 ? [a[0] + (b[0] - a[0]) * (bbox[1] - a[1]) / (b[1] - a[1]), bbox[1]] : // bottom\n edge & 2 ? [bbox[2], a[1] + (b[1] - a[1]) * (bbox[2] - a[0]) / (b[0] - a[0])] : // right\n edge & 1 ? [bbox[0], a[1] + (b[1] - a[1]) * (bbox[0] - a[0]) / (b[0] - a[0])] : // left\n null;\n}", "function rectCollision(aX, aY, aW, aH, bX, bY, bW, bH) {\n\t// rect A collides with rect B if any of the corner\n\t// points of A is within B\n\t// OR lets not forget (lol) if B is within A !\n\n\treturn _oneOfPointsWithinRect(aX, aY, aW, aH, bX, bY, bW, bH) ||\n\t\t\t\t_oneOfPointsWithinRect(bX, bY, bW, bH, aX, aY, aW, aH);\n}", "function intersect () {\n var arg1 = arguments[0];\n var arg2 = arguments[1];\n if (arguments.length == 3) {\n var arg3 = arguments[2];\n if (arg3 instanceof Rect2d) {\n return intersect_Rect2d_Rect2d(arg1, arg2, arg3);\n }\n else if (arg3 instanceof Rect3d) {\n return intersect_Rect3d_Rect3d(arg1, arg2, arg3)\n }\n }\n else if (arguments.length == 2) {\n if (arg2 instanceof Ray3d) {\n if (arg1 instanceof Plane3d) {\n return intersect_Plane3d_Ray3d(arg1, arg2);\n }\n else if (arg1 instanceof Sphere) {\n return intersect_Sphere_Ray3d(arg1, arg2);\n }\n else if (arg1 instanceof Rect3d) {\n return intersect_Rect3d_Ray3d(arg1, arg2);\n }\n }\n else if (arg2 instanceof Ray2d) {\n if (arg1 instanceof Plane2d) {\n return intersect_Plane2d_Ray2d(arg1, arg2);\n }\n else if (arg1 instanceof Circle) {\n return intersect_Circle_Ray2d(arg1, arg2);\n }\n else if (arg1 instanceof Rect2d) {\n return intersect_Rect2d_Ray2d(arg1, arg2);\n }\n }\n else if (arg1 instanceof Circle && arg2 instanceof Circle) {\n return intersect_Circle_Circle(arg1, arg2);\n }\n else if (arg1 instanceof Sphere && arg2 instanceof Sphere) {\n return intersect_Sphere_Sphere(arg1, arg2);\n }\n else if (arg1 instanceof Rect2d && arg2 instanceof Circle) {\n return intersect_Rect2d_Circle(arg1, arg2);\n }\n else if (arg1 instanceof Rect3d && arg2 instanceof Sphere) {\n return intersect_Rect3d_Sphere(arg1, arg2);\n }\n }\n else {\n debug_assert(false, \"Incorrect number of arguments\")\n }\n}", "function intersection(head1, head2) {}", "function findIntersectY(r1x1, r1y1, r1x2, r1y2, x) {\r\n if (r1y1 == r1y2) {\r\n return {x: x, y: r1y1};\r\n }\r\n var r1m = (r1y1 - r1y2) / (r1x1 - r1x2);\r\n var r1b = r1y1 - (r1m * r1x1);\r\n\r\n var y = r1m * x + r1b;\r\n\r\n return {x: x, y: y};\r\n }", "function boxIntersect(red, blue, visit, full) {\n\t var n = red.length\n\t var m = blue.length\n\t\n\t //If either array is empty, then we can skip this whole thing\n\t if(n <= 0 || m <= 0) {\n\t return\n\t }\n\t\n\t //Compute dimension, if it is 0 then we skip\n\t var d = (red[0].length)>>>1\n\t if(d <= 0) {\n\t return\n\t }\n\t\n\t var retval\n\t\n\t //Convert red boxes\n\t var redList = pool.mallocDouble(2*d*n)\n\t var redIds = pool.mallocInt32(n)\n\t n = convertBoxes(red, d, redList, redIds)\n\t\n\t if(n > 0) {\n\t if(d === 1 && full) {\n\t //Special case: 1d complete\n\t sweep.init(n)\n\t retval = sweep.sweepComplete(\n\t d, visit, \n\t 0, n, redList, redIds,\n\t 0, n, redList, redIds)\n\t } else {\n\t\n\t //Convert blue boxes\n\t var blueList = pool.mallocDouble(2*d*m)\n\t var blueIds = pool.mallocInt32(m)\n\t m = convertBoxes(blue, d, blueList, blueIds)\n\t\n\t if(m > 0) {\n\t sweep.init(n+m)\n\t\n\t if(d === 1) {\n\t //Special case: 1d bipartite\n\t retval = sweep.sweepBipartite(\n\t d, visit, \n\t 0, n, redList, redIds,\n\t 0, m, blueList, blueIds)\n\t } else {\n\t //General case: d>1\n\t retval = boxIntersectIter(\n\t d, visit, full,\n\t n, redList, redIds,\n\t m, blueList, blueIds)\n\t }\n\t\n\t pool.free(blueList)\n\t pool.free(blueIds)\n\t }\n\t }\n\t\n\t pool.free(redList)\n\t pool.free(redIds)\n\t }\n\t\n\t return retval\n\t}", "function boxIntersect(red, blue, visit, full) {\n\t var n = red.length\n\t var m = blue.length\n\t\n\t //If either array is empty, then we can skip this whole thing\n\t if(n <= 0 || m <= 0) {\n\t return\n\t }\n\t\n\t //Compute dimension, if it is 0 then we skip\n\t var d = (red[0].length)>>>1\n\t if(d <= 0) {\n\t return\n\t }\n\t\n\t var retval\n\t\n\t //Convert red boxes\n\t var redList = pool.mallocDouble(2*d*n)\n\t var redIds = pool.mallocInt32(n)\n\t n = convertBoxes(red, d, redList, redIds)\n\t\n\t if(n > 0) {\n\t if(d === 1 && full) {\n\t //Special case: 1d complete\n\t sweep.init(n)\n\t retval = sweep.sweepComplete(\n\t d, visit, \n\t 0, n, redList, redIds,\n\t 0, n, redList, redIds)\n\t } else {\n\t\n\t //Convert blue boxes\n\t var blueList = pool.mallocDouble(2*d*m)\n\t var blueIds = pool.mallocInt32(m)\n\t m = convertBoxes(blue, d, blueList, blueIds)\n\t\n\t if(m > 0) {\n\t sweep.init(n+m)\n\t\n\t if(d === 1) {\n\t //Special case: 1d bipartite\n\t retval = sweep.sweepBipartite(\n\t d, visit, \n\t 0, n, redList, redIds,\n\t 0, m, blueList, blueIds)\n\t } else {\n\t //General case: d>1\n\t retval = boxIntersectIter(\n\t d, visit, full,\n\t n, redList, redIds,\n\t m, blueList, blueIds)\n\t }\n\t\n\t pool.free(blueList)\n\t pool.free(blueIds)\n\t }\n\t }\n\t\n\t pool.free(redList)\n\t pool.free(redIds)\n\t }\n\t\n\t return retval\n\t}", "function checkCollisionRectangle(x1, y1, width1, height1, x2, y2, width2, height2) {\n if (x1 > x2) {\n if (y1 > y2) {\n if (x1 - x2 < width2 && y1 - y2 < height2) {\n if (x1 - x2 > y1 - y2) { return 1; }\n return 2;\n }\n } else {\n if (x1 - x2 < width2 && y2 - y1 < height1) {\n if (x1 - x2 > y2 - y1) { return 1; }\n return 3;\n }\n }\n } else {\n if (y1 > y2) {\n if (x2 - x1 < width1 && y1 - y2 < height2) {\n if (x2 - x1 > y1 - y2) { return 0; }\n return 2;\n }\n } else {\n if (x2 - x1 < width1 && y2 - y1 < height1) {\n if (x2 - x1 > y2 - y1) { return 0; }\n return 3;\n }\n }\n }\n return -1;\n}", "static detectCollision(a, b) {\n // start with body a and body b\n for (let i=0; i<a.lines.length; i++) {\n for (let j=0; j<b.lines.length; j++) {\n let res = Line.intersect(a.lines[i],b.lines[j])\n if (res.c == true) {\n // draw lines that are intersecting\n // ctx.beginPath();\n // ctx.lineWidth = 5;\n // ctx.moveTo(a.lines[i].p1.x,a.lines[i].p1.y);\n // ctx.lineTo(a.lines[i].p2.x,a.lines[i].p2.y);\n // ctx.stroke();\n // ctx.beginPath();\n // ctx.moveTo(b.lines[j].p1.x,b.lines[j].p1.y);\n // ctx.lineTo(b.lines[j].p2.x,b.lines[j].p2.y);\n // ctx.stroke();\n // ctx.lineWidth = 1;\n return {c:true, x:res.x, y:res.y}\n }\n }\n }\n return {c:false, x:undefined, y:undefined}\n }", "function labelRectangleIntersection(lk, li, vi, pi) {\n let min = 0;\n let max = Number.POSITIVE_INFINITY;\n if (vi.y !== 0) {\n const firstIntersection = (lk.height / 2 + li.height / 2 - li.offsetY + (lk.top + lk.bottom) / 2 - pi.y) / vi.y;\n const secondIntersection = (-lk.height / 2 - li.height / 2 - li.offsetY + (lk.top + lk.bottom) / 2 - pi.y) / vi.y;\n // Multiplying by a negative sign reverses an inequality\n if (vi.y > 0) {\n max = Math.min(max, firstIntersection);\n min = Math.max(min, secondIntersection);\n } else {\n min = Math.max(min, firstIntersection);\n max = Math.min(max, secondIntersection);\n }\n } else {\n // vector is vertical and they will never intersect\n if (li.offsetY + pi.y - (lk.top + lk.bottom) / 2 > lk.height / 2 + li.height / 2) return interval.empty();\n if (li.offsetY + pi.y - (lk.top + lk.bottom) / 2 < -lk.height / 2 - li.height / 2) return interval.empty();\n }\n if (vi.x !== 0) {\n const thirdIntersection = (lk.width / 2 + li.width / 2 + (lk.right + lk.left) / 2 - pi.x - li.offsetX) / vi.x;\n const fourthIntersection = (-lk.width / 2 - li.width / 2 + (lk.right + lk.left) / 2 - pi.x - li.offsetX) / vi.x;\n if (vi.x > 0) {\n max = Math.min(max, thirdIntersection);\n min = Math.max(min, fourthIntersection);\n } else {\n min = Math.max(min, thirdIntersection);\n max = Math.min(max, fourthIntersection);\n }\n } else {\n if (pi.x + li.offsetX - (lk.right + lk.left) / 2 > lk.width / 2 + li.width / 2) return interval.empty();\n if (pi.x + li.offsetX - (lk.right + lk.left) / 2 < -lk.width / 2 - li.width / 2) return interval.empty();\n }\n\n // Only interested in positive values\n return interval(min, max);\n}", "function intersectRect(rect, p) {\n var cx = rect.x, cy = rect.y, dx = p.x - cx, dy = p.y - cy, w = rect.width / 2, h = rect.height / 2;\n\n if (dx == 0)\n return { \"x\": p.x, \"y\": rect.y + (dy > 0 ? h : -h) };\n\n var slope = dy / dx;\n\n var x0 = null, y0 = null;\n if (Math.abs(slope) < rect.height / rect.width) {\n // intersect with the left or right edges of the rect\n x0 = rect.x + (dx > 0 ? w : -w);\n y0 = cy + slope * (x0 - cx);\n } else {\n y0 = rect.y + (dy > 0 ? h : -h);\n x0 = cx + (y0 - cy) / slope;\n }\n\n return { \"x\": x0, \"y\": y0 };\n }", "rectIntersectsGround(x, y, w, h) {\n for (let i = x; i < x + w; i++) {\n for (let j = y; j < y + h; j++) {\n if (this.isGround(i, j)) {\n return true;\n }\n }\n }\n return false;\n }", "intersect(other) { }", "function collisionRect(x1,y1,w1,h1,x2,y2,w2,h2) {\n\treturn (x1 < x2 + w2) && (x1 + w1 > x2) && (y1 < y2 + h2) && (y1 + h1 > y2);\n}", "function collision(rect1, rect2) {\n if (rect1.x < rect2.x + rect2.width &&\n rect1.x + rect1.width > rect2.x &&\n rect1.y < rect2.y + rect2.height &&\n rect1.y + rect1.height > rect2.y) {\n return true;\n }\n}", "function isLineOfSight(a,b){\n\t\n\t//quick check\n\t//print(isColorEqualP2C(b,obstacleColor));\n\t\n\t//var startTime5 = millis();\n\n\tif(obstacles.length>0 && isColorEqualP2C(b,obstacleColor)){\n\t\treturn false;\n\t\t\n\t}\n\t\n\t//print(Math.round(millis()-startTime5));\n\t\n\tif(obstacles.length==0){//if no obstacles - everything can be seen\n\t\treturn true;\n\t}\n\t\n\t//rigorous check stage 1\n\n\tvar normalVector = new Point2(-(b.y-a.y),b.x-a.x);\n\tvar offset = dotP2(a,normalVector);\n\t\n\t//print(normalVector);\n\tvar count = 0 ; //=1 if obstacle not intersected\n\tvar count2 = 0; //number of edges which does not intersect\n\n\tfor(var i = 0; i<obstacles.length; i++){\n\t\tif(obstacles[i].isConvex){\n\t\t\t\n\t\t\tcount = 0; //=1 if this obstacle does not intersect\n\t\t\t//bounding box\n\t\t\tif(a.x > obstacles[i].largestX && b.x > obstacles[i].largestX){count++;}\n\t\t\telse if(a.y > obstacles[i].largestY && b.y > obstacles[i].largestY){count++;}\n\t\t\telse if(a.x < obstacles[i].smallestX && b.x < obstacles[i].smallestX){count++;}\n\t\t\telse if(a.y < obstacles[i].smallestY && b.y < obstacles[i].smallestY){count++;}\n\t\t\telse{//projection check: //rigorous check stage 2\n\t\t\t\t// checking edge by edge for an intersection\n\t\t\t\t\n\t\t\t\tfor(var j = 0; j < obstacles[i].vertices.length-1; j++){\n\t\t\t\t\tcount2 = 0;//num of edges which does not intersect\n\t\t\t\t\t//bounding box\n\t\t\t\t\tif(a.x > obstacles[i].largestXArray[j] && b.x > obstacles[i].largestXArray[j]){count2++;}\n\t\t\t\t\telse if(a.y > obstacles[i].largestYArray[j] && b.y > obstacles[i].largestYArray[j]){count2++;}\n\t\t\t\t\telse if(a.x < obstacles[i].smallestXArray[j] && b.x < obstacles[i].smallestXArray[j]){count2++;}\n\t\t\t\t\telse if(a.y < obstacles[i].smallestYArray[j] && b.y < obstacles[i].smallestYArray[j]){count2++;}\n\t\t\t\t\telse{//projection check2: // rigorous check stage 3\n\t\t\t\t\t\t//print(\"here\")\n\t\t\t\t\t\t//projection 1\n\t\t\t\t\t\tvar projections1 = [];\n\t\t\t\t\t\tprojections1.push(dotP2(obstacles[i].vertices[j],normalVector)-offset);\n\t\t\t\t\t\tprojections1.push(dotP2(obstacles[i].vertices[j+1],normalVector)-offset);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//projection 2\n\t\t\t\t\t\tvar projections2 = [];\n\t\t\t\t\t\tprojections2.push(dotP2(a,obstacles[i].normalDirectionArray[j])-obstacles[i].offsetArray[j]);\n\t\t\t\t\t\tprojections2.push(dotP2(b,obstacles[i].normalDirectionArray[j])-obstacles[i].offsetArray[j]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//print(projections1);\n\t\t\t\t\t\tif(projections1[0]*projections1[1]>0 || projections2[0]*projections2[1]>0 ){count2++;}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(count2 == 0){//intersection found with a edge (obs-i,edge-j) - stop\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(count2 == 1){\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(count == 0){//intersection with ith obs\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tif(addObstacleMode==0){\n\t\t\t\tprint(\"Non Convex Obstacle Exists!!!\");\n\t\t\t}\n\t\t\t//obstacles[i].calculateReflexVertices();\n\t\t\t//print(obstacles[i].isConvex);\n\t\t\t//sampling based tech for nonConvex obstacles \n\t\t}\n\t}\n\t\n\tif(count==1){//no intersection with all the obstacles till the last one\n\t\t//print(\"bfbd\")\n\t\treturn true;\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "function intersectRect(node, point) {\n var x = node.x;\n var y = node.y;\n var dx = point.x - x;\n var dy = point.y - y;\n var w = $(\"#\" + node.customId).attr('width') / 2;\n var h = $(\"#\" + node.customId).attr('height') / 2;\n var sx = 0,\n sy = 0;\n if (Math.abs(dy) * w > Math.abs(dx) * h) {\n // Intersection is top or bottom of rect.\n if (dy < 0) {\n h = -h;\n }\n sx = dy === 0 ? 0 : h * dx / dy;\n sy = h;\n } else {\n // Intersection is left or right of rect.\n if (dx < 0) {\n w = -w;\n }\n sx = w;\n sy = dx === 0 ? 0 : w * dy / dx;\n }\n return {\n x: x + sx,\n y: y + sy\n };\n}", "function intersectRect(node, point) {\n var x = node.x;\n var y = node.y;\n var dx = point.x - x;\n var dy = point.y - y;\n var w = $(\"#\" + node.customId).attr('width') / 2;\n var h = $(\"#\" + node.customId).attr('height') / 2;\n var sx = 0,\n sy = 0;\n if (Math.abs(dy) * w > Math.abs(dx) * h) {\n // Intersection is top or bottom of rect.\n if (dy < 0) {\n h = -h;\n }\n sx = dy === 0 ? 0 : h * dx / dy;\n sy = h;\n } else {\n // Intersection is left or right of rect.\n if (dx < 0) {\n w = -w;\n }\n sx = w;\n sy = dx === 0 ? 0 : w * dy / dx;\n }\n return {\n x: x + sx,\n y: y + sy\n };\n}", "function intersectRectCenter(x1,y1,w1,h1,x2,y2,w2,h2) {\n\treturn {\"x\" : .5*((w1 + w2) - Math.abs(x1 - x2) * 2),\n \"y\" : .5*((h1 + h2) - Math.abs(y1 - y2) * 2)};\n}", "function tp_intersect_circle(left, top, right, bottom) { \n\tvar desc1, ref1, desc2;\n\n\tdesc1 = new ActionDescriptor(); \n\tref1 = new ActionReference(); \n\tref1.putProperty(charIDToTypeID('Chnl'), charIDToTypeID('fsel')); \n\tdesc1.putReference(charIDToTypeID('null'), ref1); \n\n\tdesc2 = new ActionDescriptor(); \n\tdesc2.putUnitDouble(charIDToTypeID('Top '), charIDToTypeID('#Pxl'), top); \n\tdesc2.putUnitDouble(charIDToTypeID('Left'), charIDToTypeID('#Pxl'), left); \n\tdesc2.putUnitDouble(charIDToTypeID('Btom'), charIDToTypeID('#Pxl'), bottom); \n\tdesc2.putUnitDouble(charIDToTypeID('Rght'), charIDToTypeID('#Pxl'), right); \n\tdesc1.putObject(charIDToTypeID('T '), charIDToTypeID('Elps'), desc2); \n\tdesc1.putBoolean(charIDToTypeID('AntA'), true); \n\texecuteAction(charIDToTypeID('IntW'), desc1, DialogModes.NO);\n}", "function boundsIntersect(bounds1, bounds2) {\n let topEdge1 = bounds1.endY;\n let rightEdge1 = bounds1.endX;\n let leftEdge1 = bounds1.startX;\n let bottomEdge1 = bounds1.startY;\n let topEdge2 = bounds2.endY;\n let rightEdge2 = bounds2.endX;\n let leftEdge2 = bounds2.startX;\n let bottomEdge2 = bounds2.startY;\n\n return (\n leftEdge1 < rightEdge2 &&\n rightEdge1 > leftEdge2 &&\n bottomEdge1 < topEdge2 &&\n topEdge1 > bottomEdge2\n );\n}", "function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {\n\n // Check if none of the lines are of length 0\n if ((x1 === x2 && y1 === y2) || (x3 === x4 && y3 === y4)) {\n return false\n }\n \n denominator = ((y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1))\n \n // Lines are parallel\n if (denominator === 0) {\n return false\n }\n \n var ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator\n var ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denominator\n \n // is the intersection along the segments\n if (ua < 0 || ua > 1 || ub < 0 || ub > 1) {\n return false\n }\n \n // Return a object with the x and y coordinates of the intersection\n var x = x1 + ua * (x2 - x1)\n var y = y1 + ua * (y2 - y1)\n \n return {x: x, y: y}\n }", "intersect(other) {\n let d = dist(this.x, this.y, other.x, other.y);\n return (d < this.r + other.r);\n }", "intersects_rect(rect) {\n var shield_t, shield_b;\n if (this.stance == 1) {\n shield_t = hb_rect(this,1) + 64;\n shield_b = hb_rect(this,3);\n }\n if (this.stance == 0) {\n shield_t = hb_rect(this,1);\n shield_b = hb_rect(this,3) - 64;\n }\n hb_rect(this,1)\n if ((hb_rect(rect,0) >= hb_rect(this,0) && hb_rect(rect,0) <= hb_rect(this,2))\n || (hb_rect(rect,2) >= hb_rect(this,0) && hb_rect(rect,2) <= hb_rect(this,2))) {\n if (this.dir != rect.dir) {\n if ((hb_rect(rect,1) >= shield_t && hb_rect(rect,1) <= shield_b)\n || (hb_rect(rect,3)-1 >= shield_t && hb_rect(rect,3)-1 <= shield_b)) {\n console.log(\"s-hit\");\n return 2;\n }\n }\n if ((hb_rect(rect,1) >= hb_rect(this,1) && hb_rect(rect,1) <= hb_rect(this,3))\n || (hb_rect(rect,3)-1 >= hb_rect(this,1) && hb_rect(rect,3)-1 <= hb_rect(this,3))) {\n console.log(\"hit\");\n return true;\n }\n else {console.log(\"xhit\")}\n }\n else {console.log(\"nohit\")}\n return false;\n }", "function unionRectangles(rect1, rect2) {\r\n\t\tvar rect = {\r\n\t\t\ttop : (Math.min(rect1.top, rect2.top)),\r\n\t\t\tbottom : (Math.max(rect1.bottom, rect2.bottom)),\r\n\t\t\tleft : (Math.min(rect1.left, rect2.left)),\r\n\t\t\tright : (Math.max(rect1.right, rect2.right))\r\n\t\t}\r\n\t\trect.width = rect.right - rect.left;\r\n\t\trect.height = rect.bottom - rect.top;\r\n\r\n\t\treturn rect;\r\n\t}", "function unionRectangles(rect1, rect2) {\n var rect = {\n top: (Math.min(rect1.top, rect2.top)),\n bottom: (Math.max(rect1.bottom, rect2.bottom)),\n left: (Math.min(rect1.left, rect2.left)),\n right: (Math.max(rect1.right, rect2.right))\n }\n rect.width = rect.right - rect.left;\n rect.height = rect.bottom - rect.top;\n\n return rect;\n }", "function intersect_Rect2d_Rect2d (pRectA, pRectB, pResult) {\n debug_assert(pResult, \"a result address must be provided\");\n pResult.fX0 = Math.max(pRectA.fX0, pRectB.fX0);\n pResult.fX1 = Math.min(pRectA.fX1, pRectB.fX1);\n if (pResult.fX0 < pResult.fX1) {\n pResult.fY0 = Math.max(pRectA.fY0, pRectB.fY0);\n pResult.fY1 = Math.min(pRectA.fY1, pRectB.fY1);\n if (pResult.fY0 < pResult.fY1) {\n return true;\n }\n }\n return false;\n}", "function overlapTest(a, b) {\n return a.x < b.x + b.w && a.x + a.w > b.x &&\n\t\t a.y < b.y + b.h && a.y + a.h > b.y\n}", "intersects_rect(rect) {\n console.log(\"hitbox\",hb_rect(this,0));\n console.log(\"rectpos\",rect[0]);\n if ((hb_rect(rect,0) >= hb_rect(this,0) && hb_rect(rect,0) <= hb_rect(this,2))\n || (hb_rect(rect,2) >= hb_rect(this,0) && hb_rect(rect,2) <= hb_rect(this,2))) {\n if ((hb_rect(rect,1) >= hb_rect(this,1) && hb_rect(rect,1) <= hb_rect(this,3))\n || (hb_rect(rect,3)-1 >= hb_rect(this,1) && hb_rect(rect,3)-1 <= hb_rect(this,3))) {\n console.log(\"hit\");\n return true;\n }\n else {console.log(\"xhit\")}\n }\n else {console.log(\"nohit\")}\n return false;\n }", "function overlapTest(a, b) {\n return a.x < b.x + b.w && a.x + a.w > b.x &&\n a.y < b.y + b.h && a.y + a.h > b.y\n}", "function overlapTest(a, b) {\n return a.x < b.x + b.w && a.x + a.w > b.x &&\n a.y < b.y + b.h && a.y + a.h > b.y\n}", "function intersect(pos1, size1, pos2, size2) {\n return (pos1.x < pos2.x + size2.w && pos1.x + size1.w > pos2.x &&\n pos1.y < pos2.y + size2.h && pos1.y + size1.h > pos2.y);\n}" ]
[ "0.7528436", "0.752486", "0.73316234", "0.7312936", "0.72516924", "0.72367334", "0.71376795", "0.71376795", "0.71376795", "0.71376795", "0.71376795", "0.71224856", "0.71224856", "0.71224856", "0.71224856", "0.71224856", "0.71224856", "0.71224856", "0.71224856", "0.70669717", "0.70534104", "0.7015262", "0.7005103", "0.69973737", "0.69973737", "0.69973737", "0.69946426", "0.6984371", "0.69817334", "0.6859432", "0.6854413", "0.684779", "0.6826216", "0.67990893", "0.67948645", "0.679174", "0.6787504", "0.67516315", "0.67516315", "0.67041075", "0.6700585", "0.6699827", "0.6690656", "0.6683081", "0.66822773", "0.6608495", "0.66028655", "0.6593269", "0.6543637", "0.6498562", "0.64922535", "0.644931", "0.6445452", "0.6425411", "0.64171964", "0.6410889", "0.6398259", "0.63978374", "0.6351834", "0.6321822", "0.6294321", "0.6294321", "0.62695026", "0.6258034", "0.62477016", "0.62442124", "0.62376803", "0.62356347", "0.62356347", "0.62356347", "0.6234603", "0.62295645", "0.6224777", "0.6210412", "0.61954355", "0.61954355", "0.61892575", "0.61877954", "0.6174781", "0.61737156", "0.6172817", "0.61716896", "0.61662614", "0.61524534", "0.615028", "0.6128356", "0.6128356", "0.61212724", "0.6115498", "0.61125195", "0.61122406", "0.6112172", "0.60983574", "0.60951096", "0.6094152", "0.60897446", "0.6077459", "0.60774064", "0.60698384", "0.60698384", "0.60639143" ]
0.0
-1
A utility function to create HTML.
function getHtml(template) { return template.join('\n'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createHtml(o){\n var b = '',\n attr,\n val,\n key,\n cn;\n\n if(typeof o == \"string\"){\n b = o;\n } else if (Ambow.isArray(o)) {\n for (var i=0; i < o.length; i++) {\n if(o[i]) {\n b += createHtml(o[i]);\n }\n };\n } else {\n b += '<' + (o.tag = o.tag || 'div');\n for (attr in o) {\n val = o[attr];\n if(!confRe.test(attr)){\n if (typeof val == \"object\") {\n b += ' ' + attr + '=\"';\n for (key in val) {\n b += key + ':' + val[key] + ';';\n };\n b += '\"';\n }else{\n b += ' ' + ({cls : 'class', htmlFor : 'for'}[attr] || attr) + '=\"' + val + '\"';\n }\n }\n };\n // Now either just close the tag or try to add children and close the tag.\n if (emptyTags.test(o.tag)) {\n b += '/>';\n } else {\n b += '>';\n if ((cn = o.children || o.cn)) {\n b += createHtml(cn);\n } else if(o.html){\n b += o.html;\n }\n b += '</' + o.tag + '>';\n }\n }\n return b;\n }", "function createHtml(o){\n var b = '',\n attr,\n val,\n key,\n keyVal,\n cn;\n\n if(typeof o == \"string\"){\n b = o;\n } else if (Ext.isArray(o)) {\n for (var i=0; i < o.length; i++) {\n if(o[i]) {\n b += createHtml(o[i]);\n }\n };\n } else {\n b += '<' + (o.tag = o.tag || 'div');\n for (attr in o) {\n val = o[attr];\n if(!confRe.test(attr)){\n if (typeof val == \"object\") {\n b += ' ' + attr + '=\"';\n for (key in val) {\n b += key + ':' + val[key] + ';';\n };\n b += '\"';\n }else{\n b += ' ' + ({cls : 'class', htmlFor : 'for'}[attr] || attr) + '=\"' + val + '\"';\n }\n }\n };\n // Now either just close the tag or try to add children and close the tag.\n if (emptyTags.test(o.tag)) {\n b += '/>';\n } else {\n b += '>';\n if ((cn = o.children || o.cn)) {\n b += createHtml(cn);\n } else if(o.html){\n b += o.html;\n }\n b += '</' + o.tag + '>';\n }\n }\n return b;\n }", "function genFinalHtml() {\r\n ` </div> \r\n\r\n </body>\r\n </html`;\r\n}", "get html() {\n let html = '<div style=\"background: #fff; border: solid 1px #000; border-radius: 5px; font-weight: bold; margin-bottom: 1em; overflow: hidden;\">';\n html += '<div style=\"background: #000; color: #fff; text-align: center;\">' + this._header + '</div>';\n html += '<div style=\"padding: 5px;\">' + this._content + '</div>';\n html += '</div>';\n return html;\n }", "function generateHTML(node) {\n\n if (node.name === 'h4') {\n\n html = h4(lib, node)\n\n } else if (node.name === 'h5') {\n\n html = h5(lib, node)\n\n } else if (node.name === 'img') {\n\n html = img(lib, node)\n\n } else {\n\n html = '<' + node.name + ' not-yet-supported/>'\n }\n\n debug('generate <%s> --> %s', node.name, html)\n\n return html\n}", "function createMarkup(data) {\n return { __html: data };\n}", "generateHTML(type, classes, parent = app, text = \"\", id = \"\") {\n const element = document.createElement(type);\n element.classList = (classes);\n element.innerText = (text);\n element.id = (id);\n parent.appendChild(element);\n return element;\n }", "render() {\n return html ``;\n }", "function makeTemplate() {\n return html`\n\n <div class=\"display-div\"> </div>\n\n `;\n}", "render(){return html``}", "function createHTMLString(item) {\n return `\n <li class=\"content\">\n <img src=\"${item.image}\" alt=\"${item.type}\" class=\"item__thumbnail>\n <p class=\"item_description>${item.gender}, ${item.size} size</p>\n `;\n}", "function createHTML(postsData) {\n\tvar ourHTMLString = '';\n\tfor (i = 0; i < postsData.length; i++) {\n\t\tourHTMLString += '<h2>' + postsData[i].title.rendered + '</h2>';\n\t}\n\tppc.innerHTML = ourHTMLString;\n}", "function generateHtml() {\n const folder = fs.readdirSync(`${__dirname}/projects`);\n let myHtml = \" \";\n folder.forEach((arg) => {\n myHtml += `<p><a href=\"/${arg}/\">${arg}</a></p>`;\n });\n return myHtml;\n}", "function SafeHtml() {}", "function SafeHtml() {}", "function SafeHtml() {}", "function SafeHtml() {}", "function SafeHtml() {}", "wrapHTML(title, body) {\n\t\treturn `<!DOCTYPE html>\\\n\t\t<html>\\\n\t\t\t<head>\\\n\t\t\t\t<meta charset=\"UTF-8\">\\\n\t\t\t\t<link rel=\"stylesheet\" href=\"/style.css\">\\\n\t\t\t\t<link href=\"https://fonts.googleapis.com/css?family=Ovo\" rel=\"stylesheet\">\\\n\t\t\t\t<title>${title} - ${config.username}</title>\\\n\t\t\t</head>\\\n\t\t\t<body>\\\n\t\t\t\t<div id=\"container\">\\\n\t\t\t\t\t<div id=\"header\">\\\n\t\t\t\t\t\t<h1>${title} - ${config.username}</h1>\\\n\t\t\t\t\t</div>\\\n\t\t\t\t\t<div id=\"text-area\">\\\n\t\t\t\t\t\t${body}\\\n\t\t\t\t\t</div>\\\n\t\t\t\t</div>\\\n\t\t\t</body>\\\n\t\t</html>`;\n\t}", "function createHTML(hashTable){\n return '<!DOCTYPE html>\\n' +\n '<html lang=\"en\">\\n' +\n '\\t<head>\\n' +\n '\\t\\t<meta charset=\"UTF-8\">\\n' +\n '\\t\\t<title>The Elements - ' + hashTable.elementName + '</title>\\n'+\n '\\t\\t<link rel=\"stylesheet\" href=\"css/styles.css\">\\n'+\n '\\t</head>\\n'+\n '\\t<body>\\n' +\n '\\t\\t<h1>' + hashTable.elementName + '</h1>\\n' +\n '\\t\\t<h2>' + hashTable.elementSymbol + '</h2>\\n' +\n '\\t\\t<h3>Atomic number ' + hashTable.elementAtomicNumber + '</h3>\\n' +\n '\\t\\t<p>' + hashTable.elementDescription + '</p>\\n' +\n '\\t\\t<p><a href=\"/\">back</a></p>\\n' +\n '\\t</body>\\n'+\n '</html>';\n}", "createMarkup(html) {\n return {\n __html: html\n };\n }", "renderHTML() {\n \n }", "function makeHTML([title, rating, index]) {\n return `\n <li id=\"${index}\">\n ${title}: ${rating} \n <button class=\"remove\">\n REMOVE\n </button>\n </li>\n `\n}", "function html(h, ...values){ return h.join('');}", "toHtml()\n\t{\n //to finish \n var answer = '<div class=\"student-project-panel\"><div class=\"personal-row\"> <h3>' \n\t\t+ this.name + '</h3><span class=\"'+ map_dot[this.status]+'\"></span></div></div>'\n\t\treturn answer;\n\t}", "generateHTML() {\n return `<nav>${this.generateMenu(this.data)}</nav>`;\n }", "function createHTMLString(item) {\r\n return `\r\n <li class=\"item\">\r\n <img src=\"${item.image}\" alt=\"${item.type}\" class=\"item__thumbnnail\">\r\n <span class=\"item__desctiption\">${item.gender}, ${item.size}</span>\r\n </li>\r\n `;\r\n}", "function buildHTML(tree, options) {\n // buildExpression is destructive, so we need to make a clone\n // of the incoming tree so that it isn't accidentally changed\n tree = JSON.parse((0, _stringify2.default)(tree));\n\n // Build the expression contained in the tree\n var expression = buildExpression(tree, options, true);\n var body = makeSpan([\"base\"], expression, options);\n\n // Add struts, which ensure that the top of the HTML element falls at the\n // height of the expression, and the bottom of the HTML element falls at the\n // depth of the expression.\n var topStrut = makeSpan([\"strut\"]);\n var bottomStrut = makeSpan([\"strut\", \"bottom\"]);\n\n topStrut.style.height = body.height + \"em\";\n bottomStrut.style.height = body.height + body.depth + \"em\";\n // We'd like to use `vertical-align: top` but in IE 9 this lowers the\n // baseline of the box to the bottom of this strut (instead staying in the\n // normal place) so we use an absolute value for vertical-align instead\n bottomStrut.style.verticalAlign = -body.depth + \"em\";\n\n // Wrap the struts and body together\n var htmlNode = makeSpan([\"katex-html\"], [topStrut, bottomStrut, body]);\n\n htmlNode.setAttribute(\"aria-hidden\", \"true\");\n\n return htmlNode;\n}", "function createTemplate (data) {\n var htmlTemplate = `\n <!DOCTYPE html>\n <html>\n <head>\n <title>Authors</title>\n </head>\n <body>\n ${data}\n </body>\n </html>\n `;\n return htmlTemplate;\n}", "function writeHTML(array) { \n return `\n <!DOCTYPE html>\n <html lang=\"en\">\n \n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <title>Team Profile Generator</title>\n <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css\" integrity=\"sha512-HK5fgLBL+xu6dm/Ii3z4xhlSUyZgTT9tuc/hSrtw6uzJOvgRr2a9jyxxT1ely+B+xFAmJKVSTbpM/CuL7qxO8w==\" crossorigin=\"anonymous\" />\n <link rel=\"stylesheet\" href=\"./dist/style.css\">\n </head>\n\n <body>\n <header>\n <h1>\n Team Profile \n </h1>\n </header>\n\n <main>\n <div class=\"main\">\n ${writeEmployees(array)}\n </div>\n </main>\n </body>\n `\n}", "function buildHTML(tree, options) {\n // buildExpression is destructive, so we need to make a clone\n // of the incoming tree so that it isn't accidentally changed\n tree = JSON.parse(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(tree));\n\n // Build the expression contained in the tree\n var expression = buildExpression(tree, options, true);\n var body = makeSpan([\"base\"], expression, options);\n\n // Add struts, which ensure that the top of the HTML element falls at the\n // height of the expression, and the bottom of the HTML element falls at the\n // depth of the expression.\n var topStrut = makeSpan([\"strut\"]);\n var bottomStrut = makeSpan([\"strut\", \"bottom\"]);\n\n topStrut.style.height = body.height + \"em\";\n bottomStrut.style.height = body.height + body.depth + \"em\";\n // We'd like to use `vertical-align: top` but in IE 9 this lowers the\n // baseline of the box to the bottom of this strut (instead staying in the\n // normal place) so we use an absolute value for vertical-align instead\n bottomStrut.style.verticalAlign = -body.depth + \"em\";\n\n // Wrap the struts and body together\n var htmlNode = makeSpan([\"katex-html\"], [topStrut, bottomStrut, body]);\n\n htmlNode.setAttribute(\"aria-hidden\", \"true\");\n\n return htmlNode;\n}", "html()\n{\n console.log(\"Rendering\");\n const html = ` <h2>${this.name}</h2>\n <div class=\"image\"><img src=\"${this.imgSrc}\" alt=\"${this.imgAlt}\"></div>\n <div>\n <div>\n <h3>Distance</h3>\n <p>${this.distance}</p>\n </div>\n <div>\n <h3>Difficulty</h3>\n <p>${this.difficulty}</p>\n </div>\n </div>`;\n\n return html;\n}", "function createHTML(resultArray) {\n let htmlString = `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>Cars</title>\n </head>\n <body>\n <h1>Search result</h1>\n <table>\n <thead>\n <th>Model</th>\n <th>Licence</th>\n </thead>\n <tbody>`;\n\n for (let car of resultArray) {\n htmlString += `<tr>\n <td>${car.model}</td><td>${car.licence}</td></tr>`;\n }\n\n htmlString += `</tbody> \n </table>\n </body>\n </html>`;\n}", "function createHTML (studentSet) {\n\tvar frame = '';\n\tfor (var i=0; i < studentSet.length; i++) {\n\t\tframe += \"<li class='list-group-item body-text'>\"; \n\t\tframe += \"<b>\" + studentSet[i].studentName + \"</b> - \";\n\t\tframe += studentSet[i].description + \"</li>\";\n\t}\n\treturn frame;\n}", "function SafeHtml() { }", "function SafeHtml() { }", "function SafeHtml() { }", "function GenerateTagHTML(tags) {\r\n \r\n var html = '<div class=\"tags\">';\r\n \r\n // Generate the html for each of the tags and return it\r\n $.each(tags, function(key, tag) { html += '<span>' + tag + '</span>' });\r\n return html + '</div>';\r\n \r\n }", "function buildHTML() {\n //initialize html\n html = \"\";\n\n for(var i=0; i<elements.length; i++) {\n switch(elements[i].type) {\n case 'title':\n buildTitle(elements[i].options);\n break;\n case 'header':\n buildHeader(elements[i].options);\n break;\n case 'img-one':\n buildImageOne(elements[i].options);\n break;\n case 'img-two':\n buildImageTwo(elements[i].options);\n break;\n case 'img-three':\n buildImageThree(elements[i].options);\n break;\n case 'article-right':\n buildArticleRight(elements[i].options);\n break;\n case 'article-left':\n buildArticleLeft(elements[i].options);\n break;\n case 'text' :\n buildText(elements[i].options);\n break;\n \n }\n }\n buildEnd();\n\n document.getElementById('HTML').innerText = `${html}`;\n}", "function SafeHtml(){}", "showHTML() { \n return `\n <div class='showRecipes'>\n <div>\n <h3>${this.recipeTitle}</h3> \n </div> \n <div>\n ${'Time: ' + this.recipeTime}\n </div>\n <div>\n ${this.recipeIngredients}\n </div>\n <div>\n ${this.recipeAllergies}</li>\n </div>\n </div>`\n }", "function generateTagHTML (tag){//generates HTML for a given tag\n return `<li class='tag'><div class='tag-box'>${tag}</div></li>`;\n}", "getHtmlTemplateString(employeesObjectArray) {\n let employeeDetails = \"\";\n let iconHtml = \"\";\n const returnedHtmlObjects = [];\n //iterate over each employee\n for (const employee of employeesObjectArray) {\n // https://stackoverflow.com/questions/10314338/get-name-of-object-or-class\n const currentObjectTypeName = employee.constructor.name;\n //different employee types get different HTML\n if (currentObjectTypeName == \"Manager\") {\n employeeDetails = this.getHtmlManagerDetails(employee.getId(), employee.getEmail(), employee.getOfficeNumber());\n iconHtml = \"<i class='fas fa-tasks'></i>\";\n } else if (currentObjectTypeName == \"Engineer\") {\n employeeDetails = this.getHtmlEngineerDetails(employee.getId(), employee.getEmail(), employee.getGitHub());\n iconHtml = \"<i class='fas fa-laptop-code'></i>\";\n } else if (currentObjectTypeName == \"Intern\") {\n employeeDetails = this.getHtmlInternDetails(employee.getId(), employee.getEmail(), employee.getSchool());\n iconHtml = \"<i class='fas fa-glasses'></i>\";\n }\n //add each iteration to an array\n returnedHtmlObjects.push(this.getHtmlEmployeeString(employee.getName(), employee.getDescription(), iconHtml, currentObjectTypeName, employee.getImageUrl(), employeeDetails));\n }\n //pass the array to be wrapped and return constructed and formatted HTML\n const innerHtml = this.wrapInParentHtml(returnedHtmlObjects);\n return `\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"utf-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>Our Software Team</title>\n <link rel=\"stylesheet\" href=\"https://unpkg.com/bulma@0.9.0/css/bulma.min.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"./hero.css\">\n <script src=\"https://kit.fontawesome.com/e6ff202c8b.js\" crossorigin=\"anonymous\"></script>\n </head>\n <body>\n <section class=\"hero is-info is-small\">\n <div class=\"hero-body\">\n <div class=\"container has-text-centered\">\n <p class=\"title\">\n Our Software Team\n </p>\n </div>\n </div>\n </section>\n <section class=\"container\">\n ${innerHtml}\n </section>\n </body>\n </html>`.replace(/\\s+/g, ' ');\n }", "function getHtml( value ) {\n value = value || \"\";\n\n // No action required if the value is an element\n if ( value instanceof Element ) {\n return value;\n }\n\n if ( value instanceof Function ) {\n return getHtml( value() );\n }\n\n if (value instanceof Array) {\n // Return empty element if array is empty\n if ( !value.length ) {\n return getHtml();\n }\n\n // Appending each element to wrapper\n const el = document.createElement( \"div\" );\n value.map( arrEl => el.appendChild( getHtml( arrEl ) ) );\n\n return el;\n }\n\n // Create a text-node if content is string\n if ( value.constructor === String || value.constructor === Number ) {\n return document.createTextNode( value );\n }\n\n // Render modular elements\n if ( value instanceof Object ) {\n if ( value.__config__ && value.__config__.type !== \"modular-element\" ) {\n throw err( 2 );\n }\n\n return value.__config__.render();\n }\n\n throw err( 3 );\n }", "function makehtml(fi) {//makes an html file which will contain the lyrics for the song designated by the file named 'fi' a string of html code\n var ht=\"<!DOCTYPE html>\\n<html>\\n<head lang=\\\"en\\\">\\n<meta charset=\\\"UTF-8\\\">\\n<title>\"+ fi + \"</title>\\n</head>\\\"\\n<body>\\n<p id=\\\"demo\\\"></p>\";\n ht+=formatlyrics(fi);\n ht+= \"</body>\\n</html>\";\n return ht;\n\n}", "function htmlWriter() {\n \n //writes the html for introduction\n htmlIntro();\n \n //creates the event functionality for example 1 and example 2\n exampleSetEvents();\n \n //writes the html for the game\n htmlGame();\n }", "function generateHTML(team) {\n return `\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <title>Team Profile</title>\n <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css\">\n </head>\n <body>\n <div class=\"container-fluid blue-grey lighten-4 z-depth-2\">\n <h1 class=\"center-align blue-grey-text\" style=\"padding: 50px; margin-top: 0px;\">Team Profile</h1>\n </div>\n <div id=\"employeeCards\" class=\"row\">\n ${team.map(generateCard).join('')}\n </div>\n </body>\n</html>`\n}", "function generateHTML() {\n\n \n fs.writeFile(outputPath, render(members), \"UTF-8\", (err) => {\n \n\n \n if (err) throw err;\n \n });\n \n console.log(members);\n\n }", "function formatAsHtml(content){\n\tvar output = \n\t\"<!DOCTYPE html>\\n\" + \n\t\"<html>\\n\" + \n\t\"<head>\\n\" +\n \"<meta charset=\\\"UTF-8\\\">\\n\" +\n \"<title>My Chit Chat</title>\\n\" +\n \"</head>\\n\" +\n \"<body>\\n\" +\n content + \"\\n\" +\n \"</body>\\n\" +\n \"</html>\";\n return output;\n}", "createHTMLtask() {\n const htmlstring = '<div class=\"task\" draggable=\"true\" id=\"' + this.id + '\" ondragstart=\"drag(event)\" ondrop=\"drop(event)\" ondragover=\"allowDrop(event)\">' +\n '<big><strong>' + this.name + \" \" + '</strong></big>' +\n this.date.replace('T', ' ').substring(0, 19) +\n '<button id=\"' + this.id + '\" onClick=\"viewTask(this.id)\"' + ' class=\"view\" type=\"button\">&#128065;</button>' +\n this.priorityButton() + '<br><br>' +\n \"<p>\" + this.minimizeDescription() +\n this.changePhaseButton() +\n '<p>Assignee: ' + this.assignee + '..........Priority: ' + this.priority + '</p>' +\n '</div><br><br><br><br><br>';\n\n return htmlstring;\n }", "function html(tagName, attributes, ...children) {\n // create the element\n const r = document.createElement(tagName);\n // add the attributes\n for (const key in attributes) {\n // special case for booleans\n if (typeof attributes[key] === \"boolean\") {\n if (attributes[key]) {\n r.setAttribute(key, \"\");\n }\n }\n else {\n r.setAttribute(key, attributes[key]);\n }\n }\n // add the children\n children.forEach(child => {\n // special case for strings\n if (typeof child === \"string\") {\n r.appendChild(document.createTextNode(child));\n }\n else {\n r.appendChild(child);\n }\n });\n return r;\n}", "function makeHTMLd(deaths, year){\n htmlStr=\"\";\n htmlStr+=\"<div class= 'Numbers'>\";\n htmlStr+= \"<h4>\" + \"Death Toll: \" + deaths +\"</h4>\" ;\n htmlStr+= \"</div>\";\n $('#Numbers').html(htmlStr);\n}", "function generateTeamHTML(answers) {\n return ` `;\n}", "function makeTeamHTML(emplyArr) {\n fs.writeFile(outputPath, render(emplyArr), function(err) {\n err?console.log(err):console.log(\"Team html rendered. Have a look!\");\n })\n}", "function construct_html(href, title, describe,tags) {\n url1 = '<article class=\"post tag-sync_sulab post__wrapper\" data-cols=\"4\">' + '<div class=\"post__wrapper_helper post__wrapper_helper--notloaded el__transition post__wrapper_helper--hover\">' + '<div class=\"post__preview el__transition\">' + '<header class=\"post__header\">' + '<h2 class=\"post__title\">' + '<a href='\n\n url2 = ' class=\"post__link post__title_link\"><span>'\n\n url3 = '</span></a></h2></header><p class=\"post__excerpt\"><a href='\n url4 = ' class=\"post__link post__readmore\">'\n\n url5 = '</a></p></div><footer class=\"post__meta\"><ul class=\"post__tags\">'\n url6 = '</ul></footer></div></article>'\n html = url1 + href + url2 + title + url3 + href + url4 + describe + url5\n for(var i=0; i < tags.length; i++) {\n if (tags[i] != 'sync_sulab') { // skip internal sync_sulab tag\n html += construct_tag(tags[i]);\n }\n };\n html += url6;\n return html\n}", "displayHTML() {\n return `<p>Name: ${this.name}</p>\n <p>Email: ${this.email}</p>\n <p>Phone: ${this.phone}</p>\n <p>Relation: ${this.relation}</p>`;\n }", "function html() {\n\t// Your code here\n}", "function toString() {\n return static_1.html(this, this.options);\n}", "_generateMarkup() {\n // console.log(this._data); // data is in the form of an array. We want to return one of the below html elements for each of the elements in that array\n\n return this._data.map(this._generateMarkupPreview).join('');\n }", "function createMarkup(description) {\n return { __html: description };\n }", "function createContent() {\n var bCSS = \"font: bolder 12px Arial\";\n return '<b style=\"' + bCSS + '\">Tag Legend</b>' +\n '<ul style=\"margin-left: 10px\">' +\n '<li>@location</li>' +\n '<li>+project</li>' +\n '<li>general category</li>' +\n '</ul>'\n ;\n }", "function makeHtml(data) {\n var html = (new Showdown.converter()).makeHtml(data);\n $(document.body).html(html);\n }", "function returnHtml(item){\n var output = `<div class=\"newsitem\"><div class=\"itemleft\"><div class=\"itemimg\"><img src=\"`+item.thumbnail+`\"></div></div>`\n + `<div class=\"itemright\"><div class=\"itemtitle\">`+item.title+`</div>`\n +`<div class=\"itemabstract\">`+item.abstract+`</div>`\n +`<div class=\"itemdate\">`+item.published_date+`</div>`\n +`<div class=\"itemlink\"><a target=\"_blank\" href=\"`+item.url+`\">Open in new tab</a></div></div></div>`\n ;\n return output;\n }", "tagMaker() {\n const isHtmlNode = () => {\n return true;\n };\n const isAttribMap = () => {\n return true;\n };\n var notEmpty = (x) => {\n if ((typeof x === 'undefined') ||\n (x === null) ||\n x.length === 0) {\n return false;\n }\n return true;\n };\n var maker = (name, defaultAttribs = {}) => {\n var tagFun= (attribs, children) => {\n let node = '<';\n\n // case 1. one argument, first may be attribs or content, but attribs if object.\n if (typeof children === 'undefined') {\n if (typeof attribs === 'object' &&\n ! (attribs instanceof Array) &&\n isAttribMap(attribs)) {\n if (Object.keys(attribs).length === 0) {\n node += name;\n } else {\n const tagAttribs = this.attribsToString(this.mergeAttribs(attribs, defaultAttribs));\n node += [name, tagAttribs].filter(notEmpty).join(' ');\n }\n node += '>';\n // case 2. arity 1, is undefined\n } else if (typeof attribs === 'undefined') {\n const tagAttribs = this.attribsToString(defaultAttribs);\n node += [name, tagAttribs].filter(notEmpty).join(' ');\n node += '>';\n // case 3: arity 1, is content\n } else if (isHtmlNode(attribs)) {\n const tagAttribs = this.attribsToString(defaultAttribs);\n node += [name, tagAttribs].filter(notEmpty).join(' ');\n node += '>' + this.renderChildren(attribs);\n }\n // case 4. arity 2 - atribs + content\n } else if (isAttribMap(attribs) && isHtmlNode(children)) {\n if (Object.keys(attribs).length === 0) {\n node += name;\n } else {\n const tagAttribs = this.attribsToString(this.mergeAttribs(attribs, defaultAttribs));\n node += [name, tagAttribs].filter(notEmpty).join(' ');\n }\n node += '>' + this.renderChildren(children);\n }\n node += '</' + name + '>';\n return node;\n };\n return tagFun;\n };\n return maker;\n }", "generateHTML() {\n let HTML = '';\n HTML += `<img class=\"headerLogo\" src=\"${this.logoPath + this.data.logoHeader}\" alt=\"${this.data.logoalt}\">`;\n return HTML;\n }", "function createHTML(item) {\n return '<li class=\"item\" >\\n' +\n ' <img src=\"'+item.image+'\" alt=\"image\" class=\"itemPoint\" data-key=\"image\" data-value=\"'+item.image+'\">' +\n ' <span class=\"itemDetail\">'\n +item.gender+' / '+item.size+' / '+item.color+\n '</span>\\n' +\n ' </li>';\n}", "function displayTemplate(niceDate, all) {\n return `<!DOCTYPE html>\n <html>\n <head>\n <title>${niceDate.split('.').join(':')}</title>\n <meta charset=\"utf-8\">\n <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css\">\n <link href=\"https://fonts.googleapis.com/css?family=Montserrat:400,400i,700,700i|Source+Code+Pro&display=swap\" rel=\"stylesheet\">\n <style>${fs.readFileSync('./test-runner.css', 'utf-8')}</style>\n </head>\n <body>\n <script>\n render('${niceDate.split('.').join(':')}', ${JSON.stringify(all, '', ' ')});\n ${render}\n </script>\n </body>\n </html>\n `\n}", "function div(text) { return '<div>'+text+'</div>'; }", "function buildHTML(tag, html, attrs) {\n\n var element = document.createElement(tag);\n // if custom html passed in, append it\n if (html) element.innerHTML = html;\n\n // set each individual attribute passed in\n for (attr in attrs) {\n if (attrs[attr] === false) continue;\n element.setAttribute(attr, attrs[attr]);\n }\n\n return element;\n }", "function createLettersHtml() {\r\n var html = [];\r\n for (var i = 1; i < letters.length; i++) {\r\n if (html.length === 0) {\r\n html.push('<a class=\"all\" href=\"#\">'+ opts.allText + '</a><a class=\"_\" href=\"#\">0-9</a>');\r\n }\r\n html.push('<a class=\"' + letters[i] + '\" href=\"#\">' + ((letters[i] === '-') ? '...' : letters[i].toUpperCase()) + '</a>');\r\n }\r\n return '<div class=\"ln-letters\">' + html.join('') + '</div>' + ((opts.showCounts) ? '<div class=\"ln-letter-count listNavHide\">0</div>' : '');\r\n // Remove inline styles, replace with css class\r\n // Element will be repositioned when made visible\r\n }", "function printMembersHTML( arrImages, arrNameComments, arrTimeMail, arrDateIcon){\n return sectionMembersActivities = `\n <div>\n <div><img src=\"${arrImages}\"></div>\n <p class=\"user-activity-name\">${arrNameComments} <br> <span>${arrTimeMail}</span></p>\n </div>\n <div>\n <p>${arrDateIcon}</p>\n </div>\n `;\n}", "createElement (text) {\n this.text = text\n return html`<h1>${text}</h1>`\n }", "toHTML ( theMode, sigDigs , params) {}", "function toHTML(content, title) {\n return '<doctype html>' +\n '<html><head><title>' + title + '</title>' +\n '<style type=\"text/css\">' +\n style +\n '</style>' +\n '<script type=\"text/javascript\">' +\n defaultJs +\n '</script>' +\n '</head><body>' +\n content +\n '</body></html>';\n }", "function createMarkup() {\n if (episode.summary) {\n let newSummary = episode.summary; //Convert response for summary to Markup.\n let newLength = episode.summary.length;\n let regex = /[.,]/g;\n if (newLength > 100) {\n newSummary = newSummary.slice(3, newSummary.search(regex)).concat('...'); // WIll cut the string for summary if it's longer than 100 without removing the markup tag\n }\n return { __html: newSummary }; // (Dangerously) going to set html.\n }\n }", "function getHtml(template) {\n return template.join('\\n');\n}", "toHTML() {\n return '';\n }", "html() {\n var htm;\n htm = \"\";\n if (UI.hasLays) {\n htm += `<div class=\"layout-logo \" id=\"${this.htmlId('Logo')}\"></div>`;\n }\n if (UI.hasLays || (this.navbs != null)) {\n htm += `<div class=\"layout-corp\" id=\"${this.htmlId('Corp')}\"></div>`;\n }\n if (UI.hasLays) {\n htm += `<div class=\"layout-find\" id=\"${this.htmlId('Find')}\"></div>`;\n }\n if (UI.hasTocs) {\n htm += `<div class=\"layout-tocs tocs\" id=\"${this.htmlId('Tocs')}\"></div>`;\n }\n htm += `<div class=\"layout-view\" id=\"${this.htmlId('View')}\"></div>`;\n if (UI.hasLays) {\n htm += `<div class=\"layout-side\" id=\"${this.htmlId('Side')}\"></div>`;\n }\n if (UI.hasLays) {\n htm += `<div class=\"layout-pref \" id=\"${this.htmlId('Pref')}\"></div>`;\n }\n if (UI.hasLays) {\n htm += `<div class=\"layout-foot\" id=\"${this.htmlId('Foot')}\"></div>`;\n }\n if (UI.hasLays) {\n htm += `<div class=\"layout-trak\" id=\"${this.htmlId('Trak')}\"></div>`;\n }\n return htm;\n }", "function gen_pet_tips_html(equipid, big_img_root, equip_face_img, pet_skill_url, pet_desc, pet_name){\nvar pet_attrs = get_pet_attrs_info(pet_desc);\nvar template = get_tips_template($(\"pet_tips_template\").innerHTML); \n\nvar result = template.format(equipid, big_img_root,equip_face_img, pet_name, pet_attrs.pet_grade, pet_attrs.attack_aptitude, \n\npet_attrs.defence_aptitude, pet_attrs.physical_aptitude, pet_attrs.magic_aptitude, pet_attrs.speed_aptitude, pet_attrs.avoid_aptitude, pet_attrs.lifetime, pet_attrs.growth, equipid, equipid, pet_attrs.blood,pet_attrs.max_blood, \n\npet_attrs.soma, pet_attrs.magic, pet_attrs.max_magic, pet_attrs.magic_powner, pet_attrs.attack, pet_attrs.strength, pet_attrs.defence, pet_attrs.endurance, pet_attrs.speed, pet_attrs.smartness, pet_attrs.wakan, pet_attrs.potential, equipid, equipid, \n\npet_attrs.five_aptitude, equipid, equipid,equipid, pet_attrs.all_skill, pet_attrs.sp_skill, pet_skill_url, equipid);\n\nreturn result;\n}", "function toHTML(myString) {\n myString = \"\\\"\" + myString + \"\\\"\"\n return myString;\n}", "function gen_equip_tips_html(equipid, equip_name, equip_desc, equip_type_desc, big_img_root, equip_face_img, pet_skill_url){\t\n\tvar template = get_tips_template($(\"equip_tips_template\").innerHTML);\n\tvar result = template.format(equipid, big_img_root, equip_face_img, equip_name, equip_type_desc, equip_desc);\n\treturn result;\n}", "render(){\n\n //retorna el template usando el html del tag del template, crea los elementos en el dom\n return html`\n <div>Hello Word!!</div>\n `;\n }", "function createHTML(teamArray,manager) {\n const header = `\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\" />\n <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css\"\n integrity=\"sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2\" crossorigin=\"anonymous\" />\n <title>Team Profiles</title>\n </head>\n <body>\n <header class=\"jumbotron bg-info text-white\">\n <h1 class=\"text-center\">My Team</h1>\n </header>\n <section class=\"container\">`;\n let managerSection = managerCardTemplate(manager);\n let employeeSection = ''; \n const footer = `\n </section>\n </body>\n `;\n for (let index = 0; index < teamArray.length; index++) {\n const employee = teamArray[index];\n console.log(employee);\n let card = '';\n if(employee.getRole() === 'Intern') {\n card = internCardTemplate(employee);\n } else if(employee.getRole() === 'Engineer') {\n card = engineerCardTemplate(employee);\n }\n employeeSection += card;\n }\n return header+managerSection+employeeSection+footer; \n }", "function carritoHTML() {\n\n articulosCarrito.forEach( (curso) => {\n const row = document.createElement('tr');\n row.innerHTML = '\n <td>\n \n </td>\n ';\n })\n}", "function createAnimalTradingCardHTML(animal) {\n const cardHTML = `<div class=\"card\"> \n <h3 class=\"name\"> ${animal.name} </h3> \n <img src=\"${animal.name}.jpg\" alt=\"${animal.name}\" class=\"picture\">\n <div class=\"description\">\n <p class=\"fact\"> ${animal.fact} </p>\n <ul class=\"details\">\n <li><span class=\"bold\">Scientific Name</span>: ${animal.scientificName} </li>\n <li><span class=\"bold\">Average Lifespan</span>: ${animal.lifespan} </li>\n <li><span class=\"bold\">Average Speed</span>: ${animal.speed} </li>\n <li><span class=\"bold\">Diet</span>: ${animal.diet} </li>\n </ul>\n <p class=\"brief\"> ${animal.summary} </p>\n </div>`\n </div>;\n\n return cardHTML;\n}", "function generateHtml(employeeHtml) {\n return `\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <link href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We\" crossorigin=\"anonymous\">\n <title>Team Profiler</title>\n</head>\n<body>\n <header>\n <h1 class=\"text-center bg-secondary text-warning py-2\">Team Profiler</h1>\n </header>\n\n <section class=\"container\">\n <div class=\"row\">\n <h2 class=\"text-center bg-dark text-white py-3 rounded\">My Team</h2>\n </div>\n <div class=\"row justify-content-center\">\n ${employeeHtml}\n </div>\n </section>\n\n <script src=\"https://kit.fontawesome.com/b355c8aa28.js\" crossorigin=\"anonymous\"></script>\n</body>\n</html>\n `\n}", "function makeTodoHTML(todoText) {\n \n return \"<li class=\\\"todo-item\\\"><span class=\\\"delete-todo\\\"><i class=\\\"fa fa-times\\\" aria-hidden=\\\"true\\\"></i></span> \" + todoText + \"</li>\";\n\n}", "function codigohtml (dato) {\n\tvar html=\"<article>\";\n\t\thtml=\"<div>\"+dato+\"</div>\";\n\thtml+=\"</article>\";\n\treturn html;\n}", "function generateHTML() {\r\n return `\r\n <ul class=\"list__task--dropdown\">\r\n <li class=\"status__pending\"><a href=\"#1\" class=\"table__status--button\">Pending<span class=\"triangle\">▼</span></a></li>\r\n <li class=\"status__ongoing\">Ongoing</li>\r\n <li class=\"status__complete\">Complete</li>\r\n </ul>`\r\n }", "function generateHtml(list){\n\tlet html = \n `<li class=\"student-item cf\">\n\t <div class=\"student-details\">\n\t <img class=\"avatar\" src=\"${list.picture.large}\" alt=\"Profile Picture\">\n\t <h3>${list.name.title} ${list.name.first} ${list.name.last}</h3>\n\t <span class=\"email\">${list.email}</span></div>\n\t <div class=\"joined-details\">\n\t <span class=\"date\">${list.registered.date}</span>\n </div></li>`\n return html\n}", "createHTML(){\n return '<li class=\"ListItem\">' + '<h2>' + this.name + '</h2>' + '<span class=\"venueType\" id=\"venueType1\">' + this.type + '</span>' + '</li>'\n }", "generateHTML(){\n var self = this;\n var html = \"<div class='\"+self.class_name+ \"'> \\\n </div>\";\n $(\"body\").append(html);\n \n //THIS WILL DEPEND ON VIEW- CHANGE LATER\n self.footer.generateHTML();\n self.us_state_map.generateMap();\n self.profile_page.generateHTML();\n self.profile_page.unfocus();\n self.header.generateHTML();\n \n }", "function createHTML() {\n const html = render(employeeList);\n // check if directory exists and create if not exists\n if (!fs.existsSync(OUTPUT_DIR)) {\n fs.mkdirSync(OUTPUT_DIR);\n }\n\n fs.writeFile(outputPath, html, function (err) {\n if (err) {\n console.log(err);\n } else {\n console.log(\"Successfully created the Team profile file!\");\n }\n });\n}", "function create_page_title(title)\n{\n return `\n <h1 class=\"page_title\">\n ${title}\n </h1>\n <hr>\n `;\n}", "getHTML() {\n const endIndex = this.strings.length - 1;\n let html = '';\n for (let i = 0; i < endIndex; i++) {\n const s = this.strings[i];\n // This exec() call does two things:\n // 1) Appends a suffix to the bound attribute name to opt out of special\n // attribute value parsing that IE11 and Edge do, like for style and\n // many SVG attributes. The Template class also appends the same suffix\n // when looking up attributes to create Parts.\n // 2) Adds an unquoted-attribute-safe marker for the first expression in\n // an attribute. Subsequent attribute expressions will use node markers,\n // and this is safe since attributes with multiple expressions are\n // guaranteed to be quoted.\n const match = lastAttributeNameRegex.exec(s);\n if (match) {\n // We're starting a new bound attribute.\n // Add the safe attribute suffix, and use unquoted-attribute-safe\n // marker.\n html += s.substr(0, match.index) + match[1] + match[2] +\n boundAttributeSuffix + match[3] + marker;\n }\n else {\n // We're either in a bound node, or trailing bound attribute.\n // Either way, nodeMarker is safe to use.\n html += s + nodeMarker;\n }\n }\n return html + this.strings[endIndex];\n }", "function createMarkUp() {\n\t\t\treturn { __html: a.content }\n\t\t}", "function generateHTML(data) {\n return `<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"UTF-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Team Profile Generator</title>\n <link href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css\" rel=\"stylesheet\"\n integrity=\"sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6\" crossorigin=\"anonymous\">\n <link rel=\"stylesheet\" href=\"./assets/style.css\">\n <script src=\"https://kit.fontawesome.com/05e62abe87.js\" crossorigin=\"anonymous\"></script>\n</head>\n\n<body>\n <header class=\"bg-danger text-white text-center\">\n My Team\n </header>\n <section class=\"row row-cols-3 display: block justify-content-center mt-5\">\n ${generateManagerCard(data)}\n ${generateEngineerCard(data)}\n ${generateInternCard(data)}\n </section>\n <script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js\"\n integrity=\"sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf\"\n crossorigin=\"anonymous\"></script>\n</body>\n\n</html>`\n}", "function userInformationHTML(user) { //the 'user' parameter here references the user object being returned from the github API. this contains information methods like user's name login name etc.\n//could console.log(user) to see all the different things in user object from github data API that you could display.\n return `<h2>${user.name}\n <span class=\"small-name\">\n (@<a href=\"${user.html_url}\" target= \"_blank\">${user.login}</a>)\n </span>\n </h2>\n <div class=\"gh-content\">\n <div class=\"gh-avatar\">\n <a href=\"${user.html_url} target= \"_blank\" \n <img src=\"${user.avatar_url}\" width=\"80\" height=\"80\" alt=\"${user.login}\"/>\n </a>\n </div>\n <p>Followers: ${user.followers} - Following ${user.following} <br> Repos: ${user.public_repos}</p>\n </div>`;\n}", "createHTML() {\n var tile = document.createElement('li'),\n targetElement = this.tilesView.tilesWrapper.querySelector(\n '.list.' + this.shader.status\n );\n\n if (!targetElement) {\n let list = document.createElement('ul'),\n listElement = document.createElement('li');\n\n list.classList.add('list', this.shader.status);\n list.setAttribute('data-status', this.shader.statusOrginal);\n listElement.appendChild(list);\n this.tilesView.tilesWrapper.appendChild(list);\n targetElement = list;\n }\n\n tile.classList.add('shader');\n tile.innerHTML = TILE_TEMPLATE.replace(\n '{previewUrl}',\n getPreviewUrlById(this.shader.id)\n )\n .replace('{shaderUrl}', getShaderUrlById(this.shader.id))\n .replace('{shaderTitle}', this.shader.title);\n targetElement.appendChild(tile);\n }", "static createElement(html2, _options) {\n const el = d.createElement(\"template\");\n el.innerHTML = html2;\n return el;\n }" ]
[ "0.70083255", "0.69676286", "0.69038135", "0.6871408", "0.6770828", "0.6735295", "0.67150605", "0.66873163", "0.668702", "0.6627301", "0.6575555", "0.65703076", "0.6563294", "0.6512549", "0.6512549", "0.6512549", "0.6512549", "0.6512549", "0.64919186", "0.64720607", "0.6472004", "0.6469296", "0.6464736", "0.645981", "0.6457968", "0.6456792", "0.6456633", "0.6439742", "0.64396876", "0.6413119", "0.6408542", "0.6397938", "0.6362304", "0.6358771", "0.63456625", "0.63456625", "0.63456625", "0.63424087", "0.632854", "0.6314988", "0.6308158", "0.6297722", "0.6295864", "0.6286627", "0.6283082", "0.6281249", "0.62795836", "0.62694174", "0.6268544", "0.62603664", "0.6254082", "0.62492883", "0.6244606", "0.62284434", "0.62208515", "0.6219815", "0.61973214", "0.6191862", "0.6187043", "0.6185491", "0.6177613", "0.6175688", "0.6166735", "0.61653936", "0.61445546", "0.6135322", "0.6112569", "0.61096513", "0.61059487", "0.61041456", "0.60919756", "0.60903245", "0.60876065", "0.6085876", "0.6084839", "0.607957", "0.6069986", "0.60687107", "0.60676605", "0.6048577", "0.60408497", "0.60389835", "0.60387075", "0.6038395", "0.602899", "0.60221267", "0.6015831", "0.60130024", "0.6008415", "0.6002717", "0.5998108", "0.5993052", "0.5990677", "0.598556", "0.5984854", "0.5978781", "0.597641", "0.5974798", "0.5969444", "0.5960238" ]
0.6139077
65
snippetend:[s3.JavaScript.s3_PhotoViewer.config] Functions snippetstart:[s3.JavaScript.s3_PhotoViewer.listAlbums] List the photo albums that exist in the bucket.
function listAlbums() { s3.listObjects({Delimiter: '/'}, function(err, data) { if (err) { return alert('There was an error listing your albums: ' + err.message); } else { var albums = data.CommonPrefixes.map(function(commonPrefix) { var prefix = commonPrefix.Prefix; var albumName = decodeURIComponent(prefix.replace('/', '')); return getHtml([ '<li>', '<button style="margin:5px;" onclick="viewAlbum(\'' + albumName + '\')">', albumName, '</button>', '</li>' ]); }); var message = albums.length ? getHtml([ '<p>Click on an album name to view it.</p>', ]) : '<p>You do not have any albums. Please Create album.'; var htmlTemplate = [ '<h2>Albums</h2>', message, '<ul>', getHtml(albums), '</ul>', ] document.getElementById('viewer').innerHTML = getHtml(htmlTemplate); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listAlbums() {\n s3.listObjects({Delimiter: '/'}, function(err, data) {\n if (err) {\n return alert('There was an error listing your albums: ' + err.message);\n } else {\n var albums = data.CommonPrefixes.map(function(commonPrefix) {\n var prefix = commonPrefix.Prefix;\n var albumName = decodeURIComponent(prefix.replace('/', ''));\n return getHtml([\n '<div class = \"btn-group\" style = \"padding: 20px\">',\n '<button class=\"btn btn-sm\" style=\"margin-top:20px; border:2px solid #000000;\" onclick=\"viewAlbum(\\'' + albumName + '\\')\">',\n albumName,\n '</button>',\n '</div>'\n ]);\n });\n var message = albums.length ?\n getHtml([\n '<p style = \"text-align: center;\">Click on an album name to view it.</p>',\n ]) :\n '<p style = \"text-align: center;\">You do not have any albums. Please Create album.';\n var htmlTemplate = [\n '<h2 style = \"text-align: center; padding: 25px\" >Albums</h2>',\n message,\n '<div style = \"margin: 0; position: absolute; left: 50%; -ms-transform: translate(-50%, 0%) ; transform: translate(-50%, 0%);\">',\n getHtml(albums),\n\n '</div>'\n ]\n document.getElementById('viewer').innerHTML = getHtml(htmlTemplate);\n }\n });\n}", "function viewAlbum(albumName) {\r\n var albumPhotosKey = encodeURIComponent(albumName) + '/';\r\n s3.listObjects({Prefix: albumPhotosKey}, function(err, data) {\r\n if (err) {\r\n return alert('There was an error viewing your album: ' + err.message);\r\n }\r\n // 'this' references the AWS.Request instance that represents the response\r\n var href = this.request.httpRequest.endpoint.href;\r\n var bucketUrl = href + albumBucketName + '/';\r\n\r\n var photos = data.Contents.map(function(photo) {\r\n var photoKey = photo.Key;\r\n var photoUrl = bucketUrl + encodeURIComponent(photoKey);\r\n return getHtml([\r\n '<span>',\r\n '<div>',\r\n '<br/>',\r\n '<img style=\"width:128px;height:128px;\" src=\"' + photoUrl + '\"/>',\r\n '</div>',\r\n '<div>',\r\n '<span>',\r\n photoKey.replace(albumPhotosKey, ''),\r\n '</span>',\r\n '</div>',\r\n '</span>',\r\n ]);\r\n });\r\n var message = photos.length ?\r\n '<p>The following photos are present.</p>' :\r\n '<p>There are no photos in this album.</p>';\r\n var htmlTemplate = [\r\n '<div>',\r\n '<button onclick=\"listAlbums()\">',\r\n 'Back To Albums',\r\n '</button>',\r\n '</div>',\r\n '<h2>',\r\n 'Album: ' + albumName,\r\n '</h2>',\r\n message,\r\n '<div>',\r\n getHtml(photos),\r\n '</div>',\r\n '<h2>',\r\n 'End of Album: ' + albumName,\r\n '</h2>',\r\n '<div>',\r\n '<button onclick=\"listAlbums()\">',\r\n 'Back To Albums',\r\n '</button>',\r\n '</div>',\r\n ]\r\n document.getElementById('viewer').innerHTML = getHtml(htmlTemplate);\r\n document.getElementsByTagName('img')[0].setAttribute('style', 'display:none;');\r\n });\r\n}", "function viewAlbum(albumName) {\n var albumPhotosKey = encodeURIComponent(albumName) + '/';\n s3.listObjects({Prefix: albumPhotosKey}, function(err, data) {\n if (err) {\n return alert('There was an error viewing your album: ' + err.message);\n }\n // 'this' references the AWS.Response instance that represents the response\n var href = this.request.httpRequest.endpoint.href;\n var bucketUrl = href + albumBucketName + '/';\n\n\n //gets photo from s3\n var photos = data.Contents.map(function(photo) {\n var photoKey = photo.Key;\n var photoUrl = bucketUrl + encodeURIComponent(photoKey);\n return getHtml([\n \"<div class='col-sm-4'>\",\n\n \"<figure class='photo-frame'>\",\n \"<img src=' \" + photoUrl + \"' class='gallery'/>\",\n \"</figure>\",\n '</div>',\n ]);\n });\n\n\n //if there are photos in the album, display first message, otherwise display second message\n var message = photos.length ?\n '<p>The following photos are present.</p>' :\n '<p>There are no photos in this album.</p>';\n\n //template for how website is going to be formated\n\n var htmlTemplate = [\n//button to go back\n\n\n //photo\n '<div class= \"col-lg-12\">',\n '<div class=\"gallery-backdrop\">',\n '<div id = \"gallery\" class=\"case photo-gallery\">',\n getHtml(photos),\n '</div>',\n '</div>',\n '</div>',\n\n //end of album and button to go back to list of albums\n\n '<div class = \"col-sm-5\" style= \"margin: auto; padding-bottom: 10px; width: 60%; transform: translate(-50%, -50%); \">',\n '<button type=\"button\" onclick=\"listAlbums()\" class=\"btn btn-sm\" style=\"margin-top:20px; border:2px solid #000000;\">',\n 'Back To Albums',\n '</button>',\n '</div>',\n ]\n document.getElementById('viewer').innerHTML = getHtml(htmlTemplate);\n document.getElementsByTagName('div')[6].setAttribute('style', 'display:none !important;');\n });\n}", "async getAlbums(){\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/albums?excludeNonAppCreatedData=true',\n method: 'GET',\n headers: {\n 'Authorization': 'Bearer '+ token.accessToken,\n 'Content-type': 'application/json'\n },\n }\n response = await this.APIHandler.sendRequest(data);\n return response\n }", "function getEventAlbums(eventId) {\n if (isUndefined(eventId)) {\n throw new Error('The eventId is required to check if a photo exists.');\n }\n return makeApiRequest({\n method: 'sp.album.get_list',\n event_id: eventId,\n });\n}", "function getPicasaAlbums() {\n var data = UrlFetchApp.fetch(URL, googleOAuth_()).getContentText();\n var xmlOutput = Xml.parse(data, false);\n var albums = xmlOutput.getElement().getElements('entry');\n var info = [];\n var app = UiApp.createApplication().setTitle('Picasa');\n var panel = app.createVerticalPanel();\n var listBox = app.createListBox().setName('albumListBox').addItem('select');\n var handler = app.createServerHandler('showImagesEventHandler').addCallbackElement(listBox);\n listBox.addChangeHandler(handler);\n for (var i = 0; i < albums.length; i++) {\n if (albums[i].getElement('rights').getText() == \"public\") {\n var title = albums[i].getElement('title').getText();\n var id = albums[i].getElement('http://schemas.google.com/photos/2007', 'id').getText();\n info.push([ title, id ]);\n listBox.addItem(title);\n }\n }\n // use a script property to save the links to each album for later use\n ScriptProperties.setProperty('info', Utilities.jsonStringify(info));\n var scrollPanel = app.createScrollPanel().setWidth('500').setHeight('300');\n scrollPanel.setAlwaysShowScrollBars(true);\n scrollPanel.add(app.createVerticalPanel().setId('panelForImages'));\n app.add(panel.add(listBox).add(scrollPanel));\n // SpreadsheetApp.getActiveSpreadsheet().show(app);\n return app;\n}", "function showImagesEventHandler(e) {\n var app = UiApp.getActiveApplication();\n var panel = app.getElementById('panelForImages').clear();\n var info = Utilities.jsonParse(ScriptProperties.getProperty('info'));\n for (i in info) {\n if (info[i][0] == e.parameter.albumListBox) {\n var data = UrlFetchApp.fetch(URL + '/albumid/' + info[i][1], googleOAuth_()).getContentText();\n var xmlOutput = Xml.parse(data, false);\n var photos = xmlOutput.getElement().getElements('entry');\n for (j in photos) {\n panel.add(app.createImage(photos[j].getElement('content').getAttribute('src').getValue()));\n }\n }\n }\n return app;\n}", "getAlbums() {\n let results = [];\n\n if (!this.currentArtistName) {\n for (let i=0; i < this.albums.length; ++i) {\n results.push(this.albums[i].title);\n }\n\n return results;\n }\n else {\n let artistId = this._getArtistId();\n\n for (let i = 0; i < this.albums.length; ++i) {\n if (this.albums[i].artistId === artistId) {\n results.push(this.albums[i].title);\n }\n }\n }\n\n return results;\n }", "getAllAlbums(limit = 0, offset = 0) {\n\t\tvar query = `\n\t\tSELECT DISTINCT album FROM songs\n\t\t\tLEFT JOIN json USING (json_id)\n\t\t\tORDER BY date_added ASC\n\t\t`;\n\t\n\t\treturn this.cmdp(\"dbQuery\", [query])\n\t\t\t.then((albumsObjs) => {\n\t\t\t\t// Unpack \"artist\" string attribute into its own array of strings\n\t\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\t\tresolve(albumsObjs.map(function(a) {return a.album;}));\n\t\t\t\t});\n\t\t\t});\n\t}", "async getSharedAlbums(){\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/sharedAlbums?excludeNonAppCreatedData=true',\n method: 'GET',\n headers: {\n 'Authorization': 'Bearer '+ token.accessToken,\n 'Content-type': 'application/json'\n },\n }\n response = await this.APIHandler.sendRequest(data);\n return response\n }", "function readAlbumsFromDb() {\n musicDb.allDocs({\n include_docs: true,\n startkey: 'album_',\n endkey: 'album_\\uffff'\n }).then(function (resultFromDb) {\n processInfoFromDb(resultFromDb)\n }).catch(function (err) {\n console.log(err)\n })\n }", "function listBuckets() {\n s3Client.listBuckets((err, data) => {\n if (err) console.log('err:', err);\n else console.log('data:', data);\n });\n}", "function showAlbums() {\n\turl = \"showAlbums.php\";\n\tdoAjaxCall(url, \"updateMain\", \"GET\", true);\n}", "_FB_getAlbumPhotos(album) {\n const _this = this;\n\n _this._FB_API(\"/\" + album.id + \"/photos\", {fields: 'id', limit: 999999}, (response) => {\n if(!response || response.error) {\n _this.props.onError(ERROR.NO_PHOTOS);\n _this.set_errorMessage(MSFBPhotoSelector.TEXTS.could_not_load_album_photos, 'https://facebook.com/' + album.id);\n }\n else {\n const index = _this.state.FB_albums.indexOf(album);\n var FB_albums = _this.state.FB_albums.slice(0);\n\n FB_albums[index].photos = response.data.map((photo) => ({id: photo.id}));\n _this.setState({FB_albums});\n }\n });\n }", "async getAllAlbums() {\n // if (!enable()) return null;\n\n try {\n console.log(\"[imgur] GET All Albums\");\n\n // get album count\n let count = await this.albumsCount();\n if (count == null) throw (\"[imgur] Can not get Albums count!\");\n\n // loop for pages\n let pArray = [];\n let pages = parseInt(count / 50);\n for (let page = 0; page <= pages; page++) {\n pArray.push(this.albums({ page }));\n }\n\n // get result\n let result = [];\n await Promise.all(pArray).then(values => {\n for (let arr of values) {\n result = result.concat(arr);\n }\n });\n\n console.log(\"[imgur] Imgur account Albums load complete (\" + result.length + \" Albums)!\");\n return result;\n\n } catch (error) {\n console.log(`[imgur] imgur.api.account.getAllAlbums`);\n console.log(error);\n return null;\n }\n }", "_FB_getUserAlbums(finishedCallback) {\n const _this = this;\n\n _this._FB_API('/me/albums', {fields: 'name,id'}, (response) => {\n if(!response || response.error) {\n _this.props.onError(ERROR.NO_ALBUMS);\n _this.set_errorMessage(MSFBPhotoSelector.TEXTS.could_not_load_albums);\n } else {\n _this.setState({\n FB_albums: response.data.map((album) => {\n var album = {\n id: album.id,\n name: album.name,\n loading: false,\n limit: MSFBPhotoSelector.ALBUM_PHOTOS_LIMIT,\n photos: []\n };\n\n _this._FB_getAlbumPhotos(album);\n\n return album;\n })\n }, finishedCallback);\n }\n }\n )\n }", "function getAlbumPhotos(albumId, page = 1) {\n if (isUndefined(albumId)) {\n throw new Error('The eventId is required to check if a photo exists.');\n }\n return makeApiRequest({\n method: 'sp.album.get_photos',\n album_id: albumId,\n page,\n });\n}", "async function listBuckets() {\r\n try {\r\n const results = await storage.getBuckets();\r\n\r\n const [buckets] = results;\r\n\r\n console.log('Buckets:');\r\n buckets.forEach(bucket => {\r\n console.log(bucket.name);\r\n });\r\n } catch (err) {\r\n console.error('ERROR:', err);\r\n }\r\n}", "function listObjects() {\n var request = gapi.client.storage.objects.list({\n 'bucket': BUCKET\n });\n executeRequest(request, 'listObjects');\n}", "function gallery_controls() {\r\n\r\n\t\t$(function() {\r\n\t\t$.getJSON( \"assets/db/albums.json\", function( data ) {\r\n\t\t\tvar albums = [];\r\n\r\n\t\t\tvar album_list = [];\r\n\r\n\t\t\t$.each( data, function (key, val) {\r\n\r\n\t\t\t\tif (Number.isInteger(parseInt(key)) && val[\"is_active\"]==1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\talbums.push( \"<div class='col-sm-6 col-md-4 filtr-item' data-category='\" + parseInt(key) + \"'>\" );\r\n\t\t\t\t\talbums.push( \"<div class='mu-item-thumbonail'>\" );\r\n\t\t\t\t\talbums.push( \"<img class='img-responsive' src='assets/\" + val[\"slug\"] + \".jpg' alt='\" + val[\"title\"] + \"'>\" );\r\n\t\t\t\t\talbums.push( \"</div>\" );\r\n\t\t\t\t\talbums.push( \"<div class='mu-filter-item-content'>\" );\r\n\t\t\t\t\talbums.push( \"<h1 class='mu-filter-item-title'>\" + val[\"title\"] + \"</h2>\" );\r\n\t\t\t\t\talbums.push( \"<h4 class='mu-filter-item-title'>\" + val[\"sub_title\"] + \"</h4>\" );\r\n\t\t\t\t\talbums.push( \"<span class='mu-header-dot' style='background-color: white'></span>\" );\r\n\t\t\t\t\talbums.push( \"<h4 class='mu-filter-item-title'>Released: \" + album_date(val[\"release_date\"]) + \"</h5>\" );\r\n\t\t\t\t\talbums.push( \"<h4 class='mu-filter-item-title'>\" + val[\"tracks\"] + \" tracks (\" + format_album_time(val[\"total_length\"]) + \")</h5>\" );\r\n\t\t\t\t\talbums.push( \"<h5 class='mu-filter-item-title'>&copy; \" + val[\"label\"] + \"</h5>\" );\r\n\t\t\t\t\talbums.push( \"<a class='mu-filter-imglink' href='assets/\" + val[\"slug\"] + \".jpg' title='\" + val[\"title\"] + \"'\" + \"id='\" + key + \"'><i class='fa fa-info-circle'></i></a>\" );\r\n\t\t\t\t\talbums.push( \"<span class='list-track' id='\" + key + \"'><i class='fa fa-question-circle'></i></span>\" );\r\n\t\t\t\t\talbums.push( \"</div>\" );\r\n\t\t\t\t\talbums.push( \"</div>\" );\r\n\t\t\t\t\t\t\r\n\t\t\t\t\talbum_list[key] = key;\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\r\n\t\t\tdocument.getElementsByClassName(\"filtr-container\")[0].innerHTML = albums.join(\"\");\r\n\t\t\t\r\n\t\t\t$('.mu-filter-imglink').magnificPopup({\r\n\t\t\t\ttype: 'image',\r\n\t\t\t\tmainClass: 'mfp-fade',\r\n\t\t\t\tgallery:{\r\n\t\t\t\t enabled:true\r\n\t\t\t\t}\r\n\t\t\t });\r\n\t\t});\r\n\t});\r\n}", "async function listBuckets() {\n try {\n const results = await storage.getBuckets();\n\n const [buckets] = results;\n\n console.log('Buckets:');\n buckets.forEach(bucket => {\n console.log(bucket.name);\n });\n } catch (err) {\n console.error('ERROR:', err);\n }\n}", "function Album(){\n\tvar photos = [];\n\tvar locations = [];\n\tthis.addPhoto = function(photo){\n\t\tphotos.push(photo);\n\t}\n\tthis.addLocation = function(location){\n\t\tlocations.push(location);\n\t}\n\tthis.listPhotos = function() {\n\t\treturn photos.toString();\n\t}\n\tthis.listLocations = function() {\n\t\treturn locations.toString();\n\t}\n\tthis.getPhoto=function(index){\n\t\treturn [photos[index],locations[index]];\n\t}\n\tthis.hasPhoto = function(photo) {\n\t\treturn photos.includes(photo);\n\t}\n}", "async albumImages({ albumHash }) {\n // if (!enable()) return null;\n\n try {\n console.log(\"[imgur] GET Album Images \" + albumHash);\n return await _apiRequest2(\"GET\", \"album/\" + albumHash + \"/images\");\n\n } catch (error) {\n console.log(`[imgur] imgur.api.album.albumImages Error ${error.statusCode}`);\n // console.json(error);\n return null;\n }\n }", "function getAlbums(event){\n event.preventDefault();\n var id = $(event.currentTarget).parent().attr(\"data-value\");\n show_albums(id);\n }", "getAlbumsForArtist(artistName){\n return this.getArtistByName(artistName).albums;\n }", "function loadPhotoAlbums(uid, page, limit)\n{\n\tvar user_id = uid;\n\tvar html=\"\";\n\t$loadingImage = \"<img id = 'album_loading' src = '/\" + PROJECT_NAME + \"public/images/loading_large_purple.gif' alt = 'Wait...' />\";\n\t$(\"#album\").append($loadingImage).css('text-align','center');\n\t\n\tjQuery.ajax({\n url: \"/\" + PROJECT_NAME + \"profile/photo-albums-profile-listing\",\n type: \"POST\",\n dataType: \"json\",\n data : {\"uid\":uid, \"page\":page, \"limit\":limit},\n success: function(jsonData) {\n \t\n \t$(\"#album img#album_loading\").remove();\n \t\n \tif(jsonData['album_info'])\n \t{\n\t \tfor(i in jsonData['album_info'])\n\t \t{\n\t \t\t html+='<div class=\"whitebox\">';\n\t \t\thtml+='<a href=\"'+PROJECT_URL+PROJECT_NAME+'profile/photos/uid/'+uid+'/id/'+jsonData['album_info'][i][\"id\"]+'\">';\n\t \thtml+='<img src=\"'+jsonData['album_info'][i][\"socialise_albums_socialise_photo\"]+'\"/>';\n\t \thtml+='<div class=\"caption\">';\n\t \thtml+='<div class=\"col1-title lt\" title=\"'+jsonData['album_info'][i][\"album_name\"]+'\" >';\n\t \t\thtml+=showCroppedText( jsonData['album_info'][i][\"album_name\"], 15 ) ;\n\t \t\thtml+='</div>';\n\t \t\thtml+='<div class=\"col1-title3 rt\">';\n\t \t\thtml+=jsonData['album_info'][i][\"photo_count\"];\n\t \t\thtml+='</div>';\n\t \t\thtml+='</div>';\n\t \t\thtml+='</div>';\n\t \t\thtml+='</a>';\t \n\t \t\thtml+='</div>';\n\t \t}\n\t \t$('#detail').append(html);\n\t \t\n\t \t$(\"input#album_page\").val( parseInt( $(\"input#album_page\").val() ) + 1 );\n\t \t\n\t \tif( jsonData['is_there_more_albums'] != 0 )\n\t \t{\t\n\t \t\tloadPhotoAlbums(user_id, $(\"input#album_page\").val(), 12);\n\t \t}\n \t}\n \telse if(jsonData.login_user_no_album_msg)\n \t{\n \t\t html+='<div class=\"no-albums\">';\n \t\t html+='<img src=\"'+IMAGE_PATH+'/no-album.png\"/>';\n \t\t html+='<div class=\"no-album-text\">';\n \t\t html+='No Albums to be displayed';\n \t\t html+='</div>';\n \t\t html+='<div>';\n \t\t \n \t\t html+='<a href =\"'+PROJECT_URL+PROJECT_NAME+'profile/photo-albums\" class=\"create-album\">';\n \t\t html+= '+Create New Album';\n \t\t html+=\t'</a>';\n \t\t html+='</div>';\n \t\t html+='</div>';\n \t\t$('#detail').html( html );\n \t}\n \telse if(jsonData.not_a_login_user_no_album_msg)// if albums are not of login user and there are no albums.\n \t{\n \t\t html+='<div class=\"no-albums\">';\n \t\t html+='<img src=\"'+IMAGE_PATH+'/no-album.png\"/>';\n \t\t html+='<div class=\"no-album-text\">';\n \t\t html+=jsonData['albums_owner_name']+ \" \" +jsonData['not_a_login_user_no_album_msg'];\n \t\t html+='</div>';\n \t\t html+='</div>';\n \t\t$('#detail').html( html );\n \t}\n \telse\n \t{\n \t\t html+='<div class=\"no-albums\">';\n \t\t html+='<img src=\"'+IMAGE_PATH+'/no-album.png\"/>';\n \t\t html+='<div class=\"no-album-text\">';\n \t\t html+=jsonData['albums_owner_name']+ \" \" + \"has not shared any albums with you.\";\n \t\t html+='</div>';\n \t\t html+='</div>';\n \t\t$('#detail').html(html);\n \t}\n\t\t},\n error: function(xhr, ajaxOptions, thrownError)\n {\n \t\n\t\t}\n });\n}", "function listBuckets() {\n var request = gapi.client.storage.buckets.list({\n 'project': PROJECT\n });\n executeRequest(request, 'listBuckets');\n}", "function getAlbumsList(username) {\n return $http.get('/api/album/' + username).then(function (data) {\n return data.data.albums;\n });\n }", "function showCollection( array ){\n// - Console.log the number of items in the array.\nconsole.log( 'The number of records in the collection is:', recordCollection.length );\nfor( let i = 0; i<recordCollection.length; i++ ){\n// - Loop over the array and console.log each album's information formatted like: `TITLE by ARTIST, published in YEAR`.\n console.log( recordCollection[i].title, 'by', recordCollection[i].artist, 'published in', recordCollection[i].year ); \n} //end function\n\n} //end showCollection", "function getListObjects(Prefix){\n const params = {\n Bucket: 'gsg-image-uploads',\n Prefix:Prefix, //Limits the response that begin with the specified prefix.\n //MaxKeys: 2 //(Integer) Sets the maximum number of keys returned in the response.\n };\n return new Promise((resolve, reject)=>{\n s3.listObjectsV2(params, function(err, data){\n if (err) {\n console.log(err, err.stack);\n reject(err)\n } else {\n const bucketContents = data.Contents;\n var temp = {};\n bucketContents.map(({Size, Key})=>{\n if(Size>0)\n {\n const urlParams = {Bucket: 'gsg-image-uploads', Key};\n s3.getSignedUrl('getObject',urlParams, function(err, url){\n temp[Key]= url;\n });\n }\n });\n resolve(temp);\n }\n });\n })\n\n}", "function showAlbumsResult(r) \n{\n if (!r.success) {\n\t\t\tif (r.error) {\n\t\t\t\tTi.UI.createAlertDialog({title:L('error'),message:r.error}).show();\n\t\t\t} else {\n\t\t\t\tTi.UI.createAlertDialog({title:L('error'),message:L('uns')}).show();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t//Convert the result to json\n\t\talbumsJSON = JSON.parse(r.result).data;\n\t\tvar albums=[];\n\t\t\n\t\tfor(var j = 0; j < albumsJSON.length; j++) \n\t\t{\n\t\t\t//Check if there is images in this album\n\t\t\tif(!albumsJSON[j].hasOwnProperty('count'))\n\t\t\t{\n\t\t\t\talbumsJSON.splice(j, 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\talbums.push(new Album(\n\t\t\t\t\talbumsJSON[j].name,\n\t\t\t\t\talbumsJSON[j].count,\n\t\t\t\t\t\"https://graph.facebook.com/\"+albumsJSON[j].cover_photo+\"/picture\",\n\t\t\t\t\talbumsJSON[j].id));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Return the resuls\n\t\tlistener(albums);\n}", "async getListS3() {\n s3.listObjectsV2(s3Params, (err, data) => {\n if (err) {\n console.log(err, err.stack);\n } else {\n let listFiles = data[\"Contents\"].map(({ Key }) => ({ key: Key }));\n this.setState({ listFiles: listFiles });\n }\n });\n }", "getAlbumsForArtist(artistName) {\n const artist = this.getArtistById(artistName);\n return artist.getAlbumsNames();\n }", "function loadFullAlbum() {\r\n\ttry {\r\n\t\tif (m = $('.summary')[0].textContent.split('|')[0].match(/(\\d+)/g)) {\r\n\t\t\tm = m.sort(function(a,b){return a-b});\r\n\t\t\ttotalImagePages = Math.ceil(m[2]/20);\r\n\t\t\tif (n=page.match(/page=(\\d)/)) { thisPageNumber=n[1]; } else { thisPageNumber=1; }\r\n\t\t\talbumPagesLoaded = 0;\r\n\t\t\ttotalAlbumPages = totalImagePages-1;\r\n\t\t\t$('#fbf_photo_pagination').innerHTML = '<span class=\"caption\">' + $l('loadingFullAlbum') + '<span></span></span>';\r\n\t\t\tfor (var i=1; i<totalImagePages+1; i++) {\r\n\t\t\t\tif (i!=thisPageNumber) {\r\n\t\t\t\t\tappendPhotos('http://www.facebook.com/' + (page.indexOf('page=')!=-1 ? page.replace(/page=\\d+/,'page='+i) : page+'&page='+i) + '&quickling', $l('fullAlbumLoaded'));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} catch(x) { logError('Load Full Album', x); }\r\n}", "function loadFullAlbum() {\r\n\ttry {\r\n\t\tif (m = $('.summary')[0].textContent.split('|')[0].match(/(\\d+)/g)) {\r\n\t\t\tm = m.sort(function(a,b){return a-b});\r\n\t\t\ttotalImagePages = Math.ceil(m[2]/20);\r\n\t\t\tif (n=page.match(/page=(\\d)/)) { thisPageNumber=n[1]; } else { thisPageNumber=1; }\r\n\t\t\talbumPagesLoaded = 0;\r\n\t\t\ttotalAlbumPages = totalImagePages-1;\r\n\t\t\t$('#fbf_photo_pagination').innerHTML = '<span class=\"caption\">' + $l('loadingFullAlbum') + '<span></span></span>';\r\n\t\t\tfor (var i=1; i<totalImagePages+1; i++) {\r\n\t\t\t\tif (i!=thisPageNumber) {\r\n\t\t\t\t\tappendPhotos('http://www.facebook.com/' + (page.indexOf('page=')!=-1 ? page.replace(/page=\\d+/,'page='+i) : page+'&page='+i) + '&quickling', $l('fullAlbumLoaded'));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} catch(x) { logError('Load Full Album', x); }\r\n}", "function showCollection(){\n// - Console.log the number of items in the array.\n console.log( 'Collection:', collection.length );\n//- Loop over the array and console.log each album's information formatted like: `TITLE by ARTIST, published in YEAR`.\n for (let i = 0; i < collection.length; i++) {\n const record = collection[i];\n console.log( record.title,'by ' + record.artist + ' published in ' + record.yearPublished);\n }\n}", "async function folderList () {\n return bucket.getFiles({\n // TODO: changing frequency may break this?\n maxResults: 365 * 24 / config.get('archiver.frequency'),\n delimiter: '/',\n }).then((data) => {\n const response = data[2];\n return response.prefixes.map(val => val.replace(/\\//, ''));\n });\n}", "function getalbums (user_id, my_album) {\n\n FB.api({\n // access_token: authresponse.accessToken,\n method: 'fql.multiquery',\n queries: {\n query1: 'SELECT aid,object_id, name,link,photo_count,cover_object_id FROM album WHERE owner=\"'+user_id+'\"',\n query2: 'SELECT src FROM photo WHERE object_id IN (SELECT cover_object_id FROM #query1)'\n }\n },\n function(response) {\n\n var cover_valid = 0;\n $(\"#image_frame\").html(\"\");\n var frame = document.createElement('div');\n frame.setAttribute(\"id\", \"image_frame\");\n frame.setAttribute(\"class\", \"cf\");\n\n document.body.appendChild(frame);\n\n var page_title = document.createElement('div');\n page_title.setAttribute(\"class\", \"page_title\");\n\n var title = document.createTextNode(\"Your Albums\");\n var div_albums = document.createElement('br');\n\n page_title.appendChild(title);\n frame.appendChild(page_title);\n frame.appendChild(div_albums);\n\n for (var i=0; i<response[0].fql_result_set.length; i++) {\n\n if(response[0].fql_result_set[i].cover_object_id != 0)\n {\n\n var album_name = document.createTextNode(response[0].fql_result_set[i].name);\n\n var album = document.createElement('a');\n album_id = response[0].fql_result_set[i].object_id;\n album.aid = response[0].fql_result_set[i].aid;\n album.album_name = response[0].fql_result_set[i].name;\n album.link = response[0].fql_result_set[i].link;\n album.count = response[0].fql_result_set[i].photo_count;\n\n album.setAttribute(\"href\", \"/home/album_photos?album_id=\"+album_id+\"&album_name=\"+album.album_name);\n\n var cover_photo = document.createElement('img');\n cover_photo.src = response[1].fql_result_set[cover_valid++].src;\n\n album.appendChild(cover_photo);\n\n var title = document.createElement('div');\n title.setAttribute(\"class\", \"title\");\n title.appendChild(album_name);\n\n var image = document.createElement('div');\n image.setAttribute(\"class\", \"image\");\n image.appendChild(album);\n image.appendChild(title);\n\n frame.appendChild(image);\n\n }\n }\n\n });\n}", "function s3ListObjects(token, collection = []) {\n return listObjects({\n Bucket: bucket,\n Prefix: 'sound-sync/',\n ContinuationToken: token,\n }).then(({ IsTruncated, Contents, NextContinuationToken }) => {\n const contents = collection.concat(Contents);\n return IsTruncated\n ? s3ListObjects(NextContinuationToken, contents)\n : contents;\n });\n}", "function getAlbum (pl) {\n for (var i = 0; i < pl.length; i++) {\n if (pl[i].album.name !== '') {\n return pl[i].album.name\n }\n }\n}", "function getAlbum (pl) {\n for (var i = 0; i < pl.length; i++) {\n if (pl[i].album.name !== '') {\n return pl[i].album.name\n }\n }\n}", "static async getAllAlbum(req, res, next) {\n try {\n const galleries = await gallery.findAll({\n attributes: ['albumId'],\n group: ['albumId'],\n })\n res.status(200).json(galleries)\n } catch (error) {\n next(error)\n }\n }", "async function getAlbumsByPage() {\n _model.isFetchingNewPage = true;\n try {\n const albumList = await albumStore.fetchByPage(_model.nextPage);\n _model.albums = _model.albums.concat(albumList.albums);\n _model.hasNextPage = angular.isDefined(albumList.pagingState);\n _setNextPage(_model.hasNextPage, albumList.pagingState);\n $rootScope.$new().$evalAsync();\n }\n catch(error) {\n $log.warn(error);\n }\n _model.isFetchingNewPage = false;\n }", "function zoto_list_album_sets(options){\n\toptions = options || {};\n\toptions.no_results_msg = ' ';\n\toptions.expand = true;\n\n\tthis.zapi_str = 'sets.get_list';\n\tthis.total_sets = 0;\n\t\n\tthis.str_return = _('back to albums');\n\tthis.glob = options.glob || new zoto_glob();\n\n\tthis.$uber(options);\n\tthis.build_list_header();\n}", "function album_details(album, songlist) {\n artistname.innerHTML = album.artistname;\n \n albumimage.forEach(e => {\n e.src = album.albumimage;\n });\n\n song_num.innerHTML = songlist[song_id].songid;\n bartitle.innerHTML = songlist[song_id].songname;\n titlename.innerHTML = songlist[song_id].songname;\n\n track.src = songlist[song_id].src;\n track.autoplay = true;\n\n}", "displayAlbums() {\n const { albums } = this.state;\n\n if (!albums) {\n return;\n }\n\n return albums.map(album => (\n <AlbumContainer album={album} key={album.album_id} />\n ));\n }", "function hideAlbums(){\n $(\".album\").hide();\n}", "function getFriendsAlbums() {\n var deferred = $q.defer();\n Facebook.api('/me/friends?fields=albums.limit(5).fields(count,updated_time,name,type),name,picture', function(response) {\n if(response.data) {\n console.log(response);\n deferred.resolve(response);\n } else {\n //error handling\n }\n })\n return deferred.promise;\n }", "function renderAlbum(album) {\n const photos = album.photos;\n let template = `\n<div class=\"album-card\">\n <header>\n <h3>${photos.title}, by Bret </h3>\n </header>\n <section class=\"photo-list\">\n </section>\n</div>\n `\n photos.forEach(photo => {\n $('.photo-list').append(renderPhoto(photo));\n })\n return template;\n}", "function fetchAlbums() {\n fetch('https://rallycoding.herokuapp.com/api/music_albums')\n .then(res => res.json())\n .then(json => console.log(json));\n}", "function AlbumsList(_alert, _listcontainer, _listcontainerbody, _extContainer) {\n\n\t\t//reference to alert element\n\t\tthis.alert = _alert;\n\n\t\t//reference to albums container header\n\t\tthis.listcontainer = _listcontainer;\n\n\t\t//reference to albums container body\n\t\tthis.listcontainerbody = _listcontainerbody;\n\n\t\t//reference to external container (used to collapse album area)\n\t\tthis.externalContainer = _extContainer;\n\n\t\t//clears the html element content and hides it\n\t\tthis.reset = function() {\n\t\t\tthis.listcontainer.style.visibility = \"hidden\";\n\t\t\tthis.listcontainerbody.innerHTML=\"\";\n\t\t\tthis.externalContainer.removeChild(this.listcontainer);\n\t\t};\n\n\t\t//call server for albums data and show them in the page\n\t\tthis.show = function() {\n\t\t\tvar self = this;\n\t\t\tmakeSearchCall(\"GET\", \"Home\",\n\t\t\t\tfunction(req) {\n\t\t\t\t\tif (req.readyState == XMLHttpRequest.DONE) {\n\t\t\t\t\t\tvar message = req.responseText;\n\t\t\t\t\t\tswitch (req.status) {\n\t\t\t\t\t\t\tcase 200:\n\t\t\t\t\t\t\t\tconsole.log(\"Response = \" + message);\n\t\t\t\t\t\t\t\tvar albumsToShow = JSON.parse(req.responseText);\n\t\t\t\t\t\t\t\tif (albumsToShow.length == 0) {self.alert.textContent = \"\\u00BB No albums found!\"; return;}\n\t\t\t\t\t\t\t\tself.update(albumsToShow); // self visible by closure\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 400: // bad request\n\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB Error code 400: \" + message;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 401: // unauthorized\n\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB Error code 401: \" + message;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 500: // server error\n\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB Error code 500: \" + message;\n\t\t\t\t\t\t\t\tbreak;\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\n\t\t//update the page content about albums\n\t\tthis.update = function(arrayAlbums) {\n\t\t\tvar li, card, cardBody, imgLink, firstImage, title;\n\t\t\tthis.listcontainerbody.innerHTML = \"\"; // empty the card body\n\n\t\t\t//expand albums area by re-appending the html child elem\n\t\t\tthis.externalContainer.appendChild(this.listcontainer);\n\n\t\t\t// build updated list\n\n\t\t\t// \"self\" visible here instead of \"this\" (this is a trick to make \"this\" visible in nested functions)\n\t\t\tvar self = this;\n\n\t\t\tarrayAlbums.forEach(function(album) {\n\t\t\t\tcard = document.createElement(\"div\");\n\t\t\t\tcard.setAttribute(\"sortable\", \"true\");\n\t\t\t\tcard.setAttribute(\"albumId\", album.id);\n\t\t\t\tcard.setAttribute(\"class\", \"card mb-4 mx-auto d-block shadow-sm w-50\");\n\t\t\t\tcard.setAttribute(\"id\", album.id);\n\t\t\t\tfirstImage = document.createElement(\"img\");\n\t\t\t\tfirstImage.setAttribute(\"src\", getContextPath() + album.firstImagePath);\n\t\t\t\tfirstImage.setAttribute(\"class\", \"card-img-top thumbnailsec\");\n\t\t\t\tfirstImage.setAttribute('albumId', album.id);\n\t\t\t\tcard.appendChild(firstImage);\n\t\t\t\tcardBody = document.createElement(\"div\");\n\t\t\t\tcardBody.setAttribute(\"class\", \"card-body\");\n\t\t\t\tcardBody.setAttribute(\"albumId\", album.id);\n\t\t\t\tcard.appendChild(cardBody);\n\t\t\t\ttitle = document.createElement(\"h5\");\n\t\t\t\ttitle.setAttribute(\"id\", \"albumName\");\n\t\t\t\ttitle.setAttribute(\"albumId\", album.id);\n\t\t\t\ttitle.textContent = album.title;\n\t\t\t\tcardBody.appendChild(title);\n\n\t\t\t\tcard.addEventListener(\"click\", (e) => {\n\t\t\t\t\t// image clicked\n\t\t\t\t\tself.reset();\n\t\t\t\t\timagesList.show(e.target.getAttribute(\"albumId\"), 1); // the list must know the details container\n\t\t\t\t}, false);\n\t\t\t\t//imgLink.href = \"#\";\n\t\t\t\tself.listcontainerbody.appendChild(card);\n\t\t\t});\n\n\t\t\t//make albums visible\n\t\t\tthis.listcontainer.style.visibility = \"visible\";\n\n\t\t\t//make albums sortable\n\t\t\tthis.sortableAlbums(\n\t\t\t\tthis.listcontainerbody,\n\t\t\t\tfunction (sortedAlbum) {\n\t\t\t\t\tconsole.log(\"album \" + sortedAlbum.getAttribute(\"albumId\") + \"has changed position\");\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t//enable save albums order button\n\t\t\tthis.setSaveAlbumsOrderButton();\n\t\t};\n\n\t\t//make albums sortable by drag and drop\n\t\tthis.sortableAlbums = function (rootEl, onUpdate) {\n\t\t\tvar dragEl;\n\n\t\t\tconsole.log(\"rootEl = \" + rootEl.getAttribute(\"id\"));\n\t\t\tconsole.log(Array.from(rootEl.children));\n\n\t\t\t// Set all children movable\n\t\t\tArray.from(rootEl.children).forEach(function (itemEl) {\n\t\t\t\tconsole.log(\"itemEl = \" + itemEl.getAttribute(\"id\") + \" \" + itemEl.getAttribute(\"sortable\") );\n\t\t\t\titemEl.draggable = true;\n\t\t\t});\n\n\t\t\t// Function triggered when a dragged element is over an other one\n\t\t\tfunction _onDragOver(e) {\n\n\t\t\t\t//disable default event behavior\n\t\t\t\te.preventDefault();\n\n\t\t\t\t//change cursor icon\n\t\t\t\te.dataTransfer.dropEffect = 'move';\n\n\t\t\t\tconsole.log(\"dragging: \" + dragEl.tagName);\n\n\t\t\t\t//target that triggered the event (note: it isn't the one that is being dragged)\n\t\t\t\tvar target = e.target;\n\n\t\t\t\t//choosing if the destination target is suitable to change its position in the album list\n\t\t\t\t//with the dragged element\n\t\t\t\tif( target && target !== dragEl && target.getAttribute(\"sortable\") === \"true\" ){\n\n\t\t\t\t\tvar rect = target.getBoundingClientRect(); //target card rect (used to get its size on screen)\n\t\t\t\t\tvar next = (e.clientY - rect.top)/(rect.bottom - rect.top) > .5; //true if we are up the target that triggered the event\n\n\t\t\t\t\t//thanks to \"next\" we understand where to put in the albumList the dragged album\n\t\t\t\t\trootEl.insertBefore(dragEl, next && target.nextSibling || target);\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// End of sorting\n\t\t\tfunction _onDragEnd(e){\n\n\t\t\t\t//disable default event behavior\n\t\t\t\te.preventDefault();\n\n\t\t\t\t//make dragged element look normal (no more transparent)\n\t\t\t\tdragEl.classList.remove('ghost');\n\n\t\t\t\t//remove drag and drop events listener\n\t\t\t\trootEl.removeEventListener('dragover', _onDragOver, false);\n\t\t\t\trootEl.removeEventListener('dragend', _onDragEnd, false);\n\n\t\t\t\t// Notification about the end of sorting (for debug purpose)\n\t\t\t\tonUpdate(dragEl);\n\t\t\t}\n\n\t\t\t//Drag and drop initialization\n\t\t\trootEl.addEventListener('dragstart', function (evt){\n\n\t\t\t\t//making sure to drag the right html element\n\t\t\t\tvar draggingParentOrChild = evt.target.getAttribute(\"sortable\")===\"true\";\n\n\t\t\t\t//storing in \"dragEl\" the dragged element\n\t\t\t\tdragEl = (draggingParentOrChild)?evt.target:evt.target.parentNode;\n\n\t\t\t\t//Setting the drag effect\n\t\t\t\tevt.dataTransfer.effectAllowed = 'move';\n\n\t\t\t\t//Setting data that are transferred while dropping\n\t\t\t\tevt.dataTransfer.setData('Text', dragEl.textContent);\n\n\t\t\t\t// Subscribing drag and drop events\n\t\t\t\trootEl.addEventListener('dragover', _onDragOver, false);\n\t\t\t\trootEl.addEventListener('dragend', _onDragEnd, false);\n\n\t\t\t\t//timeout with 0 wait seconds is a trick to schedule the callback\n\t\t\t\t//to be run asynchronously, after the shortest possible delay\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\tdragEl.classList.add('ghost'); //set the dragged object to be transparent\n\t\t\t\t}, 0)\n\t\t\t}, false);\n\t\t};\n\n\t\t//enable save albums order button\n\t\tthis.setSaveAlbumsOrderButton = function () {\n\n\t\t\t//retrieve button html reference\n\t\t\tdocument.getElementById(\"saveAlbumsOrder\").addEventListener(\"click\", (e) => {\n\n\t\t\t\tvar self=this;\n\t\t\t\tvar albumsIdOrder = [];\n\n\t\t\t\t//retrieve album order from html document\n\t\t\t\tArray.from(this.listcontainerbody.children).forEach(function (child) {\n\t\t\t\t\talbumsIdOrder.push(child.getAttribute(\"albumId\"));\n\t\t\t\t});\n\n\t\t\t\tconsole.log(\"Sending new albums order to server...\");\n\t\t\t\tconsole.log(albumsIdOrder);\n\n\t\t\t\t//sending new album order toi server\n\t\t\t\tmakeJsonCall(\"POST\", \"ChangeAlbumOrder\", JSON.stringify({\"newOrder\":albumsIdOrder}),\n\t\t\t\t\tfunction(req) {\n\t\t\t\t\t\tif (req.readyState == XMLHttpRequest.DONE) {\n\t\t\t\t\t\t\tvar message = req.responseText;\n\t\t\t\t\t\t\tswitch (req.status) {\n\t\t\t\t\t\t\t\tcase 200:\n\t\t\t\t\t\t\t\t\tconsole.log(\"New albums order saved successfully\");\n\n\t\t\t\t\t\t\t\t\t//log in green that the new albums order is saved\n\t\t\t\t\t\t\t\t\tself.alert.classList.remove(\"text-danger\");\n\t\t\t\t\t\t\t\t\tself.alert.classList.add(\"text-success\");\n\t\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB New albums order saved successfully\";\n\n\t\t\t\t\t\t\t\t\t//clean alert bar after 5 seconds\n\t\t\t\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB\";\n\t\t\t\t\t\t\t\t\t\tself.alert.classList.add(\"text-danger\");\n\t\t\t\t\t\t\t\t\t\tself.alert.classList.remove(\"text-success\");\n\t\t\t\t\t\t\t\t\t},5000);\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 400: // bad request\n\t\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB Error code 400: \" + message;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 401: // unauthorized\n\t\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB Error code 401: \" + message;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 500: // server error\n\t\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB Error code 500: \" + message;\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});\n\t\t\t\t});\n\t\t}\n\t}", "function Album(){\nthis.photos = []\n// empty array to add photos too \n\tthis.addphotos = function(photos){\n\t\t this.photo.push(photos);\n\t\t// adding photos to the empty array aka album \n\t\treturn photos \n\t}\n\n\n\tthis.list_photo =function(){\n\treturn this.photos\n\t\t// returning the list of photos\n\t}\n\n\tthis.get_photo =function(y){\n\treturn this.photos[y];\n\t\t// adding photos to the new album via the y paramters \n\t}\n\n\tfunction Photo(location,filename){\n\tthis.location = location;\n\tthis.filename = filename;\n\t}\n }", "function renderAlbumList(albumList) {\n $('#app section.active').removeClass('active');\n $('#album-list').empty();\n $('#album-list').addClass('active');\n albumList.forEach(album => {\n $('#album-list').append(renderAlbum(album));\n });\n}", "function getAlbums(res){\n res.forEach(function(album){\n renderAlbum(album);\n })\n}", "function getSongList(){\n\t\t\tSongSheetAPI.index(\n\t\t\t\tfunction success(data){\n\t\t\t\t\tconsole.log('success', data);\n\t\t\t\t\t$scope.songSheets = data;\n\t\t\t\t},\n\t\t\t\tfunction error(data){\n\t\t\t\t\tconsole.log('error', data);\n\t\t\t\t}\n\t\t\t);\n\t\t}", "async function getAlbums(limit, query) {\n const albums = await fetchAlbums(limit, query);\n const artistIds = albums.map((el) => el.artistId);\n const artists = await fetchArtists(artistIds);\n return albums.map((album) => ({\n ...album,\n artistName: artists[album.artistId],\n }));\n}", "function searchAlbum() {\n var usersAlbum = $(albumSearch).val();\n\n $.ajax({\n url: 'https://api.spotify.com/v1/search',\n data: {\n q: usersAlbum,\n type: 'album'\n },\n success: function(data) {\n console.log('success', data);\n for(fourthCounter in data.albums.items) {\n var album = data.albums.items[fourthCounter]\n $('.results').append('<div class=\"result-background\"><div class=\"result-content\">' +\n '<img src=\"' + album.images[0].url + '\" onload=\"this.width/=2;this.onload=null;\"><span>' +\n album.name + '</span></div></div>');\n }\n },\n error: function(data) {\n console.log('error', data)\n }\n });\n }", "async function ListObject(bucketName, prefix) {\n let response;\n var params = {\n Bucket: bucketName,\n Delimiter: '/',\n MaxKeys: 1,\n Prefix: prefix\n };\n\n try {\n response = await S3.listObjectsV2(params).promise();\n }\n catch (error) {\n console.log(\"list error:\", error);\n }\n\n return response;\n}", "function getphotos(album_id, album_name) {\n\n FB.api(album_id + \"/photos?limit=400&offset=0\",function(photos){\n\n if (photos && photos.data && photos.data.length){\n\n var photo_frame = document.createElement('div');\n photo_frame.setAttribute(\"id\", \"image_frame\");\n photo_frame.setAttribute(\"class\", \"cf\");\n\n document.body.appendChild(photo_frame);\n\n var page_title = document.createElement('div');\n page_title.setAttribute(\"class\", \"page_title\");\n\n var pic_name;\n\n if(album_name == \"undefined\") {\n pic_name = \"Untitled\";\n }\n else {\n pic_name = album_name;\n }\n\n var title = document.createTextNode(\"Album: \"+pic_name);\n var div_albums = document.createElement('br');\n\n page_title.appendChild(title);\n photo_frame.appendChild(page_title);\n photo_frame.appendChild(div_albums);\n\n for (var j = 0; j < photos.data.length; j++){\n\n var photo = document.createElement('a');\n photo.id = photos.data[j].id;\n photo.name = photos.data[j].name;\n photo.from = photos.data[j].from.id;\n photo.source = photos.data[j].images[4].source;\n\n photo.setAttribute(\"href\", \"/home/user_likes?photo_id=\"+photo.id+\"&photo_name=\"+photo.name+\"&photo_from=\"+photo.from+\"&photo_source=\"+photo.source);\n\n var picture = document.createElement('img');\n picture.src = photos.data[j].picture;\n photo.appendChild(picture);\n\n\n var image = document.createElement('div');\n image.setAttribute(\"class\", \"image\");\n image.appendChild(photo);\n\n var title = document.createElement('div');\n title.setAttribute(\"class\", \"title\");\n\n if(photos.data[j].name) {\n var photo_name = document.createTextNode(photos.data[j].name);\n title.appendChild(photo_name);\n\n }\n else{\n var photo_name = document.createTextNode(\"Untitled\");\n title.appendChild(photo_name);\n }\n\n image.appendChild(title);\n photo_frame.appendChild(image);\n }\n }\n });\n}", "function fetchAlbums(){\n fetch('https://rallycoding.herokuapp.com/api/music_albums')\n .then (res=>res.json())\n .then(json=>console.log(json));\n}", "function zoto_list_recent_album_activity(options){\n\toptions = options || {};\n\toptions.no_results_msg = ' ';\n\tthis.zapi_str = 'sets.get_albums';\n\tthis.glob = options.glob || new zoto_glob();\n\tthis.$uber(options);\n}", "function listAllObjects(oci, bucket) {\n return oci.request(bucket)\n .then(({ data }) => data.objects.map(o => o.name));\n}", "function manageAlbums() {\n\turl = \"manageAlbums.php\";\n\tdoAjaxCall(url, \"updateMain\", \"GET\", true);\n}", "function slideshowGPhotoAlbums(a) {\n var albums_html = '';\n var albums_explore_btn = $('.h_ex_your_ph');\n\n\n if(albums_explore_btn.find('.list-albums-o').length) return albums_explore_btn.find('.list-albums-o').fadeIn();\n\n for(var i = 0; i < a.length; i++) {\n var _xkoe = a[i];\n albums_html += '<div id=\"sl-i-alb-' + _xkoe.id + '\" onclick=\"evstop(event);getUserSphotosFalbum(event,this,function(data,id){slideshowPhotosFromAlbum(data,id);});\" class=\"col-card __no-decor _novitrina ovr-menu_soh\">\\\n\t\t\t\t\t\t<div><div class=\"photo-sc_i_cover\">\\\n\t\t\t\t\t\t<div class=\"photo-sc_i_cnt __prw\">\\\n\t\t\t\t\t\t<a href=\"javascript:void(0)\" class=\"photo-sc_i_cnt_a\">\\\n\t\t\t\t\t\t<img class=\"photo-sc_i_cnt_a_img va_target\" src=\"/getPhoto?p=' + _xkoe.cover + '&sz=thumb\">\\\n\t\t\t\t\t\t<div class=\"col-card_ovr\"></div></a></div></div>\\\n\t\t\t\t\t\t<div class=\"photo-sc_grid_abt ellip\">\\\n\t\t\t\t\t\t<span class=\"o\" title=\"' + _xkoe.name + '\">' + _xkoe.name + '</span><span class=\"alb_count_pp\">' + _xkoe.count + ' photos</span></div></div></div>';\n }\n if(!albums_explore_btn.find('.list-albums-o').length) {\n\n albums_explore_btn.append('<div class=\"list-albums-o\" onclick=\"evstop(event);\"><div class=\"up_arr_st3\"></div><div class=\"nano albums_list-9q0\" ><div class=\"nano-content\">' + albums_html + '</div></div></div>');\n ga(\".list-albums-o .nano\").nanoScroller();\n ga(window).off('keyup.slideshow-dropdownhide').on('keyup.slideshow-dropdownhide', function(ev) {\n ev.preventDefault();\n ev.stopImmediatePropagation();\n if(ev.keyCode == 27)\n albums_explore_btn.find('.list-albums-o').fadeOut();\n });\n ga('body').off('click.slideshow-dropdownhide').on('click.slideshow-dropdownhide', function(e) {\n //e.preventDefault();\n albums_explore_btn.find('.list-albums-o').fadeOut();\n });\n }\n}", "function getAllProfileAlbums(param) {\n return $http.get('/api/shared/profileAlbum', {params: {loadMore: param}})\n .then(function (data) {\n return data.data;\n });\n }", "function loadAlbums() {\n\t$.ajax({\n\t\turl: 'bowie_albums.json',\n\t\tdataType: 'json',\n\t\tcontentType: 'application/json',\n\t\tmethod: 'get',\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tconsole.log(errorThrown);\n\t\t},\n\t\n\t\tsuccess: function(data, textStatus, jqXHR) {\n\t\t\talbums = data.bowie_albums;\n\t\t\t//console.log(albums);\n\t\t}\n\t});\t \t\t \t\t\t \n}", "function searchAlbumCovers(id) {\n\n\n \n var queryUrl = \"https://api.spotify.com/v1/artists/\" + id + \"/albums?market=us&limit=10\"\n\n $.ajax({\n url: queryUrl,\n type: \"GET\",\n beforeSend: function (xhr) { xhr.setRequestHeader('Authorization', 'Bearer ' + _token); },\n success: function (response) {\n\n $(\".image-results\").attr(\"src\", response.items[0].images[0].url)\n $(\".image-results\").attr(\"value\", response.items[0].id)\n $(\".image-results2\").attr(\"src\", response.items[1].images[0].url)\n $(\".image-results2\").attr(\"value\", response.items[1].id)\n\n $(\".image-results3\").attr(\"src\", response.items[2].images[0].url)\n $(\".image-results3\").attr(\"value\", response.items[2].id)\n\n $(\".image-results4\").attr(\"src\", response.items[3].images[0].url)\n $(\".image-results4\").attr(\"value\", response.items[3].id)\n\n $(\".image-results5\").attr(\"src\", response.items[4].images[0].url)\n $(\".image-results5\").attr(\"value\", response.items[4].id)\n\n $(\".image-results6\").attr(\"src\", response.items[6].images[0].url)\n $(\".image-results6\").attr(\"value\", response.items[6].id)\n\n\n $(\".album-name\").text(response.items[0].name)\n $(\".album-name2\").text(response.items[1].name)\n $(\".album-name3\").text(response.items[2].name)\n $(\".album-name4\").text(response.items[3].name)\n $(\".album-name5\").text(response.items[4].name)\n $(\".album-name6\").text(response.items[5].name)\n $(\".album-name7\").text(response.items[6].name)\n\n $(\".more-albums\").attr(\"src\", response.items[i].images[0].url)\n $(\".more-albums:nth-child(2)\").attr(\"src\", response.items[1].images[0].url)\n $(\".more-albums:nth-child(3)\").attr(\"src\", response.items[2].images[0].url)\n $(\".more-albums:nth-child(4)\").attr(\"src\", response.items[3].images[0].url)\n $(\".more-albums:nth-child(5)\").attr(\"src\", response.items[4].images[0].url)\n $(\".more-albums:nth-child(6)\").attr(\"src\", response.items[5].images[0].url)\n\n\n console.log(response.items[0].images[0].url)\n console.log(response)\n }\n});\n\n\n}", "function execute() {\n return gapi.client.photoslibrary.mediaItems.list({}).then(\n function(response) {\n // Handle the results here (response.result has the parsed body).\n console.log(\"Response\", response);\n },\n function(err) {\n console.error(\"Execute error\", err);\n }\n );\n}", "function printAlbums(number, offset) {\n var playlistLength = $('.sp-list-table-body').find(\".sp-list-item\").size();\n // EchoNest only allows you to request info for 4 or 5 songs at a time, so we need to do this in batches\n // console.log('Printing '+number+' albums with offset = '+offset);\n var uriBatch = [];\n var track;\n var artist;\n var i = 0;\n // console.log('playlist length = '+playlistLength);\n $('.sp-list-item').each(function(i, trackItem) {\n // Get uri of song\n var uri = trackItem.getAttribute(\"data-uri\");\n if(undefined !== uri) {\n // Change format of the Spotify URI to comply with EchoNest API\n // var formattedURI = uri.replace('spotify', 'spotify-WW');\n // if (i>=offset && i<4+offset) {\n // Add the URI to our current batch\n uriBatch.push(uri);\n // }\n }\n });\n\n // Construct the URL request for EchoNest. There's definitely a better way to do this using a base URL with parameters...\n // var enURL = enBase+'api_key='+enAPIkey+'&format=json&track_id='+uriBatch[0]+'&track_id='+uriBatch[1]+'&track_id='+uriBatch[2]+'&track_id='+uriBatch[3]+'&bucket=audio_summary';\n var enURL = enBase+'api_key='+enAPIkey+'&format=json&track_id='+uriBatch[offset]+'&bucket=audio_summary';\n var batchBPM = [];\n var batchKey =[];\n var batchMode =[];\n var batchKeyMatch =[];\n\n console.log('enURL = '+enURL, enAPIkey);\n \n $.getJSON(\n enURL, function (data) {\n console.log(data);\n $.each(data, function(index, element) {\n // for (var k = 0; k<1; k++) {\n if (element.status.code == 0) {\n // console.log('pushing key and bpm for item '+k);\n // Put the key and BPM info into our arrays\n batchKey.push(element.songs[0].audio_summary.key);\n batchMode.push(element.songs[0].audio_summary.mode);\n batchBPM.push(parseInt(element.songs[0].audio_summary.tempo));\n batchKeyMatch.push(compareToCurrentKey(element.songs[0].audio_summary.key, element.songs[0].audio_summary.mode));\n console.log(compareToCurrentKey(element.songs[0].audio_summary.key, element.songs[0].audio_summary.mode));\n }else{\n batchKey.push('!');\n batchMode.push('!');\n batchBPM.push('!');\n batchKeyMatch.push('!');\n }\n // }\n });\n // Now we've got our data, replace the column contents with it\n $('.sp-list-item').each(function(i, trackItem) {\n if (i>=offset && i<1+offset) {\n var keyMatchTextColor;\n var keyMatchBgColor;\n if (batchKeyMatch[i-offset] == 0) {\n // NO MATCH\n keyMatchTextColor = \"black\";\n keyMatchBgColor = \"inherit\";\n }else if (batchKeyMatch[i-offset] == 1) {\n // IN KEY\n keyMatchTextColor = \"white\";\n keyMatchBgColor = \"green\";\n }else if (batchKeyMatch[i-offset] == 2) {\n // UP A FIFTH\n keyMatchTextColor = \"white\";\n keyMatchBgColor = \"orange\";\n }else if (batchKeyMatch[i-offset] == 3) {\n // DOWN A FIFTH\n keyMatchTextColor = \"white\";\n keyMatchBgColor = \"#808000\";\n }else if (batchKeyMatch[i-offset] == 4) {\n // RELATIVE MAJOR\n keyMatchTextColor = \"white\";\n keyMatchBgColor = \"#008080\";\n }else if (batchKeyMatch[i-offset] == 5) {\n // RELATIVE MINOR\n keyMatchTextColor = \"white\";\n keyMatchBgColor = \"#008080\";\n }\n // console.log('replace '+i);\n $(this).find(\".sp-list-cell-popularity\").each(function (l) {\n $(this).html(batchBPM[i-offset]);\n });\n $(this).find(\".sp-list-cell-share\").each(function (l) {\n if (batchMode[i-offset]) {\n $(this).html(\"<div style='background-color:\"+keyMatchBgColor+\"; color:\"+keyMatchTextColor+\"; font-weight:bold;'>\"+convertKey(batchKey[i-offset])+\"m</div>\");\n }else{\n $(this).html(\"<div style='background-color:\"+keyMatchBgColor+\"; color:\"+keyMatchTextColor+\"; font-weight:bold;'>\"+convertKey(batchKey[i-offset])+\"</div>\");\n }\n });\n }\n });\n\n // Run the whole thing again until we run out of songs\n if (offset <= playlistLength){\n printAlbums(1, offset+1);\n // console.log('next offset = '+offset+4);\n }else{\n // console.log('reached end of list');\n }\n });\n }", "function getAlbums(id) {\n vm.modalLoading = true;\n listService.getAlbums(id).then(function(data) {\n vm.modalLoading = false;\n vm.showModal.albums = data;\n })\n }", "function readBucketList_bucket(obj) {\n\tchecked = ['✗', '✓'];\n\t$.each(obj.bucket, function(index, value){\n\t\tvar temp = \"<li>\"+ checked[value.checked] + \" \" + value.content + \"</li>\";\n\t\t$(\".show-bucket-list\").append(temp);\n\t})\t\n}", "function getAlbumReference() {\n return true;\n}", "getAlbumsByArtist(artistName) {\n\t\tvar query = `\n\t\tSELECT DISTINCT album FROM songs\n\t\t\tLEFT JOIN json USING (json_id)\n\t\t\tWHERE artist=\"${artistName}\"\n\t\t\tORDER BY date_added ASC\n\t\t`;\n\t\n\t\treturn this.cmdp(\"dbQuery\", [query])\n\t\t\t.then((albumObjs) => {\n\t\t\t\t// Unpack \"albums\" string attribute into its own array of strings\n\t\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\t\tresolve(albumObjs.map(function(a) {return a.album;}));\n\t\t\t\t});\n\t\t\t});\n\t}", "function showCollection(array){\n // - Console.log the number of items in the array.\n console.log(array);\n // - Loop over the array and console.log each album's information formatted like: `TITLE by ARTIST, published in YEAR`.\n for (let i = 0; i < array.length; i++){\n console.log(`${array[i].title} by: ${array[i].artist}, Published: ${array[i].yearPublished}`);\n\n } // end of foor loop\n } // end of of showCollection", "function setAlbumCover() {\n if (!currentFilterByTag || currentFilterByTag.length===0)\n return; // no curent album\n setAlbumCoverNext(Object.keys(selection), function() {\n flash(\"Album cover set\");\n });\n}", "async function getExploreAlbum1() {\n let response = await fetch(\"http://wordpress.oscho.dk//wp-json/wp/v2/posts?_embed&categories=29\");\n let data = await response.json();\n appendExploreAlbum1(data);\n //showLoader(false);\n }", "loadArtistsOrAlbums(offset) {\n this._ApiFactory.getByArtistOrAlbum(this._$stateParams.value, offset).query({}, (response) => {\n\n const albums = this.matchSpotifyResults(response.albums.items);\n const artists = this.matchSpotifyResults(response.artists.items);\n\n this.musicRange = [...albums, ...artists].sort(this.compareByName);\n this.spotifyResults = [...this.spotifyResults, ...this.musicRange];\n\n }, (response) => {\n if (response.status === 401 || response.status === 403 || response.status === 419 || response.status === 440)\n this._JWT.login();\n });\n }", "function getAlbumListUrl(world) {\n const root = world.getRoot();\n let url;\n if (root) {\n // Parent's Albums tab.\n url = `${root}/albums`;\n } else {\n // Main Album List page.\n url = world.routes.albums;\n }\n return url;\n}", "async getAlbums(artist) {\r\n const albumResponse = await fetch(`https://itunes.apple.com/lookup?id=${artist}&entity=album`);\r\n const album = await albumResponse.json();\r\n return album;\r\n }", "async getMediaItems(albumID){\n //Reponse contains an array of (id, description, productUr, mediaMetaData, filename)\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/mediaItems:search',\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer '+ token.accessToken,\n 'Content-type': 'application/json'\n },\n body: JSON.stringify({\n \"pageSize\":\"100\",\n \"albumId\": albumID\n })\n }\n response = await this.APIHandler.sendRequest(data);\n return response.mediaItems\n }", "getBucketlist(){\n axios.get(BASE_URL + '/bucketlist/',{\n headers: {\"Authorization\": localStorage.getItem('token')}\n }).then((response) => {\n this.setState({\n bucketlists: response.data.bucketlist,\n next_page :response.data.next_page,\n prev_page :response.data.prev_page,\n });\n }).catch((error)=>{});\n }", "function getAlbum(){\n fetch('http://jsonplaceholder.typicode.com/albums')\n .then((res) => res.json())\n .then((data) => {\n let outputAlbum = `<h2 class=\"bb-4\">Album</h2>`;\n data.forEach((album) =>{\n outputAlbum += `\n <ul class=\"list-group mb-3\">\n <li class=\"list-group-item\">Id: ${album.id}</li>\n <li class=\"list-group-item\">Title: ${album.title}</li>\n </ul>\n `;\n });\n document.getElementById('output').innerHTML = outputAlbum;\n })\n .catch((err) => console.log(err));\n}", "function loadBuckets() {\n const appCatalog = JSON.parse(localStorage.appCatalogBucketsUrl);\n const sessionIdHeader = {\n headers: {'sessionid': getSessionId()},\n params: {\n 'kind': $scope.showPSAWorkflowsOnly ? 'Workflow/psa' : 'Workflow/standard',\n 'objectName': $scope.workflowNameQuery\n }\n };\n $scope.isBucketsLoading = true;\n $scope.bucketsMetadataList = [];\n $http.get(appCatalog, sessionIdHeader)\n .success(function (bucketList) {\n $scope.bucketsMetadataList = bucketList;\n // No empty bucket should appear for no empty workflowNameQuery\n if ($scope.workflowNameQuery) {\n $scope.bucketsMetadataList = $scope.bucketsMetadataList.filter(function (bucket) {\n return bucket.objectCount;\n });\n }\n /**\n * In the case where the buckets list is not empty, we select the first bucket if the selected bucket is not in cache or no longer exist\n * Fetch objects of the selected bucket\n * Otherwise, objectList should be empty\n **/\n if ($scope.bucketsMetadataList.length) {\n const selectedBucketIndex = $scope.bucketsMetadataList.findIndex(function (bucket) {\n return bucket.name === $scope.selectedBucketName;\n });\n if (!$scope.selectedBucketName || selectedBucketIndex === -1) {\n $scope.selectedBucket = $scope.bucketsMetadataList[0];\n if (!$scope.showPSAWorkflowsOnly){\n UtilsFactory.setUserPreference('submissionView.selectedBucketName', $scope.selectedBucket.name);\n }\n } else {\n $scope.selectedBucket = $scope.bucketsMetadataList[selectedBucketIndex];\n $scope.scrollToBucket();\n }\n updateWorkflowsMetadataList();\n } else {\n $scope.workflowsMetadataList = [];\n\n }\n $scope.isBucketsLoading = false;\n })\n .error(function (response) {\n console.error('loadbuckets : http.get buckets: ' + response);\n });\n }", "getAlbumsByName(albumName){\n let allAlbums = this.collectAlbums();\n let filtered = allAlbums.filter((album) => album.getName().toLowerCase().includes(albumName.toLowerCase()));\n return filtered;\n }", "getSongsInAlbum(albumName) {\n\t\tvar query = `\n\t\tSELECT * FROM songs\n\t\t\tLEFT JOIN json USING (json_id)\n\t\t\tWHERE album=\"${albumName}\"\n\t\t\tORDER BY date_added ASC\n\t\t`;\n\t\n\t\treturn this.cmdp(\"dbQuery\", [query]);\n\t}", "collectAlbums(){\n let resultadoAlbums = this.artists.map((fArtist) => fArtist.albums);\n let flatResultado = resultadoAlbums.reduce(function(a, b) { \n return a.concat(b);\n }, new Array);\n return flatResultado;\n }", "async function initAlbum() {\n await initThemes()\n const id = urlParams.get('id')\n const albums = JSON.parse(localStorage.getItem(\"albumArray\"))\n const album = albums.find(x => x.id == id)\n if (album.title.length == 0) album.title = \"Ingen titel\"\n if (album.description.length == 0) album.description = \"Ingen beskrivelse\"\n $(\"#album-title\").html(album.title)\n $(\"#albumDescription\").html(album.description)\n fetchAlbumImages(id)\n}", "function loadUpThumbnailsForAlbums(thumbnailDirectory, albumDirectory, jsonFileDirectory) \n{\n \n $(\"#loadingMessageBlock\").text(\"Now loading...\");\n \n \n var listOfActualPhotoLocations = [], regexp = new RegExp(\"\\.png|\\.jpg\"), arrayIndex = 0;\n \n \n /* \n This is where we perform the requests to get the URLs for the thumbnail and album directories,\n as well as putting together the thumbnail elements where the image's source is the URL for the\n thumbnail, and one attribute of each element holds the URL to the actual picture in the album.\n */\n \n // Use the when-and-then method calls to control the sequence of calls to make them synchronous.\n // http://stackoverflow.com/questions/6250022/waiting-for-jquery-ajax-responses\n \n $.ajax({\n //This will retrieve the contents of the folder if the folder is configured as 'browsable'\n url: jsonFileDirectory,\n success: function (albumData) {\n $.each(albumData.imageFiles, function(index, value) {\n listOfActualPhotoLocations.push();\n \n if (currentSystemUsedForDisplayingTheWebsite === systemsForWebsite.WII_U)\n $(\"#thumbnailBlock\").append(\"<div class=\\\"photoGalleryThumbnails\\\">\" +\n \"<div class=\\\"thumbnails\\\" photoHref='\" + albumDirectory + value + \"'>\" +\n \"<img src='\" + thumbnailDirectory + value + \"' alt='\" + thumbnailDirectory + value + \"' />\" + \n \"</div>\" +\n \"</div>\").load();\n else if (currentSystemUsedForDisplayingTheWebsite === systemsForWebsite.RESPONSIVE)\n $(\"#thumbnailBlock\").append(\"<div class=\\\"photoGalleryThumbnails\\\">\" +\n \"<div class=\\\"responsiveThumbnails\\\" photoHref='\" + albumDirectory + value + \"'>\" +\n \"<img src='\" + thumbnailDirectory + value + \"' alt='\" + thumbnailDirectory + value + \"' />\" + \n \"</div>\" +\n \"</div>\").load();\n else\n $(\"#thumbnailBlock\").append(\"<div class=\\\"photoGalleryThumbnails\\\" >\" +\n \"<div class=\\\"desktopThumbnails\\\" photoHref='\" + albumDirectory + value + \"' ng-click=\\\"respondToPhotoThumbnailClick()\\\">\" +\n \"<img src='\" + thumbnailDirectory + value + \"' alt='\" + thumbnailDirectory + value + \"' />\" + \n \"</div>\" +\n \"</div>\").load();\n });\n\n \n\n /* Display the caption that tells the user which album is opened. */\n var currentAlbumOpenedCaption = \"\";\n\n if (currentAlbumOpened == albumSelection.ALBUM_1_SPLATOON_STAY_FRESH)\n currentAlbumOpenedCaption = \"Splatoon! Stay fresh!\";\n else if (currentAlbumOpened == albumSelection.ALBUM_2_SOME_OF_THE_MOST_LIKED_INSTAGRAM_PHOTOS)\n currentAlbumOpenedCaption = \"Some of the most liked Instagram photos\";\n else if (currentAlbumOpened == albumSelection.ALBUM_3_UNIVERSITY_OF_WATERLOO)\n currentAlbumOpenedCaption = \"University of Waterloo\";\n else if (currentAlbumOpened == albumSelection.ALBUM_4_VOLUNTEERING_INVOLVEMENT)\n currentAlbumOpenedCaption = \"Volunteering Involvement\";\n else if (currentAlbumOpened == albumSelection.ALBUM_5_MOST_LIKED_FACEBOOK_PHOTOS)\n currentAlbumOpenedCaption = \"Most Liked Facebook Photos\";\n else if (currentAlbumOpened == albumSelection.ALBUM_6_SELFIES)\n currentAlbumOpenedCaption = \"Selfies\";\n else\n currentAlbumOpenedCaption = \"Some Personal Favourites\";\n\n\n $(\"#loadingMessageBlock\").text(\"Current Album opened: \" + currentAlbumOpenedCaption);\n\n /* \n Perform a quick animation so that the user can see the thumbnails.\n http://stackoverflow.com/questions/6677035/jquery-scroll-to-element \n */\n $('html, body').animate({\n scrollTop: $(\"#thumbnailBlock\").offset().top\n }, 500);\n \n \n }\n });\n \n \n}", "function showAlbum(album, albumWrapper) {\n\t//log('show', album.name);\n\tvar urls = new Array();\n\tfor(var i=0; i<album.photos.length; i++) {\n\t\turls.push(album.photos[i].url);\n\t}\n\t\n\thideAlbum(); //hide the open album (if exists)\n\t\n\tvar gallery = $('#albumGallery');\n\talbumModule.gallery = new Gallery(gallery, urls,350,1);\n\tvar node = $(albumWrapper).parent();\n\t\n\t//remember the position of the album thumbnail\n\talbumModule.selectedAlbum = node;\n\talbumModule.positionOfAlbum = getSizeAndPosition(node);\n\t$('#galleryTitle').html(album.name);\n\t\n\t//move thumbnail and show gallery\n\tnode.animate({\n\t\ttop: '170px',\n\t\tleft: '130px',\n\t\twidth:'580px',\n\t\theight: '460px'\n\t}, 500, 'linear', function() {\n\t\t$(this).hide();\n\t});\n\tgallery.delay(300).fadeIn(200);\n}", "componentDidMount() {\n this.getAllAlbums();\n }", "function initAlbum() {\r\n\tplayOgg();\r\n\tvar loadAlbum = getAlbum();\r\n\tif(loadAlbum==\"galaxies\") {\r\n\t\tpath = \"../../MaavisMedia/Photos/galaxies/\";\r\n\t\tvar firstphoto = new Array(\"800px-Spiral_galaxy_arms_diagram.png\",\"Image by Dbenbenn\", \"http://en.wikipedia.org/wiki/File:Spiral_galaxy_arms_diagram.png\",\"Spiral galaxy arms diagram\",\"Creative Commons Attribution 3.0 Unported (CC BY 3.0)\");\r\n\t\tvar secondphoto = new Array(\"andromeda-galaxy.jpg\",\"Photo by Adam Evans, 2010\",\"http://www.shmoop.com/perseus-andromeda/photo-andromeda-galaxy.html\",\"Andromeda, the Galaxy\", \"Creative Commons Attribution 3.0 Unported (CC BY 3.0)\");\r\n\t\timageArray[0] = firstphoto;\r\n\t\timageArray[1] = secondphoto;\r\n\t} else if(loadAlbum==\"neutronstars\"){\r\n\t\tpath = \"../../MaavisMedia/Photos/neutronstars/\";\r\n\t\tvar firstphoto = new Array(\"star.png\",\"Image: Corvin Zahn, Institute of Physics, Universitšt Hildesheim\",\"Space Time Travel (http://www.spacetimetravel.org/)\",\"Light deflection near a neutron star\", \"Creative Commons License Attribution-Share Alike 2.0 Germany (abbreviated 'cc-by-sa/2.0/de')\");\r\n\t\tvar secondphoto = new Array(\"neutronstar.png\",\"Image: Corvin Zahn, Institute of Physics, Universitšt Hildesheim\",\"Space Time Travel (http://www.spacetimetravel.org/)\",\"Light deflection near a neutron star\", \"Creative Commons License Attribution-Share Alike 2.0 Germany (abbreviated 'cc-by-sa/2.0/de')\");\r\n\t\timageArray[0] = firstphoto;\r\n\t\timageArray[1] = secondphoto;\r\n\t} else if (loadAlbum==\"timetravel\"){\r\n\t\tpath = \"../../MaavisMedia/Photos/timetravel/\";\r\n\t\t//imageArray = new Array(\"wurmloch.png\", \"dice.png\",\"blackhole.jpg\",\"speedlight.png\",\"wheels.png\");\r\n\t\tvar firstphoto = new Array(\"wurmloch.png\",\"Image: Corvin Zahn, Institute of Physics, Universitšt Hildesheim\", \"Space Time Travel (http://www.spacetimetravel.org/)\",\"Wormhole\",\"Creative Commons License Attribution-Share Alike 2.0 Germany (abbreviated 'cc-by-sa/2.0/de')\" );\r\n\t\tvar secondphoto = new Array(\"dice.png\",\"Image: Ute Kraus, Institute of Physics, Universitšt Hildesheim\",\"Space Time Travel (http://www.spacetimetravel.org/)\", \"Cubes moving at 90% of the speed of light\", \"Creative Commons License Attribution-Share Alike 2.0 Germany (abbreviated 'cc-by-sa/2.0/de')\");\r\n\t\tvar thirdphoto = new Array(\"blackhole.jpg\",\"Image: Ute Kraus, Institute of Physics, Universitšt Hildesheim\", \"Space Time Travel (http://www.spacetimetravel.org/)\",\"Black Hole in front of the Milky Way\", \"Creative Commons License Attribution-Share Alike 2.0 Germany (abbreviated 'cc-by-sa/2.0/de')\");\r\n\t\tvar fourthphoto = new Array(\"speedlight.png\",\"Image: Ute Kraus, Institute of Physics, Universitšt Hildesheim\", \"Space Time Travel (http://www.spacetimetravel.org/)\",\"Moving at 90% of the speed of light\", \"Creative Commons License Attribution-Share Alike 2.0 Germany (abbreviated 'cc-by-sa/2.0/de')\");\t\t\r\n\t\tvar fifthphoto = new Array(\"wheels.png\",\"Image: Corvin Zahn, Institute of Physics, Universitšt Hildesheim\", \"Space Time Travel (http://www.spacetimetravel.org/)\",\"Rolling Wheels\", \"Creative Commons License Attribution-Share Alike 2.0 Germany (abbreviated 'cc-by-sa/2.0/de')\");\t\t\r\n\t\timageArray[0] = firstphoto;\r\n\t\timageArray[1] = secondphoto;\r\n\t\timageArray[2] = thirdphoto;\r\n\t\timageArray[3] = fourthphoto;\r\n\t\timageArray[4] = fifthphoto;\r\n\t}\r\n\trunSlideshow();\r\n}", "allTracks(){\n return this.collecTracks(this.collectAlbums());\n }", "listAll(cb){\n var q = \"SELECT * FROM `\" + conf.structureBucket + \"`\";\n this.bucket.query(N1qlQuery.fromString(q), (err, rows) => {\n cb(err, rows.map((x) => x[conf.structureBucket]));\n });\n }", "componentDidMount () {\n AlbumActionCreators.getAlbumList('')\n AlbumStore.addChangeListener(this.onAlbumChange)\n }", "function zoto_widget_featured_albums(options) {\n\toptions = merge({\n\t\t'can_edit': true},\n\t\toptions || {}\n\t);\n\tthis.$uber(options);\n\tthis.type = 'zoto_widget_featured_albums';\n\tthis.set_title(\"featured albums\");\n\tthis.media = [];\n}", "renderAlbums() {\n\t\t//map over list of albums. this is a loop of sorts\n\t\treturn this.state.albums.map(album =>\n\t\t\t\t//'key' property is used by react to check which item it is updating at a given time.\n\t\t\t\t//we are displaying the title of each album displayed\n\t\t\t\t//we use the child component AlbumDetail\n\t\t\t\t<AlbumDetail key={album.title} album={album} />\n\t\t);\n\t}", "function formatAlbums (albumSet) {\n\n\t\tvar albums = [];\n\n\t\tfor (var album in albumSet) {\n\n\t\t\tvar songs = sortSongs(albumSet[album]);\n\n\t\t\talbums.push({ name: album, songs: songs });\n\n\t\t}\n\n\t\treturn albums;\n\n\t}", "function renderAlbum(album) {\n console.log('rendering album:', album);\n\n}", "list() {\n\t\tconst query = objectToQuery({ prefix: this.objectPath, delimiter: '/' });\n\t\treturn this.fetch(`${baseApiURL}b/${this.bucket}/o${query}`);\n\t}", "function ImagesList(_alert,_titleLine, _listcontainer, _listcontainerbody) {\n\n\t\t//reference to alert element\n\t\tthis.alert = _alert;\n\n\t\tthis.titleLine = _titleLine;\n\n\t\t//reference to albums container header\n\t\tthis.listcontainer = _listcontainer;\n\n\t\t//reference to albums container body\n\t\tthis.listcontainerbody = _listcontainerbody;\n\n\t\t//clears the html element content and hides it\n\t\tthis.reset = function() {\n\t\t\tthis.listcontainer.style.visibility = \"hidden\";\n\t\t\tthis.listcontainerbody.innerHTML=\"\";\n\t\t\tdocument.getElementById(\"next\").style.visibility=\"hidden\";\n\t\t\tdocument.getElementById(\"previous\").style.visibility=\"hidden\";\n\t\t};\n\n\t\t//loaded album data\n\t\tthis.currentAlbumImages = null;\n\t\tthis.currentNumOfPages = null;\n\t\tthis.currentAlbumTitle = \"albumTitle\";\n\t\tthis.currentPage = 1;\n\t\tthis.imagesPerPage = 5; //images per page\n\n\t\t//call server for album images and show them in the page\n\t\tthis.show = function(albumId) {\n\t\t\tvar self = this;\n\n\t\t\t//download album images\n\t\t\tmakeSearchCall(\"GET\", \"Album?albumId=\"+albumId,\n\t\t\t\tfunction(req) {\n\t\t\t\t\tif (req.readyState == XMLHttpRequest.DONE) {\n\t\t\t\t\t\tvar message = req.responseText;\n\t\t\t\t\t\tswitch (req.status) {\n\t\t\t\t\t\t\tcase 200:\n\t\t\t\t\t\t\t\tvar albumImages = JSON.parse(message);\n\t\t\t\t\t\t\t\tif (albumImages.length == 0) {\n\t\t\t\t\t\t\t\t\tself.alert.textContent = \"No images yet!\";\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tself.currentAlbumTitle = albumImages.title;\n\t\t\t\t\t\t\t\tself.update(albumImages.images, 1); // self visible by closure\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 400: // bad request\n\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB Error code 400: \" + message;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 401: // unauthorized\n\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB Error code 401: \" + message;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 500: // server error\n\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB Error code 500: \" + message;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t);\n\t\t};\n\n\t\t//registering navigation buttons events\n\t\tthis.setPaginationButtons = function () {\n\t\t\tconsole.log(\"Current page: \" + this.currentPage);\n\n\t\t\tvar previousButton = document.getElementById(\"previous\");\n\t\t\tvar nextButton = document.getElementById(\"next\");\n\t\t\tpreviousButton.addEventListener(\"click\", (e) => {\n\t\t\t\tif(this.currentPage>1) {\n\t\t\t\t\tvar previousPage = this.currentPage-1;\n\t\t\t\t\tconsole.log(\"Go to previous page \" + previousPage +\" from page \"+ this.currentPage);\n\t\t\t\t\tthis.update(this.currentAlbumImages,previousPage); //go to previous page\n\t\t\t\t}\n\t\t\t}, false);\n\t\t\tnextButton.addEventListener(\"click\", (e) => {\n\t\t\t\tif(this.currentPage<this.currentNumOfPages) {\n\t\t\t\t\tvar nextPage = this.currentPage + 1;\n\t\t\t\t\tconsole.log(\"Go to next page \" + nextPage + \" from page \" + this.currentPage);\n\t\t\t\t\tthis.update(this.currentAlbumImages, nextPage); //go to next page\n\t\t\t\t}\n\t\t\t}, false);\n\t\t};\n\n\t\t//update the page content about albums\n\t\tthis.update = function(arrayImages, page) {\n\n\t\t\t//rename this to make it visible in inner functions\n\t\t\tvar self = this;\n\n\t\t\t//store current album data\n\t\t\tthis.currentAlbumImages = arrayImages; //store array of images\n\t\t\tthis.currentPage = page;\n\t\t\tthis.currentNumOfPages = Math.ceil(self.currentAlbumImages.length/this.imagesPerPage);\n\n\t\t\t//html elements for showing the images\n\t\t\tvar card, imgPreview, cardBody, imgName, col;\n\n\t\t\tthis.listcontainerbody.innerHTML = \"\"; // empty image list body\n\n\t\t\t//show album title line\n\t\t\tthis.titleLine.show(this.currentAlbumTitle);\n\n\t\t\t//arrayImages offsets\n\t\t\tvar startImageOffset = (page-1)*this.imagesPerPage;\n\t\t\tvar endImageOffset = startImageOffset + 5;\n\n\t\t\t//showing 5 page images\n\t\t\tarrayImages.slice(startImageOffset,endImageOffset).forEach(function(image) { // self visible here, not this\n\t\t\t\tcol = document.createElement(\"div\");\n\t\t\t\tcol.setAttribute(\"class\",\"col-md-5ths col-xs-6\");\n\t\t\t\tcard = document.createElement(\"div\");\n\t\t\t\tcard.setAttribute(\"class\",\"card mb-4 shadow-sm\");\n\t\t\t\timgPreview = document.createElement(\"img\");\n\t\t\t\timgPreview.setAttribute(\"class\",\"card-img-top thumbnailsec\");\n\t\t\t\timgPreview.setAttribute(\"src\",getContextPath() + image.path);\n\t\t\t\timgPreview.setAttribute(\"data-toggle\", \"modal\");\n\t\t\t\timgPreview.setAttribute(\"data-target\", \"modalImageContainer\");\n\t\t\t\tcardBody = document.createElement(\"div\");\n\t\t\t\tcardBody.setAttribute(\"class\",\"card-body\");\n\t\t\t\timgName = document.createElement(\"p\");\n\t\t\t\timgName.textContent = image.title;\n\t\t\t\tcol.appendChild(card);\n\t\t\t\tcard.appendChild(imgPreview);\n\t\t\t\tcard.appendChild(cardBody);\n\t\t\t\tcardBody.appendChild(imgName);\n\t\t\t\tcard.setAttribute('imageId', image.id); // set a custom HTML attribute\n\t\t\t\timgPreview.addEventListener(\"mouseover\", (e) => {\n\t\t\t\t\t// dependency via module parameter\n\t\t\t\t\timageDetails.update(image, image.comments); // the list must know the details container\n\t\t\t\t}, false);\n\t\t\t\tself.listcontainerbody.appendChild(col);\n\t\t\t});\n\t\t\tthis.listcontainer.style.visibility = \"visible\";\n\t\t\tconsole.log(this.listcontainer);\n\n\t\t\t//hide/show buttons\n\t\t\tvar previousButton = document.getElementById(\"previous\");\n\t\t\tvar nextButton = document.getElementById(\"next\");\n\t\t\tvar numOfPages = Math.ceil(self.currentAlbumImages.length/this.imagesPerPage);\n\t\t\tif(page<=1) previousButton.style.visibility = \"hidden\";\n\t\t\telse previousButton.style.visibility = \"visible\";\n\t\t\tif(page>=numOfPages) nextButton.style.visibility = \"hidden\";\n\t\t\telse nextButton.style.visibility = \"visible\";\n\t\t};\n\n\t}" ]
[ "0.8024313", "0.7243369", "0.6794385", "0.6745076", "0.6455987", "0.64443034", "0.6256037", "0.6229391", "0.61871964", "0.61222136", "0.6019089", "0.60035217", "0.596359", "0.5958814", "0.59500635", "0.5905532", "0.58850634", "0.58154565", "0.5808184", "0.5793066", "0.57891095", "0.57780963", "0.5765867", "0.5751504", "0.57171065", "0.57107854", "0.5708997", "0.570674", "0.56837773", "0.566848", "0.5664178", "0.56302863", "0.56281585", "0.5606923", "0.5606923", "0.55976516", "0.5596474", "0.5595552", "0.55423963", "0.55339473", "0.55339473", "0.5526649", "0.5522457", "0.5514026", "0.5498607", "0.5494871", "0.549474", "0.5488793", "0.5480989", "0.54455096", "0.5437588", "0.5428332", "0.5427487", "0.5422428", "0.54162675", "0.5413947", "0.5412448", "0.54096395", "0.54009527", "0.5386226", "0.5378153", "0.53648514", "0.5358352", "0.5348354", "0.5319698", "0.53196615", "0.5317644", "0.528303", "0.52754873", "0.52651346", "0.52650654", "0.52613074", "0.5261052", "0.52543896", "0.5252756", "0.5251017", "0.5248393", "0.5243303", "0.5236473", "0.5232367", "0.52119446", "0.5205994", "0.5203827", "0.51877445", "0.51872605", "0.51852775", "0.5183908", "0.51809245", "0.5168951", "0.5161696", "0.5159365", "0.5154448", "0.5150707", "0.5142306", "0.51368743", "0.5128542", "0.5119571", "0.51134694", "0.51119053", "0.5104107" ]
0.8272134
0
snippetend:[s3.JavaScript.s3_PhotoViewer.listAlbums] snippetstart:[s3.JavaScript.s3_PhotoViewer.viewAlbum] Show the photos that exist in an album.
function viewAlbum(albumName) { var albumPhotosKey = encodeURIComponent(albumName) + '/'; s3.listObjects({Prefix: albumPhotosKey}, function(err, data) { if (err) { return alert('There was an error viewing your album: ' + err.message); } // 'this' references the AWS.Request instance that represents the response var href = this.request.httpRequest.endpoint.href; var bucketUrl = href + albumBucketName + '/'; var photos = data.Contents.map(function(photo) { var photoKey = photo.Key; var photoUrl = bucketUrl + encodeURIComponent(photoKey); return getHtml([ '<span>', '<div>', '<br/>', '<img style="width:128px;height:128px;" src="' + photoUrl + '"/>', '</div>', '<div>', '<span>', photoKey.replace(albumPhotosKey, ''), '</span>', '</div>', '</span>', ]); }); var message = photos.length ? '<p>The following photos are present.</p>' : '<p>There are no photos in this album.</p>'; var htmlTemplate = [ '<div>', '<button onclick="listAlbums()">', 'Back To Albums', '</button>', '</div>', '<h2>', 'Album: ' + albumName, '</h2>', message, '<div>', getHtml(photos), '</div>', '<h2>', 'End of Album: ' + albumName, '</h2>', '<div>', '<button onclick="listAlbums()">', 'Back To Albums', '</button>', '</div>', ] document.getElementById('viewer').innerHTML = getHtml(htmlTemplate); document.getElementsByTagName('img')[0].setAttribute('style', 'display:none;'); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listAlbums() {\r\n s3.listObjects({Delimiter: '/'}, function(err, data) {\r\n if (err) {\r\n return alert('There was an error listing your albums: ' + err.message);\r\n } else {\r\n var albums = data.CommonPrefixes.map(function(commonPrefix) {\r\n var prefix = commonPrefix.Prefix;\r\n var albumName = decodeURIComponent(prefix.replace('/', ''));\r\n return getHtml([\r\n '<li>',\r\n '<button style=\"margin:5px;\" onclick=\"viewAlbum(\\'' + albumName + '\\')\">',\r\n albumName,\r\n '</button>',\r\n '</li>'\r\n ]);\r\n });\r\n var message = albums.length ?\r\n getHtml([\r\n '<p>Click on an album name to view it.</p>',\r\n ]) :\r\n '<p>You do not have any albums. Please Create album.';\r\n var htmlTemplate = [\r\n '<h2>Albums</h2>',\r\n message,\r\n '<ul>',\r\n getHtml(albums),\r\n '</ul>',\r\n ]\r\n document.getElementById('viewer').innerHTML = getHtml(htmlTemplate);\r\n }\r\n });\r\n}", "function listAlbums() {\n s3.listObjects({Delimiter: '/'}, function(err, data) {\n if (err) {\n return alert('There was an error listing your albums: ' + err.message);\n } else {\n var albums = data.CommonPrefixes.map(function(commonPrefix) {\n var prefix = commonPrefix.Prefix;\n var albumName = decodeURIComponent(prefix.replace('/', ''));\n return getHtml([\n '<div class = \"btn-group\" style = \"padding: 20px\">',\n '<button class=\"btn btn-sm\" style=\"margin-top:20px; border:2px solid #000000;\" onclick=\"viewAlbum(\\'' + albumName + '\\')\">',\n albumName,\n '</button>',\n '</div>'\n ]);\n });\n var message = albums.length ?\n getHtml([\n '<p style = \"text-align: center;\">Click on an album name to view it.</p>',\n ]) :\n '<p style = \"text-align: center;\">You do not have any albums. Please Create album.';\n var htmlTemplate = [\n '<h2 style = \"text-align: center; padding: 25px\" >Albums</h2>',\n message,\n '<div style = \"margin: 0; position: absolute; left: 50%; -ms-transform: translate(-50%, 0%) ; transform: translate(-50%, 0%);\">',\n getHtml(albums),\n\n '</div>'\n ]\n document.getElementById('viewer').innerHTML = getHtml(htmlTemplate);\n }\n });\n}", "function viewAlbum(albumName) {\n var albumPhotosKey = encodeURIComponent(albumName) + '/';\n s3.listObjects({Prefix: albumPhotosKey}, function(err, data) {\n if (err) {\n return alert('There was an error viewing your album: ' + err.message);\n }\n // 'this' references the AWS.Response instance that represents the response\n var href = this.request.httpRequest.endpoint.href;\n var bucketUrl = href + albumBucketName + '/';\n\n\n //gets photo from s3\n var photos = data.Contents.map(function(photo) {\n var photoKey = photo.Key;\n var photoUrl = bucketUrl + encodeURIComponent(photoKey);\n return getHtml([\n \"<div class='col-sm-4'>\",\n\n \"<figure class='photo-frame'>\",\n \"<img src=' \" + photoUrl + \"' class='gallery'/>\",\n \"</figure>\",\n '</div>',\n ]);\n });\n\n\n //if there are photos in the album, display first message, otherwise display second message\n var message = photos.length ?\n '<p>The following photos are present.</p>' :\n '<p>There are no photos in this album.</p>';\n\n //template for how website is going to be formated\n\n var htmlTemplate = [\n//button to go back\n\n\n //photo\n '<div class= \"col-lg-12\">',\n '<div class=\"gallery-backdrop\">',\n '<div id = \"gallery\" class=\"case photo-gallery\">',\n getHtml(photos),\n '</div>',\n '</div>',\n '</div>',\n\n //end of album and button to go back to list of albums\n\n '<div class = \"col-sm-5\" style= \"margin: auto; padding-bottom: 10px; width: 60%; transform: translate(-50%, -50%); \">',\n '<button type=\"button\" onclick=\"listAlbums()\" class=\"btn btn-sm\" style=\"margin-top:20px; border:2px solid #000000;\">',\n 'Back To Albums',\n '</button>',\n '</div>',\n ]\n document.getElementById('viewer').innerHTML = getHtml(htmlTemplate);\n document.getElementsByTagName('div')[6].setAttribute('style', 'display:none !important;');\n });\n}", "async getAlbums(){\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/albums?excludeNonAppCreatedData=true',\n method: 'GET',\n headers: {\n 'Authorization': 'Bearer '+ token.accessToken,\n 'Content-type': 'application/json'\n },\n }\n response = await this.APIHandler.sendRequest(data);\n return response\n }", "function getPicasaAlbums() {\n var data = UrlFetchApp.fetch(URL, googleOAuth_()).getContentText();\n var xmlOutput = Xml.parse(data, false);\n var albums = xmlOutput.getElement().getElements('entry');\n var info = [];\n var app = UiApp.createApplication().setTitle('Picasa');\n var panel = app.createVerticalPanel();\n var listBox = app.createListBox().setName('albumListBox').addItem('select');\n var handler = app.createServerHandler('showImagesEventHandler').addCallbackElement(listBox);\n listBox.addChangeHandler(handler);\n for (var i = 0; i < albums.length; i++) {\n if (albums[i].getElement('rights').getText() == \"public\") {\n var title = albums[i].getElement('title').getText();\n var id = albums[i].getElement('http://schemas.google.com/photos/2007', 'id').getText();\n info.push([ title, id ]);\n listBox.addItem(title);\n }\n }\n // use a script property to save the links to each album for later use\n ScriptProperties.setProperty('info', Utilities.jsonStringify(info));\n var scrollPanel = app.createScrollPanel().setWidth('500').setHeight('300');\n scrollPanel.setAlwaysShowScrollBars(true);\n scrollPanel.add(app.createVerticalPanel().setId('panelForImages'));\n app.add(panel.add(listBox).add(scrollPanel));\n // SpreadsheetApp.getActiveSpreadsheet().show(app);\n return app;\n}", "function showImagesEventHandler(e) {\n var app = UiApp.getActiveApplication();\n var panel = app.getElementById('panelForImages').clear();\n var info = Utilities.jsonParse(ScriptProperties.getProperty('info'));\n for (i in info) {\n if (info[i][0] == e.parameter.albumListBox) {\n var data = UrlFetchApp.fetch(URL + '/albumid/' + info[i][1], googleOAuth_()).getContentText();\n var xmlOutput = Xml.parse(data, false);\n var photos = xmlOutput.getElement().getElements('entry');\n for (j in photos) {\n panel.add(app.createImage(photos[j].getElement('content').getAttribute('src').getValue()));\n }\n }\n }\n return app;\n}", "function showAlbumsResult(r) \n{\n if (!r.success) {\n\t\t\tif (r.error) {\n\t\t\t\tTi.UI.createAlertDialog({title:L('error'),message:r.error}).show();\n\t\t\t} else {\n\t\t\t\tTi.UI.createAlertDialog({title:L('error'),message:L('uns')}).show();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t//Convert the result to json\n\t\talbumsJSON = JSON.parse(r.result).data;\n\t\tvar albums=[];\n\t\t\n\t\tfor(var j = 0; j < albumsJSON.length; j++) \n\t\t{\n\t\t\t//Check if there is images in this album\n\t\t\tif(!albumsJSON[j].hasOwnProperty('count'))\n\t\t\t{\n\t\t\t\talbumsJSON.splice(j, 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\talbums.push(new Album(\n\t\t\t\t\talbumsJSON[j].name,\n\t\t\t\t\talbumsJSON[j].count,\n\t\t\t\t\t\"https://graph.facebook.com/\"+albumsJSON[j].cover_photo+\"/picture\",\n\t\t\t\t\talbumsJSON[j].id));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Return the resuls\n\t\tlistener(albums);\n}", "function getEventAlbums(eventId) {\n if (isUndefined(eventId)) {\n throw new Error('The eventId is required to check if a photo exists.');\n }\n return makeApiRequest({\n method: 'sp.album.get_list',\n event_id: eventId,\n });\n}", "getAlbums() {\n let results = [];\n\n if (!this.currentArtistName) {\n for (let i=0; i < this.albums.length; ++i) {\n results.push(this.albums[i].title);\n }\n\n return results;\n }\n else {\n let artistId = this._getArtistId();\n\n for (let i = 0; i < this.albums.length; ++i) {\n if (this.albums[i].artistId === artistId) {\n results.push(this.albums[i].title);\n }\n }\n }\n\n return results;\n }", "function showAlbums() {\n\turl = \"showAlbums.php\";\n\tdoAjaxCall(url, \"updateMain\", \"GET\", true);\n}", "function getAlbumPhotos(albumId, page = 1) {\n if (isUndefined(albumId)) {\n throw new Error('The eventId is required to check if a photo exists.');\n }\n return makeApiRequest({\n method: 'sp.album.get_photos',\n album_id: albumId,\n page,\n });\n}", "function Album(){\n\tvar photos = [];\n\tvar locations = [];\n\tthis.addPhoto = function(photo){\n\t\tphotos.push(photo);\n\t}\n\tthis.addLocation = function(location){\n\t\tlocations.push(location);\n\t}\n\tthis.listPhotos = function() {\n\t\treturn photos.toString();\n\t}\n\tthis.listLocations = function() {\n\t\treturn locations.toString();\n\t}\n\tthis.getPhoto=function(index){\n\t\treturn [photos[index],locations[index]];\n\t}\n\tthis.hasPhoto = function(photo) {\n\t\treturn photos.includes(photo);\n\t}\n}", "function renderAlbum(album) {\n const photos = album.photos;\n let template = `\n<div class=\"album-card\">\n <header>\n <h3>${photos.title}, by Bret </h3>\n </header>\n <section class=\"photo-list\">\n </section>\n</div>\n `\n photos.forEach(photo => {\n $('.photo-list').append(renderPhoto(photo));\n })\n return template;\n}", "async getSharedAlbums(){\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/sharedAlbums?excludeNonAppCreatedData=true',\n method: 'GET',\n headers: {\n 'Authorization': 'Bearer '+ token.accessToken,\n 'Content-type': 'application/json'\n },\n }\n response = await this.APIHandler.sendRequest(data);\n return response\n }", "function showAlbum(album, albumWrapper) {\n\t//log('show', album.name);\n\tvar urls = new Array();\n\tfor(var i=0; i<album.photos.length; i++) {\n\t\turls.push(album.photos[i].url);\n\t}\n\t\n\thideAlbum(); //hide the open album (if exists)\n\t\n\tvar gallery = $('#albumGallery');\n\talbumModule.gallery = new Gallery(gallery, urls,350,1);\n\tvar node = $(albumWrapper).parent();\n\t\n\t//remember the position of the album thumbnail\n\talbumModule.selectedAlbum = node;\n\talbumModule.positionOfAlbum = getSizeAndPosition(node);\n\t$('#galleryTitle').html(album.name);\n\t\n\t//move thumbnail and show gallery\n\tnode.animate({\n\t\ttop: '170px',\n\t\tleft: '130px',\n\t\twidth:'580px',\n\t\theight: '460px'\n\t}, 500, 'linear', function() {\n\t\t$(this).hide();\n\t});\n\tgallery.delay(300).fadeIn(200);\n}", "function getAlbums(event){\n event.preventDefault();\n var id = $(event.currentTarget).parent().attr(\"data-value\");\n show_albums(id);\n }", "function getAlbums(res){\n res.forEach(function(album){\n renderAlbum(album);\n })\n}", "_FB_getAlbumPhotos(album) {\n const _this = this;\n\n _this._FB_API(\"/\" + album.id + \"/photos\", {fields: 'id', limit: 999999}, (response) => {\n if(!response || response.error) {\n _this.props.onError(ERROR.NO_PHOTOS);\n _this.set_errorMessage(MSFBPhotoSelector.TEXTS.could_not_load_album_photos, 'https://facebook.com/' + album.id);\n }\n else {\n const index = _this.state.FB_albums.indexOf(album);\n var FB_albums = _this.state.FB_albums.slice(0);\n\n FB_albums[index].photos = response.data.map((photo) => ({id: photo.id}));\n _this.setState({FB_albums});\n }\n });\n }", "function loadFullAlbum() {\r\n\ttry {\r\n\t\tif (m = $('.summary')[0].textContent.split('|')[0].match(/(\\d+)/g)) {\r\n\t\t\tm = m.sort(function(a,b){return a-b});\r\n\t\t\ttotalImagePages = Math.ceil(m[2]/20);\r\n\t\t\tif (n=page.match(/page=(\\d)/)) { thisPageNumber=n[1]; } else { thisPageNumber=1; }\r\n\t\t\talbumPagesLoaded = 0;\r\n\t\t\ttotalAlbumPages = totalImagePages-1;\r\n\t\t\t$('#fbf_photo_pagination').innerHTML = '<span class=\"caption\">' + $l('loadingFullAlbum') + '<span></span></span>';\r\n\t\t\tfor (var i=1; i<totalImagePages+1; i++) {\r\n\t\t\t\tif (i!=thisPageNumber) {\r\n\t\t\t\t\tappendPhotos('http://www.facebook.com/' + (page.indexOf('page=')!=-1 ? page.replace(/page=\\d+/,'page='+i) : page+'&page='+i) + '&quickling', $l('fullAlbumLoaded'));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} catch(x) { logError('Load Full Album', x); }\r\n}", "function loadFullAlbum() {\r\n\ttry {\r\n\t\tif (m = $('.summary')[0].textContent.split('|')[0].match(/(\\d+)/g)) {\r\n\t\t\tm = m.sort(function(a,b){return a-b});\r\n\t\t\ttotalImagePages = Math.ceil(m[2]/20);\r\n\t\t\tif (n=page.match(/page=(\\d)/)) { thisPageNumber=n[1]; } else { thisPageNumber=1; }\r\n\t\t\talbumPagesLoaded = 0;\r\n\t\t\ttotalAlbumPages = totalImagePages-1;\r\n\t\t\t$('#fbf_photo_pagination').innerHTML = '<span class=\"caption\">' + $l('loadingFullAlbum') + '<span></span></span>';\r\n\t\t\tfor (var i=1; i<totalImagePages+1; i++) {\r\n\t\t\t\tif (i!=thisPageNumber) {\r\n\t\t\t\t\tappendPhotos('http://www.facebook.com/' + (page.indexOf('page=')!=-1 ? page.replace(/page=\\d+/,'page='+i) : page+'&page='+i) + '&quickling', $l('fullAlbumLoaded'));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} catch(x) { logError('Load Full Album', x); }\r\n}", "function getalbums (user_id, my_album) {\n\n FB.api({\n // access_token: authresponse.accessToken,\n method: 'fql.multiquery',\n queries: {\n query1: 'SELECT aid,object_id, name,link,photo_count,cover_object_id FROM album WHERE owner=\"'+user_id+'\"',\n query2: 'SELECT src FROM photo WHERE object_id IN (SELECT cover_object_id FROM #query1)'\n }\n },\n function(response) {\n\n var cover_valid = 0;\n $(\"#image_frame\").html(\"\");\n var frame = document.createElement('div');\n frame.setAttribute(\"id\", \"image_frame\");\n frame.setAttribute(\"class\", \"cf\");\n\n document.body.appendChild(frame);\n\n var page_title = document.createElement('div');\n page_title.setAttribute(\"class\", \"page_title\");\n\n var title = document.createTextNode(\"Your Albums\");\n var div_albums = document.createElement('br');\n\n page_title.appendChild(title);\n frame.appendChild(page_title);\n frame.appendChild(div_albums);\n\n for (var i=0; i<response[0].fql_result_set.length; i++) {\n\n if(response[0].fql_result_set[i].cover_object_id != 0)\n {\n\n var album_name = document.createTextNode(response[0].fql_result_set[i].name);\n\n var album = document.createElement('a');\n album_id = response[0].fql_result_set[i].object_id;\n album.aid = response[0].fql_result_set[i].aid;\n album.album_name = response[0].fql_result_set[i].name;\n album.link = response[0].fql_result_set[i].link;\n album.count = response[0].fql_result_set[i].photo_count;\n\n album.setAttribute(\"href\", \"/home/album_photos?album_id=\"+album_id+\"&album_name=\"+album.album_name);\n\n var cover_photo = document.createElement('img');\n cover_photo.src = response[1].fql_result_set[cover_valid++].src;\n\n album.appendChild(cover_photo);\n\n var title = document.createElement('div');\n title.setAttribute(\"class\", \"title\");\n title.appendChild(album_name);\n\n var image = document.createElement('div');\n image.setAttribute(\"class\", \"image\");\n image.appendChild(album);\n image.appendChild(title);\n\n frame.appendChild(image);\n\n }\n }\n\n });\n}", "function showCollection(){\n// - Console.log the number of items in the array.\n console.log( 'Collection:', collection.length );\n//- Loop over the array and console.log each album's information formatted like: `TITLE by ARTIST, published in YEAR`.\n for (let i = 0; i < collection.length; i++) {\n const record = collection[i];\n console.log( record.title,'by ' + record.artist + ' published in ' + record.yearPublished);\n }\n}", "function showCollection( array ){\n// - Console.log the number of items in the array.\nconsole.log( 'The number of records in the collection is:', recordCollection.length );\nfor( let i = 0; i<recordCollection.length; i++ ){\n// - Loop over the array and console.log each album's information formatted like: `TITLE by ARTIST, published in YEAR`.\n console.log( recordCollection[i].title, 'by', recordCollection[i].artist, 'published in', recordCollection[i].year ); \n} //end function\n\n} //end showCollection", "function findAlbum() {\n var i;\n \n if ($(\"#endofpage\").length) {\n $(\"#endofpage\").remove();\n }\n\n var photocontainer = document.createElement(\"div\");\n $(photocontainer).attr('id', \"photocontainer\");\n \n photonumber = photos.length;\n albumnumber = albums.length;\n \n for(i = 0 ; i < 15 && albumnumber > 0; i++) {\n //var album = albums[photo.albumId - 1];\n //console.log('post ' + postnumber + user.name);\n var flag = true;\n var search;\n while(flag && (albumnumber > 0)){\n var photo = photos[photonumber-1];\n if(photo.albumId == albums[albumnumber-1].id){\n flag = false; \n }\n photonumber--;\n }\n var image = document.createElement(\"img\");\n $(image).addClass(\"img\");\n $(image).attr('src', photo.thumbnailUrl);\n $(image).attr('alt',photo.url);\n $(image).attr('id',photo.id);\n $(image).attr(\"onclick\", \"openModal();currentSlide(\"+preview+\")\");\n \n var photosmall = document.createElement(\"div\");\n $(photosmall).append(image);\n $(photosmall).addClass(\"photosmall\"); \n \n $(photocontainer).append(photosmall);\n \n var modalImg = document.createElement(\"img\");\n $(modalImg).addClass(\"modalImg\")\n $(modalImg).attr('src', photo.url);\n $(modalImg).attr('alt', photo.title);\n $(modalImg).attr('id', photo.albumId);\n \n var modalBig = document.createElement(\"div\");\n $(modalBig).addClass(\"mySlides\");\n $(modalBig).append(modalImg);\n $(\".modal-content\").append(modalBig);\n \n var captions = document.createElement(\"div\");\n $(captions).addClass(\"captions\");\n $(captions).append(\"<p>\"+ photo.title +\"</p>\");\n var link1 = $(\"<a>\");\n $(link1).attr(\"href\", \"photos.html?album=\" + photos.albumId); //link to album\n $(link1).text(\"From: \" + albums[albumnumber-1].title);\n var link2 = $(\"<a>\");\n $(link2).attr(\"href\", \"profiles.html?user=\" + users[parseInt(albums[albumnumber-1].userId) - 1].id);\n $(link2).text(\"By: \" + users[parseInt(albums[albumnumber-1].userId) - 1].username);\n $(captions).append(link1);\n $(captions).append(\" \");\n $(captions).append(link2);\n $(\".caption-container\").append(captions);\n \n photonumber = photos.length;\n albumnumber--;\n preview++;\n }\n \n $(\"#maincontainer\").append(photocontainer);\n \n if(albums.length == 0) {\n var nores = document.createElement(\"div\");\n $(nores).text('No search results');\n $(nores).attr(\"id\", \"noresults\");\n\n $(\"#maincontainer\").append(end);\n }\n\n if(albumnumber > 0) {\n var end = document.createElement(\"div\");\n var loadbtn = document.createElement(\"button\");\n\n $(end).attr(\"id\", \"endofpage\");\n $(loadbtn).attr(\"id\", \"loadbtn\");\n\n $(end).append(loadbtn);\n $(\"#maincontainer\").append(end);\n\n $('#loadbtn').click(function(){\n findAlbum();\n });\n } else {\n var end = document.createElement(\"div\");\n $(end).css({\n 'background-image': 'url(end.png)'\n });\n $(end).attr(\"id\", \"endofpage\");\n\n $(\"#maincontainer\").append(end);\n }\n \n}", "function zoto_album_view(options){\n\toptions = options || {};\n\toptions.el_class = 'album_view';\n\toptions.max_items = options.max_items || 60;\n\toptions.small_item_class = options.small_item_class || zoto_album_view_item;\n\toptions.empty_data_set_str = 'There were no albums found.';\n\tthis.$uber(options);\n}", "function searchAlbum() {\n var usersAlbum = $(albumSearch).val();\n\n $.ajax({\n url: 'https://api.spotify.com/v1/search',\n data: {\n q: usersAlbum,\n type: 'album'\n },\n success: function(data) {\n console.log('success', data);\n for(fourthCounter in data.albums.items) {\n var album = data.albums.items[fourthCounter]\n $('.results').append('<div class=\"result-background\"><div class=\"result-content\">' +\n '<img src=\"' + album.images[0].url + '\" onload=\"this.width/=2;this.onload=null;\"><span>' +\n album.name + '</span></div></div>');\n }\n },\n error: function(data) {\n console.log('error', data)\n }\n });\n }", "displayAlbums() {\n const { albums } = this.state;\n\n if (!albums) {\n return;\n }\n\n return albums.map(album => (\n <AlbumContainer album={album} key={album.album_id} />\n ));\n }", "getAlbumsForArtist(artistName){\n return this.getArtistByName(artistName).albums;\n }", "function getAlbumsList(username) {\n return $http.get('/api/album/' + username).then(function (data) {\n return data.data.albums;\n });\n }", "function renderAlbum(album) {\n console.log('rendering album:', album);\n\n}", "function getAlbums(id) {\n vm.modalLoading = true;\n listService.getAlbums(id).then(function(data) {\n vm.modalLoading = false;\n vm.showModal.albums = data;\n })\n }", "function showCollection(array){\n // - Console.log the number of items in the array.\n console.log(array);\n // - Loop over the array and console.log each album's information formatted like: `TITLE by ARTIST, published in YEAR`.\n for (let i = 0; i < array.length; i++){\n console.log(`${array[i].title} by: ${array[i].artist}, Published: ${array[i].yearPublished}`);\n\n } // end of foor loop\n } // end of of showCollection", "function goToAlbum(ev) {\n var m = ev.target.src.match(/staticflickr.com.\\w*.(.+?)_/)\n if(!m) return;\n var imgid = m[1];\n window.location.href = 'https://www.flickr.com/photos/'+\n userid+'/'+imgid+'/in/album-'+albumid+'/';\n }", "function loadPhotoAlbums(uid, page, limit)\n{\n\tvar user_id = uid;\n\tvar html=\"\";\n\t$loadingImage = \"<img id = 'album_loading' src = '/\" + PROJECT_NAME + \"public/images/loading_large_purple.gif' alt = 'Wait...' />\";\n\t$(\"#album\").append($loadingImage).css('text-align','center');\n\t\n\tjQuery.ajax({\n url: \"/\" + PROJECT_NAME + \"profile/photo-albums-profile-listing\",\n type: \"POST\",\n dataType: \"json\",\n data : {\"uid\":uid, \"page\":page, \"limit\":limit},\n success: function(jsonData) {\n \t\n \t$(\"#album img#album_loading\").remove();\n \t\n \tif(jsonData['album_info'])\n \t{\n\t \tfor(i in jsonData['album_info'])\n\t \t{\n\t \t\t html+='<div class=\"whitebox\">';\n\t \t\thtml+='<a href=\"'+PROJECT_URL+PROJECT_NAME+'profile/photos/uid/'+uid+'/id/'+jsonData['album_info'][i][\"id\"]+'\">';\n\t \thtml+='<img src=\"'+jsonData['album_info'][i][\"socialise_albums_socialise_photo\"]+'\"/>';\n\t \thtml+='<div class=\"caption\">';\n\t \thtml+='<div class=\"col1-title lt\" title=\"'+jsonData['album_info'][i][\"album_name\"]+'\" >';\n\t \t\thtml+=showCroppedText( jsonData['album_info'][i][\"album_name\"], 15 ) ;\n\t \t\thtml+='</div>';\n\t \t\thtml+='<div class=\"col1-title3 rt\">';\n\t \t\thtml+=jsonData['album_info'][i][\"photo_count\"];\n\t \t\thtml+='</div>';\n\t \t\thtml+='</div>';\n\t \t\thtml+='</div>';\n\t \t\thtml+='</a>';\t \n\t \t\thtml+='</div>';\n\t \t}\n\t \t$('#detail').append(html);\n\t \t\n\t \t$(\"input#album_page\").val( parseInt( $(\"input#album_page\").val() ) + 1 );\n\t \t\n\t \tif( jsonData['is_there_more_albums'] != 0 )\n\t \t{\t\n\t \t\tloadPhotoAlbums(user_id, $(\"input#album_page\").val(), 12);\n\t \t}\n \t}\n \telse if(jsonData.login_user_no_album_msg)\n \t{\n \t\t html+='<div class=\"no-albums\">';\n \t\t html+='<img src=\"'+IMAGE_PATH+'/no-album.png\"/>';\n \t\t html+='<div class=\"no-album-text\">';\n \t\t html+='No Albums to be displayed';\n \t\t html+='</div>';\n \t\t html+='<div>';\n \t\t \n \t\t html+='<a href =\"'+PROJECT_URL+PROJECT_NAME+'profile/photo-albums\" class=\"create-album\">';\n \t\t html+= '+Create New Album';\n \t\t html+=\t'</a>';\n \t\t html+='</div>';\n \t\t html+='</div>';\n \t\t$('#detail').html( html );\n \t}\n \telse if(jsonData.not_a_login_user_no_album_msg)// if albums are not of login user and there are no albums.\n \t{\n \t\t html+='<div class=\"no-albums\">';\n \t\t html+='<img src=\"'+IMAGE_PATH+'/no-album.png\"/>';\n \t\t html+='<div class=\"no-album-text\">';\n \t\t html+=jsonData['albums_owner_name']+ \" \" +jsonData['not_a_login_user_no_album_msg'];\n \t\t html+='</div>';\n \t\t html+='</div>';\n \t\t$('#detail').html( html );\n \t}\n \telse\n \t{\n \t\t html+='<div class=\"no-albums\">';\n \t\t html+='<img src=\"'+IMAGE_PATH+'/no-album.png\"/>';\n \t\t html+='<div class=\"no-album-text\">';\n \t\t html+=jsonData['albums_owner_name']+ \" \" + \"has not shared any albums with you.\";\n \t\t html+='</div>';\n \t\t html+='</div>';\n \t\t$('#detail').html(html);\n \t}\n\t\t},\n error: function(xhr, ajaxOptions, thrownError)\n {\n \t\n\t\t}\n });\n}", "getAllAlbums(limit = 0, offset = 0) {\n\t\tvar query = `\n\t\tSELECT DISTINCT album FROM songs\n\t\t\tLEFT JOIN json USING (json_id)\n\t\t\tORDER BY date_added ASC\n\t\t`;\n\t\n\t\treturn this.cmdp(\"dbQuery\", [query])\n\t\t\t.then((albumsObjs) => {\n\t\t\t\t// Unpack \"artist\" string attribute into its own array of strings\n\t\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\t\tresolve(albumsObjs.map(function(a) {return a.album;}));\n\t\t\t\t});\n\t\t\t});\n\t}", "async function getAlbumsByPage() {\n _model.isFetchingNewPage = true;\n try {\n const albumList = await albumStore.fetchByPage(_model.nextPage);\n _model.albums = _model.albums.concat(albumList.albums);\n _model.hasNextPage = angular.isDefined(albumList.pagingState);\n _setNextPage(_model.hasNextPage, albumList.pagingState);\n $rootScope.$new().$evalAsync();\n }\n catch(error) {\n $log.warn(error);\n }\n _model.isFetchingNewPage = false;\n }", "function renderAlbums(albums) {\n var albumPanel = [];\n\n for (var i = 0; i < albums.length; i++) {\n albumPanel.push(createPanel(albums[i]));\n }\n albumContainer.append(albumPanel);\n }", "function hideAlbums(){\n $(\".album\").hide();\n}", "function zoto_list_recent_album_activity(options){\n\toptions = options || {};\n\toptions.no_results_msg = ' ';\n\tthis.zapi_str = 'sets.get_albums';\n\tthis.glob = options.glob || new zoto_glob();\n\tthis.$uber(options);\n}", "function searchAlbumCovers(id) {\n\n\n \n var queryUrl = \"https://api.spotify.com/v1/artists/\" + id + \"/albums?market=us&limit=10\"\n\n $.ajax({\n url: queryUrl,\n type: \"GET\",\n beforeSend: function (xhr) { xhr.setRequestHeader('Authorization', 'Bearer ' + _token); },\n success: function (response) {\n\n $(\".image-results\").attr(\"src\", response.items[0].images[0].url)\n $(\".image-results\").attr(\"value\", response.items[0].id)\n $(\".image-results2\").attr(\"src\", response.items[1].images[0].url)\n $(\".image-results2\").attr(\"value\", response.items[1].id)\n\n $(\".image-results3\").attr(\"src\", response.items[2].images[0].url)\n $(\".image-results3\").attr(\"value\", response.items[2].id)\n\n $(\".image-results4\").attr(\"src\", response.items[3].images[0].url)\n $(\".image-results4\").attr(\"value\", response.items[3].id)\n\n $(\".image-results5\").attr(\"src\", response.items[4].images[0].url)\n $(\".image-results5\").attr(\"value\", response.items[4].id)\n\n $(\".image-results6\").attr(\"src\", response.items[6].images[0].url)\n $(\".image-results6\").attr(\"value\", response.items[6].id)\n\n\n $(\".album-name\").text(response.items[0].name)\n $(\".album-name2\").text(response.items[1].name)\n $(\".album-name3\").text(response.items[2].name)\n $(\".album-name4\").text(response.items[3].name)\n $(\".album-name5\").text(response.items[4].name)\n $(\".album-name6\").text(response.items[5].name)\n $(\".album-name7\").text(response.items[6].name)\n\n $(\".more-albums\").attr(\"src\", response.items[i].images[0].url)\n $(\".more-albums:nth-child(2)\").attr(\"src\", response.items[1].images[0].url)\n $(\".more-albums:nth-child(3)\").attr(\"src\", response.items[2].images[0].url)\n $(\".more-albums:nth-child(4)\").attr(\"src\", response.items[3].images[0].url)\n $(\".more-albums:nth-child(5)\").attr(\"src\", response.items[4].images[0].url)\n $(\".more-albums:nth-child(6)\").attr(\"src\", response.items[5].images[0].url)\n\n\n console.log(response.items[0].images[0].url)\n console.log(response)\n }\n});\n\n\n}", "function zoto_list_album_sets(options){\n\toptions = options || {};\n\toptions.no_results_msg = ' ';\n\toptions.expand = true;\n\n\tthis.zapi_str = 'sets.get_list';\n\tthis.total_sets = 0;\n\t\n\tthis.str_return = _('back to albums');\n\tthis.glob = options.glob || new zoto_glob();\n\n\tthis.$uber(options);\n\tthis.build_list_header();\n}", "function clickOnAlbum(album_id) {\n\t\tvm.getAlbum(album_id);\n\t}", "function AlbumsList(_alert, _listcontainer, _listcontainerbody, _extContainer) {\n\n\t\t//reference to alert element\n\t\tthis.alert = _alert;\n\n\t\t//reference to albums container header\n\t\tthis.listcontainer = _listcontainer;\n\n\t\t//reference to albums container body\n\t\tthis.listcontainerbody = _listcontainerbody;\n\n\t\t//reference to external container (used to collapse album area)\n\t\tthis.externalContainer = _extContainer;\n\n\t\t//clears the html element content and hides it\n\t\tthis.reset = function() {\n\t\t\tthis.listcontainer.style.visibility = \"hidden\";\n\t\t\tthis.listcontainerbody.innerHTML=\"\";\n\t\t\tthis.externalContainer.removeChild(this.listcontainer);\n\t\t};\n\n\t\t//call server for albums data and show them in the page\n\t\tthis.show = function() {\n\t\t\tvar self = this;\n\t\t\tmakeSearchCall(\"GET\", \"Home\",\n\t\t\t\tfunction(req) {\n\t\t\t\t\tif (req.readyState == XMLHttpRequest.DONE) {\n\t\t\t\t\t\tvar message = req.responseText;\n\t\t\t\t\t\tswitch (req.status) {\n\t\t\t\t\t\t\tcase 200:\n\t\t\t\t\t\t\t\tconsole.log(\"Response = \" + message);\n\t\t\t\t\t\t\t\tvar albumsToShow = JSON.parse(req.responseText);\n\t\t\t\t\t\t\t\tif (albumsToShow.length == 0) {self.alert.textContent = \"\\u00BB No albums found!\"; return;}\n\t\t\t\t\t\t\t\tself.update(albumsToShow); // self visible by closure\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 400: // bad request\n\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB Error code 400: \" + message;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 401: // unauthorized\n\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB Error code 401: \" + message;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 500: // server error\n\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB Error code 500: \" + message;\n\t\t\t\t\t\t\t\tbreak;\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\n\t\t//update the page content about albums\n\t\tthis.update = function(arrayAlbums) {\n\t\t\tvar li, card, cardBody, imgLink, firstImage, title;\n\t\t\tthis.listcontainerbody.innerHTML = \"\"; // empty the card body\n\n\t\t\t//expand albums area by re-appending the html child elem\n\t\t\tthis.externalContainer.appendChild(this.listcontainer);\n\n\t\t\t// build updated list\n\n\t\t\t// \"self\" visible here instead of \"this\" (this is a trick to make \"this\" visible in nested functions)\n\t\t\tvar self = this;\n\n\t\t\tarrayAlbums.forEach(function(album) {\n\t\t\t\tcard = document.createElement(\"div\");\n\t\t\t\tcard.setAttribute(\"sortable\", \"true\");\n\t\t\t\tcard.setAttribute(\"albumId\", album.id);\n\t\t\t\tcard.setAttribute(\"class\", \"card mb-4 mx-auto d-block shadow-sm w-50\");\n\t\t\t\tcard.setAttribute(\"id\", album.id);\n\t\t\t\tfirstImage = document.createElement(\"img\");\n\t\t\t\tfirstImage.setAttribute(\"src\", getContextPath() + album.firstImagePath);\n\t\t\t\tfirstImage.setAttribute(\"class\", \"card-img-top thumbnailsec\");\n\t\t\t\tfirstImage.setAttribute('albumId', album.id);\n\t\t\t\tcard.appendChild(firstImage);\n\t\t\t\tcardBody = document.createElement(\"div\");\n\t\t\t\tcardBody.setAttribute(\"class\", \"card-body\");\n\t\t\t\tcardBody.setAttribute(\"albumId\", album.id);\n\t\t\t\tcard.appendChild(cardBody);\n\t\t\t\ttitle = document.createElement(\"h5\");\n\t\t\t\ttitle.setAttribute(\"id\", \"albumName\");\n\t\t\t\ttitle.setAttribute(\"albumId\", album.id);\n\t\t\t\ttitle.textContent = album.title;\n\t\t\t\tcardBody.appendChild(title);\n\n\t\t\t\tcard.addEventListener(\"click\", (e) => {\n\t\t\t\t\t// image clicked\n\t\t\t\t\tself.reset();\n\t\t\t\t\timagesList.show(e.target.getAttribute(\"albumId\"), 1); // the list must know the details container\n\t\t\t\t}, false);\n\t\t\t\t//imgLink.href = \"#\";\n\t\t\t\tself.listcontainerbody.appendChild(card);\n\t\t\t});\n\n\t\t\t//make albums visible\n\t\t\tthis.listcontainer.style.visibility = \"visible\";\n\n\t\t\t//make albums sortable\n\t\t\tthis.sortableAlbums(\n\t\t\t\tthis.listcontainerbody,\n\t\t\t\tfunction (sortedAlbum) {\n\t\t\t\t\tconsole.log(\"album \" + sortedAlbum.getAttribute(\"albumId\") + \"has changed position\");\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t//enable save albums order button\n\t\t\tthis.setSaveAlbumsOrderButton();\n\t\t};\n\n\t\t//make albums sortable by drag and drop\n\t\tthis.sortableAlbums = function (rootEl, onUpdate) {\n\t\t\tvar dragEl;\n\n\t\t\tconsole.log(\"rootEl = \" + rootEl.getAttribute(\"id\"));\n\t\t\tconsole.log(Array.from(rootEl.children));\n\n\t\t\t// Set all children movable\n\t\t\tArray.from(rootEl.children).forEach(function (itemEl) {\n\t\t\t\tconsole.log(\"itemEl = \" + itemEl.getAttribute(\"id\") + \" \" + itemEl.getAttribute(\"sortable\") );\n\t\t\t\titemEl.draggable = true;\n\t\t\t});\n\n\t\t\t// Function triggered when a dragged element is over an other one\n\t\t\tfunction _onDragOver(e) {\n\n\t\t\t\t//disable default event behavior\n\t\t\t\te.preventDefault();\n\n\t\t\t\t//change cursor icon\n\t\t\t\te.dataTransfer.dropEffect = 'move';\n\n\t\t\t\tconsole.log(\"dragging: \" + dragEl.tagName);\n\n\t\t\t\t//target that triggered the event (note: it isn't the one that is being dragged)\n\t\t\t\tvar target = e.target;\n\n\t\t\t\t//choosing if the destination target is suitable to change its position in the album list\n\t\t\t\t//with the dragged element\n\t\t\t\tif( target && target !== dragEl && target.getAttribute(\"sortable\") === \"true\" ){\n\n\t\t\t\t\tvar rect = target.getBoundingClientRect(); //target card rect (used to get its size on screen)\n\t\t\t\t\tvar next = (e.clientY - rect.top)/(rect.bottom - rect.top) > .5; //true if we are up the target that triggered the event\n\n\t\t\t\t\t//thanks to \"next\" we understand where to put in the albumList the dragged album\n\t\t\t\t\trootEl.insertBefore(dragEl, next && target.nextSibling || target);\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// End of sorting\n\t\t\tfunction _onDragEnd(e){\n\n\t\t\t\t//disable default event behavior\n\t\t\t\te.preventDefault();\n\n\t\t\t\t//make dragged element look normal (no more transparent)\n\t\t\t\tdragEl.classList.remove('ghost');\n\n\t\t\t\t//remove drag and drop events listener\n\t\t\t\trootEl.removeEventListener('dragover', _onDragOver, false);\n\t\t\t\trootEl.removeEventListener('dragend', _onDragEnd, false);\n\n\t\t\t\t// Notification about the end of sorting (for debug purpose)\n\t\t\t\tonUpdate(dragEl);\n\t\t\t}\n\n\t\t\t//Drag and drop initialization\n\t\t\trootEl.addEventListener('dragstart', function (evt){\n\n\t\t\t\t//making sure to drag the right html element\n\t\t\t\tvar draggingParentOrChild = evt.target.getAttribute(\"sortable\")===\"true\";\n\n\t\t\t\t//storing in \"dragEl\" the dragged element\n\t\t\t\tdragEl = (draggingParentOrChild)?evt.target:evt.target.parentNode;\n\n\t\t\t\t//Setting the drag effect\n\t\t\t\tevt.dataTransfer.effectAllowed = 'move';\n\n\t\t\t\t//Setting data that are transferred while dropping\n\t\t\t\tevt.dataTransfer.setData('Text', dragEl.textContent);\n\n\t\t\t\t// Subscribing drag and drop events\n\t\t\t\trootEl.addEventListener('dragover', _onDragOver, false);\n\t\t\t\trootEl.addEventListener('dragend', _onDragEnd, false);\n\n\t\t\t\t//timeout with 0 wait seconds is a trick to schedule the callback\n\t\t\t\t//to be run asynchronously, after the shortest possible delay\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\tdragEl.classList.add('ghost'); //set the dragged object to be transparent\n\t\t\t\t}, 0)\n\t\t\t}, false);\n\t\t};\n\n\t\t//enable save albums order button\n\t\tthis.setSaveAlbumsOrderButton = function () {\n\n\t\t\t//retrieve button html reference\n\t\t\tdocument.getElementById(\"saveAlbumsOrder\").addEventListener(\"click\", (e) => {\n\n\t\t\t\tvar self=this;\n\t\t\t\tvar albumsIdOrder = [];\n\n\t\t\t\t//retrieve album order from html document\n\t\t\t\tArray.from(this.listcontainerbody.children).forEach(function (child) {\n\t\t\t\t\talbumsIdOrder.push(child.getAttribute(\"albumId\"));\n\t\t\t\t});\n\n\t\t\t\tconsole.log(\"Sending new albums order to server...\");\n\t\t\t\tconsole.log(albumsIdOrder);\n\n\t\t\t\t//sending new album order toi server\n\t\t\t\tmakeJsonCall(\"POST\", \"ChangeAlbumOrder\", JSON.stringify({\"newOrder\":albumsIdOrder}),\n\t\t\t\t\tfunction(req) {\n\t\t\t\t\t\tif (req.readyState == XMLHttpRequest.DONE) {\n\t\t\t\t\t\t\tvar message = req.responseText;\n\t\t\t\t\t\t\tswitch (req.status) {\n\t\t\t\t\t\t\t\tcase 200:\n\t\t\t\t\t\t\t\t\tconsole.log(\"New albums order saved successfully\");\n\n\t\t\t\t\t\t\t\t\t//log in green that the new albums order is saved\n\t\t\t\t\t\t\t\t\tself.alert.classList.remove(\"text-danger\");\n\t\t\t\t\t\t\t\t\tself.alert.classList.add(\"text-success\");\n\t\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB New albums order saved successfully\";\n\n\t\t\t\t\t\t\t\t\t//clean alert bar after 5 seconds\n\t\t\t\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB\";\n\t\t\t\t\t\t\t\t\t\tself.alert.classList.add(\"text-danger\");\n\t\t\t\t\t\t\t\t\t\tself.alert.classList.remove(\"text-success\");\n\t\t\t\t\t\t\t\t\t},5000);\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 400: // bad request\n\t\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB Error code 400: \" + message;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 401: // unauthorized\n\t\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB Error code 401: \" + message;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 500: // server error\n\t\t\t\t\t\t\t\t\tself.alert.textContent = \"\\u00BB Error code 500: \" + message;\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});\n\t\t\t\t});\n\t\t}\n\t}", "static async getAllAlbum(req, res, next) {\n try {\n const galleries = await gallery.findAll({\n attributes: ['albumId'],\n group: ['albumId'],\n })\n res.status(200).json(galleries)\n } catch (error) {\n next(error)\n }\n }", "function renderAlbumList(albumList) {\n $('#app section.active').removeClass('active');\n $('#album-list').empty();\n $('#album-list').addClass('active');\n albumList.forEach(album => {\n $('#album-list').append(renderAlbum(album));\n });\n}", "function getAlbum (pl) {\n for (var i = 0; i < pl.length; i++) {\n if (pl[i].album.name !== '') {\n return pl[i].album.name\n }\n }\n}", "function getAlbum (pl) {\n for (var i = 0; i < pl.length; i++) {\n if (pl[i].album.name !== '') {\n return pl[i].album.name\n }\n }\n}", "_FB_getUserAlbums(finishedCallback) {\n const _this = this;\n\n _this._FB_API('/me/albums', {fields: 'name,id'}, (response) => {\n if(!response || response.error) {\n _this.props.onError(ERROR.NO_ALBUMS);\n _this.set_errorMessage(MSFBPhotoSelector.TEXTS.could_not_load_albums);\n } else {\n _this.setState({\n FB_albums: response.data.map((album) => {\n var album = {\n id: album.id,\n name: album.name,\n loading: false,\n limit: MSFBPhotoSelector.ALBUM_PHOTOS_LIMIT,\n photos: []\n };\n\n _this._FB_getAlbumPhotos(album);\n\n return album;\n })\n }, finishedCallback);\n }\n }\n )\n }", "function Album(){\nthis.photos = []\n// empty array to add photos too \n\tthis.addphotos = function(photos){\n\t\t this.photo.push(photos);\n\t\t// adding photos to the empty array aka album \n\t\treturn photos \n\t}\n\n\n\tthis.list_photo =function(){\n\treturn this.photos\n\t\t// returning the list of photos\n\t}\n\n\tthis.get_photo =function(y){\n\treturn this.photos[y];\n\t\t// adding photos to the new album via the y paramters \n\t}\n\n\tfunction Photo(location,filename){\n\tthis.location = location;\n\tthis.filename = filename;\n\t}\n }", "renderAlbums() {\n\t\t//map over list of albums. this is a loop of sorts\n\t\treturn this.state.albums.map(album =>\n\t\t\t\t//'key' property is used by react to check which item it is updating at a given time.\n\t\t\t\t//we are displaying the title of each album displayed\n\t\t\t\t//we use the child component AlbumDetail\n\t\t\t\t<AlbumDetail key={album.title} album={album} />\n\t\t);\n\t}", "render() {\n if (this.props.loadedall) {\n var getd = this.props.allphoto.filter(\n (item) => item.albumId === +this.props.match.params.id\n );\n }\n\n // returning those photos that belongs to provided album id\n return (\n <div>\n <h1 style={{textAlign: \"center\"}}>ALBUM {this.props.match.params.id}</h1>\n <div className=\"photodisplay\">\n {getd.map(photo => (\n <img style={{marginBottom: \"20px\"}} src={photo.url} alt=\"\" />\n ))}\n </div>\n </div>\n );\n }", "function readAlbumsFromDb() {\n musicDb.allDocs({\n include_docs: true,\n startkey: 'album_',\n endkey: 'album_\\uffff'\n }).then(function (resultFromDb) {\n processInfoFromDb(resultFromDb)\n }).catch(function (err) {\n console.log(err)\n })\n }", "async getAlbums(artist) {\r\n const albumResponse = await fetch(`https://itunes.apple.com/lookup?id=${artist}&entity=album`);\r\n const album = await albumResponse.json();\r\n return album;\r\n }", "function gallery_controls() {\r\n\r\n\t\t$(function() {\r\n\t\t$.getJSON( \"assets/db/albums.json\", function( data ) {\r\n\t\t\tvar albums = [];\r\n\r\n\t\t\tvar album_list = [];\r\n\r\n\t\t\t$.each( data, function (key, val) {\r\n\r\n\t\t\t\tif (Number.isInteger(parseInt(key)) && val[\"is_active\"]==1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\talbums.push( \"<div class='col-sm-6 col-md-4 filtr-item' data-category='\" + parseInt(key) + \"'>\" );\r\n\t\t\t\t\talbums.push( \"<div class='mu-item-thumbonail'>\" );\r\n\t\t\t\t\talbums.push( \"<img class='img-responsive' src='assets/\" + val[\"slug\"] + \".jpg' alt='\" + val[\"title\"] + \"'>\" );\r\n\t\t\t\t\talbums.push( \"</div>\" );\r\n\t\t\t\t\talbums.push( \"<div class='mu-filter-item-content'>\" );\r\n\t\t\t\t\talbums.push( \"<h1 class='mu-filter-item-title'>\" + val[\"title\"] + \"</h2>\" );\r\n\t\t\t\t\talbums.push( \"<h4 class='mu-filter-item-title'>\" + val[\"sub_title\"] + \"</h4>\" );\r\n\t\t\t\t\talbums.push( \"<span class='mu-header-dot' style='background-color: white'></span>\" );\r\n\t\t\t\t\talbums.push( \"<h4 class='mu-filter-item-title'>Released: \" + album_date(val[\"release_date\"]) + \"</h5>\" );\r\n\t\t\t\t\talbums.push( \"<h4 class='mu-filter-item-title'>\" + val[\"tracks\"] + \" tracks (\" + format_album_time(val[\"total_length\"]) + \")</h5>\" );\r\n\t\t\t\t\talbums.push( \"<h5 class='mu-filter-item-title'>&copy; \" + val[\"label\"] + \"</h5>\" );\r\n\t\t\t\t\talbums.push( \"<a class='mu-filter-imglink' href='assets/\" + val[\"slug\"] + \".jpg' title='\" + val[\"title\"] + \"'\" + \"id='\" + key + \"'><i class='fa fa-info-circle'></i></a>\" );\r\n\t\t\t\t\talbums.push( \"<span class='list-track' id='\" + key + \"'><i class='fa fa-question-circle'></i></span>\" );\r\n\t\t\t\t\talbums.push( \"</div>\" );\r\n\t\t\t\t\talbums.push( \"</div>\" );\r\n\t\t\t\t\t\t\r\n\t\t\t\t\talbum_list[key] = key;\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\r\n\t\t\tdocument.getElementsByClassName(\"filtr-container\")[0].innerHTML = albums.join(\"\");\r\n\t\t\t\r\n\t\t\t$('.mu-filter-imglink').magnificPopup({\r\n\t\t\t\ttype: 'image',\r\n\t\t\t\tmainClass: 'mfp-fade',\r\n\t\t\t\tgallery:{\r\n\t\t\t\t enabled:true\r\n\t\t\t\t}\r\n\t\t\t });\r\n\t\t});\r\n\t});\r\n}", "showAlbums() {\n if (this.state.albums.length > 0) {\n return this.state.albums.map((album) => <Album key={album.id} details={album} artist={this.state.artist} artist_id={this.state.artist_id} token={this.state.token}/>); \n }\n }", "function fetchAlbums() {\n fetch('https://rallycoding.herokuapp.com/api/music_albums')\n .then(res => res.json())\n .then(json => console.log(json));\n}", "function processAlbumResults(resultArr) {\n if (!resultArr || (resultArr.length == 0)) {\n $('#h_albumname').text('Album not found...');\n getCover('', '#albumviewcover, #coverpopupimage', 'extralarge');\n showLoading(false);\n return;\n }\n customTracklists[resultArr.uri] = resultArr;\n \n albumTracksToTable(resultArr, ALBUM_TABLE, resultArr.uri);\n var albumname = getAlbum(resultArr);\n var artistname = getArtist(resultArr);\n $('#h_albumname').html(albumname);\n $('#h_albumartist').html(artistname);\n $('#coverpopupalbumname').html(albumname);\n $('#coverpopupartist').html(artistname);\n getCover(resultArr[0].album, '#albumviewcover, #coverpopupimage', 'extralarge');\n showLoading(false);\n}", "function getFriendsAlbums() {\n var deferred = $q.defer();\n Facebook.api('/me/friends?fields=albums.limit(5).fields(count,updated_time,name,type),name,picture', function(response) {\n if(response.data) {\n console.log(response);\n deferred.resolve(response);\n } else {\n //error handling\n }\n })\n return deferred.promise;\n }", "function getphotos(album_id, album_name) {\n\n FB.api(album_id + \"/photos?limit=400&offset=0\",function(photos){\n\n if (photos && photos.data && photos.data.length){\n\n var photo_frame = document.createElement('div');\n photo_frame.setAttribute(\"id\", \"image_frame\");\n photo_frame.setAttribute(\"class\", \"cf\");\n\n document.body.appendChild(photo_frame);\n\n var page_title = document.createElement('div');\n page_title.setAttribute(\"class\", \"page_title\");\n\n var pic_name;\n\n if(album_name == \"undefined\") {\n pic_name = \"Untitled\";\n }\n else {\n pic_name = album_name;\n }\n\n var title = document.createTextNode(\"Album: \"+pic_name);\n var div_albums = document.createElement('br');\n\n page_title.appendChild(title);\n photo_frame.appendChild(page_title);\n photo_frame.appendChild(div_albums);\n\n for (var j = 0; j < photos.data.length; j++){\n\n var photo = document.createElement('a');\n photo.id = photos.data[j].id;\n photo.name = photos.data[j].name;\n photo.from = photos.data[j].from.id;\n photo.source = photos.data[j].images[4].source;\n\n photo.setAttribute(\"href\", \"/home/user_likes?photo_id=\"+photo.id+\"&photo_name=\"+photo.name+\"&photo_from=\"+photo.from+\"&photo_source=\"+photo.source);\n\n var picture = document.createElement('img');\n picture.src = photos.data[j].picture;\n photo.appendChild(picture);\n\n\n var image = document.createElement('div');\n image.setAttribute(\"class\", \"image\");\n image.appendChild(photo);\n\n var title = document.createElement('div');\n title.setAttribute(\"class\", \"title\");\n\n if(photos.data[j].name) {\n var photo_name = document.createTextNode(photos.data[j].name);\n title.appendChild(photo_name);\n\n }\n else{\n var photo_name = document.createTextNode(\"Untitled\");\n title.appendChild(photo_name);\n }\n\n image.appendChild(title);\n photo_frame.appendChild(image);\n }\n }\n });\n}", "async albumImages({ albumHash }) {\n // if (!enable()) return null;\n\n try {\n console.log(\"[imgur] GET Album Images \" + albumHash);\n return await _apiRequest2(\"GET\", \"album/\" + albumHash + \"/images\");\n\n } catch (error) {\n console.log(`[imgur] imgur.api.album.albumImages Error ${error.statusCode}`);\n // console.json(error);\n return null;\n }\n }", "async function getExploreAlbum1() {\n let response = await fetch(\"http://wordpress.oscho.dk//wp-json/wp/v2/posts?_embed&categories=29\");\n let data = await response.json();\n appendExploreAlbum1(data);\n //showLoader(false);\n }", "function getAlbum(){\n fetch('http://jsonplaceholder.typicode.com/albums')\n .then((res) => res.json())\n .then((data) => {\n let outputAlbum = `<h2 class=\"bb-4\">Album</h2>`;\n data.forEach((album) =>{\n outputAlbum += `\n <ul class=\"list-group mb-3\">\n <li class=\"list-group-item\">Id: ${album.id}</li>\n <li class=\"list-group-item\">Title: ${album.title}</li>\n </ul>\n `;\n });\n document.getElementById('output').innerHTML = outputAlbum;\n })\n .catch((err) => console.log(err));\n}", "function fetchAlbums(){\n fetch('https://rallycoding.herokuapp.com/api/music_albums')\n .then (res=>res.json())\n .then(json=>console.log(json));\n}", "function showGallery() {\r\n var out = \"\";\r\n for (var propertyName in images) {\r\n var photo = images[propertyName];\r\n out += getPhotoTag(photo, \"result-image result-image--gallery\", \"showOriginalImage\");\r\n }\r\n document.getElementById(\"search_result\").innerHTML = out;\r\n}", "function album_details(album, songlist) {\n artistname.innerHTML = album.artistname;\n \n albumimage.forEach(e => {\n e.src = album.albumimage;\n });\n\n song_num.innerHTML = songlist[song_id].songid;\n bartitle.innerHTML = songlist[song_id].songname;\n titlename.innerHTML = songlist[song_id].songname;\n\n track.src = songlist[song_id].src;\n track.autoplay = true;\n\n}", "async function searchAlbumTracks (album) {\n const spotify = createSpotify()\n // Set comparison threshold.\n // @url https://www.npmjs.com/package/string-similarity\n const threshold = 0.75\n const compare = (a, b) =>\n similarity.compareTwoStrings(a, b) > threshold\n try {\n const query = `album:${album.album} artist:${album.artist}`\n return await spotify.searchTracks(query)\n .then(response => {\n let tracks = []\n if (response.body.tracks.items.length) {\n // Build matched album tracks from search results.\n tracks = response.body.tracks.items.filter(track => {\n // Basic artist matching algorithm.\n const matchArtist = track.artists.some(artist =>\n compare(artist.name, album.artist))\n // Basic album matching algorithm.\n const matchAlbum = compare(track.album.name, album.album)\n return matchArtist && matchAlbum\n })\n }\n return tracks\n })\n } catch (e) {\n throw e\n }\n}", "function findAlbum(specificId){\n\t\t$.ajax({\n\t\t\ttype:\"GET\", //Get this info from the server.\n\t\t url: 'https://api.spotify.com/v1/artists/5K4W6rqBFWDnAN6FQUkS6x/albums',\n\t\t success: getAlbum,\n\t\t error: errorGettingAlbum,\n\t\t dataType: \"json\"\n\t });\n\t}", "function displayResult2 () {\n if (request2.readyState == 4) {\n var jsonTA = JSON.parse(request2.responseText);\n document.getElementById(\"outputTA1\").innerHTML = \"List of top 5 albums:\"\n for (var i = 0; i < 5; i++)\n {\n document.getElementById(\"outputTA2\").innerHTML += \"<br></br>\"+jsonTA.topalbums.album[i]['name'] + \"<img src=\"+jsonTA.topalbums.album[i].image[1]['#text']+\"/>\";\n }\n }\n}", "function getAllProfileAlbums(param) {\n return $http.get('/api/shared/profileAlbum', {params: {loadMore: param}})\n .then(function (data) {\n return data.data;\n });\n }", "async getAllAlbums() {\n // if (!enable()) return null;\n\n try {\n console.log(\"[imgur] GET All Albums\");\n\n // get album count\n let count = await this.albumsCount();\n if (count == null) throw (\"[imgur] Can not get Albums count!\");\n\n // loop for pages\n let pArray = [];\n let pages = parseInt(count / 50);\n for (let page = 0; page <= pages; page++) {\n pArray.push(this.albums({ page }));\n }\n\n // get result\n let result = [];\n await Promise.all(pArray).then(values => {\n for (let arr of values) {\n result = result.concat(arr);\n }\n });\n\n console.log(\"[imgur] Imgur account Albums load complete (\" + result.length + \" Albums)!\");\n return result;\n\n } catch (error) {\n console.log(`[imgur] imgur.api.account.getAllAlbums`);\n console.log(error);\n return null;\n }\n }", "getAlbumsByName(albumName){\n let allAlbums = this.collectAlbums();\n let filtered = allAlbums.filter((album) => album.getName().toLowerCase().includes(albumName.toLowerCase()));\n return filtered;\n }", "getAlbumsForArtist(artistName) {\n const artist = this.getArtistById(artistName);\n return artist.getAlbumsNames();\n }", "function setAlbumCover() {\n if (!currentFilterByTag || currentFilterByTag.length===0)\n return; // no curent album\n setAlbumCoverNext(Object.keys(selection), function() {\n flash(\"Album cover set\");\n });\n}", "function loadAlbums() {\n\t$.ajax({\n\t\turl: 'bowie_albums.json',\n\t\tdataType: 'json',\n\t\tcontentType: 'application/json',\n\t\tmethod: 'get',\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tconsole.log(errorThrown);\n\t\t},\n\t\n\t\tsuccess: function(data, textStatus, jqXHR) {\n\t\t\talbums = data.bowie_albums;\n\t\t\t//console.log(albums);\n\t\t}\n\t});\t \t\t \t\t\t \n}", "function popAlbumFilter (cont) {\n $(\"#albumFilter\").html(\"\");\n for (let i=0; i < cont.songs.length; i++) {\n let songItem = cont.songs[i];\n $(\"#albumFilter\").append(\n `<option value = ${songItem.album}>${songItem.album}</option>\n `)\n }\n }", "function showLibrary() {\n\t$(\"#libraryContainer\").empty(); // Empty out the list\n\t$.mobile.changePage( \"#libraryPage\", { transition: \"slide\" });\n\t\n\t// Show all downloads up top on the list\n\tfor(var i=0; i<songDownloads.length; i++) {\n\t\tif(songDownloads[i].status != 1)\n\t\t\t$(\"#libraryContainer\").append('<div class=\"playlistRow\" id=\"libraryDownload'+i+'\" onClick=\"\">'+songDownloads[i].title+'<br>'+songDownloads[i].artist+'<div class=\"songPlaylistArt\" style=\"background-image:url('+songDownloads[i].artwork+');\"></div></div>');\n\t}\n\t\n\t// Then display all locally downloaded songs\n\tif(savedDownloadsJson !== undefined) {\n\t\tif(savedDownloadsJson.length > 0) {\n\t\t\tfor(var i=0; i<savedDownloadsJson.length; i++) {\n\t\t\t\t$(\"#libraryContainer\").append('<div class=\"playlistRow\" id=\"librarySaved'+i+'\" onClick=\"playerPlayLocalSong('+i+');\">'+savedDownloadsJson[i].title+'<br>'+savedDownloadsJson[i].artist+'<div class=\"songPlaylistArt\" style=\"background-image:url('+savedDownloadsJson[i].artwork+');\"></div></div>');\n\t\t\t}\n\t\t}\n\t}\n}", "function run() {\n if (!verifyThatPhotosAppIsRunning()) {\n return;\n }\n\n var newAlbumNameForAlbumlessPhotos = \"ALBUMLESS\";\n\n var app = getPhotosApp();\n app.displayAlert(`This script will scan through Apple Photos for photos NOT in an album. This might take some time.\\n\nThe identified photos will be added to a new album ${newAlbumNameForAlbumlessPhotos}, or a variant of that name if it exists already.`);\n\n findAlbumlessPhotos(newAlbumNameForAlbumlessPhotos);\n}", "getSongsInAlbum(albumName) {\n\t\tvar query = `\n\t\tSELECT * FROM songs\n\t\t\tLEFT JOIN json USING (json_id)\n\t\t\tWHERE album=\"${albumName}\"\n\t\t\tORDER BY date_added ASC\n\t\t`;\n\t\n\t\treturn this.cmdp(\"dbQuery\", [query]);\n\t}", "async function getAlbums(limit, query) {\n const albums = await fetchAlbums(limit, query);\n const artistIds = albums.map((el) => el.artistId);\n const artists = await fetchArtists(artistIds);\n return albums.map((album) => ({\n ...album,\n artistName: artists[album.artistId],\n }));\n}", "function slideshowGPhotoAlbums(a) {\n var albums_html = '';\n var albums_explore_btn = $('.h_ex_your_ph');\n\n\n if(albums_explore_btn.find('.list-albums-o').length) return albums_explore_btn.find('.list-albums-o').fadeIn();\n\n for(var i = 0; i < a.length; i++) {\n var _xkoe = a[i];\n albums_html += '<div id=\"sl-i-alb-' + _xkoe.id + '\" onclick=\"evstop(event);getUserSphotosFalbum(event,this,function(data,id){slideshowPhotosFromAlbum(data,id);});\" class=\"col-card __no-decor _novitrina ovr-menu_soh\">\\\n\t\t\t\t\t\t<div><div class=\"photo-sc_i_cover\">\\\n\t\t\t\t\t\t<div class=\"photo-sc_i_cnt __prw\">\\\n\t\t\t\t\t\t<a href=\"javascript:void(0)\" class=\"photo-sc_i_cnt_a\">\\\n\t\t\t\t\t\t<img class=\"photo-sc_i_cnt_a_img va_target\" src=\"/getPhoto?p=' + _xkoe.cover + '&sz=thumb\">\\\n\t\t\t\t\t\t<div class=\"col-card_ovr\"></div></a></div></div>\\\n\t\t\t\t\t\t<div class=\"photo-sc_grid_abt ellip\">\\\n\t\t\t\t\t\t<span class=\"o\" title=\"' + _xkoe.name + '\">' + _xkoe.name + '</span><span class=\"alb_count_pp\">' + _xkoe.count + ' photos</span></div></div></div>';\n }\n if(!albums_explore_btn.find('.list-albums-o').length) {\n\n albums_explore_btn.append('<div class=\"list-albums-o\" onclick=\"evstop(event);\"><div class=\"up_arr_st3\"></div><div class=\"nano albums_list-9q0\" ><div class=\"nano-content\">' + albums_html + '</div></div></div>');\n ga(\".list-albums-o .nano\").nanoScroller();\n ga(window).off('keyup.slideshow-dropdownhide').on('keyup.slideshow-dropdownhide', function(ev) {\n ev.preventDefault();\n ev.stopImmediatePropagation();\n if(ev.keyCode == 27)\n albums_explore_btn.find('.list-albums-o').fadeOut();\n });\n ga('body').off('click.slideshow-dropdownhide').on('click.slideshow-dropdownhide', function(e) {\n //e.preventDefault();\n albums_explore_btn.find('.list-albums-o').fadeOut();\n });\n }\n}", "function addToAlbum() {\n var modal = openDialog({title:'Add to album'}, function($body) {\n ajax({\n type: 'GET',\n url: '/photos/albums/byName',\n dataType: 'json',\n success: function(albums) {\n if (albums !== null && albums !== undefined && albums.length > 0) {\n _selectorAddAlbumRow(modal, null);\n for (var i=0; i<albums.length; i++) {\n var album = albums[i];\n _selectorAddAlbumRow(modal, album);\n }\n }\n },\n error: function(jqxhr, textStatus, error) {\n modal.close();\n flashError(\"Failed to get album list\", jqxhr.status);\n }\n });\n });\n}", "collectAlbums(){\n let resultadoAlbums = this.artists.map((fArtist) => fArtist.albums);\n let flatResultado = resultadoAlbums.reduce(function(a, b) { \n return a.concat(b);\n }, new Array);\n return flatResultado;\n }", "async getMediaItems(albumID){\n //Reponse contains an array of (id, description, productUr, mediaMetaData, filename)\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/mediaItems:search',\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer '+ token.accessToken,\n 'Content-type': 'application/json'\n },\n body: JSON.stringify({\n \"pageSize\":\"100\",\n \"albumId\": albumID\n })\n }\n response = await this.APIHandler.sendRequest(data);\n return response.mediaItems\n }", "function Album () {\n\tthis.photos = []\n\tthis.addPhoto = function();\n\t\n}", "async function viewObjectsInGallery(galnum, name){\n\t//retrieve objects\n\tconst p = new Parameters();\n\tp.addParams(\"gallery\", galnum);\n\tconst data = await getSearchData(OBJECT, p.getParams());\n\t//display objets\n\tlet html = \"<table><tr><th colspan='2'>Objects in Gallery: \" + name + \"</th></tr>\";\n\thtml += getObjectTable(data) + \"</table>\";\n\tdocument.getElementById(\"results\").innerHTML = html;\n}", "function showAllAssets() {\n\tfor (var i=0; i <= 15; i++) {\n\t\t$(\"#gallery\").append(\n\t\t\t\"<a class='\" + Assets[i].type +\n\t\t\t\"' id= '\" + Assets[i].embed +\n\t\t\t\"'href='\" + Assets[i].href +\n\t\t \t\"'><img src='\" + Assets[i].src + \n\t\t \t\"' alt='\" + Assets[i].alt + \"'></a>\"\n\t\t );\n\t}\n}", "loadArtistsOrAlbums(offset) {\n this._ApiFactory.getByArtistOrAlbum(this._$stateParams.value, offset).query({}, (response) => {\n\n const albums = this.matchSpotifyResults(response.albums.items);\n const artists = this.matchSpotifyResults(response.artists.items);\n\n this.musicRange = [...albums, ...artists].sort(this.compareByName);\n this.spotifyResults = [...this.spotifyResults, ...this.musicRange];\n\n }, (response) => {\n if (response.status === 401 || response.status === 403 || response.status === 419 || response.status === 440)\n this._JWT.login();\n });\n }", "renderAlbums() {\n return this.state.albums.map(album =>\n <AlbumDetail key={album.title} album={album} />\n );\n }", "function showAll() {\n searchForSongs();\n displayAudioBookInformation();\n }", "function formatAlbums (albumSet) {\n\n\t\tvar albums = [];\n\n\t\tfor (var album in albumSet) {\n\n\t\t\tvar songs = sortSongs(albumSet[album]);\n\n\t\t\talbums.push({ name: album, songs: songs });\n\n\t\t}\n\n\t\treturn albums;\n\n\t}", "function refreshAlbum(container, array) {\n for (var i = 0; i < array.length; i++) {\n container.appendChild(array[i]); }\n}", "componentDidMount() {\n const { album } = this.props.route.params; //selects the album\n this.GetImages({ first: fetchAmount, assetType: 'Photos', groupName: album })\n }", "allTracks(){\n return this.collecTracks(this.collectAlbums());\n }", "getAlbumsByArtist(artistName) {\n\t\tvar query = `\n\t\tSELECT DISTINCT album FROM songs\n\t\t\tLEFT JOIN json USING (json_id)\n\t\t\tWHERE artist=\"${artistName}\"\n\t\t\tORDER BY date_added ASC\n\t\t`;\n\t\n\t\treturn this.cmdp(\"dbQuery\", [query])\n\t\t\t.then((albumObjs) => {\n\t\t\t\t// Unpack \"albums\" string attribute into its own array of strings\n\t\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\t\tresolve(albumObjs.map(function(a) {return a.album;}));\n\t\t\t\t});\n\t\t\t});\n\t}", "function openPhotoAlbum(username,profilechecksum,AlbumCount,hasAlbum){\n totalImg=AlbumCount;\n currentView=1;\n progress=0;\n photoURL='/images/jspc/commonimg/loader.gif';\n if(AlbumCount>0){\n unloadScrollBars();\n var imageInsert='';\n var loop=1;\n for(loop=1;loop<=AlbumCount;loop++){\n imageInsert += \"<div class='albumPhotoImage' id='photo\"+loop+\"' data-count='\"+loop+\"' style='min-width: 990px; position: absolute;'> <div class='disp-tbl fullwid txtc'><div class='disp-cell vmid js-albumoutlayer' style='height:512px'> <img src='/images/jspc/commonimg/loader.gif' oncontextmenu='return false;' onmousedown='return false;' style='max-width:990px;max-height:512px;'/></div></div></div>\";\n }\n $(\"#photoContainer\").append(imageInsert);\n $('#photoContainer').find('#photo1').addClass('currentImgS');\n\n var loop=1;\n var wid = $(\"#photo1\").width();\n var leftHere = ($(window).width()-990)/2+wid;\n for(loop=2;loop<=totalImg;loop++){\n var toLeft = leftHere+(loop-1)*990;\n $(\"#photo\"+loop).css(\"visiblity\",\"hidden\");\n $(\"#photo\"+loop).animate({left: toLeft},1,function(){ $(\"#photo\"+loop).css(\"visiblity\",\"visible\");});\n }\n $(\"#photoAlbumPrev\").show();\n $(\"#photoAlbumNext\").show();\n if(totalImg<2){\n $(\"#photoAlbumPrev\").hide();\n $(\"#photoAlbumNext\").hide();\n }\n ajaxCallForAlbum(username,profilechecksum);\n\n $(\"#photoLayerMain\").show();\n $(\"#commonOverlay\").fadeIn();\n //$(\"#photoAlbumPrev\").hide();\n $(\"#photoAlbumCaption\").text(currentView+\" / \"+totalImg);\n $(\"#photoAlbumUsername\").text(username);\n }\n else{\n return false;\n }\n}", "function getAlbumReference() {\n return true;\n}", "static async getPhotoByAlbumId(req, res, next) {\n try {\n const { albumId } = req.params\n const galleries = await gallery.findAll(\n {\n attributes: {\n exclude: ['updatedAt', 'createdAt']\n },\n where: {\n albumId: albumId\n }\n }\n )\n res.status(200).json(galleries)\n } catch (error) {\n next(error)\n }\n }", "function hideAll() {\n $('#album1').hide();\n $('#album2').hide();\n $('#album3').hide();\n $('#album4').hide();\n }", "function loadFlickrPhotos() {\n var photoSetId, photoSetName;\n photoSetId = this.id.substring(2); // remove \"ps\" prefix\n photoSetName = $(this).text();\n\n // Get all the photos associated with the given photoset id.\n $.getJSON('/photos/' + photoSetId).then(\n function (data) {\n $('#photos').empty();\n Object.keys(data).sort().forEach(function (title) {\n var photo = data[title];\n loadFlickrPhoto(photo);\n });\n });\n }", "async function getExploreAlbum2() {\n let response = await fetch(\"http://wordpress.oscho.dk//wp-json/wp/v2/posts?_embed&categories=26\");\n let data = await response.json();\n\n appendExploreAlbum2(data);\n //showLoader(false);\n}" ]
[ "0.7894317", "0.7626682", "0.69266987", "0.68596125", "0.6788956", "0.67698354", "0.6760671", "0.67581177", "0.67003363", "0.6636396", "0.64802694", "0.6478993", "0.6407122", "0.6382332", "0.6378019", "0.6374532", "0.6347924", "0.63412625", "0.63008416", "0.63008416", "0.6279492", "0.62745494", "0.6215065", "0.615663", "0.6141748", "0.6123532", "0.6120579", "0.6116235", "0.6104964", "0.6097187", "0.6081516", "0.6078477", "0.6076119", "0.6066224", "0.60526294", "0.6036754", "0.6005507", "0.60003525", "0.5981887", "0.5960869", "0.59585714", "0.59503305", "0.5947298", "0.59472567", "0.59229684", "0.5899468", "0.5899468", "0.5867296", "0.5865432", "0.5855988", "0.58543086", "0.58387417", "0.5835753", "0.5835524", "0.58339685", "0.5824612", "0.5820185", "0.5817414", "0.58094513", "0.58013064", "0.5788657", "0.57601017", "0.57581145", "0.5757857", "0.57560694", "0.57544297", "0.5735621", "0.5714072", "0.57063276", "0.56992286", "0.56940305", "0.56749445", "0.5650513", "0.5599157", "0.55973816", "0.5595871", "0.55888", "0.55825025", "0.55754757", "0.5575441", "0.5559381", "0.5552402", "0.55369693", "0.55315614", "0.5528964", "0.5510087", "0.5509423", "0.55087394", "0.55024207", "0.54930526", "0.5489006", "0.5487448", "0.5482952", "0.54790026", "0.54786587", "0.5478513", "0.5455055", "0.5453207", "0.5452425", "0.5445323" ]
0.77872026
1
Constructor Put your required dependencies in the constructor parameters list
constructor(cache, tagsService, postsService) { this.cache = cache; this.tagsService = tagsService; this.postsService = postsService; this.schema = { slug: null, title: null, image: null, content: null, tags: [], }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(params) {\n this.params = params;\n }", "constructor(args, required) {\n super(args, required);\n // <<-- Creer-Merge: constructor -->>\n // setup any thing you need here\n // <<-- /Creer-Merge: constructor -->>\n }", "constructor(args, required) {\n super(args, required);\n // <<-- Creer-Merge: constructor -->>\n // setup any thing you need here\n // <<-- /Creer-Merge: constructor -->>\n }", "function Constructor() {\n // All construction is actually done in the init method\n if ( this.initialize )\n this.initialize.apply(this, arguments);\n }", "constructor(args) {\n super(args);\n }", "constructor(args) {\n super(args);\n }", "consructor() {\n }", "init() {\n // Import indicator + set the default params\n this.ind1 = dep('SomeIndicator1', [12])\n\n // Import a TA library (nmp package)\n this.ta_lib = dep('@some_ta_lib')\n\n }", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor() {\n\t\t// ...\n\t}", "constructor(data = {}) {\n super(data);\n \n this.init(data);\n }", "constructor(title, author, isbn) {\n // whatever passes in as params will be assigned to title, author, isbn\n this.title = title;\n this.author = author;\n this.isbn = isbn;\n }", "constructur() {}", "constructor(opts) {\n super(opts);\n }", "constructor(opts) {\n this.init(opts || {});\n }", "constructor(firstName, lastName, age, address) {\n // sets the instance variables to whatever is passed into\n // constructor\n this.firstName = firstName\n this.lastName = lastName\n this.age = age\n this.address = address\n }", "constructor( args ) {\n\t\t\t\tsuper( args );\n\t\t\t}", "constructor() {\r\n // ohne Inhalt\r\n }", "constructor(data) { }", "constructor(params = {}) {\n this.clear();\n this.initialize(params);\n }", "function _construct()\n\t\t{;\n\t\t}", "constructor(args, opts) {\n super(args, opts);\n}", "constructor(){\n\n }", "constructor(){\n\n }", "constructor(){\r\n }", "constructor(){\n \n\n }", "constructor( ) {}", "constructor() {\n super();\n this._init();\n }", "constructor(){\r\n\t}", "constructor(){\n\n }", "constructor(a, b, c) {\n super(a, b, c);\n }", "constructor(){\r\n\r\n }", "constructor(oDescriptor, oParameters) {\n this.applyDescriptor(oDescriptor);\n this.applyParameters(oParameters);\n this.init();\n }", "constructor(...args) {\n super(...args);\n \n }", "constructor(...args) {\n super(() => [], ...args);\n\n // Used to store validated order components for sorting this relation.\n this.orderComponents = null;\n }", "constructor(data) {\n\n //TODO - your code goes here -\n\n }", "function _ctor() {\n\t}", "constructor(props) {\n super(props);\n //@TODO\n }", "constructor() \n { \n \n\n }", "constructor()\n {\n this.init();\n }", "constructor(props) {\n super(props);\n // TODO\n }", "constructor(props) {\n super(props);\n // TODO\n }", "constructor() {\n\t\tsuper(...arguments);\n\t}", "constructor(opts) {\n\t\tsuper(opts);\n\t}", "constructor() {\r\n super()\r\n this.init()\r\n }", "constructor() {\n\n }", "constructor() {\n\n }", "constructor (){}", "constructor(config){ super(config) }", "constructor(config){ super(config) }", "constructor() {\n this.init();\n }", "constructor(options) {\n super();\n this._init(options);\n }", "constructor(dims) {\n if (dims !== undefined) this.initializeParams(dims);\n }", "constructor(params) {\n super(params);\n\n const oThis = this;\n }", "constructor ( firstName, lastName, userHobbies ) {\n //initial values of the arguments\n this.firstName = firstName;\n this.lastName = lastName;\n this.userHobbies = userHobbies;\n }", "constructor(make, model, topSpeed, color, year, numberOfWheels, dealership){\n //super keyword is used to access and call functions on an object's parent.\n //Super used inside of constructor allows access to parent constructor\n super(make, model, topSpeed, color, year);\n this.numberOfWheels = numberOfWheels;\n this.dealership = dealership;\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor(props) {\n // Call the parent constructor with the props object we automatically get\n super(props);\n }", "constructor(...params)\n {\n //defining first name, last name, address , city, state, zip, phone number and email\n this.firstName= params[0];\n this.lastName= params[1];\n this.address= params[2];\n this.city= params[3];\n this.state= params[4];\n this.zip= params[5];\n this.phoneNumber= params[6];\n this.email= params[7];\n }", "constructor(name, degree) {\n // Whenever we add a constructor a child class,\n //we need to call the constructor of its parent class\n // which means we need to add special keyword super() that\n //reference to the parent class:\n super(name); // This will initialize the NAME property\n // Here also we need to initialize DEGREE property\n this.degree = degree;\n }", "constructor() {\r\n }", "constructor() {\n \n }", "constructor(nombre, apellido, departamento) { //es necesario colocar los parametros de la clase padre que se utilizaran en la clase hija\n super(nombre, apellido); //con super mandamos a llamar al constructor de la clase padre\n this._departamento = departamento;\n }", "constructor(nombre, prioridad) {\n this.nombre = nombre;\n this.prioridad = prioridad;\n }", "constructor(props) {\n\t\tsuper(props);\n\t}", "constructor(props) {\n\t\tsuper(props);\n\t}", "constructor(_data, _target) {\n // Define fields\n this.data = _data;\n this.target = _target;\n\n // Call init\n this.init();\n }", "constructor() {\n }", "constructor(data) {\n \n }", "constructor (nombre, apellido,sueldo, cargo){ //solicitio los parametros incluidos los que vincule\n super(nombre,apellido) // con super selecciono los parametros que pide la clase vinculada\n this.sueldo= sueldo;\n this.cargo=cargo;\n }", "constructor(x, y, z){\n super(x, y, z);\n }", "constructor(options={}) {\n super(options);\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }" ]
[ "0.69842225", "0.6833624", "0.6833624", "0.67252344", "0.66913277", "0.66913277", "0.66803926", "0.66610587", "0.6652505", "0.6652505", "0.6652505", "0.6652505", "0.6652505", "0.6652505", "0.6652505", "0.6627949", "0.6586442", "0.6568772", "0.65339845", "0.6528502", "0.6503958", "0.64988196", "0.64908624", "0.64907897", "0.6473703", "0.6472678", "0.6445534", "0.64393955", "0.6438311", "0.6438311", "0.64224327", "0.63920105", "0.6386506", "0.63621545", "0.63572055", "0.6353306", "0.6350499", "0.6337574", "0.6337444", "0.63298565", "0.6326661", "0.6326054", "0.63183206", "0.63068277", "0.63017654", "0.629075", "0.62876195", "0.62876195", "0.62861335", "0.62788826", "0.6275001", "0.62732047", "0.62732047", "0.62718743", "0.6254713", "0.6254713", "0.625013", "0.6243292", "0.6240711", "0.62269163", "0.62225866", "0.6216293", "0.62104654", "0.62104654", "0.62104654", "0.62104654", "0.62104654", "0.62104654", "0.62104654", "0.62104654", "0.62104654", "0.62104654", "0.62104654", "0.62104654", "0.62104654", "0.62104654", "0.62104654", "0.62104654", "0.62104654", "0.62104654", "0.62104654", "0.6207339", "0.62019193", "0.61998546", "0.61957085", "0.61895066", "0.6183905", "0.6175429", "0.61696804", "0.61696804", "0.6163565", "0.61565065", "0.61538225", "0.61446667", "0.61382985", "0.6131639", "0.6131095", "0.6131095", "0.6131095", "0.6131095", "0.6131095" ]
0.0
-1
Initialize the component This method is triggered before rendering the component
init() { this.errors = {}; this.modal = null; this.isSending = false; this.isValidForm = true; this.cachedPostValue = this.cache.get('t-post', ''); // t-post => timeline post this.onSave = this.inputs.getEvent('save'); this.onClose = this.inputs.getEvent('close'); this.data = this.inputs.getProp('post', this.schema); if (! this.data.content) { this.data.content = this.cachedPostValue; } this.heading = this.data.id ? `Edit ${this.data.title}` : 'Create new post'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initialize() {\n this.render();\n }", "init() {\n this.render();\n }", "init() {\n this.render();\n }", "init() {\n if (this.initialised) {\n return;\n }\n\n // Set initialise flag\n this.initialised = true;\n // Create required elements\n this._createTemplates();\n // Generate input markup\n this._createInput();\n // Subscribe store to render method\n this.store.subscribe(this.render);\n // Render any items\n this.render();\n // Trigger event listeners\n this._addEventListeners();\n\n const callback = this.config.callbackOnInit;\n // Run callback if it is a function\n if (callback && isType('Function', callback)) {\n callback.call(this);\n }\n }", "function initialization() {\n $log.info('default component initialized');\n }", "function init(){\n buildComponent();\n attachHandlers();\n addComponents();\n }", "render() {\n if (!this.initialized) {\n this.init();\n }\n }", "initialize() {\n this.listenTo(this.owner, {\n [events_1.RendererEvent.BEGIN]: this.onRenderBegin,\n [events_1.PageEvent.BEGIN]: this.onRendererBeginPage,\n });\n }", "render() {\n if (!this.initialized) this.init();\n }", "initialize() {\n //\n }", "init() {\n // call the base component's init function\n UIComponent.prototype.init.apply(this, arguments)\n }", "function init(){\n buildComponent();\n attachHandlers();\n addComponents();\n doSomethingAfterRendering(); // 렌더 이후 처리함수 (예 - 서버접속)\n }", "postInitialize() {\n // Take component initialize asynchronously to take care\n // about constructor of extending component class\n setTimeout(() => {this.initialize()}, 1);\n }", "function initialize() {\n }", "onInit() {\n this.__initEvents();\n }", "render() {\n // always reinit on render\n this.init();\n }", "render() {\n // always reinit on render\n this.init();\n }", "initialize() {\n // Overwrite your component initialize\n this.state.text = 'Example component content';\n }", "function init() {\n\n }", "function init() {\n\n }", "function init () {\n // Here below all inits you need\n }", "function init() { render(this); }", "constructor() {\n super();\n this._init();\n }", "initialize() {\n log('initialized');\n\n // Start listening to initialize events\n new Initializer();\n\n /**\n * App was initialized but hasn't started yet.\n *\n * @event App#init\n */\n this.channel.trigger('init');\n\n // Render the layout\n this.layout.render();\n }", "initialize() {\n this.model.on('change', this.render, this);\n }", "initialize() {\n this.model.on('change', this.render, this);\n }", "componentDidMount() {\n\t\tthis.init();\n\t}", "constructor() {\n this._Initialize();\n }", "constructor() {\n this.init();\n }", "function init() {\r\n\r\n }", "function init() {\n }", "function initialize(){\n\n\t\t//sets all needed components, listeners, etc\n\t\tformatBodyPages();\n\t\tsetBodyTransitions();\n\n\t}", "constructor() {\n this._initialize();\n }", "initialise(){\n this._initialise(this._body)\n this._initEvents()\n this._dispatchOnInit()\n }", "init() {\n }", "onload() {\n this.init();\n }", "Initialize()\n {\n this.UpdateValues();\n }", "function init() {\n // courses\n lastCheckedCourse = -1;\n isActive = false;\n\n // connect ui elements with event handlers\n bindUIActions();\n }", "constructor() {\r\n super()\r\n this.init()\r\n }", "function init(){\n\n }", "componentWillMount() {\n let {title, datasourceUrl, path, xAxis, yAxis, aggregate, summary} = this.props.properties;\n this.initialize(title, datasourceUrl, path, xAxis, yAxis, aggregate, summary, function(){});\n }", "init(){\n \n }", "createdCallback() {\r\n this.init()\r\n }", "beforeInitialize(component, data) {}", "constructor() {\n super();\n this.render();\n }", "function init() {\r\n }", "function init() {\n cashElements();\n attachEvents();\n render();\n }", "init() {\n\t\tDebug.success(`${this.name} initialized`);\n\t}", "constructor(){\n this.init();\n }", "ready() {\n super.ready();\n\n const that = this;\n\n that._render();\n }", "constructor()\n {\n this.init();\n }", "created() {\n this.__initEvents();\n }", "initialize_() {\n this.initialize();\n this.initialized_ = true;\n }", "onInitialize() {}", "initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}", "Initialize() {\n\n }", "constructor(){\n this.init();\n\n\n }", "_initialize() {\n debug(TRACE_INITIALIZE, this);\n\n this._initState();\n\n // Call subclass lifecycle methods\n this.initializeState(this.context);\n // Initialize extensions\n for (const extension of this.props.extensions) {\n extension.initializeState.call(this, this.context, extension);\n }\n // End subclass lifecycle methods\n\n // initializeState callback tends to clear state\n this.setChangeFlags({\n dataChanged: true,\n propsChanged: true,\n viewportChanged: true,\n extensionsChanged: true\n });\n\n this._updateState();\n }", "Initialize()\n {\n\n }", "onComponentConstructed() {}", "onComponentConstructed() {}", "function init() {\n\t \t\n\t }", "init() {\n // call the base component's init function\n UIComponent.prototype.init.apply(this, arguments)\n\n // set the device model\n this.setModel(models.createDeviceModel(), 'device')\n\n\n this.attachProgress();\n\n let currentUserModel = new JSONModel();\n this.setModel(currentUserModel, \"currentUser\");\n\n\n // create the views based on the url/hash\n this.getRouter().initialize()\n }", "constructor() {\n this.init();\n\n }", "constructor() {\n this.init();\n }", "constructor() {\n this.init();\n }", "init(){\n\n\n }", "componentDidMount () {\n this.init();\n }", "componentDidMount () {\n this.init();\n }", "componentDidMount () {\n this.init();\n }", "function _init() {\n }", "init() {\n // override init to make sure createEl is not triggered\n }", "init() {\n // call the base component's init function\n UIComponent.prototype.init.apply(this, arguments)\n\n // set the device model\n this.setModel(models.createDeviceModel(), 'device')\n\n // set the todo model\n this.setModel(models.createTodoModel(), 'todo')\n\n // create the views based on the url/hash\n this.getRouter().initialize()\n }", "onInit()\n {\n // \n }", "componentDidMount() {\n this.initialize();\n }", "constructor() {\n super();\n this.renderCoreStyles();\n this.render();\n }", "initialize () {\n\n if (!this.initialized) {\n\n // only perform once\n this.initialized = true;\n\n // loads batches of assets\n this.bulkLoader = new BulkLoader();\n this.bulkLoader.on('LOAD_PROGRESS', this.on_LOAD_PROGRESS.bind(this));\n this.bulkLoader.on('LOAD_COMPLETE', this.on_LOAD_COMPLETE.bind(this));\n \n // set HTML to DOM\n this.parentEl.innerHTML = this.html;\n }\n }", "function Initialize()\n\t\t{\n\t\t\t\n\t\t}", "async _init() {\n // load the container from DOM, and check it\n const loaded = this._loadContainer(this._options.container);\n\n if (!loaded) return;\n\n // init html templates\n this._initContainer();\n this._initControls();\n this._renderControls();\n\n // init listeners\n this._initListeners();\n\n // first data load\n await this._fetchCards(this._maxDisplayedCards);\n this._loadCurrentPage();\n }", "_init() {\n\t\tthis.life.init();\n\t\tthis.render.init();\n\n\t\tthis.emission.init();\n\t\tthis.trail.init(this.node);\n\n\t\tthis.color.init();\n\t}", "constructor(props) {\n super(props);\n\n // Passed on prop for all components that may be loaded on this page.\n this.passUpdateFunctions = {\n refreshList: this.resetConvos.bind(this),\n changeView: this.changeView.bind(this)\n };\n\n this.state = this.getInitState();\n }", "initialize() {\n\n\t\t\t\t// Load the HTML used for the desktop\n\t\t\t\tthis.$el.html( CustomerFormHtml );\n\n\t\t\t\tthis.render();\n\t\t\t\tBackbone.View.prototype.initialize.call( this );\n\t\t\t}", "onRender()\n {\n this._initializeSettingsDisplay();\n }", "function init() {\n\n\n\n\t}", "function initialize() {\r\n\r\n \t}", "onInit() {\n this.score = this.timeLimit;\n this.quizOver = false;\n this.introView.render();\n this.introView.attachEventHandlers();\n }", "init_() {\n // Add CSS marker that component upgrade is finished.\n // Useful, but beware flashes of unstyled content when relying on this.\n this.root_.dataset.mdlUpgraded = '';\n }", "onInit() {}", "function Ctor() {\n this.isLoaded = false;\n }", "constructor() {\n super()\n self = this\n self.init()\n }", "init() {\n this._super(...arguments);\n this.set('config', Ember.getOwner(this).resolveRegistration('config:environment').APP.recognition);\n // Set up the observer to take a picture when the component is ready\n this.addObserver('component', this, this.componentSet);\n }", "constructor(){\n this.init();\n}", "function init() {\n\n }", "createdCallback() {\n self = this\n self.init()\n }", "$onInit() {\n \n }", "componentWillLoad() {\n this.base = new baseComponent_esm.BaseComponent(this, core.dxp);\n if (this.textList.length > 0) {\n this.assignPlaceholderText();\n }\n }", "initialize() {\n this.updateDebugMode();\n }", "function init() {\n self.loading.init = true;\n self.process = TucTelephonyAccessoriesOrderProcess.getOrderProcess();\n initComponentsOptions();\n }", "Initialize()\n {\n this.Rebind();\n }", "ready() {\n this._root = this._createRoot();\n super.ready();\n this._firstRendered();\n }", "function initialize() {\n\t\talertBinding();\n\t\tsetGalleryId();\n\t\tfileUploadInit();\n\t\tfileUploadBinding();\n\t\tloadGallery();\n\t}" ]
[ "0.78513736", "0.7619341", "0.7619341", "0.7560289", "0.75375986", "0.74452835", "0.7443599", "0.73289156", "0.7321705", "0.73024684", "0.72739834", "0.7197493", "0.71857035", "0.71266896", "0.70746905", "0.7052088", "0.7052088", "0.7033113", "0.7032479", "0.7032479", "0.7018155", "0.7012253", "0.699344", "0.6971317", "0.6963399", "0.6963399", "0.69565636", "0.69280416", "0.6925776", "0.6920938", "0.6910326", "0.69093084", "0.6893174", "0.68926376", "0.6891662", "0.6890056", "0.68871653", "0.6874633", "0.68678254", "0.6865107", "0.68620795", "0.6861903", "0.68409956", "0.68307734", "0.6794608", "0.67937005", "0.67897654", "0.6772166", "0.6771173", "0.6747333", "0.674463", "0.67342556", "0.6733259", "0.67332286", "0.6723015", "0.67222023", "0.67088413", "0.6686677", "0.6679925", "0.6678367", "0.6678367", "0.66705024", "0.66702306", "0.6641492", "0.6635754", "0.6635754", "0.6615144", "0.65996987", "0.65996987", "0.65996987", "0.65894186", "0.6587278", "0.65832675", "0.6579451", "0.6576048", "0.65743506", "0.657253", "0.65616786", "0.6545756", "0.65387666", "0.65115446", "0.649467", "0.6494275", "0.6478008", "0.6471692", "0.6470373", "0.6468304", "0.6461113", "0.6456572", "0.6454033", "0.64476115", "0.6438503", "0.64381105", "0.6434819", "0.6424732", "0.6424254", "0.6422113", "0.64104384", "0.64059305", "0.64024746", "0.6396267" ]
0.0
-1
Form to create new card with word and definition
function NewCardForm({ handleCreate }) { const currentUser = useContext(UserContext); const [formData, setFormData] = useState({ word: '', defn: '' }); function handleChange(evt) { let { name, value } = evt.target; setFormData((oldformData) => ({ ...oldformData, [name]: value })); } return ( <Form onSubmit={(evt) => handleCreate(evt, currentUser.userId, formData)}> <FormGroup> <Input name="word" value={formData.word} placeholder="Word" onChange={handleChange} required /> </FormGroup> <FormGroup> <Input name="defn" value={formData.defn} placeholder="Definition" onChange={handleChange} required /> </FormGroup> <Button> Create Card </Button> </Form> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleCreateCard() {\n let payload = {\n hint: card.hint,\n answer: card.answer,\n type: 'text',\n };\n if (image !== '' && card.type === 'image') {\n payload = {\n hint: image,\n answer: card.answer,\n type: 'image',\n };\n }\n else if (sound !== '' && card.type === 'audio' || card.type === 'sound') {\n payload = {\n hint: sound,\n answer: card.answer,\n type: 'sound',\n };\n }\n else {\n payload = {\n hint: card.hint,\n answer: card.answer,\n type: 'text',\n };\n }\n dispatch(insertCard(id, payload));\n setCard({\n hint: '',\n answer: '',\n type: ''\n })\n }", "function createCard(){\n event.preventDefault();\n\n var newCard = new Card(titleInput.value, urlInput.value);\n addCardToList(newCard);\n increaseCardCounter();\n}", "function createCard(sel, translation, context, color){\r\n var newCardObject = {\r\n id: id,\r\n term: sel,\r\n translation: translation,\r\n context: context\r\n }\r\n var newCardElement = '<div id=\"card-'+ id +'\" class=\"term-card card\" style=\"width: 100%; background-color: '+ color +';\"> \\\r\n <i id=\"' +id+ '\" class=\"delete-flashcard fas fa-trash-alt\"></i>\\\r\n <div class=\"card-body\">\\\r\n <h5 class=\"card-title\">Term</h5>\\\r\n <p class=\"card-subtitle term mb-2 text-muted\">' + sel + \r\n '<h5 class=\"card-title\">Translation</h5> \\\r\n <p class=\"card-subtitle translation mb-2 text-muted\">'+ newCardObject.translation +'</p>\\\r\n <button type=\"submit\" id=\"create-card-'+ id +'\" class=\"make-flashcard btn btn-secondary mb-2\">Make Flashcard</button></div></div>'; \r\n cards.push(newCardObject)\r\n id += 1;\r\n $(newCardElement).appendTo(\"#terms\");\r\n }", "function generateCard(id, productUrl, img, title, subtitle, description) {\n var cardForm = '\\n <form class=\"card card-hovered d-flex h-100 flex-column justify-content-between\" id=\"' + id + '\" name=\"' + id + '\" method=\"POST\" action=\"update\" >\\n <input type=\"hidden\" name=\"update\" />\\n <input type=\"hidden\" name=\"id\" value=\"' + id + '\" />\\n <div class=\"form-group\">\\n <label for=\"url\">URL</label>\\n <input type=\"url\" class=\"form-control\" name=\"url\" value=\"' + productUrl + '\" title=\"Website URL\" >\\n </div>\\n <div class=\"form-group\">\\n <label for=\"photo\">\\u0421\\u043B\\u0438\\u043A\\u0430</label>\\n <input type=\"url\" name=\"photo\" class=\"form-control\" value=\"' + img + '\" title=\"Photo URL\" > \\n </div>\\n <div class=\"card-title text-secondary m-0\">\\n <div class=\"form-group\">\\n <label for=\"name\">\\u0418\\u043C\\u0435</label>\\n <input type=\"text\" name=\"name\" class=\"card-title form-control\" value=\"' + title + '\" title=\"Product Name\"/>\\n </div>\\n <div class=\"form-group\">\\n <label for=\"subtitle\">\\u041F\\u043E\\u0434\\u043D\\u0430\\u0441\\u043B\\u043E\\u0432</label>\\n <input type=\"text\" name=\"subtitle\" class=\"card-text form-control\" value=\"' + subtitle + '\" />\\n </div>\\n </div>\\n <div class=\"card-body form-group\">\\n <label for=\"description\">\\u041E\\u043F\\u0438\\u0441</label>\\n <textarea class=\"card-text form-control\" name=\"description\">' + description + '</textarea>\\n </div>\\n <div class=\"card-footer\">\\n <div class=\"controls\">\\n <input type=\"submit\" class=\"update-button-' + id + '\" value=\"\\u0417\\u0430\\u0447\\u0443\\u0432\\u0430\\u0458\">\\n <input type=\"button\" class=\"cancel-button-' + id + '\" value=\"\\u041E\\u0442\\u043A\\u0430\\u0436\\u0438\">\\n </div>\\n </div>\\n <input type=\"hidden\" name=\"_token\" value=\"' + csrf_token + '\">\\n </form>\\n ';\n return cardForm;\n}", "function createCard() {\n let icebox = document.getElementById('icebox');\n let cardContent = new Assignment(getValue('#assignment'), getValue('#description'));\n let card = document.createElement('div');\n let cardTitle = document.createElement('h2');\n let cardDescription = document.createElement('p');\n\n icebox.appendChild(card);\n\n card.appendChild(cardTitle);\n card.appendChild(cardDescription);\n\n cardTitle.innerHTML = cardContent.title;\n cardDescription.innerHTML = cardContent.description;\n}", "function cardCreate(){\n'<div class=\"well\">' +\n'<h3>' + \"name\" + '</h3>' +\n'<p>' + 'content' + '</p>' + \n'</div>'; \n}", "function submitNewCard(event) {\n //preventing from submitting a form right away\n event.preventDefault();\n let book = Object.create(Book.prototype);\n\n book.title = event.target.elements['title'].value;\n book.author = event.target.elements['author'].value;\n book.pages = event.target.elements['pages'].value;\n book.read = event.target.elements['read'].checked;\n \n addBookToLibrary(book);\n clearForm(event);\n openForm();\n}", "function MakeCard(firstName, lastName, pan, expDate, cvv) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.pan = pan;\n this.expDate = expDate;\n this.cvv = cvv;\n}", "function createBook()\n\t{\t\n\t\tlet elem = text = document.createElement(\"form\");\n\t\telem.id = \"superform\";\n\t\tdocument.body.appendChild(elem); //Adds the form element to the body.\n\t}", "async function handleAddCard(newCardData) {\n await setAddingNewCard(true);\n const cardsArr = [...cards];\n cardsArr.push(newCardData);\n setCards(cardsArr);\n setNewCard({\n word: \"\",\n definition: \"\",\n });\n wordInput.current.focus();\n wordInput.current.value = \"\";\n definitionInput.current.value = \"\";\n }", "function setupCard() {\n angular.forEach(list.cards, function(term) {\n var definition = cardService.cards[term];\n if (definition) {\n $scope.cards.push({\n term: term,\n definition: definition\n });\n } else {\n //sync the cards if the term definition doesn't exist\n cardService.remove(term);\n }\n });\n }", "function addFlashcard(text, definition) {\n var flashcard = {\n _id: new Date().toISOString(),\n title: text,\n define: definition,\n completed: false\n };\n db.put(flashcard).then(function(result){\n console.log('everything is okay');\n console.log(result);\n }).catch(function(err){\n console.log('everything is terrible');\n console.log(err);\n });\n }", "function newBook(response, request) {\n\tvar template = fs.readFileSync('./template/book_create.jade');\n\tvar fn = jade.compile(template, {filename: './template/book_form.jade'});\n\tresponse.writeHead(200,{\"Content-Type\":\"text/html\"});\n\tresponse.write(fn());\n\tresponse.end();\n}", "function createFlashcard() {\n const card = {\n card_front: document.getElementById(\"card_front\").value,\n card_back: document.getElementById(\"card_back\").value,\n deck_id: document.getElementById(\"deck_id\").value,\n category: document.getElementById(\"category\").value,\n }\n fetch(MAIN_URL + \"/cards\", {\n method: \"POST\",\n body: JSON.stringify(card),\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n }\n })\n .then(resp => resp.json())\n .then (card => {\n let cardInstance = new Card(card)\n document.querySelector(\"#flashcard-list\").innerHTML += cardInstance.renderFlashcard();\n })\n clearForm();\n}", "function createFlashcard(front, back){\r\n const url = window.location.href.toString().replace(\"articleParser/iframetest.php\", \"flashcards/addCard.php\")\r\n \r\n let cardInfo = new FormData();\r\n cardInfo.append(\"card\", \"{\\\"front\\\":\\\"\"+front+\"\\\",\\\"back\\\":\\\"\"+back+\"\\\",\\\"deck\\\":\\\"\"+languagename+\"\\\"}\");\r\n \r\n let cardAdd = new XMLHttpRequest();\r\n cardAdd.open(\"post\", url, true);\r\n cardAdd.send(cardInfo);\r\n}", "function Get_Intent_Card(){\n\tvar div = document.createElement(\"div\");\n \tdiv.id =\"GeneralIntentCard\";\n\tvar divHtml = \"<div class='card col-md-12 text-center'><div class='header'><h4 class='title'><strong>Intent ID :</strong>\"+MIntents.Intent_ID+\"</h4></div><div class='row'><div class='col-md-12'><div class='row'><div class='col-md-10 text-center'><div class='form-group'><label><strong>Pregunta General: </strong></label><input type='text' class='form-control' placeholder='Insertar pregunta general' value='\"+MIntents.General_Question+\"' id='generalquestion' name='GeneralQuestion' required></div></div></div><div id='Variations'></div><div id='Tags'></div></div></div></div>\";\n \tdocument.getElementById(\"Intents_Collection\").appendChild(div).outerHTML = divHtml;\n \t// llamada a las funciones de crear tag y variantes\n \tGet_Tags();\n \tGet_Variations();\n}", "function requestNewCard(e) {\n const elem = e.currentTarget;\n const inputs = elem.closest('form').querySelectorAll('input');\n e.preventDefault();\n const form = elem.closest('form');\n if (!check_fill(inputs)) {\n fetch('AddNewCard', {\n method: 'POST',\n credentials: 'same-origin',\n 'X-CSRF-Token': document.querySelector('input[name=_token]').value,\n body: new FormData(form)\n })\n .then(onResponse)\n .then((json) => {\n if (json.error === undefined) {\n emptyDiv(document.querySelector('.new-card-modal'));\n document.querySelector('.new-card-modal').appendChild(getChild(json));\n emptyDiv(document.querySelector('#cards .cards-container'));\n emptyDiv(document.querySelector('#cards .info-container'));\n generateSection('Cards');\n } else {\n print_error(inputs[1], json.error);\n }\n });\n }\n}", "function flashcardCreator() {\n let str = document.querySelector(\"#flashcardWords\").value;\n let cells = str.split(\"\\n\").map(function (el) {\n return el.split(\" - \");\n });\n\n let inputs = document.querySelectorAll(\"form input\");\n\n let inputsValues = [];\n\n for (let i = 0; i < inputs.length; i++) {\n inputsValues.push(inputs[i].value);\n }\n\n let headings = inputsValues;\n\n let out = cells.map(function (el) {\n let obj = {};\n obj.cardID = 1;\n for (var i = 0; i < el.length; i++) {\n if (el.length == 2) {\n obj[headings[i]] = isNaN(Number(el[i])) ? el[i] : +el[i];\n obj.empty = \"\";\n } else {\n obj[headings[i]] = isNaN(Number(el[i])) ? el[i] : +el[i];\n }\n }\n return obj;\n });\n\n for (let i = 0; i < out.length; i++) {\n out[i].cardID = storedFlashCards.length + 1 + i;\n out[i].youtube = \"\";\n out[i].ok = 0;\n out[i].repeat = 0;\n }\n\n storedFlashCards = storedFlashCards.concat(out);\n}", "function saveCard() {\n\n // 2-1 return early if either of the required fields are empty\n if (!this.name || !this.note) {\n return\n }\n\n // 2-2 Create the payload object as stated in Airtable's api documentation\n const payload = {\n fields: {\n Name: this.name,\n Notes: this.note,\n Memorized: false, // Not necessary, but I like to be explicit\n Attachments: []\n }\n }\n\n // 2-3 Send the data\n axios.post(`https://api.airtable.com/v0/appgyWdA8yP0KXZr4/My%20Study%20Cards?api_key=${airtableKey}`, payload)\n .then((resp) => {\n\n if (resp.status === 200 && resp.data.id) {\n\n // 2-4 If we're successful, update the studyCards array\n this.studyCards.push(resp.data)\n\n // 2-5 Clear the form so we can create another task if we want.\n this.clearForm()\n\n } else {\n console.error('Unable to save card.', payload)\n }\n })\n}", "function createNewBook() {\n const book = new Book(\n document.querySelector(\"#name\").value,\n document.querySelector(\"#author\").value,\n document.querySelector(\"#pages\").value,\n document.querySelector(\"#read\").value == \"true\" ? true : false\n );\n addBookToLibrary(book);\n updateLocalStorage(myLibrary);\n displayBook(book);\n toggleForm();\n}", "function create_card(headline)\n {\n // create the HTML for the card using jQuery\n var card = $(\n [\n \"<div class='card w-100'>\",\n \"<div class='card-body'>\",\n \"<div class='card-title row'>\",\n \"<h5 class='float-left'>\",\n \"<a class='headline-link' target='_blank' href='\" + headline.link + \"'>\",\n headline.title,\n \"</a>\",\n \"</h5>\",\n \"</div>\",\n \"<div class='row justify-content-end'>\",\n \"<a class='float-right btn btn-info notes col-sm-auto'>\",\n \"Headline Notes\",\n \"</a>\",\n \"<a class='float-right btn btn-danger delete col-sm-auto'>\",\n \"Delete From Saved\",\n \"</a>\",\n \"</div>\",\n \"</div>\",\n \"</div>\"\n ].join(\"\")\n );\n card.data(\"_id\", headline._id);\n return card;\n }", "function clickCreate (event) {\n if(event.target.id === 'create') {\n cardParentEl.innerHTML += `\n <div class='card'>\n <p>${document.getElementById('textarea').value}</p>\n <button id='delete'>Delete</button>\n </div>`;\n }\n}", "function create_form_page()\n{\n empty_content('content');\n\n const form = document.createElement('form');\n\n let form_inner_html = '';\n\n form_inner_html += \n `\n <div id=\"form_title\">\n Devenez hébergeur pour <i>Merci pour l'invit'</i>'\n </div>\n <p1 id=\"description\">\n Vous avez une chambre libre ? Vous souhaitez devenir hébergeur solidaire et faire \n parti de l'aventure <i> Merci pour l'invit' </i> ? \n <br> <br>\n <i> Merci pour l'invit' </i> est un projet qui prône l'hébergement solidaire afin de faciliter la \n réinsertion socioprofessionnelle de femmes et de jeunes en grande précarité. \n <br> <br>\n <i> Merci pour l'invit' </i> se développe actuellement à BORDEAUX, à PARIS et sa banlieue. \n <br> <br>\n Après avoir rempli ce questionnaire, la responsable \"hébergement\"vous contactera pour \n vous expliquer plus amplement la démarche. La Charte de cohabitation sera signée entre \n vous et la personne accueillie lors du début de l'hébergement. \n <br> <br>\n Vous habitez une autre ville ? N'hésitez pas à remplir ce formulaire, notre équipe \n vous répondra dès que possible. \n <br> <br>\n Ce questionnaire <b>NE VOUS ENGAGE PAS A HEBERGER.</b>\n <br> <br>\n Toutes les informations collectées sont strictement pour l'association, elles ne \n seront pas partagées et ne serviront que pour les besoins du projet.\n <br> <br>\n <m style='color: red; display: inline-block;'> * Champ obligatoire </m>\n </p1>\n `;\n\n let names = ['Nom','Prénom','Genre','Ville','Code Postal','Adresse',\n 'Numéro de téléphone','Adresse mail', \"Nombres d'habitants dans le foyer\"];\n\n for(let i = 0;i < names.length ; i++)\n {\n form_inner_html += create_form_text_holder(names[i]);\n };\n\n let drop_names = [\"Modalités d'hébergement\",\"Durée d'hébergement\"];\n let drop_elements = [[\"Une chambre à part\",\"Canapé-lit\",\"Logement entier\",\"Autre\"],\n [\"Deux semaines\",\"De 1 mois à 3 mois\",\"De 4 mois à 6 mois\",\"6 mois ou plus\"]];\n\n for(let i = 0;i < drop_names.length ; i++)\n {\n form_inner_html += create_form_drop_down(drop_names[i],drop_elements[i]);\n };\n\n names = [\"A partir de quand pouvez-vous recevoir quelqu'un chez vous?\",\n \"Qu'attendez-vous de cette expérience d'accueil ?\", \"Des questions ou commentaires?\"];\n\n let place_holder = ['jj/mm/aaaa','Votre reponse','Votre reponse'];\n\n for(let i = 0;i < names.length ; i++)\n {\n form_inner_html += create_form_text_holder(names[i],place_holder[i]);\n };\n\n form_inner_html += `<div id=\"form_button\">\n <button id=\"envoyer\" type=\"button\">\n Envoyer\n </button>\n </div>`;\n \n form.innerHTML = form_inner_html;\n \n const form_container = document.createElement('div');\n form_container.setAttribute(\"class\",\"form_container\")\n form_container.appendChild(form);\n\n const content = document.querySelector('#content');\n content.innerHTML += create_page_title(\"Formulaire d'héberement\");\n content.appendChild(form_container);\n\n const submit = document.querySelector(\"#envoyer\");\n submit.addEventListener('click', submitForm);\n}", "function buscar_recetaCardMaker(text){\n if(search_recipe_cards){\n let card = document.createElement('div');\n card.className = 'card';\n card.innerHTML = '<div class=\"images\" style=\"background-image: url('+text.img+');\"></div>' +\n '<div class=\"name\">' +\n '<h1>'+text.name+'</h1>' +\n '</div>' +\n '<div class=\"other\">' +\n '<p><span>Calories: </span>'+text.calories.toFixed(0)+'</p>' +\n '<p><span>Cautions: </span>'+text.cautions+'</p>' +\n '<p><span>Diet Labels: </span>'+text.dietLabels+'</p>' +\n '<p><span>Health Labels: </span><br>'+text.healthLabels+'</p>' +\n '<p><span>Ingredients: </span><br>'+text.ingredients+'</p>' +\n '<a href='+text.url+' target=\"_blank\">Instructions</a>' +\n '</div>' +\n '<div class=\"save-btn\">' +\n '<i class=\"fas fa-save\" onclick=\"save_recipe(\\'' +text.img+ '\\' , \\''+text.name+'\\' , \\'' +text.calories.toFixed(0)+ '\\' , \\''+text.cautions+'\\' , \\''+text.dietLabels+'\\' , \\''+text.healthLabels+'\\' , \\''+text.ingredients+'\\' , \\''+text.url+'\\')\"></i>' +\n '</div>';\n search_recipe_cards.appendChild(card);\n }\n}", "handleAddCard(listId, description = '') {}", "function createForm() {\n let form = document.createElement(`form`);\n form.id = `form`;\n document.getElementById(`create-monster`).appendChild(form);\n\n document.getElementById(`form`).appendChild(createInputAndPlaceholder(`input`,`Name`));\n document.getElementById(`form`).appendChild(createInputAndPlaceholder(`input`,`Age`));\n document.getElementById(`form`).appendChild(createInputAndPlaceholder(`input`,`Description`));\n\n let button = document.createElement('button');\n button.innerHTML = `Create`;\n document.getElementById(`form`).appendChild(button);\n\n\n}", "create(req, res, next) {\n cardsDB.save(req.body)\n .then((card) => {\n res.locals.card = card;\n next();\n })\n .catch(err => next(err));\n }", "function _getCardFromTxt(e) {\n\t\t\tvar files = e.target.files || e.dataTransfer.files,\n\t\t\t\tf = files[0];\n\t\t\t\t\n\t\t\tif (!f) {\n\t\t\t\talert(\"Failed to load file\");\n\t\t\t} else if (!f.type.match('text.*')) {\n\t\t\t\talert(f.name + \" is not a valid text file.\");\n\t\t\t} else {\n\t\t\t\tvar reader = new FileReader();\n\n\t\t\t\treader.onload = function(e) { \n\t\t\t\t\tvar contents = {\n\t\t\t\t\t\ttitle: f.name,\n\t\t\t\t\t\turl: '',\n\t\t\t\t\t\ttext : e.target.result,\n\t\t\t\t\t\ttags : '',\n\t\t\t\t\t\tsubmitLabel: 'Create Card',\n\t\t\t\t\t\tattachments: []\n\t\t\t\t\t};\n\t\t\t\t\tcardForm.init(contents);\n\t\t\t\t};\n\t\t\t\treader.readAsText(f);\t\n\t\t\t}\n\t\t}", "saveCard() {\n\t\tlet translatedWord = this.state.korean;\n\t\tlet eng = document.getElementById(\"inputEng\").value;\n\t\tlet url = \"store?english=\" + eng + \"&korean=\" + translatedWord;\n\t\tfetch(url)\n\t\t\t.then(\n\t\t\t\t(error) => {\n\t\t\t\t\tthis.setState( {\n\t\t\t\t\t\terror\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t)\n\t}", "function MakeCard(theName, theBirthday, theSsn, theAddress) {\n var creditCard = {\n name: theName,\n birthday: theBirthday,\n ssn: theSsn,\n address: theAddress\n };\n return creditCard;\n}", "renderFORM() {\r\n return (\r\n <div className=\"card bg-light mb-3\">\r\n <div className='card-body'>\r\n <form>\r\n <div className=\"form-group\">\r\n <label htmlFor=\"exampleFormControlTextarea1\"><b> Title: </b></label>\r\n <textarea name='title' type='text' onChange={this.handleChange} className=\"form-control\" id=\"exampleFormControlTextarea1\"></textarea>\r\n </div>\r\n <div className=\"form-group\">\r\n <label htmlFor=\"exampleFormControlTextarea1\"><b> Category: </b></label>\r\n <textarea name='category' type='text' onChange={this.handleChange} className=\"form-control\" id=\"exampleFormControlTextarea1\"></textarea>\r\n </div>\r\n <div className=\"form-group\">\r\n <label htmlFor=\"exampleFormControlTextarea1\"><b> Description: </b></label>\r\n <textarea name='description' type='text' onChange={this.handleChange} rows='4' className=\"form-control\" id=\"exampleFormControlTextarea1\"></textarea>\r\n </div>\r\n <div className=\"form-group\">\r\n <label htmlFor=\"exampleFormControlTextarea1\"><b> Cover Image: </b></label>\r\n <textarea name='cover_image' type='text' onChange={this.handleChange} className=\"form-control\" id=\"exampleFormControlTextarea1\"></textarea>\r\n </div>\r\n <div className=\"form-group\">\r\n <label htmlFor=\"exampleFormControlTextarea1\"><b> Goal: </b></label>\r\n <textarea type='number' name='goal' min='1' onChange={this.handleChange} className=\"form-control\" id=\"exampleFormControlTextarea1\"></textarea>\r\n </div>\r\n <div className=\"d-flex justify-content-center\">\r\n <MdSave style={{ color: 'black', fontSize: \"30px\" }} onClick={this.createProject}></MdSave>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n )\r\n }", "function createDeck(){\n $state.go(\"my-deck-preview-new-card\", {}, {reload: true});\n }", "function addNewCard(cat_name, percent, cost, limit){\n var parent = document.getElementById('cat_holder');\n var cloned_card = document.getElementById('card_frame').cloneNode(true);\n cloned_card.firstElementChild.classList.remove('mdl-color--grey');\n cloned_card.firstElementChild.classList.add(colors[Math.round(Math.random())][Math.floor(Math.random()*6)]);\n var f = cloned_card.querySelector('form');\n f.querySelector('input').setAttribute('value', cat_name);\n\n f.querySelector('a').addEventListener('click', function(){\n f.submit();\n });\n\n cloned_card.querySelector('h4').firstChild.textContent = cat_name;\n cloned_card.querySelector('.card-limit-label').textContent = cost+\" / \"+limit;\n\n parent.appendChild(cloned_card);\n\n setProgress(cloned_card.querySelector('.graph_holder'), percent);\n }", "function formSubmit() {\n\tvar title = $('.title-input').val();\n\tvar idea = $('.idea-input').val();\n\tvar ideaCard = new IdeaCard(title, idea);\n\t$('section').prepend(populateCard(ideaCard)); \n\tresetHeader();\n\tsendToLocalStorage();\n}", "function setupCard() {\n // added title and p tag in wrapper\n let wrapper = document.createElement(\"div\");\n window.cardTitle = document.createElement(\"h3\");\n window.question = document.createElement(\"p\");\n window.answer = document.createElement(\"p\");\n window.language = document.createElement(\"p\");\n\n // Created Classes for the above elements\n // Hide Title and Answer by using 'display=none'\n wrapper.setAttribute(\"id\", \"card-item\");\n window.language.setAttribute(\"id\", \"card-language\");\n window.question.setAttribute(\"class\", \"card-question\");\n window.cardTitle.setAttribute(\"class\", \"card-title\");\n window.answer.setAttribute(\"class\", \"card-answer\");\n\n // added title and p tag inside wrapper\n wrapper.appendChild(window.language);\n wrapper.appendChild(window.cardTitle);\n wrapper.appendChild(window.question);\n wrapper.appendChild(window.answer);\n\n // grabbed list we wanted to add onto\n let cardList = document.querySelector(\"div#card-list\");\n\n // Clear card-list so new data creates a new list of questions and answers\n cardList.innerHTML = \"\";\n // takes all cards and renders them to a wrapper named 'card-list'\n cardList.appendChild(wrapper);\n\n // creating button element\n let deleteButton = document.createElement(\"button\");\n deleteButton.setAttribute(\"id\", \"deleteButton\");\n\n // creating text to be displayed on button\n let text = document.createTextNode(\"Delete This Card\");\n\n // appending text to button\n deleteButton.appendChild(text);\n\n // appending button to div\n wrapper.appendChild(deleteButton);\n\n // let deleteBtn = document.getElementById(\"deleteButton\");\n\n deleteButton.addEventListener(\"click\", deleteCard);\n}", "function savedRecipeCardMaker(text){\n if(saved_recipe_cards){\n let card = document.createElement('div');\n card.className = 'card';\n card.innerHTML = '<div class=\"images\" style=\"background-image: url('+text.img+');\"></div>' +\n '<div class=\"name\">' +\n '<h1>'+text.name+'</h1>' +\n '</div>' +\n '<div class=\"other\">' +\n '<p><span>Calories: </span>'+text.calories+'</p>' +\n '<p><span>Cautions: </span>'+text.cautions+'</p>' +\n '<p><span>Diet Labels: </span>'+text.dietLabels+'</p>' +\n '<p><span>Health Labels: </span><br>'+text.healthLabels+'</p>' +\n '<p><span>Ingredients: </span><br>'+text.ingredients+'</p>' +\n '<a href='+text.url+' target=\"_blank\">Instructions</a>' +\n '</div>' +\n '<div class=\"del-btn\">' +\n '<i class=\"fas fa-trash\" onclick=\"delSavedRecipe(\\'' +text.img+ '\\' , \\''+text.name+'\\' , \\'' +text.calories+ '\\' , \\''+text.cautions+'\\' , \\''+text.dietLabels+'\\' , \\''+text.healthLabels+'\\' , \\''+text.ingredients+'\\' , \\''+text.url+'\\')\"></i>' +\n '</div>';\n saved_recipe_cards.appendChild(card); \n }\n}", "function createCard(detail) {\n return (\n <Cards\n key={detail._id}\n name={detail.name}\n amount={detail.amount}\n location={detail.location}\n address={detail.address}\n img1={detail.img1}\n img2={detail.img2}\n />\n );\n}", "function setupForm() {\n var index = 1;\n document.getElementById(\"name\").focus();\n document.getElementById(\"colors-js-puns\").classList.add(\"is-hidden\");\n document.getElementById(\"other-title\").classList.add(\"is-hidden\");\n document.getElementById(\"payment\").selectedIndex = index;\n\n createTotal();\n togglePaymentDiv(index);\n }", "create(req, res) {\n\t\tlet card = new cardM();\n\t\tif (!req.body.card_no) {\n\t\t\treturn this.common.findError(res);\n\t\t}\n\n\t\tcard.card_no = req.body.card_no;\n\n\t\treturn this.dao.create(card)\n\t\t\t.then(this.common.editSuccess(res))\n\t\t\t.catch(this.common.serverError(res));\n\t}", "function create() {\n buttonCreate.style.display = 'none';\n counterVerbs.style.display = 'flex';\n inputs.style.display = 'flex';\n currentNumber.innerHTML = counter;\n fullNumber.innerHTML = verbs.length;\n presentVerb.innerHTML = verbsArr[verbNumber][0];\n}", "function t_createCard (data) {\n // Make a POST request with a JSON payload.\n var options = {\n 'method' : 'post',\n 'contentType': 'application/json',\n // Convert the JavaScript object to a JSON string.\n 'payload' : JSON.stringify(data)\n };\n UrlFetchApp.fetch('https://api.trello.com/1/cards', options);\n}", "function createNoteCard(i) {\n i = i - 1;\n var new_card = document.createElement(\"div\");\n new_card.className = \"notecard lock\";\n new_card.id = \"n\" + i; //'n' + int i\n new_card.appendChild(createTerm(i));\n new_card.appendChild(createDefintion(i));\n new_card.insertAdjacentHTML(\n \"beforeend\",\n '<input type=\"submit\" class=\"done\" value=\"Done\"/>'\n );\n return new_card;\n}", "function getFinalTerm(card){\n return card.displayTerm + \" (\" + card.definition.toString() + \")\";\n}", "function create_item() {\n document.getElementById('modify-header').textContent = 'Creating new Item';\n create_form('meat_shop_item','content-div');\n}", "function returnCard(car) {\n let cardCarsDescription = `<div class=\"card mb-5\" style=\"width: 18rem;\">\n <img src=\"https://i.imgur.com/mAnQEPU.jpg\" class=\"card-img-top\" alt=\"...\">\n <div class=\"card-body position-relative\">\n <h5 class=\"card-title d-flex\">Brand: \n <input type=\"text\" class=\"bg-transparent border-0 outline-input ml-2 height-width-input\" id=\"brand${car.id}\" value=\"${car.Marca}\" disabled>\n </h5>\n <h5 class=\"card-title d-flex\">Model: \n <input type=\"text\" class=\"bg-transparent border-0 outline-input ml-2 height-width-input\" id=\"model${car.id}\" value=\"${car.Modelo}\" disabled>\n </h5>\n <h5 class=\"card-title d-flex\">Colour: \n <input type=\"text\" class=\"bg-transparent border-0 outline-input ml-2 height-width-input\" id=\"colour${car.id}\" value=\"${car.Color}\" disabled>\n </h5>\n <h5 class=\"card-title d-flex\">Age: \n <input type=\"number\" class=\"bg-transparent border-0 outline-input ml-2 height-width-input\" id=\"age${car.id}\" value=${car.Age} disabled>\n </h5>\n <h5 class=\"card-title d-flex\">Price:\n <input type=\"text\" class=\"bg-transparent border-0 outline-input ml-2 height-width-input\" id=\"price${car.id}\" value=\"$${esCurrencyFormat.format(car.Precio)}\" disabled>\n </h5>\n <div id=\"buttonsOptionEdit${car.id}\" class=\"d-none\">\n <button onclick=\"editCar(${car.id})\" id=\"buttonConfirmEdit${car.id}\" type=\"button\" class=\"btn btn-primary\">Edit</button>\n <button onclick=\"cancelEditCar(${car.id})\" id=\"buttonCancelEdit${car.id}\" type=\"button\" class=\"btn btn-primary\">Cancel</button>\n </div>\n <a href=\"#\" class=\"btn position-absolute absolute-top absolute-right\">\n <span onclick=\"changeListGroup(${car.id})\">\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 16 16\" class=\"bi bi-caret-down-fill\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z\"/>\n </svg>\n </span>\n <div id=\"options-edit-remove${car.id}\" class=\"list-group position-absolute invisible\">\n <button onclick=\"buttonEditCar(${car.id})\" type=\"button\" onclick=\"\" class=\"list-group-item btn-outline-primary list-group-item-action active rounded-top cursor-pointer\">\n Editar\n </button>\n <button onclick=\"removeCar(${car.id})\" type=\"button\" onclick=\"\" class=\"list-group-item btn-outline-primary list-group-item-action active rounded-bottom cursor-pointer\">\n Eliminar\n </button>\n </div>\n </a>\n </div>\n </div>`\n\n return cardCarsDescription;\n}", "function createClozeCard(){\n\tinquirer.prompt([{\n\t\ttype: \"input\",\n\t\tname: \"clozeFull\",\n\t\tmessage: \"Enter the full text of the card: \"\n\t}, {\n\t\ttype: \"input\",\n\t\tname: \"clozeCloze\",\n\t\tmessage: \"Enter the cloze text of the card: \"\n\t}]).then(function(clozeAnswers){\n\t\tvar fullText = clozeAnswers.clozeFull;\n\t\tvar clozeText = clozeAnswers.clozeCloze;\n\t\t\n\t\t// Create a ClozeCard variable instance \n\t\tvar clozeFlashcard = new ClozeCard(fullText, clozeText);\n\t\t\n\t\t// Determine if the cloze deletion does not appear in the input text\n\t\t// If it does appear, append input to a .txt file\n\t\t// If it doesn't appear, log the error and prompt the user to enter the\n\t\t// information again\n\t\tvar partialText = clozeFlashcard.partial();\n\n\t\tif (partialText === \"Cloze text not found\") {\n\t\t\tconsole.log(partialText + \"\\nTry again!\");\n\t\t\tcreateClozeCard();\n\t\t}\n\t\telse {\n\t\t\t// Record the answers in a .txt file\n\t\t\tappendClozeLog(clozeFlashcard);\n\t\t}\n\t});\n}", "function addCard(title, text='',imageUrl='') {\n _data.push({title, text, imageUrl});\n}", "function generateCard(post) {\n let card = gen(\"article\");\n card.classList.add(\"card\");\n card.id = post[\"id\"];\n let image = postProfilePic(post);\n let contents = postContent(post);\n let info = postInformation(post);\n card.appendChild(image);\n card.appendChild(contents);\n card.appendChild(info);\n return card;\n }", "function BuildCard(CardQuestion,block){\n\n let MainQuestion = CardQuestion[0] // question \n let PossibleAnswers = CardQuestion[1] // possible answer \n\n // Disable and enable the question text area to add the main question \n document.getElementById('mainQuestion').innerHTML = MainQuestion\n\n\n /// ----- ANSWERS CREATED ---- \n for(let i=0; i <= PossibleAnswers.length -1 ; i ++){\n\n FillCardInfo(PossibleAnswers[i])\n \n }\n\n\n // Submit button \n let AnswerButton = document.createElement('button')\n AnswerButton.className = \"button is-success answerbutton\"\n AnswerButton.id = \"QuizAnswerButton\"\n AnswerButton.innerHTML = \"Answer\"\n AnswerButton.style = \"margin: 0 auto\"\n AnswerButton.onclick = function(){\n SubmitAnswer(CardQuestion,block)\n }\n\n let FlashCardQuizBox = document.getElementById('NewCard')\n FlashCardQuizBox.appendChild(AnswerButton)\n\n }", "function updateCard() {\n\n // 6-1 Create the payload object.\n const payload = {\n fields: {\n Name: this.name,\n Notes: this.note\n }\n }\n\n // 6-2 Edit the card:\n this.editCard(this.idToEdit, payload)\n}", "function createCard (response){\n const card = document.createElement(\"Article\");\n const img = response.imageUrl;\n const newImage = document.createElement(\"img\");\n const btn = document.createElement(\"button\");\n const form = document.createElement(\"form\");\n const main = document.querySelector(\"#shop\");\n const dropMenuLabel = document.createElement(\"label\");\n const dropMenu = document.createElement(\"select\");\n\n //Setup classes and attribute and append to card\n card.classList.add(\"col\", \"card\", \"p-3\");\n newImage.classList.add(\"img\");\n newImage.setAttribute(\"width\", \"100%\");\n newImage.setAttribute(\"src\", img);\n card.appendChild(newImage);\n\n //Set dropdown menu \n card.innerHTML += \"<h2>\" + response.name + \"</h2>\";\n dropMenuLabel.innerHTML = \"choose from Lenses here &nbsp\";\n form.appendChild(dropMenuLabel);\n form.appendChild(dropMenu);\n\n //loop to get all items and display the one selected\n for (let x in response.lenses){\n const option = document.createElement(\"option\");\n option.innerHTML = response.lenses[x];\n option.setAttribute(\"value\", response.lenses[x]);\n dropMenu.appendChild(option);\n }\n card.appendChild(form);\n\n card.innerHTML += \"<p>\" + response.description + \"</p>\";\n card.innerHTML += \"<h4>\" + \"$\" + response.price / 100 + \"</h4>\";\n btn.classList.add(\"btn\", \"btn-secondary\", \"w-25\", \"mx-auto\");\n btn.innerHTML = \"Add to Cart\";\n btn.classList.add(\"text-center\");\n\n card.append(btn);\n main.append(card);\n\n //Add item to the cart btn\n btn.addEventListener('click', () => {\n console.log(\"hello\");\n cartNumbers(response);\n totalCost(response);\n });\n\n //Check if there are any items on Local Storage\n function cartNumbers (response){\n let productNumbers = localStorage.getItem('cartNumbers');\n productNumbers = parseInt(productNumbers);\n console.log(response.name);\n //if there are any add one to them\n if (productNumbers){\n localStorage.setItem('cartNumbers', productNumbers + 1);\n document.querySelector('.spanCart').textContent = productNumbers + 1;\n //if there is none set local storage to one\n }else{\n localStorage.setItem('cartNumbers', 1);\n document.querySelector('.spanCart').textContent = 1; \n }\n setItems(response);\n \n }\n\n function setItems (){\n //console.log('inside of the SetItems functions');\n //console.log('My product is ', response);\n //Set cartItems as an array\n let cartItems = localStorage.getItem('productInCart');\n cartItems = JSON.parse(cartItems); \n if (cartItems == null){\n cartItems = []; \n }\n let singleProduct = {\n prodId: response._id,\n name: response.name,\n imgUrl: response.imageUrl,\n selectLense: dropMenu.value,\n price: response.price,\n quantity: 1 \n }\n\n cartItems.push(singleProduct);\n /*cartItems.push({\n [response._id]: response\n \n });*/\n localStorage.setItem('productInCart', JSON.stringify(cartItems));\n\n }\n \n\n //Adds the sum of the products\n function totalCost(response){\n console.log('The product price is', response.price /100);\n let cartCost = localStorage.getItem('totalCost');\n if(cartCost != null){\n cartCost = parseInt(cartCost);\n localStorage.setItem('totalCost', cartCost + response.price / 100);\n } else {\n localStorage.setItem('totalCost', response.price / 100);\n }\n }\n\n /**Checks if there is any number in the localStorage and then displays\n it in cart Span*/\n function onLoadCartNumbers(){\n let productNumbers = localStorage.getItem('cartNumbers');\n if(productNumbers){\n document.querySelector('.spanCart').textContent = productNumbers;\n }\n }\n\n onLoadCartNumbers();\n\n}", "function generateCards() {\n\t\t$('.questions').html('');\n\t\tfor (var i = 0; i < questions.length; i++) {\n\t\t\tvar q = questions[i];\n\t\t\tvar html = questionTemplate({\n\t\t\t\tquestion: q[0],\n\t\t\t\tindex: i,\n\t\t\t\ta: q[1],\n\t\t\t\tb: q[2],\n\t\t\t\tc: q[3],\n\t\t\t\td: q[4]\n\t\t\t});\n\t\t\t$('.questions').append(html);\n\t\t};\n\n // Indicamos que nos interesa el evento change de los inputs dentro de los elementos con clase question y card (cada una de las preguntas).\n\t\t$('.question.card input').change(optionSelected);\n\t}", "function generateCard(card, title, description, link) {\n // Adds card title and description to the card\n card.appendChild(title);\n card.appendChild(description);\n\n // Add card to link\n link.appendChild(card);\n\n // Adds card to the result div tag\n appendToResults.appendChild(link);\n }", "function newCard(json){\n\t// Insert Card\n\tdocument.getElementById(\"frame\").innerHTML += json.body;\n\t\n\t// Init drawer if the canvas is present\n\tif (document.getElementById(\"canvas\") != null)\n\t\tinitDrawer();\n\t\t\n\tif (document.getElementsByClassName(\"jscolor\") != null)\n\t\tinitJSColor();\n\t\n\t// Theme and animate if we need to swap cards\n\tlet cards = document.getElementsByClassName(\"card\");\n\tif (cards.length == 2){\n\t\tpopulatePage(json, cards[1]);\n\t\ttheme(cards[1]);\n\t\t\n\t\tif ($(cards[1]).find(\"#timer\")[0] != null)\n\t\t\tstartTimer(60, null);\n\t\t\n\t\ttransitionCards(cards);\n\t} else {\n\t\tpopulatePage(json, cards[0]);\n\t\t\n\t\tif ($(cards[0]).find(\"#timer\")[0] != null)\n\t\t\tcontinueTimer();\n\t\t\n\t\ttheme(cards[0]);\n\t}\n}", "function createCard(id, bookName, authorName, pages, read) {\n const cardsSection = document.querySelector('#cards');\n\n const card = document.createElement('div');\n card.classList.add('card');\n card.setAttribute('id', id);\n\n const title = document.createElement('div');\n title.classList.add('heading');\n title.textContent = bookName;\n\n const content = document.createElement('div');\n content.classList.add('content');\n\n const author = document.createElement('p');\n author.innerHTML = `Author: ${authorName}`;\n\n const numPages = document.createElement('p');\n numPages.innerHTML = `Number of pages: ${pages}`;\n\n const readStatus = document.createElement('p');\n readStatus.innerHTML = `Read: ${read}`;\n\n const removeButton = document.createElement('div');\n removeButton.classList.add('delete-btn');\n removeButton.setAttribute('data-index', id);\n removeButton.setAttribute('href', '#');\n removeButton.innerHTML = '<i class=\"far fa-trash-alt fa-lg\"></i>';\n\n card.appendChild(title);\n content.appendChild(author);\n content.appendChild(numPages);\n content.appendChild(readStatus);\n card.appendChild(content);\n card.appendChild(removeButton);\n cardsSection.appendChild(card);\n}", "createTerm() {\n\t\tlet state = {\n\t\t\t_id: Helpers.getRandomID('t'),\n\t\t\ttitle: '',\n\t\t\tsortkey: '',\n\t\t\tdesc: '',\n\t\t}\n\t\tthis.apply(\n\t\t\tActions.create('terms', 'create', {state})\n\t\t)\n\t}", "function createCard() {\n\n $(\"#card-div\").empty();\n\n $(\"#card-div\").html(\n \"<div class='card'>\" +\n \"<h5 class='card-header' id='event'></h5>\" +\n \"<div class='card-body'>\" +\n \"<h5 class='card-title' id='venue'></h5>\" +\n \"<p class='card-text' id='description'></p>\" +\n \"<a href='#' class='btn btn-primary' id='external-link'>\" + \"Find Out More\" + \"</a>\" +\n \"</div>\" +\n \"</div>\"\n )\n\n }", "function createCard(i) {\n var cardCreate = document.querySelector('#cardCreation');\n var card = document.createElement('div');\n card.className = 'card';\n var imgDiv = document.createElement('div');\n imgDiv.className = 'imgCreate';\n var img = document.createElement('img');\n imgDiv.appendChild(img);\n /*Create the header for the car part */\n var p = document.createElement('p');\n var h3 = document.createElement('h3');\n var button = document.createElement('BUTTON');\n button.className = 'add';\n button.innerHTML = 'Add to Cart';\n cardCreate.appendChild(card);\n img.src = products[i].image;\n /*Create the image for the car part*/\n img.className = 'product-image';\n card.appendChild(imgDiv);\n var name = document.createTextNode(products[i].name);\n h3.appendChild(name);\n card.appendChild(h3);\n p.className = 'price';\n /*Create the price for the car part*/\n var price = document.createTextNode('$' + products[i].price + ' CAD');\n p.appendChild(price);\n card.appendChild(p);\n var desc = document.createTextNode(products[i].description);\n card.appendChild(p);\n card.appendChild(desc);\n card.appendChild(button);\n}", "function createWord() {\r\n let randomNumber = Math.floor(Math.random()*wordList.length);\r\n let wordObject = wordList[randomNumber];\r\n\r\n //definitionText.style.visibility=\"hidden\";\r\n document.getElementById('definition').innerHTML = wordObject.definition;\r\n\r\n\r\n return wordObject.name.toUpperCase(); // to pass to letter buttons\r\n}", "function insert() {\n\t$(\"#descr\").val(\"\");\n\t$(\"#videourl\").val(\"\");\n\t$(\"#controls\").val(\"0\");\n\t$(\"#question\").val(\"\");\n\t$(\"#info\").val(\"\");\n\t$(\"#submit\").val(\"Create\");\n\t$(\"#action\").val(\"2\");\n $(\"#accordion\").accordion({ collapsible: true, active: false });\n\t$(\"#videoinfo\").overlay().load();\n\ttoControls($(\"#controls\").val());\n}", "function onclickAddFlashcards(i) {\n whichDeck(i);\n createBodyPart(createAddFlashcardsBody());\n}", "function bookForm() {\n\n var c = [];\n\n c.push(\" <form class='w3-container w3-border w3-border-amber'>\");\n c.push(\"<br><span style='width: 8em; display: inline-block' class='w3-amber'>Title : </span><input type='text' required id='currentTitle' size='50' ><br>\");\n c.push(\"<span style='width: 8em; display: inline-block' class='w3-amber'>Author : </span><input type='text' required id='currentAuthor' size='50' ><br>\");\n c.push(\"<span style='width: 8em; display: inline-block' class='w3-amber'>Category : </span><input type='text' required id='currentCategory' size='50' ><br>\");\n c.push(\"<span style='width: 8em; display: inline-block' class='w3-amber'>Format : </span><input type='text' required id='currentFormat' size='50' ><br><br>\");\n c.push(\"<button type='button' id='add' class='w3-button w3-xlarge w3-border w3-border-amber w3-round-xxlarge'>Add book</button><br><br>\");\n c.push(\"</form>\");\n c.push(\"<br><p id='message' class='w3-amber w3-large'></p>\");\n\n\n $('#book').html(c.join(\"\"));\n\n document.getElementById(\"add\").onclick = function () {\n addBook();\n };\n\n }", "function createBasicCard(){\n\tinquirer.prompt([{\n\t\ttype: \"input\",\n\t\tname: \"basicFront\",\n\t\tmessage: \"Enter the front of the card: \"\n\t}, {\n\t\ttype: \"input\",\n\t\tname: \"basicBack\",\n\t\tmessage: \"Enter the back of the card: \"\n\t}]).then(function(basicAnswers){\n\t\t\n\t\tvar front = basicAnswers.basicFront;\n\t\tvar back = basicAnswers.basicBack;\n\t\tvar basicFlashcard = new BasicCard(front, back); // Create a constructor\n\t\t\n\t\t// Record the answers in a .txt file\n\t\tappendBasicLog(basicFlashcard);\n\t});\n}", "function createCardElements() {\n var wikiLink = d.createElement(\"a\"); // creates link tag\n var card = d.createElement(\"div\"); // creates div tag\n var cardTitle = d.createElement(\"p\"); // creates title \n var cardDescription = d.createElement(\"p\"); // creates description\n setAttributes(card, cardTitle, cardDescription, wikiLink);\n generateCard(card, cardTitle, cardDescription, wikiLink);\n }", "function clickSave(event) {\n event.preventDefault();\n if ($('#title-input').val() === \"\" || $('#task-input').val() === \"\") return false;\n var card = new CreateCard($('#title-input').val(), $('#task-input').val())\n $( \".bottom-box\" ).prepend(makeCardHTML(card)); \n localStoreCard(card);\n $('form')[0].reset();\n $('.character-count-task').text(0);\n $('.character-count-title').text(0);\n}", "addDoc(){\n \n let dname = readline.question('\\nEnter Doctor name : ');\n let specialization = readline.question('Enter patient Speciality : ');\n let availability = readline.question('Enter availability Type \"AM\", \"PM\" or \"Both : ');\n \n var doctor = {\n \"DoctorName\" :dname,\n \"DocID\" :this.docid,\n \"Specialization\" : specialization,\n \"Availability\" : availability\n }\n this.dfile.Doctors.push(doctor);\n this.saveDocData();\n }", "function initCardToEdit(studyCard) {\n\n // 5-1 Set isEditing flag as this is used to update the UI.\n this.isEditing = true\n\n // 5-2 Set the id we want to edit. This is necessary for the PATCH request.\n this.idToEdit = studyCard.id\n\n // 5-3 Set our v-models so our UI shows the selected card info in the input fields.\n // using destructing because why not.\n const {\n Name,\n Notes\n } = studyCard.fields\n\n this.name = Name\n this.note = Notes\n\n // 5-4 Let's make our inputs 'dirty' so Material Design Lite knows to hide the labels:\n document.getElementById('studyCardNameInput').classList.add('is-dirty')\n document.getElementById('studyCardNoteInput').classList.add('is-dirty')\n}", "function myRecipeCardMaker(text){\r\n if(my_recipe_cards){\r\n var card = document.createElement('div');\r\n card.className = 'card';\r\n card.innerHTML = '<div class=\"images\" style=\"background-image: url('+text.img+');\"></div>' +\r\n '<div class=\"name\">' +\r\n '<h1>'+text.name+'</h1>' +\r\n '</div>' +\r\n '<div class=\"other\">' +\r\n '<p><span>Description: </span><br>'+text.description+'</p>' +\r\n '<p><span>Ingredients: </span><br>'+text.ingredients+'</p>' +\r\n '<p><span>Instructions: </span><br>'+text.instructions+'</p>' +\r\n '<a href=\"view-recipe.html\" style=\"color:blue;cursor:pointer;\" onclick=\"view_recipe(\\'' +text.img+ '\\' , \\''+text.name+'\\' , \\'' +text.description+ '\\' , \\''+text.ingredients+'\\' , \\''+text.instructions+'\\')\">View more</a>' +\r\n '</div>' +\r\n '<div class=\"del-btn\">' +\r\n '<i class=\"fas fa-trash\" onclick=\"delMyRecipe(\\'' +text.img+ '\\' , \\''+text.name+'\\' , \\'' +text.description+ '\\' , \\''+text.ingredients+'\\' , \\''+text.instructions+'\\')\"></i>' +\r\n '</div>';\r\n my_recipe_cards.appendChild(card); \r\n } \r\n}", "function createAddNewCardBtnCTANode(){\n var addCardContainer = createElement('div', {class: 'add-card'});\n var addButtonCTA = createElement('button', {class:'btn-add-card show'}, 'Add New Card...');\n var InputCTAElement = createElement('input', {class:'card-title hide', type:'text', placeholder:'Card Title'});\n\n\n addButtonCTA.addEventListener('click', function(){\n addButtonCTA.classList.remove('show');\n addButtonCTA.classList.add('hide');\n\n InputCTAElement.classList.remove('hide');\n InputCTAElement.classList.add('show');\n InputCTAElement.focus();\n });\n\n\n InputCTAElement.addEventListener('keyup', function(event){\n if (event.key === 'Enter'){\n //If enter is pressed \n var newCard = createCardBoxNode(InputCTAElement.value);\n var positionCard = document.querySelector('.add-card');\n positionCard.before(newCard);\n\n addButtonCTA.classList.remove('hide');\n addButtonCTA.classList.add('show');\n \n InputCTAElement.classList.remove('show');\n InputCTAElement.classList.add('hide');\n InputCTAElement.value = '';\n }\n });\n\n addCardContainer.appendChild(addButtonCTA);\n addCardContainer.appendChild(InputCTAElement);\n\n return addCardContainer;\n\n}", "handleEditCard(cardId, description = '') {}", "function createCard(face, suite, value) {\n var card = {\n // Props\n \"face\": face,\n \"suite\": suite,\n \"value\": value,\n \n // Behaviors\n \"getFace\": function() {\n return this.face;\n },\n \"getSuite\": function() {\n return this.suite;\n },\n \"getValue\": function() {\n return this.value;\n }\n };\n\n // Return the new Card\n return card;\n}", "function MakeCard(number,expdate){\n var newcard = {\n number: number,\n exp: expdate\n };\n return newcard; \n }", "addCard(cardDesc)\n {\n \n this.getCardValue(cardDesc.split('-')[0]);\n const ID=this.cards.length >0 ? this.cards[this.cards.length - 1].id + 1 : 1;\n const card = {\n id: ID,\n cardText: cardDesc,\n cardID:this.name +\"_\" +ID,\n \n }\n this.cards.push(card);\n }", "function createDiv(term, definition) {\n let div = $('<div class=\\'flashcard\\'></div>');\n let pTerm = $('<p></p>');\n $(pTerm).text(term);\n let pDefinition = $('<p class=\\'hidden\\'></p>');\n $(pDefinition).text(definition);\n $(div).append(pTerm, pDefinition);\n $('div.container').append(div);\n}", "function myFunction(){\r\n\r\n //used to create the readioButton\r\n createRadioButton();\r\n\r\n //used to create the card\r\n createCard();\r\n\r\n //used to create the search key word filter\r\n createKeywordFilter();\r\n\r\n \r\n function createCard(){\r\n var courseDetails = {\r\n \"course\":[\r\n {\r\n \"title\":\"Java 1\",\r\n \"instructor_name\":\"James Gosling\",\r\n \"description\" : \"Lets dive deeply in the OOP's\",\r\n \"start_date\":\"2020-08-24\",\r\n \"end_date\":\"2020-08-25\",\r\n \"estimated_workload\":\"4\",\r\n \"category\":\"Computer\"\r\n },\r\n {\r\n \"title\":\"Electrical\",\r\n \"instructor_name\":\"Dr.Sebastin\",\r\n \"description\" : \"This course gives the brief note about the electricals\",\r\n \"start_date\":\"2020-07-27\",\r\n \"end_date\":\"2030-06-15\",\r\n \"estimated_workload\":\"4\",\r\n \"category\":\"Engineering\"\r\n },\r\n {\r\n \"title\":\"Mechanical\",\r\n \"instructor_name\":\"Dr.Maran\",\r\n \"description\" : \"This course gives the note about the Mech machines\",\r\n \"start_date\":\"2020-06-01\",\r\n \"end_date\":\"2020-06-15\",\r\n \"estimated_workload\":\"4\",\r\n \"category\":\"Engineering\"\r\n },\r\n {\r\n \"title\":\"Geometry 4\",\r\n \"instructor_name\":\"Euclid\",\r\n \"description\" : \"Everything is a dimension, every dimension is geometry\",\r\n \"start_date\":\"2020-06-01\",\r\n \"end_date\":\"2020-06-15\",\r\n \"estimated_workload\":\"4\",\r\n \"category\":\"Mathematics\"\r\n },\r\n {\r\n \"title\":\"PUBG\",\r\n \"instructor_name\":\"Prof.Louis\",\r\n \"description\" : \"This deals with the gaming concepts of the PUBG game\",\r\n \"start_date\":\"2020-06-01\",\r\n \"end_date\":\"2020-06-15\",\r\n \"estimated_workload\":\"4\",\r\n \"category\":\"Computer\"\r\n },\r\n {\r\n \"title\":\"Computer 6\",\r\n \"instructor_name\":\"Duckling\",\r\n \"description\" : \"This course gives the brief note about the title\",\r\n \"start_date\":\"2020-06-01\",\r\n \"end_date\":\"2020-06-15\",\r\n \"estimated_workload\":\"4\",\r\n \"category\":\"Computer\"\r\n },\r\n ,\r\n {\r\n \"title\":\"Computer 7\",\r\n \"instructor_name\":\"StoneCold\",\r\n \"description\" : \"This course gives the brief note about the title\",\r\n \"start_date\":\"2020-06-01\",\r\n \"end_date\":\"2020-06-15\",\r\n \"estimated_workload\":\"4\",\r\n \"category\":\"Computer\"\r\n }\r\n ]\r\n }\r\n \r\n courseDetails.course.forEach(loopCards);\r\n }\r\n\r\nfunction loopCards(course,index){\r\n var months = [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"];\r\n var mainDiv = document.getElementById(\"main\")\r\n var Courses = document.createElement(\"p\")\r\n var cardDiv = document.createElement(\"div\")\r\n cardDiv.setAttribute(\"id\",\"cardDiv\")\r\n var cardTitleDiv = document.createElement(\"div\")\r\n var cardDescription = document.createElement(\"div\")\r\n var cardFooter = document.createElement(\"div\")\r\n cardTitleDiv.setAttribute(\"id\",\"titleDiv\")\r\n cardDescription.setAttribute(\"id\",\"bodyDiv\")\r\n cardFooter.setAttribute(\"id\",\"footerDiv\")\r\n var courseTitle = document.createElement(\"h2\")\r\n courseTitle.innerHTML=course.title\r\n var courseAuthor = document.createElement(\"h4\")\r\n courseAuthor.innerHTML=course.instructor_name\r\n var courseDescription = document.createElement(\"p\")\r\n courseDescription.innerHTML=course.description\r\n var registration = document.createElement(\"p\")\r\n registration.setAttribute(\"id\",\"footPara\")\r\n var courseStartDate = document.createElement(\"p\")\r\n courseStartDate.setAttribute(\"id\",\"footPara\")\r\n var courseduration = document.createElement(\"p\")\r\n courseduration.setAttribute(\"id\",\"footPara\")\r\n var begningDate= new Date(course.start_date)\r\n var finishingDate= new Date(course.end_date)\r\n\r\n //logic for the courseType\r\n if(new Date()<begningDate){\r\n registration.innerHTML=\"Pre-registration\"\r\n numberOfOpenCourses++\r\n }\r\n else if(new Date > begningDate && new Date() < finishingDate){\r\n registration.innerHTML=\"On going\"\r\n }\r\n else{\r\n registration.innerHTML=\"Completed\"\r\n }\r\n\r\n //logic to get the number of weeks between the start_date and the end_date\r\n var weeks = (finishingDate.getTime() - begningDate.getTime()) / 1000;\r\n diff =(Math.abs(Math.round(weeks/ (60 * 60 * 24 * 7))));\r\n\r\n var startDate = begningDate.getDate()\r\n var startMonth = begningDate.getMonth()\r\n var endDate = finishingDate.getDate()\r\n var endMonth = finishingDate.getMonth()\r\n courseStartDate.innerHTML=months[startMonth]+\" \"+startDate +\" - \" + months[endMonth]+ \" \" +endDate\r\n courseduration.innerHTML =diff+ \"week course,\" + course.estimated_workload + \" hrs per day\"\r\n\r\n //logic to load the data without any filter\r\n if((loop == false)&&(prev === \"All\") && (keywordValue.length == 0)){\r\n cardTitleDiv.appendChild(courseTitle)\r\n cardTitleDiv.appendChild(courseAuthor)\r\n cardDescription.appendChild(courseDescription)\r\n cardFooter.append(registration)\r\n cardFooter.appendChild(courseStartDate)\r\n cardFooter.appendChild(courseduration)\r\n cardDiv.appendChild(cardTitleDiv)\r\n cardDiv.appendChild(cardDescription)\r\n cardDiv.appendChild(cardFooter)\r\n mainDiv.appendChild(cardDiv)\r\n document.body.appendChild(mainDiv)\r\n // document.getElementById(\"footPara\").style.marginTop =\"0%\"\r\n //document.getElementById(\"footPara\").style.marginBottom =\"0%\"\r\n }\r\n\r\n //logic to load the data with the filter only as radio button\r\n else if((loop == true)&&(keywordValue.length == 0)&&(course.category === prev)){\r\n cardTitleDiv.appendChild(courseTitle)\r\n cardTitleDiv.appendChild(courseAuthor)\r\n cardDescription.appendChild(courseDescription)\r\n cardFooter.append(registration)\r\n cardFooter.appendChild(courseStartDate)\r\n cardFooter.appendChild(courseduration)\r\n cardDiv.appendChild(cardTitleDiv)\r\n cardDiv.appendChild(cardDescription)\r\n cardDiv.appendChild(cardFooter)\r\n mainDiv.appendChild(cardDiv)\r\n document.body.appendChild(mainDiv)\r\n }\r\n\r\n //logic to load the data with filter as keyword\r\n else if((loop == false)&&(keywordValue.length != 0)&&(prev === \"All\")){\r\n if(course.title.includes(keywordValue) | course.instructor_name.includes(keywordValue)){\r\n cardTitleDiv.appendChild(courseTitle)\r\n cardTitleDiv.appendChild(courseAuthor)\r\n cardDescription.appendChild(courseDescription)\r\n cardFooter.append(registration)\r\n cardFooter.appendChild(courseStartDate)\r\n cardFooter.appendChild(courseduration)\r\n cardDiv.appendChild(cardTitleDiv)\r\n cardDiv.appendChild(cardDescription)\r\n cardDiv.appendChild(cardFooter)\r\n mainDiv.appendChild(cardDiv)\r\n document.body.appendChild(mainDiv)\r\n } \r\n }\r\n\r\n //logic to load the data with filter as both radio button and search keyword\r\n else if((loop == true)&&(keywordValue != 0 )&&(course.category === prev)){\r\n if(course.title.includes(keywordValue) | course.instructor_name.includes(keywordValue)){\r\n cardTitleDiv.appendChild(courseTitle)\r\n cardTitleDiv.appendChild(courseAuthor)\r\n cardDescription.appendChild(courseDescription)\r\n cardFooter.append(registration)\r\n cardFooter.appendChild(courseStartDate)\r\n cardFooter.appendChild(courseduration)\r\n cardDiv.appendChild(cardTitleDiv)\r\n cardDiv.appendChild(cardDescription)\r\n cardDiv.appendChild(cardFooter)\r\n mainDiv.appendChild(cardDiv)\r\n document.body.appendChild(mainDiv)\r\n }\r\n }\r\n}\r\n\r\n//function to create the search box\r\nfunction createKeywordFilter(){\r\n var radioList = document.getElementById(\"keyword\")\r\n var keywordFilter = document.createElement(\"form\")\r\n keywordFilter.setAttribute(\"name\",\"keywordForm\")\r\n keywordFilter.setAttribute(\"id\",\"keywordId\")\r\n var keyword = document.createElement(\"input\")\r\n keyword.setAttribute(\"type\",\"input\")\r\n keyword.setAttribute(\"id\",\"inputKeywordId\")\r\n document.body.appendChild(keyword)\r\n keywordFilter.appendChild(keyword)\r\n radioList.appendChild(keywordFilter)\r\n\r\n}\r\n\r\n\r\n//function to create the radio buttons dynamically as per the json\r\n function createRadioButton(){\r\n var courses = [\"All\",\"Computer\",\"Mathematics\",\"Science\"]\r\n var radioList = document.getElementById(\"navRadio\")\r\n var radioDiv = document.createElement(\"form\")\r\n radioDiv.setAttribute(\"name\",\"myForm\")\r\n radioDiv.setAttribute(\"id\",\"radioDiv\")\r\n courses.forEach(loop);\r\n\r\n function loop(item,index){\r\n var radioButton = document.createElement(\"input\")\r\n radioButton.setAttribute(\"type\",\"radio\")\r\n radioButton.setAttribute(\"name\",\"course\")\r\n radioButton.setAttribute(\"value\",item)\r\n if(index === 0){\r\n radioButton.setAttribute(\"checked\",\"checked\")\r\n }\r\n document.body.appendChild(radioButton)\r\n var label = document.createElement(\"label\")\r\n label.innerHTML = item\r\n radioDiv.appendChild(radioButton)\r\n radioDiv.appendChild(label)\r\n radioList.appendChild(radioDiv)\r\n }\r\n\r\n }\r\n\r\n //eventListener whenever the radiobutton is clicked\r\n var rad = document.myForm.course;\r\n var key = document.getElementById(\"inputKeywordId\").value\r\n prev = \"All\"\r\nfor (var i = 0; i < rad.length; i++) {\r\n rad[i].addEventListener('change', function() {\r\n if (this !== prev) {\r\n prev = this.value;\r\n if(prev === \"All\"){\r\n loop = false\r\n }\r\n else{\r\n loop = true\r\n }\r\n \r\n keywordValue = key\r\n var deleDiv = document.getElementById(\"main\")\r\n deleDiv.parentNode.removeChild(deleDiv)\r\n var main = document.createElement(\"div\")\r\n main.setAttribute(\"id\",\"main\")\r\n document.body.appendChild(main)\r\n createCard();\r\n }\r\n });\r\n }\r\n\r\n //evenListener whenever the keyword is typed in the searchbox\r\n var filterKeyword = document.getElementById(\"inputKeywordId\")\r\n filterKeyword.addEventListener('keyup',function(event){\r\n if(!filterKeyword.value.length == 0){\r\n keywordValue = filterKeyword.value\r\n var deleDiv = document.getElementById(\"main\")\r\n deleDiv.parentNode.removeChild(deleDiv)\r\n var main = document.createElement(\"div\")\r\n main.setAttribute(\"id\",\"main\")\r\n document.body.appendChild(main)\r\n createCard();\r\n }else{\r\n keywordValue = \"\"\r\n var deleDiv = document.getElementById(\"main\")\r\n deleDiv.parentNode.removeChild(deleDiv)\r\n var main = document.createElement(\"div\")\r\n main.setAttribute(\"id\",\"main\")\r\n document.body.appendChild(main)\r\n createCard();\r\n }\r\n });\r\n}", "function createCBCCard(patient_id, analysis_type, analysis_data) {\n let card_header = `\n <div class=\"d-flex w-100 justify-content-between\">\n <h6 class=\"mb-1\">\n CBC Analysis - <small>${analysis_data[\"id\"]}</small>\n </h6>\n <small>${analysis_data[\"updated_at\"]}</small>\n </div>\n\n <div class=\"d-flex w-100 justify-content-between\">\n <a href=\"#collapse${analysis_data[\"id\"]}\" data-toggle=\"collapse\" data-parent=\"#accordion\" aria-expanded=\"true\" aria-controls=\"collapse${analysis_data[\"id\"]}\" class=\"flex-column align-items-start btn btn-link btn-sm\">\n Show Data\n </a>\n\n <a href=\"/analyzes/patient_id/${patient_id}/cbc_id/${analysis_data[\"id\"]}\"\n class=\"mb-1 btn btn-link btn-sm\"\n target=\"_blank\"\n data-cbc-options-link=\"print_pdf\">PDF\n </a>\n </div>\n `\n\n let card_block = `\n <div class=\"row\">\n <div class=\"container\">\n <div class=\"row\">\n <div id=\"cbc_action_links\" class=\"col align-self-center text-center\">\n <a href=\"#\"\n data-cbc-edit\n data-cbc-id=\"${analysis_data[\"id\"]}\"\n data-cbc-comment=\"${analysis_data[\"comment\"]}\"\n data-cbc-wcb=\"${analysis_data[\"WCB\"]}\"\n data-cbc-hgb=\"${analysis_data[\"HGB\"]}\"\n data-cbc-mcv=\"${analysis_data[\"MCV\"]}\"\n data-cbc-mch=\"${analysis_data[\"MCH\"]}\"\n data-toggle=\"modal\"\n data-target=\"#edit_cbc_modal\">Edit</a>\n |\n <a href=\"#\"\n data-cbc-delete\n data-cbc-id=\"${analysis_data[\"id\"]}\"\n data-cbc-comment=\"${analysis_data[\"comment\"]}\"\n data-cbc-wcb=\"${analysis_data[\"WCB\"]}\"\n data-cbc-hgb=\"${analysis_data[\"HGB\"]}\"\n data-cbc-mcv=\"${analysis_data[\"MCV\"]}\"\n data-cbc-mch=\"${analysis_data[\"MCH\"]}\"\n data-toggle=\"modal\"\n data-target=\"#confirm_delete_cbc${analysis_data[\"id\"]}_modal\">Delete</a>\n </div>\n </div>\n </div>\n\n <div class=\"col-12\">\n <hr>\n <div class=\"mb-1\">\n <h6 data-cbc-doctor class=\"text-muted\">Confirmed by Dr.Zizo.</h6>\n <p>\n <span data-cbc-comment>${analysis_data[\"comment\"]}</span>\n </p>\n </div>\n\n <table id=\"table-${analysis_data[\"id\"]}\" class=\"table table-sm\">\n <thead>\n <tr>\n <th>Item</th>\n <th>Value</th>\n <th>Normal</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th scope=\"row\">WCB</th>\n <!-- \"WCB\": \"2.19\" -->\n <td data-cbc-wcb=${analysis_data[\"WCB\"]}>${analysis_data[\"WCB\"]}</td>\n <td>3.70 - 10.10</td>\n </tr>\n <tr>\n <th scope=\"row\">HGB</th>\n <!-- \"HGB\": \"12.9\" -->\n <td data-cbc-hgb=${analysis_data[\"HGB\"]}>${analysis_data[\"HGB\"]}</td>\n <td>12.9 - 15.9</td>\n </tr>\n <tr>\n <th scope=\"row\">MCV</th>\n <!-- \"MCV\": \"82.2\" -->\n <td data-cbc-mcv=${analysis_data[\"MCV\"]}>${analysis_data[\"MCV\"]}</td>\n <td>81.1 - 96.0</td>\n </tr>\n <tr>\n <th scope=\"row\">MCH</th>\n <!-- \"MCH\": \"27.3\" -->\n <td data-cbc-mch=${analysis_data[\"MCH\"]}>${analysis_data[\"MCH\"]}</td>\n <td>27.0 - 31.2</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n `\n\n let card = createCard(card_header, `heading${analysis_data['id']}`, card_block, `collapse${analysis_data[\"id\"]}`)\n\n // let confirm_delete_cbc_modal = createModalToConfirmCBCDelete(patient_id, analysis_type, analysis_data[\"id\"])\n // .appendTo(card)\n\n return card\n }", "function constructCard() {\n\t// invokes to clear page before setting cards\n\tclearBooks();\n\n\t// relists all the books in myLibrary\n\tmyLibrary.forEach((book, index) => {\n\t\tconst bookCard = document.createElement('div');\n\t\tconst titleElem = document.createElement('h1');\n\t\tconst authorElem = document.createElement('h2');\n\t\tconst pagesElem = document.createElement('h3');\n\t\tconst buttonDiv = document.createElement('div');\n\t\tconst readButton = document.createElement('button');\n\t\tconst deleteButton = document.createElement('button');\n\n\t\t// had to break everything down to allow for more flexibility over plain string-literal expressions that turned out harder to deal with\n\t\tbookCard.classList.add('book');\n\t\tbookCard.dataset.index = index;\n\t\ttitleElem.innerText = book.title;\n\t\tauthorElem.innerText = `by ${book.author}`;\n\t\tpagesElem.innerText = `Pages: ${book.pages}`;\n\t\tbuttonDiv.classList.add('buttons');\n\t\treadButton.innerText = 'Read';\n\t\treadButton.classList.add('readButton');\n\t\treadButton.addEventListener('click', toggleRead);\n\t\tdeleteButton.innerText = 'Delete';\n\t\tdeleteButton.classList.add('deleteButton');\n\t\tdeleteButton.addEventListener('click', deleteCard);\n\n\t\tbookCard.appendChild(titleElem);\n\t\tbookCard.appendChild(authorElem);\n\t\tbookCard.appendChild(pagesElem);\n\t\tbookCard.appendChild(buttonDiv);\n\t\tbuttonDiv.appendChild(readButton);\n\t\tbuttonDiv.appendChild(deleteButton);\n\t\tcontainer.appendChild(bookCard);\n\n\t\t// if/else reading from the array object to set read/not-read button\n\t\tif (book.read === true) {\n\t\t\treadButton.classList.add('read');\n\t\t\treadButton.innerText = 'Read';\n\t\t} else {\n\t\t\treadButton.classList.add('notRead');\n\t\t\treadButton.innerText = 'Not Read';\n\t\t}\n\t});\n\t// localstorage saved here as this constantly updates the library\n\tlocalStorage.setItem('books', JSON.stringify(myLibrary));\n}", "function createAddresCardFromObject(object) {\n\n //Set variables\n let indexCardClass = \"indexKaart\";\n let strFirstLtr = object.lastname.charAt(0);\n \n //Check for class values and set accordingly\n object.gender == \"man\" ? indexCardClass += \" man\": indexCardClass += \" vrouw\";\n if (strFirstLtr.match(/[a-i]/i)){indexCardClass += \" aToti\"};\n if (strFirstLtr.match(/[j-r]/i)){indexCardClass += \" jTotr\"};\n if (strFirstLtr.match(/[s-z]/i)){indexCardClass += \" sTotz\"};\n \n //Create new div and insert into DOM\n $(\"#cards\").append('<div id=\"' + object.id + '\" class=\"' + indexCardClass + '\"><div class=\"persInfo\"><p>ID: '+ object.id + '</br>Naam: ' + object.firstname\n + ' ' + object.lastname + '</br>Woonplaats: ' + object.city + ' </br>Geslacht: ' + object.gender + '</p></div></div>');\n \n }", "_create(props) {\n super._create(props);\n\n this.set({\n schema: {\n component: 'Form',\n fields: [\n {\n name: 'text',\n component: 'TextField',\n label: 'Text',\n multiline: true,\n docLevel: 'basic',\n help: 'Any markdown. See markdownguide.org'\n }\n ]\n }\n });\n }", "function createCard(title, text, link, image = \"\", position = \"left\") {\n\tlet card = new Card(title, text, link, image, position);\n\tcard.add();\n\treturn card;\n}", "function createRadLibFormDiv(radLib){\n \n let content = radLib.content\n //clear base div display\n showDiv.innerHTML = \"\"\n //set array of content for reference in future functions\n let arrayOfContent = splitByPipe(content);\n //Show title of radLib and basic information on data entry in centered text\n let header = document.createElement('h1')\n\n header.setAttribute('data-id', radLib.id);\n\n header.innerText = radLib.name\n header.style.textAlign = \"center\"\n header.style.fontSize = \"50px\"\n header.style.fontFamily = \"marker felt\"\n\n showDiv.appendChild(header)\n let instructions = document.createElement('h4')\n instructions.style.textAlign = \"center\"\n // instructions.innerHTML = \"Fill in an entry for each part of speech!<br><br>Remember:<br>A noun is a person, place or thing (ostrich, broken shoelace, the Louvre).<br>A verb is an action (cry, juggle, yodel).<br>An adjective describes a noun (fluffy, poisonous, irritating).<br>An adverb modifies or describes a verb or adjective (gently, creepily, joyously).\"\n showDiv.appendChild(instructions)\n //create a form and centered text\n const form = document.createElement('form')\n form.style.textAlign = \"center\"\n //add form to div\n showDiv.appendChild(form)\n //break blanks string into array by entry\n let arrayOfBlanks = splitByPipe(radLib.word_blank)\n //for each blank in the array, create labels and input fields. index value is used as an id for input form\n for (let i = 0; i < arrayOfBlanks.length; i++) {\n const label = document.createElement('label')\n const input = document.createElement('input')\n input.setAttribute('id', ('input ' + (i + 1)))\n label.innerText = arrayOfBlanks[i] + \":\"\n form.appendChild(label)\n form.appendChild(input)\n form.innerHTML += \"<br>\";\n }\n //adding page break for small space\n form.innerHTML += \"<br>\"\n //setting data attribute for how many entries the form has for reference\n form.setAttribute('data-entry-count', arrayOfBlanks.length)\n //create submit button and label it\n const submit = document.createElement('button')\n submit.innerHTML = \"Submit\"\n submit.style.borderRadius = \"10px\"\n submit.style.color = \"#FFFFFF\"\n submit.style.backgroundColor = \"#3298dc\"\n //event listener to form processessing function, rendering completed radLib in showDiv\n submit.addEventListener(\"click\", () => {\n submitRadLibEntry();\n })\n \n form.appendChild(submit)\n //button function on form, collects answers, combines them with content into a string, and renders div to show string\n function submitRadLibEntry(){\n event.preventDefault()\n //function collectAnswers collects answers in an array and returns array\n let describerArray = collectAnswers()\n //combine answer array and content array into one block of text and returns string\n let storyBlock = combineAnswersAndContent(describerArray, arrayOfContent)\n //set showDiv to and h1 tag of title and string of completed radLib\n showDiv.innerHTML = ''\n\n // showDiv.innerHTML = `<h1>${radLib.name}</h1>` + \"<br>\" + storyBlock\n \n const newDiv = document.createElement('div');\n showDiv.appendChild(newDiv);\n \n const saveBtn = document.createElement('button');\n saveBtn.id = radLib.id;\n saveBtn.innerText = \"Save Your Rad Lib\";\n saveBtn.style.borderRadius = \"10px\"\n saveBtn.style.color = \"#FFFFFF\"\n saveBtn.style.backgroundColor = \"#3298dc\" \n\n\n saveBtn.addEventListener('click', postCompletedRadLib)\n \n // showDiv.innerHTML = `<h1>${header.innerText}</h1>` + \"<br>\" + storyBlock\n // showDiv.innerHTML = ''\n let header = document.createElement('h1')\n \n header.setAttribute('data-id', radLib.id);\n \n header.innerText = radLib.name\n header.style.textAlign = \"center\"\n header.style.fontSize = \"50px\"\n header.style.fontFamily = \"marker felt\"\n \n showDiv.appendChild(header)\n showDiv.innerHTML += `${storyBlock} <br><br>`\n showDiv.appendChild(saveBtn);\n // showDiv.innerHTML = header + \"<br>\" + storyBlock\n\n\n // RATING CODE THAT SHOULD BE BROKEN INTO FUNCTIONS\n // const rateForm = document.createElement(\"form\")\n // const formLabel = document.createElement('label')\n // const formInput = document.createElement('input')\n // formInput.setAttribute(\"id\", \"rating-input\")\n\n // rateForm.style.textAlign = \"left\"\n // showDiv.appendChild(rateForm)\n // rateForm.setAttribute('data-id', radLib.id);\n \n // formLabel.innerHTML = \"<br><br><br><strong>Rate this Rad Lib (1-5)</strong><br>\"\n // rateForm.appendChild(formLabel)\n // rateForm.appendChild(formInput)\n // rateForm.innerHTML += \"<br><br>\";\n\n // const submitBtn = document.createElement('button')\n // submitBtn.innerHTML = \"Submit Rating\"\n // submitBtn.style.borderRadius = \"10px\"\n // submitBtn.style.color = \"#FFFFFF\"\n // submitBtn.style.backgroundColor = \"#3298dc\" \n // rateForm.appendChild(submitBtn)\n \n starRating()\n\n // submitBtn.addEventListener(\"click\", event => {\n // event.preventDefault()\n\n // let inputValue = document.getElementById(\"rating-input\").value\n // rating += parseInt(inputValue)\n // console.log(rating)\n // }) \n\n function showRating(rating) {\n\n }\n\n }\n // END OF RATING CODE THAT SHOULD BE BROKEN INTO FUNCTIONS\n \n}", "function newForm(){\r\n let createNew = document.querySelector(\"form\")\r\ncreateNew.innerHTML = `\r\n<input type=\"text\" id=\"userName\" placeholder =\"Enter User Name\" >\r\n<input type=\"text\" id=\"picture\" placeholder =\"Enter Photo URL\"><br>\r\n<input class= \"donebtn\" type=\"button\" value=\"DONE\" onclick=\"adder()\">\r\n<input class= \"cancelbtn\" type=\"button\" value=\"CANCEL\" onclick=\"adder()\"><br>\r\n`\r\n}", "function openConfirmCreate() {\n // Get our data\n var name = document.getElementById(\"createDeckName\").value\n var mode = document.getElementById(\"createIssueModeSelect\").value\n var decimals = document.getElementById(\"createDeckDecimals\").value\n var asd = document.getElementById(\"createASD\").value\n\n\n // Fill the confirmation forms\n // Fill deck name\n document.getElementById(\"deckNameConfirmCreate\").innerHTML = name\n // Fill mode\n document.getElementById(\"issueModeConfirmCreate\").innerHTML = mode\n // Fill amount\n document.getElementById(\"decimalPlaceConfirmCreate\").innerHTML = decimals\n // Fill ASD\n document.getElementById(\"aSDConfirmCreate\").innerHTML = asd\n\n // Open the confirmation form\n document.getElementById(\"confirmTransactionCreate\").style.display = \"flex\"\n}", "function makeACard(img, name, id, entry){\n //get some page elements\n let card = document.createElement(\"div\");\n //give it a class of pokemon-card\n card.classList.add(\"pokemon-card\");\n displayCards.prepend(card);\n //picture\n let pokePicture = document.createElement(\"div\");\n pokePicture.classList.add(\"pokemon-card__img\");\n //api will add img here\n pokePicture.innerHTML = `<img class=\"pokemon-card__img__picture\" src=\"${img}\">`;\n\n card.appendChild(pokePicture);\n\n //name\n let pokeName = document.createElement(\"div\");\n pokeName.classList.add(\"pokemon-card__name\");\n card.appendChild(pokeName);\n pokeName.innerHTML = `<p class=\"pokemon-card__name__text\">${name}</p>`;\n //pokedex #\n let pokeID = document.createElement(\"div\");\n pokeID.classList.add(\"pokemon-card__id\");\n card.appendChild(pokeID);\n pokeID.innerHTML = `<p class=\"pokemon-card__id__text\">Pokedex #:<br>${id}</p>`;\n\n //entry\n let pokeEntry = document.createElement(\"div\");\n pokeEntry.classList.add(\"pokemon-card__entry\");\n card.appendChild(pokeEntry);\n pokeEntry.innerHTML = `<p class=\"pokemon-card__entry__text\">${entry}</p>`;\n\n}", "function buildRecipeCard(recipe) {\n var recipeTitle = recipe.title;\n var recipeImage = recipeURL(recipe.id);\n var recipeCard = $(\"<div class=\\\"recipe-card\\\" id=\\\"recipe-card-\" + recipe.id + \"\\\"></div>\");\n recipeCard.append(\"<div class =\\\"recipe-card-thumbnail\\\"><img src=\\\"\" + recipeImage + \"\\\"><h2 class=\\\"recipe-name\\\"><a href=\\\"#\\\">\" + recipeTitle + \"</a></h2><span class=\\\"recipe-source\\\"></span><div class=\\\"recipe-card-footer-bar\\\"><button href=\\\"#\\\" class=\\\"product-card-color-option\\\"><i data-id=\\\"\" + recipe.id + \"\\\" class=\\\"fas DV-show-details fa-info-circle\\\"></i></button><button href=\\\"#\\\" class=\\\"product-card-color-option\\\"><i data-title=\\\"\" + recipe.title + \"\\\" data-id=\\\"\" + recipe.id + \"\\\" class=\\\"fas add-recipe fa-plus\\\"></i></button></div></div>\");\n $(\"#recipe-display\").append($(recipeCard));\n}", "function buildBoxHTML(card) {\r\n\tlet cardImg = card.imageUrl;\r\n\tlet boxHTML = '<h2>' + card.name + '</h2>';\r\n\tboxHTML += '<img src=\"' + cardImg + '\" alt=\"\">';\r\n\tboxHTML += '<p>' + card.type + '</p>';\r\n\tboxHTML += '<p>Rarity: ' + card.rarity + '</p>';\r\n\tcardBoxContainer.innerHTML = boxHTML;\r\n}", "function addCard() {\n let player = {};\n player.id = data.players.length + 1;\n player.name = document.getElementById(\"playername\").value;\n player.school = document.getElementById(\"playerschool\").value;\n player.points = document.getElementById(\"ppg\").value;\n player.assists = document.getElementById(\"apg\").value;\n player.rebounds = document.getElementById(\"rpg\").value;\n player.note = document.getElementById(\"playernote\").value;\n data.players.push(player);\n $('.gridView').append(createCard(player));\n }", "function Todocard(props) {\n let texteditvalue = '';\n\n const editcardname = name => {\n props.edit(name.target.value, texteditvalue);\n };\n const deletecard = id => {\n props.delete(id.target.value);\n };\n return (\n <>\n <div className=\"card\" style={{ width: '18rem' }}>\n <img src={props.img} className=\"card-img-top\" alt=\"...\" />\n <div className=\"card-body\">\n <h5 className=\"card-title\">\n {props.input ? (\n <input\n type=\"text\"\n className=\"w-50\"\n onChange={e => (texteditvalue = e.target.value)}\n />\n ) : (\n props.name\n )}\n </h5>\n <p className=\"card-text\">price:{props.price}</p>\n </div>\n <div className=\"card-footer bg-secondary justify-content-between d-flex\">\n {props.input ? (\n <button\n type=\"button\"\n className=\"btn btn-success btn-sm\"\n value={props.name}\n onClick={editcardname}\n >\n Save\n </button>\n ) : (\n <button\n type=\"button\"\n className=\"btn btn-warning btn-sm\"\n value={props.name}\n onClick={editcardname}\n >\n Edit\n </button>\n )}\n <button\n type=\"button\"\n className=\"btn btn-danger btn-sm\"\n value={props.id}\n onClick={deletecard}\n >\n Delete\n </button>\n </div>\n </div>\n </>\n );\n}", "function buildCard(quote) {\n //creating the HTML elements\n let li = document.createElement('li')\n let blockquote = document.createElement('blockquote')\n let p = document.createElement('p')\n let footer = document.createElement('footer')\n let br = document.createElement('br')\n\n //get the data for the text to populate the card\n let {author, id, quote:text} = quote\n\n //adding tags to the elements\n li.className = 'quote-card'\n li.id = `li-${id}`\n blockquote.className = 'blockquote'\n blockquote.id = `block-${id}`\n p.className = 'mb-0'\n footer.className = 'blockquote-footer'\n\n //add text data to the card elements\n p.textContent = text\n footer.textContent = author\n\n //building the card\n blockquote.append(p, footer, br)\n li.append(blockquote)\n quoteList.append(li)\n likeButton(quote)\n deleteButton(quote)\n}", "function viewRecipeCardMaker(text){\r\n if(view_recipe_card){\r\n var card = document.createElement('div');\r\n card.className = 'big-card';\r\n card.innerHTML = '<div class=\"big-image\" style=\"background-image: url('+text.img+');\"></div>' +\r\n '<div class=\"name\">' +\r\n '<h1>'+text.name+'</h1>' +\r\n '</div>' +\r\n '<div class=\"view-other\">' +\r\n '<p><span>Description: </span><br>'+text.description+'</p>' +\r\n '<p><span>Ingredients: </span><br>'+text.ingredients+'</p>' +\r\n '<p><span>Instructions: </span><br>'+text.instructions+'</p>' +\r\n '</div>';\r\n view_recipe_card.appendChild(card);\r\n } \r\n}", "function makeCard() {\n\n\tlet newLine = \"\\r\\n\"; //make blank line\n\n// create the div\n\tconst div = document.createElement(\"div\");\n\tdiv.className = \"clPanel\";\n\tdiv.id = \"card\"\n\t// + i;\n\tlet card = div.id;\n\tconsole.log(div.id);\n\tconsole.log(card);\n\tdiv.textContent = \"Card \" + i +newLine +newLine;\n\n\t//create a add before button\n\n\tlet btnAddBefore = document.createElement(\"button\");\n\tbtnAddBefore.className =\"buttons\";\n\tbtnAddBefore.textContent =\"Add before\";\n\tbtnAddBefore.addEventListener(\"click\", onAddBefore);\n\n\t//add a button:Add before\n\tdiv.appendChild(btnAddBefore);\n\n\t//create a add after button\n\tlet btnAddAfter = document.createElement(\"button\");\n\tbtnAddAfter.className =\"buttons\";\n\tbtnAddAfter.textContent = \"Add after\";\n\tbtnAddAfter.addEventListener(\"click\", onAddAfter);\n\n\t//add a button:Add after\n\tdiv.appendChild(btnAddAfter);\n\n\t//create a another line break\n\t\n\n\t//create a delete button\n\tlet btnDelete = document.createElement(\"button\");\n\tbtnDelete.className =\"buttons\";\n\tbtnDelete.textContent = \"Delete\";\n\tbtnDelete.addEventListener(\"click\",onDelete);\n\n\t//add a button: delete\n\tdiv.appendChild(btnDelete);\n\n\n\treturn div;\n}", "_saveVocab() {\n let deutsch = document.querySelector(\".deutsch\").value;\n let englisch = document.querySelector(\".englisch\").value;\n let notiz = document.querySelector(\".notiz\").value;\n\n if (deutsch != \"\" || englisch != \"\"){\n\n // zurück zu input!!\n\n this._vokabeln.saveNew({\n deutsch: deutsch,\n englisch: englisch,\n notiz: notiz,\n //format: html,\n });\n\n // aus JS auf andere Seite leiten\n this._app.showVocabularyOverview();\n this._app.navigate(\"/\");\n\n } else {\n alert(\"Bitte alle Angaben ausfüllen!♥\");\n }\n }", "function CreateCard ({formData,setFormData,handleChange}) {\n\n const parameters = useParams();\n const deckId = parameters.deckId;\n const [currentDeck, setCurrentDeck] = useState(\"Not Fetched Yet\");\n\n useEffect(() => {\n async function getDeck () {\n const fetchedDeck = await readDeck(deckId);\n setCurrentDeck(fetchedDeck);\n }\n getDeck();\n },[deckId])\n\n const handleSave = (event) => {\n event.preventDefault();\n createCard(deckId,formData);\n setFormData({})\n }\n\n if (currentDeck === \"Not Fetched Yet\") {\n return \"Content is loading...\"\n }\n\n return (\n <div className = \"container w-75\">\n <div>\n <nav aria-label = \"breadcrumb\">\n <ol className = \"breadcrumb\">\n\n <li className = \"breadcrumb-item active\"> \n <Link to = \"/\"> Home </Link> \n </li>\n <li className = \"breadcrumb-item active\"> \n <Link to = {`/decks/${deckId}`}> {currentDeck.name} </Link> \n </li>\n <li className = \"breadcrumb-item\"> Add Card </li>\n\n </ol>\n </nav>\n </div>\n <h1>{currentDeck.name}: Add Card</h1>\n <CardForm deckId={deckId}\n formData={formData} \n handleChange={handleChange} \n handleSave={handleSave}/>\n </div>\n )\n}", "function viewRecipeCardMaker(text){\n if(ver_tarjeta_receta){\n let card = document.createElement('div');\n card.className = 'big-card';\n card.innerHTML = '<div class=\"big-image\" style=\"background-image: url('+text.img+');\"></div>' +\n '<div class=\"name\">' +\n '<h1>'+text.name+'</h1>' +\n '</div>' +\n '<div class=\"view-other\">' +\n '<p><span>Description: </span><br>'+text.description+'</p>' +\n '<p><span>Ingredients: </span><br>'+text.ingredients+'</p>' +\n '<p><span>Instructions: </span><br>'+text.instructions+'</p>' +\n '</div>';\n ver_tarjeta_receta.appendChild(card);\n } \n}", "function createCard() {\n const card = document.createElement('div')\n\n card.classList.add('card')\n if (idx === 0) {\n card.classList.add('active')\n }\n\n card.innerHTML = `\n <div class=\"inner-card\">\n <div class=\"inner-card-front\">\n <p>\n ${data.question}\n </p>\n </div>\n <div class=\"inner-card-back\">\n <p>\n ${data.answer}\n </p>\n </div>\n </div>`\n\n card.addEventListener('click', () => card.classList.toggle('show-answer'))\n\n // Add to DOM cards\n cardsEl.push(card)\n cardsContainer.appendChild(card)\n updateCurrentText()\n}", "create() {\n this.id = 0;\n this.familyName = null;\n this.givenNames = null;\n this.dateOfBirth = null;\n\n this.validator.resetForm();\n $(\"#form-section-legend\").html(\"Create\");\n this.sectionSwitcher.swap('form-section');\n }", "function addWord(req, res) {\n const data = req.body;\n\n if (!data || !data.englishWord || !data.translation) {\n res.status(400).send('Bad request.');\n return;\n }\n\n Vocabulary.create(data, function (err, newWord) {\n if (err) {\n res.status(500).json({\n status: 'An error occurred in adding new word.',\n data: err\n });\n } else {\n res.status(201).json({\n status: 'OK',\n data: newWord\n });\n }\n });\n}", "function make_dcard(card) {\n\n\tvar new_dcard = new Object();\n\tnew_dcard.cardName = card.getAttribute('cardName');\n\tnew_dcard.count = 1;\n\tnew_dcard.rarity = card.getAttribute('rarity');\n\tnew_dcard.cardId = card.getAttribute('cardId');\n\tnew_dcard.imgurl = card.getAttribute('imgurl');\n\tnew_dcard.cardSet = card.getAttribute('cardSet');\n\tnew_dcard.mana = card.getAttribute('cost');\n\n\treturn new_dcard;\n}", "function createCard(doc, user) {\n document.getElementById(\"help\").innerHTML = \"These people are in your area and need some help!\";\n document.getElementById(\"moreInfo\").innerHTML = \"Click on the cards to see more info.\";\n let col = document.createElement('div');\n col.className = \"col-xs-6 col-sm-6 col-md-4 col-lg-3\";\n let card = document.createElement('div');\n card.className = \"card text-white border-primary bg-info mb-3\";\n card.style.width = \"18rem\";\n card.style.margin = \"auto\";\n card.style.marginTop = \"10px\";\n let header = document.createElement('div');\n header.className = \"card-header\";\n let headerName = document.createTextNode(doc.data().name);\n header.appendChild(headerName);\n let cardBody = document.createElement('div');\n cardBody.className = \"card-body\";\n cardBody.style.height = \"10rem\";\n cardBody.style.overflow = \"hidden\";\n let title = document.createElement('h5');\n title.className = \"card-title\";\n let textName = document.createTextNode(\"A little about this person!\");\n title.appendChild(textName);\n let cardText = document.createElement('p');\n cardText.className = \"card-text\";\n let description = document.createTextNode(doc.data().description);\n cardText.appendChild(description);\n let viewHelpee = document.createElement('a');\n viewHelpee.className = \"align-self-end btn stretched-link\";\n viewHelpee.setAttribute(\"onclick\", \"viewInfo(\" + JSON.stringify(doc.id) + \",\" + JSON.stringify(user.uid) + \")\");\n viewHelpee.setAttribute(\"href\", \"#popup\");\n\n cardBody.appendChild(title);\n cardBody.appendChild(description);\n cardBody.appendChild(viewHelpee);\n card.appendChild(header);\n card.appendChild(cardBody);\n col.appendChild(card);\n document.getElementsByClassName(\"row\")[0].appendChild(col);\n}", "function caseCard(text, status, id, subject, blurb, labels, ts, customer, company, customerGrav, assigned) {\n if (company) {\n company = \"(\"+company+\")\"\n }\n if (!assigned) {\n assigned = \"Nobody\"\n }\n let attachement = {\n \"pretext\": status + \" case from \" + customer + \" \" + company,\n \"fallback\": status + \" case from \" + customer + \" \" + company + \"- #\" + id + \": \"+ subject,\n \"author_icon\": customerGrav,\n \"author_name\": customer + \" \" + company,\n \"title\": \"#\" + id + \": \"+ subject,\n \"title_link\": \"https://help.disqus.com/agent/case/\"+id,\n \"text\": blurb,\n \"fields\": [\n {\n \"title\": \"Assigned\",\n \"value\": assigned,\n \"short\": true\n },\n {\n \"title\": \"Labels\",\n \"value\": labels,\n \"short\": true\n }\n ],\n \"color\": \"#7CD197\",\n \"ts\": ts\n }\n return attachement\n }" ]
[ "0.6642591", "0.6618146", "0.6561909", "0.63169515", "0.6219841", "0.620289", "0.6175802", "0.60431105", "0.5962907", "0.59616053", "0.59004194", "0.5881875", "0.58643514", "0.58464986", "0.58189225", "0.5814129", "0.5793754", "0.57919675", "0.5759717", "0.575578", "0.5753767", "0.57290655", "0.57280797", "0.57275933", "0.57111806", "0.57105184", "0.57004327", "0.56831557", "0.5664646", "0.5658119", "0.5652015", "0.56416845", "0.563649", "0.56304026", "0.5626113", "0.5618254", "0.5601713", "0.5581203", "0.5568918", "0.55626667", "0.5561656", "0.55583245", "0.5557732", "0.55416214", "0.55231446", "0.55163884", "0.54932696", "0.54930276", "0.5492754", "0.5492183", "0.5472558", "0.54693204", "0.54681146", "0.54657036", "0.54644984", "0.54521626", "0.5450201", "0.54484373", "0.54476947", "0.544732", "0.54419225", "0.5441013", "0.5431531", "0.5425798", "0.5421197", "0.5410432", "0.54093456", "0.5408698", "0.54024637", "0.5396884", "0.5395162", "0.53861654", "0.53837097", "0.5376212", "0.53736675", "0.5359606", "0.53582746", "0.535553", "0.5352812", "0.53520566", "0.5350657", "0.53498185", "0.5345586", "0.5342129", "0.5340534", "0.532193", "0.53215533", "0.53206235", "0.53193116", "0.53190863", "0.53188837", "0.53155965", "0.5314882", "0.5313293", "0.5311216", "0.5311027", "0.5307183", "0.5302022", "0.52978975", "0.52954894" ]
0.6704491
0
Clear the response. Resets some values back to their defaults. Call this between tests if you are going to reuse a single Response object for multiple intersection tests (recommented as it will avoid allcating extra memory).
clear() { this.overlap = Number.MAX_VALUE; this.aInB = true; this.bInA = true; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearPreviousResponses() {\n\tlastResponse = {\n\t\t\"actions\" : []\n\t};\n}", "function clearResponse(clear){\r\n while(response.firstChild){\r\n response.removeChild(response.firstChild);\r\n }\r\n playerScore = 0;\r\n computerScore = 0;\r\n}", "reset() {\n this.classList.add('cloak');\n this.responseEnabled = false;\n\n // clear data\n this.responseData = {\n slider: null,\n labels: \"\",\n answer: \"\",\n answerSide: \"\",\n confidence: \"\",\n timeEstimate: null,\n\n complete: false\n };\n\n // reset timeline styling\n this.querySelectorAll(\".response-column-inner\").forEach(e => {\n e.style.height = 0;\n });\n\n this.querySelectorAll(\".response-marker.feedback\").forEach(\n e => e.remove()\n );\n this.querySelectorAll(\".ghost\").forEach(e => e.remove());\n }", "reset() {\n this.classList.add('cloak');\n\n // clear data\n this.responseData = {\n estimateLeft: null,\n markerWidth: null,\n estimateLabelLeft: null,\n estimateLabelRight: null,\n timeEstimate: null,\n\n complete: false\n };\n\n // reset timeline styling\n this.querySelector(\".response-timeline\").classList.add(\"cloak\");\n this.querySelector(\".response-marker\").style.top = \"\";\n this.querySelector(\".response-marker\").style.opacity = \"1\";\n\n this.resetTimeline();\n this.resetMarkerPool();\n }", "function clearResponse(){\n $('#response').html('');\n}", "clear() {\n this._status = null;\n this._code = null;\n this._messageBody = null;\n this._messageHeader = null;\n }", "clear() {\n this.requests = [];\n this.decoders = [];\n this.accountNextNonces = {};\n this.accountUsedNonces = {};\n }", "function resetReqRes() {\n document.getElementById(\"httpRequest\").innerHTML = null;\n document.getElementById(\"httpResponse\").innerHTML = null;\n}", "function reset() {\n resSpy.status.reset();\n unauthenticatedHandler.reset();\n unauthorizedHandler.reset();\n routeHandler.reset();\n firewallAdapter.reset();\n }", "function Response () {\n\t\tthis.a = null;\n\t\tthis.b = null;\n\t\tthis.overlapN = new Vector();\n\t\tthis.overlapV = new Vector();\n\t\tthis.clear();\n\t}", "function StubResponse () {\n Emitter.call(this)\n this._bodySent = false\n this._headers = {}\n this._body = null\n this._status = null\n this.headerSent = false\n}", "clear() {\n this._processData = this._processHeaderData;\n this._processLine = this._processDelimiterLine;\n\n this._headers = [];\n this._headerMap = {};\n this._expected = null;\n\n this._lineReader.clear();\n }", "reset() {\n if (this._queryStartKey) {\n this._queryStartKey = undefined;\n }\n if (this._querySkip) {\n this._querySkip = undefined;\n }\n if (this.isSearch) {\n this.isSearch = false;\n }\n if (this.querying) {\n this._querying = false;\n }\n if (this.requests) {\n this.requests = undefined;\n }\n }", "clearServerResponse() {\n this.setState({\n serverResponse: {\n event: \"\",\n status: \"\"\n }\n });\n }", "function Response() {\n this['a'] = null;\n this['b'] = null;\n this['overlapN'] = new Vector();\n this['overlapV'] = new Vector();\n this.clear();\n }", "function Response() {\n this['a'] = null;\n this['b'] = null;\n this['overlapN'] = new Vector();\n this['overlapV'] = new Vector();\n this.clear();\n }", "function Response() {\n this['a'] = null;\n this['b'] = null;\n this['overlapN'] = new Vector();\n this['overlapV'] = new Vector();\n this.clear();\n }", "reset()\n {\n Object.assign(this,this.__.originalData);\n this.errors.clear();\n }", "function resetAllDivs() {\n\t$('#response').html('');\n\t$('#info').html('');\n\t$('#err').html('');\n}", "reset() {\n this._query = '';\n this._note = '';\n this._expiresText = '';\n this._errMsg = '';\n this._render();\n }", "clearResponses() {\n $( this.inputSelectors.inputTextareaId ).text('').val('');\n $( this.inputSelectors.nameFieldId ).val('');\n $( this.inputSelectors.emailFieldId ).val('');\n }", "clear() {\n this._selectedFilesMetaData = [];\n this.uploadResponse = [];\n this.modelValue = [];\n }", "reset() {\n this.cache = null\n this.counter = 0\n this.results = []\n }", "reset() {\n this.api.clear();\n this.api = null;\n this.fieldDescriptor.clear();\n this.resetForm();\n }", "reset () {\n this.displayPlot(null)\n this.displayStatistics(null, null)\n this.displayLog(null)\n this.displayError(null)\n this.results = new Map()\n }", "function reset() {\n oConfig = {};\n oConfig = jQuery.extend({}, {}, oConfigDefaults);\n aLastResults = [];\n }", "reset() {\n this._results = [];\n this._resultsCache = {};\n this._isSearching = false;\n this.updateQuery(\"\");\n }", "reset() {\n this.resetFields();\n this.resetStatus();\n }", "reset() {\n this.data = {};\n this.type = null;\n }", "function resetData() {\n\t\t\tconsole.log(\"resetData()\");\n\n\t\t\tvm.results = [];\n\t\t\tvm.selectedIndex = -1;\n\t\t\tvm.total_count = 0;\n\n\t\t\t// rebuild empty apiDomain submission object, else bindings fail\n\t\t\tvm.apiDomain = {};\n\t\t\tvm.apiDomain.logicalDBKey = \"\";\t\n\t\t}", "function reset() {\n quizMetrics.changeState(\"results\", false);\n quizMetrics.numCorrect = 0;\n \n for(var i = 0; i < dataSvc.quizQuestions.length; i++) {\n var data = dataSvc.quizQuestions[i];\n \n data.selected = null;\n data.correct = null;\n }\n }", "function resetReqAndErr() {\n setRequest({\n streetAddress: '',\n city: '',\n state: '',\n zipcode: '',\n neighborhood: '',\n description: '',\n category: '',\n startDate: '',\n endDate: '',\n startTime: '',\n carRequired: false,\n laborRequired: false,\n duration: null,\n taskId: null,\n addressId: null,\n userId: null,\n });\n setValidationErrors({});\n }", "function reset() {\n\n factory.error = null;\n factory.success = null;\n\n }", "function clearAllCalcData() {\n result = {}; // clear result object\n result.mimpactScore = 0;\n result.mexploitScore = 0;\n result.environScore = 0;\n result.debugStr = \"\"; // lines of text used to hold scores for debugging\n }", "function resetData() {\n\t\t\tconsole.log(\"resetData()\");\n\n\t\t\tvm.results = [];\n\t\t\tvm.selectedIndex = -1;\n\t\t\tvm.selectedMIIndex = 0;\n\t\t\tvm.selectedECIndex = 0;\n\t\t\tvm.total_count = 0;\n\t\t vm.attachOrganismValue = \"\";\n\n\t\t\t// rebuild empty apiDomain submission object, else bindings fail\n\t\t\tvm.apiDomain = {};\n\t\t\tvm.apiDomain.alleleKey = \"\";\t\n\t\t\tvm.apiDomain.alleleSymbol = \"\";\t\n\t\t\tvm.apiDomain.accID = \"\";\n\t\t}", "function resetData () {\n\n\t\tsayso.data = {\n\t\t\ttype : 'ADjuster Campaign', // or 'ADjuster Creative'\n\t\t\ttagdomain : {},\n\t\t\tdomainAvail : {},\n\t\t\tcreative : {},\n\t\t\tbasic : {\n\t\t\t\tname: '',\n\t\t\t\tid: '',\n\t\t\t\tsize: '',\n\t\t\t\tminimum: '',\n\t\t\t\tbegindate: '',\n\t\t\t\tenddate: '',\n\t\t\t\tissurvey: 'no'\n\t\t\t},\n\t\t\tmetrics : {\n\t\t\t\tclicktrack : 'No',\n\t\t\t\tsearchengines : {},\n\t\t\t\tsearchengineIds : [],\n\t\t\t\tsocial : {},\n\t\t\t\tsocialIds : []\n\t\t\t},\n\t\t\tsurveyinfo : {\n\t\t\t\ttype : 'No Survey',\n\t\t\t\ttag : '',\n\t\t\t\tdeliverIf : {}\n\t\t\t},\n\t\t\tquota : {},\n\t\t\tcells : {}\n\t\t};\n\n\t\t// temporary object for storing list data\n\t\t// prior to aggregation into sayso.data\n\t\tsayso.temp = {\n\t\t\tqualifier : {\n\t\t\t\tbrowse : {},\n\t\t\t\tsearch : {}\n\t\t\t},\n\t\t\tdomain : {}\n\t\t};\n\t}", "clear() {\n this.cache.clear();\n if (this._uninterceptClientRequest) {\n this._uninterceptClientRequest();\n this._uninterceptClientRequest = undefined;\n }\n }", "function _reset(sel) {\n\tresponse = null;\n\t$setRef(sel);\n\t$setVar(sel);\n\n\tpjax.bind(sel);\n}", "clear() {\n // clearing the viewers and setting the operation to undefined\n this.readyToReset = true;\n this.currentOperand = '';\n this.previousOperand = undefined;\n this.operation = undefined;\n this.espSymbol = undefined;\n }", "reset() {\n this.router.clear();\n this.calls.clear();\n }", "reset() {\n this.dateMaps = this.getInitialDateClusterMaps();\n this.errorClusters.reset();\n this.errors = {};\n this.events = {};\n this.userMap.clear();\n }", "reset() {\n this.portIndex = 0;\n this.results = [];\n this.error = null;\n this.prepare(true);\n }", "function cancelout() {\n setAddResponse(null);\n setchosenmed(null);\n setExistingPrescription(null);\n }", "function clearResult() {\n $(\"#resultEl\").html(\"\");\n }", "reset() {\n\t\tthis.startTime = null;\n\t\tthis.endTime = null;\n\t}", "reset() {\n // Initial values\n this._data = new WordArray();\n this._nDataBytes = 0;\n }", "function reset() {\n\t\tdictionary = {};\n\t\tradioNames = [];\n\t}", "clear() {\n this.autocompleteCache = [];\n this.internalQuery = null;\n this.autocompleteSelectedQuery = null;\n this.autocomplete.perform();\n }", "function clear() {\n state = {\n operandOne: \"0\",\n operandTwo: undefined,\n operation: undefined,\n result: undefined\n };\n }", "off() {\n this.mocking = false;\n this.clear();\n }", "function reset() {\n timer.answerTime = 30;\n totalQuestions = 0;\n counter = 0;\n correctAns = 0;\n wrongAns = 0;\n unanswered = totalQuestions - correctAns - wrongAns;\n $(\"#result\").empty();\n $(\"#response\").empty();\n questions();\n}", "function clear() {\n newStats = {\n theyAreReady: false,\n iAmReady: false,\n currentTurn: null,\n firstTurn: null,\n openRows: null,\n history: null,\n future: null,\n iAmRed: null,\n moveStart: null,\n redTime: null,\n bluTime: null,\n winner: null,\n winBy: null,\n theyWantMore: false,\n iWantMore: false,\n };\n Object.assign(stats, newStats);\n }", "async function resetData() {\n try {\n const res = await fetch(baseUrl);\n if (res.ok) {\n res.json().then(res => {\n setCards([...res.cards]);\n setNext((res._links && res._links.next) || null);\n setIsFetching(false);\n setSearchTerm('');\n setNoResults(false);\n forceCheck();\n });\n } else {\n throw Error('Non 200 response recieved from API');\n }\n } catch (err) {\n setErrors(err);\n }\n }", "initialize_values() {\n this.lastResponse = [];\n this.tmpPiece = null;\n this.numberOfTries = 0;\n }", "reset() {\n this.token = DEFAULT_TOKEN\n this.user = null\n this.institution = null\n api.unsetToken()\n }", "function reset() {\n BaseAPI.reset.call(_self);\n\n // Data Model\n _self.cmi = new CMI(_self);\n _self.adl = new ADL(_self);\n }", "function reset()\n {\n Parameters.container = $.extend(true, {}, defaultContainer);\n Parameters.counter = 0;\n Parameters.timeId = null;\n }", "function initResponse(response) {\n\tresponse.set('Content-Type', 'application/json');\n}", "function clearCookies(res) {\n res.clearCookie(\"state\");\n res.clearCookie(\"data\");\n}", "function reset() {\n $('#locator-loader').show();\n $('.sidebar-js-button').removeClass('active');\n $('.result-body').hide();\n $('.legend-inner-container').hide();\n $('.legend-body').html('');\n $('#result-list').html('');\n $('.result-dropdown select').html('');\n }", "function reset() {\n\n //clear enemies\n allEnemies.length = 0;\n //clear any text messages from the heads-up display.\n hud.textElements.length = 0;\n }", "function _clear() {\n\n // Only clear if call is async. Clearing has no effect for synchronous calls and is also known to cause\n // issues with components that use async set value mechanisms (bug #20770935).\n if ( !lSync ) {\n $( lPageItemsToReturn, apex.gPageContext$ ).each(function () {\n $s(this, \"\", null, true);\n });\n }\n }", "reset() {\n this._age = 0\n this._height = 0\n this._fruits = []\n this._healthyStatus = true\n this._harvested = ''\n }", "function clearTheDifference() {\n\t$('#result').empty();\n\t// data for json\n\t$('#realDifference').empty();\n\t$('#result').append('Current difference: ');\n}", "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "function clearResults() {\n\t\t// Re-display loading icons\n\t\tdocument.getElementById(\"loadingmeaning\").style.display = \"inline\";\n\t\tdocument.getElementById(\"loadinggraph\").style.display = \"inline\";\n\t\tdocument.getElementById(\"loadingcelebs\").style.display = \"inline\";\n\t\t\n\t\t// Clear old results\n\t\tdocument.getElementById(\"meaning\").innerHTML = \"\";\n\t\tdocument.getElementById(\"graph\").innerHTML = \"\";\n\t\tdocument.getElementById(\"celebs\").innerHTML = \"\";\n\t\t\n\t\t// Hide \"no results\" error message\n\t\tdocument.getElementById(\"norankdata\").style.display = \"none\";\n\t}", "_resetState () {\n this._wsQueue = [];\n this._subscriptionsById.clear();\n this._subscriptionsByKey.clear();\n this._requests = {};\n this._calls = {};\n this._rpcRegs = {};\n this._rpcNames = new Set();\n\n // Just keep attrs that are have to be present\n this._cache = {\n reqId : 0,\n reconnectingAttempts: 0,\n opStatus : SUCCESS,\n closePromise : null,\n connectPromise : null,\n };\n }", "function resetData() {\n\t\t\tconsole.log(\"resetData()\");\n\n\t\t\tvm.results = [];\n\t\t\tvm.selectedIndex = -1;\n vm.selectedAccIndex = 0;\n\t\t\tvm.total_count = 0;\n loadEmptyObject();\n\t\t\tresetBoolean();\n\t\t}", "function clearAll() {\n questionsAnswered = 0;\n trueAnswers = [];\n trueQuestions = [];\n userAnswers = [];\n}", "function resetResults() {\n $(\"#search-results-heading\").text(\"\");\n $(\"#results\").text(\"\");\n}", "function dataReset() {\n apiUrl = originalApiUrl;\n timeToScreen = \"\";\n city = \"\";\n currentCondition = \"\";\n iconUrl = originalIconUrl;\n humidity = \"\";\n windSpeed = \"\";\n speedFormat = \"\";\n clouds = \"\";\n }", "fullReset() {\n this._parser.reset();\n this._onRequestReset.fire();\n return true;\n }", "function reset() {\n\tmessage = '';\n\tmessageIndex = 0;\n\tpromise = null;\n}", "reset() {\n this.completeDeferred = new Deferred();\n this.completePromise = this.completeDeferred.promise;\n this.error = null;\n }", "function clearFunction(){\n myArray = [];\n location.reload()\n document.getElementById(\"response\").innerHTML = myArray;\n}", "function resetMessageDivs() {\n gees.dom.clearHtml('ResponseMessage');\n gees.dom.clearHtml('status');\n gees.dom.clearHtml('globe');\n}", "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "reset() {\n $.each(this.combo_lists, (i,list)=>{list.reset();});\n this.async_requests = 0;\n this.working_list = _(this.original_list).difference(this.exclude_tags).difference(this.combo_tags).map(tag=>{return tag.match(/^-?(.*)$/)[1];}).value();\n this.fixed_combo_tags = [];\n this.bad_tags = [];\n this.tag_aliases = {};\n this.aliased_tags = {};\n this.tag_implications = {};\n this.superfluous_tags = {};\n this.reconstructed_list = [];\n this.reconstructed_html = \"\";\n this.is_running = false;\n this.is_ready = false;\n this.window_size = 0;\n this.error = false;\n this.unchanged = false;\n this.combos_started = false;\n this.last_logged = 0;\n this.stage = 0;\n this.stop = false;\n }", "function resetAnswer() {}", "function resetTestResults() {\n testResults = [];\n $.each(tests, function(i) {\n testResults.push(null);\n });\n\n assert(testResults.length > 0);\n assert(testResults.length == tests.length);\n}", "reset() {\n this.length = 0;\n this._subParamsLength = 0;\n this._rejectDigits = false;\n this._rejectSubDigits = false;\n this._digitIsSub = false;\n }", "function reset() {\n BaseAPI.reset.call(_self);\n\n // Data Model\n _self.cmi = new CMI(_self);\n }", "function clear () {\n insight.optOut = undefined;\n}", "function clearPreviousResults() {\n setMapOnAllMarkers(null);\n markersOnMap = [];\n arrayOfLocations = [];\n}", "function clearResults() {\n\t$('.results').text('');\n}", "function clearResults() {\n selectedPoints = [];\n Map.layers().remove(Map.layers().get(2));\n var instructionsLabel = ui.Label('Select regions to compare population.');\n resultsPanel.widgets().reset([instructionsLabel]);\n}", "function _reset() {\n //Clear console.\n $(\"#console-area\").val(\"\");\n\n //Show sign in boxes.\n $(\"#div-signin\").show();\n\n //Hide all API actions DIV until successful sign in.\n $(\"#actions\").hide();\n\n //Hide agent info DIV until successful sign in.\n $(\"#div-signout\").hide();\n\n //Reset agent info data.\n $(\"#span-agent-info\").html(\"\");\n\n //Clear the dial number field.\n $(\"#field-call-control-make-dialnum\").val(\"\");\n\n //Clear the callid field.\n $(\"#field-call-control-callid\").val(\"\");\n}", "reset() {\n this.data = $.extend(true, {}, this.cacheData);\n this.href = null;\n this.isBuilt = false;\n\n // Unsubscribe events\n this.eventBus.unsubscribeByScope(this);\n }", "_reset() {\n this.log(\"Closing connections.\");\n this._stopTrackingTask();\n this._partialResponse = \"\";\n this._closeSocket(this._socket);\n this._closeSocket(this._dataSocket);\n // Set a new socket instance to make reconnecting possible.\n this.socket = new Socket();\n }", "clearValues(){\n\t\t\tthis.addedName = '';\n\t\t\tthis.addedPrice = 0;\n\t\t\tthis.commission = 0;\n\t\t\tthis.totalContractValue = 0;\n\t\t\t\n\t\t}", "clear() {\n\t\treturn this.update( state => {\n\t\t\t\treturn { name: \"clear()\", nextState: {} };\n\t\t\t});\n\t}", "expire() {\n this.viewer = null // Sever reference back to this viewer to make it clear that this is attached\n delete this.response_buffer\n }", "function stripResponse(response) {\n const strippedResponse = {};\n strippedResponse.body = response.bodyAsText;\n strippedResponse.headers = response.headers;\n strippedResponse.status = response.status;\n return strippedResponse;\n}", "function stripResponse(response) {\n const strippedResponse = {};\n strippedResponse.body = response.bodyAsText;\n strippedResponse.headers = response.headers;\n strippedResponse.status = response.status;\n return strippedResponse;\n}", "reset() {\n this.set('data', []);\n this._reset();\n }", "removeAll() { this.general = {}; this.timers = {}; this.alarms = {}; this.helpers = {}; this.search = {}; }", "clear() {\n\t\t\tthis._buffer = [ ];\n\t\t}", "reset() {\n this.setObjectRenderer(this.emptyRenderer);\n }", "clear()\n {\n this._exceptionsBySelector.clear();\n this._exceptions.clear();\n }" ]
[ "0.69551986", "0.6934768", "0.68229336", "0.6719653", "0.6627428", "0.6477026", "0.6452805", "0.6375394", "0.63742906", "0.6222826", "0.6160884", "0.6135466", "0.61059767", "0.60162914", "0.59714854", "0.59714854", "0.59714854", "0.59477454", "0.5928571", "0.5845798", "0.5844477", "0.58433676", "0.58425236", "0.58356255", "0.57781136", "0.5776341", "0.57673544", "0.57349694", "0.5648429", "0.56452924", "0.5643713", "0.5636841", "0.5623438", "0.5592662", "0.5586921", "0.556704", "0.5539741", "0.552522", "0.55224967", "0.5517335", "0.54943573", "0.54571635", "0.54532427", "0.54225904", "0.54179484", "0.5397042", "0.5396133", "0.5390822", "0.53906184", "0.5390351", "0.5368869", "0.5365649", "0.53643316", "0.5362877", "0.53602177", "0.53563905", "0.5353737", "0.53472483", "0.5345135", "0.53442633", "0.53303415", "0.5328375", "0.53269994", "0.532109", "0.5315659", "0.5315659", "0.5315659", "0.5313886", "0.530717", "0.5305124", "0.5300421", "0.5295219", "0.529341", "0.52869654", "0.5284284", "0.52706647", "0.52676255", "0.5264439", "0.52626526", "0.5259347", "0.52528584", "0.5252189", "0.52462393", "0.52434754", "0.52403426", "0.5236551", "0.52306604", "0.5226995", "0.52226895", "0.52184784", "0.52174777", "0.52120286", "0.5203514", "0.5199034", "0.5198694", "0.5198694", "0.51958746", "0.51908374", "0.51893765", "0.5185798", "0.51857716" ]
0.0
-1
Time: O(n n n)
function sortString(s) { let input = s.split(''); let result = []; let currentLetter; let getSmallest = true; while (input.length !== 0) { let index; if (getSmallest) { index = getNextLargestLetter(input, currentLetter); } else { index = getNextSmallestLetter(input, currentLetter); } if (index === undefined) { getSmallest = !getSmallest; currentLetter = undefined; } else { const lastLetter = input.splice(index, 1); currentLetter = lastLetter; result.push(currentLetter); } } return result.join(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function boooo(n) {\n for (let i = 0; i < n; i++) { // O(1)\n console.log('booooo');\n }\n}", "function findUniqueValues(arr){ //O(n) // You wrote this\r\n let uniqueVal = []; \r\n let left = 0; \r\n let right = arr.length - 1;\r\n while(left < right){ // O(n)\r\n if(!(uniqueVal.includes(arr[left]))){\r\n uniqueVal.push(arr[left]);\r\n left++;\r\n } else if(!(uniqueVal.includes(arr[right]))){\r\n uniqueVal.push(arr[right]);\r\n right--;\r\n } else if(uniqueVal.includes(arr[left])){\r\n left++;\r\n } else {\r\n right--;\r\n }\r\n }\r\n return uniqueVal.length\r\n}", "function naiveSumZero(arr){ // O(n^2)\r\n for(let i = 0; i < arr.length; i++){ // O(n)\r\n for(let j = i + 1; j < arr.length; j++){ // nested O(n)\r\n if(arr[i] + arr[j] === 0){\r\n return [arr[i], arr[j]];\r\n }\r\n }\r\n }\r\n}", "function mystery(n) {\n let r = 0;\n for (let i = 0; i < n; i++) {\n for (let j = i + 1; j <= n; j++) {\n for (let k = 1; k < j; k++) {\n r++;\n }\n }\n }\n return r;\n}", "function twoSum(arr, n) {\n const cache = new Set();\n for (let i = 0; i < arr.length; i++) {\n if (cache.has(n - arr[i])) {\n return true;\n }\n cache.add(arr[i]);\n }\n return false;\n}", "function n(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "function n(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "function example2(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) {\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) {\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n}", "function anotherFunChallenge(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) {\n // O(n)\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) {\n // O(n)\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n}", "function O(t, e, n) {\n return t.length === e.length && t.every((function(t, r) {\n return n(t, e[r]);\n }));\n}", "function solution(a) { // O(N)\n let max1; // O(1)\n let max2; // O(1)\n\n for (let value of a) { // O(N)\n if (!max1) { // O(1)\n max1 = value; // O(1)\n } else if (value > max1) { // O(1)\n max2 = max1; // O(1)\n max1 = value; // O(1)\n } else if (value < max1) { // O(1)\n if (!max2) { // O(1)\n max2 = value; // O(1)\n } else if (value > max2) { // O(1)\n max2 = value; // O(1)\n }\n }\n }\n\n return max2; // O(1)\n}", "function funChallenge(input) {\n let a = 10; // O(1)\n a = 50 + 3; // O(1)\n\n for (let i = 0; i < input.length; i++) {\n // O(n)\n anotherFunction(); // O(n)\n let stranger = true; // O(n)\n a++; // O(n)\n }\n return a; // O(1)\n}", "function anotherFunChallenge(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) {\n // O(n) --> numbers of inputs\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) {\n // O(n) --> numbers of inputs\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 6.4.0)\n \n N = 100001\n var bitmap = Array(N).fill(false);\n for (var i = 0; i < A.length; i ++) {\n if (A[i] > 0 && A[i] <= N) {\n bitmap[A[i]] = true;\n }\n }\n \n for(var j = 1; j <= N; j++) {\n if (!bitmap[j]) {\n return j;\n }\n }\n \n return N + 1;\n}", "function funChallenge(input) {\n let a = 10; // O(1)\n a = 50 + 3; // O(1)\n\n for (let i = 0; i < input.length; i++) {\n // O(n) --> number of inputs\n anotherFunction(); // O(n)\n let stranger = true; // O(n)\n a++; // O(n)\n }\n return a; // O(1)\n}", "function anotherFunChallenge(input) {\n let a = 5; //O(1)\n let b = 10; //O(1)\n let c = 50; //O(1)\n for (let i = 0; i < input; i++) { //* \n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n\n }\n for (let j = 0; j < input; j++) { //*\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; //O(1)\n}", "function i(n){let e=0,t=0;const r=n.length;let i,o=n[t];for(t=0;t<r-1;t++)i=n[t+1],e+=(i[0]-o[0])*(i[1]+o[1]),o=i;return e>=0}", "function arrayManipulation(n, queries) {\n const acc = {};\n for (const [a, b, k] of queries) {\n acc[a] = (acc[a] || 0) + k;\n acc[b+1] = (acc[b+1] || 0) - k;\n } \n let last = 0\n let m = 0\n for (let i=0; i<n+1; i++) {\n const curr = acc[i] || 0;\n last = last + curr;\n if (last > m) {\n m = last;\n }\n }\n return m\n}", "function findNUniqueIntegersSumUpToZero(n) {\n let result = n % 2 === 0 ? [n, -n] : [0]\n for (let index = 1; index < n / 2; index++) {\n result.push(index, -index)\n }\n return result\n}", "function O(t, n) {\n return void 0 !== t ? t : n;\n}", "function StairCase(n, arr) {\n\tvar cache = [1];\n\tfor (let i=1; i< n+1; i++) {\n\t\tlet ans = getSumOfPossiblities(i, arr, cache);\n\t\tcache[i] = ans;\n\t}\n\t\n\treturn cache[n];\n}", "function f(n) {\n return [0].indexOf(n - n + 0);\n}", "function twoSum(arr, n) {\n var ret = [];\n\n for( var i = 0; i < arr.length - 1; i++ ) {\n for( var j = i + 1; j < arr.length; j++ ){\n if( arr[i] + arr[j] == n ) {\n ret.push(i);\n ret.push(j);\n return [i,j];\n }\n }\n }\n}", "function removeDuplicatesInPlace(arr, n)\n{\n if (n===0 || n===1)\n {\n return n\n }\n\n let temp = new Array(n)\n\n let j = 0\n\n for (let i = 0; i < n - 1; i++)\n {\n if (arr[i] !== arr[i+1]) {\n temp[j++] = arr[i]\n }\n\n }\n temp[j++] = arr[n-1];\n\n for(let k = 0; k < j; k++)\n {\n arr[k] = temp[k]\n }\n\n return j\n}", "function compressBoxes(input){\n for(var i = 0; i<=100; i++){\n console.log('hi'); // O(100)\n }\n\n input.forEach(function(box){\n console.log(box); // O(n)\n })\n\n input.forEach(function(box){\n console.log(box); //O(n)\n })\n }", "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function A(n,t){for(;t+1<n.length;t++)n[t]=n[t+1];n.pop()}", "function maxSubArraySum(arr, n){ // O(n^2) // naive solution\r\n let maxSum = 0;\r\n for(let i = 0; i < arr.length - n + 1; i++){ // O(n)\r\n let temp = 0;\r\n for(let j = 0; j < n; j++){ // nested O(n)\r\n temp += arr[i + j];\r\n }\r\n if(temp > maxSum){\r\n maxSum = temp;\r\n }\r\n }\r\n return maxSum;\r\n}", "function solution(a) {\r\n // write your code in JavaScript (Node.js 0.12)\r\n var i, l=a.length-1;\r\n var arr=[];\r\n do{ \r\n arr[a[l]-1] = a[l];\r\n \r\n l--; \r\n if(l===0)\r\n for(j=0;j<arr.length;j++)\r\n if(!arr[j])\r\n return j+1;\r\n \r\n }while(l>=0)\r\n}", "function mutateTheArray(n, a) {\n if (n === 1) {\n return a;\n }\n var result = new Array(n);\n \n for (let i = 0; i < n; i++) {\n let left = a[i-1] ? a[i-1] : 0;\n let curr = a[i]\n let right = a[i+1] ? a[i+1] : 0;\n \n result[i] = (left+curr+right)\n } \n return result; \n \n}", "function n(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}", "function searchNaive(arr, n){ // O(n) Linear Search\r\n for(let i = 0; i < arr.length; i++){\r\n if(arr[i] === n){\r\n return i;\r\n } \r\n }\r\n return -1;\r\n}", "function reoccurring(arr){\n\tfor(let i = 0; i < arr.length; i++){\n\t\tfor(j = i+1; j < arr.length; j++){\n\t\t\tif(arr[i] === arr[j]){\n\t\t\t\treturn arr[i]\n\t\t\t}\n\t\t}\n\t}\n\treturn undefined\n} // O(n^2)", "function performantSmallest(arr, n) {\n let res =[]\n do{\n let x = Math.min(...arr)\n res.push([x,arr.indexOf(x)])\n arr.splice(arr.indexOf(x),1)\n }\n while (res.length < n)\n res.sort((a,b)=>a[1]-b[1])\n return res.map(e=>e[0])\n }", "function fibonacciIterative(n) {\n let arr = [0, 1]\n for (let i = 2; i < n + 1; i++) {\n arr.push(arr[i - 2] + arr[i - 1])\n }\n return arr[n]\n} // O(n)", "function sift(a, i, n, lo) {\n\t var d = a[--lo + i],\n\t x = f(d),\n\t child;\n\t while ((child = i << 1) <= n) {\n\t if (child < n && f(a[lo + child]) > f(a[lo + child + 1])) child++;\n\t if (x <= f(a[lo + child])) break;\n\t a[lo + i] = a[lo + child];\n\t i = child;\n\t }\n\t a[lo + i] = d;\n\t }", "function funChallenge(input) {\n let a = 10; // O(1) Some people don't count assignments\n a = 50 + 3; // O(1)\n\n for (let i = 0; i < input.length; i++) { // O(n) --> n is the input\n anotherFunction(); // O(n)\n let stranger = true; // O(n)\n a++; // O(n)\n }\n return a; // O(1) another thing some people don't count\n}", "function sift(a, i, n, lo) {\n var d = a[--lo + i],\n x = f(d),\n child;\n while ((child = i << 1) <= n) {\n if (child < n && f(a[lo + child]) > f(a[lo + child + 1])) child++;\n if (x <= f(a[lo + child])) break;\n a[lo + i] = a[lo + child];\n i = child;\n }\n a[lo + i] = d;\n }", "function missing2(A) {\n let N = A.length + 1;\n let fullSum = 0;\n for (let i = 1; i <= n; i++) {\n fullSum = fullSum + i;\n }\n return fullSum;\n}", "function Gn(e,t){var a=e[t];e.sort(function(e,t){return P(e.from(),t.from())}),t=d(e,a);for(var n=1;n<e.length;n++){var r=e[n],f=e[n-1];if(P(f.to(),r.from())>=0){var o=G(f.from(),r.from()),i=U(f.to(),r.to()),s=f.empty()?r.from()==r.head:f.from()==f.head;n<=t&&--t,e.splice(--n,2,new Di(s?i:o,s?o:i))}}return new Oi(e,t)}", "function ex_2_I(n) {\n var sum = 0;\n var i=0;\n var j=0;\n while (i!=n){\n if(j%2==1){\n sum+=j;\n i++;\n j+=2;\n }\n else{j++;}\n }\n\n return sum;\n}", "function F(n) {\n if(n == 0) return 1;\n return n - M(F(n-1));\n}", "function solve(input) {\n let elves = [];\n for (let i = 0; i < input; i++) {\n elves.push(i + 1);\n }\n\n function getNextIndex(index) {\n let next = (elves.length / 2) + index;\n if (next >= elves.length) {\n next -= elves.length\n }\n if (!_.isInteger(next)) {\n next = _.floor(next);\n }\n return next;\n }\n\n let current = elves[0];\n // let currentTime = new Date().getTime();\n while (elves.length > 1) {\n let index = _.indexOf(elves, current);\n let nextIndex = getNextIndex(index);\n // if (index % 100 === 0) {\n // let newTime = new Date().getTime();\n // console.log(index, elves[index], elves[nextIndex], elves.length, newTime - currentTime);\n // currentTime = newTime;\n // }\n elves[nextIndex] = 0;\n elves = _.compact(elves);\n let nextCurrent = _.indexOf(elves, current) + 1;\n if (nextCurrent >= elves.length) {\n nextCurrent = 0;\n }\n current = elves[nextCurrent];\n }\n console.log(input, elves[0]);\n}", "function threesum(nums){\n nums=nums.sort((a,b)=>a-b);\n let result=[];\n for(let i=0;i<nums.length-2;i++){\n let left=i+1;\n let right=nums.length-1;\n while(right>left){\n let currSum=nums[i]+nums[left]+nums[right];\n if(currSum===0){\n let flag=true;\n console.log(nums[i], nums[left], nums[right]);\n for(let ar of result){\n console.log(ar)\n if(ar[0]===nums[i] && ar[1]===nums[left] && ar[2]===nums[right]) flag=false;\n }\n if(flag){\n result.push([nums[i],nums[left],nums[right]])\n }\n left++;\n right--;\n }\n else if(currSum>0)\n right--;\n else\n left++\n }\n }\n return result;\n}", "function x(n) {\n let i = 0, answer = [];\n while (i < n) {\n let j = 0, a = [];\n while (j < n) {\n a[j] = 0;\n j++;\n }\n answer.push(a);\n i++;\n }\n\n i = 0;\n while (i < n) {\n var k = 0;\n while (k < n) {\n if (i === k) {\n answer[i][k] = 1;\n }\n if (i + k === n - 1) {\n answer[i][k] = 1;\n }\n k++;\n }\n i++;\n }\n return answer;\n}", "function solution(n) {\n d = new Array(30);\n l = 0;\n while (n > 0) {\n d[l] = n % 2;\n n = Math.floor(n / 2);\n l += 1;\n }\n console.log('l = ', l);\n console.log('d = ', d);\n for (p = 1; p < 1 + l; ++p) {\n ok = true;\n for (i = 0; i < l - p; ++i) {\n if (d[i] != d[i + p]) {\n ok = false;\n break;\n }\n }\n if (ok) {\n return p;\n }\n }\n return -1;\n}", "function ex_2(myA){\n return myA.filter(x => x % 2 == 0) // O(myA.length)\n .map(a => a * a) // O(myA.length)\n .reduce((acc, x) => acc + x, 0); // O(myA.length)\n}", "function o$h(n,o,t){for(let r=0;r<t;++r)o[2*r]=n[r],o[2*r+1]=n[r]-o[2*r];}", "function h(n,t){var r,u,i,f;if(n===t)return 0;for(r=n.length,u=t.length,i=0,f=Math.min(r,u);i<f;++i)if(n[i]!==t[i]){r=n[i];u=t[i];break}return r<u?-1:u<r?1:0}", "function i(t,e,n){var i=t.length>>>0;return e=null==e?n||0:e<0?Math.max(i+e,0):Math.min(e,i),e}", "function snt (n) {\n for (let i=2 ; i <=n; i++)\n arr[i]=1;\n console.log(arr)\n arr[0]=arr[1]=0;\n // console.log(arr)\n for (let i =2; i<=Math.sqrt(n); i++)\n if (arr[i])\n for (let j=2*i; j <=n; j += i)\n arr[j]=0\n}", "function advanced(arr) {\n const n = arr.length;\n let leftSum = 0;\n let rightSum = 0;\n\n for (let i = 1; i < n; i++) {\n rightSum += arr[i];\n }\n\n for (let i = 0, j = 1; i < n; i++, j++) {\n leftSum += arr[i];\n rightSum -= arr[j];\n\n if (leftSum === rightSum) {\n return arr[j];\n }\n }\n\n return arr[0];\n}", "function fastPermutatedNeedle(needle, haystack) {\n let result = []\n let length = needle.length\n let needleObject = hashTableString(needle)\n for (let i = 0; i < haystack.length - length + 1; i++) {\n if (!needleObject[haystack[i]]) {\n continue\n }\n let needleObjectCopy = shallowCopyObject(needleObject)\n let count = length\n for (let j = i; j < i + needle.length; j++) {\n if (!needleObjectCopy[haystack[j]] || needleObjectCopy[haystack[j] < 1]) {\n break\n }\n needleObjectCopy[haystack[j]]--\n count--\n }\n if (count === 0) {\n result.push(i)\n }\n }\n return result\n}", "function problem2(){\n var numArr = [1,2];\n while(numArr[numArr.length-1]<4000000){\n numArr.push( numArr[numArr.length - 2] + numArr[numArr.length - 1] );\n }\n numArr = numArr.filter(function(a){ return a%2===0});\n return numArr.reduce(function(a,b){ return a+b; });\n}", "function printFirstItemThenFirstHalfThenSayHi100Times(items) {\n console.log(items[0]); // O(1)\n\n let middleIndex = Math.floor(items.length / 2); // O(1)\n let index = 0; // O(1)\n while (index < middleIndex) {\n console.log(items[index]); // O(n/2)\n index++; // O(n/2)\n }\n\n for (let i = 0; i < 100; i++) {\n // O(100)\n console.log('Hi'); // O(100)\n }\n}", "function fn(n) {\n for (var i = 0; i < n; i++) {\n for (var j = 0; j < n; j++) {\n console.log(i, j);\n }\n }\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n // [1,0] . [0,1]\n let f = A[0];\n let count = 0;\n let getOCount = getCount(A, 1);\n let getZCount = getCount(A, 0);\n console.log(getOCount + \" \" + getZCount);\n if (getOCount >= getZCount) {\n for (let i = 0; i < A.length - 1; ++i) {\n if (A[i] === A[i + 1]) {\n if (A[i] === 1) {\n A[i + 1] = 0;\n } else {\n A[i + 1] = 1;\n }\n count++;\n }\n }\n } else {\n for (let i = 0; i < A.length - 1; ++i) {\n if (A[i] === A[i + 1]) {\n if (A[i + 1] === 1) {\n A[i] = 0;\n } else {\n A[i] = 1;\n }\n count++;\n }\n }\n }\n return count;\n}", "function shortestArrang(n) {\n let newArr = [];\n let start_number;\n n % 2 == 0 ? (start_number = n / 2) : (start_number = (n + 1) / 2);\n while (start_number > 0) {\n for (let i = start_number; i > 0; i--) {\n newArr.push(i);\n if (find_sum_elements_array(newArr) > n) {\n newArr = [];\n break;\n }\n if (find_sum_elements_array(newArr) === n) {\n return newArr;\n }\n }\n start_number--;\n }\n return [-1];\n}", "function solution2(A) {\n let x1 = A[0]; // xor all elements in array\n let x2 = 1; // xor all elements from 1 to n+1 (n+1 since 1 number is missing)\n for (let i = 1; i < A.length; i++) {\n x1 ^= A[i];\n }\n for (let i = 2; i <= A.length + 1; i++) {\n x2 ^= i;\n }\n\n return x2 ^ x1;\n}", "function stones(n, a, b) {\n let countSet = new Set()\n \n for(let i = 0; i < n; i++) {\n countSet.add(i * Math.max(a,b) + (n - i - 1) * Math.min(a,b));\n }\n \n return Array.from(countSet);\n}", "function fibonacciIterative(n) {\n // O(n)\n let arr = [0, 1];\n for (let i = 2; i < n + 1; i++) {\n arr.push(arr[i - 2] + arr[i - 1]);\n }\n return arr[n];\n}", "function NumberInAscendingOrder(arr,n){\n const Unique = [...new Set(arr)];\n Unique.sort((a,b) => a-b);\n return Unique[n-1]\n}", "function linear_search(arr, n){\n for(var elem of arr){\n if(elem === n){\n return arr.indexOf(elem);\n }\n }\n}", "function n(e,t){if(e===t)return 0;for(var i=e.length,n=t.length,o=0,a=Math.min(i,n);o<a;++o)if(e[o]!==t[o]){i=e[o],n=t[o];break}return i<n?-1:n<i?1:0}", "function NumberInDescendOrder(arr,n){\n const Unique = [...new Set(arr)];\n Unique.sort((a,b) => b-a);\n return Unique[n-1]\n}", "function n(e,t){if(e===t)return 0;for(var r=e.length,i=t.length,n=0,a=Math.min(r,i);n<a;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0}", "function f(n, k){\r\n let dp = new Array(n + 1)\r\n for (let i=0; i<n+1; i++)\r\n dp[i] = new Array(k + 1).fill(0)\r\n \r\n dp[0][0] = 1\r\n \r\n \r\n for (let i=1; i<=n; i++)\r\n for (let j=1; j<=Math.min(i, k); j++) {\r\n dp[i][j] = dp[i - j][j] + dp[i - 1][j - 1]\r\n console.log(dp); \r\n } \r\n return dp[n][k]\r\n}", "function naiveSame(arr1, arr2){ // O(n^2)\r\n if(arr1.length !== arr2.length){\r\n return false;\r\n }\r\n for(let i = 0; i < arr1.length; i++){ // O(n)\r\n let correctIdx = arr2.indexOf(arr1[i] ** 2) // nested O(n)\r\n if(correctIdx === -1){\r\n return false;\r\n }\r\n arr2.splice(correctIdx, 1)\r\n }\r\n return true;\r\n}", "function countInverse(array) {\n\n split(0, array.length - 1);\n // console.log(\"Result:\" + array);\n //console.log(count);\n //console.log(perf + ' ' + array.length * Math.log(array.length));\n\n function split(left, right) {\n // console.log('Split ' + left + \" \" + right)\n var middle = Math.floor((right + left) / 2);\n\n if (middle > left) {\n split(left, middle);\n split(middle + 1, right);\n }\n merge(left, middle, right)\n }\n\n function merge(left, middle, right) {\n //console.log(\"Merge\" + left + ',' + middle + ',' + right);\n var leftArr = array.slice(left, middle + 1);\n var rightArr = array.slice(middle + 1, right + 1);\n // console.log(leftArr);\n // console.log(rightArr);\n while (leftArr.length > 0 && rightArr.length > 0) {\n perf++;\n if (leftArr[0] < rightArr[0]) {\n array[left++] = leftArr.shift();\n } else {\n count = (count+leftArr.length);\n array[left++] = rightArr.shift();\n }\n }\n leftArr.concat(rightArr);\n while (leftArr.length > 0) {\n array[left++] = leftArr.shift();\n }\n }\n return count;\n }", "function simply_solution(n, cores) {\n var answer = 0;\n\n var core = [];\n for (let i of cores) {\n core.push({precessTime: i, t: i});\n }\n\n while (n != 0) {\n for (let i = 0; i < core.length; i++) {\n if (core[i].t == core[i].precessTime) {\n n--;\n core[i].t = 0;\n answer = i+1;\n if (n == 0) break;\n }\n core[i].t = core[i].t + 1;\n }\n }\n\n return answer;\n}", "function solution(n) {\n let answer = 0;\n let tempArr = [];\n let root = Math.sqrt(n);\n \n for (let i = 0; i <= n; i++) {\n tempArr.push(true);\n }\n \n tempArr[0] = false;\n tempArr[1] = false;\n \n for (let j = 2; j < root; j++) {\n if (tempArr[j]) {\n for (let k = j * j; k <= n; k += j) {\n tempArr[k] = false;\n }\n }\n }\n \n for (let l = 0; l < tempArr.length; l++) {\n if (tempArr[l]) answer += 1;\n }\n \n return answer;\n}", "a (a a = 0; a < a.a; ++a) {N\n a a = a[a];N\n a (a.a == a) {N\n a a = aAaAaAa(a, a.a);N\n a (!a) a.a = aAa;N\n a a (aAa) a.a = a.a == a ? a : a.a + a;N\n }N\n }", "function n(e,t){if(e===t)return 0;for(var A=e.length,n=t.length,r=0,i=Math.min(A,n);r<i;++r)if(e[r]!==t[r]){A=e[r],n=t[r];break}return A<n?-1:n<A?1:0}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n const N = A.length;\n let count = new Array(N+1).fill(0);\n \n for(let i in A){\n if(A[i] > N){\n return 0;\n }\n if(count[A[i]] > 0){\n return 0;\n }\n count[A[i]]++;\n }\n \n for(let i=1; i>N+1; i++){\n if(count[i] != 1){\n return 0;\n }\n }\n \n return 1;\n}", "function Oi(t, n) {\n var i = t[0], e = t[1], r = n[0], s = n[1], u = bi(i, r);\n return 0 === u ? bi(e, s) : u;\n}", "function n(t,e){if(t===e)return 0;for(var i=t.length,n=e.length,r=0,o=Math.min(i,n);r<o;++r)if(t[r]!==e[r]){i=t[r],n=e[r];break}return i<n?-1:n<i?1:0}", "function firstNonRepeat(n) {\n var map = {};\n for (var i = 0; i < n.length; i++) {\n //loop through and append\n append(n[i], i);\n }\n\n //check results, return first non repeat\n for(key in map) {\n if (map[key].count == 1) {\n return key;\n }\n }\n\n //utility function\n function append(c, i) {\n if (map[c] != null) {\n map[c].count++;\n } else {\n map[c] = {'index': i, 'count': 1};\n }\n }\n}", "function n(e,t){if(e===t)return 0;for(var r=e.length,i=t.length,n=0,o=Math.min(r,i);n<o;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0}", "function countPairs(arr, n) {\n var arrSet = new Set(arr)\n var count = 0\n for (let i = 0; i < arr.length; i++) {\n arrSet.remove(arr[i])\n if (arrSet.has(n-arr[i])) {\n count ++\n }\n }\n return count\n}", "function compute(num) {\n let result = [];\n for (let i = 1; i <= num; i++) {\n //O(n)\n if (i === 1) {\n result.push(0);\n } else if (i === 2) {\n result.push(1);\n } else {\n result.push(result[i - 2] + result[i - 3]);\n }\n }\n return result;\n}", "function slow_solution(arr){\n let resultsArr = []\n for(let i=0; i<arr.length;i++){\n resultsArr[i] = 0;\n for(let j=0; j<arr.length; j++){\n if(arr[i] % arr[j] !== 0){\n resultsArr[i] +=1;\n // console.log('|i:', i, '| j:', j,'| arr:', arr[i], '| res:',resultsArr[i])\n }\n }\n }\n return resultsArr\n}", "function loopTheLoop() {\n // time complexity would be something like 45^47\n for (let i = 0; i < 45; i++) {\n for (let j = 1; j < 47; j++) {\n console.log(i, j);\n }\n }\n}", "function countSumOfTwoRepresentations(n, l, r) {\n var c=0;\n for(var i=l;i<=r;i++) {\n if(i<n) {\n for(var j=i;j<=r;j++) {\n if(i+j>n) break;\n else if(i+j<n);\n else c++;\n }\n }\n }\n return c;\n}", "function inversionsN(arr) {\n let inv = 0;\n for (let i = 0; i < arr.length; i++) {\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[i] > arr[j]) inv++;\n }\n }\n return inv;\n}", "function n(t, a) {\n return t[0] = a[0], t[1] = a[1], t[2] = a[2], t[3] = a[3], t[4] = a[4], t[5] = a[5], t[6] = a[6], t[7] = a[7], t[8] = a[8], t[9] = a[9], t[10] = a[10], t[11] = a[11], t[12] = a[12], t[13] = a[13], t[14] = a[14], t[15] = a[15], t;\n }", "function n(t,e){if(t===e)return 0;for(var r=t.length,i=e.length,n=0,a=Math.min(r,i);n<a;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0}", "function n(t,e){if(t===e)return 0;for(var r=t.length,i=e.length,n=0,a=Math.min(r,i);n<a;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0}", "function n(t,e){if(t===e)return 0;for(var r=t.length,i=e.length,n=0,a=Math.min(r,i);n<a;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0}", "function i(a){for(var b=\"\",c=0;c<a.length;c++)b+=j(a[c]);return b}", "triples(array, N) {\n var Count = 0;\n for (var i = 0; i < N - 2; i++) {\n for (var j = i + 1; j < N - 1; j++) {\n for (var k = j + 1; j < N; j++) {\n if (array[i] + array[j] + array[k] === 0) {\n Count++;\n console.log(\"triplet are: \" + array[i] + \",\" + array[j] + \",\" + array[k]);\n }\n }\n }\n }\n }", "function n(t,e){if(t===e)return 0;for(var A=t.length,n=e.length,i=0,r=Math.min(A,n);i<r;++i)if(t[i]!==e[i]){A=t[i],n=e[i];break}return A<n?-1:n<A?1:0}", "function n(t,e){if(t===e)return 0;for(var A=t.length,n=e.length,i=0,r=Math.min(A,n);i<r;++i)if(t[i]!==e[i]){A=t[i],n=e[i];break}return A<n?-1:n<A?1:0}", "threesum1(arr) {\n\n var l = arr.length;\n for (var i = 0; i < l - 2; i++) {\n for (var j = i + 1; j < l - 1; j++) {\n for (var k = j + 1; k < l; k++) {\n if (arr[i] + arr[j] + arr[k] == 0) {\n console.log(arr[i] + \",\" + arr[j] + \",\" + arr[k] + \" is a triplet\")\n }\n\n\n }\n }\n }\n }", "function e(t,n){for(;n+1<t.length;n++)t[n]=t[n+1];t.pop()}", "function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}", "function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}", "function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}", "function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}" ]
[ "0.6586823", "0.6391703", "0.629024", "0.62489676", "0.61400515", "0.6129802", "0.6129802", "0.6116326", "0.6099428", "0.60690093", "0.60363495", "0.5998905", "0.5985945", "0.59679604", "0.59395343", "0.59367657", "0.59352857", "0.5910229", "0.5891375", "0.5884211", "0.5882854", "0.5879128", "0.5861384", "0.58437026", "0.58352655", "0.5835163", "0.5835163", "0.5835163", "0.5835163", "0.5824427", "0.5803899", "0.58024603", "0.5798386", "0.5785841", "0.5761968", "0.5754054", "0.57419395", "0.572661", "0.5714872", "0.57104194", "0.5686506", "0.56732625", "0.5671537", "0.5656805", "0.56370056", "0.56339854", "0.56287134", "0.56265813", "0.5623803", "0.5623236", "0.56147254", "0.56103545", "0.56018937", "0.55833614", "0.557781", "0.5551002", "0.55484873", "0.55435956", "0.55428636", "0.5523036", "0.5520007", "0.5519601", "0.55179155", "0.55170965", "0.5514342", "0.5506609", "0.5502433", "0.550055", "0.5498996", "0.5497621", "0.5493705", "0.54882956", "0.54842746", "0.54816496", "0.54808533", "0.5480463", "0.54789054", "0.54757357", "0.54682535", "0.5466428", "0.5460785", "0.5459869", "0.5456815", "0.54501677", "0.5450034", "0.5449388", "0.5446261", "0.5445268", "0.54363513", "0.54363513", "0.54363513", "0.5435439", "0.54346746", "0.54302496", "0.54302496", "0.54298824", "0.5426644", "0.5425426", "0.5425426", "0.5425426", "0.5425426" ]
0.0
-1
Space: O(1) Time: O(s)
function alternative(s) { const counts = new Array(26).fill(0); for (let i = 0; i < s.length; i++) { counts[s.charCodeAt(i) - 97]++; } const result = new Array(Math.max(...counts)).fill(''); // iterate through each letter of alphabet for (let i = 0; i < 26; i++) { // iterate through each count of a letter for (let j = 0; j < counts[i]; j++) { if (j % 2 === 0) { result[j] += String.fromCharCode(i + 97); } else { result[j] = String.fromCharCode(i + 97) + result[j]; } } } return result.join(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compressBoxes(input){\n for(var i = 0; i<=100; i++){\n console.log('hi'); // O(100)\n }\n\n input.forEach(function(box){\n console.log(box); // O(n)\n })\n\n input.forEach(function(box){\n console.log(box); //O(n)\n })\n }", "function fastPermutatedNeedle(needle, haystack) {\n let result = []\n let length = needle.length\n let needleObject = hashTableString(needle)\n for (let i = 0; i < haystack.length - length + 1; i++) {\n if (!needleObject[haystack[i]]) {\n continue\n }\n let needleObjectCopy = shallowCopyObject(needleObject)\n let count = length\n for (let j = i; j < i + needle.length; j++) {\n if (!needleObjectCopy[haystack[j]] || needleObjectCopy[haystack[j] < 1]) {\n break\n }\n needleObjectCopy[haystack[j]]--\n count--\n }\n if (count === 0) {\n result.push(i)\n }\n }\n return result\n}", "a (a a = 0; a < a.a; ++a) {N\n a a = a[a];N\n a (a.a == a) {N\n a a = aAaAaAa(a, a.a);N\n a (!a) a.a = aAa;N\n a a (aAa) a.a = a.a == a ? a : a.a + a;N\n }N\n }", "function example2(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) {\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) {\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n}", "function findUniqueValues(arr){ //O(n) // You wrote this\r\n let uniqueVal = []; \r\n let left = 0; \r\n let right = arr.length - 1;\r\n while(left < right){ // O(n)\r\n if(!(uniqueVal.includes(arr[left]))){\r\n uniqueVal.push(arr[left]);\r\n left++;\r\n } else if(!(uniqueVal.includes(arr[right]))){\r\n uniqueVal.push(arr[right]);\r\n right--;\r\n } else if(uniqueVal.includes(arr[left])){\r\n left++;\r\n } else {\r\n right--;\r\n }\r\n }\r\n return uniqueVal.length\r\n}", "function compressItems(items) {\n console.log(items[0]); // O(1) --> Constant time\n}", "a (a a = 0; a < a.a; ++a) {N\n a a = a[a];N\n a (a.a != a) a.a += a;N\n a (a.a == a) {N\n a a = aAaAaAa(a, a.a);N\n a (!a) {N\n a.a = a;N\n a (aAa) (a || (a = [])).a(a);N\n }N\n } a {N\n a.a += a;N\n a (aAa) (a || (a = [])).a(a);N\n }N\n }", "function boooo(n) {\n for (let i = 0; i < n; i++) { // O(1)\n console.log('booooo');\n }\n}", "function anotherFunChallenge(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) {\n // O(n)\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) {\n // O(n)\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n}", "function naiveSumZero(arr){ // O(n^2)\r\n for(let i = 0; i < arr.length; i++){ // O(n)\r\n for(let j = i + 1; j < arr.length; j++){ // nested O(n)\r\n if(arr[i] + arr[j] === 0){\r\n return [arr[i], arr[j]];\r\n }\r\n }\r\n }\r\n}", "function findDuplicate(arr) {\n \n \n}", "function naiveSame(arr1, arr2){ // O(n^2)\r\n if(arr1.length !== arr2.length){\r\n return false;\r\n }\r\n for(let i = 0; i < arr1.length; i++){ // O(n)\r\n let correctIdx = arr2.indexOf(arr1[i] ** 2) // nested O(n)\r\n if(correctIdx === -1){\r\n return false;\r\n }\r\n arr2.splice(correctIdx, 1)\r\n }\r\n return true;\r\n}", "function anotherFunChallenge(input) {\n let a = 5; //O(1)\n let b = 10; //O(1)\n let c = 50; //O(1)\n for (let i = 0; i < input; i++) { //* \n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n\n }\n for (let j = 0; j < input; j++) { //*\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; //O(1)\n}", "function anotherFunChallenge(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) {\n // O(n) --> numbers of inputs\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) {\n // O(n) --> numbers of inputs\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n}", "function $cf838c15c8b009ba$export$2f3eb4d6eb4663c9(key) {\n const getKey = typeof key === \"string\" ? (value)=>value && typeof value === \"object\" && value[key] !== undefined ? value[key] : value : null;\n const create = (iterating)=>{\n let i = 0, j, len, nOthers, args, result, memory;\n return function() {\n if (!args) {\n args = [].sort.call(arguments, (a, b)=>a.length - b.length);\n nOthers = args.length - 1;\n result = [];\n memory = new Map();\n i = 0;\n j = 0;\n }\n for(; i <= nOthers; i++){\n //j = j===-1 ? arguments[i].length : j;\n const len = args[i].length;\n while(j < len){\n const elem = args[i][j], key = getKey ? getKey(elem) : elem;\n if (memory.get(key) === i - 1) {\n if (i === nOthers) {\n result[result.length] = elem;\n memory.set(key, 0);\n if (iterating) {\n j++;\n return {\n value: elem\n };\n }\n } else memory.set(key, i);\n } else if (i === 0) memory.set(key, 0);\n j++;\n }\n j = 0;\n }\n args = null;\n return iterating ? {\n done: true\n } : result;\n };\n };\n const intersect = create();\n intersect.iterable = function(...args) {\n const intersect = create(true);\n let started;\n return {\n next () {\n if (started) return intersect();\n started = true;\n return intersect(...args);\n },\n [Symbol.iterator] () {\n return this;\n }\n };\n };\n return intersect;\n}", "function same(arr1, arr2) {\n if (arr1.length !== arr2.length) return false; // O(1)\n\n for (let i = 0; i < arr1.length; i++) { // O(N)\n let correctIdx = arr2.indexOf(arr1[i] ** 2); // O(N)\n if (correctIdx === -1) return false; // O(1)\n arr2.splice(correctIdx, 1); // O(N)\n }\n return true;\n }", "function funChallenge(input) {\n let a = 10; // O(1)\n a = 50 + 3; // O(1)\n\n for (let i = 0; i < input.length; i++) {\n // O(n)\n anotherFunction(); // O(n)\n let stranger = true; // O(n)\n a++; // O(n)\n }\n return a; // O(1)\n}", "function version2(array){ // O(n)\n let map = {}\n for(let i=0; i< array.length; i++){\n if(map[array[i]] !== undefined ){ // if(0) gives undefined due to type coercion \n return array[i]\n }else{\n map[array[i]] = i\n }\n }\n console.log(map)\n return undefined\n}", "function find_quad (ary, s) {\n\n\tif(ary.length < 4) {\n\n\t\treturn null;\n\t}\n\telse if(ary.length === 4) {\n\n\t\tif(ary[0] + ary[1] + ary[2] + ary[3] === s) return ary;\n\t}\n\n\tvar hashTable = {}; //declare a hashtable \n\tvar tempSum = 0;\n\n\tfor(var i = 0; i < ary.length; i++) {\n\n\t\tfor(var j = i + 1; j < ary.length; j++) {\n\n\t\t\ttempSum = ary[i] + ary[j];\n\t\t\tif(!hashTable[tempSum]) {\n\t\t\t\thashTable[tempSum] = [];\n\t\t\t}\n\t\t\thashTable[tempSum].push([i , j]);\n\t\t}\n\t}\n\n\tconsole.log(hashTable);\n\n\tvar arrayA = [];\n\tvar arrayB = [];\n\tvar result = [];\n\n\tfor(key in hashTable) {\n\n\t\tif(hashTable[s - key]) {\n\n\t\t\tarrayA = hashTable[key];\n\t\t\tarrayB = hashTable[s - key];\n\t\t\tresult = checkUniqueness(arrayA, arrayB);\n\t\t\tif(result) {\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t}\n\t}\n\n\treturn null;\n}", "function fusion(liste)\r\n{\r\n var tempArray = liste.slice(); // Copie temporaire du tableau (liste)\r\n for(var k=0; k<size; k++)\r\n {\r\n if(tempArray[k] != null)\r\n {\r\n var l = k+1;\r\n\r\n while(tempArray[l]==null && l<=size)\r\n {\r\n l++;\r\n }\r\n\r\n if(tempArray[l] == tempArray[k])\r\n {\r\n tempArray[k] = tempArray[k]*2;\r\n tempArray[l] = null;\r\n moved = true;\r\n caseBoitesRemplies--;\r\n }\r\n\r\n k = l-1;\r\n }\r\n }\r\n\r\n var l = 0;\r\n\r\n for(var k=0; k<size; k++)\r\n {\r\n if(tempArray[k] != null)\r\n {\r\n if(l == k)\r\n l++;\r\n else\r\n {\r\n tempArray[l] = tempArray[k];\r\n tempArray[k] = null;\r\n l++;\r\n moved = true;\r\n }\r\n }\r\n }\r\n return tempArray;\r\n}", "function printFirstItemThenFirstHalfThenSayHi100Times(items) {\n console.log(items[0]); // O(1)\n\n let middleIndex = Math.floor(items.length / 2); // O(1)\n let index = 0; // O(1)\n while (index < middleIndex) {\n console.log(items[index]); // O(n/2)\n index++; // O(n/2)\n }\n\n for (let i = 0; i < 100; i++) {\n // O(100)\n console.log('Hi'); // O(100)\n }\n}", "function aVeryBigSum(ar) {\n \n}", "_hash(key) { //O(1)\n let hash = 0;\n for (let i = 0; i < key.length; i++) {//grab the length of 'grapes' (key)\n hash = (hash + key.charCodeAt(i) * i) % this.data.length;\n //charCodeAt(): returns an integer between 0 & 65535 \n //this.data.length: ensures the size stays between 0-50 (memory space for hash table)\n console.log(hash); // 0 14 8 44 48 23\n }\n return hash;\n }", "function insertion_sort(arr) {\r\n var start_time = performance.now();\r\n sorted = arr;\r\n\r\n for(var i = 1;i<sorted.length;i++){\r\n for(var y = 0; y<i; y++){\r\n if(sorted[i] < sorted[y]){\r\n temp = sorted[y];\r\n sorted[y] = arr[i];\r\n arr[i] = temp;\r\n }\r\n }\r\n }\r\n var finish_time = performance.now();\r\n var execution_time = finish_time - start_time;\r\n document.getElementById(\"time_spent\").innerHTML = execution_time;\r\n return sorted;\r\n}", "function uniq_fast(a) {\n\tlet seen = {};\n\tlet out = [];\n\tlet len = a.length;\n\tlet j = 0;\n\tfor(let i = 0; i < len; i++) {\n\t\tlet item = a[i];\n\t\tif(seen[item] !== 1) {\n\t\tseen[item] = 1;\n\t\tout[j++] = item;\n\t\t}\n\t}\n\treturn out;\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 6.4.0)\n \n N = 100001\n var bitmap = Array(N).fill(false);\n for (var i = 0; i < A.length; i ++) {\n if (A[i] > 0 && A[i] <= N) {\n bitmap[A[i]] = true;\n }\n }\n \n for(var j = 1; j <= N; j++) {\n if (!bitmap[j]) {\n return j;\n }\n }\n \n return N + 1;\n}", "function insertSort(arr) {\n console.time('insertSort');\n for(let i = 1; i < arr.length; i++) {\n let temp = arr[i];\n\n let j = i;\n for(j = i; j > 0; j--) {\n if(arr[j - 1] < temp) {\n break;\n } else {\n arr[j] = arr[j - 1];\n }\n }\n arr[j] = temp;\n \n\n // while ( (j > 0) && (arr[j - 1] > temp) ) {\n // arr[j] = arr[j - 1];\n // j--;\n // c++;\n //\n // }\n\n // arr[j] = temp;\n\n }\n\n console.timeEnd('insertSort');\n return arr;\n}", "function funChallenge(input) {\n let a = 10; // O(1)\n a = 50 + 3; // O(1)\n\n for (let i = 0; i < input.length; i++) {\n // O(n) --> number of inputs\n anotherFunction(); // O(n)\n let stranger = true; // O(n)\n a++; // O(n)\n }\n return a; // O(1)\n}", "function r(e,t){var n=i.length?i.pop():[],r=s.length?s.pop():[],a=o(e,t,n,r);return n.length=0,r.length=0,i.push(n),s.push(r),a}", "function ps(t) {\n var e = O(t);\n return O(O(e.bh).persistence).Uo();\n}", "function solution(a) { // O(N)\n let max1; // O(1)\n let max2; // O(1)\n\n for (let value of a) { // O(N)\n if (!max1) { // O(1)\n max1 = value; // O(1)\n } else if (value > max1) { // O(1)\n max2 = max1; // O(1)\n max1 = value; // O(1)\n } else if (value < max1) { // O(1)\n if (!max2) { // O(1)\n max2 = value; // O(1)\n } else if (value > max2) { // O(1)\n max2 = value; // O(1)\n }\n }\n }\n\n return max2; // O(1)\n}", "function countInverse(array) {\n\n split(0, array.length - 1);\n // console.log(\"Result:\" + array);\n //console.log(count);\n //console.log(perf + ' ' + array.length * Math.log(array.length));\n\n function split(left, right) {\n // console.log('Split ' + left + \" \" + right)\n var middle = Math.floor((right + left) / 2);\n\n if (middle > left) {\n split(left, middle);\n split(middle + 1, right);\n }\n merge(left, middle, right)\n }\n\n function merge(left, middle, right) {\n //console.log(\"Merge\" + left + ',' + middle + ',' + right);\n var leftArr = array.slice(left, middle + 1);\n var rightArr = array.slice(middle + 1, right + 1);\n // console.log(leftArr);\n // console.log(rightArr);\n while (leftArr.length > 0 && rightArr.length > 0) {\n perf++;\n if (leftArr[0] < rightArr[0]) {\n array[left++] = leftArr.shift();\n } else {\n count = (count+leftArr.length);\n array[left++] = rightArr.shift();\n }\n }\n leftArr.concat(rightArr);\n while (leftArr.length > 0) {\n array[left++] = leftArr.shift();\n }\n }\n return count;\n }", "function solution(arr){\n\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n // [1,0] . [0,1]\n let f = A[0];\n let count = 0;\n let getOCount = getCount(A, 1);\n let getZCount = getCount(A, 0);\n console.log(getOCount + \" \" + getZCount);\n if (getOCount >= getZCount) {\n for (let i = 0; i < A.length - 1; ++i) {\n if (A[i] === A[i + 1]) {\n if (A[i] === 1) {\n A[i + 1] = 0;\n } else {\n A[i + 1] = 1;\n }\n count++;\n }\n }\n } else {\n for (let i = 0; i < A.length - 1; ++i) {\n if (A[i] === A[i + 1]) {\n if (A[i + 1] === 1) {\n A[i] = 0;\n } else {\n A[i] = 1;\n }\n count++;\n }\n }\n }\n return count;\n}", "function OwnerID(){}// http://jsperf.com/copy-array-inline", "function OwnerID(){}// http://jsperf.com/copy-array-inline", "function singleOccurrence(arr) { }", "function a(e,t){if(e===t){return 0}var r=e.length;var i=t.length;for(var n=0,a=Math.min(r,i);n<a;++n){if(e[n]!==t[n]){r=e[n];i=t[n];break}}if(r<i){return-1}if(i<r){return 1}return 0}", "function a(e,t){if(e===t){return 0}var r=e.length;var i=t.length;for(var n=0,a=Math.min(r,i);n<a;++n){if(e[n]!==t[n]){r=e[n];i=t[n];break}}if(r<i){return-1}if(i<r){return 1}return 0}", "function funChallenge(input) {\n let a = 10; // O(1) Some people don't count assignments\n a = 50 + 3; // O(1)\n\n for (let i = 0; i < input.length; i++) { // O(n) --> n is the input\n anotherFunction(); // O(n)\n let stranger = true; // O(n)\n a++; // O(n)\n }\n return a; // O(1) another thing some people don't count\n}", "lookupAndMarkFound() {\n let m=0;\n for (let n=1; n<=N; n++) {\n for (let i=0;i<N; i++) {\n let fr = this.findInRow(n,i);\n if (fr.length == 1) {\n this.markAndRemove(n,fr[0].i, fr[0].j);\n m++;\n }\n let fc = this.findInColumn(n,i);\n if (fc.length == 1) {\n this.markAndRemove(n,fc[0].i, fc[0].j);\n m++;\n }\n let fb = this.findInBlock(n,i);\n if (fb.length == 1) {\n this.markAndRemove(n,fb[0].i, fb[0].j);\n m++;\n }\n }\n }\n return m;\n }", "function solution(A) {\n // write your code in JavaScript (ECMA-262, 5th edition)\n function compareNumbers(a, b)\n {\n return a - b;\n }\n var rad = [], sorted = A.splice(0).sort(compareNumbers);\n for(var i=0; i<A.length; A++){\n \n }\n \n return 11 > 10000000 ? -1 : 11;\n}", "function A(n,t){for(;t+1<n.length;t++)n[t]=n[t+1];n.pop()}", "function n(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "function n(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "function op1(map, val) { // O(1)\n // insert the val into the map \n // if the val already exists in the map\n // now also have to update the frequencies map \n if (map[val]) { \n // check if map[val] we need to decrement the\n // frequency of map[val]\n // increment its value \n map[val]++;\n // increment frequecy of map[val] in the frequency map\n } else {\n // otherwise, add it to the map with a value of 1\n map[val] = 1;\n // add map[val] to our frequencies map \n }\n}", "function OwnerID(){} // http://jsperf.com/copy-array-inline", "function solve(input) {\n let elves = [];\n for (let i = 0; i < input; i++) {\n elves.push(i + 1);\n }\n\n function getNextIndex(index) {\n let next = (elves.length / 2) + index;\n if (next >= elves.length) {\n next -= elves.length\n }\n if (!_.isInteger(next)) {\n next = _.floor(next);\n }\n return next;\n }\n\n let current = elves[0];\n // let currentTime = new Date().getTime();\n while (elves.length > 1) {\n let index = _.indexOf(elves, current);\n let nextIndex = getNextIndex(index);\n // if (index % 100 === 0) {\n // let newTime = new Date().getTime();\n // console.log(index, elves[index], elves[nextIndex], elves.length, newTime - currentTime);\n // currentTime = newTime;\n // }\n elves[nextIndex] = 0;\n elves = _.compact(elves);\n let nextCurrent = _.indexOf(elves, current) + 1;\n if (nextCurrent >= elves.length) {\n nextCurrent = 0;\n }\n current = elves[nextCurrent];\n }\n console.log(input, elves[0]);\n}", "function sumZeroForMethod(arr) {\n let i = 0;\n for (let j = 0; j < arr.length; j++) {\n if (arr[i] !== arr[j]) {\n i++;\n arr[i] = arr[j];\n }\n }\n\n return i + 1;\n}", "function o(e,t){if(e===t)return 0\nfor(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i]\nbreak}return r<n?-1:n<r?1:0}", "function fL(a){var i,l,ret=[]\n for(i=0,l=a.length;i<l;){\n ret.push(a[i])\n while(a[i]+1 == a[++i] && i<l);\n if(a[i-1]!==0x10ffff)ret.push(a[i-1]+1)}\n return ret}", "function firstRecurringCharacter(input) {\n for (let i = 0; i < input.length; i++) {\n for (let j = i + 1; j < input.length; j++) {\n if(input[i] === input[j]) {\n return input[i];\n }\n }\n }\n return undefined\n}//O(n^2) with Space Complexicity O(1)", "function a(e,t){var n=i.length?i.pop():[],a=o.length?o.pop():[],s=r(e,t,n,a);return n.length=0,a.length=0,i.push(n),o.push(a),s}", "function solution(a) {\r\n // write your code in JavaScript (Node.js 0.12)\r\n var i, l=a.length-1;\r\n var arr=[];\r\n do{ \r\n arr[a[l]-1] = a[l];\r\n \r\n l--; \r\n if(l===0)\r\n for(j=0;j<arr.length;j++)\r\n if(!arr[j])\r\n return j+1;\r\n \r\n }while(l>=0)\r\n}", "function o(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "function o(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "function calcToRemove(a, b)\n{\n\tvar subLengths = 0;\n\tfor (var i = 0; i < a.table.length; i++)\n\t{\n\t\tsubLengths += a.table[i].table.length;\n\t}\n\tfor (var i = 0; i < b.table.length; i++)\n\t{\n\t\tsubLengths += b.table[i].table.length;\n\t}\n\n\tvar toRemove = a.table.length + b.table.length;\n\treturn toRemove - (Math.floor((subLengths - 1) / M) + 1);\n}", "function calcToRemove(a, b)\n{\n\tvar subLengths = 0;\n\tfor (var i = 0; i < a.table.length; i++)\n\t{\n\t\tsubLengths += a.table[i].table.length;\n\t}\n\tfor (var i = 0; i < b.table.length; i++)\n\t{\n\t\tsubLengths += b.table[i].table.length;\n\t}\n\n\tvar toRemove = a.table.length + b.table.length;\n\treturn toRemove - (Math.floor((subLengths - 1) / M) + 1);\n}", "function calcToRemove(a, b)\n{\n\tvar subLengths = 0;\n\tfor (var i = 0; i < a.table.length; i++)\n\t{\n\t\tsubLengths += a.table[i].table.length;\n\t}\n\tfor (var i = 0; i < b.table.length; i++)\n\t{\n\t\tsubLengths += b.table[i].table.length;\n\t}\n\n\tvar toRemove = a.table.length + b.table.length;\n\treturn toRemove - (Math.floor((subLengths - 1) / M) + 1);\n}", "function calcToRemove(a, b)\n{\n\tvar subLengths = 0;\n\tfor (var i = 0; i < a.table.length; i++)\n\t{\n\t\tsubLengths += a.table[i].table.length;\n\t}\n\tfor (var i = 0; i < b.table.length; i++)\n\t{\n\t\tsubLengths += b.table[i].table.length;\n\t}\n\n\tvar toRemove = a.table.length + b.table.length;\n\treturn toRemove - (Math.floor((subLengths - 1) / M) + 1);\n}", "function calcToRemove(a, b)\n{\n\tvar subLengths = 0;\n\tfor (var i = 0; i < a.table.length; i++)\n\t{\n\t\tsubLengths += a.table[i].table.length;\n\t}\n\tfor (var i = 0; i < b.table.length; i++)\n\t{\n\t\tsubLengths += b.table[i].table.length;\n\t}\n\n\tvar toRemove = a.table.length + b.table.length;\n\treturn toRemove - (Math.floor((subLengths - 1) / M) + 1);\n}", "function calcToRemove(a, b)\n{\n\tvar subLengths = 0;\n\tfor (var i = 0; i < a.table.length; i++)\n\t{\n\t\tsubLengths += a.table[i].table.length;\n\t}\n\tfor (var i = 0; i < b.table.length; i++)\n\t{\n\t\tsubLengths += b.table[i].table.length;\n\t}\n\n\tvar toRemove = a.table.length + b.table.length;\n\treturn toRemove - (Math.floor((subLengths - 1) / M) + 1);\n}", "function solution(A) {\r\n // write your code in JavaScript (Node.js 8.9.4)\r\n \r\n let sorted = A.sort();\r\n let storage = {};\r\n \r\n // Store sorted Array in a json using the value as the key\r\n for (let i = 0; i < sorted.length; i++) {\r\n storage[sorted[i]] = sorted[i];\r\n }\r\n \r\n // If the storage does not contain the key from the loop below, return the key\r\n for (let i = 1; i < 1000001; i++) {\r\n if (!storage[i]) return i; \r\n }\r\n \r\n return 1;\r\n}", "function countToArrayObject(source, storage){\r\n for(i=0; i<source.length; i++){\r\n if(i===0){\r\n storage.push(source[i]);\r\n storage[i].count += 1\r\n }\r\n if(i>0){\r\n var cek = 0;\r\n for(j = 0; j < storage.length; j++){\r\n if((source[i].key === storage[j].key) === true){\r\n cek = 1;\r\n pos = j;\r\n break;\r\n } \r\n }\r\n \r\n if(cek === 0){\r\n storage.push(source[i]);\r\n storage[storage.length -1 ].count += 1;\r\n }\r\n else{\r\n storage[pos].count += 1;\r\n }\r\n }\r\n }\r\n}", "function reoccurring(arr){\n\tfor(let i = 0; i < arr.length; i++){\n\t\tfor(j = i+1; j < arr.length; j++){\n\t\t\tif(arr[i] === arr[j]){\n\t\t\t\treturn arr[i]\n\t\t\t}\n\t\t}\n\t}\n\treturn undefined\n} // O(n^2)", "function firstDuplicateValue(array) {\n\tconst visited = new Set();\n \tfor (i = 0; i<array.length;i++) {\n\t\tif (visited.has(array[i])) {\n\t\t\treturn array[i];\n\t\t} else visited.add(array[i]);\n\t\tconsole.log(visited)\n\t}\n\treturn -1;\n}", "function i(a){for(var b=\"\",c=0;c<a.length;c++)b+=j(a[c]);return b}", "function s(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "function calcToRemove(a, b)\n\t{\n\t\tvar subLengths = 0;\n\t\tfor (var i = 0; i < a.table.length; i++)\n\t\t{\n\t\t\tsubLengths += a.table[i].table.length;\n\t\t}\n\t\tfor (var i = 0; i < b.table.length; i++)\n\t\t{\n\t\t\tsubLengths += b.table[i].table.length;\n\t\t}\n\n\t\tvar toRemove = a.table.length + b.table.length\n\t\treturn toRemove - (Math.floor((subLengths - 1) / M) + 1);\n\t}", "function op2(map, val) { // O(1)\n // delete the val from the map \n // if the val already exists in the map\n if (map[val]) {\n // decrement the old frequency of map[val]\n // decrement its value \n map[val]--;\n // increment the new frequency in map[val]\n }\n // otherwise, we don't do anything \n}", "unique() {\n var arr = [];\n for(var i = 0; i < this.length; i++) {\n if(!arr.contains(this[i])) {\n arr.push(this[i]);\n }\n }\n return arr; \n}", "function Gn(e,t){var a=e[t];e.sort(function(e,t){return P(e.from(),t.from())}),t=d(e,a);for(var n=1;n<e.length;n++){var r=e[n],f=e[n-1];if(P(f.to(),r.from())>=0){var o=G(f.from(),r.from()),i=U(f.to(),r.to()),s=f.empty()?r.from()==r.head:f.from()==f.head;n<=t&&--t,e.splice(--n,2,new Di(s?i:o,s?o:i))}}return new Oi(e,t)}", "function n(e,t){var n=o.length?o.pop():[],a=i.length?i.pop():[],u=r(e,t,n,a);return n.length=0,a.length=0,o.push(n),i.push(a),u}", "function findDuplicate(nums) {\n if (nums.length > 1) {\n let slow = nums[0], fast = nums[nums[0]];\n\n while (slow !== fast) {\n slow = nums[slow];\n fast = nums[nums[fast]];\n }\n\n fast = 0;\n\n while (fast !== slow) {\n slow = nums[slow];\n fast = nums[fast];\n }\n\n return slow;\n }\n\treturn -1;\n}", "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function i(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function i(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function i(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function i(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function i(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function i(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function i(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function solution(A) {\n\n}", "function i$1(t,i,r){if(!t.allDirty)if(null!=t.from&&null!=t.count){const s=Math.min(t.from,i),l=Math.max(t.from+t.count,i+r)-s;t.from=s,t.count=l;}else t.from=i,t.count=r;}", "function permMissingElem2(A) {\n\tvar comparisonArray = [];\n\t\n\tfor (var i=0; i < A.length +1; i++) {\n\t\tcomparisonArray[i] = i+1;\n\t}\n\n\tfor (i=0; i < comparisonArray.length; i++) {\n\t\tif (A.indexOf(comparisonArray[i]) === -1) {\n\t\t\treturn comparisonArray[i];\n\t\t} \n\t\n\t}\n\n}", "function findUnique(wordsArr) {\n \n}", "function prune(arr){\r\n//\tGM_log(\"arr.length : \"+arr.length);\r\n\tvar i = 0;\r\n\tfor(j in arr){\r\n\t\ti = j;\r\n\t\t// excluding i where i-1 or i+1 doesn't exist\r\n\t\tif(i > 0 && i < (arr.length -1)){\r\n\t\t\tvar test = Math.abs(arr[i*1+1] - arr[i-1]);\r\n\t\t//\tGM_log(\"test : \"+test+\" = arr[\"+i+\"+1] : \"+arr[i+1]+\" - arr[\"+i+\"-1] : \"+arr[i-1]);\r\n\t\t//\tGM_log(\"All [i] - i : \"+i+\" -> test : \"+test);\r\n\t\t\tif(test < smallest){\r\n\t\t//\t\tGM_log(\"i : \"+i+\" -> test : \"+test);\r\n\t\t\t\tsmallest = test;\r\n\t\t\t\trememberI = i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n//\tGM_log(\"rememberI : \"+rememberI);\r\n\treturn rememberI;\r\n}", "function solution(A) {\n var set = new Set(),\n arrayLength = A.length;\n for (var i =0; i < arrayLength; i++) {\n if (set.has(A[i])) {\n set.delete(A[i]);\n continue;\n }\n set.add(A[i]);\n }\n return (set.values()).next().value;\n}", "function ex_2(myA){\n return myA.filter(x => x % 2 == 0) // O(myA.length)\n .map(a => a * a) // O(myA.length)\n .reduce((acc, x) => acc + x, 0); // O(myA.length)\n}", "function a(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "function e(t,n){for(;n+1<t.length;n++)t[n]=t[n+1];t.pop()}", "function solution(A) {\n let map = []\n let index = 1;\n for(let i = 0; i < A.length + 1; i++) {\n map[A[i]] = true;\n }\n\n while( index < A.length + 1) {\n if(!map[index]) break;\n index++;\n }\n\n return index;\n}", "compareDNA(obj) { \n //identical variable is the number of duplicates per index of both this.dna and obj.dna arrays\n let identical = 0\n this.dna.forEach( (element, index) => element === obj.dna[index] ? identical++ : identical += 0)\n\n //percentage variable, of course finds the percentage of duplicates both arrays\n let percentage = Math.floor(identical / this.dna.length * 100)\n\n return `specimen #1 and specimen #2 have ${percentage}% DNA in common.`\n }", "function e(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "addToSet(set) {\n let copy2, placed = false;\n for (let i = 0; i < set.length; i++) {\n let other = set[i];\n if (this.eq(other))\n return set;\n if (this.type.excludes(other.type)) {\n if (!copy2)\n copy2 = set.slice(0, i);\n } else if (other.type.excludes(this.type)) {\n return set;\n } else {\n if (!placed && other.type.rank > this.type.rank) {\n if (!copy2)\n copy2 = set.slice(0, i);\n copy2.push(this);\n placed = true;\n }\n if (copy2)\n copy2.push(other);\n }\n }\n if (!copy2)\n copy2 = set.slice();\n if (!placed)\n copy2.push(this);\n return copy2;\n }", "function countUniqueValues2(arr){\n if(arr.length < 2){\n return arr.length;\n }\n let i=0\n for(let j=1; j<arr.length; j++){\n if(arr[i]!==arr[j]){\n arr[++i] = arr[j]\n }\n }\n return i+1;\n}", "function findUnique(wordsArr) {\n //\n}", "function findUnique(wordsArr) {\n //\n}" ]
[ "0.5820679", "0.5787601", "0.5734751", "0.57192147", "0.56462574", "0.56139266", "0.5543364", "0.550842", "0.548855", "0.5445043", "0.54335546", "0.54029053", "0.537168", "0.53455395", "0.5323178", "0.532034", "0.5311005", "0.53068864", "0.5275456", "0.5257535", "0.52550274", "0.52458113", "0.5237876", "0.52318513", "0.5210792", "0.5203856", "0.5193767", "0.51922524", "0.5181722", "0.51718014", "0.5167435", "0.51664245", "0.5155287", "0.5151124", "0.5141563", "0.5141563", "0.51382375", "0.51375145", "0.51375145", "0.5129682", "0.5118467", "0.5115879", "0.51060045", "0.50913656", "0.50913656", "0.5088367", "0.5084135", "0.5081066", "0.5076923", "0.5074175", "0.50627595", "0.50573313", "0.5056075", "0.5044445", "0.5043374", "0.5043374", "0.5042767", "0.5042767", "0.5042767", "0.5042767", "0.5042767", "0.5042767", "0.5031422", "0.5030094", "0.50266683", "0.50230944", "0.5020984", "0.50169307", "0.50071496", "0.50005424", "0.49981606", "0.4997076", "0.49954572", "0.4994951", "0.49928206", "0.49928206", "0.49928206", "0.49928206", "0.4992774", "0.4992774", "0.4992774", "0.4992774", "0.4992774", "0.4992774", "0.4992774", "0.49878135", "0.49873775", "0.49854165", "0.49827877", "0.4980716", "0.49806413", "0.4977907", "0.4977826", "0.4977454", "0.49721012", "0.497158", "0.49703398", "0.49641588", "0.49636436", "0.49588814", "0.49588814" ]
0.0
-1
Enty array that will hold total sum for each card
function alex(){ for (arrayPosition = 0; arrayPosition < array.length; arrayPosition++){ for (i=0; i < array[arrayPosition].length; i++){ if (isNaN(array[arrayPosition][i])) { continue; } else { sum += parseInt(array[arrayPosition][i]); } } // inside for loop totals.push(sum); sum = 0; } // outside for loop arrayPosition console.log("Array with totals: " + totals); var topNumber = Math.max.apply(Math, totals); console.log('------'); var index = totals.lastIndexOf(topNumber); console.log("Highest count is: " + topNumber + " and the credit card number is: " + array[index]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get sum() {\r\n let cardSum = 0\r\n for (const card of this.cards) {\r\n cardSum += card.value;\r\n }\r\n return cardSum\r\n }", "total (itens) {\n prod1 = list[0].amount\n prod2 = list[1].amount\n prod3 = list[2].amount\n prod4 = list[3].amount\n\n itens = prod1 + prod2 + prod3 + prod4\n\n return itens\n }", "function sum_array(total, sum){\n \t\t\treturn total + sum;\n }", "function total(arr)\n{\n\t//your code here \n\tconst result = arr.reduce(function(num, addedValue){\n\t\taddedValue = addedValue + num; // 0 + 1 = 1, 1 + 2 = 3, 3 + 3 = 6\n\t\treturn addedValue;\n\t});\n\treturn result;\n}", "function sumDealerPoints() {\n dealerPointTotal = cardsDealtDealer.reduce((pointTotal, cardParameter) => {\n return pointTotal + cardParameter.points;\n }, 0);\n console.log(dealerPointTotal);\n }", "function total(arr) {\n const result = arr.reduce(function(num, finalSum){\n return finalSum = finalSum + num;\n });\n return result;\n \n}", "function total(arr) {\n return arr.reduce((acc, el) => acc + el)\n}", "function sumValues() {\n return data.reduce((temp, currValue) => temp + currValue.cost, 0);\n }", "function addTotal(arr){\n arr.forEach(function(ele){\n let total=0;\n total=ele.science+ele.maths+ele.english\n ele.total=total;\n })\n }", "get splitSum(){\r\n let splitCardSum = 0\r\n for (const card of this.splitCards) {\r\n splitCardSum += card.value;\r\n }\r\n return splitCardSum\r\n }", "function sumArr(array){\n\n}", "function total(index) {\n\n var total = 0\n matrix[index].forEach(element => {\n total += element\n })\n return total; \n\n }", "calcBetAmount() {\n let total = this.chipTotalAmount.reduce((a, b) => {\n return a + b;\n });\n return total;\n }", "function totals(arr){\n\tvar total = 0;\n\tvar t_M = 0;\n\tvar ft_M = 0;\n\tvar f_M = 0;\n\tarr.forEach(function totals(element){\n\t\tt_M += element.threesMade;\n\t\tft_M += element.freeThrowsMade;\n\t\tf_M += element.fieldGoalsMade;\n\t});\n\tf_M -= t_M;\n\tf_M *= 2;\n\tt_M *= 3;\n\ttotal += f_M + t_M + ft_M;\n\treturn total;\n}", "_sum (arr) {\r\n return arr.reduce((acc,val) => acc+val)\r\n }", "function totalOfArray(arr) {\n const result = arr.reduce(function(finalAddition, num) {\n finalAddition = finalAddition + num;\n return finalAddition;\n });\n return result;\n}", "calculateHand() {\n let sum = 0;\n let holdAce = [];\n for (const card of this.hand){\n if (card.isAce()) {\n holdAce.push(card);\n } else {\n sum += card.getValue();\n }\n }\n // Count an Ace as an 11 as long as it doesn't bust the hand. If there is more than one Ace only one can be 11.\n for (const ace of holdAce){\n let tempSum = sum + ace.getValue();\n if (tempSum >21){\n sum += 1;\n } else {\n sum += ace.getValue();\n }\n }\n return sum;\n }", "function getSum(hand) {\n var sum = 0;\n var aceCount = 0;\n for(var i = 0; i ( hand.length; i++) {\n cardValue = getValue(hand[i]);\n if(cardValue == 1) {\n aceCount += 1;\n } else {\n sum += cardValue;\n }\n }\n for(var i = 0; i ( aceCount; i++) {\n sum += 1;\n }\n for(var i = 0; i ( aceCount; i++) {\n if(sum + 10 (= 21) {\n sum += 10;\n }\n }\n return sum;\n}", "function shoppingSpree(arr) {\n return arr.reduce((total, curr) => {\n return total + curr.price;\n }, 0);\n}", "function shoppingSpree(arr) {\n return arr.reduce((total, curr) => {\n return total + curr.price;\n }, 0);\n}", "function total(arr) {\n return arr.reduce(function (final, num) {\n return (final += num);\n });\n}", "calcTotal(){\n\t\t\tlet length = this.sales.length;\n\t\t\tthis.paidCommissionTotal = 0;\n\t\t\tthis.commissionTotal = 0;\n\t\t\tfor(let i = 0; i < length; ++i){\n\t\t\t\t\tthis.commissionTotal += this.sales[i].commission;\n\t\t\t\t\tif(this.sales[i].paid == true){\n\t\t\t\t\t\tthis.paidCommissionTotal += this.sales[i].commission;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tthis.sales.length;\n\t\t}", "function sum(){\r\n var sumArray = array.reduce((total,num)=>{return total + num;});\r\n console.log(sumArray);\r\n}", "function shoppingSpree(arr) {\n let sum = arr.reduce((a, {price}) => a + price, 0);\n return sum;\n }", "function calculateTotalPrice(arr){\n return arr.reduce((a, cv) => a + cv, 0);\n}", "function sum(arr){\n\nresult = arr.reduce((total, elem)=>{\n return total += elem;\n })\n return result}", "function findTotal(dataArray){\n let sum = 0;\n for (let i = 0; i < dataArray.length; i++){\n sum += dataArray[i];\n }\n return sum;\n}", "function gainTotalBalance(arr){\n let total = 0\n for(let i = 0; i < arr.length; i++){\n let element = arr[i]\n total = total + element\n }\n return total\n}", "function addCards(addHand) {\n var total = 0;\n var list = [];\n\n for (var i = 0; i < addHand.cards.length; i++) {\n\n if (addHand.cards[i].face != 'A') {\n list.unshift(addHand.cards[i]);\n }\n else {\n list.push(addHand.cards[i]);\n }\n }\n\n\n\n for (var i = 0; i < list.length; i++) {\n\n if (list[i].face != 'A') {\n total += list[i].value;\n }\n else {\n\n if (total < 11) {\n total += 11;\n }\n else {\n total += 1;\n }\n }\n }\n\n return total;\n}", "function sumArray(array) {\n return array.reduce(function (prev, cur) {\n return prev + cur;\n }, 0);\n }", "function sumPrices(cartArray) {\n var sum = 0;\n for (var i = 0; i < cartArray.length; i++) {\n sum = sum + cartArray[i].price;\n }\n console.log(sum);\n}", "function sum(array) {\n // create a variable 'total' to store the sum . init to 0\n var total = 0;\n // run for-loop to access & add each element to the total\n for (var i = 0; i < array.length; i++) {\n total += array[i];\n }\n return total;\n}", "function total() {\n let totalCost = 0\n for (var i = 0; i < cart.length; i++) {\n for (var item in cart[i]) {\n totalCost += cart[i][item]\n }\n }\n return totalCost\n}", "function getSums (arr){\n var result = []\n if(!arr.length) return result\n\n var totalSum = arr.reduce(function (previous, current){\n result.push(previous)\n return previous + current\n })\n result.push(totalSum) //without this line the last element of the work reduce will not be displayed\n return result\n}", "function addCardValues(hand) {\n let cardTotal = 0;\n\n for (let i = 0; i < hand.length; i += 1) {\n if (hand[i].name === \"J\" || hand[i].name === \"Q\" || hand[i].name === \"K\") {\n cardTotal += 10;\n } else if (hand[i].name === \"A\") {\n if (cardTotal > 11) {\n cardTotal += 1;\n } else {\n cardTotal += 11;\n }\n } else {\n cardTotal += hand[i].name;\n }\n }\n return cardTotal;\n}", "function getTotal() {\n\t\treturn cart.reduce((current, next) => {\n\t\t\treturn current + next.price * next.count;\n\t\t}, 0);\n\t}", "function totalPrice (arr) {\n var total = 0;\n arr.forEach(function (element) {\n return total += element.price; \n }) \n return total; \n}", "function shoppingSpree(arr) {\n return arr.reduce((acc, el) => acc + el.price, 0) \n}", "sum(arr) {\n return arr.reduce( (sum, val) => sum + val, 0);\n }", "function total(arr) {\n return arr.reduce((a, b) => a + b);\n}", "function addChange(cashArr) {\n let total = 0;\n for (let x = 0; x < cashArr.length; x++) {\n total = total + cashArr[x][1];\n }\n return total;\n }", "function summArray(array){\n var tot = 0;\n for(var i = 0; i < array.length; i++){\n tot += array[i]\n }\n return tot\n}", "function calculateSum(arrayType) {\n\t//arrayType can be srcAmounts or expAmounts(two global arrays)\n\tlet totalSum = 0;\n\ttotalSum = arrayType.reduce(function(acc, curr) {\n\t\treturn acc + curr;\n\t}, 0);\n\treturn totalSum;\n}", "function sumArray(arr){\n var total = 0;\n arr.forEach(function(element){\n total += elemtnl;\n });\n return total;\n}", "function sumArray(array){\n\tvar total = 0;\n\tarray.forEach(function(element){\n\t\ttotal += element;\n\t\n\t});\n\treturn total;\n}", "function pushArray() {\n\t\t\tfor (var i = 0; i<friends.length; i++) {\n\t\t\t\tfor (var x = 0; x<friends[i].scores.length; x++) {\n\t\t\t\t\ttotal += parseInt(friends[i].scores[x]);\n\t\t\t\t}\n\t\t\t\ttotalArray.push(total);\n\t\t\t\ttotal = 0;\n\t\t\t}\n\t\t\tconsole.log(totalArray);\n\t\t\tdifference();\n\t\t}", "function sum (array) {\n\tvar total = 0 ;\n\tfor (var i=0 ; i<array.length ; i++) {\n\t\ttotal += array[i]\n\t}\n\treturn total ;\n}", "function checktotal(arr) {\r\n var rValue = 0;\r\n var aceAdjust = false;\r\n for(var i in arr) {\r\n if(arr[i].cardnum == 'A' && !aceAdjust) {\r\n aceAdjust = true;\r\n rValue=rValue + 10;\r\n }\r\n rValue=rValue+arr[i].cardvalue;\r\n }\r\n if (aceAdjust && rValue > 21) {\r\n rValue = rValue - 10\r\n }\r\n return rValue;\r\n }", "function sumArray(arr) {\n // let total =0;\n // for(let i=0; i < arr.length; ++i){\n // total += arr[i]\n // }\n\n // return total\n\n return arr.reduce((accumulator, currentValue) => accumulator + currentValue)\n\n\n\n\n\n}", "function addAllValues(array){\n let currentTotal = 0;\n console.log(array);\n console.log(array[1]);\n for ( let i = 0; i < array.length; i++){\n currentTotal = currentTotal + array[i];\n }\n return currentTotal;\n}", "function total(arr) {\n return arr.reduce((a, b) => a + b, 0);\n}", "function sumArrayfor(array){\n let sum =0;\n for(let i=0; i<array.length;i++){\n sum += array[i];\n }\n return sum;\n}", "function totalNewArray(){\n\t\t\tfor (var i = 0; i<req.body.scores.length; i++){\n\t\t\ttotalNew += parseInt(req.body.scores[i]);\n\t\t\t}\n\n\t\t\tconsole.log(totalNew);\n\t\t\tpushArray();\n\t\t}", "function sum (array) {\n if (!array.length) {\n return 0;\n };\n return array.reduce(function(acc, curr) {\n return Number(acc) + Number(curr);\n });\n }", "function eachBikePriceSum(arr) {\n return arr.map(Number)\n .reduce((a, b) => a + b);\n }", "function sum()\n{\n var temp=0;\n for(var i=0;i<cart.length;i++)\n {\n temp=temp+ cart[i].price;\n }\n return temp;\n}", "function getArrOfSums(arr){\r\n\t\r\n\tlet sumArr = [];\r\n\t\r\n\tfor (let i = 0; i < arr.length; i++){\r\n\t\t\r\n\t\tsumArr.push(arr[i].reduce((t, el) => t + el));\r\n\t\r\n\t}\r\n\t\r\n\treturn sumArr;\r\n}", "sum(){\n let t=data[0];\n var sum;\n for(x=0;x<t.length; x++){\n sum=sum+t[x];\n }\n return sum;\n }", "function sum(array){\n\tlet somme = 0;\n\tarray.forEach( (element) => { somme+=element;})\n\treturn somme;\n}", "function sumArray(arr) {\n let total=0;\n for (let i=0;i<arr.length;i++){\n total+=arr[i];\n }\n return total;\n }", "function sum(array) {\r\n return array.reduce((summ, element) => {\r\n return summ + element\r\n });\r\n}", "function branchestotal() {\n let arraytotal = [];\n\n for (let i = 0; i < hours.length; i++) {\n let sum = Seattle.salesbyhour[i] + Tokyo.salesbyhour[i] + Dubai.salesbyhour[i] +\n Paris.salesbyhour[i] + Lima.salesbyhour[i];\n arraytotal.push(sum);\n }\n\n return arraytotal;\n\n}", "function sumPrices(cartArray) {\n // for loop through array; sum value of price attribute for each object\n var total = 0;\n \n for(var i=0; i<cartArray.length; i++) {\n if(cartArray[i].price) {\n total = total + cartArray[i].price;\n }\n }\n \n //to do: print total as HTML to page, next to cart icon\n console.log(total);\n}", "function sumArray(array) {\n total = 0;\n for (i = 0; i < array.length; i++) {\n total += array[i];\n }\n return total;\n}", "function totalPrice2(arr) {\n let sum = arr.reduce((total, item) => (total += item), 10);\n return \"Total value is $\" + sum * pricePerCoffee;\n}", "function addExpenses(array) {\n let sum = 0;\n for (let i = 0; i < array.length; i++) {\n sum = sum + array[i];\n }\n return sum;\n }", "function totalValue($arr) {\n var $totalProductValue = 0; // create variable to hold total value\n for (i=0;i<$arr.length;i++) { // loop through every item in the $products array\n $productObj = $arr[i]; // get each product object from the array\n $perItemCost = $productObj['unit_price']; // create variable for individual item cost and get each product object's unit_price value\n $perItemInventory = $productObj['inventory']; // create variable for individual item inventory and get each product object's inventory value\n $perItemValue = $perItemCost * $perItemInventory; // calculate total value of each item's inventory \n $totalProductValue += $perItemValue; // add indiv item's value to the totalProductValue variable\n }\n return $totalProductValue; // returns the total value after the loop is complete\n }", "function sum(arr) {\n return arr.reduce(function(a, b) {\n return a + b;\n }, 0);\n }", "function sum(arry) {\n\t\t\tvar total = 0;\n\t\t\tfor (i in arry) total += arry[i];\n\t\t\treturn total;\n\t\t}", "function suma(array) {\n\t\t\tlet suma = 0;\n\t\t\tfor(i=0; i<array.length; i++) {\n\t\t\t\tsuma = suma + array[i];\n\t\t\t};\n\t\t\treturn suma;\n\t\t}", "function sum(arr) {\n return arr.reduce(function(a, b) {\n return a + b;\n });\n }", "function sum_reduce(array){\r\n return array.reduce(function(total,value){\r\n return total+value\r\n },10);\r\n}", "function sum(array) {\n return array.reduce((total, current) => total + current, 0);\n}", "sumCredit(courses){\n\t\tvar sum=0;\n\t\tfor(var i=0;i<courses.length;i++){\n\t\t\tsum=sum+parseInt(courses[i].courseCredit);\n\t\t}\n\t\treturn sum;\n\n\t}", "function sum(myArray) {\n var mytotal = 0;\n for(var i = 0; i<myArray.length; i++){\n mytotal += myArray[i];\n }\n \n return mytotal;\n}", "function sumArray(arr){\n\tvar sum = 0;\n\tarr.forEach(function(data){\n\t\tsum=sum+data;\n\t});\n\treturn sum;\n}", "function getSums(arr) {\r\n var newArray = [];\r\n arr.reduce(function(previousValue, currentValue, index, array) {\r\n newArray.push(previousValue + currentValue);\r\n return previousValue + currentValue;\r\n });\r\n return newArray;\r\n}", "function sumElementArray(array) {\n var sumTotal = 0;\n for (var count = 0; count < array.length; count++) {\n sumTotal += array[count];\n }\n return sumTotal;\n}", "function sumPlayerTotal () {\nfor ( var i = 0; i < playerHand.length; i++){\n playerTotal += playerHand[i].weight;\n }\n return playerTotal;\n}", "function sum(arr){\n let sum=0;\n for(let i=0; i<arr.length; i++){\n sum +=arr[i];\n }\n return sum;\n }", "calulateHandValue(){\n //Sorts the hand by in ascending order of card value, then reverses it for simpler calculation.\n const sortedHand = this.hand.slice().sort((a,b)=>a.value - b.value).reverse();\n\n //Now, to add up the sum of the cards.\n let handTotal = 0;\n sortedHand.forEach(element => {\n if(element.value === 0)\n {\n if(handTotal <= 10){\n handTotal += 11; //Ace is 11 if it wouldn't make the hand go bust,\n }else{\n handTotal += 1;//and is 1 otherwise.\n }\n }else{\n handTotal += element.value;\n }\n });\n return handTotal;\n }", "function calcularTotal(){\n //borrar el precio \n total=0;\n //recorrer el array de la cesta y obtener el precio de cada producto\n for(let item of arrayCesta){\n let itemcesta=productos.filter(function(objetoproductos){\n return objetoproductos['tag']==item;\n });\n //se suma el total\n total=total+itemcesta[0]['precio'];\n }\n //mostrar el precio\n $total.textContent=total.toFixed(2);\n}", "function total() {\n var total = 0\n for(var i = 0; i < cart.length; i++){\n total += cart[i].itemPrice\n }\n return total\n}", "function totalPriceIntoCart(panier) {\n let total = 0;\n\n for (let index = 0; index < panier.length; index++) {\n let articleQuantity = panier[index].quantity;\n let articlePrice = priceById[panier[index].id];\n\n total = total + articleQuantity * articlePrice;\n\n }\n\n return total;\n}", "function sumArray(array){\n var total = 0;\n array.forEach(function(element){\n total += element;\n });\n return total;\n}", "function sumAll( ) {\n let sum = 0;\n // TODO: loop to add items\n return sum;\n}", "function total(x){\n let resultat=0\n for(let i=0; i<x.length;i++){\n resultat += x[i]\n }\n return resultat\n}", "function total() {\n var totalValue = 0;\n for (var i = 0; i < cart.length; i++) {\n totalValue += cart[i].itemPrice\n }\n return totalValue;\n}", "getTotal() {\n let gameOver = false;\n // total number of cards in arrays indexes [3] & [4]\n let strongCards = 0;\n // total all cards in the matrix \n let total = 0;\n // number of cards in the deck - use to determine progress in a deck\n const deckTotal = this.deck.length;\n for (let i=0; i<5; i++) {\n if (i > 2) {\n strongCards += this.matrix[i].length;\n }\n total += this.matrix[i].length;\n }\n // check to see if user completed the deck\n if (strongCards === deckTotal){\n gameOver = true;\n }\n return { strong: strongCards, total: total, deckTotal: deckTotal, gameOver: gameOver};\n }", "function sumEntries(entriesArray) {\n let total = 0\n\n for (let entry of entriesArray) {\n total += entry\n }\n\n return total\n}", "function sumArray(total, num) {\n return total + num\n}", "function shoppingSpree(arr) {\n return arr.reduce((a, b) => a + b.price, 0)\n}", "function sum(array) {\n return array.reduce((total, value) => total + value)\n}", "function sum(arr){\n return arr.reduce(function(d, i){ return i + d; });\n }", "function sumArray(array) {\n\tvar result = 0\n\tarray.forEach(function(element) {\n\t\tresult += element;\n\t});\n\treturn result \n}", "function sum(arr) {\n \tconst len = arr.length;\n \tlet result = 0;\n \tfor (let i = 0; i < len; i++) {\n \t\tresult += arr[i];\n \t}\n \treturn result;\n }", "function sumArray(arr) {\n var total = 0;\n arr.forEach(function (element) {\n total += element;\n });\n return total;\n}", "function arraySum(pArray)\n{\n return pArray.reduce (function(tot,item){tot+=item},0,this)\n return sum;\n}", "function sum(array) {\n var total = 0;\n for (var i=0; i<array.length; i++) {\n total += array[i];\n }\n return total;\n}", "_arraySum(array,item,begin,n) {\r\n let sum=0, x=0;\r\n for(x=0; x < n; x++) {\r\n let ix = ((begin+x) % array.length);\r\n sum += array[ix][item];\r\n }\r\n return this._round(sum,8);\r\n }", "function totalScore(scorecard) {\n var sum = 0;\n for (var i = scorecard.scorecardItems.content.length - 1; i >= 0; i--) {\n // condtion to only sum the scores that have been scored, -1 equates not summed\n if ( scorecard.scorecardItems.content[i].score >= 0 ) {\n sum+=scorecard.scorecardItems.content[i].score\n }\n };\n return sum;\n }" ]
[ "0.7053534", "0.69008124", "0.68277574", "0.6823024", "0.6787793", "0.6728793", "0.66848296", "0.6633015", "0.66231424", "0.6601148", "0.6565345", "0.6546556", "0.65377533", "0.6531683", "0.652488", "0.6522388", "0.6509741", "0.6499215", "0.64952296", "0.6491637", "0.6485718", "0.6484843", "0.64791566", "0.645791", "0.64450693", "0.64324725", "0.643047", "0.64299834", "0.64239055", "0.64138895", "0.6405032", "0.639851", "0.6386878", "0.63861215", "0.6385815", "0.63751626", "0.63751096", "0.6348908", "0.63393044", "0.633", "0.6319719", "0.6311783", "0.63102907", "0.6299457", "0.62917197", "0.62892574", "0.6278127", "0.6277812", "0.6269799", "0.626819", "0.62680733", "0.6256941", "0.6255552", "0.62504774", "0.6249278", "0.62476873", "0.6245728", "0.6243319", "0.62374574", "0.6232872", "0.6231092", "0.62161785", "0.62155396", "0.6203743", "0.62004894", "0.61938304", "0.6191608", "0.6187633", "0.6183378", "0.6172531", "0.616844", "0.61674124", "0.6167301", "0.6165369", "0.61643064", "0.6157751", "0.6153906", "0.6150173", "0.6145947", "0.6145938", "0.61418855", "0.61403686", "0.61392456", "0.61337584", "0.6130665", "0.6129114", "0.61229473", "0.61216", "0.6120182", "0.6116327", "0.61121863", "0.61120707", "0.6111287", "0.61100847", "0.61098343", "0.6103559", "0.6101281", "0.60989594", "0.60982794", "0.60961324", "0.6092188" ]
0.0
-1
take the values of html
function paramaters(data){ return document.querySelector(data) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _getRulaiHtml(content){\n\n}", "function pagehtml(){\treturn pageholder();}", "function fnGetHtmlText(i, value) {\n var html = $(\"<div/>\").text(value).html();\n return $.trim(html);\n }", "function getTableDataFromHtml() {\n\n }", "function parseRatkojatHtml(htmlres) {\n let el = document.createElement('html');\n el.innerHTML = htmlres;\n let searchResultCollection = el.getElementsByClassName('w wi');\n let resstr = \" \";\n for (let item of searchResultCollection) {\n console.debug(\"[Ratkojat] -> \" + item.innerText);\n resstr += item.innerText;\n resstr += \" \";\n }\n return resstr;\n}", "get html() {\n return this._html;\n }", "function getHtml(el) {\n return el.innerHTML;\n }", "htmlForSiGMLURL() {\nvar html;\n//--------------\nreturn html = `<input type=\"text\" class=\"txtSiGMLURL av${this.ix}\" value=\"${this.initsurl}\" />`;\n}", "getHTML() {\n return this._executeAfterInitialWait(() => this.currently.getHTML());\n }", "htmlForProgress() {\nvar html;\n//----------\nreturn html = `<!--========================================================-->\n<span class=\"spanInfo av${this.ix}\" >\nSign/Frame:\n<input type=\"text\" class=\"txtSF av${this.ix}\" value=\"0/0\" />\n&nbsp;\nGloss:\n<input type=\"text\" class=\"txtGloss av${this.ix}\" value=\"[none]\" />\n&nbsp;\nFPS:\n<input type=\"text\" class=\"txtFPS av${this.ix}\" value=\"00.00\" />\n</span> <!--class=\"spanInfo av${this.ix}\"-->`;\n}", "function htmlToText(e){return e.replace(/<\\/div>\\n/gi,\"\").replace(/<\\/p>/gi,\"\").replace(/<\\/span>/gi,\"\").replace(/<\\/div>/gi,\"\").replace(/<\\/ul>/gi,\"\").replace(/<\\/li>/gi,\"\").replace(/<\\/strong>/gi,\"\").replace(/<\\/center>/gi,\"\").replace(/<\\/pre>/gi,\"\").replace(/<\\s*p[^>]*>/gi,\"\").replace(/<\\s*span[^>]*>/gi,\"\").replace(/<\\s*div[^>]*>/gi,\"\").replace(/<\\s*ul[^>]*>/gi,\"\").replace(/<\\s*li[^>]*>/gi,\"\").replace(/<\\s*strong[^>]*>/gi,\"\").replace(/<\\s*center[^>]*>/gi,\"\").replace(/<\\s*pre[^>]*>/gi,\"\").replace(/<hr>/gi,\"\").replace(/<div><br>/gi,\"\\n\").replace(/<div>/gi,\"\").replace(/<\\s*br[^>]*>/gi,\"\\n\").replace(/<\\s*\\/li[^>]*>/gi,\"\").replace(/<\\s*script[^>]*>[\\s\\S]*?<\\/script>/gim,\"\").replace(/<\\s*style[^>]*>[\\s\\S]*?<\\/style>/gim,\"\").replace(/<!--.*?-->/gim,\"\").replace(/<\\s*a[^>]*href=['\"](.*?)['\"][^>]*>([\\s\\S]*?)<\\/\\s*a\\s*>/gi,\"$2 ($1)\").replace(/&([^;]+);/g,decodeHtmlEntity)}", "_parseContent(item) {\n const textFieldClass = this.getCSS(this._data.mode, \"textField\");\n return item.querySelector(`.${textFieldClass}`).innerHTML;\n }", "getHTML() {\n return getHTMLFromFragment(this.state.doc.content, this.schema);\n }", "function extractData(html){\n let searchtool=cheerio.load(html);\n\n let part = searchtool('a[data-hover=\"View All Results\"]');\n let SourceLink=part.attr(\"href\");\n let FullLink=`https://www.espncricinfo.com${SourceLink}`;\n console.log(FullLink);\n\n //Now requesting on FullLink to obtain scorecard link array\n request(FullLink,AllScoreCardcb);\n}", "htmlForStatus() {\nvar html;\n//----------\nreturn html = `<!--========================================================-->\n<span class=\"spanInfo av${this.ix}\" >\nStatus:\n<input type=\"text\" class=\"statusExtra av${this.ix}\" />\n</span> <!--class=\"spanInfo av${this.ix}\"-->`;\n}", "function getElementsFromHTML() {\n toRight = document.querySelectorAll(\".to-right\");\n toLeft = document.querySelectorAll(\".to-left\");\n toTop = document.querySelectorAll(\".to-top\");\n toBottom = document.querySelectorAll(\".to-bottom\");\n }", "function processHTML(html,callback) {\n var document = jsdom(html);\n var math = document.getElementsByTagName(\"math\");\n var data = {math:, format:\"MathML\", svg:true; state:{}}", "_parse(html, data) {\n for (let key in data) {\n const value = data[key];\n const regex = new RegExp(`{{ *${key} *}}`, 'mg');\n html = html.replace(regex, value);\n }\n\n return html;\n }", "function extractResult (html) {\n let data = []\n var rows = $('.rList > li', html)\n for (let i = 0; i < rows.length; i++) {\n data.push(extractFields(rows[i]))\n }\n return data\n}", "get innerHTML() {\n let retArr = [];\n this.eachElem(elem => retArr.push(elem.innerHTML));\n return retArr.join(\"\");\n }", "get innerHTML() {\n let retArr = [];\n this.eachElem(elem => retArr.push(elem.innerHTML));\n return retArr.join(\"\");\n }", "static get html() {\n return '';\n }", "renderHTML() {\n \n }", "postprocess(html) {\n return html;\n }", "function renderHtmlPlacehoder(placeHolderContent) {\n\t// for each value, search for class == .ocdToken and update innerHtml\n\treturn placeHolderContent.map(function(item) {\n\t\tvar selector = \".ocd\" + item.name;\n\t\tvar selectedElement = jQuery(selector);\n\t\tif(!selectedElement) {\n\t\t\treturn;\n\t\t}\n\n\t\tselectedElement.off();\n\n\t\t// add click event handler\n\t\tif(item.trackResponse != undefined && item.trackResponse != \"\") {\n\t\t\tselectedElement.attr(\"onClick\", \"trackResponse('\" + item.offerCd + \"', '\" + item.trackResponse + \"');\");\n\t\t\treturn;\n\t\t}\n\n\t\tvar tagType = selectedElement.prop(\"tagName\");\n\n\t\t// set value\n\t\tif(tagType == \"IMG\") {\n\t\t\tif(item.value != \"\") {\n\t\t\t\tselectedElement.attr(\"src\", item.value);\n\t\t\t} else {\n\t\t\t\tselectedElement.remove();\n\t\t\t}\n\n\t\t} else if (tagType == \"INPUT\") { \n\t\t\tselectedElement.val(item.value);\n\t\t} else {\n\t\t\tselectedElement.html(item.value);\n\t\t}\n\n\t\treturn selectedElement;\n\t});\n}", "get outerHTML(){ \n\t\t return this.xml; \n\t\t \n\t }", "get outerHTML(){ \n\t\t return this.xml; \n\t\t \n\t }", "function htmlDecode() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utTransform,\n sp: utilitymanager_1.um.TIXSelPolicy.Line,\n }, function (up) {\n var d = document.createElement('div');\n d.innerHTML = up.intext;\n return d.textContent;\n });\n }", "function Parsedata(data){\r\n// PAGE==>CHEERIO\r\n let $ = cheerio.load(data);\r\n// SELECTOR SE SELECT THING ==> .TEXT()==> gIVE CONCATENATED STRING OF SELECTED TAG\r\n // let text=$(\"title\").text();\r\n// GIVE THE ARRAY OF WHOLE LASS MATCHES \r\n let Commentarr=$(\".d-flex.match-comment-padder.align-items-center .match-comment-long-text\");\r\n \r\n let text=$(Commentarr[0]).text();\r\n\r\n console.log(text);\r\n}", "function setHtmlDetails(text){\n\n document.getElementById(\"where\").innerHTML = text;\n}", "function getDataAddress(html) {\n \n\tvar address = \"\";\n\tif(html) {\n\t\tvar div = document.createElement(\"div\");\n\t\tdiv.innerHTML = html;\n\t\tif(div.getElementsByTagName(\"p\").length > 0) {\n\t\t\taddress = div.getElementsByTagName(\"p\")[0].innerText;\n\t\t} else if($(div).find(\"h2.firstHeading\")) {\n\t\t\taddress = $(div).find(\"h2.firstHeading\").text();\n\t\t}\n\t}\n\treturn address;\n}", "getHTML(_id) {\n return this._elements[_id].innerHTML;\n }", "getHTML(_id) {\n return this._elements[_id].innerHTML;\n }", "function getText(html) { // Returns text from HTML while trying to preserve structure\n return html.replace(/<[^>]+>/g, '');\n // https://stackoverflow.com/a/41756926/6364386\n}", "function insertHTML(data){\n $(\"#usubject\").val(data[0].subname)\n $(\"#regno\").val(data[0].subid)\n }", "function cleanFieldHtml(fieldHtml, pos) {\n html = fieldHtml\n }", "function extract() {\n var skript = $('#skript').val();\n\n // Regex to parse text from ai_output, description and info_addchoice\n var re = /(?:(ai_output[A-Z0-9\\s\\(\\,]+\\\"[A-Z0-9\\_]+\\\"[\\)\\;\\s]+\\/\\/)|(description[\\s\\=]+[\\\"])|(info_addchoice[\\s\\(A-Z0-9\\_\\,]*[\\\"]))([A-Z0-9\\ \\ß\\.\\-\\,\\*\\!\\?\\'\\…\\ä\\ö\\ü\\(\\)\\+\\-]*)(?:[\\\"\\;])*/gi;\n var match;\n var ger_text = \"\";\n\n while (match = re.exec(skript)) {\n ger_text = ger_text + match[4] + \"\\n\";\n }\n\n $(\"#ger\").val(ger_text);\n\n $(\"#linktodeepl\").attr(\"href\", \"https://www.deepl.com/translator#de/en/\" + encodeURI(ger_text));\n $(\"#linktodeepl\").removeClass(\"disabled btn-dark\");\n $(\"#linktodeepl\").addClass(\"btn-primary\");\n}", "function buildWebPage(result){\n document.getElementById('article').innerHTML = result.description;\n document.getElementById('article-title').innerHTML = result.title;\n}", "function getHTML(){\n $(function() {\n var myListItems = $('ul').html();\n console.log(myListItems.length);\n console.log(myListItems.charAt(3));\n }); \n}", "htmlForInfo() {\nvar html;\n//----------\nreturn html = `<!--========================================================-->\n<hr style=\"height:1px;\" />\n${this.htmlForProgress()}\n<br>\n${this.htmlForStatus()}`;\n}", "render(){return html``}", "function parseTemplateHTML(html) {\n var el = document.createElement(\"div\");\n el.innerHTML = html;\n return el.children[0];\n }", "function item_html(role){\n var html = '';\n return html;\n }", "function getCurrentValue(value) {\r\n return value.html();\r\n}", "function captureData() {\n \n var capturedDat = document.documentElement.innerHTML;\n return capturedDat;\n}", "getTextContent() {}", "getHTML() {\n const result = browser.selectorExecute(\n // tslint:disable-next-line:ter-prefer-arrow-callback\n [this._node.getSelector()], function (elems, elementSelector) {\n const error = {\n notFound: [],\n };\n if (elems.length === 0) {\n error.notFound.push(elementSelector);\n }\n if (error.notFound.length > 0) {\n return error;\n }\n const elem = elems[0];\n return elem.innerHTML;\n }, this._node.getSelector());\n if (isJsError(result)) {\n throw new Error(`${this._node.constructor.name} could not be located on the page.\\n( ${this._node.getSelector()} )`);\n }\n else {\n return result || '';\n }\n }", "function spmHTML(forrigeTekstInnA, nyTekstInnA, forrigeTekstInnB, nyTekstInnB, forrigeOverskrift, nyOverskrift){\n\n\t\tvar strengA = document.getElementById(\"spmSvarA\").innerHTML; \n\t\tvar endraTekstA = strengA.replace(forrigeTekstInnA,nyTekstInnA);\n\t\tdocument.getElementById(\"spmSvarA\").innerHTML=endraTekstA;\n\n\t\tvar strengB = document.getElementById(\"spmSvarB\").innerHTML; \n\t\tvar endraTekstB = strengB.replace(forrigeTekstInnB,nyTekstInnB);\n\t\tdocument.getElementById(\"spmSvarB\").innerHTML=endraTekstB;\n\n\t\tvar strengC = document.getElementById(\"testOverskrift\").innerHTML; \n\t\tvar endraTekstA = strengC.replace(forrigeOverskrift,nyOverskrift);\n\t\tdocument.getElementById(\"testOverskrift\").innerHTML=endraTekstA;\t\t\n\t\t}", "function getFormatWP(inputs)\n{\n\n str = \"<input type='hidden' value=''>\";\n //apellido del autor\n str+= '<div class=\"realv\">'+filterxss( $(inputs[0]).val() ) + '</div>';\n str+='<div>,</div>';\n\n \n //Inicial del nombre\n str+= '<div class=\"realv\">' +filterxss($(inputs[1]).val())+'</div>';\n str+='<div>.</div>';\n \n //año de publicación\n str+='<div>(</div>';\n str+= '<div class=\"realv\">'+ ( ($(inputs[2]).val() == undefined) ? 's.f.': filterxss( $(inputs[2]).val() ) ) + '</div>';\n str+='<div>).</div>';\n //titulo\n str+= '<div class=\"realv\">'+filterxss( $(inputs[3]).val() )+'</div>';\n str+='<div>.</div>';\n //titulo de la página web\n str+='<div class=\"realv\">'+ '<i>' + filterxss( $(inputs[4]).val() )+ '</i>'+'</div>';\n str+='<div>.Recuperado de: </div>';\n //recuperdado de \n str+= '<div class=\"realv\">'+ filterxss( $(inputs[5]).val() ) +'</div>';\n\n return str;\n\n}", "function fromHtml(html) {\n return html.replace(/<p>&nbsp;<\\/p>/ig, \"\\n\")\n .replace(/<p>/ig,\"\")\n .replace(/<\\/p>/ig, \"\\n\")\n .replace(/<br \\/>/ig, \"\\n\")\n .replace(/(&nbsp;|\\xa0|\\u2005)/ig, \" \")\n // While copying widgets with text, CKEditor adds these html elements\n .replace(/<span\\b[^>]*?id=\"?cke_bm_\\d+\\w\"?\\b[^>]*?>.*?<\\/span>/ig, \"\")\n .replace(/<span\\b[^>]*?data-cke-copybin-(start|end)[^<]*?<\\/span>/ig, \"\")\n // CKEditor uses zero-width spaces as markers\n // and sometimes they leak out (on copy/paste?)\n .replace(/\\u200b+/ig, \" \")\n // fixup final </p>, which is is not a newline\n .replace(/\\n$/, \"\");\n }", "function convertHtmlToText(value) {\n var d = document.createElement(\"div\");\n d.innerHTML = value;\n return d.innerText;\n}", "function parseHTMLInOpener (html) {\n var div = global.opener.document.createElement('div');\n div.innerHTML = html;\n return div.children[0];\n }", "getHTML() {\n const l = this.strings.length - 1;\n let html = '';\n let isTextBinding = true;\n for (let i = 0; i < l; i++) {\n const s = this.strings[i];\n html += s;\n // We're in a text position if the previous string closed its tags.\n // If it doesn't have any tags, then we use the previous text position\n // state.\n const closing = findTagClose(s);\n isTextBinding = closing > -1 ? closing < s.length : isTextBinding;\n html += isTextBinding ? nodeMarker : marker;\n }\n html += this.strings[l];\n return html;\n }", "get fieldValuesAsHTML() {\r\n return new SharePointQueryableInstance(this, \"FieldValuesAsHTML\");\r\n }", "getTexts() {\n const wes = this.getWebElements();\n\n const texts = [];\n\n wes.forEach((we) => {\n texts.push(we.getText());\n });\n return texts;\n }", "function getTextFromHtml(html) {\n\treturn htmlToText.fromString(html);\n}", "function getEventDetails(html) {\n\n const $ = cheerio.load(html);\n\n const artist = $('.event-information h1').text();\n\n const city = $('table.venue-details > tbody > tr:first-child > td:nth-child(2) a:first-child')\n .text()\n .split(':')[0]\n .trim();\n\n const venue = $('table.venue-details > tbody > tr:first-child > td:nth-child(2) a:first-child')\n .text()\n .split(':')[1]\n .trim();\n\n const date = $('table.venue-details > tbody > tr:nth-child(2) > td:nth-child(2)')\n .text();\n\n const price = $('.BuyBox.block:first-child .price strong')\n .text();\n\n return {\n artist,\n city,\n venue,\n date,\n price\n };\n\n}", "getInput(_htmlId){\n let userInput = document.getElementById(_htmlId).value;\n return userInput;\n }", "function parseBingHtml(htmlres) {\n let el = document.createElement('html');\n el.innerHTML = htmlres;\n let searchResultCollection = el.getElementsByClassName('b_attribution');\n let resstr = \" \";\n for (let item of searchResultCollection) {\n console.debug(\"[Bing] -> \" + item.innerText);\n resstr += item.innerText;\n resstr += \" \";\n }\n return resstr;\n}", "get innerHtml() {\n return this.innerHTML;\n }", "get innerHtml() {\n return this.innerHTML;\n }", "function understand(html) {\n\t\t\tif(Array.isArray(html)){\n\t\t var complex = html;\n\t\t\t\tvar complexResult = complex.map(understand);\n\t\t\t\treturn complexResult;\n\t\t\t}else {\n\t\t\t\tvar element = html;\n\t \t var textNodes = Array.from(element.childNodes).filter(f => f.nodeName === '#text');\n\t \t\treturn textNodes.reduce(concatTextNode, '');\n\t\t\t}\n \t}", "function understand(html) {\n\t\t\tif(Array.isArray(html)){\n\t\t var complex = html;\n\t\t\t\tvar complexResult = complex.map(understand);\n\t\t\t\treturn complexResult;\n\t\t\t}else {\n\t\t\t\tvar element = html;\n\t \t var textNodes = Array.from(element.childNodes).filter(f => f.nodeName === '#text');\n\t \t\treturn textNodes.reduce(concatTextNode, '');\n\t\t\t}\n \t}", "interpretHTML(a) {\n // CUT OUT IMGS TO ACCOUNT FOR MORE THAN 1 & STYLE ACCORDINGLY\n let _complete;\n let _imgs = a.match(/<img.*>/g, '');\n let _text = a.replace(/<img.*>/g, '');\n let _temp = [\"<div class='markedWrapper'>\"];\n\n if(_imgs === null){\n _temp.push(_text);\n }else if(_imgs.length > 1){\n _temp.push(_text.concat(this.handleImgs(_imgs)));\n }else{\n _temp.push(this.handleImgs(_imgs).concat(_text));\n }\n _temp.push(\"</div>\")\n _complete = _temp.join('');\n return {__html: _complete};\n }", "getContent() {\n\n let contentArray = []; // holder content html array\n\n // loop through all parms\n for(let i = 1; i <= this.config.otpLength; i++) {\n contentArray.push(`<input \n class=\"input\" \n type=\"${this.config.inputType}\" order=\"${i}\" \n style=\"border-color : ${this.config.boxColor}; \n color : ${this.config.boxColor};\n width : ${this.config.boxSize};\n height : ${this.config.boxSize};\n font-size : ${this.config.fontSize};\n text-transform:${this.config.letters}\">`\n );\n }\n\n let content = contentArray.join(`<span class=\"dash\" style=\"color:${this.config.boxColor}\">-</span>`);\n content = `<div class=\"otp-inputs\">${content}</div>`; // wrap content\n\n return content; \n }", "static get observers(){return[\"_render(html)\"]}", "getElement(data){\n var html = \n `<div class=\"single-event d-flex flex-row\">\n <p class=\"col date\">\n ${data.date}\n </p>\n <p class=\"col-8 name\">\n ${data.name}\n </p>\n <p class=\"col-8 desc\">\n ${data.desc}\n </p>\n <p class=\"col text-right\">\n <span class=\"lnr lnr-highlight\"></span>\n <span class=\"lnr lnr-trash\"></span>\n </p>\n </div>`;\n return html.toHtmlElement();\n }", "function extractPlayerOfMatch(html){\n let selectorTool= cheerio.load(html);\n let playerOfMatchEle= selectorTool(`.best-player-content`);\n let playerName= playerOfMatchEle.text();\n console.log(playerName);\n \n}", "function getFloatFromExchangeResult(html){\n\t\t\t\t\t\t\t\t\n\tvar html = \"<div class='target-label'><div title='Wear Value' style='position:relative;right:-43px;top:-0.8em'>0.20041191577911376953</div></div>\";\n\tvar $ = cheerio.load(html);\n\tconsole.log(\"RESULTAT: \", $('.target-label').text());\n\treturn $('.target-label').text();\n}", "get contactText(){return $('span=Contact details')}", "function getContent(html) {\n return html.replace(/<[^>]*>/g, '');\n}", "getHtmlItem(media) {\n\t\tlet htmlToInsert = \"\"\n\t\thtmlToInsert += `\n\t\t\t<section class=\"blockList\">\n\t\t\t\t<div class=\" light-shadow relative parent-hover columnItem `\n\t\t//si c'esst pour une selection on affiche aussi le tooltip et la classe\n\t\thtmlToInsert += this.onlyForPickUp ? \"pickUpImageToUglyForm tooltipped\\\" data-position=\\\"bottom\\\" data-delay=\\\"350\\\" data-tooltip=\\\"Choisir cette image\\\"\" : \"\"\n\t\thtmlToInsert += `\"\n\t\t\t\t style=\"background-color: rgb(255,255,255) !important;\">\n\t\t\t\t\t<i class=\"absolute white-text\" style=\"margin:20px 0 0 10px; font-size: small\">` + media.size + `</i>\n\t\t\t\t\t<img class=\"responsive-img\" src=\"` + media.url + `\" alt=\"` + media.label + `\">\n\t\t\t\t\t<a href=\"#!\" id=\"admin/edit/delete-media?id=` + media.id + `&CSRFToken=`+CSRFToken+`\" class=\"children-hover btn-floating waves-effect waves-light lightButton absolute tooltipped removeMediaFromLibrary\" data-position=\"top\"\n\t\t\t\t\t\t\t\t data-delay=\"350\" data-tooltip=\"Supprimer l'image de votre bibliothèque\" \n\t\t\t\t\t\t\t\t style=\"top: 10px ; right: 10px\">\n\t\t\t\t\t\t<i class=\"material-icons \" >clear</i>\n\t\t\t\t\t</a>\n\t\t\t\t\t<div class=\"absolute children-hover\" style=\"bottom: 0; width: 100%; background-color: rgba(0,0,0,0.52)\">\n\t\t\t\t\t\t<form method=\"post\" action=\"admin/edit/edit-media-info\" class=\"editMediaInfo\" style=\"margin: 0 10px 0 10px !important;\">\n\t\t\t\t\t\t<input type=\"text\" name=\"id\" value=\"` + media.id + `\" class=\"displaynone\">\n\t\t\t\t\t\t<input type=\"text\" class=\"displaynone\" name=\"CSRFToken\" value=\"`+CSRFToken+`\">\n\t\t\t\t\t\t\t<input name=\"label\" type=\"text\" `\n\t\t//form de la valeur \"alt\"\n\t\thtmlToInsert += media.label ? 'value=\"' + media.label + '\"' : \"\";\n\t\thtmlToInsert += ` placeholder=\"Donner un titre a votre image\" class=\"tooltipped white-text\" data-position=\"bottom\"\n\t\t\t\t\t\tdata-delay=\"350\" data-tooltip=\"Editer le nom de votre image, utile pour l'accessibilité de votre site et son référencent\" style=\"width: 100%; margin-bottom: 10px!important; \">\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t<button class=\" btn-floating waves-effect waves-light lightButton absolute tooltipped\" data-position=\"top\"\n\t\t\t\t\t\t\t\t\t data-delay=\"350\" data-tooltip=\"Editer\" \n\t\t\t\t\t\t\t\t\t style=\"top: -10px ; right: 10px\">\n\t\t\t\t\t\t\t\t<i class=\"material-icons \" >edit</i>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</section>`\n\t\t//et on renvoie le template\n\t\treturn htmlToInsert\n\t}", "function html(h, ...values){ return h.join('');}", "function Browser_InnerText_Get(html)\n{\n\t//has inner text?\n\tvar innerText = html.innerText;\n\t//not valid, use text content\n\treturn innerText ? innerText : html.textContent;\n}", "function toText(html) {\n\n var $$ = cheerio.load(\"<body>\" + html + \"</body>\",{decodeEntities: false});\n\n return $$(\"body\").text();\n\n}", "function getTexts(){\n //console.log('getTexts');\n var tmp = document.querySelectorAll('#lawyerList > div.floatDiv > a');\n return Array.prototype.map.call(tmp, function(e){\n return e.innerHTML;\n });\n}", "function decodeHtml(html) {\n var txt = document.createElement(\"textarea\");\n txt.innerHTML = html;\n return txt.value;\n }", "function getText(domObject, value) {\n var text = null;\n try {\n switch (domObject) {\n case \"id\":\n text = document.getElementById(value).innerHTML;\n console.log(\"status pass : Inner Text = \", text);\n break;\n case \"class\":\n text = document.getElementsByClassName(value).innerHTML;\n console.log(\"status pass : Inner Text = \", text);\n break;\n case \"xpath\":\n var iterator = document.evaluate(value,\n document, null, XPathResult.ANY_TYPE, null);\n try {\n var thisNode = iterator.iterateNext();\n text = thisNode.innerHTML;\n } catch (e) {\n console.log('Error: Document tree modified during iteration ' + e);\n }\n console.log(\"status pass : Inner Text = \", text);\n break;\n case \"css\":\n document.getElementById(value).click(); //ToDo-must impliment\n console.log(\"status pass : button clicked\", domObject, value);\n break;\n case \"tag\":\n document.getElementById(value).click(); //ToDo-much more detailed implimentation\n console.log(\"status pass : button clicked\", domObject, value);\n break;\n default:\n console.log(\"status fail : domObject type not supported\");\n }\n } catch (err) {\n console.log(err);\n }\n return text;\n}", "generateHtmlOutput() {\n let html = \"\";\n const stateSections = this.state.assignment.sections;\n const outSections = stateSections.custom.concat(stateSections.compulsory);\n\n for (let i = 0; i < outSections.length; i++) {\n if (outSections[i].value != \"\") {\n html += \"<h1>\" + outSections[i].title + \"</h1>\";\n html += outSections[i].value;\n }\n }\n\n return html;\n }", "getHTML() {\n const l = this.strings.length - 1;\n let html = '';\n let isTextBinding = true;\n for (let i = 0; i < l; i++) {\n const s = this.strings[i];\n html += s;\n // We're in a text position if the previous string closed its tags.\n // If it doesn't have any tags, then we use the previous text position\n // state.\n const closing = findTagClose(s);\n isTextBinding = closing > -1 ? closing < s.length : isTextBinding;\n html += isTextBinding ? nodeMarker : marker;\n }\n html += this.strings[l];\n return html;\n }", "function extractToText(strings) {\n var $htmlContent, $htmlPattern, $htmlReplace;\n\n // first remove to unnecessary gaps\n $htmlContent = strings.replace(/\\n/gim, '').replace(/\\r/gim, '').replace(/\\t/gim, '').replace(/&nbsp;/gim, ' ');\n\n $htmlPattern = [\n /\\<span(|\\s+.*?)><span(|\\s+.*?)>(.*?)<\\/span><\\/span>/gim, // trim nested spans\n// /<(\\w*[^p])\\s*[^\\/>]*>\\s*<\\/\\1>/gim, // remove empty or white-spaces tags (ignore paragraphs (<p>) and breaks (<br>))\n// [ COMMENT BCZ REMOVE THE <B> TAG -- ASHISH]\n\n /\\<div(|\\s+.*?)>(.*?)\\<\\/div>/gim, // convert div to p\n /\\<strong(|\\s+.*?)>(.*?)\\<\\/strong>/gim, // convert strong to b\n /\\<em(|\\s+.*?)>(.*?)\\<\\/em>/gim // convert em to i\n ];\n\n $htmlReplace = [\n '<span$2>$3</span>',\n// '', //[ COMMENT BCZ REMOVE THE <B> TAG -- ASHISH]\n '<p$1>$2</p>',\n '<b$1>$2</b>',\n '<i$1>$2</i>'\n ];\n\n // repeat the cleaning process 5 times\n for (c = 0; c < 5; c++) {\n // create loop as the number of pattern\n for (var i = 0; i < $htmlPattern.length; i++) {\n var pattern = $htmlPattern[i];\n var replaceby = $htmlReplace[i];\n $htmlContent = $htmlContent.replace(pattern, replaceby);\n }\n }\n\n // if paragraph is false (<p>), convert <p> to <br>\n if (!vars.p)\n $htmlContent = $htmlContent.replace(/\\<p(|\\s+.*?)>(.*?)\\<\\/p>/ig, '<br/>$2');\n\n // if break is false (<br>), convert <br> to <p>\n if (!vars.br) {\n $htmlPattern = [\n /\\<br>(.*?)/ig,\n /\\<br\\/>(.*?)/ig\n ];\n\n $htmlReplace = [\n '<p>$1</p>',\n '<p>$1</p>'\n ];\n\n // create loop as the number of pattern (for breaks)\n for (var i = 0; i < $htmlPattern.length; i++) {\n $htmlContent = $htmlContent.replace($htmlPattern[i], $htmlReplace[i]);\n }\n }\n\n // if paragraph and break is false (<p> && <br>), convert <p> to <div>\n if (!vars.p && !vars.br)\n $htmlContent = $htmlContent.replace(/\\<p>(.*?)\\<\\/p>/ig, '<div>$1</div>');\n\n return $htmlContent;\n }", "function htmlLoad() {\n}", "function getText(){\n return document.body.innerText\n }", "function ListBox_GetHTMLTarget(eEvent, aData)\n{\n\t//default result: null\n\tvar result = null;\n\t//no data?\n\tif (aData == null || aData.length == 0)\n\t{\n\t\t//use the entire object\n\t\treturn this;\n\t}\n\telse\n\t{\n\t\t//get the next item index\n\t\tvar nextIndex = ListBox_GetNextItem(this, aData).Index;\n\t\t//get the item\n\t\tvar item = this.InterpreterObject.MapItems[nextIndex];\n\t\t//get its html\n\t\tresult = item.HTML;\n\t}\n\t//return the result\n\treturn result;\n}", "GetGraphFromHTML() {\n var mydiv = document.getElementById(\"mygraphdata\");\n var graph_as_string = mydiv.innerHTML;\n let graph = eval(graph_as_string);\n return graph;\n }", "renderHTML() {\n let domPurify = createDomPurify(new JSDOM().window);\n return { __html: domPurify.sanitize(this.state.post.html) }; //Sanitize html so no hackers can inject\n }", "function extract(msg_desc,msg_title,msg_url){\n var desc = [];\n var title = [];\n var url = [];\n desc = msg_desc;\n title = msg_title;\n url = msg_url;\n var tags = \"\";\n for(var x = 0; x < desc.length; x ++){\n tags += \"<h3>'\"+title[x]+\"'</h3><h4>'\"+desc[x]+\"'</h4><a href='\"+url[x]+\"'>Link</a><br>\"\n }\n return tags;\n }", "parseToHtml() {\n this.htmlElementsDom = this.parser.parseFromString(this.htmlElementsString, 'text/html');\n }", "createMarkup(html) {\n return {\n __html: html\n };\n }", "function get_html_attributes(selector,attribute){\n if(!attribute){\n return $(selector).map(function() {return $(this).val();}).get()\n }else{\n return $(selector).map(function() {return $(this).attr(attribute) ;}).get()\n }\n \n }", "html(strings, ...args) {\n\t\tlet buf = strings[0];\n\t\tlet i = 0;\n\t\twhile (i < args.length) {\n\t\t\tbuf += this.escapeHTML(args[i]);\n\t\t\tbuf += strings[++i];\n\t\t}\n\t\treturn buf;\n\t}", "function getDataForCustomHtmlForm()\n{\n var sets = getHtmlFormSettings_();\n var data = {\n values: getDatatForHtmpFormSelect_(),\n header: sets.listName,\n listHeight: sets.listHeight\n }\n return data; \n}", "function JsontoHTML() {\n $(\"ul.items\").empty()\n all_html = []\n for (let i = 0; i < databaseObj.length; i++) {\n c = databaseObj[i];\n let keywrd = (JSON.parse(c[\"keywords\"]))\n kwrds = []\n for (let a = 0; a < keywrd.length; a++) {\n kwrds.push(keywrd[a][\"name\"])\n }\n let movieObj = new MovieInfo(c[\"budget\"], c[\"genres\"], c[\"homepage\"], c[\"runtime\"], c[\"vote_average\"],\n kwrds, c[\"title\"], c[\"id\"], c[\"image_url\"], c[\"image_url1\"], c[\"image_url2\"],\n c[\"overview\"])\n all_html.push(movieObj)\n }\n }", "getHTML(){const e=this.strings.length-1;let t=\"\",n=!1;for(let r=0;r<e;r++){const e=this.strings[r],a=e.lastIndexOf(\"<!--\");// For each binding we want to determine the kind of marker to insert\n// into the template source before it's parsed by the browser's HTML\n// parser. The marker type is based on whether the expression is in an\n// attribute, text, or comment poisition.\n// * For node-position bindings we insert a comment with the marker\n// sentinel as its text content, like <!--{{lit-guid}}-->.\n// * For attribute bindings we insert just the marker sentinel for the\n// first binding, so that we support unquoted attribute bindings.\n// Subsequent bindings can use a comment marker because multi-binding\n// attributes must be quoted.\n// * For comment bindings we insert just the marker sentinel so we don't\n// close the comment.\n//\n// The following code scans the template source, but is *not* an HTML\n// parser. We don't need to track the tree structure of the HTML, only\n// whether a binding is inside a comment, and if not, if it appears to be\n// the first binding in an attribute.\nn=(-1<a||n)&&-1===e.indexOf(\"-->\",a+1);// Check to see if we have an attribute-like sequence preceeding the\n// expression. This can match \"name=value\" like structures in text,\n// comments, and attribute values, so there can be false-positives.\nconst s=lastAttributeNameRegex.exec(e);t+=null===s?e+(n?commentMarker:nodeMarker):e.substr(0,s.index)+s[1]+s[2]+boundAttributeSuffix+s[3]+marker}return t+=this.strings[e],t}", "html(argHTML) {\n if (argHTML === undefined) return this.elementArray[0].innerHTML;\n this.each(ele => {\n ele.innerHTML = argHTML;\n });\n }", "function jsonHtml ( data ) {\n //!-bringVar:\n var ObjKeys = Object.keys\n var tagtxt = \"\"\n var postTag = []\n if ( typeof data[ 0 ] == 'object'){ jsonHtmlcore( data[ 0 ] ) }\n for ( var i = 1; i < data.length; i++ ){\n if ( data[ i ] instanceof Array ) { tagtxt += jsonHtml ( data[ i ] ); continue }\n jsonHtmlcore( data[ i ] )\n }\n return tagtxt + postTag.reverse().toString().replace( /,/g , '')\n //______ jsonHtmlore ___________//\n function jsonHtmlcore ( data ) {\n if ( data || data == '' ) {\n if ( typeof data == \"object\" ){ \n var dataObjKeys = ObjKeys( data ) \n var tagName = dataObjKeys[ 0 ]\n var content = data[ tagName ]\n var objclass = content \n var cls = \"\"\n /// gestion class \\\\\\\n if ( typeof content == 'object' ) { \n cls= \"class='\"\n while ( typeof ( cls += ObjKeys( content )[0] + \" \", content = content[ObjKeys( content )[0]] ) == 'object' ){}\n cls += \"' \"\n }\n content = cls + content\n /// gestion id \\\\\\\n // if ( ObjKeys( data )[ 1 ] == 'id' ) { id = \"id='\"+data[ ObjKeys( data )[ 1 ] ] + \"'\" }\n for ( var i = 1; i < dataObjKeys.length; i++){\n content = dataObjKeys[i]+ \"='\"+data[ dataObjKeys[i]] + \"' \" + content }\n tagtxt += '<'+tagName+ ( content? ' '+content+'' : '') + '>' \n postTag.push('</'+tagName+'>')\n return jsonHtmlcore\n }\n tagtxt += data // texte dans inner\n return jsonHtmlcore\n }\n /// <br /> \\\\\\ \n tagtxt += '<br />' // br dans inner\n return jsonHtmlcore\n }\n }", "get headertext() { return $('h3') }", "function getOutput()\n{\n\treturn document.getElementById(\"output-value\").innerText;\n}", "function decodeHtml(html) {\n return $('<span>').html(html).text();\n}", "htmlForSpeed() {\nvar html;\n//-----------\nreturn html = `<!--========================================================-->\n<span class=\"spanSpeed av${this.ix}\" >\nSpeed (log<sub>2</sub> scale):\n${this.htmlForSpeedCtrl()}\n</span> <!--class=\"spanSpeed av${this.ix}\"-->`;\n}", "function getOutput(){\r\n\treturn document.getElementById(\"output_value\").innerText;\r\n}" ]
[ "0.65092385", "0.62216705", "0.6110217", "0.607251", "0.59608865", "0.58772224", "0.5831328", "0.58183527", "0.5806415", "0.57901245", "0.5775941", "0.57221305", "0.5714905", "0.5680191", "0.56736255", "0.5655975", "0.5655137", "0.56343603", "0.56099826", "0.5605167", "0.5605167", "0.55908364", "0.5580878", "0.55664694", "0.55478454", "0.5546852", "0.5546852", "0.5519194", "0.5512152", "0.5495026", "0.54724306", "0.54599303", "0.54599303", "0.54449266", "0.5440719", "0.5414478", "0.54137266", "0.54103804", "0.5409211", "0.5400509", "0.53998464", "0.539241", "0.5387951", "0.53852165", "0.5383266", "0.5381904", "0.53774357", "0.53757507", "0.53668785", "0.536434", "0.53638905", "0.5350932", "0.5346645", "0.5340476", "0.5340017", "0.53394645", "0.533397", "0.5332283", "0.5318568", "0.53157854", "0.53157854", "0.5315342", "0.5315342", "0.53147227", "0.5314141", "0.5305965", "0.53043383", "0.53002816", "0.53002596", "0.5287098", "0.5285156", "0.52847785", "0.5284563", "0.5283944", "0.52839255", "0.52808446", "0.52801496", "0.52729905", "0.52722245", "0.52678704", "0.5261966", "0.5261082", "0.52558446", "0.5254949", "0.5249617", "0.52466106", "0.52389365", "0.52384496", "0.52338004", "0.5232008", "0.5228614", "0.5225547", "0.52234757", "0.522044", "0.5211384", "0.5203049", "0.51930654", "0.5191284", "0.5189543", "0.51842946", "0.5183872" ]
0.0
-1
get path of the image and load in the canvas
function pathFile(event){ imageLoad = URL.createObjectURL(event.target.files[0]); loadImage(imageLoad, img => { image(img, 0, 0); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadImageToCanvas(){\n img.onload = function(){\n ctx.drawImage(img, 0,0);\n }\n img.src = imgHolder.src;\n }", "function loadImg(e){\n const reader = new FileReader(); \n reader.onload = function(){\n imgHolder.src = reader.result;\n }\n reader.readAsDataURL(e.target.files[0]);\n setTimeout(setCanvas, 1000);\n }", "function loadCanvasImage() {\n let data = [];\n minioClient.getObject(imageBucketName, imagePath, function(err, dataStream) {\n if (err) {\n console.log(err);\n // Fill the background\n console.log('There is no saved image, filling the background with base color.');\n return eraseBackground();\n }\n console.log('Loading an initial image.');\n dataStream.on('data', function(chunk) {\n data.push(chunk);\n });\n dataStream.on('end', function() {\n let image = new Image();\n image.onload = function() {\n ctx.drawImage(image, 0, 0);\n console.log('Loaded an initial image.');\n };\n image.onerror = function(err) {\n console.log(err);\n // Fill the background\n console.log('There is no saved image, filling the background with base color.');\n eraseBackground();\n };\n image.src = Buffer.concat(data);\n });\n });\n}", "function load_img() {\n fabric.Image.fromURL('golf-h.png', function (img) {\n hole = img;\n hole.scaleToWidth(60);\n hole.scaleToHeight(60);\n hole.set({\n top: holey,\n left: holex\n });\n canvas.add(hole);\n });\n\n fabric.Image.fromURL('ball.png', function (img) {\n ball = img;\n ball.scaleToWidth(ballw);\n ball.scaleToHeight(ballh);\n ball.set({\n top: bally,\n left: ballx\n });\n canvas.add(ball);\n });\n}", "function loadImage(){\n console.log(\"Image clicked one\")\n // self.img.path = self.image.src;\n // console.log(\"Image clicked two\");\n }", "function loadImg() {\n img1 = new Image();\n\n\n img1.onload = function () {\n //draw background image\n ctx.drawImage(img1, 0, 0);\n //draw a box over the top\n imgH = img1.height;\n imgW = img1.width;\n console.log(\"image loaded\");\n }\n img1.src = 'imgs/carriage_toilet.png';\n }", "function initImgLoader() {\n $('#img-loader-button').click(function() {\n var url = prompt('Background image loader.\\nInput image url.');\n img = Image();\n img.src = url;\n img.onload = function() {\n ctx.drawImage(img, 0, 0, ctx.canvas.width, ctx.canvas.height);\n }\n });\n }", "putImage() {\n this.ctx.drawImage(\n this.image,\n this.x - this.size(),\n this.y - this.size(),\n this.size() * 2,\n this.size() * 2\n );\n this.loaded = true;\n }", "function canvasSelectImage(path) {\n this.canvasClean(0);\n this.image.raster = new paper.Raster(path);\n this.image.path = path; // Fit to active layer after load\n\n this.image.raster.onLoad = this.canvasZoomImage;\n}", "function readImage() {\n if (!this.files || !this.files[0]) return;\n const FR = new FileReader();\n FR.addEventListener(\"load\", (evt) => {\n img.addEventListener(\"load\", () => {\n // drawImgCanvas();\n });\n img.src = evt.target.result;\n });\n FR.readAsDataURL(this.files[0]);\n}", "function putimage(canvas,blob){\n var img = new Image();\n var ctx = canvas.getContext('2d');\n img.onload = function () {\n ctx.drawImage(img,0,0,canvasW, canvasH);\n }\n img.src = blob;\n \n }", "componentDidMount(){\n var canvas = document.getElementById('board-canvas');\n var context = canvas.getContext('2d');\n\n var img = new Image();\n\n // when img loads, draw image to canvas and save it to state so we can refresh after drawing\n img.onload = ()=>{\n context.drawImage(img, 0,0, canvas.width, canvas.height);\n this.setState({imageData: context.getImageData(0,0,canvas.width, canvas.height)})\n }\n\n img.src = 'Uno-top view.jpg';\n }", "success(res) {\n console.log(res)\n let imgOri = res.tempFilePaths[0];\n _this.setData({\n imgOri\n })\n wx.getImageInfo({\n src: imgOri,\n success: function (res1) {\n console.log(res1)\n const query = wx.createSelectorQuery()\n query.select('#photo_canvas')\n .fields({ node: true, size: true })\n .exec(res => {\n console.log(res)\n canvas = res[0].node\n ctx = canvas.getContext('2d')\n console.log(ctx, canvas)\n var towidth = 120; //按宽度120px的比例压缩 \n var toheight = Math.trunc(120 * res1.height / res1.width);\n _this.setData({\n canvas_h: toheight\n })\n canvas.width = towidth\n canvas.height = toheight\n const img = canvas.createImage()\n console.log(img)\n img.src = imgOri\n console.log(img)\n img.onload = () =>{\n console.log(57, img)\n ctx.drawImage(img, 0, 0, res1.width, res1.height, 0, 0, towidth, toheight);\n wx.canvasToTempFilePath({\n canvas,\n fileType: \"jpg\",\n success: function (res2) {\n console.log(res2)\n _this.setData({\n imgScan: res2.tempFilePath\n })\n },\n fail(res2) {\n console.log(res2)\n _this.setData({\n imgScan: imgOri\n })\n }\n }, _this)\n }\n img.onunload = (res) => {\n console.log('error', res)\n }\n })\n \n }\n })\n }", "loadImage() {\r\n this.isImageLoaded = false;\r\n this.image = new Image();\r\n this.image.onload = () => {\r\n this.isImageLoaded = true;\r\n this.width = this.image.width;\r\n this.height = this.image.height;\r\n };\r\n this.image.src = \"Graphics/EnemyProjectile.png\";\r\n }", "loadImage(img) {\n // abort operations if componente was unmounted\n if (this._.componentUnmounted) return;\n // set as background image\n this._.backgroundImg = img;\n this._.imageLoaded = true;\n // clear all previous labels\n this.removeAllLabels();\n // refresh GUI\n this.refreshCanvases();\n }", "handleFileChosen(e) {\n\n const file = e.target.files[0];\n const reader = new FileReader();\n\n reader.onload = (f) => {\n\n var data = f.target.result;\n fabric.Image.fromURL(data, (img) => {\n\n const canvas = this.state.canvas;\n\n var oImg = img.set({left: 10, \n top: 10, angle: 0}).scale(0.8);\n canvas.add(oImg).renderAll();\n\n this.setState({canvas: canvas});\n });\n };\n\n reader.readAsDataURL(file);\n }", "async load()\n {\n if (this.path)\n {\n // Try loading\n this.image = await Picture2D.loadImage(this.path);\n this.empty = this.image.empty;\n\n // If not empty, configure bitmap size\n if (!this.empty)\n {\n this.oW = this.image.width;\n this.oH = this.image.height;\n if (this.cover)\n {\n this.w = RPM.CANVAS_WIDTH;\n this.h = RPM.CANVAS_HEIGHT;\n } else if (this.stretch)\n {\n this.w = RPM.getScreenX(this.image.width);\n this.h = RPM.getScreenY(this.image.height);\n } else\n {\n this.w = RPM.getScreenMinXY(this.image.width);\n this.h = RPM.getScreenMinXY(this.image.height);\n }\n RPM.requestPaintHUD = true;\n this.loaded = true;\n }\n }\n }", "draw() {\r\n if(this.type === 'dog') {\r\n this.image.src = '../images/dog.png';\r\n } else {\r\n this.image.src = \"../images/banana.png\";\r\n }\r\n context.drawImage(this.image, this.x, this.y, this.width, this.height);\r\n }", "function readFile() {\n\n if (this.files && this.files[0]) {\n\n var FR = new FileReader();\n\n FR.addEventListener(\"load\", function (e) {\n document.getElementById(\"preview\").src = e.target.result;\n\n fabric.Image.fromURL(e.target.result, function (myImg) {\n //i create an extra var for to change some image properties\n var img1 = myImg.set({\n left: 0,\n top: 0,\n });\n canvas.add(img1);\n });\n\n });\n FR.readAsDataURL(this.files[0]);\n }\n}", "function onloadCallback(current_image) {\n\t\t//set the image as the background image of the canvas wrapper\n\t\t$('#canvas-wrapper').css('background', 'url(' + current_image.path +') no-repeat center center fixed').css('background-size', 'contain');\n\t}", "function loadImage() {\n var baseUrl = 'https://source.unsplash.com/category';\n var category = 'nature';\n var size = '1920x1080';\n\n var source = baseUrl + '/' + category + '/' + size;\n\n buildElement(source)\n .then(render);\n }", "function openTestImage() {\n\n var base_image = new Image();\n canvas = document.getElementById(\"image-canvas\");\n canvas2 = document.getElementById(\"anno-canvas\");\n context = canvas.getContext(\"2d\");\n // wait for image to load before drawing canvas\n base_image.onload = function () {\n\n canvas.width = base_image.width;\n canvas.height = base_image.height;\n canvas2.width = base_image.width;\n canvas2.height = base_image.height;\n\n context.drawImage(base_image, 0, 0);\n imageOpen = true;\n };\n base_image.src = \"../images/test.jpg\";\n imageType = true;\n document.getElementById('workingFile').innerHTML = \"testing\";\n\n\n }", "function toImage()\n{\n var canvas = Canvas.layer[0];\n var image = document.getElementById(\"imageHolder\");\n \n image.src = canvas.toDataURL(\"image/png\"); \n}", "constructor(canvas) {\n this.ctx = canvas.getContext('2d');\n this.img = new Image(3000, 750);\n this.img.onload = () => { this.loaded = true; };\n this.img.src = backgroundPath;\n this.loaded = false;\n this.imageSize = {\n width: this.img.width,\n height: this.img.height\n };\n console.log(this.imageSize);\n this.canvasSize = {\n width: canvas.width,\n height: canvas.height\n };\n }", "constructor(pic, x, y) {\n this.pic = pic; //string\n this.x = x;\n this.y = y;\n this.img = p.loadImage(this.pic);\n \n }", "function getDataURI()\n {\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext( '2d' );\n Object.keys( imagesRack.loadedImages ).forEach( function( key ) {\n var rack = imagesRack.loadedImages[ key ];\n var bImg = rack.img;\n canvas.width = bImg.naturalWidth;\n canvas.height = bImg.naturalHeight;\n ctx.drawImage( bImg, 0, 0, canvas.width, canvas.height );\n rack.dataURI = canvas.toDataURL();\n });\n }", "function handleImage(e){\n var canvas = document.getElementById(\"imgCanvas\");\n\tvar context = canvas.getContext(\"2d\");\n var reader = new FileReader();\n reader.onload = function(event){\n var img = new Image();\n img.onload = function(){\n canvas.width = img.width;\n canvas.height = img.height;\n context.drawImage(img,0,0);\n }\n img.src = event.target.result;\n } \n reader.readAsDataURL(e.target.files[0]); \n}", "draw(board,width,height){\n console.log(\"droaw\");\n this.image.src=\"./st2.png\";\n board.drawImage(this.image,this.x,this.y,this.width,this.height); \n }", "function loadForegroundImage(){\n //get input from text input\n var fileinput = document.getElementById(\"foreinput\");\n fgcanvas = document.getElementById(\"canvf\");\n \n //create the selected image\n fgImage = new SimpleImage(fileinput);\n // show on the canvas\n fgImage.drawTo(fgcanvas);\n}", "function preload() {\n //all presets of images used on canvas\n scorpion = loadImage(\"https://i.imgur.com/XJLFOMc.png\");\n\n}", "function loadImage() {\n canvas = document.getElementById(\"can\");\n var fileInput = document.getElementById(\"OEM-Image\");\n originalImage = new SimpleImage(fileInput);\n grayImage = new SimpleImage(fileInput);\n redImage = new SimpleImage(fileInput);\n rainbowImage = new SimpleImage(fileInput);\n originalImage.drawTo(canvas);\n}", "function loadImage(mySrc, x, y, ctxi, firstTimeLoading) {\n var imageToDraw = new Image();\n imageToDraw.src = mySrc;\n if (firstTimeLoading == true) {\n imageToDraw.onload = function() {\n ctxi.drawImage(imageToDraw, x, y);\n }\n } else {\n ctxi.drawImage(imageToDraw, x, y);\n }\n}", "render() {\n ctx.drawImage(Resources.get(this.image), this.x, this.y)\n }", "initPlayerImage() {\n this.img = new Image();\n this.img.src = this.spriteSheetPath;\n this.img.onload = this.onImageLoaded();\n }", "function draw_image( img ) {\n context.clearRect(0, 0, canvas.width, canvas.height);\n context.drawImage(img, 0, 0, canvas.width, canvas.height);\n }", "function Load() {\n\n colour.value = localStorage.getItem(\"colour\");\n size.value = localStorage.getItem(\"size\");\n var image = new Image();\n image.src = localStorage.getItem(\"canvas\");\n image.onload = function () {\n ctx.drawImage(image, 0, 0, canvas.width, canvas.height);\n console.log(\"load success\");\n }\n}", "function displayCourseImage(){\n var dtForceReload = new Date();//way to force browser to reload picture after update of picture\n var imgPath = app.courseImagePath + courseHandled.details.courseID + \".jpg?\" + dtForceReload.getTime();\n common.setCanvas($(\"#canvasCourse\")[0], imgPath, \"regular\");\n }", "function loadImageURL(cx, url) {\n var image = document.createElement(\"img\");\n image.addEventListener(\"load\", function() {\n var color = cx.fillStyle, size = cx.lineWidth;\n cx.canvas.width = image.width;\n cx.canvas.height = image.height;\n cx.drawImage(image, 0, 0);\n cx.fillStyle = color;\n cx.strokeStyle = color;\n cx.lineWidth = size;\n });\n image.src = url;\n}", "function DownL_Image(){\n\n\tvar xhr = Titanium.Network.createHTTPClient({\n\tonload: function() {\n // first, grab a \"handle\" to the file where you'll store the downloaded data\n\t\tvar f = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,'mygraphic.png');\n\t\tf.write(this.responseData); // write to the file\n\t\tTi.App.fireEvent('graphic_downloaded', {filepath:f.nativePath});\n\t},\n\ttimeout: 10000\n});\n\n\nTi.API.info(\"percorso passato da lbl_indirizzo:\"+path_img);\nxhr.open('GET',\"http://i.imgur.com/xigIkvV.jpg\");\nxhr.send();\nTi.App.addEventListener('graphic_downloaded', function(e) {\n // you don't have to fire an event like this, but perhaps multiple components will\n // want to know when the image has been downloaded and saved\n\tTi.API.info(\"percorso passato da eventlister:\"+e.filepath);\n\t$.imw_image.image = e.filepath;\n});\n\t\n}", "async function loadingImg() {\r\n let img = await prom; // continuation of function will halt till prom is resolved\r\n\r\n let id = self.createID()\r\n self.fill_ID_ImageHash(id,img)\r\n img.id = id\r\n \r\n // now we can set options for image, or do something else with it\r\n if (ops) {\r\n img.set(ops)\r\n };\r\n\r\n\r\n if (canv) {\r\n canv.add(img);\r\n } else {\r\n self.canvas.add(img)\r\n }\r\n\r\n if (cb) {\r\n cb(img)\r\n\r\n };\r\n\r\n //return img\r\n }", "function setImage()\n {\n var img = getId(\"captured_image\");\n \n var path = \"file:\" + Native.getImagePath();\n \n img.setAttribute(\"src\", path);\n }", "function reloadImg() {\n img1 = new Image();\n img1.onload = function () {\n \n\n //draw background image\n ctx.drawImage(img1, 0, 0);\n //draw a box over the top\n imgH = img1.height;\n imgW = img1.width;\n console.log(\"image loaded\");\n drawSquare();\n }\n\n\n img1.src = 'imgs/carriage_toilet.png';\n \n }", "function place(path,x,y) {\n game.canvas[1].drawImage(getImage(path),x ,y);\n }", "function buildImage(src) {\n var image = loadImage(\n src,\n function (img) {\n // add styles to img\n img.className = \"file-image\";\n // empty all children in fileImage\n fileImage.empty();\n // append new img \n fileImage.append(img);\n },\n {\n orientation: true,\n canvas: true,\n cover: true\n }\n );\n return image;\n }", "function cargaImagen(){\n //declaro las variables canvas e input con los documentos seleccionados.\n let canvas = document.querySelector(\"#myCanvas\");\n let input = document.querySelector(\"#importImage\");\n //declaro el contexto donde voy a trabajar.\n let context = canvas.getContext(\"2d\");\n //relleno la imagen de blanco.\n context.fillStyle = \"#ffffff\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n\n //Cuando el input cambie de valor...\n input.onchange = e => {\n //Declaro la direccion de la imagen con la del evento.\n let file = e.target.files[0];\n let reader = new FileReader();\n //Se lee los datos como la URL de la imagen.\n reader.readAsDataURL(file);\n\n //Cuando se cargue el reader.\n reader.onload = readerEvent => {\n //Asigno content como el target del origen de la imagen.\n let content = readerEvent.target.result;\n\n //Creo una nueva imagen con la URL como titulo\n //Se crea una imagen, y le asigno el valor de content como su origen.\n let image = new Image();\n image.src = content;\n\n //cuando carga la imagen...\n image.onload = function(){\n //Asigno el ancho y alto de la imagen, para que entre en el canvas.\n let imageScaledWidth = canvas.width;\n let imageScaledHeight = canvas.height;\n\n canvas.width = image.naturalWidth;\n canvas.height = image.naturalHeight;\n \n //Se adapta la imagen lo mejor posible al canvas.\n /*let imageAspectRatio = (1.0 * this.height) / this.width;\n if (this.width < this.height) {\n imageAspectRatio = (1.0 * this.width) / this.height;\n imageScaledWidth = canvas.height * imageAspectRatio;\n imageScaledHeight = canvas.height;\n }*/\n\n //Se dibuja la imagen en el contexto.\n context.drawImage(this, 0, 0, image.naturalWidth,image.naturalHeight);\n\n //Guardo en la variable imageData la informacion de la imagen.\n let imageData = context.getImageData(0, 0, imageScaledWidth, imageScaledHeight);\n\n //guardo la imagen en una variable para utilizar filtros.\n imageOrigin = ctx.getImageData(0,0,canvas.width,canvas.height);\n\n //Se muestra la imagen en el contexto.\n context.putImageData(imageData, 0, 0);\n }\n }\n }\n }", "static async fromImgUrl (shapeCanvas, opts) {\n const imgOpts = Object.assign({}, opts, {\n groundImg: await loadImage(opts.groundImg)\n })\n return new TerrainRenderer(shapeCanvas, imgOpts)\n }", "getImage() {\n return this.canvas.toDataURL('image/png', 1.0);\n }", "function loadImage(filename, index) {\r\n var imageObj = new Image();\r\n imageObj.onload = function () {\r\n var img = document.getElementById(\"imagesgohere\");\r\n img.setAttribute('src', this.src);\r\n };\r\n imageObj.src = \"data/\" + filename;\r\n }", "function addPathToImage() {\n $(ctrl.imageTags).each(function (index) {\n if (ctrl.imageTags[index].hasAttribute('id')) {\n var imageSrc = ctrl.imageTags[index].getAttribute('id');\n $(ctrl.imageTags[index]).attr('src', oDataPath + \"/Asset('\" + imageSrc + \"')/$value\");\n }\n });\n }", "function loadImage() {\n var baseUrl = 'https://source.unsplash.com/category',\n cat = 'nature',\n size = '1920x1080';\n\n buildElement(`${baseUrl}/${cat}/${size}`).then(render);\n }", "render () {\n ctx.drawImage(Resources.get(this.image), this.x, this.y);\n }", "function loadImage (src, callback) {\n\t\tvar img = new Image(\"images/house.png\");\n\t\timg.src = src;\n\t\timg.onload = function() {\n\t\t\tcallback(null, img);\n\t\t};\n\t}", "function handleImage(e) {\n var reader = new FileReader();\n imgData = 0\n\n reader.onload = function (event) {\n img.onload = function () {\n canvas.width = 400;\n canvas.height = 400 / img.width * img.height;\n\n ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, canvas.width, canvas.height);\n }\n img.src = event.target.result;\n src = event.target.result;\n canvas.classList.add(\"show\");\n DrawOverlay(img);\n \n\n }\n reader.readAsDataURL(e.target.files[0]);\n\n}", "function preload() {\n img = loadImage(\"../assets/Earth.png\");\n}", "function uploadImg(urlimg){\n\t\t\tfabric.Image.fromURL(urlimg, function(img) {\n\t\t\t\tcanvas.add(img.set({ left: 5, top: 5, }).scale(0.5)).setActiveObject(img);\n\t\t\t\tselectObjParam();\n\t\t\t});\n\t\t\tcanvas.renderAll();\t \t\n\t\t}", "function cargar_canvas_odontograma(){\r\n// alert (\"cargar_canvas_odontograma\");\r\n\tvar canvas = document.getElementById('canvas_odontograma');\r\n\tif (canvas.getContext) {\r\n\t\tvar ctx = canvas.getContext('2d');\r\n\t\r\n\t\tvar img = new Image();\r\n\t\r\n \t //defino el evento onload del objeto imagen\r\n\t\t\r\n\t\tcanvas.width = 780;\r\n\t\tcanvas.height = 480;\r\n\t\t\r\n\t\timg.onload = function() {\r\n\t\t\tctx.drawImage(img, 0, 0, canvas.width, canvas.height);\r\n\t\t};\r\n\t\timg.src = 'Imagenes/odontograma/Odontograma2.png';\r\n\t\t\r\n\t\t} else {\r\n\t\talert('You need Safari or Firefox 1.5+ to see this demo.');\r\n\t}\r\n}", "render() {\n ctx.drawImage(Resources.get(this.image), this.x, this.y);\n }", "function loadSlide() {\n\n image.onload = function() {\n\n bufferCtx.canvas.width = ctx.canvas.width;\n bufferCtx.canvas.height = ctx.canvas.height;\n bufferCtx.drawImage(image, 0, 0, slideshow.width, slideshow.height);\n drawCaption(bufferCtx);\n ctx.drawImage(bufferCanvas, 0, 0, slideshow.width, slideshow.height);\n }\n\n image.src = slides[currentSlide].image;\n caption = slides[currentSlide].caption;\n sequence.innerHTML = (currentSlide + 1) + \" / \" + slides.length;\n }", "loadImage(file) {\n let reader = new FileReader();\n\n reader.onload = (e) => {\n file.src = e.target.result;\n\n if (this.afterFileSelect){\n this.afterFileSelect(file);\n }\n };\n\n reader.readAsDataURL(file);\n }", "function setup(){\r\n createCanvas(500, 500);\r\n img1 = loadImage(\"https://celine10811020.github.io/Stock/Stock/20210901.PNG\");\r\n console.log(typeof img1);\r\n}", "function loadImage(image) {\n if (artwork.orientation == 'landscape') {\n context.drawImage(\n image,\n Math.abs(canvas.width / 2 - artwork.longDimension/2),\n Math.abs(canvas.height / 2 - artwork.shortDimension / 2),\n artwork.longDimension,\n artwork.shortDimension\n );\n } else { \n context.drawImage(\n image,\n Math.abs(canvas.width / 2 - artwork.shortDimension / 2),\n Math.abs(canvas.height / 2 - artwork.longDimension/2),\n artwork.shortDimension,\n artwork.longDimension,\n );\n }\n}", "function showImage() {\n if (this.files && this.files[0]) {\n const obj = new FileReader();\n obj.onload = function(data) {\n const image = document.getElementById(\"image\");\n image.src = data.target.result;\n };\n obj.readAsDataURL(this.files[0]);\n }\n}", "function drawBoard() {\n // load the image first\n $(\"canvas\").drawImage({\n source: \"board.jpg\",\n x: 10, y: 10,\n width: 360,\n height: 360,\n fromCenter: false,\n load: drawBoardLines //after image loads, this callback draws the lines on top\n });\n}", "function loadImageFromDrop(src) {\n\n\n var reader = new FileReader();\n reader.onload = function (e) {\n render(e.target.result);\n };\n\n reader.readAsDataURL(src);\n\n\n }", "function receiveCanvasContent(value){\n \n // get gazedata via ajax call\n receiveGD(value);\n \n // compose filepath, save it globally\n var filepath = value + '.' + $('#fileSelection').find('option:selected').attr('type');\n g_imgSrc = filepath;\n\n // draw result\n drawCanvas(filepath);\n \n}", "function sendCanvasImage(id) {\n requestedCanvas = {\n image: canvasImages[id],\n id: id\n }\n socket.emit(\"receiveCanvasImage\", requestedCanvas);\n }", "function initImage() {\n csImage.onload = function () {\n updateShape(new Point(model.x, model.y));\n };\n csImage.src = 'http://www.biobest.co.uk/assets/images/home/blood-samples-web.jpg';\n}", "loadImg() {\n let loadedCount = 0\n function onLoad() {\n loadedCount++\n if (loadedCount >= this.imgPaths.length) {\n this.flowStart()\n }\n }\n this.baseImages = this.imgPaths.map(path => {\n const image = new Image()\n image.onload = onLoad.bind(this)\n image.src = path\n return image\n })\n }", "function initCanvas()\n{\n const canvas = document.getElementById('canvas');\n const ctx = canvas.getContext('2d');\n const canvasWidth = canvas.width;\n const canvasHeight = canvas.height;\n const imageData = ctx.getImageData(0,0,1,1);\n\n}", "function renderizaPlanoDeFundo(){\n\t$(\"canvas\").drawImage({\n\tsource: 'paginaBG2.jpg',\n\tx: 400,\n\ty: 300,\n\twidth: $(\"canvas\").width(),\n\theight: $(\"canvas\").height()\n\t});\n}", "get_image(img_tag){\n let fake_canvas = document.createElement('canvas'),\n fake_context = fake_canvas.getContext('2d');\n fake_canvas.width = img_tag.width;\n fake_canvas.height = img_tag.height;\n fake_context.drawImage(img_tag, 0, 0);\n return fake_context.getImageData(0, 0, img_tag.width, img_tag.height);\n }", "function add_image() {\r\n var image_url = document.getElementById('image_url').value;\r\n fabric.Image.fromURL(image_url, function (oImg) {\r\n canvas.add(oImg);\r\n canvas.sendToBack(oImg);\r\n }, { crossOrigin: 'Anonymous' });\r\n}", "function load_image(file){\r\nconsole.log(\"image loading\");\r\n$(\"#message\").text(\"image loading\");\r\n\tvar image = document.createElement(\"img\");\r\n\tdocument.getElementById(\"hidden_area\").appendChild(image);\r\n\timage.onerror = onImageError;\r\n\timage.onload = onImageLoad;\r\n\tvar createObjectURL = (window.webkitURL && window.webkitURL.createObjectURL) || (window.URL && window.URL.createObjectURL);\r\n\timage.src = createObjectURL(file);\r\n}", "function loadImage(data){\n // encode into base64\n var uint8Arr = new Uint8Array(data.buffer);\n var binary = '';\n for (var i = 0; i < uint8Arr.length; i++) {\n binary += String.fromCharCode(uint8Arr[i]);\n }\n var base64String = window.btoa(binary);\n var img = new Image();\n // load image\n img.onload = function () {\n context.drawImage(img, 0, 0);\n };\n \n img.src = 'data:image/jpeg;base64,' + base64String;\n\n console.log('Image loaded');\n }", "function pathToImage(path) {\n let res = new Image();\n res.src = path;\n return res;\n}", "function setCanvas(w,h){\n canvas.width = imgHolder.width;\n canvas.height = imgHolder.height;\n\n loadImageToCanvas();\n }", "function insertImageToCanvas(statusBar, imageAddress) {\n var image = new Image();\n image.crossOrigin = '';\n image.onload = function () {\n var canvas = $(statusBar).find(\"#steg-canvas\").get(0);\n var context = canvas.getContext('2d');\n context.drawImage(image, 0, 0, image.width, image.height, 0, 0, canvas.width, canvas.width * 1.0 * image.width / image.height);\n var imageText = canvas.toDataURL();\n };\n image.src = imageAddress;\n}", "function loadImage(firstLoad){\n img = new Image()\n zoomed = false\n if (!firstLoad){\n basename = images[curIndex]\n }\n src = path.join(dirname, basename)\n img.src = src\n img.onload = () => {\n setOriDim()\n setSvgDim()\n setDefaultScale()\n setImgDim()\n setImgPos()\n updateImg()\n setTitle()\n }\n}", "uploadCustomImg(canvas) {\n document.getElementById('imgLoader').onchange = function handleImage(e) {\n var reader = new FileReader();\n reader.onload = function (event) {\n\n var imgObj = new Image();\n imgObj.src = event.target.result;\n imgObj.onload = function () {\n // start fabricJS stuff\n\n var image = new fabric.Image(imgObj);\n image.set({\n left: 0,\n top: 0,\n angle: 20,\n padding: 10,\n cornersize: 10\n });\n //image.scale(getRandomNum(0.1, 0.25)).setCoords();\n canvas.add(image);\n\n // end fabricJS stuff\n }\n\n }\n reader.readAsDataURL(e.target.files[0]);\n };\n }", "function loadMemberPhoto(){\n var canvas = document.getElementById('headPhoto'),\n \n context = canvas.getContext('2d');\n var base_image = new Image();\n\n // var memberid=$(\"#h3memberID\")[0].innerHTML;\n memberid=$(\"#memberID\")[0].value;\n\n base_image.onload=function(){\n // context.drawImage(base_image,75,0);\n context.drawImage(this,0,0,this.width,this.height,\n 0,0,canvas.width,canvas.height);\n // context.drawImage(this,0,0,640,640*(this.height/this.width));\n };\n \n $.get('/static/photo/'+memberid+'.png')\n .done(function() { \n // Do something now you know the image exists.\n base_image.src = '/static/photo/'+memberid+'.png';\n }).fail(function() { \n // Image doesn't exist - do something else.\n base_image.src = '/static/photo/eagle.png';\n })\n\n \n}", "convertCanvasToImage(canvas) {\n console.log('this is happening now')\n var image = new Image();\n image.src = canvas.toDataURL(\"image/png\");\n image.classList.add('contain-image');\n return image;\n }", "load(callback) {\n // Try to get paper.js to cache the image src.\n var img = new Image();\n img.src = this.src;\n\n img.onload = () => {\n var raster = new paper.Raster(img);\n raster.remove();\n callback();\n };\n }", "success(res) {\n console.log(res.width);\n console.log(res.height);\n let imgH = res.height/res.width*W\n ctx.drawImage('/assets/images/vip/vip_crde1.png', 0, 0, res.width, res.height, 0, 0 , W, imgH)\n // ctx.drawImage(this.data.assetsImages + 'vip/vip_crde1.png', 0, 0, res.width, res.height, 0, 0 , W, imgH)\n ctx.draw(true)\n\n ctx.beginPath();\n ctx.arc( rpxTopx(591), rpxTopx(320), rpxTopx(60),0,360,false);\n ctx.fillStyle=\"#ffffff\";//填充颜色,默认是黑色\n ctx.fill();//画实心圆\n ctx.closePath();\n ctx.draw(true)\n }", "loadImageFromURL(newImageURL) {\n if (newImageURL === undefined) {\n return;\n }\n\n // get canvas elements\n var imageCanvas = this.refs[\"image-canvas\"];\n var imageCanvasContext = imageCanvas.getContext(\"2d\");\n\n // clear previous image\n imageCanvasContext.clearRect(0, 0, imageCanvas.width, imageCanvas.height);\n\n if (newImageURL.constructor === String) {\n\n // load new image from URL\n var image = new Image();\n image.crossOrigin = '';\n\n image.src = newImageURL;\n\n image.onload = function() {\n \n // draw new image onto canvas\n imageCanvas.width = image.width;\n imageCanvas.height = image.height;\n imageCanvasContext.drawImage(image, 0, 0, image.width, image.height,\n 0, 0, imageCanvas.width, imageCanvas.height);\n\n this.state.imageChangedFromHint(image);\n\n // update canvas data in Caman\n window.Caman(\"#image-canvas\", function() {\n this.reloadCanvasData();\n });\n\n }.bind(this);\n }\n }", "function addPNGFile(imgName){\n\t\t\tconsole.log('adding PNG', imgName); \t\t\n\t\t\tvar imgPNGName = new Image()\n\t\t\timgPNGName.src = imgName;\n\t\t\tfabric.Image.fromURL(imgName, function(img) {\n\t\t\t\tcanvas.add(img.set({ left: 5, top: 5, }).scale(0.5)).setActiveObject(img);\n\t\t\t\tselectObjParam();\n\t\t\t\tcanvas.renderAll();\t \n\t\n\t\t\t});\n\t\t}", "function drawImage(input) {\n\t\tif (input.files && input.files[0]) {\n\t\t\tvar reader = new FileReader();\n\t\t\treader.onload = function(e) {\n\t\t\t\tvar parentofSelected = input.parentNode; \n\t\t\t\tparentofSelected.getElementsByTagName('img')[0].setAttribute('src', e.target.result);\n\t\t\t}\n\t\t\treader.readAsDataURL(input.files[0]);\n\t\t}\n\t}", "function initCanvas(onDrawingCallback) {\n let flag = false,\n prevX, prevY, currX, currY = 0;\n let canvasJq = $('#canvas');\n let canvasEle = document.getElementById('canvas');\n let imgEle = document.getElementById('image');\n\n // event on the canvas when the mouse is on it\n canvasJq.on('mousemove mousedown mouseup mouseout', function (e) {\n prevX = currX;\n prevY = currY;\n currX = e.clientX - canvasJq.position().left;\n currY = e.clientY - canvasJq.position().top;\n if (e.type === 'mousedown') {\n flag = true;\n }\n if (e.type === 'mouseup' || e.type === 'mouseout') {\n flag = false;\n }\n // if the flag is up, the movement of the mouse draws on the canvas\n if (e.type === 'mousemove') {\n if (flag) { \n data = { \n canvas: { \n width: canvasEle.width, \n height: canvasEle.height \n }, \n paths: [\n { \n x1: prevX, \n y1: prevY, \n x2: currX, \n y2: currY \n }\n ], \n color: inkColor, \n thickness: thickness \n }\n pushPath(data);\n onDrawingCallback(data);\n }\n }\n });\n\n // Loaded & resize event\n imgEle.addEventListener('load', () => {\n repositionCanvas();\n });\n\n window.addEventListener('resize', () => {\n repositionCanvas();\n });\n\n // If the image has already been loaded.\n if (imgEle.naturalHeight && imgEle.clientWidth > 0) {\n repositionCanvas();\n }\n}", "function read_and_draw_dataurl(file, image) {\n // Releasing data URL when image is loaded\n image.addEventListener('load', function () {\n window.URL.revokeObjectURL(this.src);\n });\n // Triggering the load\n image.src = window.URL.createObjectURL(file); // creating a data URL from file description\n }", "function imageLoad(self, e) {\n\tif (e.id > self.lastLoaded && self.config.showLoadedImages) { // to not have a back and forward hickup… but some images will be skipped\n\t\tself.drawImage(e.id);\n\t\tself.lastLoaded = e.id;\n\t}\n\n\tif (typeof self.config.imageLoad === 'function' ) {\n\t\te.sequencer = self;\n\t\tself.config.imageLoad(e);\n\t}\n\n\tif (typeof self.imageLoad === 'function' ) {\n\t\te.sequencer = self;\n\t\tself.imageLoad(e);\n\t}\n\n\t// The canvas size is determined and set from the first image loaded:\n\tif (e.id === 0) {\n\t\tif(self.config.fitFirstImage) {\n\t\t\tself.size(e.img.width, e.img.height);\n\t\t\tself.config.fitFirstImage = false;\n\t\t}\n\t\tself.drawImage(0);\n\t\tself.current = 0; // TODO: could be better\n\t}\n}", "drawImage() {\n\n }", "function cargar_canvas_odontograma_bd(){\r\n\t// alert (\"cargar_canvas_odontograma\");\r\n\t\tvar canvas = document.getElementById('canvas_odontograma');\r\n\t\tif (canvas.getContext) {\r\n\t\t\tvar ctx = canvas.getContext('2d');\r\n\t\t\r\n\t\t\tvar img = document.getElementById(\"imgbd\");\r\n\t\t\r\n\t \t //defino el evento onload del objeto imagen\r\n\t\t\t\r\n\t\t\tcanvas.width = 780;\r\n\t\t\tcanvas.height = 480;\r\n\t\t\t\r\n\t\t\timg.onload = function() {\r\n\t\t\t\tctx.drawImage(img, 0, 0, canvas.width, canvas.height);\r\n\t\t\t};\r\n\t\t\t//srcimg= \"'\"+\"data:image/png;base64,\"+imgbd+\"'\";\r\n\t\t\t//img.src=srcimg;\r\n\t\t\t//\"<img src='data:image/png;base64,\"+imagen +\"'/>\"\r\n\t\t\t//alert(\"img canvas= \"+srcimg);\r\n\t\t\t\r\n\t\t\t} else {\r\n\t\t\talert('You need Safari or Firefox 1.5+ to see this demo.');\r\n\t\t}\r\n\t}", "function loadImage(src){\n //\tPrevent any non-image file type from being read.\n if(!src.type.match(/image.*/)){\n console.log(\"The dropped file is not an image: \", src.type);\n return;\n }\n\n //\tCreate our FileReader and run the results through the render function.\n var reader = new FileReader();\n reader.onload = function(e){\n var data = e.target.result\n $.ajax({\n type: \"POST\",\n url: \"uploadCanvas\",\n //contentType: \"application/x-www-form-urlencoded\",\n data: {\n img64: data\n },\n success: function (response) {\n console.log(response);\n },\n error: function (errorThrown) {\n console.log(errorThrown)\n }\n\n }).done(function(o) {\n tempImg = globalsrc + o\n tmpO = o\n var tmp = new Image();\n tmp.src = tempImg\n tmp.onload = function(){\n $(\"#image\").css('width',tmp.width)\n $(\"#image\").css('height',tmp.height)\n\n $(\"#image\").css({'background': 'url('+tempImg+') no-repeat',\n 'background-size': '100% auto'})\n\n\n\n $(\"#image\").freetrans({\n 'rot-origin': '50% 50%'\n }).css({\n border: \"1px solid pink\"\n });\n var o = $('#image').freetrans('getBounds');\n tmpW = o.width\n tmp=null\n }\n\n\n\n });\n\n };\n reader.readAsDataURL(src);\n}", "function add() {\r\n\t\t//upload car, and background images on the canvas.\r\n\r\n\t\tbackground_img = new Image()\r\n\t\tbackground_img.onload = uploadBackground;\r\n\t\tbackground_img.src = background_image\r\n\t\trover_img = new Image()\r\n\t\trover_img.onload = uploadrover;\r\n\t\trover_img.src = rover_image;\r\n\t\t\r\n}", "function imgToDataUrl(img) {\n var $img = artoo.$(img);\n\n // Do we know the mime type of the image?\n var mime = imageMimes[getExtension($img.attr('src')) || 'png'];\n\n // Creating dummy canvas\n var canvas = document.createElement('canvas');\n canvas.width = $img[0].naturalWidth;\n canvas.height = $img[0].naturalHeight;\n\n // Copy the desired image to a canvas\n var ctx = canvas.getContext('2d');\n ctx.drawImage($img[0], 0, 0);\n var dataUrl = canvas.toDataURL(mime);\n\n // Clean up\n canvas = null;\n\n // Returning the url\n return dataUrl;\n }", "function loadImage() {\n\n // image file not loaded yet? => load image file\n if ( !resource ) jQuery( '<img src=\"' + url + '\">' );\n\n // immediate perform success callback\n success();\n\n }", "function setImg(src, id){\n // grabs image and looks for attribute source to set the frame's attribute\n $(\"#main\").attr(\"src\", src);\n\n $.get(\"path\", function(data){\n \n });\n }", "function renderImages() {\n imgElem.src = Actor.all[0].path;\n}", "function getDataUrl(img, type) {\n let canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n let context = canvas.getContext('2d');\n context.drawImage(img, 0, 0);\n return canvas.toDataURL('image/' + type);\n }", "function putinto_clothes(canvas,url) {\n\n var dataURL=canvas.toDataURL('image/png');\n var Img=new Image;\n Img.src=dataURL;\n var clothes=new Image;\n clothes.src=url;\n var canvas0=document.getElementById('canvas0');\n var ctx=canvas0.getContext('2d');\n ctx.clearRect(0,0,canvas0.width,canvas0.height);\n ctx.drawImage(clothes,0,0);\n ctx.drawImage(Img,110,150,120,150);\n }", "function preload(){\r\n\r\n img=loadImage('js/ddss.png');\r\n}" ]
[ "0.7161191", "0.68201184", "0.6790953", "0.6768371", "0.66306484", "0.6491823", "0.64799446", "0.64259785", "0.6353772", "0.6342281", "0.6337488", "0.62757075", "0.6246974", "0.6232981", "0.62265486", "0.61989856", "0.6191581", "0.61748576", "0.6168299", "0.61618435", "0.6152977", "0.6143701", "0.61348706", "0.61345667", "0.6133324", "0.6118779", "0.6104869", "0.61034036", "0.61027235", "0.6091125", "0.60833126", "0.6083213", "0.6072394", "0.6047502", "0.60278577", "0.60188097", "0.6014673", "0.6013543", "0.5977234", "0.5966892", "0.5955316", "0.59457266", "0.59343046", "0.59317386", "0.5930868", "0.5925982", "0.59116364", "0.5909867", "0.590937", "0.5904827", "0.58979875", "0.5895444", "0.58882606", "0.58825266", "0.5879564", "0.5877538", "0.58751297", "0.5865302", "0.5860715", "0.5858345", "0.58574307", "0.58565754", "0.5853941", "0.58523816", "0.58496445", "0.5844941", "0.584307", "0.5842884", "0.5832505", "0.5832428", "0.5824731", "0.5815723", "0.58089584", "0.58087295", "0.58043826", "0.5803251", "0.5795704", "0.57921803", "0.57889634", "0.5787717", "0.57874936", "0.57836944", "0.5778965", "0.57750374", "0.5765471", "0.5763752", "0.5763295", "0.5761413", "0.57605463", "0.57594705", "0.57584757", "0.57558745", "0.5755369", "0.57542086", "0.5749964", "0.5744241", "0.5743951", "0.57435584", "0.5735435", "0.57306856" ]
0.6700588
4
Handle when the primary card at the top of the HomeView component is tapped. Use delta to determine whether or not the tap is singular or double.
cardTap() { const delta = new Date().getTime() - this.state.lastPress; let updateShowBack = this.state.showBack; if (delta < 200) { // double tap happend updateShowBack = this.state.showBack ? false : true; } this.setState({ ...this.state, showBack: updateShowBack, lastPress: new Date().getTime() }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function didTap() {\n //Enure we dont return 0 or null for false values\n return !!(validateTap() && hasTap());\n }", "function didTap() {\n //Enure we dont return 0 or null for false values\n return !!(validateTap() && hasTap());\n }", "function didTap() {\n\t\t //Enure we dont return 0 or null for false values\n\t\t\treturn !!(validateTap() && hasTap());\n\t\t}", "function didTap() {\n\t\t //Enure we dont return 0 or null for false values\n\t\t\treturn !!(validateTap() && hasTap());\n\t\t}", "function didTap() {\n\t\t //Enure we dont return 0 or null for false values\n\t\t\treturn !!(validateTap() && hasTap());\n\t\t}", "handleTap(){\n\n }", "function onTap() {\n if ($('#site-header').hasClass('toggled')) {\n $('#site-header').removeClass('toggled')\n $('#menu-primary').css('height', 'auto');\n $(window).unbind('scroll');\n $('#menu-primary').find('a, input').attr('tabindex', -1);\n } else {\n var bodyHeight = $('body').height();\n $('#site-header').addClass('toggled')\n $('#menu-primary').css('height', bodyHeight);\n $(window).scroll(onScroll);\n $('#menu-primary').find('a, input').attr('tabindex', 0);\n }\n }", "function handleCardClick(event) {\n if ($(event.currentTarget).hasClass(\"isFlipped\") || twoCardsClicked) {\n return; // if a card is already flipped or there are two cards already clicked then clicks will be temporarily disabled\n }\n if (firstCardClicked === null) {\n firstCardClicked = $(event.currentTarget).addClass(\"isFlipped\");\n firstCardClickedImageURL = event.currentTarget.children[2].style.backgroundImage; // image url of the first clicked card\n } else {\n secondCardClicked = $(event.currentTarget).addClass(\"isFlipped\");\n secondCardClickedImageURL = event.currentTarget.children[2].style.backgroundImage; // image url of the second clicked card\n twoCardsClicked = true;\n if (firstCardClickedImageURL !== secondCardClickedImageURL) { // actions to take if the two clicked cards don't match\n misMatchedCardsAction();\n } else { // actions to take if the two clicked cards match\n matchedCardsAction();\n }\n }\n displayStats(); // calculate and show stats\n}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "function eventTap ( event ) {\n\n\t\t// The tap event shouldn't propagate up\n\t\tevent.stopPropagation();\n\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\n\t\tvar handleNumber = getClosestHandle(proposal);\n\n\t\t// Tackle the case that all handles are 'disabled'.\n\t\tif ( handleNumber === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flag the slider as it is now in a transitional state.\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\tif ( !options.events.snap ) {\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n\t\t}\n\n\t\tsetHandle(handleNumber, proposal, true, true);\n\n\t\tsetZindex();\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\t\tfireEvent('update', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\n\t\t}\n\t}", "isSingleTap(currentTouchTimeStamp, { x0, y0 }) {\n const { prevTouchX, prevTouchY, prevTouchTimeStamp } = this.prevTouchInfo;\n const dt = currentTouchTimeStamp - prevTouchTimeStamp;\n\n return dt < 200 && this.distance(prevTouchX, prevTouchY, x0, y0) < 5;\n }", "function eventTap ( event ) {\r\n\r\n\t\t// The tap event shouldn't propagate up\r\n\t\tevent.stopPropagation();\r\n\r\n\t\tvar proposal = calcPointToPercentage(event.calcPoint);\r\n\t\tvar handleNumber = getClosestHandle(proposal);\r\n\r\n\t\t// Tackle the case that all handles are 'disabled'.\r\n\t\tif ( handleNumber === false ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Flag the slider as it is now in a transitional state.\r\n\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\r\n\t\tif ( !options.events.snap ) {\r\n\t\t\taddClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\r\n\t\t}\r\n\r\n\t\tsetHandle(handleNumber, proposal, true, true);\r\n\r\n\t\tsetZindex();\r\n\r\n\t\tfireEvent('slide', handleNumber, true);\r\n\t\tfireEvent('set', handleNumber, true);\r\n\t\tfireEvent('change', handleNumber, true);\r\n\t\tfireEvent('update', handleNumber, true);\r\n\r\n\t\tif ( options.events.snap ) {\r\n\t\t\teventStart(event, { handleNumbers: [handleNumber] });\r\n\t\t}\r\n\t}", "function handleClickCard(event) {\n $(event.currentTarget).find('.backOfCard').addClass('hidden');\n console.log(event.currentTarget);\n if (firstCardClicked === null) {\n firstCardClicked = $(event.currentTarget);\n } else {\n secondCardClicked = $(event.currentTarget);\n attempts++;\n var firstPick = firstCardClicked.find('.revealCard').css('background-image');\n var secondPick = secondCardClicked.find('.revealCard').css('background-image');\n turnClickHandlerOff();\n if (firstPick === secondPick) {\n console.log('The cards match!');\n matches++;\n firstCardClicked = null;\n secondCardClicked = null;\n turnClickHandlerOn();\n } else {\n setTimeout(function () {\n firstCardClicked.find('.backOfCard').removeClass('hidden');\n firstCardClicked = null;\n secondCardClicked.find('.backOfCard').removeClass('hidden');\n secondCardClicked = null;\n turnClickHandlerOn();\n }, 500);\n }\n displayStats();\n }\n}", "function eventTap(event) {\n\n // The tap event shouldn't propagate up\n event.stopPropagation();\n\n var proposal = calcPointToPercentage(event.calcPoint);\n var handleNumber = getClosestHandle(proposal);\n\n // Tackle the case that all handles are 'disabled'.\n if (handleNumber === false) {\n return false;\n }\n\n // Flag the slider as it is now in a transitional state.\n // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n if (!options.events.snap) {\n addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n }\n\n setHandle(handleNumber, proposal, true, true);\n\n setZindex();\n\n fireEvent('slide', handleNumber, true);\n fireEvent('update', handleNumber, true);\n fireEvent('change', handleNumber, true);\n fireEvent('set', handleNumber, true);\n\n if (options.events.snap) {\n eventStart(event, {handleNumbers: [handleNumber]});\n }\n }", "_onContainerTouchStart(e){\n e.preventDefault();\n if(e.touches.length === 2){\n this.doubleTap = true;\n this.tapDistance = this._calcDistance(\n e.touches[0].pageX, e.touches[0].pageY,\n e.touches[1].pageX, e.touches[1].pageY\n );\n }\n let element = $(e.target);\n if(element.attr('handle') != undefined){\n let box = this.elements[element.attr('handle')];\n if(box != undefined){\n let x = e.touches[0].pageX - this.canvas.offsetLeft;\n let y = e.touches[0].pageY - this.canvas.offsetTop;\n this.onTouchStart(e, x, y, box);\n box.onTouchStart(e, x, y);\n }\n }\n }", "function eventTap(event) {\n // The tap event shouldn't propagate up\n event.stopPropagation();\n var proposal = calcPointToPercentage(event.calcPoint);\n var handleNumber = getClosestHandle(proposal);\n // Tackle the case that all handles are 'disabled'.\n if (handleNumber === false) {\n return;\n }\n // Flag the slider as it is now in a transitional state.\n // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n if (!options.events.snap) {\n addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n }\n setHandle(handleNumber, proposal, true, true);\n setZindex();\n fireEvent(\"slide\", handleNumber, true);\n fireEvent(\"update\", handleNumber, true);\n if (!options.events.snap) {\n fireEvent(\"change\", handleNumber, true);\n fireEvent(\"set\", handleNumber, true);\n }\n else {\n eventStart(event, { handleNumbers: [handleNumber] });\n }\n }", "function eventTap(event) {\n // The tap event shouldn't propagate up\n event.stopPropagation();\n\n var proposal = calcPointToPercentage(event.calcPoint);\n var handleNumber = getClosestHandle(proposal);\n\n // Tackle the case that all handles are 'disabled'.\n if (handleNumber === false) {\n return false;\n }\n\n // Flag the slider as it is now in a transitional state.\n // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n if (!options.events.snap) {\n addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n }\n\n setHandle(handleNumber, proposal, true, true);\n\n setZindex();\n\n fireEvent(\"slide\", handleNumber, true);\n fireEvent(\"update\", handleNumber, true);\n fireEvent(\"change\", handleNumber, true);\n fireEvent(\"set\", handleNumber, true);\n\n if (options.events.snap) {\n eventStart(event, { handleNumbers: [handleNumber] });\n }\n }", "function eventTap(event) {\n // The tap event shouldn't propagate up\n event.stopPropagation();\n\n var proposal = calcPointToPercentage(event.calcPoint);\n var handleNumber = getClosestHandle(proposal);\n\n // Tackle the case that all handles are 'disabled'.\n if (handleNumber === false) {\n return false;\n }\n\n // Flag the slider as it is now in a transitional state.\n // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n if (!options.events.snap) {\n addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n }\n\n setHandle(handleNumber, proposal, true, true);\n\n setZindex();\n\n fireEvent(\"slide\", handleNumber, true);\n fireEvent(\"update\", handleNumber, true);\n fireEvent(\"change\", handleNumber, true);\n fireEvent(\"set\", handleNumber, true);\n\n if (options.events.snap) {\n eventStart(event, { handleNumbers: [handleNumber] });\n }\n }", "function eventTap(event) {\n // The tap event shouldn't propagate up\n event.stopPropagation();\n\n var proposal = calcPointToPercentage(event.calcPoint);\n var handleNumber = getClosestHandle(proposal);\n\n // Tackle the case that all handles are 'disabled'.\n if (handleNumber === false) {\n return false;\n }\n\n // Flag the slider as it is now in a transitional state.\n // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n if (!options.events.snap) {\n addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n }\n\n setHandle(handleNumber, proposal, true, true);\n\n setZindex();\n\n fireEvent(\"slide\", handleNumber, true);\n fireEvent(\"update\", handleNumber, true);\n fireEvent(\"change\", handleNumber, true);\n fireEvent(\"set\", handleNumber, true);\n\n if (options.events.snap) {\n eventStart(event, { handleNumbers: [handleNumber] });\n }\n }", "function OnMultiTap(tap:Tap){\n\t//do a raycast base on the position of the tap\n\tvar ray:Ray = Camera.main.ScreenPointToRay(tap.pos);\n\tvar hit:RaycastHit;\n\tif(Physics.Raycast(ray, hit, Mathf.Infinity)){\n\t\t//if the tap lands on the shortTapObj, then shows the effect.\n\t\tif(hit.collider.transform==shortTapObj){\n\t\t\t//place the indicator at the object position and assign a random color to it\n\t\t\tIndicator.transform.position=shortTapObj.position;\n\t\t\tIndicator.startColor=GetRandomColor();\n\t\t\t//emit a set number of particle\n\t\t\tIndicator.Emit(30);\n\t\t}\n\t\t//if the tap lands on the doubleTapObj\n\t\telse if(hit.collider.transform==doubleTapObj){\n\t\t\t//check to make sure if the tap count matches\n\t\t\tif(tap.count==2){\n\t\t\t\t//place the indicator at the object position and assign a random color to it\n\t\t\t\tIndicator.transform.position=doubleTapObj.position;\n\t\t\t\tIndicator.startColor=GetRandomColor();\n\t\t\t\t//emit a set number of particle\n\t\t\t\tIndicator.Emit(30);\n\t\t\t}\n\t\t}\n\t}\n}", "_onTap(e) {}", "function cardClick() {\n if (event.target.nodeName == \"LI\") {\n // Card area is clicked\n cardClicked = event.target;\n } else if (event.target.nodeName == \"I\") {\n // card icon is clicked\n cardClicked = event.target.parentElement;\n } else {\n return; // Empty deck area clicked\n }\n if (cardClicked === openCards[0]) {\n return;\n }\n}", "function tap ( event ) {\n\n\t\tvar location = event.calcPoint, total = 0, to;\n\n\t\t// The tap event shouldn't propagate up and cause 'edge' to run.\n\t\tevent.stopPropagation();\n\n\t\t// Add up the handle offsets.\n\t\t$.each( $Handles, function(){\n\t\t\ttotal += this.offset()[ options.style ];\n\t\t});\n\n\t\t// Find the handle closest to the tapped position.\n\t\ttotal = ( location < total/2 || $Handles.length === 1 ) ? 0 : 1;\n\n\t\tlocation -= $Base.offset()[ options.style ];\n\n\t\t// Calculate the new position.\n\t\tto = ( location * 100 ) / baseSize();\n\n\t\tif ( !options.events.snap ) {\n\t\t\t// Flag the slider as it is now in a transitional state.\n\t\t\t// Transition takes 300 ms, so re-enable the slider afterwards.\n\t\t\taddClassFor( $Target, Classes[14], 300 );\n\t\t}\n\n\t\t// Find the closest handle and calculate the tapped point.\n\t\t// The set handle to the new position.\n\t\tsetHandle( $Handles[total], to );\n\n\t\tfireEvents(['slide', 'set', 'change']);\n\n\t\tif ( options.events.snap ) {\n\t\t\tstart(event, { handles: [$Handles[total]] });\n\t\t}\n\t}", "function cardFlipStart(e) {\n PageX = e.touches[0].pageX;\n PageY = e.touches[0].pageY;\n console.log('touch started');\n }", "function onContentTap(gestureEvt) {\n if (sideMenuCtrl.getOpenAmount() !== 0) {\n sideMenuCtrl.close();\n gestureEvt.gesture.srcEvent.preventDefault();\n startCoord = null;\n primaryScrollAxis = null;\n } else if (!startCoord) {\n startCoord = ionic.tap.pointerCoord(gestureEvt.gesture.srcEvent);\n }\n }", "function onContentTap(gestureEvt) {\n if (sideMenuCtrl.getOpenAmount() !== 0) {\n sideMenuCtrl.close();\n gestureEvt.gesture.srcEvent.preventDefault();\n startCoord = null;\n primaryScrollAxis = null;\n } else if (!startCoord) {\n startCoord = ionic.tap.pointerCoord(gestureEvt.gesture.srcEvent);\n }\n }", "handleOnCardClicked(event) {\n const card = event.target;\n // skip and return if event target is not li or \n // if it is already open\n // if it is already matched\n if (card.nodeName.toLowerCase() !== 'li' ||\n this.mModel.mOpenCards.includes(card) ||\n this.mModel.mMatchedCards.includes(card)) {\n console.log('skipped click handling')\n return;\n }\n\n // add move, and then check resulting moves\n this.checkStars(this.mModel.addMove());\n\n // add card to the list of open cards\n this.mModel.addCardToOpenCards(card);\n }", "function manipulateCard(event) {\n\t// Check if there is any card already clicked\n\tif (firstClickedElement === null){\n\n\t\t// No card clicked yet => store its value (class) into firstCard variable\n\t\tfirstCard = event.target.lastElementChild.getAttribute('class');\n\n\t\t// Show the card\n\t\tshowCard(event);\n\n\t\t// Get the element of the first clicked card\n\t\tfirstClickedElement = document.querySelector('.clicked');\n\n\t} else if (firstCard === event.target.lastElementChild.getAttribute('class')) {\n\t\t// Show the second clicked card\n\t\tshowCard(event);\n\n\t\t// Since 2nd card matches the first one => change cards status to \"card match\" (both cards remain with their face up) -> with a short delay\n\t\tchangeCardsStatus(event, 'card match');\n\n\t\t// Reinitialize to null (a new pair of clicks begins)\n\t\tother2Cards();\n\t\t\n\t\t// Increase number of matched cards\n\t\tcellNo = cellNo + 2;\n\n\t} else {\n\t\t// Show the second clicked card\n\t\tshowCard(event);\n\n\t\t// Set the 2 clicked cards attributes to wrong class -> with a short delay\n\t\tchangeCardsStatus(event, 'card open show wrong');\n\n\t\t// Set the 2 clicked cards attributes to its defaults -> with a short delay\n\t\tsetTimeout(function(){\n\t\t\tchangeCardsStatus(event, 'card');\n\n\t\t\t// Reinitialize to null (a new pair of clicks begins)\n\t\t\tother2Cards();\n\t\t}, 300);\n\t}\n}", "singleTap() {\r\n\t\tif (window.singleTap !== undefined) {\r\n\t\t\tsingleTap(); //The function lying directly on window is called\r\n\t\t}\r\n\t}", "function tap(event) {\n var location = event.calcPoint,\n total = 0,\n handleNumber, to;\n // The tap event shouldn't propagate up and cause 'edge' to run.\n event.stopPropagation();\n // Add up the handle offsets.\n scope_Handles.forEach(function(a) {\n total += offset(a)[options.style];\n });\n // Find the handle closest to the tapped position.\n handleNumber = (location < total / 2 || scope_Handles.length ===\n 1) ? 0 : 1;\n // Check if handler is not disablet if yes set number to the next handler\n if (scope_Handles[handleNumber].hasAttribute('disabled')) {\n handleNumber = handleNumber ? 0 : 1;\n }\n location -= offset(scope_Base)[options.style];\n // Calculate the new position.\n to = (location * 100) / baseSize();\n if (!options.events.snap) {\n // Flag the slider as it is now in a transitional state.\n // Transition takes 300 ms, so re-enable the slider afterwards.\n addClassFor(scope_Target, cssClasses[14], 300);\n }\n // Support 'disabled' handles\n if (scope_Handles[handleNumber].hasAttribute('disabled')) {\n return false;\n }\n // Find the closest handle and calculate the tapped point.\n // The set handle to the new position.\n setHandle(scope_Handles[handleNumber], to);\n fireEvent('slide', handleNumber, true);\n fireEvent('set', handleNumber, true);\n fireEvent('change', handleNumber, true);\n if (options.events.snap) {\n start(event, {\n handles: [scope_Handles[handleNumber]]\n });\n }\n }", "function handleCardClick(event) {\n\tlet clickedCard = event.target;\n\t// check whether card has been clicked\n\tfor (let card of allClickedCards) {\n\t\tif (card === clickedCard) {\n\t\t\treturn 0;\n\t\t}\n\t}\n\t// handle the first of the two clicks\n\tif (clicked.length === 0) {\n\t\tclicked.push(clickedCard);\n\t\tallClickedCards.push(clickedCard);\n\t\tclickedCard.style.backgroundImage = `url(${clickedCard.classList[0]})`;\n\t\t// handle the second of the two clicks\n\t} else if (clicked.length === 1) {\n\t\tclicked.push(clickedCard);\n\t\tallClickedCards.push(clickedCard);\n\t\tclickedCard.style.backgroundImage = `url(${clickedCard.classList[0]})`;\n\t\tresult = checkMatch(clicked[0].style.backgroundImage, clicked[1].style.backgroundImage);\n\t\tif (result === true) {\n\t\t\t// start the counter over\n\t\t\tfor (card of clicked) {\n\t\t\t\tcard.classList.add('glow');\n\t\t\t}\n\t\t\tclicked = [];\n\t\t\tupdateGuesses();\n\t\t\t// keep from re-clicking the card, take it out of the running\n\t\t} else {\n\t\t\tsetTimeout(function() {\n\t\t\t\tflipCards(clicked);\n\t\t\t\tclicked = [];\n\t\t\t}, 1000);\n\t\t\tallClickedCards.pop();\n\t\t\tallClickedCards.pop();\n\t\t\tupdateGuesses();\n\t\t}\n\t}\n\n\tif (allClickedCards.length === COLORS.length) {\n\t\tsetTimeout(function() {\n\t\t\tgameOver();\n\t\t}, 100);\n\t}\n}", "function tap(event, Dt, Op) {\n\n var base = Dt.base, handle, to, point, size;\n\n // The tap event shouldn't propagate up to trigger 'edge'.\n event.stopPropagation();\n\n // Determine the direction of the slider.\n if (Op['orientation']) {\n point = event['pointY'];\n size = base.height();\n } else {\n point = event['pointX'];\n size = base.width();\n }\n\n // Find the closest handle and calculate the tapped point.\n handle = closestHandle(base.data('handles'), point, Op['style']);\n to = ((point - base.offset()[Op['style']]) * 100) / size;\n\n // The set handle to the new position.\n jump(base, handle, to, [Op['slide'], Op['set']]);\n }", "function eventTap(event) {\n // Erroneous events seem to be passed in occasionally on iOS/iPadOS after user finishes interacting with\n // the slider. They appear to be of type MouseEvent, yet they don't have usual properties set. Ignore tap\n // events that have no touches or buttons associated with them.\n if (!event.buttons && !event.touches) {\n return false;\n }\n\n // The tap event shouldn't propagate up\n event.stopPropagation();\n\n var proposal = calcPointToPercentage(event.calcPoint);\n var handleNumber = getClosestHandle(proposal);\n\n // Tackle the case that all handles are 'disabled'.\n if (handleNumber === false) {\n return false;\n }\n\n // Flag the slider as it is now in a transitional state.\n // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n if (!options.events.snap) {\n addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);\n }\n\n setHandle(handleNumber, proposal, true, true);\n\n setZindex();\n\n fireEvent(\"slide\", handleNumber, true);\n fireEvent(\"update\", handleNumber, true);\n fireEvent(\"change\", handleNumber, true);\n fireEvent(\"set\", handleNumber, true);\n\n if (options.events.snap) {\n eventStart(event, { handleNumbers: [handleNumber] });\n }\n }", "function matcher(card) {\n if (clicked(card)) {\n return;\n }\n displayer(card);\n opened(card);\n}", "function clickOnCard(e) {\n // if the target isn't a card, stop the function\n if (!e.target.classList.contains('card')) return;\n // if the user click the first time on a card (-->that is flip the first card) the timer starts\n if(isFirstCardclicked) {\n startTimer();\n isFirstCardclicked=false;\n }\n if (openCards.length<2) {\n let cardClicked = e.target;\n console.log(\"clicked \"+e.target.querySelector('i').classList);\n // show the card\n showSymbol(cardClicked);\n // save the card clicked\n addOpenCard(cardClicked);\n }\n if (openCards.length == 2) {\n // to stop from further clicking on cards until animation is finished\n deck.removeEventListener('click', clickOnCard);\n checkMatch(openCards[0], openCards[1]);\n updateMovesCounter();\n updateRating();\n }\n}", "function onCardClicked() {\n //get the card that was clicked\n let selectedId = $(this).attr('id').replace('card-','');\n let selectedCard = cards[selectedId];\n\n if (selectedCard.isDisplayed() || openCards.length >= 2) {\n return;\n } else {\n //increment click counter\n moveCount++;\n $('.moves').text(moveCount);\n\n //check move count and decrement stars if needed.\n if (moveCount == 20) {\n $('#star-3').removeClass('fa-star');\n $('#star-3').addClass('fa-star-o');\n } else if (moveCount == 30) {\n $('#star-2').removeClass('fa-star');\n $('#star-2').addClass('fa-star-o');\n }\n\n //display the card.\n selectedCard.flip();\n\n //after short delay, check if there is a match.\n //this is done so that the cards do not immediately flip back\n //preventing you from seeing the 2nd card.\n setTimeout(function() {\n if (!findCardMatch(selectedCard)) {\n //add selected card to list of open cards\n openCards.push(selectedCard);\n\n if (openCards.length == 2) {\n //hide both cards\n openCards[0].flip();\n openCards[1].flip();\n openCards = [];\n }\n }\n }, 800);\n }\n}", "didSnakeEatAnApple() {\n const snakeHead = document.querySelector('.head') || undefined;\n if (snakeHead) {\n if (snakeHead.classList.contains('apple')) {\n this.snake.eat();\n snakeHead.classList.remove('apple');\n this.renderApple();\n this.user.updateScore();\n this.updateGameSpeed();\n }\n }\n }", "function tap ( event ) {\r\n\r\n\t\t\tvar location = event.calcPoint, total = 0, handleNumber, to;\r\n\r\n\t\t\t// The tap event shouldn't propagate up and cause 'edge' to run.\r\n\t\t\tevent.stopPropagation();\r\n\r\n\t\t\t// Add up the handle offsets.\r\n\t\t\tscope_Handles.forEach(function(a){\r\n\t\t\t\ttotal += offset(a)[ options.style ];\r\n\t\t\t});\r\n\r\n\t\t\t// Find the handle closest to the tapped position.\r\n\t\t\thandleNumber = ( location < total/2 || scope_Handles.length === 1 ) ? 0 : 1;\r\n\r\n\t\t\t// Check if handler is not disablet if yes set number to the next handler\r\n\t\t\tif (scope_Handles[handleNumber].hasAttribute('disabled')) {\r\n\t\t\t\thandleNumber = handleNumber ? 0 : 1;\r\n\t\t\t}\r\n\r\n\t\t\tlocation -= offset(scope_Base)[ options.style ];\r\n\r\n\t\t\t// Calculate the new position.\r\n\t\t\tto = ( location * 100 ) / baseSize();\r\n\r\n\t\t\tif ( !options.events.snap ) {\r\n\t\t\t\t// Flag the slider as it is now in a transitional state.\r\n\t\t\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\r\n\t\t\t\taddClassFor( scope_Target, options.cssClasses.tap, options.animationDuration );\r\n\t\t\t}\r\n\r\n\t\t\t// Support 'disabled' handles\r\n\t\t\tif ( scope_Handles[handleNumber].hasAttribute('disabled') ) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// Find the closest handle and calculate the tapped point.\r\n\t\t\t// The set handle to the new position.\r\n\t\t\tsetHandle( scope_Handles[handleNumber], to );\r\n\r\n\t\t\tfireEvent('slide', handleNumber, true);\r\n\t\t\tfireEvent('set', handleNumber, true);\r\n\t\t\tfireEvent('change', handleNumber, true);\r\n\r\n\t\t\tif ( options.events.snap ) {\r\n\t\t\t\tstart(event, { handles: [scope_Handles[handleNumber]] });\r\n\t\t\t}\r\n\t\t}", "function click (card) {\n card.addEventListener(\"click\", function() {\n if(initialClick) {\n clock();\n initialClick = false;\n }\n\n const currentCard = this;\n const previousCard = openCards[0];\n\n //open cards and compare them\n if(openCards.length === 1) {\n\n card.classList.add(\"open\", \"show\", \"endclick\");\n openCards.push(this);\n // card comparison conditional\n comparison(currentCard, previousCard);\n increaseMove();\n } else {\n\n card.classList.add(\"open\", \"show\", \"endclick\");\n openCards.push(this);\n\n }\n });\n}", "handleTopCardClick() {\n return this.state.topDrawCard ? this.props.MoveDrawCards() : null;\n }", "function didDoubleTap() {\n //Enure we dont return 0 or null for false values\n return !!(validateDoubleTap() && hasDoubleTap());\n }", "function cardClickHandler(e) {\n console.log('card clicked')\n const cardIsNotAlreadyChosen = e.target.parentNode != cardOneElement;\n if (!gameWon && e.target.classList.contains('card-face') && cardIsNotAlreadyChosen) {\n checkStats(e.target.parentNode);\n flipUp(e.target.parentNode);\n }\n}", "onStart (evt) {\n if (this.target)\n return;\n\n if (!evt.target.classList.contains('card'))\n return;\n\n console.log('card moving');\n this.target = evt.target;\n this.targetBCR = this.target.getBoundingClientRect();\n\n this.startX = evt.pageX || evt.touches[0].pageX;\n this.currentX = this.startX;\n\n this.draggingCard = true;\n this.target.style.willChange = 'transform';\n\n evt.preventDefault();\n }", "handleClickEventOnCard(event) {\n if (!this.scoringHandler.isTimerStarted()) {\n this.scoringHandler.startTimer();\n }\n if (this.isNodeOfTypeLI(event) && this.isCardNotYetOpenOrMatched(event)) {\n this.openCard(event.target);\n }\n if (this.openCards.length === 2) {\n this.scoringHandler.increaseMovesByOne();\n if (this.openCardsDoMatch()) {\n this.markOpenCardsAsMatch();\n } else {\n this.coverOpenCards();\n }\n }\n }", "function handleCardClick (event) {\n\tif (\n\t\tevent.target !== firstCard &&\n\t\tevent.target !== secondCard &&\n\t\tevent.target.classList.contains('clicked') === false &&\n\t\tarrayOfClicked.length < 2\n\t) {\n\t\t// you can use event.target to see which element was clicked\n\t\tif (arrayOfClicked.length <= 1) {\n\t\t\tlet card = event.target;\n\n\t\t\tcard.classList.add('clicked');\n\t\t\tcard.style.backgroundColor = card.style.color;\n\t\t\tarrayOfClicked.push(card);\n\t\t\tfor (i = 0; i < arrayOfClicked.length; i++) {\n\t\t\t\tif (i === 0 && arrayOfClicked.length === 1) {\n\t\t\t\t\tfirstCard = arrayOfClicked[i];\n\t\t\t\t} else if (i === 1 && arrayOfClicked.length === 2) {\n\t\t\t\t\tsecondCard = arrayOfClicked[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (firstCard === secondCard) {\n\t\t\tarrayOfClicked.splice(arrayOfClicked.indexOf(secondCard), 1);\n\t\t} else if (arrayOfClicked.length === 2) {\n\t\t\tnumAttempts++;\n\t\t\tscore = document.querySelector('#score');\n\t\t\tscore.innerText = '' + numAttempts;\n\t\t\tsetTimeout(function () {\n\t\t\t\tif (firstCard.style.color !== secondCard.style.color) {\n\t\t\t\t\tfor (i = 0; i < arrayOfClicked.length; i++) {\n\t\t\t\t\t\tlet thisCard = arrayOfClicked[i];\n\t\t\t\t\t\tthisCard.style.backgroundColor = '';\n\t\t\t\t\t\tthisCard.classList.remove('clicked');\n\t\t\t\t\t}\n\t\t\t\t\tfirstCard = null;\n\t\t\t\t\tsecondCard = null;\n\t\t\t\t} else {\n\t\t\t\t\tnumMatched += 2;\n\t\t\t\t\tfirstCard.style.border = '2px solid lightgreen';\n\t\t\t\t\tsecondCard.style.border = '2px solid lightgreen';\n\t\t\t\t\tarrayOfMatched.push(firstCard);\n\t\t\t\t\tarrayOfMatched.push(secondCard);\n\t\t\t\t}\n\t\t\t\tarrayOfClicked = [];\n\t\t\t\tif (numMatched === numCards) {\n\t\t\t\t\tclearTimeout();\n\t\t\t\t\tscoreCounter.className = 'new-high-score';\n\t\t\t\t\tlet prevHighScore;\n\t\t\t\t\tlet newHighScore;\n\n\t\t\t\t\tif (numCards === 10 && localStorage.getItem('easyHighScore')) {\n\t\t\t\t\t\tif (numAttempts < localStorage.getItem('easyHighScore')) {\n\t\t\t\t\t\t\tnewHighScore = document.createElement('h2');\n\t\t\t\t\t\t\tnewHighScore.className = 'new-high-score';\n\t\t\t\t\t\t\tnewHighScore.innerText = 'NEW HIGH SCORE! ' + numAttempts;\n\t\t\t\t\t\t\tgameContainer.appendChild(newHighScore);\n\t\t\t\t\t\t\tlocalStorage.setItem('easyHighScore', numAttempts);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (numCards === 10) {\n\t\t\t\t\t\tnewHighScore = document.createElement('h2');\n\t\t\t\t\t\tnewHighScore.className = 'new-high-score';\n\t\t\t\t\t\tnewHighScore.innerText = 'NEW HIGH SCORE! ' + numAttempts;\n\t\t\t\t\t\tgameContainer.append(newHighScore);\n\t\t\t\t\t\tlocalStorage.setItem('easyHighScore', numAttempts);\n\t\t\t\t\t}\n\t\t\t\t\tif (numCards === 20 && localStorage.getItem('medHighScore')) {\n\t\t\t\t\t\tif (numAttempts < localStorage.getItem('medHighScore')) {\n\t\t\t\t\t\t\tnewHighScore = document.createElement('h2');\n\t\t\t\t\t\t\tnewHighScore.className = 'new-high-score';\n\t\t\t\t\t\t\tnewHighScore.innerText = 'NEW HIGH SCORE! ' + numAttempts;\n\t\t\t\t\t\t\tgameContainer.appendChild(newHighScore);\n\t\t\t\t\t\t\tlocalStorage.setItem('medHighScore', numAttempts);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (numCards === 20) {\n\t\t\t\t\t\tnewHighScore = document.createElement('h2');\n\t\t\t\t\t\tnewHighScore.className = 'new-high-score';\n\t\t\t\t\t\tnewHighScore.innerText = 'NEW HIGH SCORE! ' + numAttempts;\n\t\t\t\t\t\tgameContainer.append(newHighScore);\n\t\t\t\t\t\tlocalStorage.setItem('medHighScore', numAttempts);\n\t\t\t\t\t}\n\t\t\t\t\tif (numCards === 30 && localStorage.getItem('hardHighScore')) {\n\t\t\t\t\t\tif (numAttempts < localStorage.getItem('hardHighScore')) {\n\t\t\t\t\t\t\tnewHighScore = document.createElement('h2');\n\t\t\t\t\t\t\tnewHighScore.className = 'new-high-score';\n\t\t\t\t\t\t\tnewHighScore.innerText = 'NEW HIGH SCORE! ' + numAttempts;\n\t\t\t\t\t\t\tgameContainer.appendChild(newHighScore);\n\t\t\t\t\t\t\tlocalStorage.setItem('hardHighScore', numAttempts);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (numCards === 30) {\n\t\t\t\t\t\tnewHighScore = document.createElement('h2');\n\t\t\t\t\t\tnewHighScore.className = 'new-high-score';\n\t\t\t\t\t\tnewHighScore.innerText = 'NEW HIGH SCORE! ' + numAttempts;\n\t\t\t\t\t\tgameContainer.append(newHighScore);\n\t\t\t\t\t\tlocalStorage.setItem('hardHighScore', numAttempts);\n\t\t\t\t\t}\n\t\t\t\t\tdocument.querySelector('input[value=\"Reset Easy\"]').remove();\n\t\t\t\t\tdocument.querySelector('input[value=\"Reset Medium\"]').remove();\n\t\t\t\t\tdocument.querySelector('input[value=\"Reset Hard\"]').remove();\n\t\t\t\t\tresetEasyButton = document.createElement('input');\n\t\t\t\t\tresetEasyButton.type = 'button';\n\t\t\t\t\tresetEasyButton.value = 'Reset Easy';\n\t\t\t\t\tresetEasyButton.className = 'reset-button-class';\n\t\t\t\t\tresetEasyButton.id = 'reset-easy-button';\n\t\t\t\t\tresetMediumButton = document.createElement('input');\n\t\t\t\t\tresetMediumButton.type = 'button';\n\t\t\t\t\tresetMediumButton.value = 'Reset Medium';\n\t\t\t\t\tresetMediumButton.className = 'reset-button-class';\n\t\t\t\t\tresetMediumButton.id = 'reset-medium-button';\n\t\t\t\t\tresetHardButton = document.createElement('input');\n\t\t\t\t\tresetHardButton.type = 'button';\n\t\t\t\t\tresetHardButton.value = 'Reset Hard';\n\t\t\t\t\tresetHardButton.className = 'reset-button-class';\n\t\t\t\t\tresetHardButton.id = 'reset-hard-button';\n\t\t\t\t\tgameContainer.append(resetEasyButton);\n\t\t\t\t\tgameContainer.append(resetMediumButton);\n\t\t\t\t\tgameContainer.append(resetHardButton);\n\t\t\t\t\tresetEasyButton.className = 'reset-button-end-class';\n\t\t\t\t\tresetMediumButton.className = 'reset-button-end-class';\n\t\t\t\t\tresetHardButton.className = 'reset-button-end-class';\n\t\t\t\t}\n\t\t\t}, 1000);\n\t\t}\n\t}\n}", "function tap ( event ) {\n\n\t\tvar location = event.calcPoint, total = 0, handleNumber, to;\n\n\t\t// The tap event shouldn't propagate up and cause 'edge' to run.\n\t\tevent.stopPropagation();\n\n\t\t// Add up the handle offsets.\n\t\tscope_Handles.forEach(function(a){\n\t\t\ttotal += offset(a)[ options.style ];\n\t\t});\n\n\t\t// Find the handle closest to the tapped position.\n\t\thandleNumber = ( location < total/2 || scope_Handles.length === 1 ) ? 0 : 1;\n\n\t\t// Check if handler is not disablet if yes set number to the next handler\n\t\tif (scope_Handles[handleNumber].hasAttribute('disabled')) {\n\t\t\thandleNumber = handleNumber ? 0 : 1;\n\t\t}\n\n\t\tlocation -= offset(scope_Base)[ options.style ];\n\n\t\t// Calculate the new position.\n\t\tto = ( location * 100 ) / baseSize();\n\n\t\tif ( !options.events.snap ) {\n\t\t\t// Flag the slider as it is now in a transitional state.\n\t\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\t\taddClassFor( scope_Target, options.cssClasses.tap, options.animationDuration );\n\t\t}\n\n\t\t// Support 'disabled' handles\n\t\tif ( scope_Handles[handleNumber].hasAttribute('disabled') ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Find the closest handle and calculate the tapped point.\n\t\t// The set handle to the new position.\n\t\tsetHandle( scope_Handles[handleNumber], to );\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\tstart(event, { handles: [scope_Handles[handleNumber]] });\n\t\t}\n\t}", "function tap ( event ) {\n\n\t\tvar location = event.calcPoint, total = 0, handleNumber, to;\n\n\t\t// The tap event shouldn't propagate up and cause 'edge' to run.\n\t\tevent.stopPropagation();\n\n\t\t// Add up the handle offsets.\n\t\tscope_Handles.forEach(function(a){\n\t\t\ttotal += offset(a)[ options.style ];\n\t\t});\n\n\t\t// Find the handle closest to the tapped position.\n\t\thandleNumber = ( location < total/2 || scope_Handles.length === 1 ) ? 0 : 1;\n\n\t\t// Check if handler is not disablet if yes set number to the next handler\n\t\tif (scope_Handles[handleNumber].hasAttribute('disabled')) {\n\t\t\thandleNumber = handleNumber ? 0 : 1;\n\t\t}\n\n\t\tlocation -= offset(scope_Base)[ options.style ];\n\n\t\t// Calculate the new position.\n\t\tto = ( location * 100 ) / baseSize();\n\n\t\tif ( !options.events.snap ) {\n\t\t\t// Flag the slider as it is now in a transitional state.\n\t\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\n\t\t\taddClassFor( scope_Target, options.cssClasses.tap, options.animationDuration );\n\t\t}\n\n\t\t// Support 'disabled' handles\n\t\tif ( scope_Handles[handleNumber].hasAttribute('disabled') ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Find the closest handle and calculate the tapped point.\n\t\t// The set handle to the new position.\n\t\tsetHandle( scope_Handles[handleNumber], to );\n\n\t\tfireEvent('slide', handleNumber, true);\n\t\tfireEvent('set', handleNumber, true);\n\t\tfireEvent('change', handleNumber, true);\n\n\t\tif ( options.events.snap ) {\n\t\t\tstart(event, { handles: [scope_Handles[handleNumber]] });\n\t\t}\n\t}", "function didDoubleTap() {\n\t\t //Enure we dont return 0 or null for false values\n\t\t\treturn !!(validateDoubleTap() && hasDoubleTap());\n\t\t}", "function didDoubleTap() {\n\t\t //Enure we dont return 0 or null for false values\n\t\t\treturn !!(validateDoubleTap() && hasDoubleTap());\n\t\t}", "function didDoubleTap() {\n\t\t //Enure we dont return 0 or null for false values\n\t\t\treturn !!(validateDoubleTap() && hasDoubleTap());\n\t\t}", "handleTwoCardsClickedEvent() {\n if (this.clicks == 2) {\n const cards = document.querySelectorAll('.card-image');\n // convert cards from nodelist to array\n const cardsArray = Array.from(cards);\n\n const clickedCards = cardsArray.filter(this.checkForClickClass);\n\n const [card1, card2] = clickedCards;\n this.cardsMatchHandler(card1, card2);\n\n this.resetClicks();\n }\n }", "didSnakeHitAWall() {\n const rowAxis = document.querySelectorAll('.row');\n const cellAxis = rowAxis[0].children;\n\n const snakeHeadLocation = this.snake.segments[this.snake.segments.length - 1];\n if (snakeHeadLocation.x > cellAxis.length - 1\n || snakeHeadLocation.x < 0\n || snakeHeadLocation.y < 0\n || snakeHeadLocation.y > rowAxis.length - 1) {\n this.gameOver();\n }\n }", "function didDoubleTap() {\n //Enure we dont return 0 or null for false values\n return !!(validateDoubleTap() && hasDoubleTap());\n }", "function tap ( event ) {\n\t\n\t\t\tvar location = event.calcPoint, total = 0, handleNumber, to;\n\t\n\t\t\t// The tap event shouldn't propagate up and cause 'edge' to run.\n\t\t\tevent.stopPropagation();\n\t\n\t\t\t// Add up the handle offsets.\n\t\t\tscope_Handles.forEach(function(a){\n\t\t\t\ttotal += offset(a)[ options.style ];\n\t\t\t});\n\t\n\t\t\t// Find the handle closest to the tapped position.\n\t\t\thandleNumber = ( location < total/2 || scope_Handles.length === 1 ) ? 0 : 1;\n\t\t\t\n\t\t\t// Check if handler is not disablet if yes set number to the next handler\n\t\t\tif (scope_Handles[handleNumber].hasAttribute('disabled')) {\n\t\t\t\thandleNumber = handleNumber ? 0 : 1;\n\t\t\t}\n\t\n\t\t\tlocation -= offset(scope_Base)[ options.style ];\n\t\n\t\t\t// Calculate the new position.\n\t\t\tto = ( location * 100 ) / baseSize();\n\t\n\t\t\tif ( !options.events.snap ) {\n\t\t\t\t// Flag the slider as it is now in a transitional state.\n\t\t\t\t// Transition takes 300 ms, so re-enable the slider afterwards.\n\t\t\t\taddClassFor( scope_Target, cssClasses[14], 300 );\n\t\t\t}\n\t\n\t\t\t// Support 'disabled' handles\n\t\t\tif ( scope_Handles[handleNumber].hasAttribute('disabled') ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\n\t\t\t// Find the closest handle and calculate the tapped point.\n\t\t\t// The set handle to the new position.\n\t\t\tsetHandle( scope_Handles[handleNumber], to );\n\t\n\t\t\tfireEvent('slide', handleNumber, true);\n\t\t\tfireEvent('set', handleNumber, true);\n\t\t\tfireEvent('change', handleNumber, true);\n\t\n\t\t\tif ( options.events.snap ) {\n\t\t\t\tstart(event, { handles: [scope_Handles[handleNumber]] });\n\t\t\t}\n\t\t}", "function untapCards(previousCard, currentCard) {\n turnedCards.pop();\n $(previousCard.dom).toggleClass(\"not-match shake-card\");\n $(currentCard.dom).toggleClass(\"not-match shake-card\");\n\n setTimeout(function () {\n $(previousCard.dom).toggleClass(\"open not-match shake-card\");\n $(currentCard.dom).toggleClass(\"open not-match shake-card\");\n }, 500);\n}", "function tap ( event ) {\r\n\r\n\t\tvar location = event.calcPoint, total = 0, handleNumber, to;\r\n\r\n\t\t// The tap event shouldn't propagate up and cause 'edge' to run.\r\n\t\tevent.stopPropagation();\r\n\r\n\t\t// Add up the handle offsets.\r\n\t\tscope_Handles.forEach(function(a){\r\n\t\t\ttotal += offset(a)[ options.style ];\r\n\t\t});\r\n\r\n\t\t// Find the handle closest to the tapped position.\r\n\t\thandleNumber = ( location < total/2 || scope_Handles.length === 1 ) ? 0 : 1;\r\n\r\n\t\t// Check if handler is not disablet if yes set number to the next handler\r\n\t\tif (scope_Handles[handleNumber].hasAttribute('disabled')) {\r\n\t\t\thandleNumber = handleNumber ? 0 : 1;\r\n\t\t}\r\n\r\n\t\tlocation -= offset(scope_Base)[ options.style ];\r\n\r\n\t\t// Calculate the new position.\r\n\t\tto = ( location * 100 ) / baseSize();\r\n\r\n\t\tif ( !options.events.snap ) {\r\n\t\t\t// Flag the slider as it is now in a transitional state.\r\n\t\t\t// Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.\r\n\t\t\taddClassFor( scope_Target, options.cssClasses.tap, options.animationDuration );\r\n\t\t}\r\n\r\n\t\t// Support 'disabled' handles\r\n\t\tif ( scope_Handles[handleNumber].hasAttribute('disabled') ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Find the closest handle and calculate the tapped point.\r\n\t\t// The set handle to the new position.\r\n\t\tsetHandle( scope_Handles[handleNumber], to );\r\n\r\n\t\tfireEvent('slide', handleNumber, true);\r\n\t\tfireEvent('set', handleNumber, true);\r\n\t\tfireEvent('change', handleNumber, true);\r\n\r\n\t\tif ( options.events.snap ) {\r\n\t\t\tstart(event, { handles: [scope_Handles[handleNumber]] });\r\n\t\t}\r\n\t}", "function cardClicked(e) {\n\n const clickedCard = e.target;\n if (clickedCard.classList.contains('card') && !clickedCard.classList.contains('show')) {\n clickedCard.classList.add('show');\n addToOpenCards(clickedCard);\n }\n }", "function isDoubleTap(lastTap, thisTap) {\n var dx = abs(thisTap.screenX - lastTap.screenX);\n var dy = abs(thisTap.screenY - lastTap.screenY);\n var dt = thisTap.timeStamp - lastTap.timeStamp;\n return (dx < GD.DOUBLE_TAP_DISTANCE &&\n dy < GD.DOUBLE_TAP_DISTANCE &&\n dt < GD.DOUBLE_TAP_TIME);\n }", "function clickedCard() {\n if (event.target.classList.contains('card')) {\n event.target.classList.add('open', 'show', 'temp');\n tempArray.push(event.target);\n if (tempArray.length == 2) {\n if (tempArray[0] != tempArray[1]) {\n move++;\n moves.innerHTML = move;\n checkMatch();\n if (move === 15) {\n stars.children[2].classList.add('hide');\n starsArray.pop();\n } else if (move === 19) {\n stars.children[1].classList.add('hide');\n starsArray.pop();\n }\n } else {\n tempArray.splice(1);\n }\n }\n }\n}", "function onTouch() {\n var card\n\n if (i % 13 === 0) {\n acesClicked[i] = true\n if (acesClicked.filter(function (ace) {\n return ace\n }).length === 4) {\n document.body.removeChild($topbar)\n deck.$el.style.display = 'none'\n setTimeout(function () {\n startWinning()\n }, 250)\n }\n } else if (i % 13 === 12) {\n if (!kingsClicked) {\n return\n }\n kingsClicked[i] = true\n if (kingsClicked.filter(function (king) {\n return king\n }).length === 4) {\n for (var j = 0; j < 3; j++) {\n card = Deck.Card(52 + j)\n card.mount(deck.$el)\n card.$el.style[transform] = 'scale(0)'\n card.enableMoving()\n deck.cards.push(card)\n }\n deck.sort(true)\n kingsClicked = false\n }\n } else {\n acesClicked = []\n if (kingsClicked) {\n kingsClicked = []\n }\n }\n }", "function validateTap() {\n\t\t return ((fingerCount === 1 || !SUPPORTS_TOUCH) && (isNaN(distance) || distance < options.threshold));\n\t\t}", "function validateTap() {\n\t\t return ((fingerCount === 1 || !SUPPORTS_TOUCH) && (isNaN(distance) || distance < options.threshold));\n\t\t}", "function validateTap() {\n\t\t return ((fingerCount === 1 || !SUPPORTS_TOUCH) && (isNaN(distance) || distance < options.threshold));\n\t\t}", "function validateTap() {\n return ((fingerCount === 1 || !SUPPORTS_TOUCH) && (isNaN(distance) || distance === 0));\n }", "function cardClick() {\n\tif (clickedCards.length === 2 || matchedCards.includes(this.id)) {\n\t\treturn;\n\t}\n\tif(clickedCards.length === 0 || this.id != clickedCards[0].id){\n\n\t\tif(timeTrigger){\n\t\t\ttimerStart();\n\t\t\ttimeTrigger = false;\n\t\t}\n\t\tthis.classList.add('show', 'open');\n\t\tclickedCards.push(event.target);\n\t\tdetermineAction();\n\t}\n\telse {\n\t\treturn;\n\t}\n\tsetRating(moves);\n}", "onTouchUp(e) {\n let vUp = new Vector(e.pageX, e.pageY).subtract(this.offset).divide(this.resMult);\n this.lastTap = vUp;\n this.justTapped = true;\n this.activeTracking = false;\n }", "function click(card) {\n //click a card\n card.addEventListener(\"click\", function() {\n //run the timer and set the isFirstClick to false to not refer to this statement again\n if (isFirstClick) {\n beginTime();\n isFirstClick = false;\n }\n //add cards to an open card array to prepare to compare them\n if(openCards.length === 1){\n //if one card has aready been clicked then ->\n const firstCard = openCards[0];\n const secondCard = this;\n //open the card up, show the icon and disable is being clicked again using the freeze class\n card.classList.add(\"open\", \"show\", \"freeze\");\n openCards.push(this);\n compareCards(firstCard, secondCard);\n\n } else if (openCards.length >= 2){\n //Do Nothing\n } else {\n //if this is the first card to be clicked then ->\n card.classList.add(\"open\", \"show\", \"freeze\");\n openCards.push(this);\n }\n });\n }", "function clickCard(event) {\n\n\tif (interval === null) {\n\t\tsetTime();\n\t}\n\n\t//Check there's not more than 2 cards clicked\n\tif (counter < 2) {\n\t\tvar element = event.target;\n\n\t\t//Show the card\n\t\telement.style.backgroundImage = cards[ids.indexOf(element.id)];\n\n\t\t//Check it's not the same card clicked twice\n\t\tif (previousCard !== element.id) {\n\t\t\t//Count a click\n\t\t\tcounter++;\n\n\t\t\t//Check if it's the 2nd card\n\t\t\tif (previousCard !== null) {\n\t\t\t\tcurrentCard = element.id;\n\n\t\t\t\t//Restart images\n\t\t\t\tvar currentPicture = document.getElementById(currentCard).style.backgroundImage;\n\t\t\t\tvar previousPicture = document.getElementById(previousCard).style.backgroundImage;\n\n\t\t\t\t//Check if both images are the same\n\t\t\t\tif (currentPicture === previousPicture) {\n\t\t\t\t\t//Initialices a temporizer to execute correct action\n\t\t\t\t\tsetTimeout(removeCards, 1000);\n\t\t\t\t\n\n\t\t\t\t//If they're different \n\t\t\t\t} else {\n\t\t\t\t\t//Substract the score\n\t\t\t\t\tscore += -5;\n\t\t\t\t\tshowScore();\n\t\t\t\t\t//Initialices a temporizer to execute wrong action\n\t\t\t\t\tsetTimeout(hideCards, 1000);\n\t\t\t\t}\n\t\t\t\n\t\t\t} else {\n\t\t\t\t//If it's the first, store the card for the next click\n\t\t\t\tpreviousCard = element.id;\n\t\t\t}\n\t\t}\n\t}\n}", "function clicktarget(evt){\n setopen(evt); //sets card to open state\n addcardtoList(evt);// adds card to list to be check for match\n removeclickevent(evt);// removes the click listener\n\n if (cardlist.length ==2){ //if 2 cards exists it will compare via Checkmatch()\n\n setTimeout(checkmatch,200); //delay so users can see the 2nd card clicked\n\n }\n else {\n\n }\n }", "function validateTap() {\n return ((fingerCount === 1 || !SUPPORTS_TOUCH) && (isNaN(distance) || distance < options.threshold));\n }", "function onTouchStart(e) {\n firstTouch = e.nativeEvent.pageX;\n }", "function doubleTap(element) {\r\n interact(element)\r\n .on('doubletap', function(event) {\r\n if (event.target.className === 'furnitureIcon') {\r\n rotateFurniture(event.target);\r\n }\r\n\r\n })\r\n }", "function mouseClick(event) {\n const id = event.target.id;\n\n // Check if click was made on the background\n if (id === \"background\")\n return;\n\n // Update selector if it wasn't over the clicked card \n // (mixed controls behaviour bug)\n if (mouseOver !== selectorOver)\n updateSelector(mouseOver);\n\n pickCard();\n}", "function handleCardClick(event) {\n\t// you can use event.target to see which element was clicked\n\n\t// prevent selecting additional cards during no match delay\n\tif (selection1 !== 0 && selection2 !== 0) return;\n\n\t// console.log('you just clicked', event.target);\n\tconst cardClass = event.target.className;\n\n\tif (event.target.className === 'matched') {\n\t\tconsole.log('Cannot reselect this card!');\n\t\treturn;\n\t}\n\n\tattempts++;\n\tdisplayAttempts();\n\n\tevent.target.style.backgroundColor = `${colorMapObject[cardClass]}`;\n\n\tif (selection1 === 0) {\n\t\tselection1 = cardClass;\n\t\telement1 = event.target;\n\t} else if (selection2 === 0) {\n\t\tif (event.target === element1) return;\n\t\tselection2 = cardClass;\n\t\telement2 = event.target;\n\n\t\tif (selection1 === selection2) {\n\t\t\tmatch = true;\n\t\t\tselection1 = 0;\n\t\t\tselection2 = 0;\n\t\t\telement1.className = 'matched';\n\t\t\telement2.className = 'matched';\n\t\t\tmatches += 2;\n\t\t\tdisplayMatches();\n\t\t} else {\n\t\t\tmatch = false;\n\t\t\tlet noMatchTimeout = setTimeout(function() {\n\t\t\t\telement1.style.backgroundColor = defaultCardColor;\n\t\t\t\telement2.style.backgroundColor = defaultCardColor;\n\t\t\t\tselection1 = 0;\n\t\t\t\tselection2 = 0;\n\t\t\t}, noMatchDelay);\n\t\t}\n\t}\n}", "handleGoTop() {\n let offset = 300;\n let duration = 500;\n\n if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) { // ios supported\n $(window).bind('touchend touchcancel touchleave', event => {\n if ($(event.currentTarget).scrollTop() > offset) {\n $('.scroll-to-top').fadeIn(duration);\n } else {\n $('.scroll-to-top').fadeOut(duration);\n }\n });\n } else { // general\n $(window).scroll(event => {\n if ($(event.currentTarget).scrollTop() > offset) {\n $('.scroll-to-top').fadeIn(duration);\n } else {\n $('.scroll-to-top').fadeOut(duration);\n }\n });\n }\n\n $('.scroll-to-top').on('click', (e) => {\n e.preventDefault();\n $('html, body').animate({scrollTop: 0}, duration);\n return false;\n });\n }", "function apply_card_event_handlers(){\n $('.card').click(card_selected($(this)));\n }", "function handleRegionTap(d){\n if(currentlyTappedRegion===d)\n handleClickOrDoubleTap(d);\n else{\n currentlyTappedRegion=d;\n handleHoverOrSingleTouch(d);\n }\n }", "function cardClicked(event) {\n if (event.target.className === 'card' && clickedCards.length <2) {\n event.target.classList.add('open', 'show');\n addCardsToClickedCards(event);\n doCardsMatch(event);\n }\n}", "function handleCardClick(event) {\n if(isCardShown(event.target) || tempFaceUp.length >= CARDS_TO_MATCH){\n return;\n }\n\n tempFaceUp.push(event.target);\n showCard(event.target);\n\n\n\n if(tempFaceUp.length >= CARDS_TO_MATCH){\n\n if(hasFoundMatch()){\n tempFaceUp = [];\n\n if(gameIsWon()){\n endGame();\n }\n \n }\n else{\n score ++;\n document.querySelector(\"#score\").innerText = score;\n\n setTimeout(() => {\n shown = 0;\n tempFaceUp.forEach( card => {\n hideCard(card);\n });\n tempFaceUp = [];\n }, 1000);\n }\n }\n}", "function click(card) {\n // Create Click Event for card\n card.addEventListener(\"click\", function() {\n if(firstClick) {\n // Call Start the timer function\n startTimer();\n // Change the First Click value\n firstClick = false;\n }\n const secondCard = this;\n const firstCard = openedCards[0];\n // Opened card\n if(openedCards.length === 1) {\n card.classList.add(\"open\", \"show\", \"disable\");\n openedCards.push(this);\n // Call the Compare function\n compare(secondCard, firstCard);\n } else {\n secondCard.classList.add(\"open\", \"show\", \"disable\");\n openedCards.push(this);\n }\n });\n}", "cardsMatchHandler(card1, card2) {\n if (card1.alt == card2.alt) {\n this.executeMatchActions(card1, card2);\n } else {\n this.executeMismatchActions(card1, card2);\n }\n this.removeClickClasss(card1, card2);\n }", "function OnDoubleTap(pos:Vector2){\n\tvar ray:Ray = Camera.main.ScreenPointToRay(pos);\n\tvar hit:RaycastHit;\n\tif(Physics.Raycast(ray, hit, Mathf.Infinity)){\n\t\tif(hit.collider.transform==doubleTapObj){\n\t\t\t//place the indicator at the object position and assign a random color to it\n\t\t\tIndicator.transform.position=doubleTapObj.position;\n\t\t\tIndicator.startColor=GetRandomColor();\n\t\t\t//emit a set number of particle\n\t\t\tIndicator.Emit(30);\n\t\t}\n\t}\n}", "handle_mouse_click(mouse_ray) {\n if (this.disable_marker_tile || this.game_over) return;\n const width = 10, length = 10;\n // TODO: Collisions against the menu items should override any other collisions.\n let tiles = this.calculate_ray_tile_intersection(mouse_ray, width, length);\n if (!this.moving)\n this.clicked_tile = tiles;\n this.click_ray = mouse_ray;\n }", "tapEventOn(e) {\n let root = this;\n if (typeof root.hoverClass !== typeof undefined && !root.disabled) {\n // break class into array\n var classes = root.hoverClass.split(\" \");\n // run through each and add or remove classes\n classes.forEach(function(item, index) {\n if (item != \"\") {\n root.$.button.classList.add(item);\n if (item.indexOf(\"-\") != -1) {\n root.$.icon.classList.add(item);\n }\n }\n });\n }\n }", "[pointerDown](e) {\n if (isTouch(e)) {\n this.show();\n }\n }", "middleClickedOnPlayer(e) {\n\t\treturn e.which === 2 && e.path[0].dataset.aTarget === 'player-overlay-click-handler';\n\t}", "function click ( e ) {\r\n \r\n //If a user click the next card while the timer is set, the two clicked cards will be judged right away\r\n if ( timer ) {\r\n clearTimeout( timer );\r\n judge();\r\n }\r\n \r\n let elm = e.target;//The clicked card\r\n elm.innerHTML = cards[ elm.index ];//Turn up the clicked card\r\n \r\n if ( !firstCard ) {\r\n //If a user didn't select any card yet, the clicked card is the first card.\r\n firstCard = elm;\r\n \r\n } else if ( firstCard.index == elm.index ) {\r\n //If a user selected the same card two times, exit if() loop\r\n return;\r\n \r\n } else {\r\n //If a user selected the different two cards\r\n secondCard = elm;//The second card is the newly clicked card\r\n timer = setTimeout( judge, 1000 );//Judge the clicked cards a second later\r\n \r\n }\r\n}", "function OnPointerDown ( touchInfo : UnityEngine.EventSystems.PointerEventData )\n\t{\n\t\t// If we have a throwable joystick, then we want to stop the current moving\n\t\tif( throwable == true )\n\t\t\tStopCoroutine( \"ThrowableMovement\" );\n\t\t\t\n\t\t// If we are using the Touch Based Positioning we need to do a few things here\n\t\tif( touchBasedPositioning == true || touchPad == true )\n\t\t{\n\t\t\t// We need to move our joysticSizeFolder to the point of our touch\n\t\t\tjoystickSizeFolder.position = touchInfo.position - textureCenter;\n\n\t\t\t// Set our center to the touch position since it has changed\n\t\t\tjoystickCenter = touchInfo.position;\n\t\t}\n\n\t\t// Call UpdateJoystick with the info from our PointerEventData\n\t\tUpdateJoystick( touchInfo );\n\n\t\t// If we want to show animations on Touch, do that here\n\t\tif( useAnimation == true )\n\t\t\tjoystickAnimator.SetBool( \"Touch\", true );\n\n\t\t// If we are using our fade on touch do that here as well\n\t\tif( useFade == true )\n\t\t\tHandleFade( \"Touched\" );\n\t\t\t\n\t\t// Check if we are using any TapCountOption\n\t\tif( tapCountOption != TapCountOption.NoCount )\n\t\t{\n\t\t\t// If we are accumulating taps, then we need to do some things\n\t\t\tif( tapCountOption == TapCountOption.Accumulate )\n\t\t\t{\n\t\t\t\t// Here, if we aren't counting down, set tapCount to 1 since it's our first touch and start TapCounter\n\t\t\t\tif( countingDown == false )\n\t\t\t\t{\n\t\t\t\t\tcountingDown = true;\n\t\t\t\t\ttapCount = 1;\n\t\t\t\t\tTapCounter();\n\t\t\t\t}\n\t\t\t\t// If we are currently counting down then increase tapCount\n\t\t\t\telse\n\t\t\t\t\t++tapCount;\n\t\t\t}\n\t\t\t// Otherwise we just set down touches as 1\n\t\t\telse\n\t\t\t\tTapCounterDelay();\n\t\t}\n\t}", "handleTouchStart(event) {\n event.preventDefault();\n const { objectToReturn, onItemClick } = this.props;\n // returning the selected object\n onItemClick(objectToReturn);\n }", "function handleStart(e) {\n self.pressed = true;\n e.preventDefault();\n self.fx = e.changedTouches[0].screenX;\n self.fy = e.changedTouches[0].screenY - topTouchOffset;\n if (self.allowOnClick && self.onClick !== null) self.onClick.call(self);\n }", "function handleClick(){\n let target = $(this);\n //to confirm that previous flip is completed\n if(!gameState.clickTwo && !gameState.inProgess && !gameState.corrected.includes(target.attr('icon-name'))){\n //if it's the first card to be flipped\n if(!gameState.clickOne && target != gameState.clicked[0]){\n gameState.clicked.push(target);\n gameState.clickOne = target.attr('icon-name');\n tileAnimate(target, 'flip');\n }\n ////if it's the second card to be flipped\n else{\n if(!target.is(gameState.clicked[0])){\n gameState.clicked.push(target);\n gameState.clickTwo = target.attr('icon-name');\n //upon a successful flip(two cards are the same)\n if(gameState.clickOne == gameState.clickTwo){\n gameState.corrected.push(gameState.clickOne);\n gameState.moves++;\n updateMoves(gameState.moves);\n //callback functions implement a simple lock to ensure that before success animation of both cards completed, no further flip action could be performed.\n let cb = ()=>{\n let cb0 = ()=>{\n gameState.zFin = true;\n if(gameState.oFin == true){\n stepClear();\n gameState.inProgess = false;\n }\n //check whether all cards have been successfully found, if ture, call gameCleared() to prompt finish screen.\n if(gameState.corrected.length == gameState.size*gameState.size/2){\n gameCleared();\n }\n };\n let cb1 = ()=>{\n gameState.oFin = true;\n if(gameState.zFin == true){\n stepClear();\n gameState.inProgess = false;\n }\n if(gameState.corrected.length == gameState.size*gameState.size/2){\n gameCleared();\n }\n };\n tileAnimate(gameState.clicked[0],'right',cb0);\n tileAnimate(gameState.clicked[1],'right',cb1);\n };\n tileAnimate(target, 'flip', cb);\n }else{\n //if two flips are different, play the fail animation\n gameState.moves++;\n updateMoves(gameState.moves);\n let cb = ()=>{\n let cb0 = ()=>{\n gameState.zFin = true;\n if(gameState.oFin == true){\n stepClear();\n gameState.inProgess = false;\n }\n };\n let cb1 = ()=>{\n gameState.oFin = true;\n if(gameState.zFin == true){\n stepClear();\n gameState.inProgess = false;\n }\n };\n tileAnimate(gameState.clicked[0],'wrong',cb0);\n tileAnimate(gameState.clicked[1],'wrong',cb1);\n };\n //flip animation will always be called first, callback function depends on the result of flip\n tileAnimate(target, 'flip', cb);\n //update the score\n gameState.score -= Math.floor(gameState.deduction/gameState.size);\n gameState.deduction = gameState.deduction >= gameState.size ? 0 : gameState.deduction+1;\n updateScore(gameState.score);\n }\n }\n\n }\n }\n}", "function firstClick() {\n const clickArea = document.getElementById(\"card-click\");\n const card = document.getElementById(\"card1\");\n clickArea.addEventListener(\"click\", (e) => {\n card.classList.add(\"card1-hover\");\n });\n\n const attributes = document.querySelectorAll(\".atr-player-card\");\n attributes.forEach((value) => {\n value.addEventListener(\"click\", attributeSelection);\n });\n}" ]
[ "0.5840773", "0.5813912", "0.5795543", "0.5795543", "0.5795543", "0.55705005", "0.5511246", "0.5501126", "0.54984814", "0.54984814", "0.54984814", "0.54984814", "0.54984814", "0.54984814", "0.54984814", "0.54978764", "0.54978764", "0.54978764", "0.5485832", "0.5484199", "0.5440183", "0.5405413", "0.5393848", "0.5392768", "0.5390564", "0.5390564", "0.5390564", "0.53760165", "0.5335741", "0.5329659", "0.530006", "0.5287474", "0.52566624", "0.52566624", "0.52552134", "0.52266455", "0.5162116", "0.5155106", "0.51479095", "0.5133331", "0.51322734", "0.51077056", "0.5104857", "0.5093648", "0.5076735", "0.5066547", "0.5063879", "0.50604725", "0.50314736", "0.5029556", "0.5028926", "0.50270504", "0.50255233", "0.5023825", "0.5023825", "0.5021646", "0.5021646", "0.5021646", "0.5019994", "0.5017072", "0.5016491", "0.50077885", "0.4998908", "0.499879", "0.49944693", "0.4982431", "0.49791786", "0.49776888", "0.49592376", "0.49592376", "0.49592376", "0.49522388", "0.49469075", "0.49320003", "0.49149725", "0.48924798", "0.4892267", "0.4884926", "0.48800978", "0.48687142", "0.48660946", "0.4865887", "0.48643595", "0.48488903", "0.48394862", "0.4835139", "0.48347697", "0.48279", "0.48042184", "0.48029873", "0.48021707", "0.4799494", "0.47991455", "0.4796053", "0.4791136", "0.4785099", "0.4775822", "0.47692135", "0.4755903", "0.4752777" ]
0.6647205
0
Returns an array of known XRAnchor instances. May be empty.
get anchors(){ //readonly attribute sequence<XRAnchor> anchors; let results = [] for(let value of this._session.reality._anchors.values()){ results.push(value) } return results }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getDocumentAnchors()\n {\n let anchors = [];\n\n for (let i = 0; i < document.anchors.length; i++)\n {\n anchors[this.hashSeparator + document.anchors[i].name] = true;\n }\n\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR) ? [node] : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function (node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }", "function getAnchorNodes(node) {\n\t var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n\t var items = node.hasAttribute(NG_ANIMATE_REF_ATTR) ? [node] : node.querySelectorAll(SELECTOR);\n\t var anchors = [];\n\t forEach(items, function (node) {\n\t var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n\t if (attr && attr.length) {\n\t anchors.push(node);\n\t }\n\t });\n\t return anchors;\n\t }", "function getAnchorNodes(node) {\n\t var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n\t var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n\t ? [node]\n\t : node.querySelectorAll(SELECTOR);\n\t var anchors = [];\n\t forEach(items, function(node) {\n\t var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n\t if (attr && attr.length) {\n\t anchors.push(node);\n\t }\n\t });\n\t return anchors;\n\t }", "function getAnchorNodes(node) {\n\t var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n\t var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n\t ? [node]\n\t : node.querySelectorAll(SELECTOR);\n\t var anchors = [];\n\t forEach(items, function(node) {\n\t var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n\t if (attr && attr.length) {\n\t anchors.push(node);\n\t }\n\t });\n\t return anchors;\n\t }", "getLinkAnchors(mode) {\n const attrs = this.state.attributes;\n return [\n {\n element: this.object._id,\n points: [\n {\n x: attrs.x,\n y: attrs.y,\n xAttribute: \"x\",\n yAttribute: \"y\",\n direction: { x: mode == \"begin\" ? 1 : -1, y: 0 }\n }\n ]\n }\n ];\n }", "getLinkAnchors() {\n const attrs = this.state.attributes;\n const element = this.object._id;\n return [\n {\n element,\n points: [\n {\n x: attrs.x1,\n y: attrs.y1,\n xAttribute: \"x1\",\n yAttribute: \"y1\",\n direction: { x: -1, y: 0 }\n },\n {\n x: attrs.x1,\n y: attrs.y2,\n xAttribute: \"x1\",\n yAttribute: \"y2\",\n direction: { x: -1, y: 0 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x2,\n y: attrs.y1,\n xAttribute: \"x2\",\n yAttribute: \"y1\",\n direction: { x: 1, y: 0 }\n },\n {\n x: attrs.x2,\n y: attrs.y2,\n xAttribute: \"x2\",\n yAttribute: \"y2\",\n direction: { x: 1, y: 0 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x1,\n y: attrs.y1,\n xAttribute: \"x1\",\n yAttribute: \"y1\",\n direction: { x: 0, y: -1 }\n },\n {\n x: attrs.x2,\n y: attrs.y1,\n xAttribute: \"x2\",\n yAttribute: \"y1\",\n direction: { x: 0, y: -1 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x1,\n y: attrs.y2,\n xAttribute: \"x1\",\n yAttribute: \"y2\",\n direction: { x: 0, y: 1 }\n },\n {\n x: attrs.x2,\n y: attrs.y2,\n xAttribute: \"x2\",\n yAttribute: \"y2\",\n direction: { x: 0, y: 1 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.cx,\n y: attrs.y1,\n xAttribute: \"cx\",\n yAttribute: \"y1\",\n direction: { x: 0, y: -1 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.cx,\n y: attrs.y2,\n xAttribute: \"cx\",\n yAttribute: \"y2\",\n direction: { x: 0, y: 1 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x1,\n y: attrs.cy,\n xAttribute: \"x1\",\n yAttribute: \"cy\",\n direction: { x: -1, y: 0 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x2,\n y: attrs.cy,\n xAttribute: \"x2\",\n yAttribute: \"cy\",\n direction: { x: 1, y: 0 }\n }\n ]\n }\n ];\n }", "buildPointAnchors() {\r\n this.regionData.points.forEach((point, index) => {\r\n const anchor = this.createAnchor(this.paper, point.x, point.y);\r\n this.anchors.push(anchor);\r\n this.anchorsNode.add(anchor);\r\n this.subscribeAnchorToEvents(anchor, index);\r\n });\r\n }", "_findAnchor(normalizedScreenX, normalizedScreenY, display, testOptions=null){\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif(this._arKitWrapper !== null){\t\n\t\t\t\t// Perform a hit test using the ARKit integration\n\t\t\t\tthis._arKitWrapper.hitTest(normalizedScreenX, normalizedScreenY, testOptions || ARKitWrapper.HIT_TEST_TYPE_EXISTING_PLANES).then(hits => {\n\t\t\t\t\tif(hits.length === 0){\n\t\t\t\t\t\tresolve(null)\n\t\t\t\t\t\t// console.log('miss')\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst hit = this._pickARKitHit(hits)\n\n\t\t\t\t\t// if it's a plane\n\t\t\t\t\tif (hit.anchor_transform) {\n\t\t\t\t\t\thit.anchor_transform[13] += XRViewPose.SITTING_EYE_HEIGHT\n\t\t\t\t\t\thit.world_transform[13] += XRViewPose.SITTING_EYE_HEIGHT\n\n\t\t\t\t\t\t// Use the first hit to create an XRAnchorOffset, creating the XRAnchor as necessary\n\n\t\t\t\t\t\t// TODO use XRPlaneAnchor for anchors with extents; hopefully the plane will have been created, tho\n\t\t\t\t\t\tlet anchor = this._getAnchor(hit.uuid)\n\t\t\t\t\t\tif(anchor === null){\n\t\t\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\t\t\tcoordinateSystem._relativeMatrix = hit.anchor_transform\n\t\t\t\t\t\t\tanchor = new XRAnchor(coordinateSystem, hit.uuid)\n\t\t\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst offsetPosition = [\n\t\t\t\t\t\t\thit.world_transform[12] - hit.anchor_transform[12],\n\t\t\t\t\t\t\thit.world_transform[13] - hit.anchor_transform[13],\n\t\t\t\t\t\t\thit.world_transform[14] - hit.anchor_transform[14]\n\t\t\t\t\t\t]\n\t\t\t\t\t\tconst worldRotation = new Quaternion().setFromRotationMatrix(hit.world_transform)\n\t\t\t\t\t\tconst inverseAnchorRotation = new Quaternion().setFromRotationMatrix(hit.anchor_transform).inverse()\n\t\t\t\t\t\tconst offsetRotation = new Quaternion().multiplyQuaternions(worldRotation, inverseAnchorRotation)\n\t\t\t\t\t\tconst anchorOffset = new XRAnchorOffset(anchor.uid)\n\t\t\t\t\t\tanchorOffset.poseMatrix = MatrixMath.mat4_fromRotationTranslation(new Float32Array(16), offsetRotation.toArray(), offsetPosition)\n\t\t\t\t\t\tresolve(anchorOffset)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\t\tcoordinateSystem._relativeMatrix = hit.world_transform\n\t\t\t\t\t\tconst anchor = new XRAnchor(coordinateSystem, hit.uuid)\n\t\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\n\t\t\t\t\t\tconst anchorOffset = new XRAnchorOffset(anchor.uid)\n\t\t\t\t\t\tresolve(anchorOffset)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} else if(this._vrDisplay !== null){\n\t\t\t\t// Perform a hit test using the ARCore data\n\t\t\t\tlet hits = this._vrDisplay.hitTest(normalizedScreenX, normalizedScreenY)\n\t\t\t\tif(hits.length == 0){\n\t\t\t\t\tresolve(null)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\thits.sort((a, b) => a.distance - b.distance)\n\t\t\t\tlet anchor = this._getAnchor(hits[0].uuid)\n\t\t\t\tif(anchor === null){\n\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\tcoordinateSystem._relativeMatrix = hits[0].modelMatrix\n\t\t\t\t\tcoordinateSystem._relativeMatrix[13] += XRViewPose.SITTING_EYE_HEIGHT\n\t\t\t\t\tanchor = new XRAnchor(coordinateSystem)\n\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\t\t\t\t}\n\t\t\t\tresolve(new XRAnchorOffset(anchor.uid))\n\t\t\t} else {\n\t\t\t\tresolve(null) // No platform support for finding anchors\n\t\t\t}\n\t\t})\n\t}", "_findAnchor(normalizedScreenX, normalizedScreenY, display){\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif(this._arKitWrapper !== null){\t\n\t\t\t\t// Perform a hit test using the ARKit integration\n\t\t\t\tthis._arKitWrapper.hitTest(normalizedScreenX, normalizedScreenY, ARKitWrapper.HIT_TEST_TYPE_EXISTING_PLANES).then(hits => {\n\t\t\t\t\tif(hits.length === 0){\n\t\t\t\t\t\tresolve(null)\n\t\t\t\t\t\t// console.log('miss')\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst hit = this._pickARKitHit(hits)\n\t\t\t\t\thit.anchor_transform[13] += XRViewPose.SITTING_EYE_HEIGHT\n\t\t\t\t\thit.world_transform[13] += XRViewPose.SITTING_EYE_HEIGHT\n\n\t\t\t\t\t// Use the first hit to create an XRAnchorOffset, creating the XRAnchor as necessary\n\n\t\t\t\t\t// TODO use XRPlaneAnchor for anchors with extents\n\n\t\t\t\t\tlet anchor = this._getAnchor(hit.uuid)\n\t\t\t\t\tif(anchor === null){\n\t\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\t\tcoordinateSystem._relativeMatrix = hit.anchor_transform\n\t\t\t\t\t\tanchor = new XRAnchor(coordinateSystem, hit.uuid)\n\t\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\t\t\t\t\t}\n\n\t\t\t\t\tconst offsetPosition = [\n\t\t\t\t\t\thit.world_transform[12] - hit.anchor_transform[12],\n\t\t\t\t\t\thit.world_transform[13] - hit.anchor_transform[13],\n\t\t\t\t\t\thit.world_transform[14] - hit.anchor_transform[14]\n\t\t\t\t\t]\n\t\t\t\t\tconst worldRotation = new Quaternion().setFromRotationMatrix(hit.world_transform)\n\t\t\t\t\tconst inverseAnchorRotation = new Quaternion().setFromRotationMatrix(hit.anchor_transform).inverse()\n\t\t\t\t\tconst offsetRotation = new Quaternion().multiplyQuaternions(worldRotation, inverseAnchorRotation)\n\t\t\t\t\tconst anchorOffset = new XRAnchorOffset(anchor.uid)\n\t\t\t\t\tanchorOffset.poseMatrix = MatrixMath.mat4_fromRotationTranslation(new Float32Array(16), offsetRotation.toArray(), offsetPosition)\n\t\t\t\t\tresolve(anchorOffset)\n\t\t\t\t})\n\t\t\t} else if(this._vrDisplay !== null){\n\t\t\t\t// Perform a hit test using the ARCore data\n\t\t\t\tlet hits = this._vrDisplay.hitTest(normalizedScreenX, normalizedScreenY)\n\t\t\t\tif(hits.length == 0){\n\t\t\t\t\tresolve(null)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\thits.sort((a, b) => a.distance - b.distance)\n\t\t\t\tlet anchor = this._getAnchor(hits[0].uuid)\n\t\t\t\tif(anchor === null){\n\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\tcoordinateSystem._relativeMatrix = hits[0].modelMatrix\n\t\t\t\t\tcoordinateSystem._relativeMatrix[13] += XRViewPose.SITTING_EYE_HEIGHT\n\t\t\t\t\tanchor = new XRAnchor(coordinateSystem)\n\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\t\t\t\t}\n\t\t\t\tresolve(new XRAnchorOffset(anchor.uid))\n\t\t\t} else {\n\t\t\t\tresolve(null) // No platform support for finding anchors\n\t\t\t}\n\t\t})\n\t}", "buildAnchors() {\r\n this.buildPointAnchors();\r\n }", "function getAnchors(p1x, p1y, p2x, p2y, p3x, p3y) {\n var l1 = (p2x - p1x) / 2,\n l2 = (p3x - p2x) / 2,\n a = Math.atan((p2x - p1x) / Math.abs(p2y - p1y)),\n b = Math.atan((p3x - p2x) / Math.abs(p2y - p3y));\n\n a = p1y < p2y ? Math.PI - a : a;\n b = p3y < p2y ? Math.PI - b : b;\n\n var alpha = Math.PI / 2 - ((a + b) % (Math.PI * 2)) / 2,\n dx1 = l1 * Math.sin(alpha + a),\n dy1 = l1 * Math.cos(alpha + a),\n dx2 = l2 * Math.sin(alpha + b),\n dy2 = l2 * Math.cos(alpha + b);\n\n return {\n x1:p2x - dx1,\n y1:p2y + dy1,\n x2:p2x + dx2,\n y2:p2y + dy2\n };\n }", "getHandles() {\n return [];\n // let attrs = this.state.attributes as AnchorElementAttributes;\n // let { x, y } = attrs;\n // return [\n // <Handles.Point>{\n // type: \"point\",\n // x: x, y: y,\n // actions: []\n // }\n // ]\n }", "function initAnchors() {\n\tnew SmoothScroll({\n\t\tanchorLinks: 'a[href^=\"#\"]:not([href=\"#\"])'\n\t});\n\tnew SmoothScroll({\n\t\tanchorLinks: 'a[href^=\"#\"]:not([href=\"#\"])',\n\t\textraOffset: 30,\n\t\tactiveClasses: 'link'\n\t});\n\tnew SmoothScroll({\n\t\tanchorLinks: 'a[href^=\"#\"]:not([href=\"#\"])',\n\t\teasing: 'linear'\n\t});\n}", "function getLinks() {\n\tvar links = [];\n\tvar linksResult = document.evaluate('(//td[@class=\"ebcTtl\"]|//div[@class=\"ttl\"])//a', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n\tfor (var i = 0; i < linksResult.snapshotLength; i += 1) {\n\t\tvar link = linksResult.snapshotItem(i);\n\t\tlinks.push(link.href);\n\t}\n\treturn links;\n}", "getLinksList() {\n const links = [];\n\n this.getLinkLinks(this, links, 0);\n\n return links;\n }", "getAnchor() {\n this._assertInitialized();\n return this.marker;\n }", "getAnchor(uid){\n\t\t// XRAnchor? getAnchor(DOMString uid);\n\t\treturn this._session.reality._getAnchor(uid)\n\t}", "function gatherHrefs() {\n return new Promise((resolve, reject) => {\n document.querySelectorAll('a').length ? resolve(document.querySelectorAll('a')) : reject('Can\\'t find a single <a> node');\n });\n }", "getAnchor(name) {\n const anchor = this.anchors.filter(function(anchor) {\n return anchor.name === name\n })\n if (anchor.length === 0) {\n return null\n } else {\n return anchor[0]\n }\n }", "function getSelectionAnchor() {\r\n\treturn [selectionAnchorLine, selectionAnchorColumn];\r\n}", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n\t var result = null;\n\t Array.prototype.some.call(list, function(element) {\n\t if (nodeName_(element) === 'a') {\n\t result = element;\n\t return true;\n\t }\n\t });\n\t return result;\n\t }", "function getFirstAnchor(list) {\n\t var result = null;\n\t Array.prototype.some.call(list, function(element) {\n\t if (nodeName_(element) === 'a') {\n\t result = element;\n\t return true;\n\t }\n\t });\n\t return result;\n\t }", "function getAllLinks() {\n\t\treturn [].splice.call(document.querySelectorAll('a[href]'), 0);\n\t}", "function anchors($) {\n const urls = []\n //regex for ftp,http,https,javascript,#,mailto, file extensions (this will pass on file extensions with query params)\n const pattern = new RegExp('(((f|ht){1}tp[s]?:\\/\\/|javascript|#|mailto)[-a-zA-Z0-9@:%_\\+.~#?&//=;]+)|#|\\.(gif|jpg|jpeg|tiff|png|pdf)$','i')\n $('a').map(function() {\n var href = $(this).attr('href');\n //only unique\n if(urls.indexOf(href) === -1){\n //only relative urls\n if (href && !pattern.test(href)){\n urls.push(href);\n }\n }\n })\n return urls\n}", "function getAnchorChildren() {\n let anchors = document.getElementsByTagName('a');\n \n let retStr = \"\";\n\n for (let i = 0; i < anchors.length; i++)\n {\n let spans = anchors[i].getElementsByTagName('span');\n \n for (let j = 0; j < spans.length; j++)\n retStr += spans[j].innerHTML + '\\n';\n }\n\n console.log(retStr);\n return;\n}", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function (element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "getAdjacents() {\n return Array.from(this.adjacents);\n }", "function getFirstAnchor(list) {\n\t\t\t\tvar result = null;\n\t\t\t\tArray.prototype.some.call(list, function(element) {\n\t\t\t\t\tif (nodeName_(element) === 'a') {\n\t\t\t\t\t\tresult = element;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn result;\n\t\t\t}", "function initAnchors() {\n\n\t\t\"use strict\"; \n\n\t\tnew SmoothScroll({\n\t\t\tanchorLinks: 'a.smooth[href^=\"#\"]:not([href=\"#\"])',\n\t\t\textraOffset: 0,\n\t\t\twheelBehavior: 'none'\n\t\t});\n\n\t\tnew SmoothScroll({\n\t\t\tanchorLinks: '.anchorNavigationList a[href^=\"#\"]:not([href=\"#\"])',\n\t\t\textraOffset: function() {\n\t\t\t\tvar totalHeight = 0;\n\t\t\t\tjQuery('.anchorNav').each(function() {\n\t\t\t\t\tvar $box = jQuery(this);\n\t\t\t\t\tvar stickyInstance = $box.data('StickyScrollBlock');\n\t\t\t\t\tif (stickyInstance) {\n\t\t\t\t\t\tstickyInstance.stickyFlag = false;\n\t\t\t\t\t\tstickyInstance.stickyOn();\n\t\t\t\t\t\ttotalHeight += $box.outerHeight();\n\t\t\t\t\t\tstickyInstance.onResize();\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttotalHeight += $box.css('position') === 'fixed' ? $box.outerHeight() : 0;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn totalHeight += 25;\n\t\t\t},\n\t\t\tactiveClasses: 'parent',\n\t\t\tanchorActiveClass: 'active',\n\t\t\twheelBehavior: 'none'\n\t\t});\n\t}", "function getLinks() {\r\n\t\tvar doc_links = document.links;\r\n\t\tvar links = new Array();\r\n\t\tfor (var i=0; i < doc_links.length; i++){\r\n\t\t\tlinks.push(doc_links[i]);\r\n\t\t\t}\r\n\t\treturn links;\r\n\t\t}", "function getFirstAnchor(list) { // 4726\n var result = null; // 4727\n Array.prototype.some.call(list, function(element) { // 4728\n if (nodeName_(element) === 'a') { // 4729\n result = element; // 4730\n return true; // 4731\n } // 4732\n }); // 4733\n return result; // 4734\n } // 4735", "function get_line_nodes(anchor, wrapper) {\n var rtn = [];\n var tmp;\n tmp = anchor.previousSibling;\n //...\n return rtn;\n }", "function getFirstAnchor(list){var result=null;Array.prototype.some.call(list,function(element){if(nodeName_(element)==='a'){result=element;return true;}});return result;}", "function getFirstAnchor(list){var result=null;Array.prototype.some.call(list,function(element){if(nodeName_(element)==='a'){result=element;return true;}});return result;}", "function initAnchors() {\r\n\tnew SmoothScroll({\r\n\t\tanchorLinks: 'a.anchor-link',\r\n\t\textraOffset: 0,\r\n\t\twheelBehavior: 'none'\r\n\t});\r\n}", "function optimizeAnchors(positions) {\n return positions.map((position, index) => {\n const others = [...positions.slice(0, index), ...positions.slice(index + 1)];\n const othersBearing = getBearingFromOtherPoints(position, others);\n return {\n lngLat: position.lngLat,\n anchor: getAnchor(position.axis, othersBearing),\n };\n });\n}", "function addLinks() {\n res = [[], []];\n for(var l = 0; l < document.links.length; l++) {\n var li = document.links[l];\n if (isVisible(li) && elementInViewport(li)) {\n res[0].push(li);\n }\n }\n return res;\n}", "function initAnchors() {\n\tnew SmoothScroll({\n\t\tanchorLinks: 'a[href^=\"#\"]:not([href=\"#\"])',\n\t\textraOffset: 0,\n\t\twheelBehavior: 'none'\n\t});\n}", "function getAnchorChildren() {\n var x = document.getElementsByTagName('a');\n //console.log(x);\n for(var i = 0; i < x.length; i++) {\n var y = x[i].firstElementChild;\n for (var j = 0; j < x[i].childElementCount; j++) {\n if (y.tagName === 'SPAN') {\n console.log(y.innerHTML);\n }\n }\n }\n}", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && nodeName_(element) === 'a') result = element;\n });\n return result;\n }", "getResidents() {\n return Array.from(this.children);\n }", "function initAnchors() {\n\tnew SmoothScroll({\n\t\tanchorLinks: 'a.smooth[href^=\"#\"]:not([href=\"#\"])',\n\t\textraOffset: 68,\n\t\tactiveClasses: 'parent'\n\t});\n}", "getLinks() {\n return [];\n }", "buildAllAnchor() {\n let x = self.baseImage.getX(), y = self.baseImage.getY();\n let width = self.baseImage.getWidth(), height = self.baseImage.getHeight();\n let coor = [x,y, x+width,y, x,y+height, x+width,y+height];\n for (let i=0; i<coor.length; i+=2){\n self.buildAnchor(coor[i], coor[i+1], i/2);\n }\n self.group.setDraggable(true);\n self.group.add(self.anchorGroup);\n self.layer.draw()\n\n }", "detectAnchor(): void\n\t{\n\t\t[...document.querySelectorAll('a')].map(node => {\n\t\t\tlet href = Dom.attr(node, 'href');\n\t\t\tif (href)\n\t\t\t{\n\t\t\t\thref = href.toString();\n\t\t\t}\n\t\t\tif (href && href.indexOf(':'))\n\t\t\t{\n\t\t\t\tconst hrefPref = href.split(':')[0];\n\t\t\t\tif (['callto', 'tel', 'mailto'].includes(hrefPref))\n\t\t\t\t{\n\t\t\t\t\tEvent.bind(node, 'click', () => {\n\t\t\t\t\t\tthis.sendLabel('', 'addressClick', hrefPref);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "_getAvailableXrefTargets(xref) {\n const refType = xref.refType;\n let manager;\n switch (refType) {\n case BlockFormula.refType: {\n manager = this._formulaManager;\n break;\n }\n case 'fig': {\n manager = this._figureManager;\n break;\n }\n case 'fn': {\n // EXPERIMENTAL: table footnotes\n // TableFootnoteManager is stored on the TableFigure instance\n const tableFigure = findParentByType(xref, 'table-figure');\n if (tableFigure) {\n manager = tableFigure.getFootnoteManager();\n } else {\n manager = this._footnoteManager;\n }\n break;\n }\n case 'table-fn': {\n const tableFigure = findParentByType(xref, 'table-figure');\n if (tableFigure) {\n manager = tableFigure.getFootnoteManager();\n }\n break;\n }\n case 'bibr': {\n manager = this._referenceManager;\n break;\n }\n case 'table': {\n manager = this._tableManager;\n break;\n }\n case 'file': {\n manager = this._supplementaryManager;\n break;\n }\n default:\n throw new Error('Unsupported xref type: ' + refType);\n }\n if (!manager) return [];\n\n const selectedTargets = xref.resolve('refTargets');\n // retrieve all possible nodes that this\n // xref could potentially point to,\n // so that we can let the user select from a list.\n const availableTargets = manager.getSortedCitables();\n let targets = availableTargets.map(target => {\n // ATTENTION: targets are not just nodes\n // but entries with some information\n return {\n selected: includes(selectedTargets, target),\n node: target,\n id: target.id,\n };\n });\n // Determine broken targets (such that don't exist in the document)\n const brokenTargets = without(selectedTargets, ...availableTargets);\n if (brokenTargets.length > 0) {\n targets = targets.concat(\n brokenTargets.map(id => {\n return { selected: true, id };\n }),\n );\n }\n // Makes the selected targets go to top\n targets = orderBy(targets, ['selected'], ['desc']);\n return targets;\n }", "function initaliseAnchors(container) {\r\n for (var i=0; i<Diagram.NUM_ANCHORS; i++) {\r\n var anchor = DOM.createElement(\"DIV\", \"anchor\");\r\n container.appendChild(anchor);\r\n anchor.id = \"anchor\" + i;\r\n anchor.className = \"anchor\";\r\n var img = DOM.createElement(\"img\", \"image\");\r\n anchor.appendChild(img);\r\n img.src = \"img/nothing.gif\";\r\n }\r\n for (var i=0; i<Diagram.NUM_ANCHORS; i++) {\r\n var hover = DOM.createElement(\"DIV\", \"hover\");\r\n container.appendChild(hover);\r\n hover.id = \"hover\" + i;\r\n hover.className = \"hover\";\r\n var img = DOM.createElement(\"img\", \"image\");\r\n hover.appendChild(img);\r\n img.src = \"/img/nothing.gif\";\r\n }\r\n}", "function getAnchorChildren() {\r\n let span = document.querySelectorAll(\"a span\");\r\n for (let s of span) console.log(s.innerHTML);\r\n}", "function getConnectors() {\n var targetDecorator = { shape: 'Arrow', style: { fill: '#444', strokeColor: '#444' } };\n var sourcePoint = { x: 0, y: 0 };\n var targetPoint = { x: 40, y: 40 };\n var connectorSymbols = [\n {\n id: 'Link2', sourcePoint: sourcePoint, targetPoint: targetPoint,\n type: 'Orthogonal', style: getConnectorStyle(true), targetDecorator: targetDecorator,\n },\n {\n id: 'Link1', sourcePoint: sourcePoint, targetPoint: targetPoint,\n type: 'Orthogonal', style: getConnectorStyle(), targetDecorator: targetDecorator,\n },\n {\n id: 'Link3', sourcePoint: sourcePoint, targetPoint: targetPoint,\n type: 'Straight', style: getConnectorStyle(), targetDecorator: targetDecorator,\n }\n ];\n return connectorSymbols;\n}" ]
[ "0.6959122", "0.65383494", "0.65383494", "0.65383494", "0.65383494", "0.65383494", "0.65383494", "0.65383494", "0.65383494", "0.65383494", "0.65383494", "0.65383494", "0.65383494", "0.65383494", "0.65383494", "0.65383494", "0.65383494", "0.65383494", "0.65383494", "0.65383494", "0.6490695", "0.6476059", "0.64747936", "0.64688617", "0.64688617", "0.6248557", "0.57301956", "0.5611763", "0.55880964", "0.5578779", "0.5433934", "0.53757006", "0.53518677", "0.5276753", "0.5216981", "0.5208411", "0.5200077", "0.5156124", "0.5155561", "0.5144421", "0.51267534", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.5105274", "0.50944084", "0.50944084", "0.5080091", "0.50652605", "0.50652057", "0.5061552", "0.5056626", "0.5053402", "0.50459754", "0.5035497", "0.5030109", "0.5012993", "0.501291", "0.501291", "0.49954358", "0.49888325", "0.4984556", "0.49756503", "0.4957988", "0.49280444", "0.4915777", "0.49150535", "0.49099377", "0.4908702", "0.4905264", "0.48780957", "0.48540494", "0.48396954", "0.47908607" ]
0.7785882
0
Create an anchor at a specific position defined by XRAnchor.coordinates
addAnchor(coordinateSystem, position=[0,0,0], orientation=[0,0,0,1]){ //DOMString? addAnchor(XRCoordinateSystem, position, orientation); let poseMatrix = MatrixMath.mat4_fromRotationTranslation(new Float32Array(16), orientation, position) MatrixMath.mat4_multiply(poseMatrix, coordinateSystem.getTransformTo(this._session._display._trackerCoordinateSystem), poseMatrix) let anchorCoordinateSystem = new XRCoordinateSystem(this._session._display, XRCoordinateSystem.TRACKER) anchorCoordinateSystem._relativeMatrix = poseMatrix return this._session.reality._addAnchor(new XRAnchor(anchorCoordinateSystem), this._session.display) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createAnchor(xx, yy, offset, nme) {\n\tvar anchor = paper\n\t .circle(xx, yy, 2)\n\t .attr({\"stroke-width\": 1, fill: \"#F00\"});\n\tanchor.name = nme;\n\tanchor.node.name = nme;\n\t\n\t// on clicking on the circle, \n\t// 1. create a new draggable object\n\t// 2. create a connection object between the rh and the draggable object\n\t// 3. if the draggable object dropped on a rh, then connect the two rh's \n\t$(anchor.node).bind('click', function(e) { \n\t\tconsole.log(\"anchor clicked: \"+this.name)\n\t\tvar drag_anchor = paper\n\t\t\t.circle(xx+offset, yy, 5)\n\t\t\t.attr({\"stroke-width\": 1, fill: \"#050\", opacity: 0.8})\n\t\t\t.draggable.enable();\n\t\tconnections.push(paper.connection2BBox(anchor, drag_anchor, \"#f57\", \"#55f\"));\t\t\n\t\tdrag_anchor.drag(move, dragger, up_and_glue);\n\t\t\n\t\t// needed for the dropped_on event\n\t\tdrag_anchor.dragFinish = over;\t\n\t\tdrag_anchor.make_draggable();\n\t\t\n\t});\n\t\n\treturn anchor;\n}", "createAnchor(paper, x, y, style, r = AnchorsComponent.DEFAULT_ANCHOR_RADIUS) {\r\n const a = paper.circle(x, y, r);\r\n a.addClass(\"anchorStyle\");\r\n if (style !== undefined && style !== \"\") {\r\n a.addClass(style);\r\n }\r\n return a;\r\n }", "setAnchorPostion(anchor, newX, newY) {\n anchor.html.attr(\"cx\", newX).attr(\"cy\", newY);\n }", "_findAnchor(normalizedScreenX, normalizedScreenY, display, testOptions=null){\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif(this._arKitWrapper !== null){\t\n\t\t\t\t// Perform a hit test using the ARKit integration\n\t\t\t\tthis._arKitWrapper.hitTest(normalizedScreenX, normalizedScreenY, testOptions || ARKitWrapper.HIT_TEST_TYPE_EXISTING_PLANES).then(hits => {\n\t\t\t\t\tif(hits.length === 0){\n\t\t\t\t\t\tresolve(null)\n\t\t\t\t\t\t// console.log('miss')\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst hit = this._pickARKitHit(hits)\n\n\t\t\t\t\t// if it's a plane\n\t\t\t\t\tif (hit.anchor_transform) {\n\t\t\t\t\t\thit.anchor_transform[13] += XRViewPose.SITTING_EYE_HEIGHT\n\t\t\t\t\t\thit.world_transform[13] += XRViewPose.SITTING_EYE_HEIGHT\n\n\t\t\t\t\t\t// Use the first hit to create an XRAnchorOffset, creating the XRAnchor as necessary\n\n\t\t\t\t\t\t// TODO use XRPlaneAnchor for anchors with extents; hopefully the plane will have been created, tho\n\t\t\t\t\t\tlet anchor = this._getAnchor(hit.uuid)\n\t\t\t\t\t\tif(anchor === null){\n\t\t\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\t\t\tcoordinateSystem._relativeMatrix = hit.anchor_transform\n\t\t\t\t\t\t\tanchor = new XRAnchor(coordinateSystem, hit.uuid)\n\t\t\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst offsetPosition = [\n\t\t\t\t\t\t\thit.world_transform[12] - hit.anchor_transform[12],\n\t\t\t\t\t\t\thit.world_transform[13] - hit.anchor_transform[13],\n\t\t\t\t\t\t\thit.world_transform[14] - hit.anchor_transform[14]\n\t\t\t\t\t\t]\n\t\t\t\t\t\tconst worldRotation = new Quaternion().setFromRotationMatrix(hit.world_transform)\n\t\t\t\t\t\tconst inverseAnchorRotation = new Quaternion().setFromRotationMatrix(hit.anchor_transform).inverse()\n\t\t\t\t\t\tconst offsetRotation = new Quaternion().multiplyQuaternions(worldRotation, inverseAnchorRotation)\n\t\t\t\t\t\tconst anchorOffset = new XRAnchorOffset(anchor.uid)\n\t\t\t\t\t\tanchorOffset.poseMatrix = MatrixMath.mat4_fromRotationTranslation(new Float32Array(16), offsetRotation.toArray(), offsetPosition)\n\t\t\t\t\t\tresolve(anchorOffset)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\t\tcoordinateSystem._relativeMatrix = hit.world_transform\n\t\t\t\t\t\tconst anchor = new XRAnchor(coordinateSystem, hit.uuid)\n\t\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\n\t\t\t\t\t\tconst anchorOffset = new XRAnchorOffset(anchor.uid)\n\t\t\t\t\t\tresolve(anchorOffset)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} else if(this._vrDisplay !== null){\n\t\t\t\t// Perform a hit test using the ARCore data\n\t\t\t\tlet hits = this._vrDisplay.hitTest(normalizedScreenX, normalizedScreenY)\n\t\t\t\tif(hits.length == 0){\n\t\t\t\t\tresolve(null)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\thits.sort((a, b) => a.distance - b.distance)\n\t\t\t\tlet anchor = this._getAnchor(hits[0].uuid)\n\t\t\t\tif(anchor === null){\n\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\tcoordinateSystem._relativeMatrix = hits[0].modelMatrix\n\t\t\t\t\tcoordinateSystem._relativeMatrix[13] += XRViewPose.SITTING_EYE_HEIGHT\n\t\t\t\t\tanchor = new XRAnchor(coordinateSystem)\n\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\t\t\t\t}\n\t\t\t\tresolve(new XRAnchorOffset(anchor.uid))\n\t\t\t} else {\n\t\t\t\tresolve(null) // No platform support for finding anchors\n\t\t\t}\n\t\t})\n\t}", "_createAnchor() {\n const anchor = this._document.createElement('div');\n\n this._toggleAnchorTabIndex(this._enabled, anchor);\n\n anchor.classList.add('cdk-visually-hidden');\n anchor.classList.add('cdk-focus-trap-anchor');\n anchor.setAttribute('aria-hidden', 'true');\n return anchor;\n }", "_createAnchor() {\n const anchor = this._document.createElement('div');\n this._toggleAnchorTabIndex(this._enabled, anchor);\n anchor.classList.add('cdk-visually-hidden');\n anchor.classList.add('cdk-focus-trap-anchor');\n anchor.setAttribute('aria-hidden', 'true');\n return anchor;\n }", "_createAnchor() {\n const anchor = this._document.createElement('div');\n this._toggleAnchorTabIndex(this._enabled, anchor);\n anchor.classList.add('cdk-visually-hidden');\n anchor.classList.add('cdk-focus-trap-anchor');\n anchor.setAttribute('aria-hidden', 'true');\n return anchor;\n }", "_createAnchor() {\n const anchor = this._document.createElement('div');\n this._toggleAnchorTabIndex(this._enabled, anchor);\n anchor.classList.add('cdk-visually-hidden');\n anchor.classList.add('cdk-focus-trap-anchor');\n anchor.setAttribute('aria-hidden', 'true');\n return anchor;\n }", "function addAnchorR() {\n var pole = addStreetPostsR();\n\n pole.lightPost.position.z = -4770;\n pole.light.position.z = -4770;\n}", "function anchorAt(txt,x,y) {\n\ttxt.position=[x-(txt.anchor[0]-txt.position[0]),(txt.position[1]-txt.anchor[1])+y];\n}", "_findAnchor(normalizedScreenX, normalizedScreenY, display){\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif(this._arKitWrapper !== null){\t\n\t\t\t\t// Perform a hit test using the ARKit integration\n\t\t\t\tthis._arKitWrapper.hitTest(normalizedScreenX, normalizedScreenY, ARKitWrapper.HIT_TEST_TYPE_EXISTING_PLANES).then(hits => {\n\t\t\t\t\tif(hits.length === 0){\n\t\t\t\t\t\tresolve(null)\n\t\t\t\t\t\t// console.log('miss')\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst hit = this._pickARKitHit(hits)\n\t\t\t\t\thit.anchor_transform[13] += XRViewPose.SITTING_EYE_HEIGHT\n\t\t\t\t\thit.world_transform[13] += XRViewPose.SITTING_EYE_HEIGHT\n\n\t\t\t\t\t// Use the first hit to create an XRAnchorOffset, creating the XRAnchor as necessary\n\n\t\t\t\t\t// TODO use XRPlaneAnchor for anchors with extents\n\n\t\t\t\t\tlet anchor = this._getAnchor(hit.uuid)\n\t\t\t\t\tif(anchor === null){\n\t\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\t\tcoordinateSystem._relativeMatrix = hit.anchor_transform\n\t\t\t\t\t\tanchor = new XRAnchor(coordinateSystem, hit.uuid)\n\t\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\t\t\t\t\t}\n\n\t\t\t\t\tconst offsetPosition = [\n\t\t\t\t\t\thit.world_transform[12] - hit.anchor_transform[12],\n\t\t\t\t\t\thit.world_transform[13] - hit.anchor_transform[13],\n\t\t\t\t\t\thit.world_transform[14] - hit.anchor_transform[14]\n\t\t\t\t\t]\n\t\t\t\t\tconst worldRotation = new Quaternion().setFromRotationMatrix(hit.world_transform)\n\t\t\t\t\tconst inverseAnchorRotation = new Quaternion().setFromRotationMatrix(hit.anchor_transform).inverse()\n\t\t\t\t\tconst offsetRotation = new Quaternion().multiplyQuaternions(worldRotation, inverseAnchorRotation)\n\t\t\t\t\tconst anchorOffset = new XRAnchorOffset(anchor.uid)\n\t\t\t\t\tanchorOffset.poseMatrix = MatrixMath.mat4_fromRotationTranslation(new Float32Array(16), offsetRotation.toArray(), offsetPosition)\n\t\t\t\t\tresolve(anchorOffset)\n\t\t\t\t})\n\t\t\t} else if(this._vrDisplay !== null){\n\t\t\t\t// Perform a hit test using the ARCore data\n\t\t\t\tlet hits = this._vrDisplay.hitTest(normalizedScreenX, normalizedScreenY)\n\t\t\t\tif(hits.length == 0){\n\t\t\t\t\tresolve(null)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\thits.sort((a, b) => a.distance - b.distance)\n\t\t\t\tlet anchor = this._getAnchor(hits[0].uuid)\n\t\t\t\tif(anchor === null){\n\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\tcoordinateSystem._relativeMatrix = hits[0].modelMatrix\n\t\t\t\t\tcoordinateSystem._relativeMatrix[13] += XRViewPose.SITTING_EYE_HEIGHT\n\t\t\t\t\tanchor = new XRAnchor(coordinateSystem)\n\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\t\t\t\t}\n\t\t\t\tresolve(new XRAnchorOffset(anchor.uid))\n\t\t\t} else {\n\t\t\t\tresolve(null) // No platform support for finding anchors\n\t\t\t}\n\t\t})\n\t}", "function createAnchor(tagName, attributes, children) {\n return new AnchorToken(attributes);\n}", "set anchor(value) {}", "function Position(x, y)\n{\n this.x = x\n this.y = y\n this.xRelative = (x <= 1.0);\n this.yRelative = (y <= 1.0);\n this.xAnchor = (arguments.length >= 3) ? arguments[2] : 0;\n this.yAnchor = (arguments.length >= 4) ? arguments[3] : 0;\n}", "function createAnchor(type, key) {\n if (main.debug) {\n var comment = (type === 0 ? 'start' : (type === 1 ? 'end' : 'anchor')) + ' ' + key;\n return document.createComment(comment);\n } else {\n return document.createTextNode('');\n };\n}", "function ShapePoint(anchor, left, right) {\r\n this.anchor = anchor;\r\n this.left = left;\r\n this.right = right;\r\n}", "buildPointAnchors() {\r\n this.regionData.points.forEach((point, index) => {\r\n const anchor = this.createAnchor(this.paper, point.x, point.y);\r\n this.anchors.push(anchor);\r\n this.anchorsNode.add(anchor);\r\n this.subscribeAnchorToEvents(anchor, index);\r\n });\r\n }", "_createImageAnchor(uid, buffer, width, height, physicalWidthInMeters) {\n\t\tif (this._arKitWrapper) {\n return this._arKitWrapper.createImageAnchor(uid, buffer, width, height, physicalWidthInMeters)\n } else {\n\t\t\treturn null;\n\t\t}\n\t}", "addAnchoredNode(anchorOffset, node){\n\t\tthis.anchoredNodes.push({\n\t\t\tanchorOffset: anchorOffset,\n\t\t\tnode: node\n\t\t})\n\t\tthis.scene.add(node)\n\t}", "createAlias(node, name) {\n if (!node.anchor) {\n const prev = anchorNames(this);\n node.anchor =\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n !name || prev.has(name) ? findNewAnchor(name || 'a', prev) : name;\n }\n return new Alias(node.anchor);\n }", "function updateAnchorPos() {\n if (!labelSim.selection) return;\n\n labelSim.selection.each(function(d) {\n var bbox = this.getBBox(),\n x = bbox.x + bbox.width/2,\n y = bbox.y + bbox.height/2\n\n d.anchorPos.x = x\n d.anchorPos.y = y\n d.anchorPos.fx = x\n d.anchorPos.fy = y\n\n // If a label position does not exist, set it to be the anchor position\n if (d.labelPos.x == null) {\n d.labelPos.x = x\n d.labelPos.y = y\n }\n })\n }", "function toAnchorNode(node, id) {\n setNodeAttr(node, 'id', id);\n mergeNodeAttr(node, 'class', classNames.anchor);\n\n const linkNode = tree.createElement('a', ns.html, [\n {\n name: 'class',\n value: classNames.anchorLink,\n },\n {\n name: 'href',\n value: `#${id}`,\n },\n {\n name: 'aria-hidden',\n value: 'true',\n },\n ]);\n\n const iconNode = tree.createElement('span', ns.html, [\n {\n name: 'class',\n value: classNames.anchorIcon,\n },\n ]);\n\n tree.appendChild(node, linkNode);\n tree.appendChild(linkNode, iconNode);\n}", "buildAnchors() {\r\n this.buildPointAnchors();\r\n }", "createAlias(node, name) {\n if (!node.anchor) {\n const prev = anchors.anchorNames(this);\n node.anchor =\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n !name || prev.has(name) ? anchors.findNewAnchor(name || 'a', prev) : name;\n }\n return new Alias.Alias(node.anchor);\n }", "function addNEDCoordLink(parent, ra, dec, active) {\n if (typeof active === 'undefined') { active = true; }\n\n const url = 'http://ned.ipac.caltech.edu/?q=nearposn&lon=' +\n\t ra.toString() + 'd&lat=' + dec.toString() +\n\t '&sr=0.0833&incsrcs=0&coordsys=Equatorial&equinox=J2000';\n\n const a = document.createElement('a');\n if (active) {\n a.setAttribute('target', '_blank');\n a.setAttribute('href', url);\n } else {\n a.setAttribute('href', '#');\n }\n addText(a, 'NED');\n\n parent.appendChild(a);\n }", "function addAnchorL() {\n var pole = addStreetPostsL();\n\n pole.lightPost.position.z = -4770;\n pole.light.position.z = -4770;\n}", "function axialCoords(q, r) {\r\n\tthis.q = q;\r\n\tthis.r = r;\r\n}", "function createNode(radius, xStartPos, id) {\n var newNode = Object.create(nodeObject);\n newNode.radius = radius;\n newNode.x = xStartPos;\n newNode.y = 0;\n newNode.id = id;\n\n return newNode;\n}", "function alinhar(imagem, x, y){\n\timagem.anchor.x = x;\n\timagem.anchor.y = y;\n}", "getAnchor(uid){\n\t\t// XRAnchor? getAnchor(DOMString uid);\n\t\treturn this._session.reality._getAnchor(uid)\n\t}", "setPosition(newX=this.x, newY=this.y) {\n this.x = newX;\n this.y = newY;\n this.updateEdges() // Update Edge positions\n this.setAnchorPostion(this, newX, newY); // Update DOM element\n }", "function cardChildrenAdjustForAnchor(card, anchorX, anchorY){\n\n //****CARD CHILD LOCATION*****\n // 0 - TOP LEFT CORNER - ATTACK\n // 1 - TOP RIGHT CORNER - HP\n // 2 - BOTTOM LEFT CORNER - ACTION POINTS\n // 3 - CARD TITLE (will need to move to 4 or 5)\n // 4 - CARD IMAGE\n\n var rectangle = card.getLocalBounds();\n\n var child = card.getChildAt(0);\n child.position.x = topLeftAttributeSlotXOffset - getXOffsetFromCenterForText(playerCards[card.id].attack, cardAttributeFontCharSize) - (rectangle.width * anchorX);\n child.position.y = topLeftAttributeSlotYOffset - cardAttributeFontCharSize - (rectangle.height * anchorY);\n\n\n var child = card.getChildAt(1);\n child.position.x = topRightAttributeSlotXOffset - getXOffsetFromCenterForText(playerCards[card.id].health, cardAttributeFontCharSize) - (rectangle.width * anchorX);\n child.position.y = topRightAttributeSlotYOffset - cardAttributeFontCharSize - (rectangle.height * anchorY);\n\n\n var child = card.getChildAt(2); \n child.position.x = botLeftAttributeSlotXOffset - getXOffsetFromCenterForText(playerCards[card.id].remMoves, cardAttributeFontCharSize) - (rectangle.width * anchorX);\n child.position.y = botLeftAttributeSlotYOffset - cardAttributeFontCharSize - (rectangle.height * anchorX);\n \n\n var child = card.getChildAt(3); \n child.position.x = cardFrameOriginalWidth/2 - cardImageWidth / 2 - (rectangle.width * anchorX);\n child.position.y = 0 - (rectangle.height * anchorY) + 200;\n\n\n var child = card.getChildAt(4); \n child.position.x = cardFrameOriginalWidth/2 - getXOffsetFromCenterForText(playerCards[card.id].name, cardTitleFontCharSize) - (rectangle.width * anchorX);\n child.position.y = 0 - (rectangle.height * anchorY) + 100;\n }", "buildAllAnchor() {\n let x = self.baseImage.getX(), y = self.baseImage.getY();\n let width = self.baseImage.getWidth(), height = self.baseImage.getHeight();\n let coor = [x,y, x+width,y, x,y+height, x+width,y+height];\n for (let i=0; i<coor.length; i+=2){\n self.buildAnchor(coor[i], coor[i+1], i/2);\n }\n self.group.setDraggable(true);\n self.group.add(self.anchorGroup);\n self.layer.draw()\n\n }", "getLinkAnchors(mode) {\n const attrs = this.state.attributes;\n return [\n {\n element: this.object._id,\n points: [\n {\n x: attrs.x,\n y: attrs.y,\n xAttribute: \"x\",\n yAttribute: \"y\",\n direction: { x: mode == \"begin\" ? 1 : -1, y: 0 }\n }\n ]\n }\n ];\n }", "function xAniLine(xa, x, y, tt, at, qc, oed, oea, oef)\r\n{\r\n var a = xa.init(xa.e, at, qc, tt, onRun, onRun, oed, oea, oef);\r\n a.x1 = xLeft(a.e); // start point\r\n a.y1 = xTop(a.e);\r\n a.x2 = x; // end point\r\n a.y2 = y;\r\n if (a.as) a.start();\r\n return a;\r\n function onRun(o) { xMoveTo(o.e, Math.round(o.x), Math.round(o.y)); }\r\n}", "function asrNode (id, x, y) {\n\t// TODO\n}", "function createNewCoordinate() {\n var randCoordArr = generateXY();\n coordinates = new CurrentPicturePosition(randCoordArr[0], randCoordArr[1]);\n}", "setAnchorPoseFromCameraOffset(x, y, z, orientation) {\n this._z.instant_world_tracker_anchor_pose_set_from_camera_offset(this._impl, x, y, z, orientation || zappar_cv_1.instant_world_tracker_transform_orientation_t.MINUS_Z_AWAY_FROM_USER);\n }", "createImageAnchor(uid, buffer, width, height, physicalWidthInMeters) {\n\t\treturn new Promise((resolve, reject) => {\n if (!this._isInitialized){\n reject(new Error('ARKit is not initialized'));\n return;\n }\n\n let b64 = base64.encode(buffer);\n\n window.webkit.messageHandlers.createImageAnchor.postMessage({\n uid: uid,\n buffer: b64,\n imageWidth: width,\n imageHeight: height,\n physicalWidth: physicalWidthInMeters,\n\t\t\t\tcallback: this._createPromiseCallback('createImageAnchor', resolve)\n })\n\t\t})\n\t}", "function $anchor(parent, id, cl, text, href) {\n\tlet a = $new(parent, 'a', id, cl, text);\n\tif (href) a.href = href;\n\treturn a;\n}", "anchorDragMove(dx, dy, x, y) {\r\n let p = new Point2D_1.Point2D(this.dragOrigin.x + dx, this.dragOrigin.y + dy);\r\n if (this.paperRect !== null) {\r\n p = p.boundToRect(this.paperRect);\r\n }\r\n window.requestAnimationFrame(() => {\r\n this.ghostAnchor.attr({ cx: p.x, cy: p.y });\r\n });\r\n this.updateRegion(p);\r\n }", "function centerAnchorPoint(layer){\n var comp = app.project.activeItem;\n var x = layer.sourceRectAtTime(comp.time,false).width/2 + layer.sourceRectAtTime(comp.time,false).left;\n var y = layer.sourceRectAtTime(comp.time,false).height/2 + layer.sourceRectAtTime(comp.time,false).top;\n layer.anchorPoint.setValue([x,y]);\n }", "function getAnchor() {\n\t\t\tvar test = $('.pinContent').text();\n\t\t\treturn new Microsoft.Maps.Point(0, 33)\n\t\t}", "function swapAnchor (whichLayer, newAnchor) {\n\n\t\t// Layer Transform Group\n\tvar layerTransformGrp = whichLayer.property(\"ADBE Transform Group\");\n\n\t\t// Position Layer Anchor Point\n\tvar theLayerAnchor = layerTransformGrp.property(\"ADBE Anchor Point\");\n\ttheLayerAnchor.setValue(newAnchor);\n\n}", "function createAnchor(html, index) {\n const a = document.createElement('a');\n a.href = '#';\n a.innerHTML = html;\n a.onclick = onHeadigClick(this, index);\n return a;\n}", "function optimizeAnchors(positions) {\n return positions.map((position, index) => {\n const others = [...positions.slice(0, index), ...positions.slice(index + 1)];\n const othersBearing = getBearingFromOtherPoints(position, others);\n return {\n lngLat: position.lngLat,\n anchor: getAnchor(position.axis, othersBearing),\n };\n });\n}", "function createArc(obj, name, x_val) {\n\tscene2_container.getChildByName(obj).visible = true;\t\n\tscene2_container.addChild(name);\n name.x = x_val;\n name.y = blue_sample_arc_y;\n\tname.graphics.beginStroke(\"#2d4294\").setStrokeStyle(3).moveTo(10, ARC_STRAIGHT_CONST).bezierCurveTo(10, 30, 50, 30, 50, ARC_STRAIGHT_CONST).command;\n\tname.alpha = 0.5;\n}", "findAnchor(normalizedScreenX, normalizedScreenY, options=null){\n\t\t// Promise<XRAnchorOffset?> findAnchor(float32, float32); // cast a ray to find or create an anchor at the first intersection in the Reality\n\t\treturn this._session.reality._findAnchor(normalizedScreenX, normalizedScreenY, this._session.display, options)\n\t}", "anchor() {\n this.__anchors++;\n }", "anchor() {\n this.__anchors++;\n }", "anchor() {\n this.__anchors++;\n }", "anchor() {\n this.__anchors++;\n }", "function xAniEllipse(xa, xr, yr, a1, a2, tt, at, qc, oed, oea, oef)\r\n{\r\n var a = xa.init(xa.e, at, qc, tt, onRun, onRun, oed, oea, oef);\r\n a.x1 = a1 * (Math.PI / 180); // start angle\r\n a.x2 = a2 * (Math.PI / 180); // end angle\r\n var sx = xLeft(a.e) + (xWidth(a.e) / 2); // start point\r\n var sy = xTop(a.e) + (xHeight(a.e) / 2);\r\n a.xc = sx - (xr * Math.cos(a.x1)); // arc center point\r\n a.yc = sy - (yr * Math.sin(a.x1));\r\n a.xr = xr; // radii\r\n a.yr = yr;\r\n if (a.as) a.start();\r\n return a;\r\n function onRun(o) {\r\n xMoveTo(o.e,\r\n Math.round(o.xr * Math.cos(o.x)) + o.xc - (xWidth(o.e) / 2),\r\n Math.round(o.yr * Math.sin(o.x)) + o.yc - (xHeight(o.e) / 2));\r\n }\r\n}", "absAnchorOut(nid) {\n const ltd = this.lastTreeData;\n if (ltd && (nid in ltd)) {\n const ndata = ltd[nid];\n return {\n x: ndata.position.x + ndata.anchorOut.x,\n y: ndata.position.y + ndata.anchorOut.y\n }\n }\n return {x: 0, y: 0};\n }", "getAnchor() {\n this._assertInitialized();\n return this.marker;\n }", "function computeSpawnPointFromPosition(center, position) {\n let dist = Math.sqrt(position.lat*position.lat + position.lng*position.lng);\n let directionX = position.lat / dist;\n let directionY = position.lng / dist;\n let distFromOrigen = 0.01 * Panorama.getDistanceBetween(center, position);\n return {x: directionX * distFromOrigen, y: directionY * distFromOrigen, z: 0};\n}", "setDefaults() {\n this.anchor = 0.5;\n this.x = 0;\n this.y = 0;\n }", "function createAnchor(name, text, count, url, d) {\n\n let a = document.createElement(\"a\");\n a.setAttribute(\"class\", \"bubble-action\");\n a.setAttribute(\"href\", url);\n\n\n let svg = document.createElementNS(NS, \"svg\");\n svg.setAttribute(\"class\", \"octicon octicon-\" + name);\n svg.setAttribute(\"viewBox\", \"0 0 14 16\");\n svg.setAttribute(\"version\", \"1.1\");\n svg.setAttribute(\"width\", \"24\");\n svg.setAttribute(\"height\", \"16\");\n svg.setAttribute(\"aria-hidden\", \"true\");\n\n\n let path = document.createElementNS(NS, \"path\");\n path.setAttribute(\"fill-rule\", \"evenodd\");\n path.setAttribute(\"d\", d);\n\n svg.appendChild(path);\n\n\n let span = document.createElement(\"span\");\n span.setAttribute(\"class\", \"Counter\");\n span.appendChild(document.createTextNode(count));\n\n a.appendChild(svg);\n a.appendChild(document.createTextNode(\" \" + text + \" \"));\n a.append(span);\n\n return a;\n}", "recenterAnchorInSubtree(){\n if(!this.getChildrenList().length){\n this.setWorldPosition(this.getParent().getWorldPosition())\n return\n }\n let bbox = this.getChildTreeObjectSpaceBoundingBox()\n let new_center = new Vec2((bbox[0].x+bbox[2].x)/2, (bbox[0].y+bbox[2].y)/2)\n // console.log(new_center)\n this.setWorldPosition(this.getObjectToWorldMatrix().times(new_center))\n }", "function offsetAnchor() {\n if (location.hash.length !== 0) {\n window.scrollTo(window.scrollX, window.scrollY - 110);\n }\n}", "function deriveAnchor(edge, index, ep, conn) {\n return options.anchor ? options.anchor : options.deriveAnchor(edge, index, ep, conn);\n }", "addAnchor() {\n const data = {\n action: 'addAnchor',\n value: null\n };\n this.postMessage(data);\n }", "function setAnchorAsButton(anchor){anchor.setAttribute(\"role\",\"button\");anchor.tabIndex=0;}// eslint-disable-next-line es/no-object-assign -- safe", "constructor($anchor, $head = $anchor) {\n let inv = $anchor.pos > $head.pos\n super(inv ? $head : $anchor, inv ? $anchor : $head)\n // :: ResolvedPos The resolved anchor of the selection.\n this.$anchor = $anchor\n // :: ResolvedPos The resolved head of the selection.\n this.$head = $head\n }", "function spawnLocation(xPos, yPos) {\n \n return { x: xPos, y: yPos };\n\n}", "function offsetAnchor() {\n if (location.hash.length !== 0) {\n window.scrollTo(window.scrollX, window.scrollY - 100);\n }\n}", "static create(doc2, anchor, head = anchor) {\n let $anchor = doc2.resolve(anchor);\n return new this($anchor, head == anchor ? $anchor : doc2.resolve(head));\n }", "addAnchortoDOM(root_html, anchor) {\n // Create a group\n const group = root_html.append(\"g\")\n // Add anchor\n const anchorDOM = group.append(\"circle\")\n .attr(\"r\", anchor.radius)\n .attr(\"cx\", anchor.x)\n .attr(\"cy\", anchor.y)\n .attr(\"fill\", anchor.color)\n return anchorDOM\n }", "setupCoordinates(){\n // Start the circle off screen to the bottom left.\n // We divide the size by two because we're drawing from the center.\n this.xPos = -circleSize / 2;\n this.yPos = height + circleSize / 2;\n }", "function createMarker(brewery, coords) {\n marker = new google.maps.Marker({\n position: coords,\n map: map,\n title: brewery.brewery.name\n });\n\n }", "moveTo(position) {\n\t\tthis.position = position;\n\t\tthis.image.position.x = this.__calculateX(position);\n\t\tthis.image.position.y = this.__calculateY(position);\n\t}", "moveTo(position) {\n\t\tthis.position = position;\n\t\tthis.image.position.x = this.__calculateX(position);\n\t\tthis.image.position.y = this.__calculateY(position);\n\t}", "function offsetAnchor() {\n if (location.hash.length !== 0) {\n window.scrollTo(window.scrollX, window.scrollY - 100);\n }\n}", "function offsetAnchor() {\n if (location.hash.length !== 0) {\n window.scrollTo(window.scrollX, window.scrollY - 100);\n }\n}", "function offsetAnchor() {\r\n\tif (location.hash.length !== 0) {\r\n\t\twindow.scrollTo(window.scrollX, window.scrollY - 100);\r\n\t}\r\n}", "subscribeAnchorToEvents(anchor, index) {\r\n anchor.node.addEventListener(\"pointerenter\", (e) => {\r\n if (!this.isFrozen) {\r\n // Set drag origin point to current anchor\r\n this.dragOrigin = this.regionData.points[index];\r\n this.activeAnchorIndex = index;\r\n // Move ghost anchor to current anchor position\r\n window.requestAnimationFrame(() => {\r\n this.ghostAnchor.attr({\r\n cx: this.dragOrigin.x,\r\n cy: this.dragOrigin.y,\r\n display: \"block\",\r\n });\r\n });\r\n this.onManipulationBegin();\r\n }\r\n });\r\n }", "_onSceneAnchorFound(anchor) {\n\n this.anchors[this.numAnchors] = anchor;\n planes.push(\n <ViroARPlane\n key={this.anchors[this.numAnchors].anchorId}\n anchorId={this.anchors[this.numAnchors].anchorId}\n onClick={this._setTextNatively(\"onClick\", this.numAnchors)}\n onAnchorFound={this._onAnchorFound}\n onAnchorUpdated={this._onAnchorUpdated}\n onAnchorRemoved={this._onAnchorRemoved} >\n\n <ViroSurface\n rotation={[-90, 0, 0]}\n scale={[.5, .5, 1]}\n materials={\"blue_plane\"} />\n\n </ViroARPlane>);\n\n\n this.numAnchors++;\n this.setState({\n reloadFlag: !(this.state.reloadFlag),\n isObjectVisible: true,\n }, () => { this._updateAnimation(this.anchors[this.numAnchors - 1].position) })\n }", "newPosition(x, y)\n {\n this.x = x;\n this.y = y;\n }", "function createArc(x, y, r) {\n // Draw the outside curve of a half-circle\n var start = new Point(x, y - r);\n var through = new Point(x - r, y);\n var to = new Point(x, y + r);\n var arcNode = Path.Arc(start, through, to);\n // Draw the flat line\n arcNode.add(new Point(x, y));\n arcNode.add(new Point(x, y - r));\n arcNode.rotate(45, new Point(x, y));\n arcNode.name = 'arcNode';\n return arcNode;\n }", "function offsetAnchor() {\n if (location.hash.length !== 0) {\n window.scrollTo(window.scrollX, window.scrollY - 100)\n }\n}", "moveTo(x, y) {\n this.x = x;\n this.y = y;\n }", "positionBubble_() {\n let left = this.anchorXY_.x;\n if (this.workspace_.RTL) {\n left -= this.relativeLeft_ + this.width_;\n } else {\n left += this.relativeLeft_;\n }\n const top = this.relativeTop_ + this.anchorXY_.y;\n this.moveTo(left, top);\n }", "addNode(x, y, text, rx = 20, ry = 20) {\n let node = new Node(x, y, rx, ry, text);\n this.root.appendChild(node.root);\n this.nodes.push(node);\n return node;\n }", "moveTo(x, y) {\n this.params.x = x\n this.params.y = y\n this.updateParams()\n }", "constructor(xOffset, yOffset) {\n super();\n this._XOffset = xOffset;\n this._YOffset = yOffset;\n }", "createNode(pos) {\n let newX;\n let newY;\n if (pos !== undefined) {\n newX = pos.x;\n newY = pos.y;\n }\n else {\n newX = this.cursorPosition.x;\n newY = this.cursorPosition.y;\n }\n return new Types_1.Node(\"0\", this.findLowestIDAvailable(), newX, newY, this.frozen, false);\n }", "function setPointerR(name, node) {\n return node.jsav.pointer(name, node, {anchor: \"right top\",\n myAnchor: \"left bottom\", left: -10});\n}", "static moveRotatePoint(point, offset, anchorCenter, anchorRot, size_multi){\t\t\t\n\t\t\tpoint.x = anchorCenter.x + offset.x;\n\t\t\tpoint.y = anchorCenter.y + offset.y; \n\t\t\tpoint.rotation=(anchorRot + offset.offRot) % 360;\n\t\t\t//if(point.rotation != offset.rot){\n\t\t\t\t// get vector from center to template\n\t\t\t\tconst deltaRotRad = toRadians((point.rotation - offset.rot) % 360);\n\t\t\t\t// rotate vector around angle\n\t\t\t\t[point.x, point.y] = TokenAttacher.computeRotatedPosition(anchorCenter.x, anchorCenter.y, point.x, point.y, deltaRotRad, size_multi);\n\t\t\t\t\n\t\t\t//}\t\n\t\t\treturn [point.x, point.y, point.rotation];\n\t\t}", "setupCoordinates(){\n // Starts the circle and square off screen to the bottom left\n // We divide their size by two because we're drawing from the center\n this.xPos = width + squareSize / 2;\n this.yPos = height + squareSize / 2;\n }", "function createTopLeftTurn(xpos, ypos) { //creates a top left angled corner for a turn\r\n color(\"light_green\")\r\n char(\"e\", xpos, ypos + 12);\r\n char(\"e\", xpos + 6, ypos + 6);\r\n char(\"e\", xpos + 12, ypos);\r\n char(\"d\", xpos + 6, ypos + 12);\r\n char(\"d\", xpos + 12, ypos + 6);\r\n char(\"d\", xpos + 12, ypos + 12);\r\n turnHelper(xpos, ypos);\r\n}", "function calcXAndY(row, column){\n if(row < 0 || row > 4 || column < 0 || column > 4){\n return undefined\n }\n return {\n x: row * QUADRANT_DIMENSION + ANCHOR_OFFSET,\n y: column * QUADRANT_DIMENSION + ANCHOR_OFFSET,\n };\n}", "function create_atom(element, x, y, id) {\n\t// The Atom object\n\n\tif (id || id == 0) { // If id is specified\n\t\tvar a = new Atom(element, x, y, id);\n\t} else { // If id is not specified\n\t\tvar a = new Atom(element, x, y);\n\t}\n\n\t// If this is the first atom\n\tif (atoms.length == 0) {\n\t\t// active_atom = a;\n\t\t// a.fabric_atom.set(\"active\", true);\n\t\t// a.get_properties();\n\t\t$(\"#bondBtn\").html(\"Bond!\");\n\t\t$(\"#boSelect\").removeClass(\"hidden\");\n\t\t$(\"#boSelectLabel\").removeClass(\"hidden\");\n\t}\n\n\t// Add atom to the list of atoms\n\tif (id || id == 0) {\n\t\tatoms[id] = a;\n\t} else {\n\t\tatoms.push(a);\n\t}\n\n\t// Add the atom to the formula\n\tif (!formula_dict[element]) {\n\t\tformula_dict[element] = 1;\n\t} else {\n\t\tformula_dict[element] += 1;\n\t}\n\tupdate_formula();\n\n\n\treturn a;\n}", "function anchorFirst(){self.startRow=anchorRow;self.startNode=selection.anchorNode;self.startOffset=selection.anchorOffset;self.endRow=focusRow;self.endNode=selection.focusNode;self.endOffset=selection.focusOffset;}// This function is used when we detect that the \"focus\" node is first.", "function mr(e,t,a,n){if(n){var r=e.anchor;if(a){var f=P(t,r)<0;f!=P(a,r)<0?(r=t,t=a):f!=P(t,a)<0&&(t=a)}return new Di(r,t)}return new Di(a||t,t)}", "getLinkAnchors() {\n const attrs = this.state.attributes;\n const element = this.object._id;\n return [\n {\n element,\n points: [\n {\n x: attrs.x1,\n y: attrs.y1,\n xAttribute: \"x1\",\n yAttribute: \"y1\",\n direction: { x: -1, y: 0 }\n },\n {\n x: attrs.x1,\n y: attrs.y2,\n xAttribute: \"x1\",\n yAttribute: \"y2\",\n direction: { x: -1, y: 0 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x2,\n y: attrs.y1,\n xAttribute: \"x2\",\n yAttribute: \"y1\",\n direction: { x: 1, y: 0 }\n },\n {\n x: attrs.x2,\n y: attrs.y2,\n xAttribute: \"x2\",\n yAttribute: \"y2\",\n direction: { x: 1, y: 0 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x1,\n y: attrs.y1,\n xAttribute: \"x1\",\n yAttribute: \"y1\",\n direction: { x: 0, y: -1 }\n },\n {\n x: attrs.x2,\n y: attrs.y1,\n xAttribute: \"x2\",\n yAttribute: \"y1\",\n direction: { x: 0, y: -1 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x1,\n y: attrs.y2,\n xAttribute: \"x1\",\n yAttribute: \"y2\",\n direction: { x: 0, y: 1 }\n },\n {\n x: attrs.x2,\n y: attrs.y2,\n xAttribute: \"x2\",\n yAttribute: \"y2\",\n direction: { x: 0, y: 1 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.cx,\n y: attrs.y1,\n xAttribute: \"cx\",\n yAttribute: \"y1\",\n direction: { x: 0, y: -1 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.cx,\n y: attrs.y2,\n xAttribute: \"cx\",\n yAttribute: \"y2\",\n direction: { x: 0, y: 1 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x1,\n y: attrs.cy,\n xAttribute: \"x1\",\n yAttribute: \"cy\",\n direction: { x: -1, y: 0 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x2,\n y: attrs.cy,\n xAttribute: \"x2\",\n yAttribute: \"cy\",\n direction: { x: 1, y: 0 }\n }\n ]\n }\n ];\n }", "function addAnchors() {\n // exit if no shape or no layer\n if ( !shape || !shape.getLayer() ) {\n return;\n }\n // get shape group\n var group = shape.getParent();\n // add shape specific anchors to the shape group\n if ( shape instanceof Kinetic.Line ) {\n var points = shape.points();\n if ( points.length === 4 ) {\n updateFunction = dwv.tool.UpdateLine;\n // add shape offset\n var lineBeginX = points[0] + shape.x();\n var lineBeginY = points[1] + shape.y();\n var lineEndX = points[2] + shape.x();\n var lineEndY = points[3] + shape.y();\n addAnchor(group, lineBeginX, lineBeginY, 'begin');\n addAnchor(group, lineEndX, lineEndY, 'end');\n }\n else {\n updateFunction = dwv.tool.UpdateRoi;\n var px = 0;\n var py = 0;\n for ( var i = 0; i < points.length; i=i+2 ) {\n px = points[i] + shape.x();\n py = points[i+1] + shape.y();\n addAnchor(group, px, py, i);\n }\n }\n }\n else if ( shape instanceof Kinetic.Rect ) {\n updateFunction = dwv.tool.UpdateRect;\n var rectX = shape.x();\n var rectY = shape.y();\n var rectWidth = shape.width();\n var rectHeight = shape.height();\n addAnchor(group, rectX, rectY, 'topLeft');\n addAnchor(group, rectX+rectWidth, rectY, 'topRight');\n addAnchor(group, rectX+rectWidth, rectY+rectHeight, 'bottomRight');\n addAnchor(group, rectX, rectY+rectHeight, 'bottomLeft');\n }\n else if ( shape instanceof Kinetic.Ellipse ) {\n updateFunction = dwv.tool.UpdateEllipse;\n var ellipseX = shape.x();\n var ellipseY = shape.y();\n var radius = shape.radius();\n addAnchor(group, ellipseX-radius.x, ellipseY-radius.y, 'topLeft');\n addAnchor(group, ellipseX+radius.x, ellipseY-radius.y, 'topRight');\n addAnchor(group, ellipseX+radius.x, ellipseY+radius.y, 'bottomRight');\n addAnchor(group, ellipseX-radius.x, ellipseY+radius.y, 'bottomLeft');\n }\n // add group to layer\n shape.getLayer().add( group );\n }", "function createAragon(daoAddress = '0x00', options) {\n return new Aragon(daoAddress, _objectSpread({\n apm: {\n ensRegistryAddress: '0x00'\n }\n }, options));\n }", "function InsertAnchor() {\r\n anchorSelectedText = getSelectedText();\r\n anchorSelectedText = anchorSelectedText.toString();\r\n var options = SP.UI.$create_DialogOptions();\r\n options.args = getSelectedText();\r\n options.title = \"Please enter the anchor name\";\r\n options.width = 400;\r\n options.height = 200;\r\n options.y = getTop(200);\r\n options.url = \"/_layouts/BeenJammin.SharePoint.CustomRibbonActions/AnchorDialog.aspx\";\r\n options.dialogReturnValueCallback = Function.createDelegate(null, AnchorCloseCallback);\r\n SP.UI.ModalDialog.showModalDialog(options);\r\n\r\n}", "setCoordinates() {\n while (this.coordinates == null || !this.isWithinShape(this.coordinates)) {\n // Position the circle within the shape\n this.coordinates = createVector(random(width), random(height)); \n } \n }", "function ensureAnchor(expr, start) {\n var _a;\n let { source } = expr;\n let addStart = start && source[0] != \"^\", addEnd = source[source.length - 1] != \"$\";\n if (!addStart && !addEnd)\n return expr;\n return new RegExp(`${addStart ? \"^\" : \"\"}(?:${source})${addEnd ? \"$\" : \"\"}`, (_a = expr.flags) !== null && _a !== void 0 ? _a : (expr.ignoreCase ? \"i\" : \"\"));\n}" ]
[ "0.6890784", "0.6535481", "0.6486419", "0.59145063", "0.59000015", "0.57848835", "0.57848835", "0.57848835", "0.57560533", "0.574368", "0.566826", "0.56567556", "0.5530413", "0.55218136", "0.5476556", "0.5431981", "0.5423774", "0.5341269", "0.53360736", "0.5259411", "0.5200615", "0.51818204", "0.5162876", "0.5151361", "0.5110841", "0.50869745", "0.50853556", "0.5078628", "0.503237", "0.49854666", "0.4968169", "0.49610686", "0.49398047", "0.49285945", "0.49085787", "0.49078435", "0.49004352", "0.4887264", "0.4886068", "0.48795888", "0.48705512", "0.48686525", "0.48424", "0.48091662", "0.4792072", "0.47792536", "0.4767593", "0.47621357", "0.47590643", "0.47590643", "0.47590643", "0.47590643", "0.47449845", "0.47448087", "0.47168416", "0.46815982", "0.46802336", "0.4663584", "0.46559173", "0.46527925", "0.46490318", "0.46462607", "0.46404105", "0.46305174", "0.46273378", "0.4587407", "0.45751685", "0.45710632", "0.45698905", "0.45560807", "0.4554292", "0.4554292", "0.4545811", "0.4545811", "0.45423698", "0.4539376", "0.45349094", "0.45345986", "0.4533884", "0.4530025", "0.45248258", "0.4523223", "0.45230138", "0.45162883", "0.45118183", "0.45099178", "0.45095956", "0.44939694", "0.44914487", "0.4482327", "0.44744194", "0.44738856", "0.44655326", "0.4465328", "0.44622558", "0.44587517", "0.44569507", "0.4453704", "0.4446304", "0.4440957" ]
0.623716
3
normalized screen x and y are in range 0..1, with 0,0 at top left and 1,1 at bottom right
findAnchor(normalizedScreenX, normalizedScreenY, options=null){ // Promise<XRAnchorOffset?> findAnchor(float32, float32); // cast a ray to find or create an anchor at the first intersection in the Reality return this._session.reality._findAnchor(normalizedScreenX, normalizedScreenY, this._session.display, options) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "worldToScreenXY(x, y) {\n return new Vector2D(Math.round(x), Math.round(-y + this.canvas.height));\n }", "normalizeCoords(x: number, y: number) {\n return {\n x: (x - this.im.position.x) / this.im.scale,\n y: (y - this.im.position.y) / this.im.scale,\n };\n }", "screenToWorld(x, y) {\r\n\t\tconst dpr = window.devicePixelRatio || 1;\r\n\t \treturn {\r\n\t\t\tx:(x - this._canvas.width / dpr / 2) / this.zoom + this.posX,\r\n\t\t\tz:(y - this._canvas.height / dpr / 2) / this.zoom + this.posZ\r\n\t\t};\r\n\t}", "screenToWorld(x, y) {\n if (y === undefined) {\n y = x.y;\n x = x.x;\n }\n\n let M = this.ctx.getTransform().invertSelf();\n\n let ret = {\n x: x * M.a + y * M.c + M.e,\n y: x * M.b + y * M.d + M.f,\n };\n\n return ret;\n }", "WorldToScreenX(x) {\n return Math.round((this.center.x + this.scale.px*x));\n }", "xFromScreenBasis(x) {\n return x / this.params.sx * this.smallestScreenEdge() - this.canvas.centre[0]\n }", "ScreenToWorldX(x) {\n return (x - this.center.x + 0.5) / this.scale.px;\n }", "worldToScreen(x, y) {\n if (y === undefined) {\n y = x.y;\n x = x.x;\n }\n\n let M = this.ctx.getTransform();\n\n let ret = {\n x: x * M.a + y * M.c + M.e,\n y: x * M.b + y * M.d + M.f,\n };\n\n return ret;\n }", "function correctCoordinates(x, y) {\n /* Correction for scrolling */\n x += document.body.scrollLeft + document.documentElement.scrollLeft;\n y += document.body.scrollTop + document.documentElement.scrollTop;\n\n /* Correction for canvas position */\n x -= canvas.offsetLeft + 1; /* <-- Weird! */\n y -= canvas.offsetTop;\n\n /* Correction for world's coordinate system */\n x -= camera.x;\n y -= camera.y;\n return new Vec2(x, y);\n }", "xToScreenBasis(x) {\n //return x + this.canvas.centre[0]\n return (x + this.canvas.centre[0]) / this.smallestScreenEdge() * this.params.sx\n }", "@autobind\n toScreenPosition(vec) {\n var targetVec = this.mesh.localToWorld(vec.clone());\n targetVec.project( this.camera );\n targetVec.x = (( targetVec.x ) * (this.windowWidth*0.5)) + (this.windowWidth * 0.5) ;\n targetVec.y = (( targetVec.y * -1 ) * (this.windowHeight*0.5)) + (this.windowHeight * 0.5) ;\n return targetVec;\n }", "function mapPointToScreenSpace(point) {\n\tlet scale = screen_height/(2*camera.zoom);\n\treturn {x:(camera.zoom+point.x)*scale*camera.aspect,y:(camera.zoom-point.y)*scale}\n}", "worldToScreenCoordinates(point) {\n var _a, _b, _c, _d;\n let screenX = point.x;\n let screenY = point.y;\n // shift by focus\n screenX -= (_b = (_a = this._camera) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0;\n screenY -= (_d = (_c = this._camera) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0;\n // transform back on zoom\n screenX = screenX + this.halfDrawWidth;\n screenY = screenY + this.halfDrawHeight;\n // transform back to screen space\n screenX = (screenX * this.viewport.width) / this.drawWidth;\n screenY = (screenY * this.viewport.height) / this.drawHeight;\n return new Vector(Math.floor(screenX), Math.floor(screenY));\n }", "function getPointForPosition(xscreen, yscreen) {\n // figure out the ratio of mouse position to the canvas, for x and y\n var xratio = xscreen / targetWidth;\n var yratio = yscreen / targetHeight;\n var x,y;\n if (fractalType==BURNING_SHIP) {\n // this is rendered so that x and y axis are mirrored\n x = xmax - (xmax - xmin) * xratio;\n y = ymin + (ymax - ymin) * yratio;\n } else {\n x = xmin + (xmax - xmin) * xratio;\n y = ymax - (ymax - ymin) * yratio;\n }\n return new Point(x, y);\n}", "function normPos(x, y, width, height) {\n if (x < 0) {\n x = width - 1;\n y -= 1;\n }\n\n if (y < 0) {\n return [-1, -1];\n }\n\n if (x >= width) {\n x = 0;\n y += 1;\n }\n\n if (y >= height) {\n return [-1, -1];\n }\n\n return [x, y];\n}", "screenToWorldRaw(px, py) {\n if (px == null) return {tx:null, ty:null};\n // first, the top-left pixel of the screen is at |_ scroll * size _| px from origin\n px += Math.floor(this.scrollX * this.size);\n py += Math.floor(this.scrollY * this.size);\n // now we can simply divide and floor to find the tile\n return {\n tx: px / this.size,\n ty: py / this.size\n }\n }", "screenToWorldCoordinates(point) {\n var _a, _b, _c, _d;\n let newX = point.x;\n let newY = point.y;\n // transform back to world space\n newX = (newX / this.viewport.width) * this.drawWidth;\n newY = (newY / this.viewport.height) * this.drawHeight;\n // transform based on zoom\n newX = newX - this.halfDrawWidth;\n newY = newY - this.halfDrawHeight;\n // shift by focus\n newX += (_b = (_a = this._camera) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0;\n newY += (_d = (_c = this._camera) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0;\n return new Vector(Math.floor(newX), Math.floor(newY));\n }", "_makeRelativeSnap() {\n let [x, y] = this._makeRelative.apply(this, arguments);\n\n let grid = this.context.getGrid();\n if (grid) {\n let roundX = round(this.scale.toStepsX(x), grid);\n let roundY = round(this.scale.toStepsY(y), grid);\n x = this.scale.toDistanceX(roundX);\n y = this.scale.toDistanceY(roundY);\n }\n\n return [x, y];\n }", "tile_normalized_coord() {\n\t\tvar rect = this.canvas.getBoundingClientRect();\n\t\tvar x = this.cursor_x - rect.left + this.current_x;\n\t\tvar y = this.cursor_y - rect.top + this.current_y;\n\t\tvar row = y / this.tile_size;\n\t\tvar col = x / this.tile_size;\n\t\treturn [col, row]\n\t}", "function xScreen(x) {\n return (x - xMin) / (xMax - xMin) * canvasGraph.width + 5;\n }", "static WorldPointToSizedRect() {}", "edges()\n\n{\n\tif (this.pos.x > windowWidth + 5) this.pos.x = 0;\n\tif (this.pos.x < 0) this.pos.x = windowWidth;\n\tif (this.pos.y > windowHeight + 5) this.pos.y = 0;\n\tif (this.pos.y < 0) this.pos.y = windowHeight;\n}", "init()\n {\n this.x = this.scene.viewport.width / 2;\n this.y = this.scene.viewport.height / 2;\n }", "function toScreenCoords( point ) {\n if ( ! svgRoot )\n return false;\n point = newSVGPoint(point.x, point.y);\n return point.matrixTransform(svgRoot.getScreenCTM());\n }", "function c_screen(logical)\n{\n // '1 -' because computer display coords are upside down ^_^\n return ((1 - logical) * CHART_HEIGHT)>>0;\n}", "screenToWorld(px, py) {\n const {tx, ty} = this.screenToWorldRaw(px, py)\n if (tx == null) return {tx:null, ty:null}\n else return {tx: Math.floor(tx), ty: Math.floor(ty)}\n }", "yToScreenBasis(y) {\n //return y + this.canvas.centre[1]\n return (y + this.canvas.centre[1]) / this.smallestScreenEdge() * this.params.sy\n }", "function c(c) {\n return Object(_core_screenUtils_js__WEBPACK_IMPORTED_MODULE_1__[\"createScreenPoint\"])(c.x, c.y);\n }", "function showCoords(event) {\n var x = event.screenX; //Applies to the entire screen\n var y = event.screenY; //Applies to the entire screen\n // var x = event.clientX; //Applies to a Div or HTML element\n // var y = event.clientY; //Applies to a Div or HTML element\n console.log(x,y);\n return x,y;\n}", "normalize() {\r\n let length = this.length();\r\n return new Vector2D(this.x / length, this.y / length);\r\n }", "toScreen() \t{return new Point(gMap.mapToScreenX(this._x,this._y),gMap.mapToScreenY(this._x,this._y));}", "function worldToScreen(pos, camera) {\n\t var v = pos.clone();\n\t v.project(camera);\n\t v.x = window.innerWidth / 2 + v.x * (window.innerWidth / 2);\n\t v.y = window.innerHeight / 2 - v.y * (window.innerHeight / 2);\n\t return v;\n\t }", "constructor(x, y){\n super(x, y)\n this.windowBefore = windowSize()\n window.addEventListener('resize', (e)=>{\n const windowNow = windowSize()\n\n this.x = (this.x / this.windowBefore.width) * (windowNow.width)\n this.y = (this.y / this.windowBefore.height) * (windowNow.height)\n this.windowBefore = windowNow\n });\n }", "getScreenViewPort() {\n const rect = this.getScreenActualViewPort();\n if (rect\n && this.isIOS\n && Object.getOwnPropertyNames(rect).length > 0\n && this._args.device.deviceScreenDensity) {\n return {\n x: rect.x / this._args.device.deviceScreenDensity,\n y: rect.y / this._args.device.deviceScreenDensity,\n width: rect.width / this._args.device.deviceScreenDensity,\n height: rect.height / this._args.device.deviceScreenDensity,\n };\n }\n else {\n return rect;\n }\n }", "constructor () {\n this.left = -Infinity;\n this.right = Infinity;\n this.bottom = -Infinity;\n this.top = Infinity;\n }", "function xy2grid(x, y) {\n\tvar normXY = sketch.screentoworld(x, y);\n}", "setpos(x, y) {\n let disX = x - this.w / 2;\n let disY = y - this.h / 2;\n if (disX < 0)\n disX = 0;\n else if (disX > canvas.width - this.w)\n disX = canvas.width - this.w;\n if (disY < 0)\n disY = 0;\n else if (disY > canvas.height - this.w)\n disY = canvas.height - this.w;\n this.x = disX;\n this.y = disY;\n }", "function getLayoutPositionFromXY(x, y) {\n\treturn [(x / WALL_WIDTH) | 0, (y / WALL_HEIGHT) | 0];\n}", "function XY(x,y)\r\n{\r\n \tvar pnt = domSVG.createSVGPoint();\r\n\tpnt.x = x\r\n\tpnt.y = y\r\n\tvar sCTM = domSVG.getScreenCTM();\r\n\tvar PNT = pnt.matrixTransform(sCTM.inverse());\r\n \treturn {x:PNT.x,y:PNT.y}\r\n}", "function Origin(){\n this.x = midWidth;\n this.y = midHeight;\n}", "function planeCoordToAbsScreenPosition(coordX, coordY, offsetX, offsetY) {\n // account for plane's \"origin\" being different than the canvas origin.\n // also account for canvas not starting at 0,0 in document's body.\n // offset var allows for small adjustments\n let screenPosX = (coordX * gridSpacing) + (plane.width / 2) +\n plane.offsetLeft + offsetX;\n let screenPosY = (-1 * coordY * gridSpacing) + (plane.height / 2) +\n plane.offsetTop + offsetY;\n // -1 flips y direction to graphics coord system (pos y goes down)\n\n return {\n x: screenPosX,\n y: screenPosY\n };\n}", "function fixCoordinates(x, y) {\n let newX = (x / outputCanvas.width) * 2 - 1;\n let newY = (y / outputCanvas.height) * 2 - 1;\n return [newX, newY];\n}", "toScreen(x, y, result) {\n result = result || new geom.Point(x, y);\n result.x = this.zoom * (x - this.offset.x);\n result.y = this.zoom * (y - this.offset.y);\n return result;\n }", "translate(offsetX, offsetY) {\n let newPosX = this.position.x + offsetX;\n let newPosY = this.position.y + offsetY;\n\n if (newPosX - this.maxDimension > this.screenWidth) {\n newPosX = 0;\n }\n if (newPosY - this.maxDimension > this.screenHeight) {\n newPosY = 0;\n }\n this.position = { x: newPosX, y: newPosY };\n }", "yFromScreenBasis(y) {\n return y / this.params.sy * this.smallestScreenEdge() - this.canvas.centre[1]\n }", "normalize() {\n\t\tlet m = this.getMagnitude();\n\t\tlet x = 0;\n\t\tlet y = 0\n\t\t\n\t\tif(m !== 0) {\n\t\t\tx = this.x / m;\n\t\t\ty = this.y / m;\n\t\t}\n\t\t\n\t\treturn new Vector(x, y);\n\t}", "get screen() {\n\t\treturn p5.Vector.add(this.start, this.clickable.drag_offset);\n\t}", "normalize() {var m = this.magnitude();return new M.XY(this.x/m,this.y/m);}", "constructor() { \r\n this.x = width / 2;\r\n this.y = screenHeight - screenHeight / 15;\r\n this.w = 9;\r\n this.h = 15;\r\n this.v = 0;\r\n this.image = null;\r\n }", "boundaries() {\n if (this.x - this.w/2 < -this.exceedLimit) this.x = this.w/2 - this.exceedLimit;\n if (this.x + this.w/2 > world.width+this.exceedLimit) this.x = world.width+this.exceedLimit - this.w/2;\n if (this.y - this.h/2 < -this.exceedLimit) this.y = this.h/2 - this.exceedLimit;\n if (this.y + this.h/2 > world.height+this.exceedLimit) this.y = world.height+this.exceedLimit - this.h/2;\n }", "function map_to_screen(map_x, map_y) {\r\n\r\n // adjust to camera position\r\n var calc_x = map_x - cam.x;\r\n var calc_y = map_y - cam.y;\r\n\r\n var screen_x = Math.floor((calc_x - calc_y) * TILE_WIDTH_HALF + CANVAS_WIDTH_HALF);\r\n var screen_y = Math.floor((calc_x + calc_y) * TILE_HEIGHT_HALF + CANVAS_HEIGHT_HALF);\r\n\r\n return {\"x\":screen_x, \"y\":screen_y};\r\n}", "setup() {\r\n\t\tthis.midScreenX = width /2;\r\n\t\tthis.midScreenY = height /2;\r\n\t}", "function isoToScreen(isoPos) {\n\treturn {\n\t\tx: isoPos.h * scale + origin.x,\n\t\ty: -isoPos.v * scale + origin.y,\n\t};\n}", "toScreen(camera)\n\t{\n\t\tlet pos = new NodeGraph.Position(this.x, this.y);\n\n\t\tif (this.worldSpace)\n\t\t{\n\t\t\tpos.x = pos.x * camera.zoomSmooth - camera.xSmooth;\n\t\t\tpos.y = pos.y * camera.zoomSmooth - camera.ySmooth;\n\t\t}\n\n\t\treturn pos;\n\t}", "function setScreen(x, y, c) {\n if (x >= 0 && x < px && y >= 0 && y < py) {\n screen[x][y] = c;\n }\n}", "ScreenToWorldY(y) {\n return -( y - this.center.y + 0.5) / this.scale.py;\n }", "function WorldToLocal(x, y, scale)\n{\n\tvar relativeX = (character.real_x - x)*scale * -1;\n\tvar relativeY = (character.real_y - y)*scale * -1;\n\t\n\treturn {x: relativeX, y: relativeY};\n}", "trackToCoords(_c) {\r\n\t\t\t\tthis.x = _c.x - (SCREEN_WIDTH*0.5)|0;\r\n\t\t\t\tthis.y = _c.y - (SCREEN_HEIGHT*0.5)|0;\r\n\t\t\t}", "WorldToScreenY(y) {\n return Math.round((this.center.y - this.scale.py*y));\n }", "function map_to_screen(map_x, map_y) {\n\n // adjust to camera position\n var calc_x = map_x - cam.x;\n var calc_y = map_y - cam.y;\n\n var screen_x = (calc_x - calc_y) * TILE_WIDTH_HALF + CANVAS_WIDTH_HALF;\n var screen_y = (calc_x + calc_y) * TILE_HEIGHT_HALF + CANVAS_HEIGHT_HALF;\n\n return {\"x\":screen_x, \"y\":screen_y};\n}", "function screenToWorld ( screenPos ) {\n\n var windowHalfX = window.innerWidth / 2;\n var windowHalfY = window.innerHeight / 2;\n\n var worldPos = screenPos.clone();\n worldPos.x = worldPos.x / windowHalfX - 1;\n worldPos.y = - worldPos.y / windowHalfY + 1;\n projector.unprojectVector( worldPos, camera );\n return worldPos; \n}", "constructor ()\n\t{\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t}", "constructor(width=10, height=10, x=0, y=0) {\n this.width = width;\n this.height = height;\n this.x = x;\n this.y = y;\n this.xHitBox = this.width/2\n this.yHitBox = this.height/2\n }", "normalized()\n {\n let normalized = new Vector2(this.x, this.y);\n normalized.divide(normalized.getLength());\n return normalized;\n }", "function Start() {\n\tscreenRect = Rect(0,0,Screen.width, Screen.height);\n}", "function toScreen( position, camera, jqdiv ) {\n\n var pos = position.clone(); \n projScreenMat = new THREE.Matrix4();\n projScreenMat.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );\n pos.applyProjection(projScreenMat);\n\n return { x: ( pos.x + 1 ) * jqdiv.width() / 2 ,\n y: ( pos.y + 1 ) * jqdiv.height()/ 2 };\n\n // return pos;\n }", "function mouseSquare()\n{\n var mouse={x:-1, y:-1} ;\n if ((mouseX/pixelSize) >= 100 && (mouseX/pixelSize) < 900 && \n (mouseY/pixelSize) >= 100 && (mouseY/pixelSize) < 900) {\n mouse.x=Math.floor((mouseX/pixelSize)/100)-1;\n mouse.y=Math.floor((mouseY/pixelSize)/100)-1;\n if (reverse) {\n mouse.x=7-mouse.x;\n mouse.y=7-mouse.y;\n }\n }\n return mouse;\n}", "function normalize_gui_pos(gui_x, gui_y)\n{\n var map_x, map_y, nat_x, nat_y, gui_x0, gui_y0, diff_x, diff_y;\n \n /* Convert the (gui_x, gui_y) into a (map_x, map_y) plus a GUI offset\n * from this tile. */\n var r = gui_to_map_pos(gui_x, gui_y);\n map_x = r['map_x'];\n map_y = r['map_y'];\n\n \n var s = map_to_gui_pos(map_x, map_y);\n gui_x0 = s['gui_dx'];\n gui_y0 = s['gui_dy'];\n \n diff_x = gui_x - gui_x0;\n diff_y = gui_y - gui_y0;\n \n \n /* Perform wrapping without any realness check. It's important that\n * we wrap even if the map position is unreal, which normalize_map_pos\n * doesn't necessarily do. */\n var t = MAP_TO_NATIVE_POS(map_x, map_y);\n nat_x = t['nat_x'];\n nat_y = t['nat_y'];\n \n if (topo_has_flag(TF_WRAPX)) {\n nat_x = FC_WRAP(nat_x, map['xsize']);\n }\n if (topo_has_flag(TF_WRAPY)) {\n nat_y = FC_WRAP(nat_y, map['ysize']);\n }\n \n var u = NATIVE_TO_MAP_POS(nat_x, nat_y);\n map_x = u['map_x'];\n map_y = u['map_y']; \n\n /* Now convert the wrapped map position back to a GUI position and add the\n * offset back on. */\n var v = map_to_gui_pos(map_x, map_y);\n gui_x = v['gui_dx'];\n gui_y = v['gui_dy'];\n\n gui_x += diff_x;\n gui_y += diff_y;\n\n return {'gui_x' : gui_x, 'gui_y' : gui_y}; \n}", "function world2Screen(wrapper, aX = 0, aY = 0, aZ = 0) {\n if (window.camera != null) {\n // Get the 3d position\n var vec = wrapper.getWorldPosition();\n // Add the delta\n vec.y += aY;\n vec.x += aX;\n vec.z += aZ\n // Project it on the camera\n var newVector = vec.project(window.camera);\n // Calculate the 2d contex\n newVector.x = (vec.x + 1) / 2 * window.ctx.canvas.width;\n newVector.y = - (vec.y - 1) / 2 * window.ctx.canvas.height;\n /// Now, lets check if it's in the screen\n // Get camera pos and target\n var cameraPos = window.camera.getWorldPosition()\n var targetPos = wrapper.getWorldPosition();\n // Add delta\n targetPos.x += aX;\n targetPos.y += aY;\n targetPos.z += aZ;\n // Get where we are looking\n var lookat = window.camera.getWorldDirection();\n var pos = targetPos.sub(cameraPos)\n // Check if it is not in the camera's view\n if (pos.angleTo(lookat) > (Math.PI / 2)) {\n // If not, invert X (yes, if it's on in the camera's view, x and y get inverted)\n newVector.x *= -1;\n // Put the y on the bottom\n newVector.y = 1000;\n }\n // Return this shit\n return newVector;\n } return null;\n}", "function fromCoordSystem(cm, coords, context) {\n\t\t if (context == \"div\") return coords;\n\t\t var left = coords.left, top = coords.top;\n\t\t // First move into \"page\" coordinate system\n\t\t if (context == \"page\") {\n\t\t left -= pageScrollX();\n\t\t top -= pageScrollY();\n\t\t } else if (context == \"local\" || !context) {\n\t\t var localBox = cm.display.sizer.getBoundingClientRect();\n\t\t left += localBox.left;\n\t\t top += localBox.top;\n\t\t }\n\t\t\n\t\t var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n\t\t return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n\t\t }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function windowToCavasCoordinates(canvas, x, y) {\n var boundingBox = canvas.getBoundingClientRect();\n\n return {x: x - boundingBox.left * (canvas.width / boundingBox.width),\n y: y - boundingBox.top * (canvas.height / boundingBox.height)};\n}", "function fromCoordSystem(cm, coords, context) {\r\n if (context == \"div\") return coords;\r\n var left = coords.left, top = coords.top;\r\n // First move into \"page\" coordinate system\r\n if (context == \"page\") {\r\n left -= pageScrollX();\r\n top -= pageScrollY();\r\n } else if (context == \"local\" || !context) {\r\n var localBox = cm.display.sizer.getBoundingClientRect();\r\n left += localBox.left;\r\n top += localBox.top;\r\n }\r\n\r\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\r\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\r\n }", "x(worldX) {\n\t\treturn worldX - this.viewRectX0;\n\t}", "getBlockIndex(screenX, screenY) {\n let col = Math.floor(screenX * this.col / window.innerWidth);\n let row = Math.floor(screenY * this.row / window.innerHeight);\n return [row, col];\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") {\n return coords;\n }\n\n var left = coords.left,\n top = coords.top; // First move into \"page\" coordinate system\n\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {\n left: left - lineSpaceBox.left,\n top: top - lineSpaceBox.top\n };\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = getRect(cm.display.sizer);\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = getRect(cm.display.lineSpace);\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = getRect(cm.display.sizer);\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = getRect(cm.display.lineSpace);\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = getRect(cm.display.sizer);\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = getRect(cm.display.lineSpace);\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = getRect(cm.display.sizer);\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = getRect(cm.display.lineSpace);\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function Start () {\n\nlarguraBotao = 120;//largura predefinida do botao\nalturaBotao = 30;//altura predefinida do botao\n\nposiX = (Screen.width - Screen.width);//Tratando o eixo x\nposiY = (Screen.height - Screen.height);//Tratando o eixo y\n\n}", "function Browser_GetScreenCoordinates(event)\n{\n\t//create and return a point\n\tvar point = { x: 0, y: 0 };\n\t//has touch?\n\tif (window.__BROWSER_IS_TOUCH_ENABLED && event.targetTouches && event.targetTouches.length > 0)\n\t{\n\t\t//set points as per touch\n\t\tpoint.x = event.targetTouches[0].screenX;\n\t\tpoint.y = event.targetTouches[0].screenY;\n\t}\n\telse\n\t{\n\t\t//set directly\n\t\tpoint.x = event.screenX;\n\t\tpoint.y = event.screenY;\n\t}\n\t//return our point\n\treturn point;\n}", "function inLocalScale(point) {\n\n var viewbox = canvas.viewbox();\n\n return {\n x: round(point.x / viewbox.scale),\n y: round(point.y / viewbox.scale)\n };\n }", "documentToWorld(x, y) {\n // We create a 2D vector\n var vector = new THREE.Vector2();\n // We set its position where the user clicked and we convert it to a number between -1 & 1\n vector.set(\n 2 * ((x - this._offset.left) / this._w) - 1,\n 1 - 2 * ((y - this._offset.top) / this._h)\n );\n\n return vector;\n }", "function toScreenPosition(obj, camera, renderer){\n var vector = new THREE.Vector3();\n\n var widthHalf = 0.5*renderer.context.canvas.width;\n var heightHalf = 0.5*renderer.context.canvas.height;\n\n obj.updateMatrixWorld();\n vector.setFromMatrixPosition(obj.matrixWorld);\n vector.project(camera);\n\n vector.x = ( vector.x * widthHalf ) + widthHalf;\n vector.y = - ( vector.y * heightHalf ) + heightHalf;\n\n return {\n x: vector.x,\n y: vector.y\n };\n}", "pointList() {\n let bottom = this.bottom.screen,\n top = this.top.screen;\n\n return [bottom.x - bottom.w, bottom.y,\n bottom.x + bottom.w, bottom.y,\n top.x + top.w, top.y,\n top.x - top.w, top.y];\n }", "computeCenter() {\n self.centerX = self.screenX + self.screenDisplacementX;\n self.centerY = self.screenY + self.screenDisplacementY;\n }", "function xCoord() {\r\n var min = Math.ceil(120);\r\n var max = Math.floor(cWidth - 120);\r\n return Math.floor(Math.random() * (max - min) + min);\r\n }", "offscreen(){return this.x < -this.w}", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }" ]
[ "0.74771494", "0.7027409", "0.69512177", "0.68741554", "0.680003", "0.6781072", "0.67347944", "0.6701663", "0.66424936", "0.6589856", "0.65289354", "0.6524923", "0.6500318", "0.64919496", "0.64755785", "0.6432975", "0.64243615", "0.63446456", "0.63126266", "0.6276747", "0.62696004", "0.62589115", "0.6251502", "0.62430483", "0.6241467", "0.62244385", "0.61976147", "0.6195277", "0.61745197", "0.6126644", "0.6117282", "0.61150724", "0.6113219", "0.610574", "0.6098918", "0.6092549", "0.6091146", "0.60909265", "0.6079674", "0.6069851", "0.6047353", "0.6042688", "0.60370404", "0.60349697", "0.6018017", "0.6011428", "0.600096", "0.5985843", "0.59769356", "0.5960016", "0.59545845", "0.59461474", "0.5925255", "0.5907804", "0.5906593", "0.58942896", "0.58863485", "0.5854047", "0.58477366", "0.58433026", "0.58404154", "0.58340544", "0.582739", "0.5819528", "0.58168846", "0.58091336", "0.580395", "0.57982326", "0.57947767", "0.57944804", "0.5794209", "0.5794209", "0.5794209", "0.5794209", "0.5794209", "0.5794209", "0.5794209", "0.5794209", "0.57918197", "0.57876", "0.5776332", "0.5776281", "0.5771153", "0.57705534", "0.57705534", "0.57705534", "0.57705534", "0.57697576", "0.5769236", "0.5762459", "0.5761751", "0.57615286", "0.5761036", "0.57561356", "0.5745752", "0.5745275", "0.57398504", "0.57398504", "0.57398504", "0.57398504", "0.57398504" ]
0.0
-1
Find an XRAnchorOffset that is at floor level below the current head pose uid will be the resulting anchor uid (if any), or if null one will be assigned
findFloorAnchor(uid=null){ // Promise<XRAnchorOffset?> findFloorAnchor(); return this._session.reality._findFloorAnchor(this._session.display, uid) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_findFloorAnchor(display, uid=null){\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tresolve(null)\n\t\t})\n\t}", "absAnchorOut(nid) {\n const ltd = this.lastTreeData;\n if (ltd && (nid in ltd)) {\n const ndata = ltd[nid];\n return {\n x: ndata.position.x + ndata.anchorOut.x,\n y: ndata.position.y + ndata.anchorOut.y\n }\n }\n return {x: 0, y: 0};\n }", "_findAnchor(normalizedScreenX, normalizedScreenY, display){\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif(this._arKitWrapper !== null){\t\n\t\t\t\t// Perform a hit test using the ARKit integration\n\t\t\t\tthis._arKitWrapper.hitTest(normalizedScreenX, normalizedScreenY, ARKitWrapper.HIT_TEST_TYPE_EXISTING_PLANES).then(hits => {\n\t\t\t\t\tif(hits.length === 0){\n\t\t\t\t\t\tresolve(null)\n\t\t\t\t\t\t// console.log('miss')\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst hit = this._pickARKitHit(hits)\n\t\t\t\t\thit.anchor_transform[13] += XRViewPose.SITTING_EYE_HEIGHT\n\t\t\t\t\thit.world_transform[13] += XRViewPose.SITTING_EYE_HEIGHT\n\n\t\t\t\t\t// Use the first hit to create an XRAnchorOffset, creating the XRAnchor as necessary\n\n\t\t\t\t\t// TODO use XRPlaneAnchor for anchors with extents\n\n\t\t\t\t\tlet anchor = this._getAnchor(hit.uuid)\n\t\t\t\t\tif(anchor === null){\n\t\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\t\tcoordinateSystem._relativeMatrix = hit.anchor_transform\n\t\t\t\t\t\tanchor = new XRAnchor(coordinateSystem, hit.uuid)\n\t\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\t\t\t\t\t}\n\n\t\t\t\t\tconst offsetPosition = [\n\t\t\t\t\t\thit.world_transform[12] - hit.anchor_transform[12],\n\t\t\t\t\t\thit.world_transform[13] - hit.anchor_transform[13],\n\t\t\t\t\t\thit.world_transform[14] - hit.anchor_transform[14]\n\t\t\t\t\t]\n\t\t\t\t\tconst worldRotation = new Quaternion().setFromRotationMatrix(hit.world_transform)\n\t\t\t\t\tconst inverseAnchorRotation = new Quaternion().setFromRotationMatrix(hit.anchor_transform).inverse()\n\t\t\t\t\tconst offsetRotation = new Quaternion().multiplyQuaternions(worldRotation, inverseAnchorRotation)\n\t\t\t\t\tconst anchorOffset = new XRAnchorOffset(anchor.uid)\n\t\t\t\t\tanchorOffset.poseMatrix = MatrixMath.mat4_fromRotationTranslation(new Float32Array(16), offsetRotation.toArray(), offsetPosition)\n\t\t\t\t\tresolve(anchorOffset)\n\t\t\t\t})\n\t\t\t} else if(this._vrDisplay !== null){\n\t\t\t\t// Perform a hit test using the ARCore data\n\t\t\t\tlet hits = this._vrDisplay.hitTest(normalizedScreenX, normalizedScreenY)\n\t\t\t\tif(hits.length == 0){\n\t\t\t\t\tresolve(null)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\thits.sort((a, b) => a.distance - b.distance)\n\t\t\t\tlet anchor = this._getAnchor(hits[0].uuid)\n\t\t\t\tif(anchor === null){\n\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\tcoordinateSystem._relativeMatrix = hits[0].modelMatrix\n\t\t\t\t\tcoordinateSystem._relativeMatrix[13] += XRViewPose.SITTING_EYE_HEIGHT\n\t\t\t\t\tanchor = new XRAnchor(coordinateSystem)\n\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\t\t\t\t}\n\t\t\t\tresolve(new XRAnchorOffset(anchor.uid))\n\t\t\t} else {\n\t\t\t\tresolve(null) // No platform support for finding anchors\n\t\t\t}\n\t\t})\n\t}", "_findAnchor(normalizedScreenX, normalizedScreenY, display, testOptions=null){\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif(this._arKitWrapper !== null){\t\n\t\t\t\t// Perform a hit test using the ARKit integration\n\t\t\t\tthis._arKitWrapper.hitTest(normalizedScreenX, normalizedScreenY, testOptions || ARKitWrapper.HIT_TEST_TYPE_EXISTING_PLANES).then(hits => {\n\t\t\t\t\tif(hits.length === 0){\n\t\t\t\t\t\tresolve(null)\n\t\t\t\t\t\t// console.log('miss')\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst hit = this._pickARKitHit(hits)\n\n\t\t\t\t\t// if it's a plane\n\t\t\t\t\tif (hit.anchor_transform) {\n\t\t\t\t\t\thit.anchor_transform[13] += XRViewPose.SITTING_EYE_HEIGHT\n\t\t\t\t\t\thit.world_transform[13] += XRViewPose.SITTING_EYE_HEIGHT\n\n\t\t\t\t\t\t// Use the first hit to create an XRAnchorOffset, creating the XRAnchor as necessary\n\n\t\t\t\t\t\t// TODO use XRPlaneAnchor for anchors with extents; hopefully the plane will have been created, tho\n\t\t\t\t\t\tlet anchor = this._getAnchor(hit.uuid)\n\t\t\t\t\t\tif(anchor === null){\n\t\t\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\t\t\tcoordinateSystem._relativeMatrix = hit.anchor_transform\n\t\t\t\t\t\t\tanchor = new XRAnchor(coordinateSystem, hit.uuid)\n\t\t\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst offsetPosition = [\n\t\t\t\t\t\t\thit.world_transform[12] - hit.anchor_transform[12],\n\t\t\t\t\t\t\thit.world_transform[13] - hit.anchor_transform[13],\n\t\t\t\t\t\t\thit.world_transform[14] - hit.anchor_transform[14]\n\t\t\t\t\t\t]\n\t\t\t\t\t\tconst worldRotation = new Quaternion().setFromRotationMatrix(hit.world_transform)\n\t\t\t\t\t\tconst inverseAnchorRotation = new Quaternion().setFromRotationMatrix(hit.anchor_transform).inverse()\n\t\t\t\t\t\tconst offsetRotation = new Quaternion().multiplyQuaternions(worldRotation, inverseAnchorRotation)\n\t\t\t\t\t\tconst anchorOffset = new XRAnchorOffset(anchor.uid)\n\t\t\t\t\t\tanchorOffset.poseMatrix = MatrixMath.mat4_fromRotationTranslation(new Float32Array(16), offsetRotation.toArray(), offsetPosition)\n\t\t\t\t\t\tresolve(anchorOffset)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\t\tcoordinateSystem._relativeMatrix = hit.world_transform\n\t\t\t\t\t\tconst anchor = new XRAnchor(coordinateSystem, hit.uuid)\n\t\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\n\t\t\t\t\t\tconst anchorOffset = new XRAnchorOffset(anchor.uid)\n\t\t\t\t\t\tresolve(anchorOffset)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} else if(this._vrDisplay !== null){\n\t\t\t\t// Perform a hit test using the ARCore data\n\t\t\t\tlet hits = this._vrDisplay.hitTest(normalizedScreenX, normalizedScreenY)\n\t\t\t\tif(hits.length == 0){\n\t\t\t\t\tresolve(null)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\thits.sort((a, b) => a.distance - b.distance)\n\t\t\t\tlet anchor = this._getAnchor(hits[0].uuid)\n\t\t\t\tif(anchor === null){\n\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\tcoordinateSystem._relativeMatrix = hits[0].modelMatrix\n\t\t\t\t\tcoordinateSystem._relativeMatrix[13] += XRViewPose.SITTING_EYE_HEIGHT\n\t\t\t\t\tanchor = new XRAnchor(coordinateSystem)\n\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\t\t\t\t}\n\t\t\t\tresolve(new XRAnchorOffset(anchor.uid))\n\t\t\t} else {\n\t\t\t\tresolve(null) // No platform support for finding anchors\n\t\t\t}\n\t\t})\n\t}", "getAnchor(uid){\n\t\t// XRAnchor? getAnchor(DOMString uid);\n\t\treturn this._session.reality._getAnchor(uid)\n\t}", "function cardChildrenAdjustForAnchor(card, anchorX, anchorY){\n\n //****CARD CHILD LOCATION*****\n // 0 - TOP LEFT CORNER - ATTACK\n // 1 - TOP RIGHT CORNER - HP\n // 2 - BOTTOM LEFT CORNER - ACTION POINTS\n // 3 - CARD TITLE (will need to move to 4 or 5)\n // 4 - CARD IMAGE\n\n var rectangle = card.getLocalBounds();\n\n var child = card.getChildAt(0);\n child.position.x = topLeftAttributeSlotXOffset - getXOffsetFromCenterForText(playerCards[card.id].attack, cardAttributeFontCharSize) - (rectangle.width * anchorX);\n child.position.y = topLeftAttributeSlotYOffset - cardAttributeFontCharSize - (rectangle.height * anchorY);\n\n\n var child = card.getChildAt(1);\n child.position.x = topRightAttributeSlotXOffset - getXOffsetFromCenterForText(playerCards[card.id].health, cardAttributeFontCharSize) - (rectangle.width * anchorX);\n child.position.y = topRightAttributeSlotYOffset - cardAttributeFontCharSize - (rectangle.height * anchorY);\n\n\n var child = card.getChildAt(2); \n child.position.x = botLeftAttributeSlotXOffset - getXOffsetFromCenterForText(playerCards[card.id].remMoves, cardAttributeFontCharSize) - (rectangle.width * anchorX);\n child.position.y = botLeftAttributeSlotYOffset - cardAttributeFontCharSize - (rectangle.height * anchorX);\n \n\n var child = card.getChildAt(3); \n child.position.x = cardFrameOriginalWidth/2 - cardImageWidth / 2 - (rectangle.width * anchorX);\n child.position.y = 0 - (rectangle.height * anchorY) + 200;\n\n\n var child = card.getChildAt(4); \n child.position.x = cardFrameOriginalWidth/2 - getXOffsetFromCenterForText(playerCards[card.id].name, cardTitleFontCharSize) - (rectangle.width * anchorX);\n child.position.y = 0 - (rectangle.height * anchorY) + 100;\n }", "function addAnchorR() {\n var pole = addStreetPostsR();\n\n pole.lightPost.position.z = -4770;\n pole.light.position.z = -4770;\n}", "function findAnchorPoint(shp, arcs) {\n var maxPath = shp && geom.getMaxPath(shp, arcs),\n pathBounds = maxPath && arcs.getSimpleShapeBounds(maxPath),\n thresh, simple;\n if (!pathBounds || !pathBounds.hasBounds() || pathBounds.area() === 0) {\n return null;\n }\n // Optimization: quickly simplify using a relatively small distance threshold.\n // (testing multiple candidate points can be very slow for large and detailed\n // polgons; simplification alleviates this)\n // Caveat: In rare cases this could cause poor point placement, e.g. if\n // simplification causes small holes to be removed.\n thresh = Math.sqrt(pathBounds.area()) * 0.01;\n simple = simplifyPolygonFast(shp, arcs, thresh);\n if (!simple.shape) {\n return null; // collapsed shape\n }\n return findAnchorPoint2(simple.shape, simple.arcs);\n }", "head(){\n if(this.keypoints['nose'] && this.headCenter && this.shoulderCenter){\n var x = this.keypoints['nose'].x;\n var y = this.keypoints['nose'].y;\n // get nose relative points from origin\n x = (this.headCenter.x - x)/(this.distance/15);\n y = this.shoulderCenter.y - y;\n // normalize (i.e. scale it)\n y = this.map(y,this.distance*1.5,this.distance*2.8,-2,2);\n // console.log(140/this.distance,260/this.distance);\n this.joints.update('head', { x, y });\n return { x, y };\n }\n }", "function OLgetRefOffsets(mkObj){\r\nvar mc=o3_refc.toUpperCase(),mp=o3_refp.toUpperCase(),mW=mH=pW=pH=0,off=[0,0];\r\npW=(OLbubblePI&&o3_bubble)?o3_width:OLns4?over.clip.width:over.offsetWidth;\r\npH=(OLbubblePI&&o3_bubble)?OLbubbleHt:OLns4?over.clip.height:over.offsetHeight;\r\nif((!OLop7)&&mkObj.toString().indexOf('Image')!= -1){mW=mkObj.width;mH=mkObj.height;\r\n}else if((!OLop7)&&mkObj.toString().indexOf('Anchor')!= -1){mc=o3_refc='UL';}else{\r\nmW=(OLns4)?mkObj.clip.width:mkObj.offsetWidth;mH=(OLns4)?mkObj.clip.height:mkObj.offsetHeight;}\r\nif(mc=='UL'){off=(mp=='UR')?[-pW,0]:(mp=='LL')?[0,-pH]:(mp=='LR')?[-pW,-pH]:[0,0];\r\n}else if(mc=='UR'){off=(mp=='UR')?[mW-pW,0]:(mp=='LL')?[mW,-pH]:(mp=='LR')?[mW-pW,-pH]:[mW,0];\r\n}else if(mc=='LL'){off=(mp=='UR')?[-pW,mH]:(mp=='LL')?[0,mH-pH]:(mp=='LR')?[-pW,mH-pH]:[0,mH];\r\n}else if(mc=='LR'){off=(mp=='UR')?[mW-pW,mH]:(mp=='LL')?[mW,mH-pH]:(mp=='LR')?[mW-pW,mH-pH]:\r\n[mW,mH];}\r\nreturn off;\r\n}", "matchBefore(expr) {\n let line = this.state.doc.lineAt(this.pos);\n let start = Math.max(line.from, this.pos - 250);\n let str = line.text.slice(start - line.from, this.pos - line.from);\n let found = str.search(ensureAnchor(expr, false));\n return found < 0 ? null : { from: start + found, to: this.pos, text: str.slice(found) };\n }", "function getAnchor() {\n\t\t\tvar test = $('.pinContent').text();\n\t\t\treturn new Microsoft.Maps.Point(0, 33)\n\t\t}", "function getAvatarFootOffset() {\n var data = getJointData();\n var upperLeg, lowerLeg, foot, toe, toeTop;\n data.forEach(function(d) {\n\n var jointName = d.joint;\n if (jointName === \"RightUpLeg\") {\n upperLeg = d.translation.y;\n }\n if (jointName === \"RightLeg\") {\n lowerLeg = d.translation.y;\n }\n if (jointName === \"RightFoot\") {\n foot = d.translation.y;\n }\n if (jointName === \"RightToeBase\") {\n toe = d.translation.y;\n }\n if (jointName === \"RightToe_End\") {\n toeTop = d.translation.y;\n }\n })\n\n var offset = upperLeg + lowerLeg + foot + toe + toeTop;\n offset = offset / 100;\n return offset;\n}", "_createImageAnchor(uid, buffer, width, height, physicalWidthInMeters) {\n\t\tif (this._arKitWrapper) {\n return this._arKitWrapper.createImageAnchor(uid, buffer, width, height, physicalWidthInMeters)\n } else {\n\t\t\treturn null;\n\t\t}\n\t}", "get anchor() {\n return new FudgeCore.Vector3(this.jointAnchor.x, this.jointAnchor.y, this.jointAnchor.z);\n }", "function checkAnchorOnScroll(){\n \"use strict\";\n\n if($j('[data-q_id]').length && !$j('header.page_header').hasClass('regular')){\n $j('[data-q_id]').waypoint( function(direction) {\n\t\t\tif(direction === 'down') {\n changeActiveState($j(this).data(\"q_id\"));\n }\n }, { offset: '50%' });\n\n $j('[data-q_id]').waypoint( function(direction) {\n if(direction === 'up') {\n changeActiveState($j(this).data(\"q_id\"));\n }\n }, { offset: function(){\n return -($j(this).outerHeight() - 150);\n } });\n }\n}", "function getOffset() {\n\t\t\tif (!vm.current) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t//console.log(vm.getRank(vm.current));\n\t\t\treturn (vm.getRank(vm.current) - 2) * 17;\n\t\t}", "updateNodeFromAnchorOffset(frame, node, anchorOffset){\n\t\tconst anchor = frame.getAnchor(anchorOffset.anchorUID)\n\t\tif(anchor === null){\n\t\t\tthrottledConsoleLog('Unknown anchor uid', anchorOffset.anchorUID)\n\t\t\tthis.anchoredNodeRemoved(node);\n\t\t\tthis.removeAnchoredNode(node);\n\t\t\treturn\n\t\t}\n\t\tnode.matrixAutoUpdate = false\n\t\tnode.matrix.fromArray(anchorOffset.getOffsetTransform(anchor.coordinateSystem))\n\t\tnode.updateMatrixWorld(true)\n\t}", "findAnchor(normalizedScreenX, normalizedScreenY, options=null){\n\t\t// Promise<XRAnchorOffset?> findAnchor(float32, float32); // cast a ray to find or create an anchor at the first intersection in the Reality\n\t\treturn this._session.reality._findAnchor(normalizedScreenX, normalizedScreenY, this._session.display, options)\n\t}", "function getNativeAnchorNode(parentTNode, lView) {\n if (parentTNode.type === 2 /* View */) {\n var lContainer = getLContainer(parentTNode, lView);\n var index = lContainer.indexOf(lView, CONTAINER_HEADER_OFFSET) - CONTAINER_HEADER_OFFSET;\n return getBeforeNodeForView(index, lContainer);\n }\n else if (parentTNode.type === 4 /* ElementContainer */ ||\n parentTNode.type === 5 /* IcuContainer */) {\n return getNativeByTNode(parentTNode, lView);\n }\n return null;\n}", "function findAncestorOffsetKey(node){var searchNode=node;while(searchNode&&searchNode!==document.documentElement){var key=getSelectionOffsetKeyForNode(searchNode);if(key!=null){return key;}searchNode=searchNode.parentNode;}return null;}", "function hFindPos(obj) {\n 'use strict';\n var curtop = 0;\n if (obj.offsetParent) {\n do {\n curtop += obj.offsetTop;\n } while (obj = obj.offsetParent); // jshint ignore:line\n }\n return curtop;\n}", "get $cursor() {\n return this.$anchor.pos == this.$head.pos ? this.$head : null;\n }", "function detectNextBlock_CurrentLeftUp(x,y,h,w)\n {\n var mapCoordY = (y)/ h;\n var mapCoordX = (x) / w;\n \n mapCoordX = Math.floor(mapCoordX);\n mapCoordY = Math.floor(mapCoordY);\n \n return map[mapCoordY-1][mapCoordX-1]; \n }", "get above(){\n return Coord.QRT(this._q,this._r,this._t+1);\n }", "function calculateTop( startingPoint, floorHeight, floor ){\n return startingPoint - (( floorHeight + 10 ) * floor );\n}", "function findAnchorPoint2(shp, arcs) {\n var maxPath = geom.getMaxPath(shp, arcs);\n var pathBounds = arcs.getSimpleShapeBounds(maxPath);\n var centroid = geom.getPathCentroid(maxPath, arcs);\n var weight = getPointWeightingFunction(centroid, pathBounds);\n var area = geom.getPlanarPathArea(maxPath, arcs);\n var hrange, lbound, rbound, focus, htics, hstep, p, p2;\n\n // Limit test area if shape is simple and squarish\n if (shp.length == 1 && area * 1.2 > pathBounds.area()) {\n htics = 5;\n focus = 0.2;\n } else if (shp.length == 1 && area * 1.7 > pathBounds.area()) {\n htics = 7;\n focus = 0.4;\n } else {\n htics = 11;\n focus = 0.5;\n }\n hrange = pathBounds.width() * focus;\n lbound = centroid.x - hrange / 2;\n rbound = lbound + hrange;\n hstep = hrange / htics;\n\n // Find a best-fit point\n p = probeForBestAnchorPoint(shp, arcs, lbound, rbound, htics, weight);\n if (!p) {\n verbose(\"[points inner] failed, falling back to centroid\");\n p = centroid;\n } else {\n // Look for even better fit close to best-fit point\n p2 = probeForBestAnchorPoint(shp, arcs, p.x - hstep / 2,\n p.x + hstep / 2, 2, weight);\n if (p2.distance > p.distance) {\n p = p2;\n }\n }\n return p;\n }", "function addAnchorL() {\n var pole = addStreetPostsL();\n\n pole.lightPost.position.z = -4770;\n pole.light.position.z = -4770;\n}", "getAnchor() {\n this._assertInitialized();\n return this.marker;\n }", "function offsetAnchor() {\n if (location.hash.length !== 0) {\n window.scrollTo(window.scrollX, window.scrollY - 110);\n }\n}", "calcOffsetConstraintForHorizontalMode() {\n let viewport = getViewportDimension();\n let offsetToViewport = calcOffsetToViewport(this.props.baseEl.offsetParent);\n let height = this.props.height || DEFAULT_HEIGHT;\n\n return {\n min: -offsetToViewport.top,\n max: viewport.height - height - offsetToViewport.top\n };\n }", "_faceOffset50(face)\n {\n switch(face) {\n case 1:\n return {dy: 0, dx: 50};\n case 2:\n return {dy: 0, dx: 100};\n case 3:\n return {dy: 50, dx: 50};\n case 4:\n return {dy: 100, dx: 0};\n case 5:\n return {dy: 100, dx: 50};\n case 6:\n return {dy: 150, dx: 0};\n }\n return undefined;\n }", "function getAnchor(element) {\n if (!element) {\n return null;\n }\n\n var anchor = element.getAttribute('data-anchor');\n var elementIndex = index(element); //Slide without anchor link? We take the index instead.\n\n if (anchor == null) {\n anchor = elementIndex;\n }\n\n return anchor;\n }", "function detectNextBlock_UpLeft (x,y,h,w)\n {\n var mapCoordY = (y - 1)/ h;\n var mapCoordX = (x ) / w;\n \n mapCoordX = Math.floor(mapCoordX);\n mapCoordY = Math.floor(mapCoordY);\n \n return map[mapCoordY-1][mapCoordX-1];\n \n }", "function AnchorPosition_getPageOffsetLeft (el) {\r\n\tvar ol=el.offsetLeft;\r\n\twhile ((el=el.offsetParent) != null) { ol += el.offsetLeft; }\r\n\treturn ol;\r\n\t}", "lookAt( t ) {\n var head = this.skeleton.bones[this.body.head];\n\n // calc target pos in coordinate system of head\n var totalPos = this.parentMesh.position.add(this.rootMesh.position);\n var totalRot = this.rootMesh.rotationQuaternion.multiply(this.parentMesh.rotationQuaternion);\n var target = new BABYLON.Vector3( t.x, t.y, t.z ).subtract(totalPos);\n\n target.rotateByQuaternionToRef(BABYLON.Quaternion.Inverse(totalRot),target);\n\n // CHECKME: exact calculus?\n //var targetVector = target.subtract(this.headPos()).add(totalPos);\n var targetVector = target.subtract(this.headPos());\n if ( this.headAxisFix == -1 ) {\n // FIX: neck and head opposite orientation\n // businessman, robot, adventurer, unreal male\n targetVector.y = -targetVector.y;\n }\n targetVector.rotateByQuaternionToRef(this.headQuatInv,targetVector);\n // this results in weird head positions, more natural-looking fix applied after\n //targetVector.rotateByQuaternionToRef(this.headQuat.multiply(this.neckQuatInv),targetVector);\n\n var rotationMatrix = new BABYLON.Matrix();\n\n BABYLON.Matrix.RotationAlignToRef(this.headTarget, targetVector.normalizeToNew(), rotationMatrix);\n var quat = BABYLON.Quaternion.FromRotationMatrix(rotationMatrix);\n\n if ( this.headAxisFix != 1 ) {\n // FIX: neck and head opposite or under angle\n // boris, businessman, robot, adventurer, unreal male\n var fix = this.headQuat.multiply(this.neckQuatInv);\n quat = quat.multiply(fix);\n }\n\n head.getTransformNode().rotationQuaternion = quat;\n }", "function getOffsetElement(el) {\n return el\n ? 'offsetTop' in el\n ? el\n : getOffsetElement(el.parentNode)\n : document.body;\n }", "function getIndicatorBorderPoint(indicator, screenW, screenH, cameraPos) {\n let x = 0;\n let y = 0;\n\n let toTarget = V.mul(V.sub(indicator.point, cameraPos), 1000);\n\n let borders = [\n { x: MARGIN, y: MARGIN, tX: screenW - MARGIN, tY: MARGIN },\n { x: screenW - MARGIN, y: MARGIN, tX: screenW - MARGIN, tY: screenH - MARGIN },\n { x: screenW - MARGIN, y: screenH - MARGIN, tX: MARGIN, tY: screenH - MARGIN },\n { x: MARGIN, y: screenH - MARGIN, tX: MARGIN, tY: MARGIN }\n ];\n\n _.each(borders, (line) => {\n let center = { x: screenW / 2, y: screenH / 2 };\n let arrow = {\n x: center.x, y: center.y, tX: toTarget.x + center.x, tY: toTarget.y + center.y\n };\n let result = linesIntersect(arrow.x, arrow.y, arrow.tX, arrow.tY, line.x, line.y, line.tX, line.tY);\n if (result.intersects) {\n x = result.x;\n y = result.y;\n return false; // terminate loop\n }\n });\n\n return { x, y };\n}", "headPos() {\n // FIXME this is way suboptimal as it forces computation\n this.head().getTransformNode().computeWorldMatrix(true);\n var headPos = this.head().getTransformNode().getAbsolutePosition();\n return headPos.clone();\n }", "function offsetAnchor() {\r\n\tif (location.hash.length !== 0) {\r\n\t\twindow.scrollTo(window.scrollX, window.scrollY - 100);\r\n\t}\r\n}", "function offsetAnchor() {\n if (location.hash.length !== 0) {\n window.scrollTo(window.scrollX, window.scrollY - 100)\n }\n}", "function offsetAnchor() {\n if (location.hash.length !== 0) {\n window.scrollTo(window.scrollX, window.scrollY - 100);\n }\n}", "function offsetAnchor() {\n if (location.hash.length !== 0) {\n window.scrollTo(window.scrollX, window.scrollY - 100);\n }\n}", "firstRemainingAncestorId(xid) {\n const ltd = this.lastTreeData;\n if (!ltd) return;\n\n const getParentData = function(id) {\n if (!(id in ltd)) return null;\n const data = ltd[id];\n if (!('parentId' in data)) return null;\n const pid = data.parentId;\n if (!pid || !(pid in ltd)) return null;\n return ltd[pid];\n }\n\n var adata = getParentData(xid);\n while (adata && !(this.findNode(adata.__id))) {\n adata = getParentData(adata.__id);\n }\n return adata ? adata.__id : 0;\n }", "position() {\n return VrMath.getTranslation(this.headMatrix);\n }", "function offsetAnchor() {\n if (location.hash.length !== 0) {\n window.scrollTo(window.scrollX, window.scrollY - 100);\n }\n}", "resolveCelestialTarget(x, y) {\n // x = App.arithmetics.wrapTo180(x + 90); // uncomment this in case resolving from Matlab coordinates\n offset = App.arithmetics.wrapTo180(App.pathFinder.data.offset);\n\n return { x: App.arithmetics.wrapTo180(x + offset), y };\n }", "setAnchorPoseFromCameraOffset(x, y, z, orientation) {\n this._z.instant_world_tracker_anchor_pose_set_from_camera_offset(this._impl, x, y, z, orientation || zappar_cv_1.instant_world_tracker_transform_orientation_t.MINUS_Z_AWAY_FROM_USER);\n }", "function findMark() {\n\t\n\t\tif (intent > 0) var aim = $('.active').next('section');\n\t\telse aim = $('.active').prev('section');\n\t\tif (!aim.length) return 0;\n\t\n\t\treturn Math.abs(aim.offset().top-gate.scrollTop());\n\t}", "offset() {\n if (this.overlap) return this.dot ? 8 : 12;\n return this.dot ? 2 : 4;\n }", "function findAncestorOffsetKey(node) {\n var searchNode = node;\n while (searchNode && searchNode !== document.documentElement) {\n var key = getSelectionOffsetKeyForNode(searchNode);\n if (key != null) {\n return key;\n }\n searchNode = searchNode.parentNode;\n }\n return null;\n}", "function findAncestorOffsetKey(node) {\n var searchNode = node;\n while (searchNode && searchNode !== document.documentElement) {\n var key = getSelectionOffsetKeyForNode(searchNode);\n if (key != null) {\n return key;\n }\n searchNode = searchNode.parentNode;\n }\n return null;\n}", "function findAncestorOffsetKey(node) {\n var searchNode = node;\n while (searchNode && searchNode !== document.documentElement) {\n var key = getSelectionOffsetKeyForNode(searchNode);\n if (key != null) {\n return key;\n }\n searchNode = searchNode.parentNode;\n }\n return null;\n}", "function findAncestorOffsetKey(node) {\n var searchNode = node;\n while (searchNode && searchNode !== document.documentElement) {\n var key = getSelectionOffsetKeyForNode(searchNode);\n if (key != null) {\n return key;\n }\n searchNode = searchNode.parentNode;\n }\n return null;\n}", "function findAncestorOffsetKey(node) {\n var searchNode = node;\n while (searchNode && searchNode !== document.documentElement) {\n var key = getSelectionOffsetKeyForNode(searchNode);\n if (key != null) {\n return key;\n }\n searchNode = searchNode.parentNode;\n }\n return null;\n}", "function findAncestorOffsetKey(node) {\n var searchNode = node;\n while (searchNode && searchNode !== document.documentElement) {\n var key = getSelectionOffsetKeyForNode(searchNode);\n if (key != null) {\n return key;\n }\n searchNode = searchNode.parentNode;\n }\n return null;\n}", "function findAncestorOffsetKey(node) {\n var searchNode = node;\n while (searchNode && searchNode !== document.documentElement) {\n var key = getSelectionOffsetKeyForNode(searchNode);\n if (key != null) {\n return key;\n }\n searchNode = searchNode.parentNode;\n }\n return null;\n}", "function findAncestorOffsetKey(node) {\n var searchNode = node;\n while (searchNode && searchNode !== document.documentElement) {\n var key = getSelectionOffsetKeyForNode(searchNode);\n if (key != null) {\n return key;\n }\n searchNode = searchNode.parentNode;\n }\n return null;\n}", "function findAncestorOffsetKey(node) {\n var searchNode = node;\n while (searchNode && searchNode !== document.documentElement) {\n var key = getSelectionOffsetKeyForNode(searchNode);\n if (key != null) {\n return key;\n }\n searchNode = searchNode.parentNode;\n }\n return null;\n}", "function findAncestorOffsetKey(node) {\n\t var searchNode = node;\n\t while (searchNode && searchNode !== document.documentElement) {\n\t var key = getSelectionOffsetKeyForNode(searchNode);\n\t if (key != null) {\n\t return key;\n\t }\n\t searchNode = searchNode.parentNode;\n\t }\n\t return null;\n\t}", "topPosition(el) {\n return el ? el.offsetTop + this.topPosition(el.offsetParent) : 0;\n }", "function getOffset(element, ancestor) {\n var left = 0,\n top = 0,\n originalElement = element;\n while (element != ancestor) {\n if (element === null) {\n console.log(originalElement);\n console.log(ancestor);\n }\n left += element.offsetLeft;\n top += element.offsetTop;\n element = element.parentNode;\n }\n return { left: left, top: top };\n }", "function Z(){var e=l.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||l[t]:e.height||l[t]}", "function Z(){var e=l.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||l[t]:e.height||l[t]}", "_onAnchorFound(anchorMap){\n if (anchorMap.type != \"plane\"){\n return;\n }\n console.log(\"Getting Physics Group\");\n var worldCenterPosition = [anchorMap.position[0] + anchorMap.center[0],\n anchorMap.position[1] + anchorMap.center[1],\n anchorMap.position[2] + anchorMap.center[2]];\n this.arPlaneRef.setNativeProps({\"pauseUpdates\":true});\n this.setState({foundPlane:true, planePosition:worldCenterPosition, planeRotation:anchorMap.rotation});\n }", "function boundaryPoint_position(bp, relativeTo) {\n const nodeA = bp[0];\n const offsetA = bp[1];\n const nodeB = relativeTo[0];\n const offsetB = relativeTo[1];\n /**\n * 1. Assert: nodeA and nodeB have the same root.\n */\n console.assert(TreeAlgorithm_1.tree_rootNode(nodeA) === TreeAlgorithm_1.tree_rootNode(nodeB), \"Boundary points must share the same root node.\");\n /**\n * 2. If nodeA is nodeB, then return equal if offsetA is offsetB, before\n * if offsetA is less than offsetB, and after if offsetA is greater than\n * offsetB.\n */\n if (nodeA === nodeB) {\n if (offsetA === offsetB) {\n return interfaces_1.BoundaryPosition.Equal;\n }\n else if (offsetA < offsetB) {\n return interfaces_1.BoundaryPosition.Before;\n }\n else {\n return interfaces_1.BoundaryPosition.After;\n }\n }\n /**\n * 3. If nodeA is following nodeB, then if the position of (nodeB, offsetB)\n * relative to (nodeA, offsetA) is before, return after, and if it is after,\n * return before.\n */\n if (TreeAlgorithm_1.tree_isFollowing(nodeB, nodeA)) {\n const pos = boundaryPoint_position([nodeB, offsetB], [nodeA, offsetA]);\n if (pos === interfaces_1.BoundaryPosition.Before) {\n return interfaces_1.BoundaryPosition.After;\n }\n else if (pos === interfaces_1.BoundaryPosition.After) {\n return interfaces_1.BoundaryPosition.Before;\n }\n }\n /**\n * 4. If nodeA is an ancestor of nodeB:\n */\n if (TreeAlgorithm_1.tree_isAncestorOf(nodeB, nodeA)) {\n /**\n * 4.1. Let child be nodeB.\n * 4.2. While child is not a child of nodeA, set child to its parent.\n * 4.3. If child’s index is less than offsetA, then return after.\n */\n let child = nodeB;\n while (!TreeAlgorithm_1.tree_isChildOf(nodeA, child)) {\n /* istanbul ignore else */\n if (child._parent !== null) {\n child = child._parent;\n }\n }\n if (TreeAlgorithm_1.tree_index(child) < offsetA) {\n return interfaces_1.BoundaryPosition.After;\n }\n }\n /**\n * 5. Return before.\n */\n return interfaces_1.BoundaryPosition.Before;\n}", "function findAncestorOffsetKey(node: Node): ?string {\n let searchNode = node;\n while (\n searchNode &&\n searchNode !== getCorrectDocumentFromNode(node).documentElement\n ) {\n const key = getSelectionOffsetKeyForNode(searchNode);\n if (key != null) {\n return key;\n }\n searchNode = searchNode.parentNode;\n }\n return null;\n}", "warpIfNeeded(newScrollTop) {\n const me = this,\n result = {\n newScrollTop,\n deltaTop: newScrollTop - me.lastScrollTop\n }; // if gap to fill is large enough, better to jump there than to fill row by row\n\n if (Math.abs(result.deltaTop) > me.rowCount * me.rowOffsetHeight * 3) {\n // no specific record targeted\n let index; // Specific record specified as target of scroll?\n\n if (me.scrollTargetRecordId) {\n index = me.store.indexOf(me.scrollTargetRecordId); // since scroll is happening async record might have been removed after requesting scroll,\n // in that case we rely on calculated index (as when scrolling without target)\n } // perform the jump and return results\n\n result.newScrollTop = me.jumpToPosition(newScrollTop, index);\n result.deltaTop = 0; // no extra filling needed\n }\n\n return result;\n }", "getCollisionUp(top, x, halfwidth) {\n let r = Math.round(top) - 1; //row above top\n if (r >= WH || r < 0) return null; //world borders\n x = Math.round(x) - halfwidth; //left\n for (let c = x; c < x + halfwidth*2; c++) {\n if (this.collMatrix[r][c] == 1) {\n return c;\n }\n }\n return null;\n }", "function getAnchor(element){\n if(!element){\n return null;\n }\n var anchor = element.getAttribute('data-anchor');\n var elementIndex = index(element);\n\n //Slide without anchor link? We take the index instead.\n if(anchor == null){\n anchor = elementIndex;\n }\n\n return anchor;\n }", "function getAnchor(element){\n if(!element){\n return null;\n }\n var anchor = element.getAttribute('data-anchor');\n var elementIndex = index(element);\n\n //Slide without anchor link? We take the index instead.\n if(anchor == null){\n anchor = elementIndex;\n }\n\n return anchor;\n }", "function getAnchor(element){\n if(!element){\n return null;\n }\n var anchor = element.getAttribute('data-anchor');\n var elementIndex = index(element);\n\n //Slide without anchor link? We take the index instead.\n if(anchor == null){\n anchor = elementIndex;\n }\n\n return anchor;\n }", "function findNextLevelPos() {\r\n\tvar goRightBtnMatch = findMatch(LVL_RIGHT_PNG);\r\n\tvar goRightBtnPos = goRightBtnMatch.getRect().getCenter();\r\n\r\n\treturn goRightBtnPos.pointAdded(NEXT_LVL_OFFSET);\r\n}", "function getWaypointTopOffset() {\n\tvar $stickyHeaderHeight = 0,\n\t $mediaQueryIpad = Modernizr.mq( 'only screen and (min-device-width: 768px) and (max-device-width: 1366px) and (orientation: portrait)' ) || Modernizr.mq( 'only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape)' ),\n\t $stickyHeaderType = 1;\n\n\t\tif ( jQuery( '.fusion-header-v4' ).length || jQuery( '.fusion-header-v5' ).length ) {\n\t\t $stickyHeaderType = 2;\n\t\t}\n\n\t// Sticky header is enabled\n\tif ( '1' == avadaVars.header_sticky && jQuery( '.fusion-header-wrapper' ).length ) {\n\n\t\t// Desktop mode - headers v1, v2, v3\n\t\tif ( 1 == $stickyHeaderType ) {\n\t\t\t$stickyHeaderHeight = jQuery( '.fusion-header' ).outerHeight() - 1;\n\n\t\t// Desktop mode - headers v4, v5\n\t\t} else {\n\n\t\t\t// Menu only\n\t\t\t$stickyHeaderHeight = jQuery( '.fusion-secondary-main-menu' ).outerHeight();\n\n\t\t\t// Menu and logo\n\t\t\tif ( 'menu_and_logo' === avadaVars.header_sticky_type2_layout ) {\n\t\t\t\t$stickyHeaderHeight += jQuery( '.fusion-header' ).outerHeight() - 1;\n\t\t\t}\n\t\t}\n\n\t\t// Mobile mode\n\t\tif ( Modernizr.mq( 'only screen and (max-width: ' + avadaVars.side_header_break_point + 'px)' ) ) {\n\n\t\t\t// Sticky header is enabled on mobile\n\t\t\tif ( '1' == avadaVars.header_sticky_mobile ) {\n\t\t\t\t$stickyHeaderHeight = jQuery( '.fusion-header' ).outerHeight() - 1;\n\n\t\t\t// Sticky header is disabled on mobile\n\t\t\t} else {\n\t\t\t\t$stickyHeaderHeight = 0;\n\t\t\t}\n\t\t}\n\n\t\t// Tablet mode\n\t\tif ( '1' != avadaVars.header_sticky_tablet && $mediaQueryIpad ) {\n\t\t\t$stickyHeaderHeight = 0;\n\t\t}\n\t}\n\n\treturn $stickyHeaderHeight;\n}", "function getAnchor(element){\r\n if(!element){\r\n return null;\r\n }\r\n var anchor = element.getAttribute('data-anchor');\r\n var elementIndex = index(element);\r\n\r\n //Slide without anchor link? We take the index instead.\r\n if(anchor == null){\r\n anchor = elementIndex;\r\n }\r\n\r\n return anchor;\r\n }", "function getAnchor(element){\r\n if(!element){\r\n return null;\r\n }\r\n var anchor = element.getAttribute('data-anchor');\r\n var elementIndex = index(element);\r\n\r\n //Slide without anchor link? We take the index instead.\r\n if(anchor == null){\r\n anchor = elementIndex;\r\n }\r\n\r\n return anchor;\r\n }", "function xOffsetTop(e)\r\n{\r\n if (!(e=xGetElementById(e))) return 0;\r\n if (xDef(e.offsetTop)) return e.offsetTop;\r\n else return 0;\r\n}", "function xOffsetTop(e)\r\n{\r\n if (!(e=xGetElementById(e))) return 0;\r\n if (xDef(e.offsetTop)) return e.offsetTop;\r\n else return 0;\r\n}", "function detectNextBlock_CurrentRightUp(x,y,h,w)\n {\n var mapCoordY = (y)/ h;\n var mapCoordX = (x + w -1) / w;\n \n mapCoordX = Math.floor(mapCoordX);\n mapCoordY = Math.floor(mapCoordY);\n \n return map[mapCoordY-1][mapCoordX-1]; \n }", "_faceOffset4(face)\n {\n switch(face) {\n case 1:\n return {dy: 0, dx: 8};\n case 2:\n return {dy: 4, dx: 0};\n case 3:\n return {dy: 4, dx: 4};\n case 4:\n return {dy: 4, dx: 8};\n case 5:\n return {dy: 8, dx: 8};\n case 6:\n return {dy: 8, dx: 12};\n }\n return undefined;\n }", "function anchorFirst(){self.startRow=anchorRow;self.startNode=selection.anchorNode;self.startOffset=selection.anchorOffset;self.endRow=focusRow;self.endNode=selection.focusNode;self.endOffset=selection.focusOffset;}// This function is used when we detect that the \"focus\" node is first.", "function getDefaultPosition(source, element) {\n var sourceTrbl = Object(diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_1__[\"asTRBL\"])(source);\n var sourceMid = Object(diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_1__[\"getMid\"])(source);\n // simply put element right next to source\n return {\n x: sourceTrbl.right + DEFAULT_HORIZONTAL_DISTANCE + element.width / 2,\n y: sourceMid.y\n };\n}", "getAnchor(name) {\n const anchor = this.anchors.filter(function(anchor) {\n return anchor.name === name\n })\n if (anchor.length === 0) {\n return null\n } else {\n return anchor[0]\n }\n }", "function getOffset(el) {\n var rect = el.getBoundingClientRect();\n return {\n left: rect.left + rect.width / 2\n };\n}", "function getCurrentDirection(offset, lockThreshold = 10) {\n let direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}", "findBottomMostPlatform() {\n //getting all platforms as an array\n const platforms = this.platforms.getChildren()\n //pick the first one in the array as the current bottom most platform\n let bottomPlatform = platforms[0]\n //iterate over the Array and compare each platform against the current bottomPlatform. If a platform's y position is greater then the bottom then we set it as the new bottom\n for(let i = 1; i < platforms.length; i++) {\n const platform = platforms[i];\n //discard any platforms that are above current\n if(platform.y < bottomPlatform.y) {\n continue\n }\n bottomPlatform = platform;\n }\n return bottomPlatform;\n }", "function getOffset() {\n if (innerHeight < 600 || innerWidth < 1000) {\n return 105;\n }\n else {\n return 55;\n }\n}", "function relToPos(r) {\n /* jshint validthis:true */\n return r * k.call(this) + this.barTopLimit;\n }", "findPivot(){\n // grab the first element\n let mostCentered;\n this.items.forEach((item)=>{\n let candidateDistance = Math.hypot(\n item.center.x - this.center.x, \n item.center.y - this.center.y\n );\n item.center.distanceToBoundsCenter = candidateDistance;\n if (!mostCentered || candidateDistance < mostCentered.center.distanceToBoundsCenter ) {\n mostCentered = item;\n }\n });\n return mostCentered;\n }", "function getCurrentDirection(offset, lockThreshold) {\n if (lockThreshold === void 0) { lockThreshold = 10; }\n var direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}", "function getCurrentDirection(offset, lockThreshold) {\n if (lockThreshold === void 0) { lockThreshold = 10; }\n var direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}", "function getCurrentDirection(offset, lockThreshold) {\n if (lockThreshold === void 0) { lockThreshold = 10; }\n var direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}", "function getCurrentDirection(offset, lockThreshold) {\n if (lockThreshold === void 0) { lockThreshold = 10; }\n var direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}", "function getCurrentDirection(offset, lockThreshold) {\n if (lockThreshold === void 0) { lockThreshold = 10; }\n var direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}", "function getOffset( el ) {\n var offset = el?el.getBoundingClientRect():{top:0,left:0};\n return { top : offset.top + (window.pageYOffset || window.document.documentElement.scrollTop), left : offset.left + (window.pageXOffset || window.document.documentElement.scrollLeft) }\n}", "function calculateCurrentX(anchor, touches) {\n return anchor === 'right' ? document.body.offsetWidth - touches[0].pageX : touches[0].pageX;\n}", "function getCurrentDirection(offset, lockThreshold) {\r\n if (lockThreshold === void 0) { lockThreshold = 10; }\r\n var direction = null;\r\n if (Math.abs(offset.y) > lockThreshold) {\r\n direction = \"y\";\r\n }\r\n else if (Math.abs(offset.x) > lockThreshold) {\r\n direction = \"x\";\r\n }\r\n return direction;\r\n}", "recenterAnchorInSubtree(){\n if(!this.getChildrenList().length){\n this.setWorldPosition(this.getParent().getWorldPosition())\n return\n }\n let bbox = this.getChildTreeObjectSpaceBoundingBox()\n let new_center = new Vec2((bbox[0].x+bbox[2].x)/2, (bbox[0].y+bbox[2].y)/2)\n // console.log(new_center)\n this.setWorldPosition(this.getObjectToWorldMatrix().times(new_center))\n }", "getObjectRelativePosition(id) {\n\n\t\tlet sceneWidth = this.#_augmentaScene.scene.x;\n\t\tlet sceneHeight = this.#_augmentaScene.scene.y;\n\n\t\tlet posX = this.#_augmentaObjects[id].centroid.x / sceneWidth + 0.5;\n\t\tlet posY = this.#_augmentaObjects[id].centroid.y / sceneHeight + 0.5;\n\n\t\treturn (posX,posY);\n\t}", "function getIndicatorPos(indicator, screenW, screenH, cameraPos) {\n let target = indicator.point;\n let onScreen = (\n (Math.abs(target.x - cameraPos.x) <= (screenW / 2 - MARGIN)) &&\n (Math.abs(target.y - cameraPos.y) <= (screenH / 2 - MARGIN))\n );\n\n if (!onScreen) {\n return getIndicatorBorderPoint(indicator, screenW, screenH, cameraPos);\n }\n\n let screen = V.sub(cameraPos, { x: screenW / 2, y: screenH / 2 });\n return V.sub(target, screen);\n}" ]
[ "0.5992247", "0.5897993", "0.55991775", "0.5462787", "0.52190477", "0.5214754", "0.5134181", "0.50937563", "0.508515", "0.5066168", "0.50644076", "0.50627375", "0.50465006", "0.49820626", "0.49646086", "0.49417618", "0.49413696", "0.491731", "0.488746", "0.48602098", "0.4859467", "0.48513842", "0.48288408", "0.48278442", "0.48273385", "0.48166925", "0.48138043", "0.47970128", "0.47867733", "0.47819972", "0.4778499", "0.47745952", "0.47312132", "0.4727614", "0.47228292", "0.47167763", "0.47161934", "0.47149223", "0.47115365", "0.4698941", "0.46870497", "0.46864623", "0.46864623", "0.4684058", "0.4677186", "0.46700627", "0.46695718", "0.4663201", "0.4659636", "0.46569377", "0.46544638", "0.46544638", "0.46544638", "0.46544638", "0.46544638", "0.46544638", "0.46544638", "0.46544638", "0.46544638", "0.46515924", "0.4651534", "0.46444127", "0.46443486", "0.46443486", "0.4632848", "0.46140113", "0.46073985", "0.46071836", "0.46065897", "0.46061373", "0.46061373", "0.46061373", "0.46057817", "0.46041876", "0.46021673", "0.46021673", "0.46019658", "0.46019658", "0.45827445", "0.4574754", "0.4570397", "0.456756", "0.45663503", "0.45633045", "0.45571154", "0.45514297", "0.4550418", "0.4548008", "0.45388752", "0.45372614", "0.45372614", "0.45372614", "0.45372614", "0.45372614", "0.45348692", "0.45282978", "0.45258936", "0.45218283", "0.4520135", "0.45201245" ]
0.7003973
0
Returns an existing XRAnchor or null if uid is unknown
getAnchor(uid){ // XRAnchor? getAnchor(DOMString uid); return this._session.reality._getAnchor(uid) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findFloorAnchor(uid=null){\n\t\t// Promise<XRAnchorOffset?> findFloorAnchor();\n\t\treturn this._session.reality._findFloorAnchor(this._session.display, uid)\n\t}", "_findFloorAnchor(display, uid=null){\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tresolve(null)\n\t\t})\n\t}", "getAnchor(name) {\n const anchor = this.anchors.filter(function(anchor) {\n return anchor.name === name\n })\n if (anchor.length === 0) {\n return null\n } else {\n return anchor[0]\n }\n }", "_findAnchor(normalizedScreenX, normalizedScreenY, display, testOptions=null){\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif(this._arKitWrapper !== null){\t\n\t\t\t\t// Perform a hit test using the ARKit integration\n\t\t\t\tthis._arKitWrapper.hitTest(normalizedScreenX, normalizedScreenY, testOptions || ARKitWrapper.HIT_TEST_TYPE_EXISTING_PLANES).then(hits => {\n\t\t\t\t\tif(hits.length === 0){\n\t\t\t\t\t\tresolve(null)\n\t\t\t\t\t\t// console.log('miss')\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst hit = this._pickARKitHit(hits)\n\n\t\t\t\t\t// if it's a plane\n\t\t\t\t\tif (hit.anchor_transform) {\n\t\t\t\t\t\thit.anchor_transform[13] += XRViewPose.SITTING_EYE_HEIGHT\n\t\t\t\t\t\thit.world_transform[13] += XRViewPose.SITTING_EYE_HEIGHT\n\n\t\t\t\t\t\t// Use the first hit to create an XRAnchorOffset, creating the XRAnchor as necessary\n\n\t\t\t\t\t\t// TODO use XRPlaneAnchor for anchors with extents; hopefully the plane will have been created, tho\n\t\t\t\t\t\tlet anchor = this._getAnchor(hit.uuid)\n\t\t\t\t\t\tif(anchor === null){\n\t\t\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\t\t\tcoordinateSystem._relativeMatrix = hit.anchor_transform\n\t\t\t\t\t\t\tanchor = new XRAnchor(coordinateSystem, hit.uuid)\n\t\t\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst offsetPosition = [\n\t\t\t\t\t\t\thit.world_transform[12] - hit.anchor_transform[12],\n\t\t\t\t\t\t\thit.world_transform[13] - hit.anchor_transform[13],\n\t\t\t\t\t\t\thit.world_transform[14] - hit.anchor_transform[14]\n\t\t\t\t\t\t]\n\t\t\t\t\t\tconst worldRotation = new Quaternion().setFromRotationMatrix(hit.world_transform)\n\t\t\t\t\t\tconst inverseAnchorRotation = new Quaternion().setFromRotationMatrix(hit.anchor_transform).inverse()\n\t\t\t\t\t\tconst offsetRotation = new Quaternion().multiplyQuaternions(worldRotation, inverseAnchorRotation)\n\t\t\t\t\t\tconst anchorOffset = new XRAnchorOffset(anchor.uid)\n\t\t\t\t\t\tanchorOffset.poseMatrix = MatrixMath.mat4_fromRotationTranslation(new Float32Array(16), offsetRotation.toArray(), offsetPosition)\n\t\t\t\t\t\tresolve(anchorOffset)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\t\tcoordinateSystem._relativeMatrix = hit.world_transform\n\t\t\t\t\t\tconst anchor = new XRAnchor(coordinateSystem, hit.uuid)\n\t\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\n\t\t\t\t\t\tconst anchorOffset = new XRAnchorOffset(anchor.uid)\n\t\t\t\t\t\tresolve(anchorOffset)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} else if(this._vrDisplay !== null){\n\t\t\t\t// Perform a hit test using the ARCore data\n\t\t\t\tlet hits = this._vrDisplay.hitTest(normalizedScreenX, normalizedScreenY)\n\t\t\t\tif(hits.length == 0){\n\t\t\t\t\tresolve(null)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\thits.sort((a, b) => a.distance - b.distance)\n\t\t\t\tlet anchor = this._getAnchor(hits[0].uuid)\n\t\t\t\tif(anchor === null){\n\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\tcoordinateSystem._relativeMatrix = hits[0].modelMatrix\n\t\t\t\t\tcoordinateSystem._relativeMatrix[13] += XRViewPose.SITTING_EYE_HEIGHT\n\t\t\t\t\tanchor = new XRAnchor(coordinateSystem)\n\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\t\t\t\t}\n\t\t\t\tresolve(new XRAnchorOffset(anchor.uid))\n\t\t\t} else {\n\t\t\t\tresolve(null) // No platform support for finding anchors\n\t\t\t}\n\t\t})\n\t}", "_findAnchor(normalizedScreenX, normalizedScreenY, display){\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif(this._arKitWrapper !== null){\t\n\t\t\t\t// Perform a hit test using the ARKit integration\n\t\t\t\tthis._arKitWrapper.hitTest(normalizedScreenX, normalizedScreenY, ARKitWrapper.HIT_TEST_TYPE_EXISTING_PLANES).then(hits => {\n\t\t\t\t\tif(hits.length === 0){\n\t\t\t\t\t\tresolve(null)\n\t\t\t\t\t\t// console.log('miss')\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst hit = this._pickARKitHit(hits)\n\t\t\t\t\thit.anchor_transform[13] += XRViewPose.SITTING_EYE_HEIGHT\n\t\t\t\t\thit.world_transform[13] += XRViewPose.SITTING_EYE_HEIGHT\n\n\t\t\t\t\t// Use the first hit to create an XRAnchorOffset, creating the XRAnchor as necessary\n\n\t\t\t\t\t// TODO use XRPlaneAnchor for anchors with extents\n\n\t\t\t\t\tlet anchor = this._getAnchor(hit.uuid)\n\t\t\t\t\tif(anchor === null){\n\t\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\t\tcoordinateSystem._relativeMatrix = hit.anchor_transform\n\t\t\t\t\t\tanchor = new XRAnchor(coordinateSystem, hit.uuid)\n\t\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\t\t\t\t\t}\n\n\t\t\t\t\tconst offsetPosition = [\n\t\t\t\t\t\thit.world_transform[12] - hit.anchor_transform[12],\n\t\t\t\t\t\thit.world_transform[13] - hit.anchor_transform[13],\n\t\t\t\t\t\thit.world_transform[14] - hit.anchor_transform[14]\n\t\t\t\t\t]\n\t\t\t\t\tconst worldRotation = new Quaternion().setFromRotationMatrix(hit.world_transform)\n\t\t\t\t\tconst inverseAnchorRotation = new Quaternion().setFromRotationMatrix(hit.anchor_transform).inverse()\n\t\t\t\t\tconst offsetRotation = new Quaternion().multiplyQuaternions(worldRotation, inverseAnchorRotation)\n\t\t\t\t\tconst anchorOffset = new XRAnchorOffset(anchor.uid)\n\t\t\t\t\tanchorOffset.poseMatrix = MatrixMath.mat4_fromRotationTranslation(new Float32Array(16), offsetRotation.toArray(), offsetPosition)\n\t\t\t\t\tresolve(anchorOffset)\n\t\t\t\t})\n\t\t\t} else if(this._vrDisplay !== null){\n\t\t\t\t// Perform a hit test using the ARCore data\n\t\t\t\tlet hits = this._vrDisplay.hitTest(normalizedScreenX, normalizedScreenY)\n\t\t\t\tif(hits.length == 0){\n\t\t\t\t\tresolve(null)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\thits.sort((a, b) => a.distance - b.distance)\n\t\t\t\tlet anchor = this._getAnchor(hits[0].uuid)\n\t\t\t\tif(anchor === null){\n\t\t\t\t\tlet coordinateSystem = new XRCoordinateSystem(display, XRCoordinateSystem.TRACKER)\n\t\t\t\t\tcoordinateSystem._relativeMatrix = hits[0].modelMatrix\n\t\t\t\t\tcoordinateSystem._relativeMatrix[13] += XRViewPose.SITTING_EYE_HEIGHT\n\t\t\t\t\tanchor = new XRAnchor(coordinateSystem)\n\t\t\t\t\tthis._anchors.set(anchor.uid, anchor)\n\t\t\t\t}\n\t\t\t\tresolve(new XRAnchorOffset(anchor.uid))\n\t\t\t} else {\n\t\t\t\tresolve(null) // No platform support for finding anchors\n\t\t\t}\n\t\t})\n\t}", "function getAnchor(element) {\n if (!element) {\n return null;\n }\n\n var anchor = element.getAttribute('data-anchor');\n var elementIndex = index(element); //Slide without anchor link? We take the index instead.\n\n if (anchor == null) {\n anchor = elementIndex;\n }\n\n return anchor;\n }", "function getAnchor(element){\r\n if(!element){\r\n return null;\r\n }\r\n var anchor = element.getAttribute('data-anchor');\r\n var elementIndex = index(element);\r\n\r\n //Slide without anchor link? We take the index instead.\r\n if(anchor == null){\r\n anchor = elementIndex;\r\n }\r\n\r\n return anchor;\r\n }", "function getAnchor(element){\r\n if(!element){\r\n return null;\r\n }\r\n var anchor = element.getAttribute('data-anchor');\r\n var elementIndex = index(element);\r\n\r\n //Slide without anchor link? We take the index instead.\r\n if(anchor == null){\r\n anchor = elementIndex;\r\n }\r\n\r\n return anchor;\r\n }", "function getAnchor(element){\n if(!element){\n return null;\n }\n var anchor = element.getAttribute('data-anchor');\n var elementIndex = index(element);\n\n //Slide without anchor link? We take the index instead.\n if(anchor == null){\n anchor = elementIndex;\n }\n\n return anchor;\n }", "function getAnchor(element){\n if(!element){\n return null;\n }\n var anchor = element.getAttribute('data-anchor');\n var elementIndex = index(element);\n\n //Slide without anchor link? We take the index instead.\n if(anchor == null){\n anchor = elementIndex;\n }\n\n return anchor;\n }", "function getAnchor(element){\n if(!element){\n return null;\n }\n var anchor = element.getAttribute('data-anchor');\n var elementIndex = index(element);\n\n //Slide without anchor link? We take the index instead.\n if(anchor == null){\n anchor = elementIndex;\n }\n\n return anchor;\n }", "_createImageAnchor(uid, buffer, width, height, physicalWidthInMeters) {\n\t\tif (this._arKitWrapper) {\n return this._arKitWrapper.createImageAnchor(uid, buffer, width, height, physicalWidthInMeters)\n } else {\n\t\t\treturn null;\n\t\t}\n\t}", "findAnchor(normalizedScreenX, normalizedScreenY, options=null){\n\t\t// Promise<XRAnchorOffset?> findAnchor(float32, float32); // cast a ray to find or create an anchor at the first intersection in the Reality\n\t\treturn this._session.reality._findAnchor(normalizedScreenX, normalizedScreenY, this._session.display, options)\n\t}", "function getAnchor(element){\r\n var anchor = element.data('anchor');\r\n var index = element.index();\r\n\r\n //Slide without anchor link? We take the index instead.\r\n if(typeof anchor === 'undefined'){\r\n anchor = index;\r\n }\r\n\r\n return anchor;\r\n }", "function getAnchor(element){\r\n var anchor = element.data('anchor');\r\n var index = element.index();\r\n\r\n //Slide without anchor link? We take the index instead.\r\n if(typeof anchor === 'undefined'){\r\n anchor = index;\r\n }\r\n\r\n return anchor;\r\n }", "function getAnchor(element){\r\n var anchor = element.data('anchor');\r\n var index = element.index();\r\n\r\n //Slide without anchor link? We take the index instead.\r\n if(typeof anchor === 'undefined'){\r\n anchor = index;\r\n }\r\n\r\n return anchor;\r\n }", "function getAnchor(element){\n var anchor = element.data('anchor');\n var index = element.index();\n\n //Slide without anchor link? We take the index instead.\n if(typeof anchor === 'undefined'){\n anchor = index;\n }\n\n return anchor;\n }", "function getAnchor(element){\n var anchor = element.data('anchor');\n var index = element.index();\n\n //Slide without anchor link? We take the index instead.\n if(typeof anchor === 'undefined'){\n anchor = index;\n }\n\n return anchor;\n }", "function getAnchor(element){\n var anchor = element.data('anchor');\n var index = element.index();\n\n //Slide without anchor link? We take the index instead.\n if(typeof anchor === 'undefined'){\n anchor = index;\n }\n\n return anchor;\n }", "function getAnchor(element){\n var anchor = element.data('anchor');\n var index = element.index();\n\n //Slide without anchor link? We take the index instead.\n if(typeof anchor === 'undefined'){\n anchor = index;\n }\n\n return anchor;\n }", "function getAnchor(element) {\n var anchor = element.data('anchor');\n var index = element.index();\n\n //Slide without anchor link? We take the index instead.\n if (typeof anchor === 'undefined') {\n anchor = index;\n }\n\n return anchor;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && nodeName_(element) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) { // 4726\n var result = null; // 4727\n Array.prototype.some.call(list, function(element) { // 4728\n if (nodeName_(element) === 'a') { // 4729\n result = element; // 4730\n return true; // 4731\n } // 4732\n }); // 4733\n return result; // 4734\n } // 4735", "function uid2node(uid) { // @param String: unique id\r\n // @return Node/undefined:\r\n return _uid2node[uid];\r\n}", "function getAnchor() {\n\t\t\tvar test = $('.pinContent').text();\n\t\t\treturn new Microsoft.Maps.Point(0, 33)\n\t\t}", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n forEach(list, function(element) {\n if (!result && lowercase(element.nodeName) === 'a') result = element;\n });\n return result;\n }", "getAnchor() {\n this._assertInitialized();\n return this.marker;\n }", "function getFirstAnchor(list){var result=null;Array.prototype.some.call(list,function(element){if(nodeName_(element)==='a'){result=element;return true;}});return result;}", "function getFirstAnchor(list){var result=null;Array.prototype.some.call(list,function(element){if(nodeName_(element)==='a'){result=element;return true;}});return result;}", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function (element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }", "function getFirstAnchor(list) {\n\t\t\t\tvar result = null;\n\t\t\t\tArray.prototype.some.call(list, function(element) {\n\t\t\t\t\tif (nodeName_(element) === 'a') {\n\t\t\t\t\t\tresult = element;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn result;\n\t\t\t}", "function getFirstAnchor(list) {\n\t var result = null;\n\t Array.prototype.some.call(list, function(element) {\n\t if (nodeName_(element) === 'a') {\n\t result = element;\n\t return true;\n\t }\n\t });\n\t return result;\n\t }", "function getFirstAnchor(list) {\n\t var result = null;\n\t Array.prototype.some.call(list, function(element) {\n\t if (nodeName_(element) === 'a') {\n\t result = element;\n\t return true;\n\t }\n\t });\n\t return result;\n\t }", "get anchor() {}", "function findAnchorPoint(shp, arcs) {\n var maxPath = shp && geom.getMaxPath(shp, arcs),\n pathBounds = maxPath && arcs.getSimpleShapeBounds(maxPath),\n thresh, simple;\n if (!pathBounds || !pathBounds.hasBounds() || pathBounds.area() === 0) {\n return null;\n }\n // Optimization: quickly simplify using a relatively small distance threshold.\n // (testing multiple candidate points can be very slow for large and detailed\n // polgons; simplification alleviates this)\n // Caveat: In rare cases this could cause poor point placement, e.g. if\n // simplification causes small holes to be removed.\n thresh = Math.sqrt(pathBounds.area()) * 0.01;\n simple = simplifyPolygonFast(shp, arcs, thresh);\n if (!simple.shape) {\n return null; // collapsed shape\n }\n return findAnchorPoint2(simple.shape, simple.arcs);\n }", "absAnchorOut(nid) {\n const ltd = this.lastTreeData;\n if (ltd && (nid in ltd)) {\n const ndata = ltd[nid];\n return {\n x: ndata.position.x + ndata.anchorOut.x,\n y: ndata.position.y + ndata.anchorOut.y\n }\n }\n return {x: 0, y: 0};\n }", "function getSlideAnchor(slide){\n var slideAnchor = slide.data('anchor');\n var slideIndex = slide.index();\n\n //Slide without anchor link? We take the index instead.\n if(typeof slideAnchor === 'undefined'){\n slideAnchor = slideIndex;\n }\n\n return slideAnchor;\n }", "resolveRowRecord(elementOrEvent, xy) {\n const me = this,\n { scheduler } = me,\n event = elementOrEvent instanceof Event ? elementOrEvent : null,\n element = event ? event.target : elementOrEvent,\n coords = event ? [event.offsetX, event.offsetY] : xy,\n // Fix for FF on Linux having text nodes as event.target\n el = element.nodeType === 3 ? element.parentElement : element,\n eventElement = DomHelper.up(el, scheduler.eventSelector);\n\n if (eventElement) {\n return scheduler.resourceStore.getById(eventElement.dataset.resourceId);\n }\n\n // Need to be inside schedule at least\n if (!DomHelper.up(element, '.b-sch-timeaxis-cell')) {\n return null;\n }\n\n const index = Math.floor(coords[0] / me.resourceColumns.columnWidth);\n\n return scheduler.resourceStore.getAt(index);\n }", "function emoGetProfileId(doc) {\r\n\tvar myregexp = /allies.php.uid=(\\w+)/;\r\n\tvar links = doc.links;\r\n\tfor (var i = 0; i<links.length; i++){\r\n\t\tvar match = myregexp.exec(links[i]);\r\n\t\tif(match != null){\r\n\t\t\tid = match[1];\r\n\t\t\treturn id;\r\n\t\t}\r\n\t}\r\n}", "function getNativeAnchorNode(parentTNode, lView) {\n if (parentTNode.type === 2 /* View */) {\n var lContainer = getLContainer(parentTNode, lView);\n var index = lContainer.indexOf(lView, CONTAINER_HEADER_OFFSET) - CONTAINER_HEADER_OFFSET;\n return getBeforeNodeForView(index, lContainer);\n }\n else if (parentTNode.type === 4 /* ElementContainer */ ||\n parentTNode.type === 5 /* IcuContainer */) {\n return getNativeByTNode(parentTNode, lView);\n }\n return null;\n}", "function getSlideByAnchor(slideAnchor, section) {\n var slide = $(SLIDE_SEL + '[data-anchor=\"' + slideAnchor + '\"]', section)[0];\n\n if (slide == null) {\n slideAnchor = typeof slideAnchor !== 'undefined' ? slideAnchor : 0;\n slide = $(SLIDE_SEL, section)[slideAnchor];\n }\n\n return slide;\n }", "function createAnchor(xx, yy, offset, nme) {\n\tvar anchor = paper\n\t .circle(xx, yy, 2)\n\t .attr({\"stroke-width\": 1, fill: \"#F00\"});\n\tanchor.name = nme;\n\tanchor.node.name = nme;\n\t\n\t// on clicking on the circle, \n\t// 1. create a new draggable object\n\t// 2. create a connection object between the rh and the draggable object\n\t// 3. if the draggable object dropped on a rh, then connect the two rh's \n\t$(anchor.node).bind('click', function(e) { \n\t\tconsole.log(\"anchor clicked: \"+this.name)\n\t\tvar drag_anchor = paper\n\t\t\t.circle(xx+offset, yy, 5)\n\t\t\t.attr({\"stroke-width\": 1, fill: \"#050\", opacity: 0.8})\n\t\t\t.draggable.enable();\n\t\tconnections.push(paper.connection2BBox(anchor, drag_anchor, \"#f57\", \"#55f\"));\t\t\n\t\tdrag_anchor.drag(move, dragger, up_and_glue);\n\t\t\n\t\t// needed for the dropped_on event\n\t\tdrag_anchor.dragFinish = over;\t\n\t\tdrag_anchor.make_draggable();\n\t\t\n\t});\n\t\n\treturn anchor;\n}", "function getSlideByAnchor(slideAnchor, section){\n var slide = $(SLIDE_SEL + '[data-anchor=\"'+slideAnchor+'\"]', section)[0];\n if(slide == null){\n slideAnchor = typeof slideAnchor !== 'undefined' ? slideAnchor : 0;\n slide = $(SLIDE_SEL, section)[slideAnchor];\n }\n\n return slide;\n }", "function getSlideByAnchor(slideAnchor, section){\n var slide = $(SLIDE_SEL + '[data-anchor=\"'+slideAnchor+'\"]', section)[0];\n if(slide == null){\n slideAnchor = typeof slideAnchor !== 'undefined' ? slideAnchor : 0;\n slide = $(SLIDE_SEL, section)[slideAnchor];\n }\n\n return slide;\n }", "function getSlideByAnchor(slideAnchor, section){\n var slide = $(SLIDE_SEL + '[data-anchor=\"'+slideAnchor+'\"]', section)[0];\n if(slide == null){\n slideAnchor = typeof slideAnchor !== 'undefined' ? slideAnchor : 0;\n slide = $(SLIDE_SEL, section)[slideAnchor];\n }\n\n return slide;\n }", "function getSlideByAnchor(slideAnchor, section){\r\n var slide = $(SLIDE_SEL + '[data-anchor=\"'+slideAnchor+'\"]', section)[0];\r\n if(slide == null){\r\n slideAnchor = typeof slideAnchor !== 'undefined' ? slideAnchor : 0;\r\n slide = $(SLIDE_SEL, section)[slideAnchor];\r\n }\r\n\r\n return slide;\r\n }", "function getSlideByAnchor(slideAnchor, section){\r\n var slide = $(SLIDE_SEL + '[data-anchor=\"'+slideAnchor+'\"]', section)[0];\r\n if(slide == null){\r\n slideAnchor = typeof slideAnchor !== 'undefined' ? slideAnchor : 0;\r\n slide = $(SLIDE_SEL, section)[slideAnchor];\r\n }\r\n\r\n return slide;\r\n }", "function getUserIDFromLDAPEntry(attributes){\r\n\tvar uid = LDAPScriptUtil.getAttributeValue(attributes, 'uid', 'userid');\r\n\tif (uid != null){\r\n\t\treturn uid;\r\n\t}\r\n\treturn null;\r\n}", "function getUserIDFromLDAPEntry(attributes){\r\n\tvar displayName = LDAPScriptUtil.getAttributeValue(attributes, 'displayName', null);\r\n\tif (displayName == null || displayName == ''){\t// assume it's not a Person\r\n\t\tvar uid = LDAPScriptUtil.getAttributeValue(attributes, 'uid', 'userid');\r\n\t\tif (uid != null){\r\n\t\t\treturn uid;\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}", "function findAnchorLink(){\n\tif (location.href.indexOf('#') != -1) {\n\t\tvar namedAnchor = window.location.hash;\n\t\tvar faqToFind = namedAnchor + ' .faq_question';\n\t\t$(faqToFind).trigger('click');\n\t}\n}", "function cardChildrenAdjustForAnchor(card, anchorX, anchorY){\n\n //****CARD CHILD LOCATION*****\n // 0 - TOP LEFT CORNER - ATTACK\n // 1 - TOP RIGHT CORNER - HP\n // 2 - BOTTOM LEFT CORNER - ACTION POINTS\n // 3 - CARD TITLE (will need to move to 4 or 5)\n // 4 - CARD IMAGE\n\n var rectangle = card.getLocalBounds();\n\n var child = card.getChildAt(0);\n child.position.x = topLeftAttributeSlotXOffset - getXOffsetFromCenterForText(playerCards[card.id].attack, cardAttributeFontCharSize) - (rectangle.width * anchorX);\n child.position.y = topLeftAttributeSlotYOffset - cardAttributeFontCharSize - (rectangle.height * anchorY);\n\n\n var child = card.getChildAt(1);\n child.position.x = topRightAttributeSlotXOffset - getXOffsetFromCenterForText(playerCards[card.id].health, cardAttributeFontCharSize) - (rectangle.width * anchorX);\n child.position.y = topRightAttributeSlotYOffset - cardAttributeFontCharSize - (rectangle.height * anchorY);\n\n\n var child = card.getChildAt(2); \n child.position.x = botLeftAttributeSlotXOffset - getXOffsetFromCenterForText(playerCards[card.id].remMoves, cardAttributeFontCharSize) - (rectangle.width * anchorX);\n child.position.y = botLeftAttributeSlotYOffset - cardAttributeFontCharSize - (rectangle.height * anchorX);\n \n\n var child = card.getChildAt(3); \n child.position.x = cardFrameOriginalWidth/2 - cardImageWidth / 2 - (rectangle.width * anchorX);\n child.position.y = 0 - (rectangle.height * anchorY) + 200;\n\n\n var child = card.getChildAt(4); \n child.position.x = cardFrameOriginalWidth/2 - getXOffsetFromCenterForText(playerCards[card.id].name, cardTitleFontCharSize) - (rectangle.width * anchorX);\n child.position.y = 0 - (rectangle.height * anchorY) + 100;\n }", "createAnchor(paper, x, y, style, r = AnchorsComponent.DEFAULT_ANCHOR_RADIUS) {\r\n const a = paper.circle(x, y, r);\r\n a.addClass(\"anchorStyle\");\r\n if (style !== undefined && style !== \"\") {\r\n a.addClass(style);\r\n }\r\n return a;\r\n }", "function GetidPointByAlias(aliasGiven) {\n var exists = true;\n alG = xmlDoc.getElementsByTagName(\"Alias\");\n for (n = 0; n < alG.length; n++) {\n if (alG[n].childNodes[0].nodeValue == aliasGiven) {\n return(alG[n].parentNode.getAttribute(\"Id\"));\n } else {\n exists = false;\n }\n }\n if (exists == false) {\n return(\"nomatch\");\n }\n}", "resolveRowRecord(elementOrEvent, xy) {\n const me = this,\n {\n scheduler\n } = me,\n event = elementOrEvent instanceof Event ? elementOrEvent : null,\n element = event ? event.target : elementOrEvent,\n coords = event ? [event.offsetX, event.offsetY] : xy,\n // Fix for FF on Linux having text nodes as event.target\n el = element.nodeType === 3 ? element.parentElement : element,\n eventElement = DomHelper.up(el, scheduler.eventSelector);\n\n if (eventElement) {\n return scheduler.resourceStore.getById(eventElement.dataset.resourceId);\n } // Need to be inside schedule at least\n\n if (!DomHelper.up(element, '.b-sch-timeaxis-cell')) {\n return null;\n }\n\n if (!coords) {\n throw new Error(`Vertical mode needs coordinates to resolve this element. Can also be called with a browser\n event instead of element to extract element and coordinates from`);\n }\n\n const index = Math.floor(coords[0] / me.resourceColumns.columnWidth);\n return scheduler.resourceStore.getAt(index);\n }", "function addAnchorR() {\n var pole = addStreetPostsR();\n\n pole.lightPost.position.z = -4770;\n pole.light.position.z = -4770;\n}", "function deriveAnchor(edge, index, ep, conn) {\n return options.anchor ? options.anchor : options.deriveAnchor(edge, index, ep, conn);\n }", "function uid(node) { // @param Node:\r\n // @return Number: unique id, from 1\r\n var rv = node.uuqid;\r\n\r\n if (!rv) {\r\n rv = node.uuqid = ++_mm.uuqid;\r\n _uid2node[rv] = node;\r\n }\r\n return rv;\r\n}", "function listItemWithAnchor(anchor) {\n // They give me element like this:\n // <a href=\"https://google.com\">google.com</a>\n const li = document.createElement(\"li\");\n li.appendChild(anchor);\n // I give them an element like this:\n // <li>\n // <a href=\"https://google.com\">google.com</a>\n // </li> \n return li;\n}", "function createAnchor(type, key) {\n if (main.debug) {\n var comment = (type === 0 ? 'start' : (type === 1 ? 'end' : 'anchor')) + ' ' + key;\n return document.createComment(comment);\n } else {\n return document.createTextNode('');\n };\n}", "function getSlideByAnchor(slideAnchor, section){\r\n var slide = section.find(SLIDE_SEL + '[data-anchor=\"'+slideAnchor+'\"]');\r\n if(!slide.length){\r\n slideAnchor = typeof slideAnchor !== 'undefined' ? slideAnchor : 0;\r\n slide = section.find(SLIDE_SEL).eq(slideAnchor);\r\n }\r\n\r\n return slide;\r\n }", "function getSlideByAnchor(slideAnchor, section){\r\n var slides = section.find(SLIDES_WRAPPER_SEL);\r\n var slide = slides.find(SLIDE_SEL + '[data-anchor=\"'+slideAnchor+'\"]');\r\n\r\n if(!slide.length){\r\n slide = slides.find(SLIDE_SEL).eq(slideAnchor);\r\n }\r\n\r\n return slide;\r\n }", "function getSlideByAnchor(slideAnchor, section){\r\n var slides = section.find(SLIDES_WRAPPER_SEL);\r\n var slide = slides.find(SLIDE_SEL + '[data-anchor=\"'+slideAnchor+'\"]');\r\n\r\n if(!slide.length){\r\n slide = slides.find(SLIDE_SEL).eq(slideAnchor);\r\n }\r\n\r\n return slide;\r\n }" ]
[ "0.6680218", "0.59649634", "0.56794304", "0.5588274", "0.5537615", "0.55274224", "0.54108703", "0.54108703", "0.5410701", "0.5410701", "0.5410701", "0.53035825", "0.52973884", "0.5237611", "0.5237611", "0.5237611", "0.5235187", "0.5235187", "0.5235187", "0.5235187", "0.51952964", "0.51438254", "0.5143036", "0.5142917", "0.5048484", "0.5004462", "0.5004462", "0.5004462", "0.5004462", "0.5004462", "0.5004462", "0.5004462", "0.5004462", "0.5004462", "0.49005195", "0.4889589", "0.4889589", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.488917", "0.48848438", "0.48771676", "0.48761255", "0.48761255", "0.48633143", "0.47986096", "0.47528479", "0.47332212", "0.46906933", "0.4587233", "0.45774153", "0.45380273", "0.45332354", "0.4488286", "0.4488286", "0.4488286", "0.4487164", "0.4487164", "0.448225", "0.4481907", "0.44616577", "0.44493097", "0.44399494", "0.44333702", "0.4422153", "0.44112214", "0.43831182", "0.43335402", "0.43200287", "0.43037677", "0.429858", "0.42904475", "0.42904475" ]
0.7675937
0
and collect the results in a new array.
function arrayProjection() { var newReleases = [ { "id": 70111470, "title": "Die Hard", "boxart": "http://cdn-0.nflximg.com/images/2891/DieHard.jpg", "uri": "http://api.netflix.com/catalog/titles/movies/70111470", "rating": [4.0], "bookmark": [] }, { "id": 654356453, "title": "Bad Boys", "boxart": "http://cdn-0.nflximg.com/images/2891/BadBoys.jpg", "uri": "http://api.netflix.com/catalog/titles/movies/70111470", "rating": [5.0], "bookmark": [{ id: 432534, time: 65876586 }] }, { "id": 65432445, "title": "The Chamber", "boxart": "http://cdn-0.nflximg.com/images/2891/TheChamber.jpg", "uri": "http://api.netflix.com/catalog/titles/movies/70111470", "rating": [4.0], "bookmark": [] }, { "id": 675465, "title": "Fracture", "boxart": "http://cdn-0.nflximg.com/images/2891/Fracture.jpg", "uri": "http://api.netflix.com/catalog/titles/movies/70111470", "rating": [5.0], "bookmark": [{ id: 432534, time: 65876586 }] } ]; var videoIdAndTitle = []; newReleases.forEach(function(video) { videoIdAndTitle.push({ id: video.id, title: video.title }); }); return videoIdAndTitle; console.log('New Array (projection)--->', videoIdAndTitle); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pushResultsToArrays() {\n for(var i = 0; i < Product.allProducts.length; i++) {\n totalClicksArr.push(Product.allProducts[i].totalClicks);\n }\n for(var j = 0; j < Product.allProducts.length; j++) {\n allProductNames.push(Product.allProducts[j].stringName);\n }\n for(var k = 0; k < Product.allProducts.length; k++) {\n productBgColors.push(Product.allProducts[k].backgroundColor);\n }\n for(var l = 0; l < Product.allProducts.length; l++) {\n timesShownArr.push(Product.allProducts[l].timesShown);\n }\n}", "prepareResultsArray() {\n if (this.shouldUseCorrespondingResults()) {\n this.meta.results = Array(this.items().length).fill(promise_pool_1.PromisePool.notRun);\n }\n return this;\n }", "initializeResultsArray() {\n\t\t// Can be run only after this.checkpoints are initialized\n\t\tthis.checkpoints.forEach((cp, cp_i) => {\n\t\t\tthis.runResults[cp_i] = [];\n\t\t\tcp.testCases.forEach((testcase, tc_i) => {\n\t\t\t\tthis.runResults[cp_i][tc_i] = [];\n\t\t\t});\n\t\t});\n\t}", "toArray() {\n return this._results.slice();\n }", "toArray() {\n return this._results.slice();\n }", "toArray() {\n return this._results.slice();\n }", "toArray() {\n return this._results.slice();\n }", "toArray() {\n return this._results.slice();\n }", "toArray() {\n return this._results.slice();\n }", "function initializeResults() {\n let currentResults = [];\n let temp;\n for (let i = 0; i < clueshints.length; i++) {\n temp = { clue: clueshints[i].order_num, time: -1 };\n currentResults.push(temp);\n }\n return currentResults;\n }", "function op_results(op, recs) {\n\tif (!recs.length) return [];\n\treturn [op(recs[0])].concat(op_results(op, recs.slice(1)));\n} // op_results is usually called \"map\"", "function loadArray3(result){\n finaldata = generateData3(result); \n finalArrayData = new Array(); \n for(i=0;i<finaldata.length;i++){ \n finalArrayData.push(finaldata[i].value);\n } \n store2.loadData(finaldata); \n return finalArrayData;\n \n }", "function collectortoarray(q,c){\n \n var inpt=[];\n let counter = 0;\n \n c.forEach((value) => {\n inpt[counter]=[q[counter][0],value.content];\n counter++;\n });\n\n console.log(inpt);\n return inpt;\n}", "async toArray() {\n const result = [];\n let x = await this.next();\n while (!x.done) {\n result.push(x.value);\n x = await this.next();\n }\n return result;\n }", "splitResults(results)\n {\n var pageArr = [];\n let count = 0;\n\n while(results.length > 0) {\n pageArr.push([]);\n\n for (let i = 0; i < this.props.citiesPerPage; i++) {\n if (results.length > 0)\n pageArr[count].push(results.shift());\n }\n\n if (pageArr[count].length === 0)\n pageArr.pop();\n\n count++;\n }\n\n //console.log(pageArr);\n return pageArr;\n }", "function resultToArray(result){\n var rows = result.rows, row, arr = [];\n for(var i = 0, l = rows.length; i < l; i++) {\n arr.push(rows.item(i));\n }\n return arr;\n }", "function collect(arr, callback, thisObj){\n\t callback = makeIterator(callback, thisObj);\n\t var results = [];\n\t if (arr == null) {\n\t return results;\n\t }\n\n\t var i = -1, len = arr.length;\n\t while (++i < len) {\n\t var value = callback(arr[i], i, arr);\n\t if (value != null) {\n\t append(results, value);\n\t }\n\t }\n\n\t return results;\n\t }", "toArray() {\n let arr = [];\n this.map((data) => { arr.push(data); return data});\n return arr;\n }", "function updateArrays() {\n diceArray += result + ' ';\n totalArray.push(result);\n}", "function arrayManipulation(n, queries) {\n\n\n}", "collectResults() {\n // Collect groups\n let rows = Array.from(this.groups, ([_, group]) => {\n const { bindings: groupBindings, aggregators } = group;\n // Collect aggregator bindings\n // If the aggregate errorred, the result will be undefined\n const aggBindings = {};\n for (const variable in aggregators) {\n const value = aggregators[variable].result();\n if (value !== undefined) { // Filter undefined\n aggBindings[variable] = value;\n }\n }\n // Merge grouping bindings and aggregator bindings\n return groupBindings.merge(aggBindings);\n });\n // Case: No Input\n // Some aggregators still define an output on the empty input\n // Result is a single Bindings\n if (rows.length === 0) {\n const single = {};\n for (const i in this.pattern.aggregates) {\n const aggregate = this.pattern.aggregates[i];\n const key = rdf_string_1.termToString(aggregate.variable);\n const value = sparqlee_1.AggregateEvaluator.emptyValue(aggregate);\n if (value !== undefined) {\n single[key] = value;\n }\n }\n rows = [bus_query_operation_1.Bindings(single)];\n }\n return rows;\n }", "async toArrayForTest() {\n const stream = this.prefetch(100);\n const result = [];\n let x = await stream.next();\n while (!x.done) {\n result.push(x.value);\n x = await stream.next();\n }\n return result;\n }", "toArray() {\n\t\t\treturn this.array.slice();\n\t\t}", "asArray() {\n const result = new Array();\n this.toArray(result, 0);\n return result;\n }", "function collect (array, callback){\n let newArray = [];\n for(i = 0; i < array.length; i++){\n newArray.push(callback(array[i]))\n }\n return newArray;\n}", "function makeResultsArr(resultsArr) {\n resultsArr.forEach(function (r) {\n let operating = r.opening_hours;\n if (operating !== undefined && operating.open_now) {\n if (r.rating >= parseInt($(\"#rating\").val())) {\n if (r.price_level <= parseInt($(\"#price\").val())) {\n // checkbox option\n let barOpt = $(\"#bar\").is(':checked');\n if (barOpt) {\n r.types.forEach(function (t) {\n if (t === \"bar\") {\n rOptions.push(r);\n }\n })\n }\n else {\n rOptions.push(r);\n }\n }\n }\n }\n })\n }", "function addToResults(tracks)\r\n{\r\n\tresults[results.length] = tracks;\r\n}", "function mapquest(arr) {\n\n // create an empty array for the new array with the doubled values\n\n // loop through the input array\n\n // for each value in arr, double it, and assign it to a new variable\n\n // push this new value to the newArr\n\n // once complete, return the newArry\n}", "function evalResults() {\n var evaluated, selected, aggregated;\n results.length = 0;\n\n // Evaluation Step\n if ( evaluator ) {\n // In this case, we need to sort between filtering and selecting\n evaluated = filter.call(source, evalObject);\n }\n else {\n // Otherwise take a snapshot of the source\n evaluated = slice.call(source, 0);\n }\n\n // Pre-Select Sorting Step\n if ( sorter && sortFirst ) sorter(ctx, evaluated);\n\n // Select Step\n if ( selector ) {\n selected = [];\n for ( var i = 0, ilen = evaluated.length; i < ilen; i++ ) {\n spliceArrayItems(selected, selector(ctx, evaluated[i]));\n }\n }\n else {\n selected = evaluated;\n }\n\n // Post-Select Sorting Step\n if ( sorter && !sortFirst ) sorter(ctx, selected);\n\n // Aggregation Step\n aggregated = aggregator ? aggregator(ctx, selected) : selected;\n\n // Splice Results\n spliceArrayItems(results, aggregated);\n\n if ( results.contains ) {\n // Calling with no arguments clears its cache\n results.contains();\n }\n }", "function updateResults(clue, _time) {\n let currentResults = [];\n currentResults = result;\n result[clue].time = _time;\n return currentResults;\n }", "collecTracks(listAlbums){\n let resultadoTracks = listAlbums.map((fAlbum) => fAlbum.getTracks());\n let flatResultado = resultadoTracks.reduce(function(a, b) { \n return a.concat(b); \n }, new Array);\n return flatResultado;\n }", "toArray() {\n\t\t\t\treturn this.slice(0);\n\t\t\t}", "updateResults() {\n if (this.reindexFlag_) {\n this.reindex();\n }\n\n var results = [];\n if (this.timeModel_ && this.binMethod) {\n // make sure the source time model is filtered on the correct range\n if (this.source) {\n this.source.getFilteredFeatures();\n }\n\n var tempFilters = {};\n var filters = this.getParentFilters();\n if (filters) {\n for (var id in filters) {\n if (filters[id] != null) {\n this.timeModel_.filterDimension(id, filters[id]);\n } else {\n // there's a disturbance in the force - don't return any bins! see getParentFilters for details.\n this.results = [];\n return;\n }\n }\n }\n\n // clear the filters to get all of the data, reapply them a little farther down\n if (this.forceAllData_ == true) {\n tempFilters = this.timeModel_.clearAllFilters();\n }\n\n if (this.secondaryBinMethod) {\n results = /** @type {!Array<!os.histo.Result<!ol.Feature>>} */ (this.timeModel_.groupData(this.multiId_,\n this.combinedKeyMethod.bind(this), this.reduceAdd.bind(this),\n this.reduceRemove.bind(this), this.reduceInit.bind(this)));\n } else {\n results = /** @type {!Array<!os.histo.Result<!ol.Feature>>} */ (this.timeModel_.groupData(this.id_,\n this.binMethod.getBinKey.bind(this.binMethod), this.reduceAdd.bind(this),\n this.reduceRemove.bind(this), this.reduceInit.bind(this)));\n }\n\n // reapply the filters\n if (this.source && this.forceAllData_ == true) {\n this.timeModel_.applyFilters(tempFilters);\n }\n\n if (filters) {\n for (var id in filters) {\n this.timeModel_.filterDimension(id, undefined);\n }\n }\n\n\n results = /** @type {!Array<!ColorBin>} */ (results.map(this.map, this).filter(function(item) {\n return item != undefined;\n }));\n\n if (this.sortFn) {\n googArray.sort(results, this.sortFn);\n }\n }\n\n this.results = results;\n }", "function buildArray(result, item) {\n result.push(item)\n return result\n}", "tallyResults() { \n const results = { correct: this.correctCards.length, incorrect: this.incorrectCards.length};\n this.resortMatrix(this.correctCards, true);\n this.resortMatrix(this.incorrectCards, false);\n this.correctCards = [];\n this.incorrectCards = [];\n return results;\n }", "function waitForAll(resultArr) {\n\t\t//console.log(\"waiting\", resultArr);\n return Promise.all(resultArr[1]).then(function(resArr){ //Todo: think of merging card data & card improvements\n resultArr.pop();\n resultArr.push(resArr);\n return resultArr;\n })\n }", "mergeNewPieceTo(array){\n\n\t\tthis.newPiece.reduce((acc, element, index) => {\n\n\t\t\tlet x = this.newPiecePosition[0] + index%this.newPieceLen;\n\t\t\tlet y = this.newPiecePosition[1] + Math.trunc(index/this.newPieceLen);\n\n\n\n\t\t\t//Ou juste element ?\n\t\t\tif(element > 0){\n\t\t\t\tacc[x + y * this.boardLen] = element;\n\t\t\t}\n\n\t\t\treturn acc;\n\n\t\t}, array);\n\n\t}", "function processArray(catalog,item){\n var tempArray = new Array();\n // console.log(productArray.length);\n for(var i1=0;i1<productArray.length;i1++){\n if(productArray[i1][item]==catalog){\n //write productArray\n tempArray.push(productArray[i1]);\n }else if(catalog==\"all\"){\n //console.log(productArray);\n return productArray;\n }\n }\n if(tempArray.length == 0){\n // console.log(\"no result\");\n return 0;\n }else{\n return tempArray;\n }\n}", "function findData() {\n return myArray.map(callDataController);\n }", "toArray() {}", "toArray() {}", "toArray() {}", "function addElementsToFinal (arrayOfArrays) {\n //base case: no remaining elements in input array\n if (!arrayOfArrays.length) {\n return finalArray;\n }\n //for each subarray in the source arrays first element...\n for (var i = 0; i < arrayOfArrays[0].length; i++) {\n //...add to the results array\n finalArray.push(arrayOfArrays[0][i]);\n }\n //recursive function call of the rest of the source array\n return addElementsToFinal (arrayOfArrays.slice(1));\n }", "toArray() {\r\n let result = new Array(this.rows);\r\n result = this.data.splice(0);\r\n return result;\r\n }", "function getResults() {\n let results = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (let i = 0; i < 6; i++) {\n results[i] = sameValuePoints(i);\n }\n results[6] = onePairPoints();\n results[7] = twoPairPoints();\n results[8] = threeSamePoints();\n results[9] = fourSamePoints();\n results[10] = fullHousePoints();\n results[11] = smallStraightPoints();\n results[12] = largeStraightPoints();\n results[13] = chancePoints();\n results[14] = yatzyPoints();\n\n return results;\n}", "function pushArray() {\n\t\t\tfor (var i = 0; i<friends.length; i++) {\n\t\t\t\tfor (var x = 0; x<friends[i].scores.length; x++) {\n\t\t\t\t\ttotal += parseInt(friends[i].scores[x]);\n\t\t\t\t}\n\t\t\t\ttotalArray.push(total);\n\t\t\t\ttotal = 0;\n\t\t\t}\n\t\t\tconsole.log(totalArray);\n\t\t\tdifference();\n\t\t}", "formatSearchResults(rawResults) {\r\n const results = new Array();\r\n const tempResults = rawResults.results ? rawResults.results : rawResults;\r\n for (const tempResult of tempResults) {\r\n const cells = tempResult.Cells.results ? tempResult.Cells.results : tempResult.Cells;\r\n results.push(cells.reduce((res, cell) => {\r\n Object.defineProperty(res, cell.Key, {\r\n configurable: false,\r\n enumerable: true,\r\n value: cell.Value,\r\n writable: false,\r\n });\r\n return res;\r\n }, {}));\r\n }\r\n return results;\r\n }", "function _toPipeline() {\n var oReturn = {\n toArray: function() {\n return aLastResults.map(function(o) {\n return o.$element.get(0);\n });\n },\n pipe: pipe\n };\n\n // add plugin functions to pipeline object\n aPlugins.forEach(function(oPlugin) {\n oReturn[oPlugin.name] = function() {\n _invokePlugin(oPlugin, aLastResults);\n return _toPipeline();\n };\n });\n\n _populateSearchTargetVariables(oReturn, aLastResults);\n\n // borrow properties/functions from Array.prototype\n // TODO: should I just copy directly from aLastResults?\n Object.getOwnPropertyNames(Array.prototype).slice(0).filter(function(o) {\n return jQuery.isFunction(Array.prototype[o]);\n }).forEach(function(sFunctionName) {\n oReturn[sFunctionName] = jQuery.proxy(Array.prototype[sFunctionName], _toControl(aLastResults));\n });\n oReturn.length = oReturn.toArray().length;\n\n return oReturn;\n }", "collectAlbums(){\n let resultadoAlbums = this.artists.map((fArtist) => fArtist.albums);\n let flatResultado = resultadoAlbums.reduce(function(a, b) { \n return a.concat(b);\n }, new Array);\n return flatResultado;\n }", "function obtenerVectoresPesos() {\n myArray = inicializarArr(attributesGlobal.length);\n for (var i = 0; i < attributesGlobal.length; i++) { \n my_id = \"arq_tbody_id_\"+(i);\n mv = calcularVectorPesosAPartirDelTbody(document.getElementById(my_id));\n for (var j = 0; j < mv.length; j++) {\n // console.log(mv[j]);\n //w = myArray[j] + mv[j];\n myArray[j].push(mv[j]); \n };\n }\n return myArray;\n}", "function initializeResults() {\n resultsContainer.empty();\n var restaurantsToAdd = [];\n for (var i = 0; i < restaurants.length; i++) {\n restaurantsToAdd.push(createResults(restaurants[i]));\n }\n resultsContainer.append(restaurantsToAdd);\n }", "function toArray() {\n return this.map();\n }", "function getAllResult(){\r\n\t\r\n\tif (processDone) {\r\n for(var key in Obj_Fetch)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tvar temp_var={};\r\n\t\t\t\t\t\ttemp_var.cancertype=key;\r\n\t\t\t\t\t\ttemp_var.male=Obj_Fetch[key].MALE;\r\n\t\t\t\t\t\ttemp_var.female=Obj_Fetch[key].FEMALE;\r\n\t\t\t\t\t\tfetch_data_array.push(temp_var);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\taddAllScatterPlot(fetch_data_array);\r\n\t\t\t\t\t\t\r\n } else {\r\n setTimeout(getResult, 250);\r\n }\r\n }", "function mergeResults(contentArray) {\n return contentArray.reduce((merged, n) => merged.concat(n.content), []);\n}", "function getArray1(items) {\n return new Array().concat(items);\n}", "function appendActData(srchResult, arrayIndex) {\n\t\tif(isNotEmpty(srchResult)){\n\t\t\t\n\t\t\tfor(var i = 0; i < srchResult.length; i++){\n\t\t\t\tvar salesrep_id = srchResult[i].getText(cols[0].getName(), cols[0].getJoin(), cols[0].getSummary());\n\t\t\t\tvar salesrep = salesrep_id.substr(salesrep_id.indexOf(\" \")+1, salesrep_id.length);\n\t\t\t\tif( !isInArray(activityData, salesrep)){\n\t\t\t\t\tactivityData.push([salesrep]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// find sales rep's array and append to activityData[i][1]\n\t\t\t\tif(indexOfSalesRep(activityData, salesrep)){\n\t\t\t\t\tvar index = indexOfSalesRep(activityData, salesrep);\n\t\t\t\t\tactivityData[index][arrayIndex] = parseInt(srchResult[i].getValue(cols[1].getName(), cols[1].getJoin(), cols[1].getSummary()));\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "function spreadResult(result) {\n var _results = [];\n if (result && Object.keys(result).length) {\n if (typeof result.entries !== 'undefined') _results.push(result.entries);\n if (typeof result.assets !== 'undefined') _results.push(result.assets);\n if (typeof result.content_type !== 'undefined' || typeof result.schema !== 'undefined') _results.push(result.content_type || result.schema);\n if (typeof result.count !== 'undefined') _results.push(result.count);\n if (typeof result.entry !== 'undefined') _results = result.entry;\n if (typeof result.asset !== 'undefined') _results = result.asset;\n if (typeof result.items !== 'undefined') _results.push(result);\n }\n return _results;\n}", "function appendActData(srchResult, arrayIndex) {\n\t\t\tif(isNotEmpty(srchResult)){\n\t\t\t\t\n\t\t\t\tfor(var i = 0; i < srchResult.length; i++){\n\t\t\t\t\tvar salesrep_id = srchResult[i].getText(cols[0].getName(), cols[0].getJoin(), cols[0].getSummary());\n\t\t\t\t\tvar salesrep = salesrep_id.substr(salesrep_id.indexOf(\" \")+1, salesrep_id.length);\n\t\t\t\t\tif( !isInArray(activityData, salesrep)){\n\t\t\t\t\t\tactivityData.push([salesrep]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// find sales rep's array and append to activityData[i][1]\n\t\t\t\t\tif(indexOfSalesRep(activityData, salesrep)){\n\t\t\t\t\t\tvar index = indexOfSalesRep(activityData, salesrep);\n\t\t\t\t\t\tactivityData[index][arrayIndex] = parseInt(srchResult[i].getValue(cols[1].getName(), cols[1].getJoin(), cols[1].getSummary()));\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t}", "toArray() {\n let arr = [];\n let n = this._dummy.next;\n\n while (n !== this._dummy) {\n arr.push(n.data);\n n = n.next;\n }\n\n return arr;\n }", "function finalFunction(arr) {\n var arr = []\n for(var i=10; i < arr.length, i++ ) {\n return arr\n } \n}", "toArray() {\n let array = []\n for (let tmp = this.min; tmp <= this.max; tmp = this._next(tmp))\n array.push(tmp);\n return array;\n }", "function findDistances(results) {\n let arrayLocation = [];\n\n /* Use geolib to determine meter distances given coordinates */\n for (let i = 0; i < results.length; i++) {\n arrayLocation.push(\n geolib.getDistance(\n {\n 'latitude': results[i].geometry.location.lat,\n 'longitude': results[i].geometry.location.lng,\n },\n {\n 'latitude': location.lat,\n 'longitude': location.lng,\n }\n )\n\n );\n }\n\n return arrayLocation;\n}", "toArray() {\n return this._array.slice();\n }", "function compute(){\n var newLocations = locations;\n newLocations.forEach(function(currentValue,currentIndex){\n for(num in currentValue.loc){\n if (num == \"latitude\"){\n var c = currentValue.loc.latitude;\n lat.push(c);\n } else if (num == \"longitude\") {\n var d = currentValue.loc.longitude;\n lon.push(d);\n }\n }\n});\n}", "function addAllToArray(items,arr){for(var i=0;i<items.length;i++){arr.push(items[i]);}}", "function renderResults(){\n resultsArray = [];\n visibleMarkersId = [];\n visibleMarkersOnMap = [];\n\n for (var i = 0; i < newMarkers.length; i++) {\n if ( map.getBounds().contains(newMarkers[i].getPosition()) ){\n visibleMarkersOnMap.push(newMarkers[i]);\n visibleMarkersId.push( $(newMarkers[i].content.firstChild).attr(\"data-id\") );\n newMarkers[i].setVisible(true);\n }\n else {\n newMarkers[i].setVisible(false);\n }\n }\n markerCluster.repaint();\n }", "function formatDataForTableBuilding(data) {\n var collectionToAppend = data.results.map((valueSet, idx) => [formatDate(valueSet.date.local), valueSet.location, valueSet.parameter, valueSet.value, valueSet.unit ])\n\n //console.log(collectionToAppend);\n return collectionToAppend;\n}", "function DeclareArray() {\n arrayRiseSet = new Array(arrayInfo.length);\n arrayPressure = new Array(arrayInfo.length);\n arrayHum = new Array(arrayInfo.length);\n arrayClo = new Array(arrayInfo.length);\n arrayTempRange = new Array(arrayInfo.length);\n arrayTempAvg = new Array(arrayInfo.length);\n arrayRain = new Array(arrayInfo.length);\n arrayVis = new Array(arrayInfo.length);\n arrayWind = new Array(arrayInfo.length);\n results = [];\n}", "collect (rootAstNode) {\n return new Set(rootAstNode.nodes.flatMap(n => this.#results.get(n)))\n }", "function newArray(inArray){\n\tvar outArray =[];\n\toutArray.push(inArray[0]);\n\t\toutArray.push(stiCalc(inArray));\n\n\t\t\n\n\t\tvar totalBonus = (parseFloat(outArray[1]) * parseFloat(inArray[2]));\n\t\toutArray.push(parseFloat(inArray[2]) + parseFloat(totalBonus));\n\t\toutArray.push(totalBonus);\n\t\tconsole.log(outArray);\n}", "function obtenerResultados(funcion, arr) {\n\tif (arr.length === 0) {\n\t\tthrow new Error(\n\t\t\t\"No se ingresaron números a operar\"\n\t\t);\n\t} else if ((arr.length % 2) !== 0) {\n\t\tthrow new Error(\n\t\t\t\"Se esperaba un número par de elementos para operar, \" + \n\t\t\t\"pero se ingresaron: \" + arr.length\n\t\t);\n\t} else {\n\t\tvar arrayOper = [];\n\t\tarr.reduce(function(valorPrevio, valorActual, indice, array) {\n\t\t\t//console.log(valorPrevio, valorActual) // Validación del funcionamiento del reduce()\n\t\t\tarrayOper.push(funcion(valorPrevio, valorActual));\n\t\t\treturn valorActual;\n\t\t});\n\t\tvar arrayResultado = [];\n\t\tfor (var i = 0; i < arrayOper.length; i += 2) {\n\t\t\tarrayResultado.push(arrayOper[i]);\n\t\t}\n\t\treturn arrayResultado;\n\t\t//return arrayOper; // Retorno si se multiplican todos los pares de elementos del array\n\t}\n}", "function populateResults(callback) {\n\t\tshirtTitles.forEach((vally, indy, arry) => {\n\t\t\tresults[indy].Title = vally;\n\t\t\tresults[indy].Price = shirtPrices[indy];\n\t\t\tresults[indy].ImageURL = shirtImgs[indy];\n\t\t\tresults[indy].URL = shirtURLs[indy];\n\t\t\tresults[indy].Time = getDate();\n\t\t});\n\t\tcallback();\n\t}", "function enlarge(){\n\ttemp = new Array(queries.length*2);\n\tvar i;\n\tfor(i = 0; i < queries.length; i++){\n\t\ttemp[i] = queries[i];\n\t}\n\tqueries = temp;\n}", "function vintageArray (fn, arr) {\r\n\tvar vinCalc = []; \r\n\tfor (var i =0; i<yearOfManu.length; i++) {\r\n\t\tvinCalc.push(fn(arr[i])); \r\n\t}\r\n\treturn vinCalc; \r\n}", "toArray () {\n return this._content.map(function (x, i) {\n return x.val\n })\n }", "function collectArr(){\n biayaArr=[];\n var tot=0;\n $('.biayaTR').each(function (id,item){\n var value=$(this).attr('val');\n tot+=getCurr($('#biayaKurangTD_'+value).html());\n biayaArr.push(value);\n });\n $('#totalTD').html('Rp. '+(parseInt(tot).setCurr()));\n return biayaArr;\n }", "function Metrics(results) {\n Metrics.results.push(results);\n}", "copyResults() {\n for(let col = 0; col < this.width; col++) {\n for(let row = 0; row < this.height; row++) {\n this.grid[col][row] = this.resultGrid[col][row]\n }\n }\n }", "toArray() {\n\n }", "function shearMyData() {\r\n for (let index = 0; index < AllProducts.length; index++) {\r\n clicks.push(AllProducts[index].clicks);\r\n views.push(AllProducts[index].views);\r\n\r\n }\r\n}", "function create2DArr(rows){\n //start an array\n var array = [];\n \n //loop through the array\n for(var i=0;i<rows;i++){\n //put an array in that index\n array[i] = [];\n }\n \n return array;\n}", "function initResult() {\n var series = [],\n i = 0\n while (i < NUMBER_OF_SERIES) {\n series.push({\n codingType: 0,\n codingTable: 0,\n resolution: null,\n uncompressSamples: []\n })\n i += 1\n }\n return {\n batch_counter: 0,\n batch_relative_timestamp: 0,\n series: series\n }\n}", "function extract (arr){\n async.each(arr, exe, done);\n}", "getRelatedRecords(results, dataStore){\n const relationships = this.relationships;\n let cnt = 0, finalCnt = 0; \n if(relationships && relationships.length > 0 ){\n results.map(result => { \n relationships.map(relation=>{\n cnt = 0;\n let relatedStore = dataStore[relation.model];\n let key = (relation.in_current === true) ? relation.primary_key : relation.foreign_key;\n let val = (relation.in_current === true) ? result[relation.foreign_key] : result[relation.primary_key];\n let items = this.getRelatedValue(relatedStore,key,val);\n items.map(item => {\n cnt++;\n let k = `${[relation.model]}_${cnt}`;\n if(k in result){\n cnt = finalCnt+1;\n }\n k = `${[relation.model]}_${cnt}`;\n //result[[relation.model]] = item[relation.return_value];\n result[k] = item[relation.return_value];\n finalCnt = cnt;\n }); \n }); \n });\n }\n return results;\n }", "tracksForPlaylist(genres , duration){\n let tracks = this.getTracksMatchingGenres(genres);\n let res = [];\n for(let i=0;this.sumarTiempoDeTracks(res)<duration && i<tracks.length;i++){ \n res[i]=tracks[i];\n }\n return res;\n}", "function parseNews(results) {\n\t\t\n\t\tvar news_array = []\n\t\t//console.log(news_array);\n\t\tvar length;\n\n\t\tif(results.length > 3)\n\t\t\tlength = 3;\n\t\telse\n\t\t\tlength = results.length;\n\n\t\tfor (count = 0; count < length; count++) {\n\t\t\tnews_array[count] = results[count].abstract;\n\t\t}\n\n\t\treturn news_array;\n}", "toArray(cb) {\n cb = typeof cb === \"function\" ? cb : null;\n \n let values = [];\n \n this.each((v, n) => {\n values.push(cb ? cb.call(this, v, n) : v);\n });\n \n return values;\n }", "toArray() {\r\n // copy\r\n return this.values.map((v) => v);\r\n }", "toArray()\r\n {\r\n var a = [], list, k = size;\r\n for (var i = 0; i < k; i++)\r\n {\r\n list = this.#table[i];\r\n var l = list.length; \r\n \r\n for (var j = 0; j < l; j++)\r\n a.push(list[j]);\r\n }\r\n return a;\r\n }", "toArray()\n\t{\n\t\t//TODO: done\n\t\treturn [this.x, this.y, this.z];\n\t}", "function pushArr(value){\n var op = Math.round(Math.sqrt(Math.pow(earthRadius + value.avgAlt, 3) / GM) * 2 * Math.PI);\n delete value.avgAlt;\n value.orbitalPeriod = op;\n returnArr.push(value);\n }", "generateResultGrid () {\n this.results = this.shuffleArray(this.baseNumbers)\n }", "function cargarDatosEnGrafico(result){\n loadArray3(result.values);\n}", "function collectArr() {\n checkedArr = {\n id: arrId,\n material: materialCheck,\n size: sizeCheck,\n price: materialCheckPrice*(sizeCheck/100),\n }\n}", "function allJsonToArray(vacancy, result)\n{\n var array = [];\n for(key in result)\n {\n if(result.hasOwnProperty(key))\n {\n array.push(result[key]);\n }\n }\n getDetailsFromArray(vacancy, array);\n}", "function rebuildQuestionsArray() {\n questionsArray = questionsArray.concat(questionsAnswered);\n questionsAnswered = [];\n}", "function populateArrays(artists) {\n for(i = 0; i < artists.length; i++) {\n names[i] = artists[i].name\n earnings[i] = (artists[i].streams * 0.007)\n }\n }", "function loop2() {\n targetArray.push(...emptyArray);\n}", "filterToArray() {\n return this.filter.apply(this, arguments).base;\n }", "function logResult(result) {\n for (let i = 0; i <result[0].DataTable.length ; i++) {\n products.push(result[0].DataTable[i]);\n products[i].inCart = 0;\n }\n for (let i = 0; i < result[1].DataTable.length; i++) {\n images.push(result[1].DataTable[i]);\n }\n for (let i = 0; i < result[2].DataTable.length; i++) {\n productCategorie.push(result[2].DataTable[i])\n }\n}", "function generateArrays(data) {\n searchResults = new Array();\n var courseNum = null;\n $.each(data, function (key, value) {\n courseNum = value['courseNum'];\n searchResults.push(new Course(value));\n });\n }" ]
[ "0.7071986", "0.6731019", "0.66542625", "0.665342", "0.665342", "0.665342", "0.665342", "0.665342", "0.665342", "0.64975107", "0.61560345", "0.6110735", "0.61004466", "0.6061947", "0.6025506", "0.6016042", "0.5947504", "0.59438074", "0.59333307", "0.59293604", "0.5917254", "0.59021235", "0.58752793", "0.5874598", "0.58728427", "0.5851507", "0.58496463", "0.5826074", "0.5823143", "0.5786167", "0.5780388", "0.5766257", "0.5762229", "0.57589465", "0.5731444", "0.572082", "0.57193714", "0.5691196", "0.56590533", "0.56558114", "0.56558114", "0.56558114", "0.56535286", "0.56488156", "0.5647067", "0.5624928", "0.5616855", "0.56060475", "0.5604848", "0.5561402", "0.55585814", "0.5553184", "0.5545656", "0.5526684", "0.55226225", "0.55225986", "0.5513016", "0.5511305", "0.5510861", "0.5499939", "0.5487239", "0.5485052", "0.54712325", "0.5460116", "0.54590446", "0.54552686", "0.5454242", "0.54531574", "0.54435724", "0.5443247", "0.5441013", "0.5440245", "0.54350984", "0.54289854", "0.54288393", "0.5426412", "0.5420447", "0.542013", "0.541992", "0.5414325", "0.5411739", "0.5405927", "0.5402976", "0.5394099", "0.53866976", "0.5386378", "0.53822935", "0.5379115", "0.5378099", "0.537456", "0.5369855", "0.5368737", "0.53625506", "0.5358763", "0.5339697", "0.5337327", "0.5332615", "0.5329017", "0.532575", "0.53235376", "0.53212786" ]
0.0
-1
RGB([primaries]) RGB(value [, primaries]]) RGB(red, green, blue [, primaries])
constructor(...args) { const rest = [...args] const scope = internal(this) if (args[args.length - 1] instanceof Primaries) { scope.primaries = rest.pop() } else { scope.primaries = Primaries.sRGB } if (rest.length === 0) { this.r = 0 this.g = 0 this.b = 0 } else if (rest.length === 1) { const [value] = rest this.r = value || 0 this.g = value || 0 this.b = value || 0 } else { const [r, g, b] = rest this.r = r || 0 this.g = g || 0 this.b = b || 0 } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rgb(r, g, b) {\n \n}", "set ETC_RGB4(value) {}", "function getColor(value) {\n // More votes for republican, show red\n var red = 0;\n var blue = 0;\n var green = 0;\n if (value > 1) {\n var trimmed_value = Math.min(value, 3);\n red = 255;\n blue = Math.round((1 - trimmed_value / 3) * 255);\n green = Math.round((1 - trimmed_value / 3) * 255);\n trimmed_value = null;\n } else if (value == 1) {\n return \"#FFFFFF\";\n } else if (value < 1) {\n var trimmed_value = 1 / value;\n trimmed_value = Math.min(trimmed_value, 3);\n blue = 255;\n red = Math.round((1 - trimmed_value / 3) * 255);\n green = Math.round((1 - trimmed_value / 3) * 255);\n trimmed_value = null;\n }\n var second = red % 16;\n var first = (red - second) / 16;\n var fourth = green % 16;\n var third = (green - fourth) / 16;\n var sixth = blue % 16;\n var fifth = (blue - sixth) / 16;\n return (\"#\" + first.toString(16) + second.toString(16) + third.toString(16) + fourth.toString(16) + fifth.toString(16) + sixth.toString(16));\n }", "set ASTC_RGB_10x10(value) {}", "function color(interest1) { //interest1 is 0-1 scaled relative value of first word in pair\n if (interest1 === undefined || interest1 === GREYVALUE) {\n return GREYCOLOR;\n }\n let red = 255 * interest1;\n let blue = 255 * (1 - interest1);\n return `rgb(${red}, 25, ${blue})` //backtick means string, ${} interpolates rgb values \n}", "function rgb(r, g, b){\n return `rbg(${r}, ${g}, ${b})`\n}", "function rgb(r, g, b)\n{ return 'rgb('+clamp(Math.round(r),0,255)+', '+clamp(Math.round(g),0,255)+', '+clamp(Math.round(b),0,255)+')';}", "set ASTC_RGB_5x5(value) {}", "function colorRGB(){\n var coolor = \"(\"+generarNumero(255)+\",\" + generarNumero(255) + \",\" + generarNumero(255) +\")\";\n return \"rgb\" + coolor;\n }", "get rgb_1() {\n let c = new Color(this.r, this.g, this.b);\n return [c.r / 255, c.g / 255, c.b / 255];\n }", "set ETC2_RGB4(value) {}", "function rgb(r, g, b) {\r\n return \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\r\n}", "set ASTC_RGB_4x4(value) {}", "set ASTC_RGB_6x6(value) {}", "function rgb(r, g, b) \n{ \n\treturn 'rgb('+clamp(Math.round(r),0,255)+', '+clamp(Math.round(g),0,255)+', '+clamp(Math.round(b),0,255)+')';\n}", "function rgb(r, g, b) \n{ \n\treturn 'rgb('+clamp(Math.round(r),0,255)+', '+clamp(Math.round(g),0,255)+', '+clamp(Math.round(b),0,255)+')';\n}", "set ASTC_RGB_8x8(value) {}", "function rgb(r, g, b) {\n return \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n}", "function rgb(r, g, b) {\n return \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n}", "function rgb(r, g, b) {\n return \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n}", "function rgb(r, g, b) {\n return \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n}", "function Colour(rgb) {\n this.rgb = rgb;\n}", "brighter(){\n\t\tthis.addColorValue(\"red\", 30);\n\t\tthis.addColorValue(\"green\", 30);\n\t\tthis.addColorValue(\"blue\", 30);\n\t}", "function rgb (r, g, b) {\n var red = r / 255 * 5\n , green = g / 255 * 5\n , blue = b / 255 * 5\n return rgb5(red, green, blue)\n}", "function rgb (r, g, b) {\n var red = r / 255 * 5\n , green = g / 255 * 5\n , blue = b / 255 * 5\n return rgb5(red, green, blue)\n}", "function rgb (r, g, b) {\n var red = r / 255 * 5\n , green = g / 255 * 5\n , blue = b / 255 * 5\n return rgb5(red, green, blue)\n}", "redder(){\n\t\tthis.multiplyColorValue(\"red\", 1.2);\n\t}", "function rgb(r, g, b) { \n\treturn 'rgb('+clamp(Math.round(r),0,255)+', '+clamp(Math.round(g),0,255)+', '+clamp(Math.round(b),0,255)+')';\n}", "get ASTC_RGB_5x5() {}", "function vjRGB(red, green, blue)\n{\n return new vjColor({r:red, g:green, b:blue});\n}", "function RGB(r, g, b) {\n this.setR(r);\n this.setG(g);\n this.setB(b);\n}", "function getRGB(col){\n return \"rgb(\"+col.r+\", \"+col.g+\", \"+col.b+\")\";\n}", "set ATC_RGB4(value) {}", "set color(value) {}", "function ColorIntensityPalette() {\n this.positive = [255, 0, 0];\n this.neutral = [200, 200, 200];\n this.negative = [0, 93, 144];\n\n this.rgb = function(color) {\n rgb = \"rgb(\" + \n color[0] + \",\" +\n color[1] + \",\" +\n color[2] + \")\";\n return rgb;\n }\n\n this.str = function(intensity) {\n if (intensity > 0) {\n var top_color = this.positive;\n } else {\n var top_color = this.negative;\n intensity = -intensity;\n }\n\n s = \"rgb(\";\n for (var i=0; i<3; i++) {\n diff = top_color[i] - this.neutral[i];\n s += Math.floor(this.neutral[i] + diff*intensity);\n if (i < 2) {\n s += \",\"\n }\n }\n s += \")\"\n return s;\n }\n}", "function rgb(r, g, b)\n{\n\treturn 'rgb('+clamp(Math.round(r),0,255)+', '+clamp(Math.round(g),0,255)+', '+clamp(Math.round(b),0,255)+')';\n}", "get rgb() { return [this.r, this.g, this.b]; }", "set PVRTC_RGB2(value) {}", "function rgbOrange() {\n var val1 = randRGB();\n var val2 = randRGB();\n var val3 = randRGB();\n return \"rgb(\" + (val1 + 20) + \", \" + val1 / 2.3 + \", \" + 0 + \")\";\n}", "calcRGB() {\r\n let h = this.h/360;\r\n let s = this.s/100;\r\n let l = this.l/100;\r\n let r, g, b;\r\n if (s == 0){\r\n r = g = b = l; // achromatic\r\n } else {\r\n let q = l < 0.5 ? l * (1 + s) : l + s - l * s;\r\n let p = 2 * l - q;\r\n r = this.hue2rgb(p, q, h + 1/3);\r\n g = this.hue2rgb(p, q, h);\r\n b = this.hue2rgb(p, q, h - 1/3);\r\n }\r\n this._r = Math.round(r * 255); \r\n this._g = Math.round(g * 255); \r\n this._b = Math.round(b * 255);\r\n }", "get ETC_RGB4() {}", "function rgb5 (r, g, b) {\n var red = Math.round(r)\n , green = Math.round(g)\n , blue = Math.round(b)\n return 16 + (red*36) + (green*6) + blue\n}", "function rgb5 (r, g, b) {\n var red = Math.round(r)\n , green = Math.round(g)\n , blue = Math.round(b)\n return 16 + (red*36) + (green*6) + blue\n}", "function rgb5 (r, g, b) {\n var red = Math.round(r)\n , green = Math.round(g)\n , blue = Math.round(b)\n return 16 + (red*36) + (green*6) + blue\n}", "constructor(...args) {\n this.r = 0;\n this.g = 0;\n this.b = 0;\n this.a = 255;\n /* Handle Color([...]) -> Color(...) */\n if (args.length == 1 && args[0] instanceof Array) {\n args = args[0];\n }\n if (args.length == 1) {\n /* Handle Color(Color) and Color(\"string\") */\n let arg = args[0];\n if (arg instanceof Color) {\n [this.r, this.g, this.b, this.a] = [arg.r, arg.g, arg.b, arg.a];\n this.scale = arg.scale;\n } else if (typeof(arg) == \"string\" || arg instanceof String) {\n let [r, g, b, a] = ColorParser.parse(arg);\n [this.r, this.g, this.b, this.a] = [r, g, b, a];\n } else {\n throw new TypeError(`Invalid argument \"${arg}\" to Color()`);\n }\n } else if (args.length >= 3 && args.length <= 4) {\n /* Handle Color(r, g, b) and Color(r, g, b, a) */\n [this.r, this.g, this.b] = args;\n if (args.length == 4) this.a = args[3];\n } else if (args.length > 0) {\n throw new TypeError(`Invalid arguments \"${args}\" to Color()`);\n }\n }", "set colorValue(value) {}", "set ASTC_RGB_12x12(value) {}", "function rgbRed() {\n var val1 = randRGB();\n var val2 = randRGB();\n var val3 = randRGB();\n return \"rgb(\" + val1 + \", \" + 0 + \", \" + val1 / 4 + \")\";\n}", "function getRgbCss(r, g, b) {\r\n\treturn 'color: rgb(' + r + ',' + g + ',' + b + ');';\r\n}", "function checkColor(args){\n\tvar p = args[0];\n\tvar rgb = args[1];\n\tviewerParams.Pcolors[p] = [rgb.r/255., rgb.g/255., rgb.b/255., rgb.a];\n\t//update the octree loading bar if it exists\n\tif (viewerParams.haveOctree[p]){\n\t\td3.select('#' + p + 'octreeLoadingFill').attr('fill','rgb(' + (255*viewerParams.Pcolors[p][0]) + ',' + (255*viewerParams.Pcolors[p][1]) + ',' + (255*viewerParams.Pcolors[p][2]) + ')')\n\t\td3.select('#' + p + 'octreeLoadingText').attr('fill','rgb(' + (255*viewerParams.Pcolors[p][0]) + ',' + (255*viewerParams.Pcolors[p][1]) + ',' + (255*viewerParams.Pcolors[p][2]) + ')')\n\t}\n}", "get ASTC_RGB_10x10() {}", "function rgb(val) {\n var num = val.split('#')[1];\n var r = parseInt(num.slice(0,2), 16);\n var g = parseInt(num.slice(2,4), 16);\n var b = parseInt(num.slice(4,6), 16);\n return {r: r, g: g, b: b};\n}", "function rgbGreen() {\n var val1 = randRGB();\n var val2 = randRGB();\n var val3 = randRGB();\n return \"rgb(\" + val1 + \", \" + val1 + \", \" + 0 + \")\";\n}", "function rgb(r, g, b) {\n\treturn [r / 255, g / 255, b / 255, 1];\n}", "function mapColor(value) {\n let r = map(value, 0, 1, 0, 255);\n let g = map(value, 0, 1, 255, 0);\n let b = 255 - g - r;\n return { \n r:r,\n g:g,\n b:b\n }\n}", "function RGBColor(color_string)\n{\n this.ok = false;\n\n // strip any leading #\n if (color_string.charAt(0) == '#') { // remove # if any\n color_string = color_string.substr(1,6);\n }\n\n color_string = color_string.replace(/ /g,'');\n color_string = color_string.toLowerCase();\n\n // array of color definition objects\n var color_defs = [\n {\n re: /^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,\n example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],\n process: function (bits){\n return [\n parseInt(bits[1]),\n parseInt(bits[2]),\n parseInt(bits[3])\n ];\n }\n },\n {\n re: /^(\\w{2})(\\w{2})(\\w{2})$/,\n example: ['#00ff00', '336699'],\n process: function (bits){\n return [\n parseInt(bits[1], 16),\n parseInt(bits[2], 16),\n parseInt(bits[3], 16)\n ];\n }\n },\n {\n re: /^(\\w{1})(\\w{1})(\\w{1})$/,\n example: ['#fb0', 'f0f'],\n process: function (bits){\n return [\n parseInt(bits[1] + bits[1], 16),\n parseInt(bits[2] + bits[2], 16),\n parseInt(bits[3] + bits[3], 16)\n ];\n }\n }\n ];\n\n // search through the definitions to find a match\n for (var i = 0; i < color_defs.length; i++) {\n var re = color_defs[i].re;\n var processor = color_defs[i].process;\n var bits = re.exec(color_string);\n if (bits) {\n channels = processor(bits);\n this.r = channels[0];\n this.g = channels[1];\n this.b = channels[2];\n this.ok = true;\n }\n\n }\n\n // validate/cleanup values\n this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r);\n this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g);\n this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b);\n}", "constructor(white, red, green, blue) {\n this.white = white;\n this.red = red;\n this.green = green;\n this.blue = blue;\n }", "get colorValue() {}", "function rgbBlue() {\n var val1 = randRGB();\n var val2 = randRGB();\n var val3 = randRGB();\n return \"rgb(\" + 30 + \", \" + val1 + \", \" + val1 + \")\";\n}", "function rgb(color){\n return [color[0]/255, color[1]/255, color[2]/255];\n}", "function RGB_HSV(r,g,b){r/=255;g/=255;b/=255;var n=Math.min(Math.min(r,g),b);var v=Math.max(Math.max(r,g),b);var m=v-n;if(m===0){return[null,0,100*v];}var h=r===n?3+(b-g)/m:g===n?5+(r-b)/m:1+(g-r)/m;return[60*(h===6?0:h),100*(m/v),100*v];}// h: 0-360", "function colour(v,type){\n\n\t\t// Colour scales defined by SAOImage\n\t\tif(type==\"blackbody\" || type==\"heat\") return [((v<=127.5) ? v*2 : 255), ((v>63.75) ? ((v<191.25) ? (v-63.75)*2 : 255) : 0), ((v>127.5) ? (v-127.5)*2 : 0)];\n\t\telse if(type==\"A\") return [((v<=63.75) ? 0 : ((v<=127.5) ? (v-63.75)*4 : 255)), ((v<=63.75) ? v*4 : ((v<=127.5) ? (127.5-v)*4 : ((v<191.25) ? 0: (v-191.25)*4))), ((v<31.875) ? 0 : ((v<127.5) ? (v-31.875)*8/3 : ((v < 191.25) ? (191.25-v)*4 : 0)))];\n\t\telse if(type==\"B\") return [((v<=63.75) ? 0 : ((v<=127.5) ? (v-63.75)*4 : 255)), ((v<=127.5) ? 0 : ((v<=191.25) ? (v-127.5)*4 : 255)), ((v<63.75) ? v*4 : ((v<127.5) ? (127.5-v)*4 : ((v<191.25) ? 0 : (v-191.25)*4 ))) ];\n\t\telse{\n\t\t\t// The Planck colour scheme\n\t\t\tvar dv,dr,dg,db,rgb;\n\t\t\t\n\t\t\tif(v < 42){\n\t\t\t\tdv = v/42;\n\t\t\t\trgb = [0,0,255];\n\t\t\t\tdr = 0;\n\t\t\t\tdg = 112;\n\t\t\t\tdb = 0;\n\t\t\t}else if(v >= 42 && v < 85){\n\t\t\t\tdv = (v - 42)/43;\n\t\t\t\trgb = [0,112,255];\n\t\t\t\tdr = 0;\n\t\t\t\tdg = 109;\n\t\t\t\tdb = 0;\n\t\t\t}else if(v >= 85 && v < 127){\n\t\t\t\tdv = (v - 85)/42;\n\t\t\t\trgb = [0,221,255];\n\t\t\t\tdr = 255;\n\t\t\t\tdg = 16;\n\t\t\t\tdb = -38;\n\t\t\t}else if(v >= 127 && v < 170){\n\t\t\t\tdv = (v - 127)/43;\n\t\t\t\trgb = [255,237,217];\n\t\t\t\tdr = 0;\n\t\t\t\tdg = -57;\n\t\t\t\tdb = -217;\n\t\t\t}else if(v >= 170 && v < 212){\n\t\t\t\tdv = (v-170)/42;\n\t\t\t\trgb = [255,180,0];\n\t\t\t\tdr = 0;\n\t\t\t\tdg = -105;\n\t\t\t\tdb = 0;\n\t\t\t}else if(v >= 212){\n\t\t\t\tdv = (v-212)/43;\n\t\t\t\trgb = [255,75,0];\n\t\t\t\tdr = -155;\n\t\t\t\tdg = -75;\n\t\t\t\tdb = 0;\n\t\t\t}\n\t\t\treturn [Math.round(rgb[0] + dv*dr), Math.round(rgb[1] + dv*dg), Math.round(rgb[2] + dv*db)];\n\t\t}\n\t}", "function hue2rgb(p,q,h){h=(h+1)%1;if(h*6<1){return p+(q-p)*h*6;}if(h*2<1){return q;}if(h*3<2){return p+(q-p)*(2/3-h)*6;}return p;}", "function hue2rgb(p,q,h){h=(h+1)%1;if(h*6<1){return p+(q-p)*h*6;}if(h*2<1){return q;}if(h*3<2){return p+(q-p)*(2/3-h)*6;}return p;}", "function hue2rgb(p,q,h){h=(h+1)%1;if(h*6<1){return p+(q-p)*h*6;}if(h*2<1){return q;}if(h*3<2){return p+(q-p)*(2/3-h)*6;}return p;}", "get ASTC_RGB_6x6() {}", "function RGB(r, g, b) {\n this.r = r;\n this.g = g;\n this.b = b;\n\n this.parse = function(s) {\n this.r = parseInt(s.substr(1, 2), 16);\n this.g = parseInt(s.substr(3, 2), 16);\n this.b = parseInt(s.substr(5, 2), 16);\n };\n\n this.toString = function() {\n var s = [];\n var c;\n\n s.push(\"#\");\n c = this.r.toString(16);\n s.push(c.length == 2 ? c : \"0\" + c);\n c = this.g.toString(16);\n s.push(c.length == 2 ? c : \"0\" + c);\n c = this.b.toString(16);\n s.push(c.length == 2 ? c : \"0\" + c);\n return s.join(\"\");\n };\n}", "function rgb(color){\n return [color[0]/255, color[1]/255, color[2]/255];\n }", "function RGB2Color(r,g,b)\n\t {\treturn '#' + byte2Hex(r) + byte2Hex(g) + byte2Hex(b); }", "function toRGB(R,G,B){\n\treturn \"#\"+(R).toString(16)+(G).toString(16)+(B).toString(16);\n}", "function generateColor(red, green, blue)\n{\n paintColor[0] = red;\n paintColor[1] = green;\n paintColor[2] = blue;\n}", "get ASTC_RGB_4x4() {}", "function hue2rgb(p,q,h){h = (h + 1) % 1;if(h * 6 < 1){return p + (q - p) * h * 6;}if(h * 2 < 1){return q;}if(h * 3 < 2){return p + (q - p) * (2 / 3 - h) * 6;}return p;}", "function hue2rgb(p,q,h){h = (h + 1) % 1;if(h * 6 < 1){return p + (q - p) * h * 6;}if(h * 2 < 1){return q;}if(h * 3 < 2){return p + (q - p) * (2 / 3 - h) * 6;}return p;}", "set ETC2_RGB4_PUNCHTHROUGH_ALPHA(value) {}", "function Color(red_, green_, blue_) {\n\t\t\tthis.blue = blue_;\n\t\t\tthis.green = green_;\n\t\t\tthis.red = red_;\n\t\t}", "function makeRGB(tuple=[0,0,0]) {\n return \"rgb(\" + tuple + \")\";\n}", "get ETC2_RGB4() {}", "function Color(r, g, b) {\n this.r = r;\n this.g = g;\n this.b = b;\n}", "function searchRGB() {\n let i = colorPicked;\n let rgbValues = i.split(\"(\")[1].split(\")\")[0].split(\", \");\n return rgbValues;\n}", "function searchRGB() {\n let i = colorPicked;\n let rgbValues = i.split(\"(\")[1].split(\")\")[0].split(\", \");\n return rgbValues;\n}", "function color_rgb(color){\n return function (obj){\n if(color[3] === undefined)\n return COLOR([color[0]/255.0, color[1]/255.0, color[2]/255.0])(obj);\n else\n return COLOR([color[0]/255.0, color[1]/255.0, color[2]/255.0, color[3]])(obj);\n }\n }", "function reddify(rgbArr){ //todo3 //needs to take in an array parameter\n rgbArr[RED] = 255 //use array with this\n }", "get ASTC_RGB_8x8() {}", "function parseColor(str){\n\t\tvar result;\n\t\n\t\t/**\n\t\t * rgb(num,num,num)\n\t\t */\n\t\tif((result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(str)))\n\t\t\treturn new Color(parseInt(result[1]), parseInt(result[2]), parseInt(result[3]));\n\t\n\t\t/**\n\t\t * rgba(num,num,num,num)\n\t\t */\n\t\tif((result = /rgba\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\s*\\)/.exec(str)))\n\t\t\treturn new Color(parseInt(result[1]), parseInt(result[2]), parseInt(result[3]), parseFloat(result[4]));\n\t\t\t\n\t\t/**\n\t\t * rgb(num%,num%,num%)\n\t\t */\n\t\tif((result = /rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(str)))\n\t\t\treturn new Color(parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55);\n\t\n\t\t/**\n\t\t * rgba(num%,num%,num%,num)\n\t\t */\n\t\tif((result = /rgba\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\s*\\)/.exec(str)))\n\t\t\treturn new Color(parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55, parseFloat(result[4]));\n\t\t\t\n\t\t/**\n\t\t * #a0b1c2\n\t\t */\n\t\tif((result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str)))\n\t\t\treturn new Color(parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16));\n\t\n\t\t/**\n\t\t * #fff\n\t\t */\n\t\tif((result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str)))\n\t\t\treturn new Color(parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16));\n\n\t\t/**\n\t\t * Otherwise, we're most likely dealing with a named color.\n\t\t */\n\t\tvar name = str.strip().toLowerCase();\n\t\tif(name == 'transparent'){\n\t\t\treturn new Color(255, 255, 255, 0);\n\t\t}\n\t\tresult = lookupColors[name];\n\t\treturn new Color(result[0], result[1], result[2]);\n\t}", "function color(grey){\n return {r:grey, g:grey, b:grey};\n}", "getColor(value) {\n // Test Max\n if (value === 255) {\n console.log(\"MAX!\");\n }\n let percent = (value) / 255 * 50;\n // return 'rgb(V, V, V)'.replace(/V/g, 255 - value);\n return 'hsl(H, 100%, P%)'.replace(/H/g, 255 - value).replace(/P/g, percent);\n }", "function setRGB(data, index, r, g, b) {\n\t\tdata[index] = r;\n\t\tdata[index + 1] = g;\n\t\tdata[index + 2] = b;\n\t\treturn data;\n\t}", "function RGB_HSV (r, g, b) {\r\n\t\t\t\tr /= 255;\r\n\t\t\t\tg /= 255;\r\n\t\t\t\tb /= 255;\r\n\t\t\t\tvar n = Math.min(Math.min(r,g),b);\r\n\t\t\t\tvar v = Math.max(Math.max(r,g),b);\r\n\t\t\t\tvar m = v - n;\r\n\t\t\t\tif (m === 0) { return [ null, 0, 100 * v ]; }\r\n\t\t\t\tvar h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m);\r\n\t\t\t\treturn [\r\n\t\t\t\t\t60 * (h===6?0:h),\r\n\t\t\t\t\t100 * (m/v),\r\n\t\t\t\t\t100 * v\r\n\t\t\t\t];\r\n\t\t\t}", "function Colour(){\n\n /* Returns an object representing the RGBA components of this Colour. The red,\n * green, and blue components are converted to integers in the range [0,255].\n * The alpha is a value in the range [0,1].\n */\n this.getIntegerRGB = function(){\n\n // get the RGB components of this colour\n var rgb = this.getRGB();\n\n // return the integer components\n return {\n 'r' : Math.round(rgb.r),\n 'g' : Math.round(rgb.g),\n 'b' : Math.round(rgb.b),\n 'a' : rgb.a\n };\n\n };\n\n /* Returns an object representing the RGBA components of this Colour. The red,\n * green, and blue components are converted to numbers in the range [0,100].\n * The alpha is a value in the range [0,1].\n */\n this.getPercentageRGB = function(){\n\n // get the RGB components of this colour\n var rgb = this.getRGB();\n\n // return the percentage components\n return {\n 'r' : 100 * rgb.r / 255,\n 'g' : 100 * rgb.g / 255,\n 'b' : 100 * rgb.b / 255,\n 'a' : rgb.a\n };\n\n };\n\n /* Returns a string representing this Colour as a CSS hexadecimal RGB colour\n * value - that is, a string of the form #RRGGBB where each of RR, GG, and BB\n * are two-digit hexadecimal numbers.\n */\n this.getCSSHexadecimalRGB = function(){\n\n // get the integer RGB components\n var rgb = this.getIntegerRGB();\n\n // determine the hexadecimal equivalents\n var r16 = rgb.r.toString(16);\n var g16 = rgb.g.toString(16);\n var b16 = rgb.b.toString(16);\n\n // return the CSS RGB colour value\n return '#'\n + (r16.length == 2 ? r16 : '0' + r16)\n + (g16.length == 2 ? g16 : '0' + g16)\n + (b16.length == 2 ? b16 : '0' + b16);\n\n };\n\n /* Returns a string representing this Colour as a CSS integer RGB colour\n * value - that is, a string of the form rgb(r,g,b) where each of r, g, and b\n * are integers in the range [0,255].\n */\n this.getCSSIntegerRGB = function(){\n\n // get the integer RGB components\n var rgb = this.getIntegerRGB();\n\n // return the CSS RGB colour value\n return 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')';\n\n };\n\n /* Returns a string representing this Colour as a CSS integer RGBA colour\n * value - that is, a string of the form rgba(r,g,b,a) where each of r, g, and\n * b are integers in the range [0,255] and a is in the range [0,1].\n */\n this.getCSSIntegerRGBA = function(){\n\n // get the integer RGB components\n var rgb = this.getIntegerRGB();\n\n // return the CSS integer RGBA colour value\n return 'rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ',' + rgb.a + ')';\n\n };\n\n /* Returns a string representing this Colour as a CSS percentage RGB colour\n * value - that is, a string of the form rgb(r%,g%,b%) where each of r, g, and\n * b are in the range [0,100].\n */\n this.getCSSPercentageRGB = function(){\n\n // get the percentage RGB components\n var rgb = this.getPercentageRGB();\n\n // return the CSS RGB colour value\n return 'rgb(' + rgb.r + '%,' + rgb.g + '%,' + rgb.b + '%)';\n\n };\n\n /* Returns a string representing this Colour as a CSS percentage RGBA colour\n * value - that is, a string of the form rgba(r%,g%,b%,a) where each of r, g,\n * and b are in the range [0,100] and a is in the range [0,1].\n */\n this.getCSSPercentageRGBA = function(){\n\n // get the percentage RGB components\n var rgb = this.getPercentageRGB();\n\n // return the CSS percentage RGBA colour value\n return 'rgb(' + rgb.r + '%,' + rgb.g + '%,' + rgb.b + '%,' + rgb.a + ')';\n\n };\n\n /* Returns a string representing this Colour as a CSS HSL colour value - that\n * is, a string of the form hsl(h,s%,l%) where h is in the range [0,100] and\n * s and l are in the range [0,100].\n */\n this.getCSSHSL = function(){\n\n // get the HSL components\n var hsl = this.getHSL();\n\n // return the CSS HSL colour value\n return 'hsl(' + hsl.h + ',' + hsl.s + '%,' + hsl.l + '%)';\n\n };\n\n /* Returns a string representing this Colour as a CSS HSLA colour value - that\n * is, a string of the form hsla(h,s%,l%,a) where h is in the range [0,100],\n * s and l are in the range [0,100], and a is in the range [0,1].\n */\n this.getCSSHSLA = function(){\n\n // get the HSL components\n var hsl = this.getHSL();\n\n // return the CSS HSL colour value\n return 'hsl(' + hsl.h + ',' + hsl.s + '%,' + hsl.l + '%,' + hsl.a + ')';\n\n };\n\n /* Sets the colour of the specified node to this Colour. This functions sets\n * the CSS 'color' property for the node. The parameter is:\n *\n * node - the node whose colour should be set\n */\n this.setNodeColour = function(node){\n\n // set the colour of the node\n node.style.color = this.getCSSHexadecimalRGB();\n\n };\n\n /* Sets the background colour of the specified node to this Colour. This\n * functions sets the CSS 'background-color' property for the node. The\n * parameter is:\n *\n * node - the node whose background colour should be set\n */\n this.setNodeBackgroundColour = function(node){\n\n // set the background colour of the node\n node.style.backgroundColor = this.getCSSHexadecimalRGB();\n\n };\n\n}", "_extractColor(params, pos, attr) {\n // normalize params\n // meaning: [target, CM, ign, val, val, val]\n // RGB : [ 38/48, 2, ign, r, g, b]\n // P256 : [ 38/48, 5, ign, v, ign, ign]\n const accu = [0, 0, -1, 0, 0, 0];\n // alignment placeholder for non color space sequences\n let cSpace = 0;\n // return advance we took in params\n let advance = 0;\n do {\n accu[advance + cSpace] = params.params[pos + advance];\n if (params.hasSubParams(pos + advance)) {\n const subparams = params.getSubParams(pos + advance);\n let i = 0;\n do {\n if (accu[1] === 5) {\n cSpace = 1;\n }\n accu[advance + i + 1 + cSpace] = subparams[i];\n } while (++i < subparams.length && i + advance + 1 + cSpace < accu.length);\n break;\n }\n // exit early if can decide color mode with semicolons\n if ((accu[1] === 5 && advance + cSpace >= 2)\n || (accu[1] === 2 && advance + cSpace >= 5)) {\n break;\n }\n // offset colorSpace slot for semicolon mode\n if (accu[1]) {\n cSpace = 1;\n }\n } while (++advance + pos < params.length && advance + cSpace < accu.length);\n // set default values to 0\n for (let i = 2; i < accu.length; ++i) {\n if (accu[i] === -1) {\n accu[i] = 0;\n }\n }\n // apply colors\n switch (accu[0]) {\n case 38:\n attr.fg = this._updateAttrColor(attr.fg, accu[1], accu[3], accu[4], accu[5]);\n break;\n case 48:\n attr.bg = this._updateAttrColor(attr.bg, accu[1], accu[3], accu[4], accu[5]);\n break;\n case 58:\n attr.extended = attr.extended.clone();\n attr.extended.underlineColor = this._updateAttrColor(attr.extended.underlineColor, accu[1], accu[3], accu[4], accu[5]);\n }\n return advance;\n }", "function isRgbColor(value, includePercentValues) {\n return typeof value === 'string' && validator_lib_isRgbColor__WEBPACK_IMPORTED_MODULE_1___default()(value, includePercentValues);\n}", "function RGB_HSV (r, g, b) {\n\t\t\tr /= 255;\n\t\t\tg /= 255;\n\t\t\tb /= 255;\n\t\t\tvar n = Math.min(Math.min(r,g),b);\n\t\t\tvar v = Math.max(Math.max(r,g),b);\n\t\t\tvar m = v - n;\n\t\t\tif (m === 0) { return [ null, 0, 100 * v ]; }\n\t\t\tvar h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m);\n\t\t\treturn [\n\t\t\t\t60 * (h===6?0:h),\n\t\t\t\t100 * (m/v),\n\t\t\t\t100 * v\n\t\t\t];\n\t\t}", "asRGB(ao) {\r\n return \"rgba(\" + this.r + \",\" + this.g + \",\" + this.b + \",\" + ((ao == undefined) ? this.a : ao) + \")\";\r\n }", "function rgbToCSS(rgbValue) {\nlet css = `rgb(${rgbValue.r}, ${rgbValue.g}, ${rgbValue.b})`;\nreturn css;\n}", "parseRGBColor(color) {\n const m = color.match(/^rgb\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)$/i);\n if (m) {\n return {\n r: parseInt(m[1], 10) / 255,\n g: parseInt(m[2], 10) / 255,\n b: parseInt(m[3], 10) / 255,\n a: m[4] ? parseInt(m[3], 10) / 255 : 1,\n };\n }\n\n throw new Error(`JSCADVDiewer.parseRGBColor: invalid CSS color value received, ${color}`);\n }", "function colourNameToRGB(colourName) {\n\n}", "function RGBConstructor(rgb)\n{\n this.rgb = rgb;\n}", "function Color(input){_classCallCheck(this,Color),input instanceof Color?(this.r=input.r,this.g=input.g,this.b=input.b,this.a=input.a):input?this.parse(input):(this.r=this.g=this.b=0,this.a=1)}// ## Parse ##", "function codeColorRed(value, maxValue){\n var r = Math.floor(value/maxValue * 255);\n var g = 0;\n var b = 0;\n return color= \"rgb(\"+r+\" ,\"+g+\",\"+ b+\")\";\n}" ]
[ "0.76554847", "0.71316075", "0.7073709", "0.7052197", "0.70288366", "0.7018211", "0.699844", "0.69947547", "0.6963534", "0.6960009", "0.69509286", "0.6939522", "0.6921466", "0.6919289", "0.68741053", "0.68741053", "0.6838799", "0.6837406", "0.6837406", "0.6837406", "0.6837406", "0.6829956", "0.6825282", "0.67859596", "0.67859596", "0.67859596", "0.67822397", "0.6771506", "0.6764923", "0.67465466", "0.6741871", "0.6723839", "0.6723156", "0.6692955", "0.6689921", "0.6682901", "0.66802526", "0.6679667", "0.6671039", "0.6668059", "0.6639512", "0.6628706", "0.6628706", "0.6628706", "0.6624035", "0.6618396", "0.66167825", "0.65973985", "0.65953326", "0.6588941", "0.6562019", "0.65555084", "0.65521896", "0.65452266", "0.653274", "0.65220267", "0.65129435", "0.65106976", "0.649937", "0.64799666", "0.6478138", "0.6473284", "0.64630616", "0.64630616", "0.64630616", "0.6462944", "0.64577186", "0.640745", "0.64046925", "0.6404121", "0.6402088", "0.63996524", "0.63793284", "0.63793284", "0.63767177", "0.63734937", "0.63727146", "0.63690734", "0.6366829", "0.63660353", "0.63660353", "0.6360081", "0.635558", "0.6352919", "0.6351616", "0.6335068", "0.63330024", "0.6331349", "0.6329759", "0.631177", "0.63009506", "0.6298517", "0.6293297", "0.6289109", "0.6276456", "0.62744", "0.6273027", "0.62718743", "0.6264533", "0.62594116" ]
0.6635123
41
APP_SECRET to sign the JWTs Helper function to be called in resolvers, Wich require authentication.
function getUserId(context) { //get the Authorization header, contains user JWT from context const Authorization = context.request.get('Authorization'); //Verify the JWT if (Authorization) { const token = Authorization.replace('Bearer ', ''); const { userId } = jwt.verify(token, APP_SECRET); return userId; } //if not verified throw error throw new Error('Not authenticated'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function authJwt() {\n const secret = process.env.secret;\n const api = process.env.API_URL;\n console.log(\"I am getting called\");\n return expressJwt({\n secret,\n algorithms: [\"HS256\"],\n // isRevoked: isRevoked,\n }).unless({\n path: [\n {\n url: /\\/api\\/v1\\/books(.*)/,\n methods: [\"GET\", \"OPTIONS\"],\n },\n {\n url: /\\/api\\/v1\\/bookissue(.*)/,\n methods: [\"GET\", \"OPTIONS\", \"POST\", \"DELETE\"],\n },\n\n `${api}/user/login`,\n `${api}/user`,\n ],\n });\n}", "function getAppSigningSecret(app) {\n var signing_options = app.service.config.get('apiJWT');\n if (!signing_options || !signing_options.secret) {\n throw errors.internal_error;\n }\n return signing_options.secret;\n}", "verifyJwt(token) {\n return jwt.verify(token, config.JWT_SECRET, {\n algorithms: ['HS256']\n });\n }", "verifyJwt(token) {\n return jwt.verify(token, config.JWT_SECRET, {\n algorithms: ['HS256'],\n });\n }", "static login(payload) {\n return jwt.sign(payload, process.env.JWT_PASS, {\n expiresIn: '1d'\n });\n }", "function createApiKey () {\n return jwt.sign({user: 'API', admin: 0}, process.env.JWT_STRING);\n}", "function signJWT () {\n return jwt.sign({ retire: 'fearlessly' }, secret);\n}", "function tokenForUser(user) {\n const timeStamp = new Date().getTime();\n console.log(process.env.SECRET);\n return jwt.encode({userId: user.id, iat: timeStamp}, process.env.SECRET);\n}", "verifyJwt(token) {\n return jwt.verify(token,config.JWT_SECRET,{\n algorithms: ['HS256']\n })\n }", "createJwt(subject,payload){\n return jwt.sign(payload, config.JWT_SECRET, {\n subject,\n algorithm: 'HS256'\n })\n }", "createJwt(subject, payload) {\n return jwt.sign(payload, config.JWT_SECRET, {\n subject,\n algorithm: 'HS256'\n });\n }", "function secretPassword() {\n var password = 'xh38sk';\n return {\n \t//Code here\n }\n }", "static getAuthToken(authSecret, expiresIn = 2 * 60)\n {\n if (authSecret)\n {\n if (!expiresIn)\n {\n return jwt.sign({}, authSecret, {});\n }\n return jwt.sign({}, authSecret, { expiresIn: expiresIn });\n }\n return '';\n }", "function byPassJWT(req, res, next) {\n // example: allow all get requests\n // if(req.method === 'GET') {\n // return next();\n // }\n return expressJwt({ secret: config.secret })(req, res, next);\n }", "function generateToken(user) {\n return jwt.sign(user, process.env.SECRET, {\n expiresIn : 60*60*24 // in seconds\n });\n}", "flyAdonisJsSecrets(app) {\n this.flySetSecrets({\n app,\n requiredSecrets: ['APP_KEY']\n })\n }", "function getUserSecretKey() {\n return localStorage.getItem('userSecretKey');\n}", "function simpleJWT(){\n const secretKey= 'secretKey'; //secret key que será usada en el token\n const claims={ //contenido del JWT playload\n userName:'The user name'\n }\n //generamos el jwt\n const token =jwt.sign(claims,secretKey);\n console.log(token);\n}", "createJwt(subject, payload) {\n return jwt.sign(payload, config.JWT_SECRET, {\n subject,\n expiresIn: config.JWT_EXPIRY,\n algorithm: 'HS256',\n });\n }", "function createToken( user ) \n{\n return jwt.sign( user, 'secret', { expiresIn: 60 * 60 * 5 } );\n}", "static generateToken(user) {\n const userData = {\n userId: user.id,\n userRoles: user.roles\n };\n return jwt.sign(userData, process.env.JWT_SECRET, {\n expiresIn : 60*60*72 //expires in 30 days\n });\n }", "function generateToken(payload){\n var secret=\"IamTheTougestLogic\";\n var token = jwt.encode(payload, secret);\n return token;\n}", "function tokenConAlgoritmo(){\n const secretKey='secretKey';\n //secret key que será usada en el token\n\n const claims = {\n userName:'The user name'\n } // contenido del JWT playload\n\n\n const token =jwt.sign(claims,secretKey, {algorithm:'RS256'});\n console.log(token);\n}", "function generateToken(payload) {\n return jwt.sign(payload, process.env.SECRET_KEY_JWT);\n}", "getSecret () {\n const secret = crypto.randomBytes(32);\n const hash = crypto.createHash('sha256').update(secret).digest('hex');\n\n return {\n secret: secret,\n hash: hash\n };\n }", "issueToken (_payload) {\n return jwt.sign(_payload, config.JWT_SECRET, {\n expiresIn: config.JWT_EXPIRES_IN\n })\n }", "function generateToken(params = {}) {\n return jwt.sign(params, 'secret', {\n expiresIn: '30d',\n });\n}", "function jwtSignUser(user){\n// const QUOLTER_DAY = 60*60*6;\n// return jwt.sign(user, config.authentication.jwtSecret,{\n// expiresIn: QUOLTER_DAY\n// }) \n\nconst token =jwt.sign(user,config.get('jwtPrivateKey'))\nreturn token\n}", "flyRemixSecrets(app) {\n this.flySetSecrets({\n app,\n requiredSecrets: ['SESSION_SECRET', 'INTERNAL_COMMAND_TOKEN'],\n shouldSet: (name) => name === 'SESSION_SECRET' || this.epicStack\n })\n }", "function generateJwtToken(payload){\n\t\treturn jwt.sign(payload,app.get('secret'),{\n\t\t\texpiresIn: 86400 //\n\t\t});\n\t}", "function sign(key, policy, encoding, next) {\n\tvar signature = crypto.createHmac('sha1', process.env.SECRET_ACCESS_KEY).update(encoding).digest('base64');\n\tnext(null, key, policy, encoding, signature);\n}", "function generateToken(user) {\n //1. Don't use password and other sensitive fields\n //2. Use the information that are useful in other parts\n if (!user) return null;\n var u = {\n id: user.id,\n name: user.name,\n username: user.username,\n isAdmin: user.isAdmin,\n password: user.password\n }; // .env should contain a line like JWT_SECRET=V3RY#1MP0RT@NT$3CR3T#\n\n return jwt.sign(u, process.env.JWT_SECRET, {\n expiresIn: 60 * 60 * 24 // expires in 24 hours\n\n });\n} // return basic user details", "function correctSecretProvided(req) {\n const requiredSecret = process.env.ACTION_SECRET\n const providedSecret = req.headers.action_secret\n return requiredSecret === providedSecret\n}", "function generateToken(params = {}) {\r\n return jwt.sign(params, authConfig.secret, {\r\n expiresIn: 86400,\r\n });\r\n}", "function jwtGenerator(user_id) {\n const payload = {\n user: {\n id: user_id\n }\n };\n \n return jwt.sign(payload, process.env.jwtSecret, { expiresIn: \"1h\" });\n}", "function tokenForUser (user){\n const timestamp = new Date().getTime()\n return jwt.encode({ sub: user, iat: timestamp }, process.env.SECRET)\n}", "function generateAccessToken(user){\n return jsonwebtoken.sign(user, process.env.SECRET, {expiresIn: '50m'});\n}", "function generatetoken(phone,password){\n const token=jwt.sign({phone,password},'mysecret');\n return token;\n \n}", "function generateSecretKey() {\n return crypto\n .createHash('sha256')\n .update(uuid.v4())\n .digest('base64')\n .replace(/\\//g, '-')\n .replace(/\\+/g, '-')\n .replace(/\\=/g, '-')\n }", "function createToken(payload){\n return jwt.sign(payload, SECRET_KEY)\n}", "function jwt() {\n return User.jwt();\n}", "formatSecret() {\n return \"0x\" + this.secret.toString('hex')\n }", "function createToken(payload){\r\n return jwt.sign(payload, SECRET_KEY, {expiresIn});\r\n}", "function generateToken(params = {}) {\n return jwt.sign(params, authConfig.secret, {\n expiresIn: 86400\n });\n}", "function maketoken(info){\n info.expires=Date.now()+tokenExpiresTime\n return jwt.encode(info,secret)\n}", "function jwtCreateToken(payload){\n return jwt.sign(payload, secret, { expiresIn: tokenExpiration } );\n}", "createJWT() {\n const header = {\n alg: \"RS384\",\n typ: \"JWT\",\n kid: \"3ab8b05b64d799e289e10a201786b38c\"\n };\n const headerStr = JSON.stringify(header);\n\n const fiveMinutes = 350;\n const payload = {\n iss: PASConfig.clientId,\n sub: PASConfig.clientId,\n aud: this.state.tokenUrl,\n exp: Math.floor(Date.now() / 1000) + fiveMinutes,\n jti: shortid.generate()\n };\n const payloadStr = JSON.stringify(payload);\n\n const data = base64(headerStr) + \".\" + base64(payloadStr);\n const sign = createSign(\"RSA-SHA384\");\n sign.update(data);\n\n const signature = base64.fromBase64(\n sign.sign(PASConfig.privateKey, \"base64\")\n );\n const jwt = data + \".\" + signature;\n\n console.log(jwt);\n return jwt;\n }", "get clientSecret() {\n return this.getStringAttribute('client_secret');\n }", "function Authenticate(){\n var speakeasy = require('speakeasy');\n var key = speakeasy.generateSeceret();\n}", "createToken() {\n\t\tconst date = new Date();\n\t\tconst timestamp = date.getTime() + parseInt(process.env.JWT_EXPIRATION, 10);\n\t\tconst expiry_date = new Date(timestamp);\n\n\t\treturn jwt.sign(\n\t\t\t{\n\t\t\t\t_id: this._id,\n\t\t\t\temail: this.email,\n\t\t\t\texpiry_date: expiry_date.toISOString(),\n\t\t\t},\n\t\t\tprocess.env.JWT_SECRET,\n\t\t\t{\n\t\t\t\texpiresIn: process.env.JWT_EXPIRATION,\n\t\t\t}\n\t\t);\n\t}", "function createToken(payload){\n return jwt.sign(payload, SECRET_KEY, {expiresIn})\n}", "function tokenForUser(user) {\n const timestamp = new Date().getTime();\n return jwt.encode({ sub: user.id, iat: timestamp }, process.env.API_SECRET);\n}", "tokenForUser(user) {\n const timeStamp = new Date().getTime();\n return jwt.encode({ sub: user.id, iat: timeStamp }, config.secret);\n }", "function createToken(payload) {\r\n return jwt.sign(payload, SECRET_KEY, { expiresIn })\r\n }", "function generateToken(params = {}) {\n return jwt.sign(params, authConfig.jwtSecret, {\n expiresIn: 86400 // expires in 1 day = 86400s\n })\n}", "function loginController(req, res) {\n var user = userArray[0]\n const token = jwt.sign({user}, 'secretText')\n res.json({\n token: token\n })\n}", "init(server) {\n server.register(require('hapi-auth-jwt2'), (err) => {\n if (err) {\n console.log(err);\n return;\n }\n\n server.auth.strategy('jwt', 'jwt',\n { key: process.env.JWT_SECRET, // Never Share your secret key\n validateFunc: this.validate.bind(this), // validate function defined above\n verifyOptions: { algorithms: [ 'HS256' ] } // pick a strong algorithm\n });\n\n server.auth.default('jwt');\n });\n }", "static authrequire(req, res, next){\n const token= req.cookies.jwt;\n\n if(token){\n jwt.verify(token, process.env.JWTSECRET, (err, newToken)=>{\n if(err){\n console.log(err);\n res.redirect('login');\n }else{\n console.log(newToken);\n next();\n }\n })\n }else{\n res.redirect('login');\n }\n }", "verifyJWT(token) {\n return jwt.verify(token, configService.SECRET);\n }", "function setupGlobals(secrets) {\n SECRET_KEY = secrets.secretKey;\n CLIENT_ID = secrets.clientId;\n REDIRECT_URI = secrets.redirectUri;\n}", "function genarToken(idUser = {}) {\n return jwt.sign(idUser, authConfig.secret,\n {expiresIn: 86400})\n}", "function generateAccessToken(useremailobject) {\n //return the token with expiration time of 1hr\n return jwt.sign(useremailobject, process.env.ACCESS_TOKEN_SECRET, {expiresIn: \"1h\"});\n}", "function generateToken(user){\n return jwt.sign({\n id: user.id,\n email: user.email,\n username: user.username,\n profileImageLink: user.profileImageLink\n }, process.env.SECRET_KEY, { expiresIn: process.env.TOKEN_EXP });\n}", "function generateToken(params = {}) {\n return jwt.sign(params, authConfig.secret, { // ({ id: user.id }, )\n expiresIn: 86400, // time to token expiration 1 day\n });\n}", "function generateToken(user) {\n return jwt.sign(user, config.secret, { expiresIn: 86400});\n}", "function generateToken(user) {\n return jwt.sign(user, config.secret, { expiresIn: 86400});\n}", "function tokenForUser(user) {\n const timestamp = new Date().getTime();\n return jwt.encode({ sub: user.id, iat: timestamp }, process.env.JWT_SECRET);\n}", "function generateToken(user){\n return jwt.sign(user, authConfig.secret, {\n expiresIn: 10080\n });\n}", "function secretkey(password,secret) {\n\n const hash = crypto.createHmac('sha256', secret)\n .update(password)\n .digest('hex');\n return hash;\n}", "async function getJwt () {\n try {\n // Log into the auth server.\n await jwtLib.register()\n\n let apiToken = jwtLib.userData.apiToken\n\n // Ensure the JWT token is valid to use.\n const isValid = await jwtLib.validateApiToken()\n\n // Get a new token with the same API level, if the existing token is not\n // valid (probably expired).\n if (!isValid.isValid) {\n apiToken = await jwtLib.getApiToken(jwtLib.userData.apiLevel)\n wlogger.info('The JWT token was not valid. Retrieved new JWT token.\\n')\n } else {\n wlogger.info('JWT token is valid.\\n')\n }\n\n // Set the environment variable.\n process.env.BCHJSTOKEN = apiToken\n } catch (err) {\n wlogger.error('Error in token-liquidity.js/getJwt(): ', err)\n throw err\n }\n}", "function generateToken(userId) {\n // Include some data and an expiration timestamp in the JWT\n return jwt.sign(\n {\n exp: Math.floor(Date.now() / 1000) + 60 * 60 * 24, // This key expires in 1 hour\n data: { userId },\n },\n process.env.JWT_SECRET\n );\n}", "function createToken(payload) {\n return jwt.sign(payload, SECRET_KEY, { expiresIn })\n}", "async function getJwt() {\n const genericUser = {\n username: 'admin',\n };\n\n return (await authLogic.login(genericUser)).jwt;\n}", "static prepare(app) {\n app.configure(auth({\n // todo: use custom storage in order to obtain the token either from localStorage or the URL\n storage: window.localStorage,\n }));\n }", "function createToken(payload) {\n return jwt.sign(payload, SECRET_KEY, { expiresIn });\n}", "function createToken(payload) {\n return jwt.sign(payload, SECRET_KEY, { expiresIn });\n}", "function createToken(payload) {\n return jwt.sign(payload, SECRET_KEY, { expiresIn });\n}", "createToken(username) {\n return jwt.sign({\n issuer: username,\n iat: Math.floor(Date.now() / 1000),\n exp: Math.floor(Date.now() / 1000) + ((60 * 60) * 10)\n }, 'secret');\n }", "generateToken(id) {\n let payload = {\n id: id\n };\n\n let token = JWT.sign(payload, process.env.JWT_SECRET, { expiresIn: process.env.JWT_DURATION });\n\n return token;\n }", "function createToken(payload) {\n return jwt.sign(payload, SECRET_KEY, {\n expiresIn,\n jwtid: uuidv4(),\n audience: [AUDIENCE]\n })\n}", "function tokenForUser(user) {\n const timestamp = new Date().getTime();\n return jwt.encode({ sub: user.id, iat: timestamp }, process.env.AUTH_SECRET);\n}", "function readTokenSecret() {\n return Promise.resolve(config.get(\"tokenSecret\"));\n}", "getJwt() {\n // if (localStorage && localStorage.getItem(token)) {\n\n return localStorage.getItem(\"jwtToken\");\n // )\n // || null;\n // }\n\n // // if (sessionStorage && sessionStorage.getItem(key)) {\n // // return parse(sessionStorage.getItem(key)) || null;\n // // }\n\n // return null;\n }", "function serveJWT(req, res) {\n const {userID} = req.params;\n if (!userID) {\n res.status(404).end();\n } else {\n const token = jwt.sign(\n {\n pid: ironCoreConfig.projectId,\n sid: ironCoreConfig.segmentId,\n kid: ironCoreConfig.serviceKeyId,\n },\n privateKey,\n {\n algorithm: \"ES256\",\n expiresIn: \"2m\",\n subject: userID,\n }\n );\n res.status(200).send(token);\n }\n}", "static isSecret(x) {\n return x !== null && typeof (x) === 'object' && SECRET_SYMBOL in x;\n }", "createJWT({userId, clientId, timestamp}) {\n if (!userId || !clientId || !timestamp) {\n console.err(new Error(\"Invalid claim payload for JWT\"));\n return null;\n }\n return jwt.sign({userId, clientId, timestamp}, configService.SECRET, {\n expiresIn: configService.JWT_EXPIRATION,\n });\n }", "function encodeToken(username, password) \n{\n const info = \n {\n exp: moment().add(1, 'days').unix(),\n iat: moment().unix(),\n sub: username, password\n };\n\n return jwt.encode(info, process.env.TOPSECRET);\n console.log(\"[TOKEN] - Encoded token.\");\n}", "function getClientKeyAndSecret(serverEndpoint, username, password) {\n var data = { \"applicationName\":\"WebOSApp\", \"tags\":[\"device_management\"]};\n\n var userCredentials = username + \":\" + password;\n var userCredentialsBase64 = btoa(userCredentials);\n\n $.ajax({\n type: \"POST\",\n url: serverEndpoint + \"/api-application-registration/register\",\n data: JSON.stringify(data),\n headers: {\n 'Authorization': 'Basic ' + userCredentialsBase64,\n 'Content-Type': 'application/json'\n },\n success: function (resp) {\n var obj = JSON.parse(resp);\n\n retrieveAccessToken(serverEndpoint, username, password, obj[\"client_id\"], obj[\"client_secret\"]);\n },\n error: function () {\n $(\"#message-board\").text(\"Failed to get client ID and secret\");\n }\n });\n }", "function makesecret() {\n secret = makerandword(); }", "function generateAccessToken(user) {\n console.log(user)\n return jwt.sign(user, 'secret', { expiresIn: '5m' })\n}", "generateToken ({\n id\n }) {\n return jwt.sign({\n id\n }, authentication.jwtSecret, {\n expiresIn: authentication.expireTime\n })\n }", "function generateSecret(appname, seed) {\n var secretbody = appname + seed;\n var secret = crypto.createHash('sha256').update(secretbody.substring(0, 64)).digest(\"hex\");\n\n console.log(\"----------- Secret ---------------\");\n console.log(secret);\n return secret;\n}", "async function generateAccessToken(currentUser, accessTokenLength) {\n //var accessToken = jwt.sign({currentUser: currentUser}, process.env.ACCESS_TOKEN_SECRET);\n //Minute\n //return jwt.sign({currentUser: currentUser}, process.env.ACCESS_TOKEN_SECRET, {expiresIn: '60s'}); \n\n //5 Minutes\n //return jwt.sign({currentUser: currentUser}, process.env.ACCESS_TOKEN_SECRET, {expiresIn: '300s'}); \n \n //Hour\n //return jwt.sign({currentUser: currentUser}, process.env.ACCESS_TOKEN_SECRET, {expiresIn: '3600s'}); \n \n //From Input \n return jwt.sign({currentUser: currentUser}, process.env.ACCESS_TOKEN_SECRET, {expiresIn: accessTokenLength}); \n \n}", "function provideToken (req, res, next) {\n let registeredUser = req.registeredUser\n let token = registeredUser.hashedPassword\n ? jwt.sign({\n id: registeredUser.id,\n name: registeredUser.name,\n email: registeredUser.email,\n admin: registeredUser.admin\n }, eVars.PASS_PHRASE, { expiresIn: '24h' })\n : undefined\n req.resJson = { data: token }\n return next()\n}", "function jwtSign(payload, SECRET, options) {\n return new Promise((resolve, reject) => {\n jwt.sign(payload, SECRET, options, (error, token) => {\n if (error) return reject(new Error({ ...errorCodes.TOKEN_NOT_SIGNED, message: error.message }));\n return resolve(token);\n });\n });\n}", "validateSecret() {\n if (typeof this.options.secret !== 'string') {\n throw AppKeyException_1.AppKeyException.missingAppKey();\n }\n if (this.options.secret.length < 16) {\n throw AppKeyException_1.AppKeyException.insecureAppKey();\n }\n }", "function generateToken(user) {\n return jwt.sign(user, config.secret, {\n expiresIn: 604800 // in seconds\n });\n}", "function createJWT(user) {\n var payload = {\n sub: user._id,\n iat: moment().unix(),\n exp: moment().add(14, 'days').unix()\n };\n return jwt.encode(payload, 'JWT Token Secret');\n}", "function createJwt(profile) {\n return jwt.sign(profile, 'soooosecret', {\n expiresIn: '2h',\n issuer: 'MY_APP'\n });\n}", "function getHeader() {\n return {\n \"alg\": \"RS256\",\n \"typ\": \"JWT\"\n };\n }", "async sharedSecret(epub) {\n // todo [REFACTOR]: the keypair from the user will not be accessible in future; must be moved to a secure section, better to a SE (secure element)\n return everblack().secret(epub, this.root._.sea);\n }" ]
[ "0.67094314", "0.66989625", "0.6499316", "0.6499144", "0.64691293", "0.645821", "0.64370745", "0.64071983", "0.6392832", "0.63791233", "0.6289386", "0.62720346", "0.62498534", "0.62151927", "0.6212272", "0.61867833", "0.61751837", "0.61629707", "0.61615837", "0.61529547", "0.6151968", "0.61509573", "0.6138895", "0.6105769", "0.6079599", "0.60792845", "0.60390246", "0.6016246", "0.6004013", "0.5997262", "0.5993168", "0.5969174", "0.59272885", "0.59271646", "0.5925143", "0.5924695", "0.5922737", "0.59197474", "0.5912452", "0.5906333", "0.5880151", "0.58741415", "0.5866161", "0.5861393", "0.5850931", "0.5835235", "0.5815339", "0.58125174", "0.57834387", "0.57829887", "0.57755274", "0.577463", "0.57737017", "0.57690364", "0.5758636", "0.57530755", "0.57521224", "0.5750873", "0.57270724", "0.57050073", "0.5698837", "0.56907773", "0.5677587", "0.56661034", "0.5663666", "0.5663666", "0.5661973", "0.56609076", "0.56600726", "0.5646756", "0.5643723", "0.5640099", "0.5636056", "0.56349236", "0.56324655", "0.56324655", "0.56324655", "0.5625313", "0.5618607", "0.5610001", "0.5607506", "0.55988324", "0.55959404", "0.5595077", "0.5584232", "0.55781394", "0.5574645", "0.557449", "0.55716306", "0.55635035", "0.5557216", "0.55436015", "0.55414885", "0.5531445", "0.55294186", "0.5529356", "0.55246085", "0.5522884", "0.5510354", "0.55089283", "0.5503465" ]
0.0
-1
Set the prototype chain to inherit from `parent`, without calling `parent`'s constructor function.
function Surrogate(child) { this.constructor = child; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extend(parent) {\n\t\tthis.prototype = Object.create(parent.prototype);\n\t\tthis.prototype.constructor = parent;\n\n\t\tvar d = 0, p = this.prototype;\n\n\t\tthis.prototype.uber = function(args) {\n\t\t\tvar f = d;\n\t\t\tvar t = d;\n\t\t\tvar v = parent.prototype;\n\t\t\tif (t) {\n\t\t\t\twhile (t) {\n\t\t\t\t\tv = v.constructor.prototype;\n\t\t\t\t\tt -= 1;\n\t\t\t\t}\n\t\t\t\tf = v.constructor;\n\t\t\t} else {\n\t\t\t\tf = p.constructor;\n\t\t\t}\n\t\t\td += 1;\n\t\t\tf.apply(v, arguments);\n\t\t\t// hoist the base properties from v into this\n\t\t\tfor ( var prop in v) {\n\t\t\t\tif (typeof v[prop] != \"function\") {\n\t\t\t\t\tthis[prop] = v[prop];\n\t\t\t\t}\n\t\t\t}\n\t\t\td -= 1;\n\t\t\treturn this;\n\t\t};\n\n\t\treturn this;\n\t}", "function inherts(child , parent) {\n child.prototype = Object.create(parent.prototype);\n child.prototype.constructor = child;\n}", "function applyPrototype(parent,child){\n\tchild.prototype = Object.create(parent.prototype);\n\tchild.prototype.constructor = child;\n}", "function inheritsFrom(child, parent){\nchild.prototype = Object.create(parent.prototype);\n}", "function inheritsFrom(child, parent) {\n child.prototype = Object.create(parent.prototype);\n}", "function inheritsFrom (child, parent) {\n child.prototype = Object.create(parent.prototype);\n //can be used for clone\n}", "function inherit(parent, child) {\n const obj = Object.create(child.prototype)\n child.prototype = Object.assign({}, parent.prototype, obj)\n parent.constructor = child\n}", "function extend(parent, child){\n child.prototype= Object.create(parent.prototype)\n child.prototype.constructor=child\n }", "function subclass(child, parent) {\n child.prototype.__proto__ = parent.prototype;\n}", "function inheritPrototype(childObject, parentObject) {\n var copyOfParent = Object.create(parentObject.prototype); //ECMA5 compatible\n copyOfParent.constructor = childObject;\n childObject.prototype = copyOfParent;\n}", "function $inherits(child, parent) {\n if (child.prototype.__proto__) {\n child.prototype.__proto__ = parent.prototype;\n } else {\n function tmp() {};\n tmp.prototype = parent.prototype;\n child.prototype = new tmp();\n child.prototype.constructor = child;\n }\n}", "function inherit(){}", "function inherit(C, P) {\n\tvar F = function () {};\n\tF.prototype = P.prototype;\n\tC.prototype = new F();\n\tC.uber = P.prototype; // KEEP A REFERENCE LINK TO THE PARENT'S PROTOTYPE DIRECTLY\n}", "function __super() {\n if (this.__super__ && this.__super__.constructor) {\n var Parent = this.__super__.constructor;\n if (this.constructor !== Parent) {\n var parent = new Parent();\n }\n }\n }", "function extend( child, parent )\r\n{\r\n\tfor( prop in parent )\r\n\t{\r\n\t\tif( !(prop in child ) && prop != 'prototype' )\r\n\t\t{\r\n\t\t\tchild[prop] = parent[prop];\t\r\n\t\t}\r\n\t}\r\n\t\r\n\tfor( prop in parent.prototype )\r\n\t{\r\n\t\tif( !(prop in child.prototype ) )\r\n\t\t{\r\n\t\t\tchild.prototype[prop] = parent.prototype[prop];\t\r\n\t\t}\r\n\t}\r\n}", "function extend(child, parent, _protoFn) {\n var i;\n parent = isArray(parent) ? parent : [parent];\n var _copyProtoChain = function (focus) {\n var proto = focus.__proto__;\n while (proto != null) {\n if (proto.prototype != null) {\n for (var j in proto.prototype) {\n if (proto.prototype.hasOwnProperty(j) && !child.prototype.hasOwnProperty(j)) {\n child.prototype[j] = proto.prototype[j];\n }\n }\n proto = proto.prototype.__proto__;\n }\n else {\n proto = null;\n }\n }\n };\n for (i = 0; i < parent.length; i++) {\n for (var j in parent[i].prototype) {\n if (parent[i].prototype.hasOwnProperty(j) && !child.prototype.hasOwnProperty(j)) {\n child.prototype[j] = parent[i].prototype[j];\n }\n }\n _copyProtoChain(parent[i]);\n }\n var _makeFn = function (name, protoFn) {\n return function () {\n for (i = 0; i < parent.length; i++) {\n if (parent[i].prototype[name]) {\n parent[i].prototype[name].apply(this, arguments);\n }\n }\n return protoFn.apply(this, arguments);\n };\n };\n var _oneSet = function (fns) {\n for (var k in fns) {\n child.prototype[k] = _makeFn(k, fns[k]);\n }\n };\n if (arguments.length > 2) {\n for (i = 2; i < arguments.length; i++) {\n _oneSet(arguments[i]);\n }\n }\n return child;\n }", "function inherit(childClass, parentClass) {\r\n childClass.prototype = Object.create(parentClass.prototype);\r\n childClass.prototype.constructor = childClass;\r\n}", "function inheritPrototype(subType, superType) {\t // 0\n\t \t\t\t\tvar prototype = object(superType.prototype); // 1 \n\t \t\t\t\tprototype.constructor = subType; \t\t\t\t // 2\n\t \t\t\t\tsubType.prototype = prototype;\t\t\t\t\t // 3\n\t \t\t\t}", "function inherit(C, P) {\n function F() {};\n F.prototype = P.prototype;\n C.prototype = new F();\n C.uber = P.prototype;\n C.constructor.prototype = C;\n}", "function extend(Child,Parent)\n{\n var f=function(){};\n f.prototype=Parent.prototype;\n Child.prototype=new f();\n Child.prototype.constructor=Child;\n Child.uber=Parent.prototype;\n}", "function peg$subclass(child,parent){function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor}", "function extend(Child, Parent) {\n Child.prototype = inherit(Parent.prototype)\n Child.prototype.constructor = Child\n Child.parent = Parent.prototype\n}", "function inherited() { }", "constructor() {\n super(...arguments);\n var prototype = Object.getPrototypeOf(this);\n }", "constructor() {\n super(...arguments);\n var prototype = Object.getPrototypeOf(this);\n }", "function inheritFrom(parentConstructor, childConstructor, prototypeProps, constructorProps) {\n\t // Create a child constructor if one wasn't given\n\t if (childConstructor == null) {\n\t childConstructor = function() {\n\t parentConstructor.apply(this, arguments)\n\t }\n\t }\n\t\n\t // Make sure the new prototype has the correct constructor set up\n\t prototypeProps.constructor = childConstructor\n\t\n\t // Base constructors should only have the properties they're defined with\n\t if (parentConstructor !== Concur) {\n\t // Inherit the parent's prototype\n\t inherits(childConstructor, parentConstructor)\n\t childConstructor.__super__ = parentConstructor.prototype\n\t }\n\t\n\t // Add prototype properties - this is why we took a copy of the child\n\t // constructor reference in extend() - if a .constructor had been passed as a\n\t // __mixins__ and overitten prototypeProps.constructor, these properties would\n\t // be getting set on the mixed-in constructor's prototype.\n\t extend(childConstructor.prototype, prototypeProps)\n\t\n\t // Add constructor properties\n\t extend(childConstructor, constructorProps)\n\t\n\t return childConstructor\n\t}", "function peg$subclass(child,parent){function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor();}", "function selfsubclass(self, tmpparent) {\n\tfor (var key in self.prototype) {\n\t\ttmpparent.prototype[key] = self.prototype[key];\n\t}\n self.prototype.super = tmpparent.prototype;\n}", "function ParentConstructor() {\n}", "function inheritPrototype(subType, superType){\n var prototype = object(superType.prototype); //create object\n prototype.constructor = subType; //augment object\n subType.prototype = prototype; //assign object\n}", "function inherit(parent) {\n // inherit(parent, override_obj, override_obj, ...)\n var key;\n var result = {};\n var objects = Array.prototype.slice.call(arguments, 1);\n\n for (key in parent) result[key] = parent[key];\n\n objects.forEach(function (obj) {\n for (key in obj) result[key] = obj[key];\n });\n return result;\n }", "function inherit(proto) {\n function F() {\n };\n F.prototype = proto;\n var object = new F;\n return object;\n }", "set prototype(value) {}", "function herite( child, parent, dontfinalize )\n{\n\tif( typeof child.initialized == \"undefined\" )\n\t\t{\n\t\tfor( property in parent.prototype )\n\t\t\t{\n\t\t\tif( !child.prototype[property] )\n\t\t\t\t{\n\t\t\t\tchild.prototype[property] = parent.prototype[property] ;\n\t\t\t\t}\n\t\t\t}\n\t\tif( !dontfinalize ) child.initialized = true ;\n\t\t}\n}", "function _extend(parent, properties) {\n function proxy() {};\n proxy.prototype = Object.create(parent.prototype);\n $.extend(proxy.prototype, properties);\n return proxy.prototype;\n}", "function extend(Child, Parent) {\n var F = function(){};\n F.prototype = Parent.prototype;\n Child.prototype = new F();\n Child.prototype.constructor = Child;\n Child.uber = Parent.prototype;\n}", "function extend(Child, Parent) {\n var F = function(){};\n F.prototype = Parent.prototype;\n Child.prototype = new F();\n Child.prototype.constructor = Child;\n Child.uber = Parent.prototype;\n}", "function inheritPrototype(subType, superType){\n var copyOfSuperType = Object.create(superType.prototype) // create object\n copyOfSuperType.constructor = subType // augment object\n subType.prototype = copyOfSuperType // assign object\n}", "function inherits(parent, child, props={}) {\n\tconst extended = Object.create(parent.prototype);\n\tfor (const p in props) {\n\t\textended[p] = props[p];\n\t}\n\textended.constructor = child;\n\tchild.prototype = extended;\n\treturn child;\n}", "function inheritPrototype(A, B) {\n var F = function () {};\n F.prototype = B.prototype;\n A.prototype = new F();\n A.prototype.constructor = A;\n }", "function inheritPrototype(childObject, parentObject) {\n // As discussed above, we use the Crockford’s method to copy the properties and methods from the parentObject onto the childObject\n // So the copyOfParent object now has everything the parentObject has \n var copyOfParent = Object.create(parentObject.prototype);\n\n //Then we set the constructor of this new object to point to the childObject.\n // Why do we manually set the copyOfParent constructor here, see the explanation immediately following this code block.\n copyOfParent.constructor = childObject;\n\n // Then we set the childObject prototype to copyOfParent, so that the childObject can in turn inherit everything from copyOfParent (from parentObject)\n childObject.prototype = copyOfParent;\n}", "function extend(Child, Parent){\n Child.prototype = Object.create(Parent.prototype);\n Child.prototype.constructor = Child;\n }", "function extend(Child, Parent){\n var F = function(){};\n F.prototype = Parent.prototype;\n Child.prototype = new F();\n Child.prototype.constructor = Child;\n}", "function inherit(parent) { // inherit(parent, override_obj, override_obj, ...)\n var key;\n var result = {};\n var objects = Array.prototype.slice.call(arguments, 1);\n\n for (key in parent)\n result[key] = parent[key];\n objects.forEach(function(obj) {\n for (key in obj)\n result[key] = obj[key];\n });\n return result;\n}", "function inderit(C, P) {\n function F() {};\n F.prototype = P.prototype;\n C.prototype = new F();\n}", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function inherit(clazz, base, proto) {\n clazz.prototype = Object.create(base.prototype);\n clazz.prototype.constructor = clazz;\n if (proto)\n Object.keys(proto).forEach(\n function (key) {\n clazz.prototype[key] = proto[key];\n }\n );\n }", "function inherit(targ, src) {\n var f = function() {\n if (this.__super__ == f) {\n // add __super__ of parent to front of lookup chain\n // so parent class constructor can call its parent using this.__super__\n this.__super__ = src.prototype.__super__;\n // call parent constructor function. this.__super__ now points to parent-of-parent\n src.apply(this, arguments);\n // remove temp __super__, expose targ.prototype.__super__ again\n delete this.__super__;\n }\n };\n\n f.prototype = src.prototype || src; // added || src to allow inheriting from objects as well as functions\n // Extend targ prototype instead of wiping it out --\n // in case inherit() is called after targ.prototype = {stuff}; statement\n targ.prototype = extend$1(new f(), targ.prototype); //\n targ.prototype.constructor = targ;\n targ.prototype.__super__ = f;\n }", "constructor(parent) {\n\t\tthis._parent = parent;\n\t}", "function peg$subclass(child, parent) {\n function ctor() {\n this.constructor = child;\n }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() {\n this.constructor = child;\n }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() {\n this.constructor = child;\n }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }", "function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }" ]
[ "0.71436614", "0.70977736", "0.7069744", "0.7003358", "0.6916243", "0.6914045", "0.6815367", "0.66552323", "0.66517895", "0.65085185", "0.6376329", "0.6340662", "0.62952995", "0.62634254", "0.622443", "0.6142899", "0.6093282", "0.6092074", "0.6080786", "0.6025002", "0.6009418", "0.5977985", "0.5977488", "0.59683794", "0.59683794", "0.59602535", "0.5956744", "0.59314644", "0.59239364", "0.5909684", "0.5884538", "0.58610964", "0.5845544", "0.58451635", "0.5824202", "0.5814655", "0.5814655", "0.58062863", "0.58024216", "0.5801714", "0.5768878", "0.5750587", "0.57354355", "0.572652", "0.57159686", "0.56907326", "0.56907326", "0.56907326", "0.5680939", "0.5675648", "0.56755847", "0.56746644", "0.56746644", "0.5674374", "0.5667554", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233", "0.566233" ]
0.0
-1
necessary to determine the exact positioning dependent on the text length
function getWidthOfText(txt, fontname, fontsize){ if(getWidthOfText.c === undefined){ getWidthOfText.c=document.createElement('canvas'); getWidthOfText.ctx=getWidthOfText.c.getContext('2d'); } getWidthOfText.ctx.font = fontsize + ' ' + fontname; return getWidthOfText.ctx.measureText(txt).width; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTextPositionInLabel(text) {\r\n\t\ttext = text + \"\";\r\n\t\treturn 15 - (text.length * 2.2); \r\n\t}", "convertPointToCharacterPosition(text, point) {\n var position = 0;\n var w = 0;\n for (var i = 0, n = text.length; i < n; i++) {\n\n var charWidth = this.calculateCharacterSize(text.charAt(i))[0];\n var halfWidth = charWidth / 2;\n\n if (i > 0) {\n w = this.calculateSize(text.substr(0, i))[0];\n }\n\n // basic rounding calculation bast on character\n // width\n if (w + halfWidth > point) {\n break;\n }\n\n position++;\n }\n\n return position;\n }", "textPosition(x, y) {\n return { x: x + this.paddingX, y: y + this.paddingY };\n }", "function cleanTextPosition(textposition) {\n\t var posY = 'middle',\n\t posX = 'center';\n\t if(textposition.indexOf('top') !== -1) posY = 'top';\n\t else if(textposition.indexOf('bottom') !== -1) posY = 'bottom';\n\t\n\t if(textposition.indexOf('left') !== -1) posX = 'left';\n\t else if(textposition.indexOf('right') !== -1) posX = 'right';\n\t\n\t return posY + ' ' + posX;\n\t}", "function cleanTextPosition(textposition) {\n\t var posY = 'middle',\n\t posX = 'center';\n\t if(textposition.indexOf('top') !== -1) posY = 'top';\n\t else if(textposition.indexOf('bottom') !== -1) posY = 'bottom';\n\t\n\t if(textposition.indexOf('left') !== -1) posX = 'left';\n\t else if(textposition.indexOf('right') !== -1) posX = 'right';\n\t\n\t return posY + ' ' + posX;\n\t}", "static estimateTruncateOffset(fullText, containerWidth, actualWidth) {\n const textChars = fullText.length;\n const avgLetterSize = actualWidth / textChars;\n const canFit = containerWidth / avgLetterSize; // number of letters that can fit to container\n const deltaEachSide = (textChars - canFit) / 2; // index that used to truncate for left and right sides\n const endLeft = Math.floor(textChars / 2 - deltaEachSide);\n const startRight = Math.ceil(textChars / 2 + deltaEachSide);\n return {\n endLeft,\n startRight\n };\n }", "function cleanTextPosition(textposition) {\n var posY = 'middle',\n posX = 'center';\n if(textposition.indexOf('top') !== -1) posY = 'top';\n else if(textposition.indexOf('bottom') !== -1) posY = 'bottom';\n\n if(textposition.indexOf('left') !== -1) posX = 'left';\n else if(textposition.indexOf('right') !== -1) posX = 'right';\n\n return posY + ' ' + posX;\n}", "function cleanTextPosition(textposition) {\n var posY = 'middle',\n posX = 'center';\n if(textposition.indexOf('top') !== -1) posY = 'top';\n else if(textposition.indexOf('bottom') !== -1) posY = 'bottom';\n\n if(textposition.indexOf('left') !== -1) posX = 'left';\n else if(textposition.indexOf('right') !== -1) posX = 'right';\n\n return posY + ' ' + posX;\n}", "function determineTextAnchor(point){\n if(Math.abs(point.x) < 0.01 && point.x >= 0){\n return \"middle\"\n }\n else if(point.x > 0){\n return \"start\"\n }\n else{\n return \"end\"\n }\n }", "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 }", "function cleanTextPosition(textposition) {\n var posY = 'middle';\n var posX = 'center';\n if (typeof textposition === 'string') {\n if (textposition.indexOf('top') !== -1) posY = 'top';else if (textposition.indexOf('bottom') !== -1) posY = 'bottom';\n if (textposition.indexOf('left') !== -1) posX = 'left';else if (textposition.indexOf('right') !== -1) posX = 'right';\n }\n return posY + ' ' + posX;\n}", "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 }", "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 }", "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 }", "getXLocation(str, tile) {\n const width = ctx.measureText(str).width;\n return TILE_WIDTH * (tile - 0.5) - width / 2.0;\n }", "function wordLinePosition() {\n $('.line-container').each(function () {\n line = $(this).find('.vertical-line');\n word = $(this).find('h2');\n wordInner = word.html();\n wordFuture = '';\n tran = .1 * wordInner.length;\n for (i = 0; i < wordInner.length; i++) {\n wordFuture += '<span style=\"right:' + 100 + 'px; \">' + wordInner[i] + '</span>';\n }\n word.html(wordFuture);\n line.attr('data-height', ($(this).height() - word.width() - 15));\n });\n}", "function positionWord() {\n var wordEl = el.firstElementChild,\n highlight = wordEl.firstElementChild\n \n var centerOffsetX = (highlight.offsetWidth / 2) + highlight.offsetLeft,\n centerOffsetY = (highlight.offsetHeight / 2) + highlight.offsetTop\n \n wordEl.style.left = ((el.clientWidth / 2) - centerOffsetX) + 'px'\n wordEl.style.top = ((el.clientHeight / 2) - centerOffsetY) + 'px'\n }", "function position() {\n var w = attrs.w || me.labelWidth(attrs.txt, attrs.cl, attrs.size),\n h = attrs.h || lbl.height(),\n x = attrs.x,\n y = attrs.y,\n rot_w = 100;\n var css = attrs.rotate == -90 ? {\n // rotated\n left: x - rot_w * 0.5,\n top: attrs.valign == 'top' ? y + rot_w * 0.5 : y - rot_w * 0.5,\n width: rot_w,\n height: 20,\n 'text-align': attrs.valign == 'top' ? 'right' : 'left'\n } : {\n // not rotated\n left: attrs.align == 'left' ? x : attrs.align == 'center' ? x - w * 0.5 : x - w,\n top: y - h * (attrs.valign == 'top' ? 0 : attrs.valign == 'middle' ? 0.5 : 1),\n width: w,\n height: h\n };\n if (attrs.size) {\n css['font-size'] = attrs.size;\n }\n return css;\n }", "function textToIndex(pos){\n\n\tvar firstRowLength=114; //Header row length not including new line.\n\n\tvar rowLabelLength=4;\t//Lenght of row labels including new line.\n\n\tvar numberOfCharactersPerGroup=11;\t//Total number of characters in a group including space.\n\n\tvar totalNumberOfCharactersPerLine=114;\t//Total number of characters in a line including row label, spaces, and new Line.\n\n\tvar offset=0;\t//Total offset needed to convert text selection index to a valid index.\n\n\t\n\n\t//Amount for length of Header Row (Row 0) and first row label\n\n\toffset+=firstRowLength+rowLabelLength;\n\n\t\n\n\t//Position selected is in the header or first row labels\n\n\tif(pos<offset){\n\n\t\treturn 0;\n\n\t}\n\n\t\n\n\t//Past the first Line (Rows beyond 1)\n\n\tif(pos>=(firstRowLength+rowLabelLength+totalNumberOfCharactersPerLine)){\n\n\t\t//Calculate number of Row Labels needed (including new line)\n\n\t\toffset+=(Math.floor((pos/(totalNumberOfCharactersPerLine)))-1)*rowLabelLength\n\n\t}\n\n\t\n\n\t//Past First Group in Row 1\n\n\tif(pos>=(numberOfCharactersPerGroup+firstRowLength+rowLabelLength)){\n\n\t\t//Calculate number of spaces needed\n\n\t\toffset+=Math.floor((pos-offset)/numberOfCharactersPerGroup);\n\n\t}\n\n\t//Return Index (Position - Offset)\n\n\treturn pos-offset;\n\n\n\n}", "function getTextXY(text, context) {\n var textDims = context.measureText(text);\n return [$(context.canvas).width()*0.5 - textDims.width * 0.5, $(context.canvas).height()*0.5];\n\n}", "get textOffset() {\n return this.pos - this.path[this.path.length - 1];\n }", "function wordPos(area) { return wordBefore(area).length; }", "function ve(e){if(0==e.height)return 0;for(var t,a=e.text.length,n=e;t=se(n);){var r=t.find(0,!0);n=r.from.line,a+=r.from.ch-r.to.ch}for(n=e;t=ce(n);){var f=t.find(0,!0);a-=n.text.length-f.from.ch,n=f.to.line,a+=n.text.length-f.to.ch}return a}", "function TextOriginSettings(){\r\n\r\n var textXOffset = 0;\r\n var textYOffset = 0;\r\n}", "function getClozePosition(fullText, cloze){\n\t\tvar start = fullText.indexOf(cloze);\n\t\tconsole.log(\"\\nstart: \", start);\n\t}", "function titlePositionScore(position, length) {\n if (position < length * 0.25) return 1;\n else return 1 - ((position - length * 0.25) / length * 0.75);\n}", "function measureOffsets(text, fontFamily, fontSize) {\n /**\n * Create and setup canvas\n */\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n ctx.font = fontSize + 'px ' + fontFamily;\n\n /**\n * Make sure that there is enough room on the canvas for the text. Changing\n * the width or height of a canvas element clears the content so you need\n * to set the font again.\n */\n canvas.width = 2 * ctx.measureText(text).width;\n canvas.height = 2 * fontSize;\n\n /**\n * Center the text vertically and horizontally using the build in canvas\n * functionality (textBaseline and textAlign). We're going to measure how\n * far off the text is from the actual center since the textBaseline and\n * textAlign are not always accurate.\n */\n ctx.font = fontSize + 'px ' + fontFamily;\n ctx.textBaseline = 'alphabetic';\n ctx.textAlign = 'center';\n ctx.fillStyle = 'white';\n ctx.fillText(text, canvas.width / 2, canvas.height / 2);\n\n /**\n * Get image data so that we can iterate of every RGBA pixel.\n */\n const data = ctx.getImageData(0, 0, canvas.width, canvas.height).data;\n\n let textTop;\n let textBottom;\n for (let y = 0; y <= canvas.height; y++) {\n for (let x = 0; x <= canvas.width; x++) {\n let r_index = 4 * (canvas.width * y + x);\n let r_value = data[r_index];\n // let g_value = data[r_index + 1];\n // let b_value = data[r_index + 2];\n // let a_value = data[r_index + 3];\n\n if (r_value > 0) {\n if (!textTop) {\n textTop = y;\n }\n textBottom = y;\n break;\n }\n }\n }\n\n /**\n * Vertical offset is the difference between the horizontal center of the\n * canvas and the horizontal center of the text on the canvas.\n */\n const canvasHorizontalCenterLine = canvas.height / 2;\n const textHorizontalCenterLine = (textBottom - textTop) / 2 + textTop;\n\n let textLeft;\n let textRight;\n for (let x = 0; x <= canvas.width; x++) {\n for (let y = 0; y <= canvas.height; y++) {\n let r_index = 4 * (canvas.width * y + x);\n let r_value = data[r_index];\n\n if (r_value > 0) {\n if (!textLeft) {\n textLeft = x;\n }\n textRight = x;\n break;\n }\n }\n }\n\n /**\n * Horizontal offset is the difference between the vertical center of the\n * canvas and the vertical center of the text on the canvas.\n */\n const canvasVerticalCenterLine = canvas.width / 2;\n const textVerticalCenterLine = (textRight - textLeft) / 2 + textLeft;\n\n return {\n vertical: canvasHorizontalCenterLine - textHorizontalCenterLine,\n horizontal: canvasVerticalCenterLine - textVerticalCenterLine,\n };\n }", "function reposText(x,y,num){\n x*=100; // Skalierung auf ganze Zahlen\n y*=100; // Skalierung auf ganze Zahlen\n if(num==1)t1left = (x+7.1)*2 // Position des oberen Textes anpassen (für Serverside Generierung)\n if(num==2)t3left = (x+7.1)*2 // Position des unteren Textes anpassen (für Serverside Generierung)\n //console.log(\"t1left:\"+t1left+\", t3left\"+t3left);\n if(num==1){ // tatsächliche Neupositionierung des oberen Textes auf dem Bild\n x -= 42;\n y -= 86;\n //console.log(x+\", \"+y)\n document.getElementsByClassName(\"MemeTextTop\")[0].style.left=(x*3.6)+100+\"px\";\n document.getElementsByClassName(\"MemeTextTop\")[0].style.top=-y-20+\"px\";\n }\n if(num==2){ // tatsächliche Neupositionierung des unteren Textes auf dem Bild\n x -=50;\n y -=22;\n //console.log(x+\", \"+y+\", 2\")\n document.getElementsByClassName(\"MemeTextBottom\")[0].style.left=(x*3.6)+100+\"px\";\n document.getElementsByClassName(\"MemeTextBottom\")[0].style.top=-(y*1.4)+235+\"px\";\n }\n}", "function fixClefPlacement(el) {\n\t\t\tparseKeyVoice.fixClef(el);\n\t\t\t//if (el.el_type === 'clef') {\n\t\t\t//\t\t\t\tvar min = -2;\n\t\t\t//\t\t\t\tvar max = 5;\n\t\t\t//\t\t\t\tswitch(el.type) {\n\t\t\t//\t\t\t\t\tcase 'treble+8':\n\t\t\t//\t\t\t\t\tcase 'treble-8':\n\t\t\t//\t\t\t\t\t\tbreak;\n\t\t\t//\t\t\t\t\tcase 'bass':\n\t\t\t//\t\t\t\t\tcase 'bass+8':\n\t\t\t//\t\t\t\t\tcase 'bass-8':\n\t\t\t//\t\t\t\t\t\tel.verticalPos = 20 + el.verticalPos; min += 6; max += 6;\n\t\t\t//\t\t\t\t\t\tbreak;\n\t\t\t//\t\t\t\t\tcase 'tenor':\n\t\t\t//\t\t\t\t\tcase 'tenor+8':\n\t\t\t//\t\t\t\t\tcase 'tenor-8':\n\t\t\t//\t\t\t\t\t\tel.verticalPos = - el.verticalPos; min = -40; max = 40;\n\t\t\t////\t\t\t\t\t\tel.verticalPos+=2; min += 6; max += 6;\n\t\t\t//\t\t\t\t\t\tbreak;\n\t\t\t//\t\t\t\t\tcase 'alto':\n\t\t\t//\t\t\t\t\tcase 'alto+8':\n\t\t\t//\t\t\t\t\tcase 'alto-8':\n\t\t\t//\t\t\t\t\t\tel.verticalPos = - el.verticalPos; min = -40; max = 40;\n\t\t\t////\t\t\t\t\t\tel.verticalPos-=2; min += 4; max += 4;\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\tif (el.verticalPos < min) {\n\t\t\t//\t\t\t\t\twhile (el.verticalPos < min)\n\t\t\t//\t\t\t\t\t\tel.verticalPos += 7;\n\t\t\t//\t\t\t\t} else if (el.verticalPos > max) {\n\t\t\t//\t\t\t\t\twhile (el.verticalPos > max)\n\t\t\t//\t\t\t\t\t\tel.verticalPos -= 7;\n\t\t\t//\t\t\t\t}\n\t\t\t//}\n\t\t}", "function subtitleSidePosition(subWidth, titleWidth, subScale, titleScale, marginBetween) {\nvar subHalfWidth = (subWidth*subScale)/2;\nvar titleHalfWidth = (titleWidth*titleScale)/2;\n// Calculate how far from the center this title needs to be\nvar centerOffset = subHalfWidth + titleHalfWidth + marginBetween;\nvar offset = ($(window).width()/2) - centerOffset;\n\nreturn offset;\n}", "function distFromTextToEvent($elem, event) {\n // I don't think there's any built in browser support that helps\n // us to find the distance.\n // Therefore, place many magic marks inside $elem, and check the\n // distance from each mark to the mousedown evenet. Then return\n // the shortest distance.\n // We have no idea where the text line-wraps, so we cannot be\n // clever about where to insert the marks.\n\n // {{{ Two vaguely related StackOverflow questions.\n // <http://stackoverflow.com/questions/1589721/\n // how-can-i-position-an-element-next-to-user-text-selection>\n // <http://stackoverflow.com/questions/2031518/\n // javascript-selection-range-coordinates> }}}\n\n // Add marks to a copy of $elem's inner html.\n var $parent = $elem;\n var innerHtmlBefore = $parent.html();\n var mark = '<span class=\"utrscrlhlpr\"/>';\n // First replace all html tags with a placeholder.\n // (When we add marks, we don't want to add them inside tags.)\n // (It seems any '<' in attribute values have been escaped to '&lt;')\n var savedTags = [];\n var innerHtmlNoTags =\n innerHtmlBefore.replace(/<[^>]*>/g, function($0) {\n savedTags.push($0);\n return '·'; // COULD find a rarer utf-8 char? (Also update TagDog)\n });\n // For now, insert a mark between every two chars. We need frequent\n // marks if the font size is huge. Could check font size of\n // all elems in $target, and reduce num chars between marks.\n // (For one single elem: parseInt($elem.css('font-size')); )\n // But not needed? Performance is fine, on my computer :-)\n var htmlWithMarksNoTags = mark + innerHtmlNoTags.replace(\n /(\\s*.{0,2})/g, '$1'+ mark);\n // Put back all html tags.\n var savedTagsIx = 0;\n var htmlWithMarks = htmlWithMarksNoTags.replace(/·/g, function() {\n savedTagsIx += 1;\n return savedTags[savedTagsIx - 1];\n });\n\n // Clone $parent, and insert the marks into the clone.\n // We won't modify $parent itself — doing that would 1) destroy any\n // text selection object (but other Javascript code might need it),\n // and perhaps 2) break other related Javascript code and event\n // bindings in other ways.\n // {{{ You might wonder what happens if $parent is the <html> and the page\n // is huge. This isn't likely to happen though, because we only run\n // this code for elems that contains text or inline elems with text,\n // and such blocks are usually small. Well written text contains\n // reasonably small paragraphs, no excessively huge blocks of text? }}}\n var $parentClone = $parent.clone();\n $parentClone.html(htmlWithMarks);\n\n // Replace the parent with the clone, so we can use the clone in\n // distance measurements. But don't remove the parent — that would\n // destroy any text selection.\n // One minor (?) issues/bug:\n // If the $parent is positioned via CSS like :last-child or\n // :only-child, that CSS wouldn't be applied to the clone, so distance\n // measurement might become inaccurate.\n // Is this unavoidable? We cannot remove the real $parent, or we'd\n // destroy the text selection (if there is one).\n $parentClone.insertBefore($parent);\n\n // {{{ Alternative approach\n // Place with 'position: absolute' the clone on the parent.\n //\n // However, if the start of the parent isn't at the parent's upper\n // left corner, word wrapping in the parent and the clone won't be\n // identical. Example:\n // |text text text text text text text text text text text|\n // |text text text text text text text<small>parent parent|\n // |parent parent</small> |\n // If you clone <small> and 'position: absolute' the clone on\n // the original <small>, the clone will have no line wraps,\n // but look like so:\n // |text text text text text text text text text text text|\n // —> |<small>parent parent parent parent</small>xt text text|\n // |parent parent</small> |\n // Possible solution: Find the closest elem with display: block,\n // and clone it. Then word wraps should become identical?\n //\n //$parentClone\n // .css({\n // width: $parent.width(),\n // height: $parent.height(),\n // position: 'absolute'\n // })\n // .insertBefore($parent)\n // .position({ my: 'left top', at: 'left top', of: $parent });\n //\n // }}}\n\n // Find mousedown position relative document.\n // (This is supposedly cross browser compatible, see e.g.\n // http://stackoverflow.com/a/4430498/694469.)\n var mouseOffs;\n if (event.pageX || event.pageY) {\n mouseOffs = { x: event.pageX, y: event.pageY };\n }\n else {\n var d = document;\n mouseOffs = {\n x: event.clientX + d.body.scrollLeft + d.documentElement.scrollLeft,\n y: event.clientY + d.body.scrollTop + d.documentElement.scrollTop\n };\n }\n\n // Find min distance from [the marks inside the clone] to the mouse pos.\n var minDist2 = 999999999;\n $parentClone.find('.utrscrlhlpr').each(function() {\n var myOffs = $(this).offset();\n var distX = mouseOffs.x - myOffs.left;\n var distY = mouseOffs.y - myOffs.top;\n var dist2 = distX * distX + distY * distY;\n if (dist2 < minDist2) {\n minDist2 = dist2;\n // debug('New max dist from: '+ myOffs.left +','+ myOffs.top +\n // ' to: '+ mouseOffs.x +','+ mouseOffs.y +' is: '+ dist2);\n }\n });\n\n $parentClone.remove();\n\n return Math.sqrt(minDist2);\n }", "function estimateCoords(cm, pos) {\n\t\t var left = 0, pos = clipPos(cm.doc, pos);\n\t\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t\t var lineObj = getLine(cm.doc, pos.line);\n\t\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function Zt(e,t,a,n,r){t.before&&(a=-1);var f,o=a+(n||\"\");return t.cache.hasOwnProperty(o)?f=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(jt(e,t.view,t.rect),t.hasHeights=!0),f=Yt(e,t,a,n),f.bogus||(t.cache[o]=f)),{left:f.left,right:f.right,top:r?f.rtop:f.top,bottom:r?f.rbottom:f.bottom}}", "function va(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n(\"span\",\"xxxxxxxxxx\"),r=n(\"pre\",[t]);a(e.measure,r);var f=t.getBoundingClientRect(),o=(f.right-f.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}", "function PdfStringLayouter(){/**\n * Checks whether the x co-ordinate is need to set as client size or not.\n * @hidden\n * @private\n */this.isOverloadWithPosition=false;//\n}", "function estimateCoords(cm, pos) {\r\n var left = 0, pos = clipPos(cm.doc, pos);\r\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\r\n var lineObj = getLine(cm.doc, pos.line);\r\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\r\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\r\n }", "function centerOf(text) {\n let center = Math.floor(text.length / 2);\n if (text.length % 2 === 1) {\n return text[center];\n }\n\n return text[center - 1] + text[center];\n}", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function centerText() {\n // compute text width \n const textWidth = this.getComputedTextLength();\n // grab current x value\n const x = d3.select(this).attr('x');\n // re-center text based on textWidth\n return x - (textWidth / 2);\n}", "function findWordPosition (paragr, list, index, longestLength){\r\n\t//lay vi tri xuat hien cua tu\r\n\tvar position = paragr.indexOf(list[index]);\r\n\t\r\n\t//neu tu khong xuat hien trong doan van thi tra ve gia tri am\r\n\tif (position == -1) {\r\n\t\treturn (- longestLength);\r\n\t}\r\n\t\r\n\t//neu tu la hop le thi tra ve vi tri goc\r\n\t//neu khong thi de quy tim kiem tu \r\n\tif (checkInvalid(paragr, position, list[index].length)) {\r\n\t\treturn position;\r\n\t}\r\n\telse {\r\n\t\tvar subParagr = paragr.substring (position + list[index].length + 1);\t\t\t//can cong 1 de tranh truong hop 2 tu giong het nhau duoc noi vao nhau\r\n\t\treturn (position + findWordPosition(subParagr, list, index, longestLength));\r\n\t}\r\n}", "measureEmojiPopoverAnchorPosition() {\n if (this.emojiPopoverAnchor) {\n this.emojiPopoverAnchor.measureInWindow((x, y, width) => this.setState({\n emojiPopoverAnchorPosition: {horizontal: x + width, vertical: y},\n }));\n }\n }", "function estimateCoords(cm, pos) {\n\t\t var left = 0;\n\t\t pos = clipPos(cm.doc, pos);\n\t\t if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n\t\t var lineObj = getLine(cm.doc, pos.line);\n\t\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t\t return {left: left, right: left, top: top, bottom: top + lineObj.height}\n\t\t }", "function getTextAnnotationPosition(source, element) {\n var sourceTrbl = Object(diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_1__[\"asTRBL\"])(source);\n var position = {\n x: sourceTrbl.right + element.width / 2,\n y: sourceTrbl.top - 50 - element.height / 2\n };\n var escapeDirection = {\n y: {\n margin: -30,\n rowSize: 20\n }\n };\n return deconflictPosition(source, element, position, escapeDirection);\n}", "function fitText(ctx, str, font, style, width){\n\tvar l=36\n\tvar r=100\n\twhile (r-l>1){\n\t\tvar m=Math.floor((l+r)/2)\n\t\tctx.font = style + \" \" + m.toString()+\"px \"+font\n\t\tif (ctx.measureText(str).width <= width){\n\t\t\tl=m\n\t\t} else {\n\t\t\tr=m\n\t\t}\n\t}\n\treturn l\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function default_1(text, x, y, styles, doc) {\n styles = styles || {};\n var FONT_ROW_RATIO = 1.15;\n if (typeof x !== 'number' || typeof y !== 'number') {\n console.error('The x and y parameters are required. Missing for text: ', text);\n }\n var k = doc.internal.scaleFactor;\n var fontSize = doc.internal.getFontSize() / k;\n var splitRegex = /\\r\\n|\\r|\\n/g;\n var splitText = '';\n var lineCount = 1;\n if (styles.valign === 'middle' ||\n styles.valign === 'bottom' ||\n styles.halign === 'center' ||\n styles.halign === 'right') {\n splitText = typeof text === 'string' ? text.split(splitRegex) : text;\n lineCount = splitText.length || 1;\n }\n // Align the top\n y += fontSize * (2 - FONT_ROW_RATIO);\n if (styles.valign === 'middle')\n y -= (lineCount / 2) * fontSize * FONT_ROW_RATIO;\n else if (styles.valign === 'bottom')\n y -= lineCount * fontSize * FONT_ROW_RATIO;\n if (styles.halign === 'center' || styles.halign === 'right') {\n var alignSize = fontSize;\n if (styles.halign === 'center')\n alignSize *= 0.5;\n if (splitText && lineCount >= 1) {\n for (var iLine = 0; iLine < splitText.length; iLine++) {\n doc.text(splitText[iLine], x - doc.getStringUnitWidth(splitText[iLine]) * alignSize, y);\n y += fontSize * FONT_ROW_RATIO;\n }\n return doc;\n }\n x -= doc.getStringUnitWidth(text) * alignSize;\n }\n if (styles.halign === 'justify') {\n doc.text(text, x, y, {\n maxWidth: styles.maxWidth || 100,\n align: 'justify',\n });\n }\n else {\n doc.text(text, x, y);\n }\n return doc;\n}", "function default_1(text, x, y, styles, doc) {\n styles = styles || {};\n var FONT_ROW_RATIO = 1.15;\n var k = doc.internal.scaleFactor;\n var fontSize = doc.internal.getFontSize() / k;\n var splitRegex = /\\r\\n|\\r|\\n/g;\n var splitText = '';\n var lineCount = 1;\n if (styles.valign === 'middle' ||\n styles.valign === 'bottom' ||\n styles.halign === 'center' ||\n styles.halign === 'right') {\n splitText = typeof text === 'string' ? text.split(splitRegex) : text;\n lineCount = splitText.length || 1;\n }\n // Align the top\n y += fontSize * (2 - FONT_ROW_RATIO);\n if (styles.valign === 'middle')\n y -= (lineCount / 2) * fontSize * FONT_ROW_RATIO;\n else if (styles.valign === 'bottom')\n y -= lineCount * fontSize * FONT_ROW_RATIO;\n if (styles.halign === 'center' || styles.halign === 'right') {\n var alignSize = fontSize;\n if (styles.halign === 'center')\n alignSize *= 0.5;\n if (splitText && lineCount >= 1) {\n for (var iLine = 0; iLine < splitText.length; iLine++) {\n doc.text(splitText[iLine], x - doc.getStringUnitWidth(splitText[iLine]) * alignSize, y);\n y += fontSize * FONT_ROW_RATIO;\n }\n return doc;\n }\n x -= doc.getStringUnitWidth(text) * alignSize;\n }\n if (styles.halign === 'justify') {\n doc.text(text, x, y, {\n maxWidth: styles.maxWidth || 100,\n align: 'justify',\n });\n }\n else {\n doc.text(text, x, y);\n }\n return doc;\n}", "function default_1(text, x, y, styles, doc) {\n styles = styles || {};\n var FONT_ROW_RATIO = 1.15;\n var k = doc.internal.scaleFactor;\n var fontSize = doc.internal.getFontSize() / k;\n var splitRegex = /\\r\\n|\\r|\\n/g;\n var splitText = '';\n var lineCount = 1;\n if (styles.valign === 'middle' ||\n styles.valign === 'bottom' ||\n styles.halign === 'center' ||\n styles.halign === 'right') {\n splitText = typeof text === 'string' ? text.split(splitRegex) : text;\n lineCount = splitText.length || 1;\n }\n // Align the top\n y += fontSize * (2 - FONT_ROW_RATIO);\n if (styles.valign === 'middle')\n y -= (lineCount / 2) * fontSize * FONT_ROW_RATIO;\n else if (styles.valign === 'bottom')\n y -= lineCount * fontSize * FONT_ROW_RATIO;\n if (styles.halign === 'center' || styles.halign === 'right') {\n var alignSize = fontSize;\n if (styles.halign === 'center')\n alignSize *= 0.5;\n if (splitText && lineCount >= 1) {\n for (var iLine = 0; iLine < splitText.length; iLine++) {\n doc.text(splitText[iLine], x - doc.getStringUnitWidth(splitText[iLine]) * alignSize, y);\n y += fontSize * FONT_ROW_RATIO;\n }\n return doc;\n }\n x -= doc.getStringUnitWidth(text) * alignSize;\n }\n if (styles.halign === 'justify') {\n doc.text(text, x, y, {\n maxWidth: styles.maxWidth || 100,\n align: 'justify',\n });\n }\n else {\n doc.text(text, x, y);\n }\n return doc;\n}", "function default_1(text, x, y, styles, doc) {\n styles = styles || {};\n var FONT_ROW_RATIO = 1.15;\n var k = doc.internal.scaleFactor;\n var fontSize = doc.internal.getFontSize() / k;\n var splitRegex = /\\r\\n|\\r|\\n/g;\n var splitText = '';\n var lineCount = 1;\n if (styles.valign === 'middle' ||\n styles.valign === 'bottom' ||\n styles.halign === 'center' ||\n styles.halign === 'right') {\n splitText = typeof text === 'string' ? text.split(splitRegex) : text;\n lineCount = splitText.length || 1;\n }\n // Align the top\n y += fontSize * (2 - FONT_ROW_RATIO);\n if (styles.valign === 'middle')\n y -= (lineCount / 2) * fontSize * FONT_ROW_RATIO;\n else if (styles.valign === 'bottom')\n y -= lineCount * fontSize * FONT_ROW_RATIO;\n if (styles.halign === 'center' || styles.halign === 'right') {\n var alignSize = fontSize;\n if (styles.halign === 'center')\n alignSize *= 0.5;\n if (splitText && lineCount >= 1) {\n for (var iLine = 0; iLine < splitText.length; iLine++) {\n doc.text(splitText[iLine], x - doc.getStringUnitWidth(splitText[iLine]) * alignSize, y);\n y += fontSize * FONT_ROW_RATIO;\n }\n return doc;\n }\n x -= doc.getStringUnitWidth(text) * alignSize;\n }\n if (styles.halign === 'justify') {\n doc.text(text, x, y, {\n maxWidth: styles.maxWidth || 100,\n align: 'justify',\n });\n }\n else {\n doc.text(text, x, y);\n }\n return doc;\n}", "function calculateWidthForText(text) {\n if (spacer === undefined) { // on first call only.\n spacer = document.createElement('span'); \n spacer.style.visibility = 'hidden';\n spacer.style.position = 'fixed';\n spacer.style.outline = '0';\n spacer.style.margin = '0';\n spacer.style.padding = '0';\n spacer.style.border = '0';\n spacer.style.left = '0';\n spacer.style.whiteSpace = 'pre';\n spacer.style.fontSize = config.fontSize;\n spacer.style.fontFamily = config.fontFamily;\n spacer.style.fontWeight = 'normal';\n document.body.appendChild(spacer); \n } \n \n // Used to encode an HTML string into a plain text.\n // taken from http://stackoverflow.com/questions/1219860/javascript-jquery-html-encoding\n spacer.innerHTML = String(text).replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n return spacer.getBoundingClientRect().right;\n }", "function calculateWidthForText(text) {\n if (spacer === undefined) { // on first call only.\n spacer = document.createElement('span'); \n spacer.style.visibility = 'hidden';\n spacer.style.position = 'fixed';\n spacer.style.outline = '0';\n spacer.style.margin = '0';\n spacer.style.padding = '0';\n spacer.style.border = '0';\n spacer.style.left = '0';\n spacer.style.whiteSpace = 'pre';\n spacer.style.fontSize = config.fontSize;\n spacer.style.fontFamily = config.fontFamily;\n spacer.style.fontWeight = 'normal';\n document.body.appendChild(spacer); \n } \n \n // Used to encode an HTML string into a plain text.\n // taken from http://stackoverflow.com/questions/1219860/javascript-jquery-html-encoding\n spacer.innerHTML = String(text).replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n return spacer.getBoundingClientRect().right;\n }", "function calculateWidthForText(text) {\n if (spacer === undefined) { // on first call only.\n spacer = document.createElement('span'); \n spacer.style.visibility = 'hidden';\n spacer.style.position = 'fixed';\n spacer.style.outline = '0';\n spacer.style.margin = '0';\n spacer.style.padding = '0';\n spacer.style.border = '0';\n spacer.style.left = '0';\n spacer.style.whiteSpace = 'pre';\n spacer.style.fontSize = config.fontSize;\n spacer.style.fontFamily = config.fontFamily;\n spacer.style.fontWeight = 'normal';\n document.body.appendChild(spacer); \n } \n \n // Used to encode an HTML string into a plain text.\n // taken from http://stackoverflow.com/questions/1219860/javascript-jquery-html-encoding\n spacer.innerHTML = String(text).replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n return spacer.getBoundingClientRect().right;\n }", "function measureText(description) {\n const splitted = description.split(\"~~\");\n const ctx = document.createElement(\"canvas\").getContext(\"2d\");\n return Math.max(\n ctx.measureText(splitted[0]).width,\n ctx.measureText(splitted[1]).width\n );\n}", "function fixClefPlacement(el) {\n KeyVoice.fixClef(el);\n //if (el.el_type === 'clef') {\n//\t\t\t\tvar min = -2;\n//\t\t\t\tvar max = 5;\n//\t\t\t\tswitch(el.type) {\n//\t\t\t\t\tcase 'treble+8':\n//\t\t\t\t\tcase 'treble-8':\n//\t\t\t\t\t\tbreak;\n//\t\t\t\t\tcase 'bass':\n//\t\t\t\t\tcase 'bass+8':\n//\t\t\t\t\tcase 'bass-8':\n//\t\t\t\t\t\tel.verticalPos = 20 + el.verticalPos; min += 6; max += 6;\n//\t\t\t\t\t\tbreak;\n//\t\t\t\t\tcase 'tenor':\n//\t\t\t\t\tcase 'tenor+8':\n//\t\t\t\t\tcase 'tenor-8':\n//\t\t\t\t\t\tel.verticalPos = - el.verticalPos; min = -40; max = 40;\n////\t\t\t\t\t\tel.verticalPos+=2; min += 6; max += 6;\n//\t\t\t\t\t\tbreak;\n//\t\t\t\t\tcase 'alto':\n//\t\t\t\t\tcase 'alto+8':\n//\t\t\t\t\tcase 'alto-8':\n//\t\t\t\t\t\tel.verticalPos = - el.verticalPos; min = -40; max = 40;\n////\t\t\t\t\t\tel.verticalPos-=2; min += 4; max += 4;\n//\t\t\t\t\t\tbreak;\n//\t\t\t\t}\n//\t\t\t\tif (el.verticalPos < min) {\n//\t\t\t\t\twhile (el.verticalPos < min)\n//\t\t\t\t\t\tel.verticalPos += 7;\n//\t\t\t\t} else if (el.verticalPos > max) {\n//\t\t\t\t\twhile (el.verticalPos > max)\n//\t\t\t\t\t\tel.verticalPos -= 7;\n//\t\t\t\t}\n //}\n }", "svgLabelAlign(text, wrapBound, childNodes) {\n let bounds = new Size(wrapBound.width, childNodes.length * (text.fontSize * 1.2));\n let pos = { x: 0, y: 0 };\n let x = 0;\n let y = 1.2;\n let offsetX = text.width * 0.5;\n let offsety = text.height * 0.5;\n let pointX = offsetX;\n let pointY = offsety;\n if (text.textAlign === 'left') {\n pointX = 0;\n }\n else if (text.textAlign === 'center') {\n if (wrapBound.width > text.width && (text.textOverflow === 'Ellipsis' || text.textOverflow === 'Clip')) {\n pointX = 0;\n }\n else {\n pointX = text.width * 0.5;\n }\n }\n else if (text.textAlign === 'right') {\n pointX = (text.width * 1);\n }\n pos.x = x + pointX + (wrapBound ? wrapBound.x : 0);\n pos.y = y + pointY - bounds.height / 2;\n return pos;\n }", "function estimateCoords(cm, pos) {\r\n var left = 0;\r\n pos = clipPos(cm.doc, pos);\r\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\r\n var lineObj = getLine(cm.doc, pos.line);\r\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\r\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\r\n}", "function estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function text$6(str, x, y, width, height, z) {\n // 'fail' on 0-valued dimensions\n if (str.length === 0 || width === 0 || height === 0) {\n return;\n }\n // also 'fail' if the text height is larger than the bounding height\n if(curTextSize > height) {\n return;\n }\n\n var spaceMark = -1;\n var start = 0;\n var lineWidth = 0;\n var drawCommands = [];\n\n // run through text, character-by-character\n for (var charPos=0, len=str.length; charPos < len; charPos++)\n {\n var currentChar = str[charPos];\n var spaceChar = (currentChar === \" \");\n var letterWidth = curTextFont.measureTextWidth(currentChar);\n\n // if we aren't looking at a newline, and the text still fits, keep processing\n if (currentChar !== \"\\n\" && (lineWidth + letterWidth <= width)) {\n if (spaceChar) { spaceMark = charPos; }\n lineWidth += letterWidth;\n }\n\n // if we're looking at a newline, or the text no longer fits, push the section that fit into the drawcommand list\n else\n {\n if (spaceMark + 1 === start) {\n if(charPos>0) {\n // Whole line without spaces so far.\n spaceMark = charPos;\n } else {\n // 'fail', because the line can't even fit the first character\n return;\n }\n }\n\n if (currentChar === \"\\n\") {\n drawCommands.push({text:str.substring(start, charPos), width: lineWidth});\n start = charPos + 1;\n } else {\n // current is not a newline, which means the line doesn't fit in box. push text.\n // In Processing 1.5.1, the space is also pushed, so we push up to spaceMark+1,\n // rather than up to spaceMark, as was the case for Processing 1.5 and earlier.\n drawCommands.push({text:str.substring(start, spaceMark+1), width: lineWidth});\n start = spaceMark + 1;\n }\n\n // newline + return\n lineWidth = 0;\n charPos = start - 1;\n }\n }\n\n // push the remaining text\n if (start < len) {\n drawCommands.push({text:str.substring(start), width: lineWidth});\n }\n\n // resolve horizontal alignment\n var xOffset = 1,\n yOffset = curTextAscent;\n if (horizontalTextAlignment === PConstants.CENTER) {\n xOffset = width/2;\n } else if (horizontalTextAlignment === PConstants.RIGHT) {\n xOffset = width;\n }\n\n // resolve vertical alignment\n var linesCount = drawCommands.length,\n visibleLines = Math.min(linesCount, Math.floor(height/curTextLeading));\n if(verticalTextAlignment === PConstants.TOP) {\n yOffset = curTextAscent + curTextDescent;\n } else if(verticalTextAlignment === PConstants.CENTER) {\n yOffset = (height/2) - curTextLeading * (visibleLines/2 - 1);\n } else if(verticalTextAlignment === PConstants.BOTTOM) {\n yOffset = curTextDescent + curTextLeading;\n }\n\n var command,\n drawCommand,\n leading;\n for (command = 0; command < linesCount; command++) {\n leading = command * curTextLeading;\n // stop if not enough space for one more line draw\n if (yOffset + leading > height - curTextDescent) {\n break;\n }\n drawCommand = drawCommands[command];\n drawing.text$line(drawCommand.text, x + xOffset, y + yOffset + leading, z, horizontalTextAlignment);\n }\n }", "_measureLabel() {\r\n let drawContext = canvas._canvas.getContext(\"2d\");\r\n \r\n drawContext.save();\r\n this._setupText(drawContext);\r\n let measurements = drawContext.measureText(this._text);\r\n drawContext.restore();\r\n \r\n let numLines = 1 + (this._text.match(new RegExp(\"\\n\", \"g\")) || []).length;\r\n \r\n this._textWidth = measurements.width;\r\n this._textHeight = this._fontHeight * numLines;\r\n }", "function getCaretPosition () {\r\n var selection = window.getSelection()\r\n var position = selection.anchorOffset\r\n // We move up to the parent span\r\n var sibling = selection.anchorNode.parentNode.previousSibling\r\n while (sibling !== null) {\r\n if (sibling.childNodes.length > 0) {\r\n position += sibling.childNodes[0].length\r\n }\r\n sibling = sibling.previousSibling\r\n }\r\n return position // position\r\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function fixClefPlacement(el) {\n\t\t\t//if (el.el_type === 'clef') {\n\t\t\t\tvar min = -2;\n\t\t\t\tvar max = 5;\n\t\t\t\tswitch(el.type) {\n\t\t\t\t\tcase 'treble+8':\n\t\t\t\t\tcase 'treble-8':\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'bass':\n\t\t\t\t\tcase 'bass+8':\n\t\t\t\t\tcase 'bass-8':\n\t\t\t\t\t\tel.verticalPos = 20 + el.verticalPos; min += 6; max += 6;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'tenor':\n\t\t\t\t\tcase 'tenor+8':\n\t\t\t\t\tcase 'tenor-8':\n\t\t\t\t\t\tel.verticalPos = - el.verticalPos; min = -40; max = 40;\n//\t\t\t\t\t\tel.verticalPos+=2; min += 6; max += 6;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'alto':\n\t\t\t\t\tcase 'alto+8':\n\t\t\t\t\tcase 'alto-8':\n\t\t\t\t\t\tel.verticalPos = - el.verticalPos; min = -40; max = 40;\n//\t\t\t\t\t\tel.verticalPos-=2; min += 4; max += 4;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (el.verticalPos < min) {\n\t\t\t\t\twhile (el.verticalPos < min)\n\t\t\t\t\t\tel.verticalPos += 7;\n\t\t\t\t} else if (el.verticalPos > max) {\n\t\t\t\t\twhile (el.verticalPos > max)\n\t\t\t\t\t\tel.verticalPos -= 7;\n\t\t\t\t}\n\t\t\t//}\n\t\t}", "function j(){var e=s.getBoundingClientRect(),r=\"offset\"+[\"Width\",\"Height\"][t.ort]\nreturn 0===t.ort?e.width||s[r]:e.height||s[r]}", "getEndPosition(widget) {\n let left = widget.x;\n let top = widget.y;\n let lineWidget = undefined;\n if (widget.childWidgets.length > 0) {\n lineWidget = widget.childWidgets[widget.childWidgets.length - 1];\n left += this.getWidth(lineWidget, false);\n }\n if (!isNullOrUndefined(lineWidget)) {\n top = this.getTop(lineWidget);\n }\n let topMargin = 0;\n let bottomMargin = 0;\n let size = this.getParagraphMarkSize(widget, topMargin, bottomMargin);\n return new Point(left, top + size.topMargin);\n }" ]
[ "0.77611184", "0.6996046", "0.6972673", "0.68239707", "0.68239707", "0.68066204", "0.6769876", "0.6769876", "0.6684288", "0.6678145", "0.6674764", "0.6477504", "0.6477504", "0.6477504", "0.64566815", "0.6448371", "0.6388521", "0.631873", "0.6301182", "0.62949", "0.6261091", "0.62255305", "0.62179846", "0.6217779", "0.6211889", "0.6163007", "0.61107427", "0.6094525", "0.6094494", "0.6069081", "0.6065931", "0.6041482", "0.601478", "0.601478", "0.601478", "0.60002863", "0.5998246", "0.59890306", "0.5974611", "0.5973857", "0.5955958", "0.5955958", "0.5955958", "0.5955958", "0.5955958", "0.5955958", "0.5955958", "0.5955958", "0.59532154", "0.59529716", "0.59511065", "0.5937388", "0.5924275", "0.5904736", "0.5885607", "0.5885607", "0.5885607", "0.5885607", "0.5885607", "0.5885607", "0.5885607", "0.5885607", "0.5885607", "0.5885607", "0.5885607", "0.5885607", "0.5885607", "0.5885607", "0.5885607", "0.5885607", "0.5885607", "0.58812946", "0.58745277", "0.58745277", "0.58745277", "0.58745235", "0.58745235", "0.58745235", "0.5872223", "0.5869687", "0.5864718", "0.58558476", "0.58412755", "0.58412755", "0.5838518", "0.5833026", "0.5823493", "0.5811001", "0.5811001", "0.5811001", "0.5811001", "0.5811001", "0.5811001", "0.5811001", "0.5811001", "0.5811001", "0.5811001", "0.5811001", "0.5782168", "0.57648253", "0.5764489" ]
0.0
-1
corrects the font size depend on distance or amount (if this mode is active)
function fontCorrection(distance){ if (mapSettings[0].fontCorrection==true){ if (mapSettings[0].mode == "distance"){ if (distance>10000){return 0.6}else{ if (distance>1000){return 0.7}else{ if (distance>100){return 0.8} else{ if (distance>10){return 0.9} else{ return 1}}}} } if (mapSettings[0].mode == "amount"){ if (distance>10000){return 1.60}else{ if (distance>1000){return 1.45}else{ if (distance>100){return 1.30} else{ if (distance>10){return 1.15} else{ return 1}}}} } } else {return 1} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function adjustTextSize(){\n /* var size = 0;\n console.log(\"screen \" + screen.width());\n console.log(\"expre \" + screenExpression.width());\n if(screenExpression.width() > screen.width()){\n size = (screen.width()+40)/screenExpression.width();\n screenExpression.css(\"font-size\",size + \"rem\");\n }else{\n size = 1.5; */\n // console.log(\"expre \" + screenExpression.width());\n // screenExpression.css(\"font-size\",size + \"rem\");\n //}\n \n \n}", "function FontSizeChanger(isIncrease) {\n var pattern = /^{{{([\\+-][1-5]) (.+?)}}}$/;\n var t, s = TextProc.selectionStart();\n if (TextProc.selectionTest(pattern)) {\n var t = TextProc.selectionText();\n var fontSize = t.replace(pattern, '$1');\n var innerText = t.replace(pattern, '$2');\n if (isIncrease) fontSize++;\n else fontSize--;\n if (fontSize == 0)\n fontSize = isIncrease ? 1 : -1;\n if (5 < fontSize) fontSize = 5;\n if (fontSize < -5) fontSize = -5;\n if (fontSize > 0) fontSize = '+' + fontSize;\n t = '{{{' + fontSize + ' ' + innerText + '}}}';\n } else {\n t = '{{{' + (isIncrease ? '+1' : '-1') + ' ' + TextProc.selectionText() + '}}}';\n }\n TextProc.selectionText(t);\n TextProc.select(s, s + t.length);\n }", "_updateTextSize(size) {\n this['textSize'] = parseInt(size, 10);\n this._targetEl.style.fontSize = this['textSize'] + 'px';\n this._layoutWords();\n }", "function change_font_size(){\n if(display_arr.length>8 || (display_arr[0].toString().length + display_arr.length)>9){\n $('.display').css('font-size', '2vh')\n }if(display_arr.length>14 || (display_arr[0].toString().length + display_arr.length)>15){\n $('.display').css('font-size', '1.5vh')\n }if(display_arr.length>18 || (display_arr[0].toString().length + display_arr.length)>19){\n $('.display').css('font-size', '1vh')\n }\n}", "function decreaseSize(){\r\n var el = document.getElementById('main');\r\n var style = window.getComputedStyle(el, null).getPropertyValue('font-size');\r\n var fontSize = parseFloat(style); \r\n if(limitFontD <= 5){\r\n el.style.fontSize = (fontSize-1)+\"px\";\r\n limitFontD++;\r\n if(limitFontI>0){\r\n limitFontI--;\r\n }\r\n }else{\r\n alert('Font Decrease Limit Reached!');\r\n }\r\n}", "function checkSize() {\n var truncate = function truncate() {\n if (line < 1) lineData = [that._ellipsis(\"\", line)];else lineData[line - 1] = that._ellipsis(lineData[line - 1], line);\n }; // Constraint the font size\n\n\n fS = max([fS, fMin]);\n fS = min([fS, fMax]);\n\n if (resize) {\n lH = fS * lHRatio;\n wrapper.fontSize(fS).lineHeight(lH);\n style[\"font-size\"] = fS;\n style[\"line-height\"] = lH;\n }\n\n wrapResults = wrapper(t);\n lineData = wrapResults.lines.filter(function (l) {\n return l !== \"\";\n });\n line = lineData.length;\n\n if (wrapResults.truncated) {\n if (resize) {\n fS--;\n\n if (fS < fMin) {\n fS = fMin;\n truncate();\n return;\n } else checkSize();\n } else truncate();\n }\n }", "function btnBiggerDecorationClick() {\n setInterval(() => {\n var style = window.getComputedStyle(textArea, null).getPropertyValue('font-size').replace(\"px\", \"\");\n //1 px=0.75pt convert to pt then add 2;\n var newSize=(parseInt(style)/0.75)+2;\n textArea.style.fontSize =newSize+'pt';\n }, 500)\n }", "function updateTextSize(element, size)\n{\n\telement.style.fontSize = innerHeight * size / 100 + \"px\";\n}", "function doubleTextSize(){\r\n var x = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6');\r\n var text = \"\";\r\n var style1 = \"\";\r\n var size = \"\";\r\n\r\n var i;\r\n\r\n //If they are not doubled in size make them double in size.\r\n if(!switched)\r\n {\r\n for(i = 0; i < x.length; i++)\r\n {\r\n text = x[i];\r\n style1 = window.getComputedStyle(text, null).getPropertyValue('font-size');\r\n size = parseFloat(style1);\r\n text.style.fontSize = (size + size) + 'px';\r\n }\r\n\r\n switched = true;\r\n }\r\n //If they are doubled in sized go back to original size.\r\n else {\r\n for(i = 0; i < x.length; i++)\r\n {\r\n text = x[i];\r\n style1 = window.getComputedStyle(text, null).getPropertyValue('font-size');\r\n size = parseFloat(style1);\r\n text.style.fontSize = (size/2) + 'px';\r\n }\r\n\r\n switched = false;\r\n }\r\n\r\n}", "calSize(num){\n let opt = this.options;\n if(num > 6 && opt.width > 60 && opt.height > 60 && opt['font-size'] > 40){\n this.options.width = 60;\n this.options.height = 60;\n this.options['font-size'] = 40;\n }\n }", "_updateFontSizes() {\n const timezoneFontSize = Math.max(Math.min(this._timezoneElm.parentElement.clientWidth / (2 * 10), parseFloat(25)), parseFloat(15));\n const dateFontSize = Math.max(Math.min(this._dateElm.clientWidth / (2 * 10), parseFloat(25)), parseFloat(15));\n const clockFontSize = Math.max(Math.min(this._clockElm.clientWidth / (0.8 * 10), parseFloat(100)), parseFloat(30));\n if (timezoneFontSize + dateFontSize + clockFontSize + Utils.convertRemToPixels(2) <= this._clock.container.clientHeight) {\n this._timezoneElm.style.fontSize = `${timezoneFontSize}px`;\n this._dateElm.style.fontSize = `${dateFontSize}px`;\n this._clockElm.style.fontSize = `${clockFontSize}px`;\n }\n }", "function font_size(x) { x ? null : x=\"100%\" ; return \"font-size: \"+x+\" ! important;\"}", "function updateTextSize(newSize) {\n setClassExclusively(window.dGO.printArea, newSize, window.dGO.allTextSizes);\n}", "function doResize() {\n var cW = $(\".current\").width();\n var maxW = 325;\n var size = $(\".current\").css(\"font-size\").replace(/\\D/g, \"\");\n var tenPer = Math.floor(size *.1);\n if(cW >= maxW){\n while(cW >= maxW){\n size = size - tenPer;\n $('.current').css('font-size',size +'px');\n cW = $(\".current\").width();\n }\n }\n }", "function changeTextSize() {\n\tvar getTextBox = document.getElementById('text-area');\n\tvar getFontBox = document.getElementById('fontsize');\n\tif(getFontBox.value === 'Tiny'){\n\t\tgetTextBox.style.fontSize = '50%';\n\t} else if(getFontBox.value === 'Small'){\n\t\tgetTextBox.style.fontSize = '60%';\n\t} else if(getFontBox.value === 'Medium'){\n\t\tgetTextBox.style.fontSize = '70%';\n\t} else if(getFontBox.value === 'Large'){\n\t\tgetTextBox.style.fontSize = '80%';\n\t} else if(getFontBox.value === 'Extra Large'){\n\t\tgetTextBox.style.fontSize = '90%';\n\t} else if(getFontBox.value === 'XXL'){\n\t\tgetTextBox.style.fontSize = '120%';\n\t}\n}", "function scale(){\n\t\t\tif(win.width() > min && win.width() < max){\n\t\t\t\t\teq = ((win.width() / min) / inc) + bas;\n\t\t\t\t\t$(tag).css({\n\t\t\t\t\t\t'font-size' : eq+'px',\n\t\t\t\t\t\t'line-height' : eq * 1.5+'px',\n\t\t\t\t\t\t'letter-spacing' : (max / max) + ((win.width() / max) /100),\n\t\t\t\t\t\t'margin-bottom' : eq / 2+'px'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t }", "function onDecreaseFontSize() {\n decreaseFontSize()\n let elFont = document.querySelector('.font-size-display')\n elFont.innerHTML = gMeme.currText.size\n draw()\n}", "function scaleTipText(){\n var length = tip.node().getComputedTextLength();\n // rescale text accordingly\n if (length > donutWidth){\n tip.style(\"font-size\", Math.round(length/30))\n } else {\n tip.style(\"font-size\", 11)\n }\n}", "function scaleFont( fact ) {\n fontSize *= fact;\n var cssrule = '#'+self.cfg.stylesId+'{ #'+pageContainer.id+' .TextEquiv }';\n $.stylesheet(cssrule).css( 'font-size', fontSize+'px' );\n }", "refreshFontSize() {\n\t\tvar size = this.savedFontSize;\n\t\tsize = size * renko.getWindowScale();\n\t\tsize = size * (2 / window.devicePixelRatio);\n\t\tthis.style.fontSize = String(size) + \"px\";\n\t}", "function resizeFont() {\n for(var i = 0; i < squares.length; i++) {\n var relativeFontSize = squares[i].offsetWidth*0.05;\n squares[i].style.fontSize = relativeFontSize+'px';\n }\n}", "setFontSize(px) {\n this.font.size = px;\n this.setFont();\n }", "function changeFontSize(value) {\n\tif (value == \"small\") {\n\t\tfontSize = SMALL_CHAR_TAPE_LENGTH_INCHES;\n\t} else if (value == \"medium\") {\n\t\tfontSize = MEDIUM_CHAR_TAPE_LENGTH_INCHES;\n\t} else if (value == \"large\") {\n\t\tfontSize = LARGE_CHAR_TAPE_LENGTH_INCHES;\n\t} else {\n\t\tfontSize = INVALID_INPUT;\n\t}\n\tfontSize *= INCH_TO_METER;\n\tconsole.log(\"font size: \" + value + \"\\nlength of tape needed for each char in meters: \" + fontSize.toFixed(2));\n}", "function setTextSize() {\n css.header['font-size'] = (style.size + 2) + 'px';\n css.smallText['font-size'] = (style.size - 4) + 'px';\n css.main['font-size'] = style.size + 'px';\n css.listItem['font-size'] = style.size + 'px';\n css.button['font-size'] = style.size + 'px';\n css.verse.number['font-size'] = style.size + 'px';\n $rootScope.$broadcast('css:changed');//this lets all of the controllers know that the css object has changed\n }", "function changeSize(){\n\t\t$(\"text-area\").style.fontSize = $(\"size-dropbox\").value;\n\t}", "function increaseSize(){\r\n var el = document.getElementById('main');\r\n var style = window.getComputedStyle(el, null).getPropertyValue('font-size');\r\n var fontSize = parseFloat(style); \r\n if(limitFontI <= 5){\r\n var box = document.getElementById('main');\r\n box.style.fontSize = (fontSize+1)+\"px\";\r\n limitFontI++;\r\n if(limitFontD>0){\r\n limitFontD--;\r\n }\r\n }else{\r\n alert('Font Increase Limit Reached!');\r\n }\r\n}", "function change_font_size() {\n $(\".font_size_input\").val(actual_font_size);\n global.app.settings.font_size = actual_font_size;\n ui.actions_change_font_size(actual_font_size);\n ui.action_save_default_settings();\n }", "updateSize() {\n const _style = window.getComputedStyle(this.track);\n const inheritedFontSize = _style['font-size'];\n\n this.track.style.setProperty('--simple-switch_size', inheritedFontSize);\n }", "function resizeText(multiplier) {\n\tvar myItem = document.getElementById('schedules');\n\t\n\tif (myItem.style.fontSize == \"\") \n\t\tmyItem.style.fontSize = \"1.0em\";\n\t\n\tmyItem.style.fontSize = parseFloat(myItem.style.fontSize) + (multiplier * 0.2) + \"em\";\n}", "function setFS() {\n el.style('font-size', fs + 'px');\n }", "function decreaseFont() {\n\t\t\t\tif (localStorage.getItem(\"WatsonFontSize\") === null) {\t\t\t\t\t// this check isn't necessary (because I do it on page load), but I do it for safety\n\t\t\t\t\tlocalStorage.setItem(\"WatsonFontSize\", \"14\");\n\t\t\t\t\tcurFontSize = 14;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcurFontSize = parseInt(localStorage.getItem(\"WatsonFontSize\"));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar newFontSize = curFontSize - 1;\t\t\t\t\t\t\t\t\t\t// now that we have the stored font, decrease it\n\t\t\t\t$('.page-wrapper').css('font-size', newFontSize);\t\t\t\t\t\t// apply it\n\t\t\t\t\n\t\t\t\tlocalStorage.setItem(\"WatsonFontSize\", \"\" + newFontSize);\t\t\t\t// don't forget to save the new font size back to the data store\n\t\t\t}", "function remCalibrate() {\n\t//document.documentElement.style.fontSize = window.innerWidth/100 + 'px';\n\t var aspect_ratio = (window.innerHeight/window.innerWidth)/0.75\n var vwh = window.innerWidth/100\n var rem = Math.max(8,Math.min(24,vwh*aspect_ratio))\n\n document.documentElement.style.fontSize = rem + 'px';\n}", "resizeOutput() {\n let outputLength = this.value.length;\n\n if (outputLength < 6) {\n this._value.style.fontSize = '130px';\n } else if (outputLength === 6) {\n this._value.style.fontSize = '120px';\n } else if (outputLength === 7) {\n this._value.style.fontSize = '110px';\n } else if (outputLength >= 9) {\n this._value.style.fontSize = '90px';\n }\n }", "function textSize(size) {\r\n\tif(size == 13) \r\n\t{\r\n\t\tjQuery(\"#13\").css({\"cursor\" : \"default\",\"color\" : \"#AAAAAA\"});\r\n\t\tjQuery(\"#14\").css({\"cursor\" : \"pointer\",\"color\" : \"#333333\"});\r\n\t\t\t\t\tjQuery(document).ready(function() {\r\n \t \t\t\t\tjQuery(\"#storyTxt > p, #storyTxt > p > a\").css({\"font-size\" : \"13px\"});\r\n\t\t\t\t\tjQuery(\"#storyTxt > table > caption, #storyTxt > table > tbody > tr > td, #rltdTxt > span , #rltdTxt > span > a, #rltdTxt > div , #rltdTxt > div > a, #authInfo > p,#authInfo > a,#authInfo > span\").css({\"font-size\" : \"11px\"});\r\n \t\t\t\t\t});\r\n\t\tjQuery(\"td.stryPicCptn,li.liSideBarNoBlt,li.liSideBarNoBlt > a,li.liSideBar,li.liSideBar > a\").css({\"font-size\" : \"11px\"}) \r\n\t\tjQuery(\"#rltdBlueHd,#pullquote,h4.sbHdr\").css({\"font-size\" : \"12px\"});\r\n\t\tjQuery(\"#storyTxt,#sdbrTop,#sdbrTopimg\").css({\"font-size\" : \"13px\"});\r\n\t\tjQuery(\"td.pullquotetext,span.txtHeader\").css({\"font-size\" : \"14px\"});\r\n\t}\r\n\tif(size == 14) \r\n\t{\r\n\t\tjQuery(\"#13\").css({\"cursor\" : \"pointer\",\"color\" : \"#333333\"});\r\n\t\tjQuery(\"#14\").css({\"cursor\" : \"default\",\"color\" : \"#AAAAAA\"});\r\n\t\t\t\t\tjQuery(document).ready(function() {\r\n \t\t\t\t\tjQuery(\"#storyTxt > p, #storyTxt > p > a\").css({\"font-size\" : \"14px\"});\r\n\t\t\t\t\tjQuery(\"#storyTxt > table > caption, #storyTxt > table > tbody > tr > td, #rltdTxt > span , #rltdTxt > span > a, #rltdTxt > div , #rltdTxt > div > a, #authInfo > p,#authInfo > a,#authInfo > span\").css({\"font-size\" : \"12px\"});\r\n\t \t\t\t\t});\r\n\t\tjQuery(\"td.stryPicCptn,li.liSideBarNoBlt,li.liSideBarNoBlt > a,li.liSideBar,li.liSideBar > a\").css({\"font-size\" : \"12px\"})\r\n\t\tjQuery(\"#rltdBlueHd,#pullquote,h4.sbHdr\").css({\"font-size\" : \"13px\"});\r\n\t\tjQuery(\"#storyTxt,#sdbrTop,#sdbrTopimg\").css({\"font-size\" : \"14px\"});\r\n\t\tjQuery(\"td.pullquotetext,span.txtHeader\").css({\"font-size\" : \"15px\"});\r\n\t}\t\t\t\t\t\t\t\t \r\n}", "function decreaseFontSize() {\n\t\t\t\tlpChatFontSize = (lpChatFontSize == LP_CHAT_FONT_SIZE_MIN) ? LP_CHAT_FONT_SIZE_MIN\n\t\t\t\t\t\t: (lpChatFontSize - 2);\n\t\t\t\tchangeFontSize();\n\t\t\t}", "function resizefont_click(key, opt) {\n \t var element = \"#\"+opt.$trigger.attr(\"id\");\n \t \n \t var flag = false;\n \t while ($(element)[0].scrollHeight > $(element).innerHeight()) {\n \t\t var fontSize = parseFloat($(element).css('font-size'));\n \t\t console.log(\"font-size \" + fontSize + \" \" + $(element).innerHeight() + \" \" + $(element)[0].scrollHeight);\n \t\t $(element).css('font-size', (fontSize - 1) + \"px\");\n \t\t if(fontSize === 8){\n \t\t\t console.log(\"fontSize8\" + fontSize);\n \t\t\t truncatetext_click(key,opt);\n \t\t\t //$(element).css(\"text-overflow\", \"ellipsis\");\n \t\t\t break;\n \t\t }\n \t\t if(flag){\n \t\t\t break;\n \t\t }\n \t\t var inner = $(element).innerHeight();\n \t\t var scroll = $(element)[0].scrollHeight;\n \t\t if((scroll - inner) < 6 ){\n \t\t\t flag = true;\n \t\t }\n \t\t \n \t\t}\n \t jQuery(element).resizable()\n }", "function calcViewFont(element, inputValue, fontSize) {\n $(element).css(\"font-size\", `${fontSize}px`); // reset\n let numStr = elem => {\n return $(elem).height() / parseInt($(elem).css(\"line-height\"), 10);\n };\n let i = 0;\n while (numStr($(element)) > inputValue) {\n i++;\n $(element).css(\"font-size\", `${fontSize - i}px`);\n }\n}", "function increasefontsize(b)\n{\n\tif(b==1)\n\t{\tvar e;\t\t\t\t\n\t\tvar a=document.getElementById(\"d1\");\n\t\tvar m=parseFloat(window.getComputedStyle(a, null).getPropertyValue('font-size'));\n\t\tm++;\n\t\tif(m<30)\n\t\t{\n\t\t\te=m;\n\t\t}\n\t\telse\n\t\t\te=30;\n\n\t}\n\telse if(b==2)\n\t{\n\t\tvar a=document.getElementById(\"d2\");\n\t\tvar m=parseFloat(window.getComputedStyle(a, null).getPropertyValue('font-size'));\n\t\tm++;\n\t\tif (m<30)\n\t\t{\n\t\t\te=m;\n\t\t}\n\t\telse \n\t\t{\n\t\t\te=30;\n\t\t}\n\n\t}\n\telse if(b==3)\n\t{\n\t\tvar a=document.getElementById(\"d3\");\n\t\tvar m=parseFloat(window.getComputedStyle(a, null).getPropertyValue('font-size'));\n\t\tm++;\n\t\tif(m<30)\n\t\t{\n\t\t\te=m;\t\t\n\t\t}\n\t\telse \n\t\t\te=30;\n\n\t}\n\treturn a.fontSize=e+\"px\";\n\n}", "function texte() {\n if (fontSize == 30) {\n fontSize = 50;\n titre1.style.fontSize = fontSize + \"px\";\n }\n else if (fontSize == 50) {\n fontSize = 30;\n titre1.style.fontSize = fontSize + \"px\";\n }\n}", "function layout () {\n var rem = docEl.clientWidth * 100 / 750;\n docEl.style.fontSize = rem + 'px';\n }", "function changeTxtSize(fontSize) {\n headerEl.style.fontSize = fontSize;\n // Set the selected font in local storage\n localStorage.setItem(\"font-size\", fontSize);\n}", "function onIncreaseFontSize() {\n increaseFontSize()\n let elFont = document.querySelector('.font-size-display')\n elFont.innerHTML = gMeme.currText.size\n draw()\n}", "function changeSize() {\n let size = this.value;\n if (size == \"medium\") {\n id(\"output\").style.fontSize =\"36pt\";\n } else if (size == \"big\") {\n id(\"output\").style.fontSize =\"48pt\";\n } else {\n id(\"output\").style.fontSize =\"60pt\";\n }\n }", "function setTextSize(){\n var nodes = cy.elements('node');\n var cont = $('#cy')[0];\n\n var cent_x = (cont.offsetWidth)/2;\n var cent_y = (cont.offsetHeight)/2;\n\n for (var i = 0; i < nodes.length; i++){\n var node = nodes[i];\n var pos = nodes[i].renderedPosition();\n \n //x and y of the two nodes\n var pos_x = node.renderedPosition(\"x\");\n var pos_y = node.renderedPosition(\"y\");\n \n //distance function, sans sqrt\n var cent_dist = (cent_x - pos_x) * (cent_x - pos_x) + (cent_y - pos_y) * (cent_y - pos_y);\n if (cent_dist < 50000){\n node.addClass('big-text');\n node.removeClass('little-text');\n }\n else{\n node.addClass('little-text');\n node.removeClass('big-text');\n }\n }\n}", "function setRemUnit() {\n var rem = docEl.clientWidth / 10\n docEl.style.fontSize = rem + 'px'\n }", "function changeSize() {\n myh1.style.fontSize = (myh1.style.fontSize == \"24px\") ? \"20px\" : \"24px\"\n }", "function updateFontSize() {\n let result = id('result');\n let radioButtons = qsa(\"input[name='text-size']\");\n if (radioButtons[0].checked) {\n result.style.fontSize = radioButtons[0].value\n } else {\n result.style.fontSize = radioButtons[1].value\n }\n }", "changeSizeText(val) {\r\n this.textlogoid.style.fontSize = val+ \"px\";\r\n}", "set fontSize(value) {}", "function onResize(cm) {\r\n // Might be a text scaling operation, clear size caches.\r\n var d = cm.display;\r\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\r\n cm.setSize();\r\n }", "function r(e){var t=getComputedStyle(e).fontSize;return null!=t?parseInt(t,10):null}", "function fontSize(div) {\r\n console.log(\"fontSize\");\r\n if (!div) {\r\n div = \"body\";\r\n }\r\n\r\n var options = $(div + \" .options\");\r\n\r\n for (var i = 0; i < options.length; i++) {\r\n var poll = options[i];\r\n var option_text = $(poll).find(\".option_text\");\r\n var option_width = Math.floor(option_text.width());\r\n\r\n option_text.width(option_width); //firefox needs this dom update (bug)\r\n\r\n var size_option = parseInt((option_width / 9));\r\n option_text.css(\"font-size\", size_option);\r\n\r\n //only too miniature polls\r\n var size_optionList = parseInt((option_width / 13));\r\n $(poll).find(\".stored .option_text\").css(\"font-size\", size_optionList);\r\n\r\n var percentage_container = $(poll).find(\".percentage_container\");\r\n if (percentage_container.css(\"font-size\")) { // >0 \r\n var size_result = parseInt((option_width / 8));\r\n $(poll).find(\".percentage_container\").css(\"font-size\", size_result);\r\n }\r\n\r\n var votes_container = $(poll).find(\".votes_container\");\r\n if (votes_container.css(\"font-size\")) { // >0\r\n var size_votes = parseInt((option_width / 13));\r\n $(poll).find(\".votes_container\").css(\"font-size\", size_votes);\r\n }\r\n\r\n var size_skip = parseInt((option_width / 16));\r\n $(poll).find(\"#gameSkip\").css(\"font-size\", size_skip);\r\n }\r\n}", "handleFontSize() {\n // set max font size\n this.setState({\n maxFont: this.props.maxFont ? this.props.maxFont : 40,\n minFont: this.props.minFont ? this.props.minFont : 10,\n },()=>{\n // console.log(this.state);\n //checking if length is not zero\n if(this.props.data.length !== 0) {\n //if contains more than 1 word\n if(this.props.data.length > 1){\n //work need to do\n const ValueDifference = this.props.data[0].value- this.props.data[this.props.data.length-1].value;\n const PxDifference = this.state.maxFont - this.state.minFont;\n // console.log(ValueDifference,PxDifference);\n // console.log(this.props.data);\n this.props.data.map((item)=>{\n const ItemValueDifference = this.props.data[0].value - item.value === 0 ? 1: this.props.data[0].value - item.value;\n let NewFontSize = this.state.maxFont-((PxDifference / ValueDifference)*ItemValueDifference);\n\n //get state value for fontSizer;\n let localFontSizer = this.state.fontSizer;\n localFontSizer.push(NewFontSize);\n this.setState({\n fontSizer : localFontSizer\n });\n return item;\n });\n }else {\n //else set max value to the one word.\n this.setState({\n fontSizer: [this.props.maxFont],\n });\n }\n }\n });\n\n\n\n // console.log(this.state);\n }", "function onResize(cm) {\n // Might be a text scaling operation, clear size caches.\n var d = cm.display;\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n cm.setSize();\n }", "function onResize(cm) {\n // Might be a text scaling operation, clear size caches.\n var d = cm.display;\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n cm.setSize();\n }", "function onResize(cm) {\n // Might be a text scaling operation, clear size caches.\n var d = cm.display;\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n cm.setSize();\n }", "function windowResized() {\n resizeCanvas(windowWidth,windowHeight*9);\n \n var multiplier = map(width,200,1800,0.25,1);\n var typesize = (map(width,300,1650,50,195));\n textSize (typesize*multiplier);\n spacesize = 50*multiplier; //width of space between letters\n linesize = 280*multiplier;\n}", "function textSize(width, height, fontSize, scale) {\n\t var stageWidth = parseInt(width, 10);\n\t var stageHeight = parseInt(height, 10);\n\n\t var bigSide = Math.max(stageWidth, stageHeight);\n\t var smallSide = Math.min(stageWidth, stageHeight);\n\n\t var newHeight = 0.8 * Math.min(smallSide, bigSide * scale);\n\t return Math.round(Math.max(fontSize, newHeight));\n\t}", "function detectFontInfoChnaged() {\n let size = editor.getFontInfo().size;\n if (size != null) size = size.replace('px', '');\n\n newFontInfo = {\n color: rgbToHex(editor.getFontInfo().color),\n backgroundColor: rgbToHex(editor.getFontInfo().backgroundColor),\n family: editor.getFontInfo().family,\n size: size\n };\n\n if (isEquivalent(lastFontInfo, newFontInfo)) return;\n\n lastFontInfo = clone(newFontInfo);\n\n postFontInfo(lastFontInfo);\n}", "function makeItBig()\n{\t\n\t//console.log(\"Make it big function [\" + labelOrder[instructionSizeLevel] + \"]\");\n\tif ( instructionSizeLevel < (labelOrder.length - 1) ) {\n\t\t//console.log(\"changing font size... from \" + labelOrder[instructionSizeLevel]);\n\t\tinstructionSizeLevel++;\n\t\t//console.log(\"changing font size... to \" + labelOrder[instructionSizeLevel]);\n\t\t\n\t\tvar fontSize = labelOrder[instructionSizeLevel];\n console.log(\"New font size: \" + fontSize);\n\t\t$('#instructionLabel').css(\"font-size\", fontSize );\n $('.dropArea').css(\"font-size\", fontSize); \n $('.pillLabel').css(\"font-size\", fontSize);\n \n\t\tresults['test']['userFont'] = fontSize;\n localStorage.setItem ('results', JSON.stringify(results) );\n\t\t\n\t\t//console.log ( \"font size: \" + labelOrder[instructionSizeLevel] + \", \" + $('#instructionLabel').css('font-size'));\n\t}\n\telse {\n\t\t//console.log (\"--MAX-- font size reached\");\n\t\tresults['test']['userFont'] = \"failed\";\n localStorage.setItem ('results', JSON.stringify(results) );\n\t\t\n finishTest();\n\t}\n}", "function getSize() {\n size = $( \"#maintext\" ).css( \"font-size\" );\n size = parseInt(size, 10);\n $( \"#font-size\" ).text( size );\n}", "function textoGrande() {\n document.getElementById('previoComentario').style.fontSize = \"250%\"\n}", "function resetfontsize_click(element) {\n \t $(element).removeClass(function (index, css) {\n \t\t return (css.match (/(^|\\s)fontsize\\S+/g) || []).join(' ');\n \t });\n console.log(\"resetFontSize \");\n }", "function changetextsize() {\n var currentIndex = findCurrentIndex(tempKey);\n var fontsize = document.getElementById(\"fontsize\").value;\n mainDiagram.model.nodeDataArray[currentIndex].fontsize = fontsize;\n getRadio(mainDiagram.selection.Ca.value);\n}", "function scaleFont($element) {\n\tzoomGivenProperty($element, 'font-size', font_increase);\n}", "function resizeTextSize() {\n let size = $(\"body\").css(\"height\"); // Height of the window in pixels\n size = Number.parseInt(size.substr(0, size.length - 2) / 50); // Is is the smallest text-size\n\n let textSize = [\n [\"huge\", 3.5],\n [\"bigger\", 3],\n [\"big\", 2.5],\n [\"normal\", 2],\n [\"small\", 1.5],\n [\"detail\", 1]\n ];\n for (let e of textSize) { // for each desired textSize-type\n $(\":root\").css(`--${e[0]}Text`, `${e[1] * size}px`); // Add it to the CSS :root\n }\n\n console.log(\"Screen resized\");\n}", "function fixClefPlacement(el) {\n KeyVoice.fixClef(el);\n //if (el.el_type === 'clef') {\n//\t\t\t\tvar min = -2;\n//\t\t\t\tvar max = 5;\n//\t\t\t\tswitch(el.type) {\n//\t\t\t\t\tcase 'treble+8':\n//\t\t\t\t\tcase 'treble-8':\n//\t\t\t\t\t\tbreak;\n//\t\t\t\t\tcase 'bass':\n//\t\t\t\t\tcase 'bass+8':\n//\t\t\t\t\tcase 'bass-8':\n//\t\t\t\t\t\tel.verticalPos = 20 + el.verticalPos; min += 6; max += 6;\n//\t\t\t\t\t\tbreak;\n//\t\t\t\t\tcase 'tenor':\n//\t\t\t\t\tcase 'tenor+8':\n//\t\t\t\t\tcase 'tenor-8':\n//\t\t\t\t\t\tel.verticalPos = - el.verticalPos; min = -40; max = 40;\n////\t\t\t\t\t\tel.verticalPos+=2; min += 6; max += 6;\n//\t\t\t\t\t\tbreak;\n//\t\t\t\t\tcase 'alto':\n//\t\t\t\t\tcase 'alto+8':\n//\t\t\t\t\tcase 'alto-8':\n//\t\t\t\t\t\tel.verticalPos = - el.verticalPos; min = -40; max = 40;\n////\t\t\t\t\t\tel.verticalPos-=2; min += 4; max += 4;\n//\t\t\t\t\t\tbreak;\n//\t\t\t\t}\n//\t\t\t\tif (el.verticalPos < min) {\n//\t\t\t\t\twhile (el.verticalPos < min)\n//\t\t\t\t\t\tel.verticalPos += 7;\n//\t\t\t\t} else if (el.verticalPos > max) {\n//\t\t\t\t\twhile (el.verticalPos > max)\n//\t\t\t\t\t\tel.verticalPos -= 7;\n//\t\t\t\t}\n //}\n }", "function fitText(ctx, text, font_size, width) {\n //Lower the font size until the text fits the canvas\n do {\n font_size -= 1;\n ctx.font = 'normal normal 400 ' + font_size + 'px ' + font_family;\n } while (ctx.measureText(text).width > width);\n return font_size;\n } //function fitText", "function setFontSize() {\n /*jshint validthis: true*/\n if (this.value == 'none') return;\n var selection = window.getSelection();\n var range = selection.getRangeAt(0);\n var parentNode = range.startContainer.parentNode;\n var html = parentNode.outerHTML;\n var content = removeTags(/<\\/?span ?(style=\"font-size:[0-9]{0,2}px\")*>/g, html);\n replaceSelectionWithHtml('<span style=\"font-size:'+this.value+'\">' + content + '</span>');\n this.value = 'none';\n clearSelection();\n\n}", "static getFontScale(): number {\n return Dimensions.get('window').fontScale || PixelRatio.get();\n }", "function changeFontScreen(){\n changeSize(\"#content\", fontSizeStyle, fontSizeArr[zoomedIn]); \n changeSize(\"form\", fontSizeStyle, fontSizeArr[zoomedIn]);\n changeSize(\"h2\", fontSizeStyle, h2FontSizeArr[zoomedIn]);\n changeSize(\"#innerContent h3\", fontSizeStyle, h3FontSizeArr[zoomedIn]);\n changeSize(\":checkbox\", \"width\", checkBoxSizeArr[zoomedIn]);\n changeSize(\":checkbox\" , \"height\", checkBoxSizeArr[zoomedIn]);\n changeSize(\"form .btn-primary\", fontSizeStyle, formButtonFontSizeArr[zoomedIn]);\n}", "function onResize(cm) {\n\t\t var d = cm.display;\n\t\t // Might be a text scaling operation, clear size caches.\n\t\t d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\t\t d.scrollbarsClipped = false;\n\t\t cm.setSize();\n\t\t }", "resize() {\n var p = this.p;\n\n //text size, last two numbs are min/max font size\n p.textSize(p.map(p.height, 180, 360, 14, 28, true));\n\n if (this.values.type === \"circle\") {\n if (this.anglesMobileMode) {\n // circle mode, mobile\n this.centVec = p.createVector(p.width / 2, p.height / 2)\n this.spokeRadius = p.height / 2.5;\n this.hubRadius = p.height / 8;\n } else {\n // circle mode, non-mobile\n this.centVec = p.createVector(p.width / 2, p.height / 2)\n this.spokeRadius = p.height / 2.5;\n this.hubRadius = p.height / 20;\n }\n } else if (this.values.type === \"line\") {\n if (this.anglesMobileMode) {\n // line mode, mobile\n this.centVec = p.createVector(p.width / 2, p.height * (3 / 4));\n this.spokeRadius = p.height / 2.2;\n this.hubRadius = p.height / 8;\n } else {\n // line mode, non-mobile\n this.centVec = p.createVector(p.width / 2, p.height * (3 / 4));\n this.spokeRadius = p.height / 2.2;\n this.hubRadius = p.height / 20;\n }\n }\n }", "function setTextSize(count) {\n size = map(count, 2, 5, 20, 35);\n textSize(size);\n return size;\n}", "function fitText(ctx, text, font_size, width) {\n //Lower the font size until the text fits the canvas\n do {\n font_size -= 1;\n ctx.font = 'normal normal 400 ' + font_size + 'px ' + font_family;\n } while (ctx.measureText(text).width > width);\n\n return font_size;\n } //function fitText", "function fitText(ctx, text, font_size, width) {\n //Lower the font size until the text fits the canvas\n do {\n font_size -= 1;\n ctx.font = 'normal normal 400 ' + font_size + 'px ' + font_family;\n } while (ctx.measureText(text).width > width);\n\n return font_size;\n } //function fitText", "fontHeight () {\n return this.koofScreenY > 0 ? 16 * this.koofScreenY : 16;\n }", "function enlargeText(){\n document.getElementById('p1').style.fontSize = \"5em\";\n document.getElementById('p2').style.fontSize = \"7em\";\n}", "function onResetREM() {\n\t\t$(document.documentElement).css(\"font-size\", ($(window).width() / 100) + \"px\");\n\t}", "function setTypeSize (el) {\n var size = window.innerHeight * 0.9 + \"px\";\n _.each(el.querySelectorAll(\".glyphicon\"), function (el) {\n el.style.fontSize = size;\n el.style.lineHeight = size;\n });\n }", "function scaleFontSize(fontSize, text='') {\n // @TODO use em's for smarter conversions off of Base 20px and set voice font size\n const shrinkFontToDecimal = 1 + ((text.length / 20) / 10);\n return (Number(fontSize.replace(/px/, '')) / shrinkFontToDecimal) + 'px';\n}", "function rf(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(\n // Might be a text scaling operation, clear size caches.\n t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}", "function setCurrentFontDisplay(){\n if(zoomedIn == \"\"){\n zoomedIn = 0;\n }\n $('#current-font-size')[0].innerHTML = \"Current Font Size: \" +currentFontSizeArr[zoomedIn];\n}", "function smalltext() {\n\tdocument.getElementById(\"txt\").style.fontSize = \"12px\";\n\n}", "function _size(sz) {\n line-height: calc(sz * 2) /* required */\n font-size: sz /* required */\n}", "function fitTextInCircle(ctx, text, font_size, width, step) {\n //Lower the font size until the text fits the canvas\n do {\n font_size -= step;\n ctx.font = 'normal normal 300 ' + font_size + 'px ' + font_family;\n } while (ctx.measureText(text).width > width);\n\n return font_size;\n } //function fitTextInCircle", "function fitTextInCircle(ctx, text, font_size, width, step) {\n //Lower the font size until the text fits the canvas\n do {\n font_size -= step;\n ctx.font = 'normal normal 300 ' + font_size + 'px ' + font_family;\n } while (ctx.measureText(text).width > width);\n\n return font_size;\n } //function fitTextInCircle", "updateScale(){\n var autoscalingContentElement = $(this.refs.autoscalingContent);\n var fullContentElement = $(this.refs.fullContent);\n if(_.isEmpty(autoscalingContentElement) || _.isEmpty(fullContentElement)){\n return;\n }\n var minFontSize = this.props.minFontSize || 1;\n var maxFontSize = this.props.maxFontSize || 40;\n var currentFontSizeStr = autoscalingContentElement.css('font-size');\n var initialFontSize = parseFloat(currentFontSizeStr);\n var currentFontSize = initialFontSize;\n var unit = currentFontSizeStr.replace(currentFontSize, '');\n var lineHeightStr = autoscalingContentElement.css('line-height');\n var lineHeight = parseFloat(lineHeightStr);\n var lineHeightUnit = lineHeightStr.replace(lineHeight, '');\n\n var maxHeight = autoscalingContentElement.height();\n fullContentElement.show();\n var contentHeight = fullContentElement.height();\n\n var lastFittingFontSize; \n while(true){\n if (contentHeight > maxHeight){\n if (currentFontSize == minFontSize || lastFittingFontSize == currentFontSize -1){\n if (!lastFittingFontSize){\n lastFittingFontSize = currentFontSize;\n }\n break;\n }\n maxFontSize = currentFontSize;\n // Text is too big to fit in textarea, so need to shrink it.\n var newFontSize = Math.floor((minFontSize + currentFontSize) / 2);\n var lineHeightScale = newFontSize / initialFontSize;\n currentFontSize = newFontSize;\n fullContentElement.css('font-size', currentFontSize + unit);\n fullContentElement.css('line-height', (lineHeight*lineHeightScale) + lineHeightUnit);\n contentHeight = fullContentElement.height();\n }\n else if (contentHeight <= maxHeight){\n if (currentFontSize == maxFontSize){\n break;\n }\n lastFittingFontSize = currentFontSize;\n minFontSize = currentFontSize;\n // Text is too small to fit in textarea, so need to grow it.\n var newFontSizeBS = Math.ceil((maxFontSize + currentFontSize) / 2); //new potential font size from binary search\n var newFontSizeLS = Math.min(maxFontSize, currentFontSize + 1); // New potential font size from linear search (useful when increment of 1 causes overflow)\n var lineHeightScaleBS = newFontSizeBS / initialFontSize;\n var lineHeightScaleLS = newFontSizeLS / initialFontSize;\n // Try the default binary search.\n fullContentElement.css('font-size', newFontSizeBS + unit);\n fullContentElement.css('line-height', (lineHeight*lineHeightScaleBS) + lineHeightUnit);\n contentHeight = fullContentElement.height();\n currentFontSize = newFontSizeBS;\n \n // Now try the linear search.\n fullContentElement.css('font-size', newFontSizeLS + unit); \n fullContentElement.css('line-height', (lineHeight*lineHeightScaleLS) + lineHeightUnit);\n if (fullContentElement.height() > maxHeight){\n // If the linear search resulted in overflow, then use this new font size, as it is closer to the goal font size.\n contentHeight = fullContentElement.height();\n currentFontSize = newFontSizeLS;\n }\n }\n }\n fullContentElement.hide();\n var lineHeightScale = lastFittingFontSize / initialFontSize;\n fullContentElement.css('font-size', lastFittingFontSize + unit);\n fullContentElement.css('line-height', (lineHeight*(lineHeightScale)) + lineHeightUnit);\n autoscalingContentElement.css('font-size', lastFittingFontSize + unit);\n autoscalingContentElement.css('line-height', (lineHeight*lineHeightScale) + lineHeightUnit);\n }", "function setFontSize(s){\n\t\tvar size = s + \"px\";\n\t\t$('#display').css('font-size', size);\n\t}", "function TextSize(strIncrement) {\n \n //intTextSize = document.getElementsByTagName(\"body\")[0].style.fontSize;\n //intTextSize = document.body.style.fontSize;\n strTextSize = GetCSSProperty(document.body,\"fontSize\",\"font-size\");\n \n if (strTextSize.indexOf(\"em\") > 0) {\n strTextSizeUnit = \"em\";\n intTextSize = strTextSize.substring(0,strTextSize.length-2);\n } else if (strTextSize.indexOf(\"px\") > 0) {\n strTextSizeUnit = \"px\";\n intTextSize = strTextSize.substring(0,strTextSize.length-2);\n } else if (strTextSize.indexOf(\"%\") > 0) {\n strTextSizeUnit = \"%\";\n intTextSize = strTextSize.substring(0,strTextSize.length-1);\n } else {\n strTextSizeUnit = \"%\";\n intTextSize = \"100\";\n }\n\n if (strIncrement == '-') {\n intTextSize = intTextSize / 1.2;\n } else if (strIncrement == '+') {\n intTextSize = intTextSize * 1.2;\n }\n \n document.body.style.fontSize = intTextSize + strTextSizeUnit;\n}", "onCharSizeChanged() {\n this._renderer.onCharSizeChanged();\n }", "function changeSize(c){\r\n\tfor(var i=0; i < allArticles.length; i++){ allArticles[i].style.fontSize = c; }\r\n}", "function fitTextInCircle(ctx, text, font_size, width) {\n //Lower the font size until the text fits the canvas\n do {\n font_size -= 1;\n ctx.font = 'normal normal 300 ' + font_size + 'px ' + font_family;\n } while (ctx.measureText(text).width > width);\n\n return font_size;\n } //function fitTextInCircle", "function fixClefPlacement(el) {\n\t\t\tparseKeyVoice.fixClef(el);\n\t\t\t//if (el.el_type === 'clef') {\n\t\t\t//\t\t\t\tvar min = -2;\n\t\t\t//\t\t\t\tvar max = 5;\n\t\t\t//\t\t\t\tswitch(el.type) {\n\t\t\t//\t\t\t\t\tcase 'treble+8':\n\t\t\t//\t\t\t\t\tcase 'treble-8':\n\t\t\t//\t\t\t\t\t\tbreak;\n\t\t\t//\t\t\t\t\tcase 'bass':\n\t\t\t//\t\t\t\t\tcase 'bass+8':\n\t\t\t//\t\t\t\t\tcase 'bass-8':\n\t\t\t//\t\t\t\t\t\tel.verticalPos = 20 + el.verticalPos; min += 6; max += 6;\n\t\t\t//\t\t\t\t\t\tbreak;\n\t\t\t//\t\t\t\t\tcase 'tenor':\n\t\t\t//\t\t\t\t\tcase 'tenor+8':\n\t\t\t//\t\t\t\t\tcase 'tenor-8':\n\t\t\t//\t\t\t\t\t\tel.verticalPos = - el.verticalPos; min = -40; max = 40;\n\t\t\t////\t\t\t\t\t\tel.verticalPos+=2; min += 6; max += 6;\n\t\t\t//\t\t\t\t\t\tbreak;\n\t\t\t//\t\t\t\t\tcase 'alto':\n\t\t\t//\t\t\t\t\tcase 'alto+8':\n\t\t\t//\t\t\t\t\tcase 'alto-8':\n\t\t\t//\t\t\t\t\t\tel.verticalPos = - el.verticalPos; min = -40; max = 40;\n\t\t\t////\t\t\t\t\t\tel.verticalPos-=2; min += 4; max += 4;\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\tif (el.verticalPos < min) {\n\t\t\t//\t\t\t\t\twhile (el.verticalPos < min)\n\t\t\t//\t\t\t\t\t\tel.verticalPos += 7;\n\t\t\t//\t\t\t\t} else if (el.verticalPos > max) {\n\t\t\t//\t\t\t\t\twhile (el.verticalPos > max)\n\t\t\t//\t\t\t\t\t\tel.verticalPos -= 7;\n\t\t\t//\t\t\t\t}\n\t\t\t//}\n\t\t}", "function getSizePreEstimate( ctx, iFontSpec, iParseTree) {\n var fontSize = iFontSpec['font-size'] || kDefaultFontSize,\n factors = getFontScaleFactors( iFontSpec),\n textParams = extractTextFromMFSParseTree( iParseTree),\n textMetrics, scriptExtra;\n \n ctx.save();\n setFontAndStyle( ctx, iFontSpec);\n textMetrics = ctx.measureText( textParams.text);\n ctx.restore();\n \n // Note: this overestimates the effect of super- and subscripts because\n // it doesn't take into account the font diminishment factor.\n scriptExtra = (textParams.maxSubscript + textParams.maxSuperscript) *\n kSubscriptOffsetFactor;\n \n return {\n width: Math.round( textMetrics.width * (1 + factors.left + factors.right)),\n height: Math.round( fontSize * (1 + factors.ascent + factors.descent + scriptExtra))\n };\n }", "function changeFZ() {\r\n let fzValue, textParagraph, fzOut; // объявляем переменные\r\n\r\n fzOut = document.querySelector('#range-value-out');\r\n fzValue = document.querySelector('#range-fz').value;\r\n textParagraph = document.querySelector('.text-block__pgf');\r\n\r\n textParagraph.style.fontSize = fzValue + 'px';\r\n fzOut.innerText = fzValue;\r\n}", "update(pos, distance) {\n this.lines.x = pos.x;\n this.lines.y = pos.y;\n this.textNode.x = pos.x - this.textOffset;\n this.textNode.y = pos.y + this.lines.height;\n\n this.textNode.setText(this.text + ' (' + Math.round(distance / 10) + 'km)');\n\n let alphaUpper = 400;\n let alphaLower = 200;\n\n let alpha = 1\n if (distance < alphaUpper) {\n if (distance < alphaLower) {\n alpha = 0;\n } else {\n alpha = (distance - alphaLower) / alphaLower;\n }\n }\n\n this.textNode.alpha = alpha;\n this.lines.alpha = alpha;\n }", "function random_font_size(){ return parseInt( ( Math.random() * 3 + 1 ) * 10 ) / 10 + 'em' }", "function updateFontSize(target, fontsize)\r\r\n\t{\r\r\n\t\t$('.element-container').find(target).each(function(){\r\r\n\t\t\t$(this).css('font-size', fontsize+'px');\r\r\n\t\t\t\r\r\n\t\t\t// APPLY FONT SIZE VALUE FROM TOP PAN TO SLIDER IN ELEMENT EDITOR\r\r\n\t\t\t\r\r\n\t\t\tif($(this).hasClass('cfg-title') || $(this).hasClass('cfg-paragraph'))\r\r\n\t\t\t{\r\r\n\t\t\t\t$(this).closest('.element-container').find('.sliderelement-fontsize-value').html(fontsize);\r\r\n\t\t\t\t$(this).closest('.element-container').find('.sliderelement-fontsize-value')\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.closest('.optioneditor-fontstyleeditor-r')\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.find('.ui-slider')\r\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.slider('option', 'value', fontsize);\r\r\n\t\t\t}\r\r\n\t\t\t\r\r\n\t\t});\r\r\n\r\r\n\t\t$('.element-container').each(function(){adjustElementHeightToLeftContent($(this));});\r\r\n\r\r\n\r\r\n\t}", "handleOutputTextSize() {\n\n if(this.state.output.length > this.RESIZE_OUTPUT_LENGTH) {\n if(Object.keys(this.state.outputStyle).length < 1) {\n this.setState({\n outputStyle: this.OUTPUT_SMALL_TEXT_STYLE\n });\n }\n }\n\n else {\n if(Object.keys(this.state.outputStyle).length > 0) {\n this.setState({\n outputStyle: {}\n });\n }\n }\n\n }" ]
[ "0.6917897", "0.6861202", "0.6824301", "0.67418593", "0.67391694", "0.6711214", "0.66542923", "0.6617985", "0.6578702", "0.6578018", "0.6568328", "0.6567033", "0.6561523", "0.6544547", "0.651056", "0.64499193", "0.64456725", "0.6440148", "0.6429964", "0.6415159", "0.641215", "0.6411997", "0.64034843", "0.6390495", "0.63886917", "0.6385835", "0.63822746", "0.6363516", "0.6361766", "0.63082576", "0.6284587", "0.62774634", "0.6274017", "0.6269241", "0.626475", "0.62249494", "0.62171406", "0.62128985", "0.6168588", "0.61369103", "0.6121654", "0.611793", "0.6106761", "0.61053276", "0.6101874", "0.609221", "0.6084855", "0.6075125", "0.60575765", "0.6038846", "0.6024623", "0.60167545", "0.60003966", "0.5988005", "0.5988005", "0.5988005", "0.5985875", "0.59431565", "0.5941048", "0.59403914", "0.5917864", "0.5901288", "0.58812094", "0.5871205", "0.58472973", "0.5842787", "0.58228904", "0.58196336", "0.58074737", "0.5806612", "0.5805303", "0.5800442", "0.5798951", "0.5792876", "0.5791618", "0.5791618", "0.578082", "0.57792574", "0.5775362", "0.5752548", "0.5751008", "0.57498854", "0.57442653", "0.5738994", "0.57339907", "0.5723723", "0.5723723", "0.571699", "0.5710112", "0.5702429", "0.5699834", "0.56992316", "0.569747", "0.5695883", "0.56922287", "0.5686404", "0.5685479", "0.56842977", "0.5683783", "0.5681838" ]
0.6712731
5
calculates the end points given the angle is known template ::: :::
function vectorOfPoints(lat1, lon1, lat2, lon2,displayed_text,displayed_distance,manipulation=0, fontLocation="Helvetica", fontSizeLocation=25, fontDistance="Helvetica", fontSizeDistance=25, displayed_amount) { var start = 500; var length = 490; var length_of_text = Math.round(getWidthOfText(displayed_text,fontLocation, fontSizeLocation*fontCorrection(displayed_distance)+"px")) if (mapSettings[0].mode=="distance"){ var length_of_textDist = Math.round(getWidthOfText(displayed_distance+" km",fontDistance,fontSizeDistance*fontCorrection(displayed_distance)+"px" )) } if (mapSettings[0].mode=="amount"){ var length_of_textDist = Math.round(getWidthOfText(displayed_amount +" €",fontDistance,fontSizeDistance*fontCorrection(displayed_distance)+"px" )) } // Calculate the distance between two coordinates https://planetcalc.com/713/ var Calculate712_result = {}; var la1 = lat1 //default: 28.1272222222 var lo1 = lon1 //default: -15.4313888889 var la2 = lat2 //default: 13.0961111111 var lo2 = lon2 //default: -59.6083333333 var ellipseType = "wgs84" var angleL = { "SetValue": function(v) { Calculate712_result["angleL"] = v; } }; var distanceM = { "SetValue": function(v) { Calculate712_result["distanceM"] = v; } }; var distanceNMI = { "SetValue": function(v) { Calculate712_result["distanceNMI"] = v; } }; function rad(a) { return Math.PI * a / 180; } function grad(a) { return 180 * a / Math.PI; } function meridionalD(a) { return Math.tan(rad(45 + a / 2)); } function geoidD(a, e) { return Math.pow((1 - e * Math.sin(rad(a))) / (1 + e * Math.sin(rad(a))), e / 2); } function abs(a) { return a < 0 ? -a : a; } function calcDestination(e, la1, lo1, la2, lo2) { var lD = lo2 - lo1; if (abs(lD) > 180) lD = lD < 0 ? 360 + lD : -360 + lD; var rRes = Math.atan2(rad(lD), (Math.log(meridionalD(la2) * geoidD(la2, e)) - Math.log(meridionalD(la1) * geoidD(la1, e)))); var arcLen = (la2 - la1) ? ((1 - e * e / 4) * rad(la2 - la1) - (3 / 8) * e * e * (Math.sin(2 * rad(la2)) - Math.sin(2 * rad(la1)))) / Math.cos(rRes) : (lo2 - lo1) ? Math.cos(rad(la1)) * Math.abs(rad(lo2 - lo1)) : 0; return { "arc": arcLen, "rhumb": rRes }; } var ellipsoids = { "wgs84": { "min": 6356752.314, "max": 6378137 }, "sk42": { "min": 6356863, "max": 6378245 }, "sphere": { "min": 6378137, "max": 6378137 } }; if (ellipseType === undefined) ellipseType = "wgs84"; var geoid = ellipsoids[ellipseType]; var a2 = geoid.max * geoid.max; var b2 = geoid.min * geoid.min; var e = Math.sqrt((a2 - b2) / a2); var res1 = calcDestination(e, la1, lo1, la2, lo2, geoid.max); var res2 = calcDestination(e, la1, lo1, la2, lo2 + 360, geoid.max); var res = (res2.arc < res1.arc) ? res2 : res1; var aRes = grad(res.rhumb); if (aRes < 0) { aRes = 360 + aRes } ;angleL.SetValue(aRes); var len = geoid.max * res.arc; angle = aRes-90 // continue var text_angle = angle; if (angle > 90 & angle < 180) {text_angle = angle + 180} //transform in a way to be readible as a poster e.g. not turned around if (angle > 180 & angle < 270) {text_angle = angle - 180} var start_x = start + 0.95* length * Math.cos(angle * Math.PI / 180); var start_y = start + 0.95* length * Math.sin(angle * Math.PI / 180); var end_x = start + length * Math.cos(angle * Math.PI / 180); var end_y = start + length * Math.sin(angle * Math.PI / 180); var text_x = end_x - (25+10+length_of_textDist+length_of_text/2)*Math.cos(angle * Math.PI / 180) var text_y = end_y - (25+10+length_of_textDist+length_of_text/2)*Math.sin(angle * Math.PI / 180) var textDist_x = end_x - (25+5+length_of_textDist/2)*Math.cos(angle * Math.PI / 180) var textDist_y = end_y - (25+5+length_of_textDist/2)*Math.sin(angle * Math.PI / 180) if (manipulation!=0) { // calculates a new text positioning, while the line is kept correct (start_x,end_x var start_x2 = start + 0.95* length * Math.cos((angle+manipulation) * Math.PI / 180); var start_y2 = start + 0.95* length * Math.sin((angle+manipulation) * Math.PI / 180); var end_x2 = start + length * Math.cos((angle+manipulation) * Math.PI / 180); var end_y2 = start + length * Math.sin((angle+manipulation) * Math.PI / 180); var text_x = end_x2 - (25+10+length_of_textDist+length_of_text/2)*Math.cos((angle+manipulation) * Math.PI / 180) var text_y = end_y2 - (25+10+length_of_textDist+length_of_text/2)*Math.sin((angle+manipulation) * Math.PI / 180) var textDist_x = end_x2 - (25+5+length_of_textDist/2)*Math.cos((angle+manipulation) * Math.PI / 180) var textDist_y = end_y2 - (25+5+length_of_textDist/2)*Math.sin((angle+manipulation) * Math.PI / 180) // console.log("Start_x2 is" + start_x2 + "for " + displayed_text) // console.log("Start_y2 is" + start_y2 + "for " + displayed_text) text_angle = text_angle +manipulation } var pointsInPlot = { start_x:start_x,start_y:start_y,end_x:end_x,end_y:end_y, text_x:text_x,text_y:text_y,text_angle:text_angle, textDist_x:textDist_x,textDist_y:textDist_y, length_of_text:length_of_text,length_of_textDist:length_of_textDist,angle:angle, start_x_corr:start_x2, start_y_corr:start_y2 } return pointsInPlot }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calculateEndpoints(head = this.head, tail = this.tail) {\n const curve = new Curve(head, this.controlPt, tail);\n const incrementsArray = [0.001, 0.005, 0.01, 0.05];\n let increment = incrementsArray.pop();\n let t = 0;\n // let iterations = 0;\n while (increment && t < 0.5) {\n // iterations++;\n const pt = curve.bezier(t);\n if (this.tail.contains(pt)) {\n t += increment;\n } else {\n t -= increment;\n increment = incrementsArray.pop();\n t += increment || 0;\n }\n }\n // console.log('itertions: ' + iterations);\n this.endPt = curve.bezier(t);\n this.startPt = curve.bezier(1 - t);\n }", "function polypoint(w, h, sides, steps) {\n\n let centerX, centerY, lengthX, lengthY;\n let d, endpoint\n\n // find center point\n centerX = ( h/2 );\n centerY = ( w/2 );\n lengthX = (centerX-(h%steps) );\n lengthY = (centerY-(w%steps) );\n stepX = lengthX/steps\n stepY = lengthY/steps\n //_______ find end points_______\n // d = (2*pi/side) => d = ( 2*(Math.PI/side) )\n // will return the angle for\n d = angles(sides)\n // find the coords for each one. and return them as a tuple array to 2 decimals\n endpoints= new Array(sides).fill([])\n data = new Object\n\n for (let i = 0; i < sides; i++) {\n\n data[`_${i}`]={\n x:[Math.round( (lengthX*Math.cos(d*i)) +centerX)],\n y:[Math.round( (lengthY*Math.sin(d*i)) +centerY)]\n }\n\n endpoints[i] = [\n Math.round( (lengthX*Math.cos(d*i)) +centerX),\n Math.round( (lengthY*Math.sin(d*i)) +centerY)\n ];\n }\n endpoints.reverse()\n console.log(`endpoints ${endpoints}`.red);\n console.log(`data`.red, data);\n console.log(`variables lengthX ${lengthX}, lengthY ${lengthY}`.blue);\n console.log(`variables centerX ${centerX}, centerY ${centerY}`.blue);\n\n // there are steps involving changing it to a SVG coord system\n\n // create the step arrays.\n // find step length\nconsole.log(\"endpoints\".blue,endpoints);\n for (let i = 0; i < endpoints.length; i++) {\n for (let j = 1; j < sides; j++) {\n if (centerX < endpoints[i][0]) {//\n\n endpoints[i].push(centerX,endpoints[i][1]-j*stepX)\n\n }else if (centerX > endpoints[i][0]) {//\n\n endpoints[i].push(centerX,endpoints[i][1]+j*stepX)\n\n }else if (centerX == endpoints[i][0] ) {\n\n endpoints[i].push(endpoints[i][0]+j*stepX,centerX)\n\n }else if (centerY < endpoints[i][1]) {\n\n endpoints[i].push(endpoints[i][1]-j*stepY,centerY)\n\n }\n else if (centerY > endpoints[i][1]) {\n\n endpoints[i].push(endpoints[i][1]+j*stepY,centerY)\n\n }else if (centerY == endpoints[i][1] ) {\n\n endpoints[i].push(endpoints[i][1]+j*stepY,centerY)\n\n }\n }\n }\n console.log(\"endpoints\".green,endpoints);\n for (let i = 0; i < endpoints.length; i++) {\n if (i%2 == 0) {// reverse in pairs\n endpoints[i].reverse()\n }\n }\n console.log(\"endpoints\".green,endpoints);\n /*\n\n console.log(`endpoints`.red,endpoints );\n console.log(`variables lengthX ${lengthX}, lengthY ${lengthY}`.blue);\n console.log(`variables centerX ${centerX}, centerY ${centerY}`.blue);\n\n*/\n\n/*\n{\n _1:{ x:[1,2,4,5],y:[1,2,3,4] },\n _2:{ x:[1,2,4,5],y:[1,2,3,4] },\n _3:{ x:[1,2,4,5],y:[1,2,3,4] },\n _4:{ x:[1,2,4,5],y:[1,2,3,4] }\n}\n*/\n\n\n console.log(\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${w}px\" height=\"${h}\" viewbox=\"0 0 ${w} ${h}\">\n <g class=\"polypoint\" id=\"_${sides}_${steps}\">`.green\n +\n `<polygon points=\"${endpoints}\" />`.green\n +\n `</g>\n </svg>`.green);\n}", "static angle(start, end) {\n var tDot = start.x * end.x + start.y * end.y;\n var tDet = start.x * end.y - start.y * end.x;\n var tAngle = -Math.atan2(tDet, tDot);\n return tAngle;\n }", "get endAngle() { return Angle_1.Angle.createRadians(this._radians1); }", "function interpolateEnding({t, polyline, decreasing, rightToLeft}) {\n\n var reverse = Boolean(decreasing) !== Boolean(rightToLeft);\n\n var result = (function getLinePiece(t, line) {\n var q = 0;\n if (t > 0) {\n var distance = [0];\n var totalDistance = 0;\n for (var i = 1, x, y, x0, y0, d; i < line.length; i++) {\n x0 = line[i - 1].x;\n y0 = line[i - 1].y;\n x = line[i].x;\n y = line[i].y;\n d = Math.sqrt((x - x0) * (x - x0) + (y - y0) * (y - y0));\n totalDistance += d;\n distance.push(totalDistance);\n }\n var passedDistance = t * totalDistance;\n for (i = 1; i < distance.length; i++) {\n if (passedDistance <= distance[i]) {\n q = Math.min(1, (i - 1 +\n (passedDistance - distance[i - 1]) /\n (distance[i] - distance[i - 1])) /\n (line.length - 1)\n );\n break;\n }\n }\n }\n\n var existingCount = Math.floor((line.length - 1) * q) + 1;\n var tempCount = line.length - existingCount;\n var tempStartIdIndex = existingCount;\n var result = line.slice(0, existingCount);\n if (q < 1) {\n var qi = (q * (line.length - 1)) % 1;\n var midPt = interpolatePoint(\n line[existingCount - 1],\n line[existingCount],\n qi\n );\n push(result, utils.range(tempCount).map((i) => Object.assign(\n {}, midPt,\n {\n id: line[tempStartIdIndex + i].id,\n isInterpolated: true\n }\n )));\n }\n return result;\n })(\n (decreasing ? 1 - t : t),\n (reverse ? polyline.slice(0).reverse() : polyline)\n );\n if (reverse) {\n result.reverse();\n }\n\n return result;\n}", "function rectangleRotation(a, b) {\n let count = 0;\n let midright = a / 2 / Math.sqrt(2);\n let midleft = -1 * midright;\n let x = b / 2 / Math.sqrt(2);\n let p1 = [midleft - x, midleft + x];\n let p2 = [midleft + x, midleft - x];\n let p3 = [midright - x, midright + x];\n let p4 = [midright + x, midright - x];\n let startx = Math.ceil(p1[0]);\n let endx = Math.floor(p4[0]);\n for (let i = startx; i <= endx; i++) {\n if (a > b) {\n if (i <= p2[0]) {\n count +=\n Math.floor(getyvaluefromline(p1, i, 1)) -\n Math.ceil(getyvaluefromline(p1, i, -1)) +\n 1;\n } else if (i > p2[0] && i <= p3[0]) {\n count +=\n Math.floor(getyvaluefromline(p1, i, 1)) -\n Math.ceil(getyvaluefromline(p2, i, 1)) +\n 1;\n } else {\n count +=\n Math.floor(getyvaluefromline(p3, i, -1)) -\n Math.ceil(getyvaluefromline(p2, i, 1)) +\n 1;\n }\n } else {\n if (i <= p3[0]) {\n count +=\n Math.floor(getyvaluefromline(p1, i, 1)) -\n Math.ceil(getyvaluefromline(p1, i, -1)) +\n 1;\n } else if (i > p3[0] && i <= p2[0]) {\n count +=\n Math.floor(getyvaluefromline(p3, i, -1)) -\n Math.ceil(getyvaluefromline(p1, i, -1)) +\n 1;\n } else {\n count +=\n Math.floor(getyvaluefromline(p3, i, -1)) -\n Math.ceil(getyvaluefromline(p2, i, 1)) +\n 1;\n }\n }\n }\n return count;\n}", "function calcVelocity(angle, velocity) {\n // handling in between\n // /|\n // v/ | y\n // /o |\n // ____\n // x\n // x = cos (o) * v\n // y = sin (o) * v\n\n var newAngle = toRadians(angle);\n console.log(newAngle);\n var x = Math.cos(newAngle) * velocity;\n var y = Math.sin(newAngle) * velocity;\n return [x,y];\n}", "function generate_tc() {\n var r1 = 0.05;\n var r2 = 0.1;\n var theta = Math.PI / 6;\n var height = 1;\n var topx = [], topy = [];\n var bottomx = [], bottomy = [];\n for (var i = 0; i < 13; i++) {\n var top_x = r1 * Math.cos(i * theta);\n var top_y = r1 * Math.sin(i * theta);\n var bottom_x = r2 * Math.cos(i * theta);\n var bottom_y = r2 * Math.sin(i * theta);\n topx.push(top_x);\n topy.push(top_y);\n bottomx.push(bottom_x);\n bottomy.push(bottom_y);\n }\n for (var i = 0; i < 12; i++) {\n points.push(topx[i + 1]);\n points.push(topy[i + 1]);\n points.push(height);\n points.push(topx[i]);\n points.push(topy[i]);\n points.push(height);\n points.push(bottomx[i]);\n points.push(bottomy[i]);\n points.push(0.0);\n points.push(topx[i + 1]);\n points.push(topy[i + 1]);\n points.push(height);\n points.push(bottomx[i]);\n points.push(bottomy[i]);\n points.push(0.0);\n points.push(bottomx[i + 1]);\n points.push(bottomy[i + 1]);\n points.push(0.0);\n }\n}", "GetAngle(First, Next) {\n let dRotateAngle = Math.atan2(Math.abs(First.Latitude - Next.Latitude), Math.abs(First.Longitude - Next.Longitude));\n if (Next.Latitude >= First.Latitude) {\n if (Next.Longitude >= First.Longitude) {\n } else {\n dRotateAngle = Math.PI - dRotateAngle;\n }\n } else {\n if (Next.Longitude >= First.Longitude) {\n dRotateAngle = 2 * Math.PI - dRotateAngle;\n } else {\n dRotateAngle = Math.PI + dRotateAngle;\n }\n }\n dRotateAngle = dRotateAngle * 180 / Math.PI;\n return dRotateAngle;\n\n}", "interpolateAngles(y2, y1, y3, n) {\n /* Equation from Astronomical Algorithms page 24 */\n const a = unwindAngle(y2 - y1);\n const b = unwindAngle(y3 - y2);\n const c = b - a;\n return y2 + n / 2 * (a + b + n * c);\n }", "function interpolate(length, totalLength, start, end) {\n var xy = [\n start[0] + (end[0] - start[0]) * length / totalLength,\n start[1] + (end[1] - start[1]) * length / totalLength\n ];\n return xy;\n }", "getTranslationPointsForAngle(x, y, a, length) {\n let radians = a * (PI / 180);\n let x2 = x + length * Math.cos(radians);\n let y2 = y + length * Math.sin(radians);\n return [x2, y2];\n }", "getHedTo( { x, y } ){\n\t\tlet leny = y - this.y;\n\t\tlet lenx = x - this.x;\n\t\tlet hyp = Math.sqrt( lenx*lenx + leny*leny );\n\t\tlet ret = 0;\n\t\tif( y >= this.y && x >= this.x ){\n\t\t\tret = ( Math.asin( leny / hyp ) * 180 / Math.PI ) + 90;\n\t\t} else if( y >= this.y && x < this.x ){\n\t\t\tret = ( Math.asin( leny / -hyp ) * 180 / Math.PI ) - 90;\n\t\t} else if( y < this.y && x > this.x ){\n\t\t\tret = ( Math.asin( leny / hyp ) * 180 / Math.PI ) + 90;\n\t\t} else {\n\t\t\tret = ( Math.asin( -leny / hyp ) * 180 / Math.PI ) - 90;\n\t\t}\n\t\tif( ret >= 360 ) {\n\t\t\tret = 360 - ret;\n\t\t}\n\t\tif( ret < 0 ) {\n\t\t\tret = 360 + ret;\n\t\t}\n\t\treturn ret;\n\t}", "static createStartEnd(startAngle, endAngle, result) {\n result = result ? result : new AngleSweep();\n result.setStartEndRadians(startAngle.radians, endAngle.radians);\n return result;\n }", "function PositionToAngles(xIn, yIn){\n\tvar xPosEnd = xIn - xPosStart; //Convert global x to local x\n\tvar yPosEnd = yIn - yPosStart; //Convert global y to local y\n\n\tvar angle3Search = 0; //Value to search through angles around the final point to conect back from\n\tvar xPos3 = -Math.sin(angle3Search/180*Math.PI)*l3 + xPosEnd; //The x based on angle3Search\n\tvar yPos3 = Math.cos(angle3Search/180*Math.PI)*l3 + yPosEnd; //the y based on angle3Search\n\tvar h = Math.sqrt((xPos3*xPos3)+(yPos3*yPos3)); //The distance from the x, y just calculated to the origin\n\twhile(h>(l1+l2-3)){ //Keep searching for better angles until it is close enough to the origin\n\t\tangle3Search++; //incriment the searching angle\n\t\txPos3 = -Math.sin(angle3Search/180*Math.PI)*l3 + xPosEnd; //recalculate\n\t\tyPos3 = Math.cos(angle3Search/180*Math.PI)*l3 + yPosEnd; //recalculate\n\t\th = Math.sqrt((xPos3*xPos3)+(yPos3*yPos3)); //recalculate\n\t\tif(angle3Search > 360){ //if we have done a full circle STOP!!\n\t\t\tconsole.log(\"ERROR: Position unreachable\");\n\t\t\treturn;\n\t\t}\n\t}\n\tvar angle3Global = angle3Search - 90; //Convert the search angle to the angle above the x axis of the other end of the joint\n\tvar hangle = Math.atan2(yPos3, xPos3) * 180 / Math.PI; //The angle above the x axis that the line between the 3rd point and the origin make\n\tvar a1 = Math.acos((l2*l2-l1*l1-h*h)/(-2*l1*h)) * 180 / Math.PI; //Internal angle next to point 1 of the triangle between joint 1, 2 and the line between the 3rd point and the origin\n\tvar a2 = Math.acos((h*h-l1*l1-l2*l2)/(-2*l1*l2)) * 180 / Math.PI;//Internal angle next to point 2 angle of the triangle between joint 1, 2 and the line between the 3rd point and the origin\n\tangle1 = a1 + hangle; //Calculate the angle value of servo 1\n\tangle2 = a2 - 45; //Calculate the angle value of servo 2\n\tangle3 = angle3Global + 135 - (angle2 - 135 + angle1); //Calculate the angle value of servo 3\n}", "function generateY(angle) {\n let shipValue = getYShipValue(angle) * shipFromCenter;\n return centreOfY + shipValue;\n }", "calculate_angles(from, to, result) {\n let /*f32*/ dx = to[0] - from[0]\n let /*f32*/ dy = to[1] - from[1]\n let /*f32*/ dz = to[2] - from[2]\n\n result.pitch = MathUtil.atan2s(MathUtil.sqrtf(dx * dx + dz * dz), dy)\n result.yaw = MathUtil.atan2s(dz, dx)\n }", "function generateY(angle) {\r\n let shipValue = getYShipValue(angle) * shipFromCenter;\r\n return centreOfY + shipValue;\r\n }", "endpoints() {\n if (isNaN(this.theta)) {\n console.log(\"NaN for \" + this.point);\n }\n\n if (this.pointDefines == \"start\") {\n throw new Error(\"UNIMPLEMENTED\");\n } else if (this.pointDefines == \"center\") {\n var r = this.length / 2;\n return [\n [this.point[0] + Math.cos(this.theta) * -r, this.point[1] + Math.sin(this.theta) * -r],\n [this.point[0] + Math.cos(this.theta) * r, this.point[1] + Math.sin(this.theta) * r]\n ];\n } else if (this.pointDefines == \"end\") {\n throw new Error(\"UNIMPLEMENTED\");\n } else {\n throw new Error(\"UNIMPLEMENTED\");\n }\n }", "getTargetAngle(startPoint, targetPoint, weapon) {\n\n let targetX = targetPoint.x;\n let targetXAdjustment = targetX * (Math.random() * weapon.accuracy);\n let plusOrMinusX = Math.random() < 0.5 ? -1 : 1;\n let adjustedTargetX = targetX + (plusOrMinusX * targetXAdjustment);\n let atan2X = adjustedTargetX - startPoint.x;\n\n let targetY = targetPoint.y;\n let targetYAdjustment = targetY * (Math.random() * weapon.accuracy);\n let plusOrMinusY = Math.random() < 0.5 ? -1 : 1;\n let adjustedTargetY = targetY + (plusOrMinusY * targetYAdjustment);\n let atan2Y = adjustedTargetY - startPoint.y;\n\n let angle = Math.atan2(atan2Y, atan2X);\n // let angle = Math.atan2(targetY - startPoint.y, targetX - startPoint.x); // original - always accurate\n let sin = Math.sin(angle) * weapon.speed; // Y change\n let cos = Math.cos(angle) * weapon.speed; // X change\n let deltaX = Math.abs(cos);\n let deltaY = Math.abs(sin);\n // console.log('angle', angle, 'deltaX', deltaX, 'deltaY', deltaY);\n\n return {\n angle: angle,\n sin: sin,\n cos: cos,\n deltaX: deltaX,\n deltaY: deltaY,\n maxX: Math.abs(adjustedTargetX - startPoint.x),\n maxY: Math.abs(adjustedTargetY - startPoint.y)\n }\n }", "function calculate_line(mp, point) {\n var a = mp[0] - point[0];\n var b = mp[1] - point[1];\n var omegaFirst = tanh(a/b);\n \n var aPrime1 = 30*Math.sin(omegaFirst);\n var bPrime1 = 30*Math.cos(omegaFirst);\n \n var omegaSecond = tanh(a/b);\n \n var aPrime2 = 30*Math.sin(omegaSecond);\n var bPrime2 = 30*Math.cos(omegaSecond);\n \n var start=[];\n var end = [];\n \n if (a>0 && b>0){\n start = [mp[0]-aPrime1, mp[1]-bPrime1];\n end = [point[0]+aPrime2, point[1]+bPrime2];\n }\n else if(a<0 && b>0) {\n start = [mp[0]-aPrime1, mp[1]-bPrime1];\n end = [point[0]+aPrime2, point[1]+bPrime2];\n }\n else if(a>0 && b<0) {\n start = [mp[0]+aPrime1, mp[1]+bPrime1];\n end = [point[0]-aPrime2, point[1]-bPrime2];\n }\n else {\n // a<0 && b<0\n start = [mp[0]+aPrime1, mp[1]+bPrime1];\n end = [point[0]-aPrime2, point[1]-bPrime2];\n }\n \n return [start,end];\n}", "get endRadians() { return this._radians1; }", "function angleOfTwoPoints(initial, intersection, final){\n\tvar largerOccurance = 0;\n\tvar u = subtracted_vertex(initial, intersection);\n\tvar v = subtracted_vertex(final, intersection);\n\t/* console.log(subtracted_vertex(intersection, initial).Length()); */\n\tif(subtracted_vertex(intersection, initial).Length() == 0){\n\t\tinitial = new b2Vec2(intersection.x + 1, intersection.y);\n\t\tu = subtracted_vertex(initial, intersection);\n\t\tv = subtracted_vertex(final, intersection);\n\t}\n\n\tvar dotProduct = (u.x * v.x) + (u.y * v.y);\n\tvar angle_cos = dotProduct / (u.Length() * v.Length());\n\tvar angle = Math.acos(angle_cos) * 180 / Math.PI;\n\tif(u.x * v.y - u.y * v.x < 0)\n\t\tangle = -angle;\n\treturn angle;\n}", "get endDegrees() { return Angle_1.Angle.radiansToDegrees(this._radians1); }", "_getQuadrant(angle) {\n if (angle > 270) {\n return 4;\n }\n else if (angle > 180) {\n return 3;\n }\n else if (angle > 90) {\n return 2;\n }\n else {\n return 1;\n }\n }", "function calculateAngle(startPosition, endPosition)\n\t\t{\n\t\t\tlet xDisplacement = endPosition.x - startPosition.x,\n\t\t\t\tyDisplacement = endPosition.y - startPosition.y,\n\t\t\t\tangle;\n\t\t\t\n\t\t\tif(yDisplacement === 0)\n\t\t\t\tangle = (xDisplacement >= 0) ? 0 : 180;\n\t\t\telse if(xDisplacement === 0)\n\t\t\t\tangle = (yDisplacement > 0) ? 90 : -90;\n\t\t\telse\n\t\t\t\tangle = ((xDisplacement < 0) ? 180 : 0) + Math.atan(yDisplacement / xDisplacement) * 180 / Math.PI;\n\t\t\t\n\t\t\treturn angle;\n\t\t} // end calculateAngle()", "function anime_divRound(start, end, posXCenter, posYCenter , radius, angleStart, angleEnd)\r\n{\r\n\tvar offset = $(window).scrollTop();\r\n\tvar position = new Array();\r\n\t\r\n\tif(offset < start){\r\n\t\tposition[\"x\"] = posXCenter + radius*Math.cos(degToRad(angleStart));\r\n\t\tposition[\"y\"] = posYCenter - radius*Math.sin(degToRad(angleStart));\r\n\t\treturn position;\r\n\t} \r\n\telse if(offset > end){\r\n\t\tposition[\"x\"] = posXCenter + radius*Math.cos(degToRad(angleEnd));\r\n\t\tposition[\"y\"] = posYCenter - radius*Math.sin(degToRad(angleEnd));\r\n\t\treturn position;\r\n\t}\r\n\t\r\n\t// Cas ou l'on se situe dans les limites \r\n\tvar offsetRelative = degToRad((offset - start)*(angleEnd - angleStart)/(end - start));\r\n\tposition[\"x\"] = posXCenter + radius*Math.cos(offsetRelative);\r\n\tposition[\"y\"] = posYCenter - radius*Math.sin(offsetRelative);\r\n\t\r\n\treturn position;\r\n}", "get secondaryUVHardAngle() {}", "function findXY(length,angle){\n return{\n y: Math.sin(angle) * length * -1,\n x: Math.cos(angle) * length\n }\n}", "getIgnitionEndPoints () {\n const pts = []\n this._horz.forEach(line => {\n const y = line.anchor()\n line.segments().forEach(segment => {\n if (segment.isBurned()) {\n pts.push([segment.begins(), y])\n if (segment.begins() !== segment.ends()) {\n pts.push([segment.ends(), y])\n }\n }\n })\n })\n return pts\n }", "calcAngleBetweenTwoPoints(p1,p2){\n return Math.atan2(p2.x - p1.x, p2.z - p1.z)/* * 180 / Math.PI */;\n }", "function getAnglesAndPoints(arr, center, r) {\n var _total = 0,\n _orderedArr = arr.slice(0), // copy\n _orderedArrLength = null,\n _totalCounter = 0,\n _processedArr = [];\n \n var _angles = {\n start: 0,\n mid: 0,\n end: 0\n };\n \n var _radians = {\n start: 0,\n mid: 0,\n end: 0\n };\n\n // sort array by total (descending)\n _orderedArr.sort(function(a, b) {\n return b.total - a.total;\n });\n \n _orderedArrLength = _orderedArr.length;\n \n for (var t = 0, tl = _orderedArrLength; t < tl; t ++) {\n _total += arr[t].total;\n }\n \n for (var i = 0, il = _orderedArrLength; i < il; i ++) {\n if (_orderedArr[i].total > 0) {\n _angles = {\n start: (_processedArr[i - 1]) ? _processedArr[i - 1].angles.end : 0,\n mid: 0,\n end: ((_orderedArr[i].total + _totalCounter) / _total) * 360\n };\n \n _angles.mid = getMidAngle(_angles.start, _angles.end);\n \n _radians = {\n start: getDegToRad(_angles.start, -90),\n mid: getDegToRad(_angles.mid, -90),\n end: getDegToRad(_angles.end, -90)\n };\n \n _processedArr.push({\n name: _orderedArr[i].name,\n total: _orderedArr[i].total,\n angles: {\n start: _angles.start,\n mid: _angles.mid,\n end: _angles.end\n },\n points: {\n start: getPointAlongC(center, r, getDegToRad(_angles.start, 90)),\n end: getPointAlongC(center, r, getDegToRad(_angles.end, 90))\n },\n innerCentroid: getPointAlongC(center, r, getDegToRad(_angles.mid, 90)),\n outerCentroid: getPointAlongC(center, r + (r / 2), getDegToRad(_angles.mid, 90))\n });\n \n _totalCounter += _processedArr[i].total;\n }\n }\n \n return _processedArr;\n}", "function range_from_psi_hob_1kt_interpolated(psi,hob) {\n\n\t\tvar h = hob;\n\n\t\tvar psi_ = psi_find(psi);\n\t\tvar p1 = psi_[0]; //OUTER\n\t\tvar p2 = psi_[1]; //INNER\n\t\n\t\tif(h<=0) {\n\t\t\t//easy case\n\t\t\tvar result = lerp(rngs[p1][0],p1,rngs[p2][0],p2,psi);\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\t//first check if it is out of bounds\n\t\tvar max_hob_outer = hobs[p1][hobs[p1].length-1];\n\t\tvar max_hob_inner = hobs[p2][hobs[p2].length-1];\n\t\tvar max_hob_lerp = lerp(max_hob_outer,p1,max_hob_inner,p2,psi);\n\n\t\tif(h>max_hob_lerp) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t//start on the hard case...\n\n\t\t//the proportion between the two PSIs\n\t\tvar proportion = lerp(0,p2,1,p1,psi);\n\n\t\tvar near_hobs = array_closest(hobs[p1],h);\n\n\t\t//search start index\n\t\tvar outer_index = near_hobs[0];\n\t\tvar search_direction = 1;\n\t\n\t\tvar intercept = getInterpolatedPosition(p2,p1,outer_index);\n\t\tif(!intercept) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvar h_low_index; var h_low_prop; var r_low_prop;\n\t\tvar h_high_index; var h_high_prop; var r_high_prop;\n\t\t\n\t\twhile(intercept[1]<h) {\n\t\t\tvar rng_at_prop = lerp(rngs[p1][outer_index],1,intercept[0],0,proportion);\n\t\t\tvar hob_at_prop = lerp(hobs[p1][outer_index],1,intercept[1],0,proportion);\n\t\t\tif(hob_at_prop<h) {\n\t\t\t\tif(outer_index>h_low_index||h_low_index==undefined) {\n\t\t\t\t\th_low_index = outer_index;\n\t\t\t\t\th_low_prop = hob_at_prop;\n\t\t\t\t\tr_low_prop = rng_at_prop;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(hob_at_prop>h) {\n\t\t\t\tif(h_low_index) {\n\t\t\t\t\th_high_prop = hob_at_prop;\n\t\t\t\t\tr_high_prop = rng_at_prop;\n\t\t\t\t\tresult = lerp(r_low_prop,h_low_prop,r_high_prop,h_high_prop,h);\n\t\t\t\t\treturn result;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\touter_index+=search_direction;\n\t\t\n\t\t\tif((outer_index>=hobs[p1].length)||(outer_index<0)) {\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tintercept = getInterpolatedPosition(p2,p1,outer_index);\n\t\t\t\tif(!intercept) return false;\n\t\t\t}\n\t\t}\n\t\tif(!result && h_low_index) {\n\t\t\t\t\trng_at_prop = lerp(rngs[p1][outer_index],1,intercept[0],0,proportion);\n\t\t\t\t\thob_at_prop = lerp(hobs[p1][outer_index],1,intercept[1],0,proportion);\n\t\t\t\t\th_high_prop = hob_at_prop;\n\t\t\t\t\tr_high_prop = rng_at_prop;\n\t\t\t\t\tresult = lerp(r_low_prop,h_low_prop,r_high_prop,h_high_prop,h);\n\n\t\t\t\t\treturn result;\n\t\t} else {\n\t\t\t//so low that it fails -- just take the last two measurements and use those\n\t\t\trng_at_prop = lerp(rngs[p1][outer_index],1,intercept[0],0,proportion);\n\t\t\thob_at_prop = lerp(hobs[p1][outer_index],1,intercept[1],0,proportion);\n\t\t\th_high_prop = hob_at_prop;\n\t\t\tr_high_prop = rng_at_prop;\n\t\t\tintercept = getInterpolatedPosition(p2,p1,outer_index-1);\n\t\t\tif(!intercept) return false;\n\t\t\trng_at_prop = lerp(rngs[p1][outer_index-1],1,intercept[0],0,proportion);\n\t\t\thob_at_prop = lerp(hobs[p1][outer_index-1],1,intercept[1],0,proportion);\n\t\t\th_low_prop = hob_at_prop;\n\t\t\tr_low_prop = rng_at_prop;\n\t\t\tresult = lerp(r_low_prop,h_low_prop,r_high_prop,h_high_prop,h);\n\t\t\treturn result;\n\t\t}\n\treturn false; //failed for some reason;\n\t}", "getLineLengthForAngle(angle) {\n // set some constants\n const x = this.state.player.playerXpos;\n const y = this.state.player.playerYpos;\n const gridSize = this.state.grid.gridSize;\n const map = this.state.mapData[0];\n const radiansConversion = PI / 180;\n const debug = this.state.debug;\n\n // set some variables\n let xShift, yShift;\n let newx = x;\n let newy = y;\n\n // calculate line length until first wall segment for shifts on the x axis\n\n let lineLengthForXAxis = 0;\n\n // set initial map indices\n let tileX = parseInt(x / gridSize);\n let tileY = parseInt(y / gridSize);\n\n let tempx = x;\n let tempy = y;\n\n while (tileX > 0 && tileY >= 0 && tileX < map[0].length && tileY < map.length) {\n\n if (map[tileY][tileX] != '1') {\n\n if (angle > 0 && angle <= 90) {\n newx > gridSize ? xShift = gridSize - (newx % gridSize) : xShift = gridSize - newx;\n if (xShift == 0) { xShift = gridSize }\n newy = tempy + (xShift * (Math.tan(angle * radiansConversion)));\n newx = tempx + xShift + 0.1; // going right, subtract 0.1\n }\n if (angle > 90 && angle <= 180) {\n newx < gridSize ? xShift = newx : xShift = (newx % gridSize);\n if (xShift == 0) { xShift = gridSize }\n newy = tempy + (xShift / (Math.tan((angle + 270) * radiansConversion)));\n newx = tempx - xShift - 0.1; // going left, add 0.1\n }\n if (angle > 180 && angle <= 270) {\n newx < gridSize ? xShift = newx : xShift = (newx % gridSize);\n if (xShift == 0) { xShift = gridSize }\n\n newy = tempy - (xShift * (Math.tan((angle + 180) * radiansConversion)));\n newx = tempx - xShift - 0.1; // going left, subtract 0.1\n }\n if (angle > 270 && angle < 360) {\n newx > gridSize ? xShift = gridSize - (newx % gridSize) : xShift = gridSize - newx;\n if (xShift == 0) { xShift = gridSize }\n newy = tempy - (xShift / (Math.tan((angle + 90) * radiansConversion)));\n newx = tempx + xShift + 0.1; // going right, add 0.1\n }\n\n // set new map indices\n tileX = parseInt(newx / gridSize);\n tileY = parseInt(newy / gridSize);\n\n // before adding to the lineLength, break if out of bounds on x axis\n if (newx <= 0 || newx >= map[0].length * gridSize) {\n break;\n }\n\n lineLengthForXAxis = this.getLineLengthBetweenPoints(x, y, newx, newy);\n\n // if out of bounds on y axis, break\n if (newy <= 0 || newy >= map.length * gridSize) {\n break;\n }\n\n tempx = newx;\n tempy = newy;\n\n } else {\n break; // encountered wall segment\n }\n\n if (debug) { this.drawDebugIndicationMarker(newx, newy, 'green') }\n\n }\n\n if (debug) { console.log('x (green) = ' + lineLengthForXAxis) }\n\n // calculate line length until first wall segment for shifts on the y axis\n\n let lineLengthForYAxis = 0;\n\n // reset some reused values\n tileX = parseInt(x / gridSize);\n tileY = parseInt(y / gridSize);\n tempx = x;\n tempy = y;\n newx = x;\n newy = y;\n xShift = 0;\n yShift = 0;\n\n while (tileX > 0 && tileY >= 0 && tileX < map[0].length && tileY < map.length) {\n\n if (map[tileY][tileX] != '1'){\n\n if (angle > 0 && angle <= 90) {\n newy > gridSize ? yShift = gridSize - (newy % gridSize) : yShift = gridSize - newy;\n if (yShift == 0) { yShift = gridSize }\n newx = tempx + (yShift / (Math.tan(angle * radiansConversion)));\n newy = tempy + yShift + 0.1; // going right, add 0.1\n }\n if (angle > 90 && angle <= 180) {\n newy < gridSize ? yShift = gridSize - newy : yShift = gridSize - (newy % gridSize);\n if (yShift == 0) { yShift = gridSize }\n newx = tempx - (yShift * (Math.tan((angle + 270) * radiansConversion)));\n newy = tempy + yShift + 0.1; // going right, add 0.1\n }\n if (angle > 180 && angle <= 270) {\n newy < gridSize ? yShift = newy : yShift = (newy % gridSize);\n if (yShift == 0) { yShift = gridSize }\n newx = tempx - (yShift / (Math.tan((angle + 180) * radiansConversion)));\n newy = tempy - yShift - 0.1; // going left, subtract 0.1\n }\n if (angle > 270 && angle < 360) {\n newy > gridSize ? yShift = (newy % gridSize): yShift = newy;\n if (yShift == 0) { yShift = gridSize }\n newx = tempx + (yShift * (Math.tan((angle + 90) * radiansConversion)));\n newy = tempy - yShift - 0.1; // going left, subtract 0.1;\n }\n\n // set new map indices\n tileX = parseInt(newx / gridSize);\n tileY = parseInt(newy / gridSize);\n\n // before adding to the lineLength, break if out of bounds on y axis\n if (newy <= 0 || newy >= map.length * gridSize){\n break;\n }\n\n lineLengthForYAxis = this.getLineLengthBetweenPoints(x, y, newx, newy);\n\n // if out of bounds on x axis, break\n if (newx <= 0 || newx >= map[0].length * gridSize){\n break;\n }\n\n tempx = newx;\n tempy = newy;\n\n } else {\n break; // encountered wall segment\n }\n\n if (debug) { this.drawDebugIndicationMarker(newx, newy, 'red') }\n\n }\n\n if (debug) { console.log('y (red) = ' + lineLengthForYAxis) }\n\n // calculate the definitive shortest route to nearest wall\n let shortestRoute = lineLengthForXAxis <= lineLengthForYAxis ? lineLengthForXAxis : lineLengthForYAxis;\n\n if (debug) { console.log('shortest route is '+shortestRoute+' pixels') }\n\n // return shortest length\n return shortestRoute;\n }", "_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 if (this.page <= leftOffset) {\n // very beginning, no rotation -> [0..maxSize]\n end = this.maxSize;\n }\n else if (this.pageCount - this.page < leftOffset) {\n // very end, no rotation -> [len-maxSize..len]\n start = this.pageCount - this.maxSize;\n }\n else {\n // rotate\n start = this.page - leftOffset - 1;\n end = this.page + rightOffset;\n }\n return [start, end];\n }", "function angle(n) {\n\treturn (n - 2) * 180\n}", "function lerpRotation(start, end, t) {\n var difference = Math.abs(end - start);\n if (difference > PI) {\n // We need to add on to one of the values.\n if (end > start) {\n // We'll add it on to start...\n start += TWO_PI;\n } else {\n // Add it on to end.\n end += PI + TWO_PI;\n }\n }\n\n // Interpolate it.\n var value = start + (end - start) * t;\n\n // wrap to 0-2PI\n /*if (value >= 0 && value <= TWO_PI)\n return value;\n return value % TWO_PI;*/\n\n //just return, as it's faster\n return value;\n}", "function _make_beziers(angleStart, angleExtent) {\n\t// copied / adapted from https://github.com/BigBadaboom/androidsvg/blob/418cf676849b200cacf3465478079f39709fe5b1/androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java#L2579 (ASL 2.0)\n\tvar numSegments = Math.ceil(Math.abs(angleExtent) / 90.0);\n\tangleStart = _to_radians(angleStart);\n\tangleExtent = _to_radians(angleExtent);\n\tvar angleIncrement = (angleExtent / numSegments);\n\n\t// The length of each control point vector is given by the following formula.\n\tvar controlLength = 4 / 3 * Math.sin(angleIncrement / 2) / (1 + Math.cos(angleIncrement / 2));\n\tvar coords = [];\n\n\tfor (var i = 0;i < numSegments;i++) {\n\t\tvar angle = angleStart + i * angleIncrement;\n\t\tvar dx = Math.cos(angle);\n\t\tvar dy = Math.sin(angle);\n\t\t\n\t\t// First control point\n\t\tcoords.push([\n\t\t\tdx - controlLength * dy,\n\t\t\tdy + controlLength * dx,\n\t\t]);\n\n\t\t// Second control point\n\t\tangle += angleIncrement;\n\t\tdx = Math.cos(angle);\n\t\tdy = Math.sin(angle);\n\t\tcoords.push([\n\t\t\tdx + controlLength * dy,\n\t\t\tdy - controlLength * dx,\n\t\t]);\n\t\t\n\t\t// Endpoint of bezier\n\t\tcoords.push([dx, dy]);\n\t}\n\n\treturn coords;\n}", "function computeLocation(t){\n //We know where zero goes:\n if(t==0){\n return origin;\n }\n //Otherwise...\n //first compute the p-adic valuation of i,\n var val=1;\n while((t)%(p**val)==0){\n val++;\n }\n //Higher powers of p should be closer to the origin\n radius = screenHeight/(3*val*val);\n //Figure out our rotation;\n var theta = 2*Math.PI*t/p**n\n return [origin[0] + radius*Math.cos(theta),origin[1] + radius*Math.sin(theta)];\n\n}", "static lathe(base, out, steps = 2, repeatStart = false, angleRng = Maths.PI_2, rotAxis = \"y\") {\n const inc = angleRng / steps;\n const v = new Vec3();\n const len = base.length;\n let i, j, angle, cos, sin;\n let rx = 0, ry = 0, rz = 0;\n for (i = 0; i < steps; i++) {\n angle = i * inc;\n cos = Math.cos(angle);\n sin = Math.sin(angle);\n for (j = 0; j < len; j += 3) {\n v.fromBuf(base, j);\n switch (rotAxis) { // https://www.siggraph.org/education/materials/HyperGraph/modeling/mod_tran/3drota.htm#Y-Axis%20Rotation\n case \"y\":\n ry = v.y;\n rx = v.z * sin + v.x * cos;\n rz = v.z * cos - v.x * sin;\n break;\n case \"x\":\n rx = v.x;\n ry = v.y * cos - v.z * sin;\n rz = v.y * sin + v.z * cos;\n break;\n case \"z\":\n rz = v.z;\n rx = v.x * cos - v.y * sin;\n ry = v.x * sin + v.y * cos;\n break;\n }\n out.push(rx, ry, rz);\n }\n }\n if (repeatStart)\n out.push(...base);\n }", "generarRecorridoAleatorio(puntos = 10, longitud = 10, angulo = Math.PI/5) {\r\n\t\tvar ptsSpline = [];\r\n\t\tvar numeroGenerarPuntos = puntos;\r\n\t\tvar maxLongitud = longitud;\r\n\t\tvar maxAngulo = angulo; // Math.PI; // son radines\r\n\r\n\t\tvar origen = {x: 0, y: 0, z: 0};\r\n\t\tvar anterior = origen;\r\n\r\n\t\tfor (var i = 0; i < numeroGenerarPuntos; i++) {\r\n\r\n\t\t\t// guardamos anterior\r\n\t\t var x = anterior.x;\r\n\t\t var y = anterior.y;\r\n\t\t var z = anterior.z;\r\n\r\n\t\t\t// calculamos nuuevo angulo de rotacion\r\n\t\t\tvar nuevoAngulo = Math.random() * maxAngulo;\r\n\t\t // var nuevaLongitud = maxLongitud + Math.random() * maxLongitud;\r\n\r\n\t\t\t// Nuestra nuva longitud sera la maxima que nos han pasado\r\n\t\t\tvar nuevaLongitud = maxLongitud;\r\n\r\n\t\t\t// tenemos 3 ejes, veremos en que eje rotaremos segun la iteracion del bucle\r\n\t\t\tswitch (i%3) {\r\n\t\t\t\t// rotar con respecto al eje z\r\n\t\t\t\tcase 0: x = Math.cos(nuevoAngulo) * anterior.x + Math.sin(nuevoAngulo) * anterior.z;\r\n\t\t\t\t\t\t y = Math.cos(-nuevoAngulo) * anterior.y - Math.sin(-nuevoAngulo) * anterior.z;\r\n\t\t\t\t\t\t break;\r\n\r\n\t\t\t\t// rotar con respecto al eje x\r\n\t\t\t\tcase 1: y = Math.cos(-nuevoAngulo) * anterior.y - Math.sin(-nuevoAngulo) * anterior.z;\r\n\t\t\t\t\t\t z = Math.sin(-nuevoAngulo) * anterior.z + Math.cos(-nuevoAngulo) * anterior.x;\r\n\t\t\t\t\t\t break;\r\n\r\n\t\t\t\t// rotar con respecto al eje y\r\n\t\t\t\tcase 2: z = Math.sin(-nuevoAngulo) * anterior.z + Math.cos(-nuevoAngulo) * anterior.x;\r\n\t\t\t\t\t\t x = Math.cos(nuevoAngulo) * anterior.x + Math.sin(nuevoAngulo) * anterior.z;\r\n\t\t\t\t\t\t break;\r\n\r\n\t\t\t default: break;\r\n\t\t }\r\n\r\n\t\t\t// rotar con respecto al eje anterior tanto como nos diga la longitud\r\n\t\t\tanterior.x = x + nuevaLongitud;\r\n\t\t\tanterior.y = y + nuevaLongitud;\r\n\t\t\tanterior.z = z + nuevaLongitud;\r\n\r\n\t\t\t// aniadir a nuestro vector de puntos\r\n\t\t\tptsSpline.push(new THREE.Vector3(anterior.x, anterior.y, anterior.z));\r\n\t\t}\r\n\r\n\t\t// generar el CatmullRomCurve3\r\n\t\tvar spline = new THREE.CatmullRomCurve3(ptsSpline);\r\n\r\n\t\treturn spline;\r\n\t}", "function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {\n var t1 = 1 - t;\n var t13 = Math.pow(t1, 3);\n var t12 = Math.pow(t1, 2);\n var t2 = t * t;\n var t3 = t2 * t;\n var x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x;\n var y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y;\n var mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x);\n var my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y);\n var nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x);\n var ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y);\n var ax = t1 * p1x + t * c1x;\n var ay = t1 * p1y + t * c1y;\n var cx = t1 * c2x + t * p2x;\n var cy = t1 * c2y + t * p2y;\n var alpha = 90 - Math.atan2(mx - nx, my - ny) * 180 / Math.PI;\n\n if (mx > nx || my < ny) {\n alpha += 180;\n }\n\n return {\n x: x,\n y: y,\n m: { x: mx, y: my },\n n: { x: nx, y: ny },\n start: { x: ax, y: ay },\n end: { x: cx, y: cy },\n alpha: alpha\n };\n }", "function getInterpolatedPosition(inner_psi,outer_psi,outer_index) {\n\t\n\t\tvar inner_index = 0; //we start from index zero (HOB = 0) and move \"up.\" the choice of a starting index and the method of traversig the index could be optimized. \n\t\t\n\t\twhile(linesIntersect(\n\t\t\t\t\t0,\t\t\t\t\t\t\t\t\t0, \n\t\t\t\t\trngs[outer_psi][outer_index],\thobs[outer_psi][outer_index],\n\t\t\t\t\n\t\t\t\t\trngs[inner_psi][inner_index],\thobs[inner_psi][inner_index], \n\t\t\t\t\trngs[inner_psi][inner_index+1],\thobs[inner_psi][inner_index+1]\n\t\t)==false) {\n\t\t\tinner_index++;\n\t\t\tif(inner_index>rngs[inner_psi].length||inner_index-1<0) {\n\t\t\t\treturn false;\t\t\n\t\t\t}\n\t\t}\n\t\treturn getLineLineIntersection(0,0, rngs[outer_psi][outer_index],hobs[outer_psi][outer_index],\n\t\t\t\t\t\t\t\t rngs[inner_psi][inner_index+1],hobs[inner_psi][inner_index+1], rngs[inner_psi][inner_index],hobs[inner_psi][inner_index]);\n\n\t}", "function calcularPendiente(){\n var y2 = 12;\n var y1 = 32;\n var x2 = 8;\n var x1 = 6;\n var resultado;\n\n //Fromula de calcular pendiente de una recta.\n // m=(y2-y1)/(x2-x1)\n console.log(\"Pendiente de una recta: \")\n console.log(resultado = (y2-y1)/(x2-x1));\n\n}", "function findedge (l, p1 , p2) {\n var m = (p1[1] - p2[1])/(p1[0] - p2[0]);\n var b = p1[1] - m*p1[0];\n var y = l + p1[1];\n \n return [(y - b)/m, y];\n }", "function findAngle(p0,p1,p2) {\n var b = Math.pow(p1.x-p0.x,2) + Math.pow(p1.y-p0.y,2),\n a = Math.pow(p1.x-p2.x,2) + Math.pow(p1.y-p2.y,2),\n c = Math.pow(p2.x-p0.x,2) + Math.pow(p2.y-p0.y,2),\n angle = Math.acos( (a+b-c) / Math.sqrt(4*a*b) );\n return (angle * (180 / Math.PI))\n}", "function step(startAngle, startRadius, endAngle, endRadius) {\n var c0 = Math.cos(startAngle = (startAngle - 90) / 180 * Math.PI),\n s0 = Math.sin(startAngle),\n c1 = Math.cos(endAngle = (endAngle - 90) / 180 * Math.PI),\n s1 = Math.sin(endAngle);\n return \"M\" + startRadius * c0 + \",\" + startRadius * s0\n + (endAngle === startAngle ? \"\" : \"A\" + startRadius + \",\" + startRadius + \" 0 0 \" + (endAngle > startAngle ? 1 : 0) + \" \" + startRadius * c1 + \",\" + startRadius * s1)\n + \"L\" + endRadius * c1 + \",\" + endRadius * s1;\n}", "function curve4(x1, y1, //Anchor1\n x2, y2, //Control1\n x3, y3, //Control2\n x4, y4, //Anchor2\n nSteps // Flattening value\n\t\t)\n{\n\tvar pointList = new Array();\n var dx1 = x2 - x1;\n var dy1 = y2 - y1;\n var dx2 = x3 - x2;\n var dy2 = y3 - y2;\n var dx3 = x4 - x3;\n var dy3 = y4 - y3;\n\n var subdiv_step = 1.0 / (nSteps + 1);\n var subdiv_step2 = subdiv_step*subdiv_step;\n var subdiv_step3 = subdiv_step*subdiv_step*subdiv_step;\n\n var pre1 = 3.0 * subdiv_step;\n var pre2 = 3.0 * subdiv_step2;\n var pre4 = 6.0 * subdiv_step2;\n var pre5 = 6.0 * subdiv_step3;\n\n var tmp1x = x1 - x2 * 2.0 + x3;\n var tmp1y = y1 - y2 * 2.0 + y3;\n\n var tmp2x = (x2 - x3)*3.0 - x1 + x4;\n var tmp2y = (y2 - y3)*3.0 - y1 + y4;\n\n var fx = x1;\n var fy = y1;\n\n var dfx = (x2 - x1)*pre1 + tmp1x*pre2 + tmp2x*subdiv_step3;\n var dfy = (y2 - y1)*pre1 + tmp1y*pre2 + tmp2y*subdiv_step3;\n\n var ddfx = tmp1x*pre4 + tmp2x*pre5;\n var ddfy = tmp1y*pre4 + tmp2y*pre5;\n\n var dddfx = tmp2x*pre5;\n var dddfy = tmp2y*pre5;\n\n var step = nSteps;\n\n\tpointList.push ([x1, y1]);\t// Start Here\n while(step--)\n {\n fx += dfx;\n fy += dfy;\n dfx += ddfx;\n dfy += ddfy;\n ddfx += dddfx;\n ddfy += dddfy;\n pointList.push ([fx, fy]);\n }\n// pointList.push ([x4, y4]); // Last step must go exactly to x4, y4\n return pointList;\n}", "function phi2([n00, n01, n10, n11]) {\n return (n11 * n00 - n10 * n01)/Math.sqrt((n10 + n11) * (n00 + n11) * (n01 + n11) * (n00 + n10));\n}", "ensureClockwise() {\n let vectorsRelativeToCenter = [];\n let headingValues = [];\n for (let v of this.pixelVectorPositions) {\n vectorsRelativeToCenter.push(p5.Vector.sub(v, this.center));\n }\n\n\n for (let v of vectorsRelativeToCenter) {\n let temp = v.heading();\n if (temp < 0) {\n temp += 2 * PI;\n }\n\n headingValues.push(temp);\n }\n //print(headingValues);\n\n let rotationalDifferenceTotal = 0;\n for (let i = 0; i < headingValues.length; i++) {\n let difference = 0;\n if (i === headingValues.length - 1) {\n difference = headingValues[0] - headingValues[i];\n } else {\n difference = headingValues[i + 1] - headingValues[i];\n }\n if (difference > 0) {\n rotationalDifferenceTotal += 1;\n } else {\n rotationalDifferenceTotal -= 1;\n }\n }\n\n if (rotationalDifferenceTotal < 0) {\n this.pixelVectorPositions.reverse();\n }\n }", "function CameraCommand_Laser_ComputeBestPoints(start, end, start1, start2, end1, end2, bInvert)\n{\n\t//calculate the angles\n\tvar nAngle11 = bInvert ? Math.atan2(start1.y - end1.y, start1.x - end1.x) : Math.atan2(end1.y - start1.y, end1.x - start1.x);\n\tvar nAngle12 = bInvert ? Math.atan2(start1.y - end2.y, start1.x - end2.x) : Math.atan2(end2.y - start1.y, end2.x - start1.x);\n\tvar nAngle21 = bInvert ? Math.atan2(start2.y - end1.y, start2.x - end1.x) : Math.atan2(end1.y - start2.y, end1.x - start2.x);\n\tvar nAngle22 = bInvert ? Math.atan2(start2.y - end2.y, start2.x - end2.x) : Math.atan2(end2.y - start2.y, end2.x - start2.x);\n\t//convert it into a positive 45 degre angle\n\tnAngle11 = Math.abs(Math.abs(nAngle11 * (180 / Math.PI)) - 45);\n\tnAngle12 = Math.abs(Math.abs(nAngle12 * (180 / Math.PI)) - 45);\n\tnAngle21 = Math.abs(Math.abs(nAngle21 * (180 / Math.PI)) - 45);\n\tnAngle22 = Math.abs(Math.abs(nAngle22 * (180 / Math.PI)) - 45);\n\t//find the smallest angle\n\tif (nAngle11 <= nAngle12)\n\t{\n\t\tif (nAngle11 <= nAngle21)\n\t\t{\n\t\t\tif (nAngle11 <= nAngle22)\n\t\t\t{\n\t\t\t\t//its nAngle11\n\t\t\t\tstart.x = start1.x;\n\t\t\t\tstart.y = start1.y;\n\t\t\t\tend.x = end1.x;\n\t\t\t\tend.y = end1.y;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//its nAngle22\n\t\t\t\tstart.x = start2.x;\n\t\t\t\tstart.y = start2.y;\n\t\t\t\tend.x = end2.x;\n\t\t\t\tend.y = end2.y;\n\t\t\t}\n\t\t}\n\t\telse if (nAngle21 <= nAngle22)\n\t\t{\n\t\t\t//its nAngle21\n\t\t\tstart.x = start2.x;\n\t\t\tstart.y = start2.y;\n\t\t\tend.x = end1.x;\n\t\t\tend.y = end1.y;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//its nAngle22\n\t\t\tstart.x = start2.x;\n\t\t\tstart.y = start2.y;\n\t\t\tend.x = end2.x;\n\t\t\tend.y = end2.y;\n\t\t}\n\t}\n\telse if (nAngle12 <= nAngle21)\n\t{\n\t\tif (nAngle12 <= nAngle22)\n\t\t{\n\t\t\t//its nAngle12\n\t\t\tstart.x = start1.x;\n\t\t\tstart.y = start1.y;\n\t\t\tend.x = end2.x;\n\t\t\tend.y = end2.y;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//its nAngle22\n\t\t\tstart.x = start2.x;\n\t\t\tstart.y = start2.y;\n\t\t\tend.x = end2.x;\n\t\t\tend.y = end2.y;\n\t\t}\n\t}\n\telse if (nAngle21 <= nAngle22)\n\t{\n\t\t//its nAngle21\n\t\tstart.x = start2.x;\n\t\tstart.y = start2.y;\n\t\tend.x = end1.x;\n\t\tend.y = end1.y;\n\t}\n\telse\n\t{\n\t\t//its nAngle22\n\t\tstart.x = start2.x;\n\t\tstart.y = start2.y;\n\t\tend.x = end2.x;\n\t\tend.y = end2.y;\n\t}\n}", "function getAproxResult() {\n return ((insidePoints.length + 1) / cant_points) * (x_to - x_from) * y_to;\n }", "function trange2points({ tStart, tEnd, stepsCount, doIntegrate })\n {\n var newpoints = [];\n var area = 0;\n var antid = antider;\n antid.length = 1;\n var tstep = ( tEnd - tStart ) / stepsCount;\n for( var tix = 0; tix<=stepsCount; tix++ ) {\n var q = tStart + tstep * tix;\n var pos = q2xy( q );\n if( doIntegrate && tix ) {\n area += tstep * pos[1];\n antid[ tix ] = area;\n }\n //deswaps if swap mode is on\n curvePoints[tix] = doSwapXY ? [pos[1],pos[0]] : pos;\n newpoints.push( pos );\n }\n return newpoints;\n }", "function calcArcPoint(out, center, v1, v2, angle) {\n const x = Math.cos(angle);\n const y = Math.sin(angle);\n out[0] = center[0] + v1[0] * x + v2[0] * y;\n out[1] = center[1] + v1[1] * x + v2[1] * y;\n out[2] = center[2] + v1[2] * x + v2[2] * y;\n}", "calc(base_shape, end_shape, steps_per_revolution, revolutions, completion, twist) {\n\n // Set initial values\n var x;\n var y;\n let current_revolution;\n\n // Initialize return value - the path array\n // This stores the x,y coordinates for each step\n var path = new Array();\n\n // Iteration counter.\n var step = 0;\n\n let growth_factor;\n let lerp_amount;\n\n // Theta values\n const max_t = revolutions * TWO_PI;\n const min_t = (1.0 - completion) * max_t;\n let t = min_t;\n\n // Loop through revolutions\n while (t < max_t) {\n\n // Rotational Angle (steps per rotation in the denominator)\n t = (step/steps_per_revolution) * TWO_PI + min_t;\n\n // Calculate current rotation\n current_revolution = Math.floor(t/TWO_PI);\n\n // Calculate x,y coordinates\n // TODO: http://www.gizma.com/easing/#quint2\n lerp_amount = (current_revolution/revolutions);\n x = (t/max_t) * lerp(base_shape[step % steps_per_revolution][0], end_shape[step % steps_per_revolution][0], lerp_amount);\n y = (t/max_t) * lerp(base_shape[step % steps_per_revolution][1], end_shape[step % steps_per_revolution][1], lerp_amount);\n\n // Rotate [x,y] coordinates around [0,0] by angle theta, and then append to path\n path[step] = this.rotationMatrix(x, y, twist * t/steps_per_revolution);\n\n path.push([x,y]);\n\n // Increment iteration counter\n step++;\n }\n\n // Remove the last element of the path.\n /*\n I'm not sure why, but without this the last element is anchored at a point we don't want.\n There's probably a more elegant way to handle this in the loop above, but for now\n I'm going with this.\n */\n path.pop();\n\n return path;\n }", "function getStartEnd(boundingPoly) {\n function helper(axis, func) {\n let result = boundingPoly.vertices[0][axis];\n for (let i = 1; i < 4; i++) {\n const current = boundingPoly.vertices[i][axis];\n result = func(result, current);\n }\n return result;\n }\n\n const minX = helper('x', Math.min);\n const minY = helper('y', Math.min);\n const maxX = helper('x', Math.max);\n const maxY = helper('y', Math.max);\n\n return [{ x: minX, y: minY }, { x: maxX, y: maxY }];\n}", "function afase_pianeta(njd,AR,DE,dist_ps,dist_pt){\n\n // funzione per il calcolo dell'angolo di fase per un pianeta.\n // AR,DE sono le coordinate equatoriali decimali, del pianeta.\n // njd= numero del giorno giuliano.\n // dist_ps=distanza pianeta-sole in UA.\n // dist_pt=distanza pianeta-Terra in UA.\n // by Salvatore Ruiu - gennaio 2013.\n\n var coo_sole=pos_sole(njd); // coordinate equatoriali decimali del Sole.\n var Rs=coo_sole[4]; // distanza Terra-Sole. \n var elongaz=elong(AR,DE,coo_sole[0],coo_sole[1]); // elongazione in gradi dal Sole.\n\n // calcolo dell'angolo di fase in gradi . \n\n var Dpt= dist_pt; // distanza pianeta-terra.\n var Dts= Rs; // distanza terra-sole.\n var Dps= dist_ps; // distanza pianeta-sole.\n\n // risolve il teorema del coseno (noti i 3 lati del triangolo).\n\n var delta_fase=(Dts*Dts+Dps*Dps-Dpt*Dpt)/(2*Dps*Dts);\n delta_fase=Math.acos(delta_fase); \n delta_fase=Rda(delta_fase);\n\n var angolo_fase=180-Math.abs(elongaz)-delta_fase; // risultato: angolo di fase in gradi.\n\nreturn angolo_fase;\n\n}", "function endPoint(branch) {\r\n\tvar x = branch.x + branch.l * Math.sin(branch.a);\r\n\tvar y = branch.y - branch.l * Math.cos(branch.a);\r\n\treturn {x: x, y: y};\r\n}", "_computeArrowBodyPoints(radius, angle, width, length) {\n const that = this,\n sin = Math.sin(angle),\n cos = Math.cos(angle),\n endX1 = radius - width * cos + length * sin,\n endY1 = radius + width * sin + length * cos,\n endX2 = radius + width * cos + length * sin,\n endY2 = radius - width * sin + length * cos,\n startX1 = radius + width * cos,\n startY1 = radius - width * sin,\n startX2 = radius - width * cos,\n startY2 = radius + width * sin,\n\n points = 'M ' + startX1 + ',' + startY1 + ' L ' + startX2 + ',' + startY2 + ' L ' + endX1 + ',' + endY1 + ' ' + endX2 + ',' + endY2;\n\n that._headCenter = { x: (endX1 + endX2) / 2, y: (endY1 + endY2) / 2 };\n\n return points;\n }", "function arrowArea(a, b) {\n return (2 * a * b) / 8\n\n}", "calculateAngle() {\n const normalizedData = this.gameOver ? ((this.time / -this.terminalVelocity) / 2) + 0.5 : this.time / -this.terminalVelocity;\n this.angle = this.gameOver ? normalizedData * -135 + 90 : normalizedData * -45;\n }", "function innerAngle(ax, ay, bx, by, cx, cy) {\n var ab = distance2D(ax, ay, bx, by),\n bc = distance2D(bx, by, cx, cy),\n theta, dotp;\n if (ab === 0 || bc === 0) {\n theta = 0;\n } else {\n dotp = ((ax - bx) * (cx - bx) + (ay - by) * (cy - by)) / (ab * bc);\n if (dotp >= 1 - 1e-14) {\n theta = 0;\n } else if (dotp <= -1 + 1e-14) {\n theta = Math.PI;\n } else {\n theta = Math.acos(dotp); // consider using other formula at small dp\n }\n }\n return theta;\n }", "function _getEndPath (startPath) {\n let sp = startPath.split(\" \");\n\n let ep1 = sp\n .map((val, idx) => {\n if (idx === 5) {\n val = Number(val);\n return (val += 30);\n } else {\n return val;\n }\n })\n .join(\" \");\n\n let ep2 = sp\n .map((val, idx) => {\n if (idx === 5) {\n val = Number(val);\n return (val -= 30);\n } else {\n return val;\n }\n })\n .join(\" \");\n \n return [ep1, ep2];\n}", "function midAngle(d) { return d.startAngle + (d.endAngle - d.startAngle) / 2; }", "function midAngle(d) { return d.startAngle + (d.endAngle - d.startAngle) / 2; }", "function midAngle(d) { return d.startAngle + (d.endAngle - d.startAngle) / 2; }", "function midAngle(d) { return d.startAngle + (d.endAngle - d.startAngle) / 2; }", "function rightRegionSevenCoordinates(mx,bx,phasePos,index){\n \n //let temp = g.points[0];\n let xL, xR, m, b, x, y;\n for(let i = 0; i < phasePos.length-1; i++){\n m = (phasePos[i+1][1]-phasePos[i][1])/(phasePos[i+1][0]-phasePos[i][0]);\n b = phasePos[i][1] - m*phasePos[i][0];\n x = (bx-b)/(m-mx);\n \n if(x > phasePos[i][0] && x < phasePos[i+1][0] && i < index){\n xL = x;\n } else if(x == phasePos[i][0] && i < index){\n xL = phasePos[i][0];\n } \n\n if(x > phasePos[i][0] && x < phasePos[i+1][0] && i > index){\n xR = x;\n } else if (x == phasePos[i][0] && i > index){\n xR = phasePos[i][0];\n }\n }\n return([xL,xR])\n}", "function direction(start, end){\n var deltaX = end[0]-start[0];\n var deltaY = end[1]-start[1];\n if(deltaX === 0) return deltaY > 0 ? Math.PI/2 : 3*Math.PI/2;\n if(deltaY === 0) return deltaX > 0 ? 0 : Math.PI;\n var atan = Math.atan(deltaY/deltaX);\n if(atan >= 0){\n return deltaY > 0 ? atan : atan + Math.PI;\n }else{\n return deltaY > 0 ? atan + Math.PI : atan + 2*Math.PI;\n }\n}", "function computeLocation(t){\n var coordinates = []\n coordinates.push(origin[0]);\n coordinates.push(origin[1]);\n for(var i=0;i<n;i++){\n var radius = screenHeight/(radMult*((i+1)**radExp));\n //var radius = radiusMultiplyer/(p**(i));\n var theta;\n if(t[i]){\n theta = 2*Math.PI*t[i]/p;\n }\n else{\n theta = 0;\n }\n coordinates[0] += radius*Math.cos(-theta);\n coordinates[1] += radius*Math.sin(-theta);\n }\n return coordinates;\n}", "function phi4z (eccent,e0,e1,e2,e3,a,b,c,phi) {\n\tvar sinphi, sin2ph, tanphi, ml, mlp, con1, con2, con3, dphi, i;\n\n\tphi = a;\n\tfor (i = 1; i <= 15; i++) {\n\t\tsinphi = Math.sin(phi);\n\t\ttanphi = Math.tan(phi);\n\t\tc = tanphi * Math.sqrt (1.0 - eccent * sinphi * sinphi);\n\t\tsin2ph = Math.sin (2.0 * phi);\n\t\t/*\n\t\tml = e0 * *phi - e1 * sin2ph + e2 * sin (4.0 * *phi);\n\t\tmlp = e0 - 2.0 * e1 * cos (2.0 * *phi) + 4.0 * e2 * cos (4.0 * *phi);\n\t\t*/\n\t\tml = e0 * phi - e1 * sin2ph + e2 * Math.sin (4.0 * phi) - e3 * Math.sin (6.0 * phi);\n\t\tmlp = e0 - 2.0 * e1 * Math.cos (2.0 * phi) + 4.0 * e2 * Math.cos (4.0 * phi) - 6.0 * e3 * Math.cos (6.0 * phi);\n\t\tcon1 = 2.0 * ml + c * (ml * ml + b) - 2.0 * a * (c * ml + 1.0);\n\t\tcon2 = eccent * sin2ph * (ml * ml + b - 2.0 * a * ml) / (2.0 *c);\n\t\tcon3 = 2.0 * (a - ml) * (c * mlp - 2.0 / sin2ph) - 2.0 * mlp;\n\t\tdphi = con1 / (con2 + con3);\n\t\tphi += dphi;\n\t\tif (Math.abs(dphi) <= .0000000001 ) return(phi); \n\t}\n\tProj4js.reportError(\"phi4z: No convergence\");\n\treturn null;\n}", "function area_rectangulo(base,altura){\n return base*altura\n}", "function forward(p) {\n var n;\n var lon = p.x;\n var lat = p.y;\n\n var delta_lat = lat - this.lat0;\n var delta_lon = lon - this.long0;\n\n // 1. Calculate d_phi and d_psi ... // and d_lambda\n // For this algorithm, delta_latitude is in seconds of arc x 10-5, so we need to scale to those units. Longitude is radians.\n var d_phi = delta_lat / _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SEC_TO_RAD\"] * 1E-5;\n var d_lambda = delta_lon;\n var d_phi_n = 1; // d_phi^0\n\n var d_psi = 0;\n for (n = 1; n <= 10; n++) {\n d_phi_n = d_phi_n * d_phi;\n d_psi = d_psi + this.A[n] * d_phi_n;\n }\n\n // 2. Calculate theta\n var th_re = d_psi;\n var th_im = d_lambda;\n\n // 3. Calculate z\n var th_n_re = 1;\n var th_n_im = 0; // theta^0\n var th_n_re1;\n var th_n_im1;\n\n var z_re = 0;\n var z_im = 0;\n for (n = 1; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n z_re = z_re + this.B_re[n] * th_n_re - this.B_im[n] * th_n_im;\n z_im = z_im + this.B_im[n] * th_n_re + this.B_re[n] * th_n_im;\n }\n\n // 4. Calculate easting and northing\n p.x = (z_im * this.a) + this.x0;\n p.y = (z_re * this.a) + this.y0;\n\n return p;\n}", "function calculation () { \n var cos = Math.cos(phi), sin = Math.sin(phi);\n xB0 = xM0+R0*cos; yB0 = yM0-R0*sin; // Beobachtungsort (linke Skizze) \n xN0 = xB0-R1*sin; yN0 = yB0-R1*cos; // Norden (linke Skizze)\n xS0 = xB0+R1*sin; yS0 = yB0+R1*cos; // S�den (linke Skizze)\n xZ0 = xB0+R1*cos; yZ0 = yB0-R1*sin; // Zenit (linke Skizze)\n if (phi < 0) {cos = -cos; sin = -sin;} // Vorzeichenumkehr f�r S�dhalbkugel\n xP1 = xB1-R1*cos; yP1 = yB1-R1*sin; // Himmelspol (rechte Skizze) \n }", "function segmentoY (tx,ty,tz,lunghezza) {\n var funzione = function (p) {\n var u = p[0] * lunghezza;\n\n return [tx,ty + u,tz];\n };\n\n return funzione;\n}", "function getSinTheta() {\n var i;\n var point;\n var hitPeak = false;\n // var peaksInRange = [];\n var xList = [];\n var aList = [];\n // var newAmplitude = amplitude;\n var a, factor = 0;\n var sFactor;\n for (i = 0; i < config.doi.length; i++) {\n if (config.doi[i][\"val\"] < config.doiThreshold)\n continue;\n // console.log(config.doi[i]);\n point = config.doi[i][\"y\"];\n // current offset is within the range of a hill caused by this doi\n // hill width: +/-config.doiRange\n if (point - config.doiRange <= offset + config.doiSnappingPosition && offset + config.doiSnappingPosition <= point) { // uphill\n sFactor = isElementInViewport(config.doi[i][\"node\"]) ? config.slopeViewportFactor : config.slopeFactor;\n // console.log(\"UPHILL\", sFactor);\n a = 2 * config.doi[i][\"val\"] * sFactor / (config.doiRange * config.doiRange) * (offset + config.doiSnappingPosition - (point - config.doiRange));\n // peaksInRange.push(config.doi[i]);\n xList.push(a * (offset + config.doiSnappingPosition - (point - config.doiRange)));\n aList.push(a);\n // break;\n } else if (point < offset + config.doiSnappingPosition && offset + config.doiSnappingPosition <= point + config.doiRange) {\n sFactor = isElementInViewport(config.doi[i][\"node\"]) ? config.slopeViewportFactor : config.slopeFactor;\n // console.log(\"DOWNHILL\", sFactor);\n a = 2 * config.doi[i][\"val\"] * sFactor / (config.doiRange * config.doiRange) * ((point + config.doiRange) - (offset + config.doiSnappingPosition));\n // peaksInRange.push(config.doi[i]);\n xList.push(a * ((point + config.doiRange) - (offset + config.doiSnappingPosition)));\n aList.push(a);\n // break;\n }\n }\n\n // if multiple peaks, compute a for the peak with maximum value.\n var max = 0;\n var maxA;\n // TODO: for minus a value, pick the biggest absolute value\n for (i = 0; i < xList.length; i++) {\n if (max <= xList[i]) {\n max = xList[i];\n maxA = aList[i];\n }\n // if (max <= peaksInRange[i][\"val\"]) {\n // max = peaksInRange[i][\"val\"];\n // maxA = aList[i];\n // }\n }\n factor = Math.abs(maxA / Math.sqrt(maxA * maxA + 1));\n // console.log(factor, xList.length, \"peaks overlapping\", maxA, \"is chosen among\", aList, xList);\n return factor;\n }", "function triangleAnglesFinder(firstAngle, secondAngle) {\n let result = 180 - +firstAngle - +secondAngle;\n if (!isNaN(result)) {\n return result;\n } else {\n return \"insert only numbers\";\n }\n}", "function areaTriangulo (base,altura){\n\n return (base*altura)/2;\n}", "function getTriangle(i, svgNS, rectangle) {\r\n let triangle = document.createElementNS(svgNS, 'polygon');\r\n let {mid_x, mid_y, w, h} = rectangle;\r\n let middle = mid_x + ',' + mid_y;\r\n let angle1;\r\n let angle2;\r\n\r\n switch (i) {\r\n case 1:\r\n angle1 = (mid_x + (w/2)) + ',' + (mid_y + (h/2));\r\n angle2 = mid_x + ',' + (mid_y + (h/2));\r\n break;\r\n case 2:\r\n angle1 = (mid_x + (w/2)) + ',' + mid_y;\r\n angle2 = (mid_x + (w/2)) + ',' + (mid_y + (h/2));\r\n break;\r\n case 3:\r\n angle1 = (mid_x + (w/2)) + ',' + (mid_y - (h / 2));\r\n angle2 = (mid_x + (w/2)) + ',' + mid_y;\r\n break;\r\n case 4:\r\n angle1 = mid_x + ',' + (mid_y - (h / 2));\r\n angle2 = (mid_x + (w/2)) + ',' + (mid_y - (h / 2));\r\n break;\r\n case 5:\r\n angle1 = (mid_x - (w /2)) + ',' + (mid_y - (h / 2));\r\n angle2 = mid_x + ',' + (mid_y - (h / 2));\r\n break;\r\n case 6:\r\n angle1 = (mid_x - (w /2)) + ',' + mid_y;\r\n angle2 = (mid_x - (w /2)) + ',' + (mid_y - (h / 2));\r\n break;\r\n case 7:\r\n angle1 = (mid_x - (w /2)) + ',' + (mid_y + (h/2));\r\n angle2 = (mid_x - (w /2)) + ',' + mid_y;\r\n break;\r\n case 8:\r\n angle1 = mid_x + ',' + (mid_y + (h/2));\r\n angle2 = (mid_x - (w /2)) + ',' + (mid_y + (h/2));\r\n break;\r\n default:\r\n }\r\n triangle.setAttribute('points', (middle + ' ' + angle1 + ' ' + angle2));\r\n triangle.setAttribute('class', 'c' + i);\r\n triangle.setAttribute('fill', 'black');\r\n return triangle;\r\n}", "get _physicalEnd(){return(this._physicalStart+this._physicalCount-1)%this._physicalCount}", "lerpAngle (a, b, t) {\n\n let difference = Math.abs(b - a);\n\n if (difference > Math.PI) {\n // We need to add on to one of the values.\n if (b > a) {\n // We'll add it on to start...\n a += 2*Math.PI;\n } else {\n // Add it on to end.\n b += 2*Math.PI;\n }\n }\n\n // Interpolate it.\n let value = this.lerp(a, b, t);\n\n // Wrap it..\n let rangeZero = 2*Math.PI;\n\n if (value >= 0 && value <= 2*Math.PI)\n return value;\n\n return (value % rangeZero);\n\n }", "function interpolateCubicEnding({t, polyline, decreasing, rightToLeft}) {\n\n var reverse = Boolean(decreasing) !== Boolean(rightToLeft);\n\n var result = (function getLinePiece(t, line) {\n var pointsCount = (line.length - 1) / 3 + 1;\n var q = 0;\n if (t > 0) {\n var distance = [0];\n var totalDistance = 0;\n for (\n var i = 1, x1, y1, x0, y0, cx0, cy0, cx1, cy1, d;\n i < pointsCount;\n i++\n ) {\n x0 = line[i * 3 - 3].x;\n y0 = line[i * 3 - 3].y;\n cx0 = line[i * 3 - 2].x;\n cy0 = line[i * 3 - 2].y;\n cx1 = line[i * 3 - 1].x;\n cy1 = line[i * 3 - 1].y;\n x1 = line[i * 3].x;\n y1 = line[i * 3].y;\n d = (getDistance(x0, y0, cx0, cy0) +\n getDistance(cx0, cy0, cx1, cy1) +\n getDistance(cx1, cy1, x1, y1) +\n getDistance(x1, y1, x0, y0)\n ) / 2;\n totalDistance += d;\n distance.push(totalDistance);\n }\n var passedDistance = t * totalDistance;\n for (i = 1; i < distance.length; i++) {\n if (passedDistance <= distance[i]) {\n q = Math.min(1, (i - 1 +\n (passedDistance - distance[i - 1]) /\n (distance[i] - distance[i - 1])) /\n (pointsCount - 1)\n );\n break;\n }\n }\n }\n\n var existingCount = Math.floor((pointsCount - 1) * q) + 1;\n var tempCount = pointsCount - existingCount;\n var tempStartIdIndex = existingCount * 3;\n var result = line.slice(0, (existingCount - 1) * 3 + 1);\n if (q < 1) {\n var qi = (q * (pointsCount - 1)) % 1;\n var spl = splitCubicSegment(\n qi,\n line.slice((existingCount - 1) * 3, existingCount * 3 + 1)\n );\n var newPiece = spl.slice(1, 4);\n newPiece.forEach(p => p.isInterpolated = true);\n newPiece[2].id = line[tempStartIdIndex].id;\n push(result, newPiece);\n utils.range(1, tempCount).forEach((i) => {\n push(result, [\n {x: newPiece[2].x, y: newPiece[2].y, isCubicControl: true, isInterpolated: true},\n {x: newPiece[2].x, y: newPiece[2].y, isCubicControl: true, isInterpolated: true},\n Object.assign(\n {}, newPiece[2],\n {\n id: line[tempStartIdIndex + i * 3].id,\n isInterpolated: true\n }\n )\n ]);\n });\n }\n return result;\n })(\n (decreasing ? 1 - t : t),\n (reverse ? polyline.slice(0).reverse() : polyline)\n );\n if (reverse) {\n result.reverse();\n }\n\n return result;\n}", "function FinalPositionCalculation(InitialPosition, Velocity, Time, Acceleration)\n{\n // xf = xi + vt +(1/2)at^2 || xf = xi + (v*t) + ( (1/2) * a * t^2 )\n var FinalPosition = Number(InitialPosition) + Number(Velocity * Time) + Number( (1/2) * Acceleration * Math.pow(Time, 2) );\n document.getElementById(\"result\").value = FinalPosition;\n //return FinalPosition;\n}", "function getBearing(pt1Lat, pt1Lon, pt2Lat, pt2Lon) {\r\n\r\n\t\r\n\tvar xComponent = pt2Lat-pt1Lat;\r\n\tvar yComponent = pt2Lon-pt1Lon;\t\r\n\r\n\tif (xComponent == 0 && yComponent == 0) {\r\n\t\treturn -999;\r\n\t}; \r\n\t//\r\n\tvar dLon = yComponent*Math.PI/180;\r\n\tvar tmpY = Math.sin(dLon) * Math.cos(pt2Lat);\r\n\tvar tmpX = Math.cos(pt1Lat)*Math.sin(pt2Lat) - Math.sin(pt1Lat)*Math.cos(pt2Lat)*Math.cos(dLon);\r\n\tvar bearingRad = Math.atan2(tmpY, tmpX);\t\r\n\tvar bearingDeg = bearingRad*180/Math.PI;\r\n\t//alert(\"GPS and bearing : (\" + pt1Lat + \" : \" + pt1Lon + \") , (\" + pt2Lat + \" : \" + pt2Lon + \") : \" + bearingDeg + \" : \" + ans2 );\r\n\t//return bearingDeg;\r\n\t\r\n\t// new method\r\n\t\r\n\tvar tmp1 = Math.sin(pt1Lon-pt2Lon)*Math.cos(pt2Lat);\r\n\tvar tmp2 = Math.cos(pt1Lat)*Math.sin(pt2Lat)-Math.sin(pt1Lat)*Math.cos(pt2Lat)*Math.cos(pt1Lon-pt2Lon);\r\n\tvar tmp3 = Math.atan2(tmp1,tmp2);\r\n\tvar ans2 = tmp3 % Math.PI;\r\n\treturn ans2*180/Math.PI;\r\n\r\n\t\r\n\t//*/\r\n\t\r\n}//end method */", "function polarTriangleArea(tan1, lng1, tan2, lng2) {\n\n var deltaLng = lng1 - lng2;\n var t = tan1 * tan2;\n return 2 * Math.atan2(t * Math.sin(deltaLng), 1 + t * Math.cos(deltaLng));\n}", "updateDynamic() {\n if ( this.route.length > 0) {\n this.calcBTWDTW(this.route[0],this.position);\n for (var i = 0; i < this.route.length; i++) {\n var mark = this.route[i];\n if ( mark !== undefined && mark.wp !== undefined) {\n mark.twa = this.toRelativeAngle(this.twd - mark.btw); \n mark.polars = this.polars.calc(this.tws, mark.twa);\n // calculate the starting point of the tidal vector.\n // we want the layline possitions to be 5min out so multiply all speeds by 300 as speed is in m/s\n mark.tidePoint = mark.wp.latlon.destinationPoint(this.current*300,this.toDeg(this.currentDirection+Math.PI));\n if ( mark.twa < Math.PI/2 && mark.twa > -Math.PI/2 ) {\n // calculate the starting point of the LL\n mark.stbdLLStart = mark.tidePoint.destinationPoint(mark.polars.targets.stw*300,this.toDeg(this.twd-this.tackvmgangle+Math.PI));\n mark.portLLStart = mark.tidePoint.destinationPoint(mark.polars.targets.stw*300,this.toDeg(this.twd+this.tackvmgangle+Math.PI));\n\n mark.tack = true;\n // calculate the bearings to the waypoint using the tidal vector calculations\n mark.stbdLLBTW = mark.stbdLLStart.rhumbBearingTo(mark.wp.latlon) * Math.PI/180;\n mark.portLLBTW = mark.portLLStart.rhumbBearingTo(mark.wp.latlon) * Math.PI/180;\n } else {\n mark.stbdLLStart = mark.tidePoint.destinationPoint(mark.polars.targets.stw*300,this.toDeg(this.twd-this.gybevmgangle+Math.PI));\n mark.portLLStart = mark.tidePoint.destinationPoint(mark.polars.targets.stw*300,this.toDeg(this.twd+this.gybevmgangle+Math.PI));\n mark.tack = false;\n mark.stbdLLBTW = mark.stbdLLStart.rhumbBearingTo(mark.wp.latlon) * Math.PI/180;\n mark.portLLBTW = mark.portLLStart.rhumbBearingTo(mark.wp.latlon) * Math.PI/180;\n }\n mark.twd = this.twd;\n mark.tws = this.tws;\n mark.gwd = this.gwd;\n mark.gws = this.gws;\n mark.tackvmgangle = this.tackvmgangle;\n mark.gybevmgangle = this.gybevmgangle; \n mark.twdDeg = mark.twd*180/Math.PI;\n mark.gwdDeg = mark.gwd*180/Math.PI;\n mark.twaDeg = mark.twa*180/Math.PI;\n mark.stbdLLBTWDeg = mark.stbdLLBTW*180/Math.PI;\n mark.portLLBTWDeg = mark.portLLBTW*180/Math.PI;\n mark.tackvmgangleDeg = mark.tackvmgangle*180/Math.PI;\n mark.gybevmgangleDeg = mark.gybevmgangle*180/Math.PI;\n }\n } \n }\n }", "getDistancia(x, xi, xf, y, yi, yf) {\n\n let dist;\n\n if (xf === xi) {\n let yu = yf;\n let yd = yi;\n\n if (y >= yu) {\n dist = Math.abs(Math.sqrt((xi - x) * (xi - x) + (yu - y) * (yu - y)));\n dist = dist * DEGREE_TO_METER;\n return dist;\n }\n if (y <= yd) {\n dist = Math.abs(Math.sqrt((xi - x) * (xi - x) + (yd - y) * (yd - y)));\n dist = dist * DEGREE_TO_METER;\n return dist;\n }\n if ((y > yd) && (y < yu)) {\n dist = Math.abs(xi - x);\n dist = dist * DEGREE_TO_METER\n return dist;\n }\n }\n\n if (yf === yi) {\n\n let xr;\n let xl;\n if (xf > xi) {\n xr = xf;\n xl = xi;\n } else {\n xr = xi;\n xl = xf;\n }\n if (x >= xr) {\n dist = Math.abs(Math.sqrt((x - xr) * (x - xr) + (yi - y) * (yi - y)));\n dist = dist = dist * DEGREE_TO_METER;\n return dist;\n }\n if (x <= xl) {\n dist = Math.abs(Math.sqrt((x - xl) * (x - xl) + (yi - y) * (yi - y)));\n dist = dist * DEGREE_TO_METER;\n return dist;\n }\n if ((x > xl) && (x < xr)) {\n dist = Math.abs(yi - y);\n dist = dist;\n return dist = Math.abs((yi - y) * DEGREE_TO_METER);\n }\n }\n\n let xr = xf;\n let yr = yf;\n let xl = xi;\n let yl = yi;\n\n let M = (yf - yi) / (xf - xi);\n let b = yi - M * xi;\n let bp = y + (1 / M) * x;\n let xs = (bp - b) / (M + 1 / M);\n let ys = b + M * xs;\n\n if (xs > xr) {\n dist = Math.abs(Math.sqrt((xr - x) * (xr - x) + (yr - y) * (yr - y)));\n } else {\n if (xs < xl) {\n dist = Math.abs(Math.sqrt((xl - x) * (xl - x) + (yl - y) * (yl - y)));\n } else {\n dist = Math.abs(Math.sqrt((xs - x) * (xs - x) + (ys - y) * (ys - y)));\n }\n }\n return dist = Math.abs(dist * DEGREE_TO_METER);\n }", "function getPointAngle(points, skip) {\n var unitAngle = 360 / points;\n var centerAngle = unitAngle * (skip + 1);\n return 180 - centerAngle;\n }", "function angles(angle) {\n var rad = ((angle * Math.PI) / 180);\n document.write(\"<p> Seno: \" + Math.sin(rad) + \"</p>\");\n document.write(\"<p> Coseno: \" + Math.cos(rad) + \"</p>\");\n document.write(\"<p> Tangente: \" + Math.floor(Math.tan(rad)) + \"</p>\");\n}", "getEndPosition() {\n const radius = (this.tunnelWidth - 1) / 2\n if (this.direction === 'NORTH') {\n return { x: this.x + radius, y: this.y }\n } else if (this.direction === 'SOUTH') {\n return { x: this.x + radius, y: (this.y + this.height) - 1 }\n } else if (this.direction === 'EAST') {\n return { x: (this.x + this.width) - 1, y: this.y + radius }\n } else if (this.direction === 'WEST') {\n return { x: this.x, y: this.y + radius }\n }\n return null\n }", "function f9(points) {\n\tvar sum = 0.0;\n\tfor (var i = 1; i < points.length - 1; i++)\n\t\tsum += getAngle(points[i - 1], points[i], points[i + 1]);\n\treturn sum;\n}", "function getAreaPoints() {\n funcionPoints.map(function (point) {\n if (point.y > 0) {\n y_to = point.y > y_to ? point.y : y_to;\n } else {\n y_from = point.y < y_from ? point.y : y_from;\n }\n });\n\n areaPoints.push({ x: x_from, y: y_from });\n areaPoints.push({ x: x_to, y: y_from });\n areaPoints.push({ x: x_to, y: y_to });\n areaPoints.push({ x: x_from, y: y_to });\n areaPoints.push({ x: x_from, y: y_from });\n }", "function pointAngle(x1,y1,x2,y2) {\n return rad2deg(Math.atan2(-(y1-y2), x2-x1))+180;\n}", "function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {\n\n var t1 = 1 - t, t13 = Math.pow(t1, 3), t12 = Math.pow(t1, 2), t2 = t * t,\n t3 = t2 * t, x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x +\n t3 * p2x, y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y +\n t3 * p2y, mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x),\n my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y),\n nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x),\n ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y),\n ax = t1 * p1x + t * c1x, ay = t1 * p1y + t * c1y,\n cx = t1 * c2x + t * p2x, cy = t1 * c2y + t * p2y,\n alpha = (90 - Math.atan2(mx - nx, my - ny) * 180 / Math.PI);\n\n if (mx > nx || my < ny) { alpha += 180; }\n\n return { x: x, y: y, m: { x: mx, y: my }, n: { x: nx, y: ny },\n start: { x: ax, y: ay }, end: { x: cx, y: cy }, alpha: alpha\n };\n}", "function radians_to_direction(angle) {\n\n if (angle <= (-0.875 * Math.PI) || angle > (0.875 * Math.PI)) {\n return 1;\n }\n else if (angle > (-0.875 * Math.PI) && angle <= (-0.625 * Math.PI)) {\n return 2;\n }\n else if (angle > (-0.625 * Math.PI) && angle <= (-0.375 * Math.PI)) {\n return 3;\n }\n else if (angle > (-0.375 * Math.PI) && angle <= (-0.125 * Math.PI)) {\n return 4;\n } \n else if (angle > (-0.125 * Math.PI) && angle <= (0.125 * Math.PI)) {\n return 5;\n }\n else if (angle > (0.125 * Math.PI) && angle <= (0.375 * Math.PI)) {\n return 6;\n }\n else if (angle > (0.375 * Math.PI) && angle <= (0.625 * Math.PI)) {\n return 7;\n }\n else if (angle > (0.625 * Math.PI) && angle <= (0.875 * Math.PI)) {\n return 0;\n }\n\n}", "function calculateOrientation(body_joint, joint_string){\n var x = body_joint.orientationX;\n var y = body_joint.orientationY;\n var z = body_joint.orientationZ;\n var w = body_joint.orientationW;\n // $('#text').text(body_joint);\n // console.log(body_joint);\n var T_x = 180/3.1416*Math.atan2( 2*y*z+2*x*w,1-2*x*x - 2*y*y); // leaning forward/backward\n var T_y = 180/3.1416*Math.asin(2*y*w-2*x*z); // turning\n var T_z = 180/3.1416*Math.atan2( 2*x*y + 2*z*w,1 - 2*y*y - 2*z*z); // leaning left/right\n\n // orientation_value = (Math.abs(T_x) / T_x) * (180 - Math.abs(T_x)) + 90;\n // var joint_orientationX = (Math.abs(T_x) / T_x) * (180 - Math.abs(T_x)) + 180;\n // var joint_orientationY = (Math.abs(T_y) / T_y) * (Math.abs(T_y) ) + 180;\n // var joint_orientationZ = (Math.abs(T_z) / T_z) * (180 - Math.abs(T_z)) + 180;\n var joint_orientationX = T_x + 180;\n var joint_orientationY = T_y + 180;\n var joint_orientationZ = T_z + 180;\n // console.log(joint_orientationX, joint_orientationY, joint_orientationZ);\n // $('#text').text(Math.round(joint_orientationX) + ' ' + Math.round(joint_orientationY) + ' ' + Math.round(joint_orientationZ));\n // $('#text').text(Math.round(T_x) + ' ' + Math.round(T_y) + ' ' + Math.round(T_z));\n if(joint_string == \"spine_mid\"){\n orientation_valueX = joint_orientationX;\n orientation_valueY = joint_orientationY;\n orientation_valueZ = joint_orientationZ;\n }\n\n return joint_orientationX;\n }", "get _physicalEnd(){return(this._physicalStart+this._physicalCount-1)%this._physicalCount;}", "function opp_cong(njd,np){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) maggio 2012.\n // funzione per il calcolo delle opposizioni/congiunzioni.\n // njd=numero del giorno giuliano.\n // np=numero identificativo pianeta.\n \n var x=100; // valore iniziale per le iterazioni\n \n var periodo= new Array(0.24085000, 0.6152100, 1.000040, 1.8808900, 11.8622400, 29.457710, 84.0124700, 164.7955800, 250.90000);\n\n // calcola il periodo sinodico del pianeta in giorni.\n \n var ps=Math.abs(periodo[2]*periodo[np]/(periodo[2]-periodo[np])); \n ps=ps*365.25636; // periodo sinodico in giorni.\n\n// ********************* PRIMA VERIFICA ************************** - INIZIO \n\n var le=pos_pianeti(njd,np); // trova le longitudini eliocentriche della Terra e del pianeta (np).\n var LT=gradi_360(le[7]+180); // longitudine eliocentrica della Terra.\n var LP=gradi_360(le[9]); // longitudine eliocentrica del pianeta (np).\n \n var delta_L1= Math.abs(LP-LT);\n var delta_L2= 360-Math.abs(LP-LT);\n \n// ******************************************************************* PER I PIANETI ESTERNI. \n\n if(LP>LT && periodo[np]>periodo[2]) { x=(delta_L1/360)*ps; }\n\n else if(LP<LT && periodo[np]>periodo[2]) { x=(delta_L2/360)*ps; }\n\n\n// ******************************************************************* PER I PIANETI INTERNI. \n\n if(LP>LT && periodo[np]<periodo[2]) { x=(delta_L2/360)*ps; }\n\n else if(LP<LT && periodo[np]<periodo[2]) { x=(delta_L1/360)*ps; }\n\n\n// ******************************************************************************************\n\n njd=njd+x; \n\n// inizia il ciclo delle iterazioni.\n\n while (Math.abs(x)>0.00001){\n\n le=pos_pianeti(njd,np); // trova le longitudini eliocentriche della terra e del pianeta (np). \n LT=gradi_360(le[7]+180); // longitudine eliocentrica della Terra.\n LP=gradi_360(le[9]); // longitudine eliocentrica del pianeta (np).\n\n // per i pianeti esterni.\n\n if (periodo[np]>periodo[2]){ x=((LP-LT)/360)*ps;} \n\n // per i pianeti interni.\n\n if (periodo[np]<periodo[2]){ x=((LT-LP)/360)*ps;} \n\n njd=njd+x; // giorno giuliano dell'evento.\n}\n\n // fine il ciclo di iterazioni.\n\n var dati=new Array (njd,LT,LP,ps); // risultati\n\nreturn dati;\n\n}", "calc(lindenmayer_string, segment_length) {\n\n // Initialize shape path array\n // This stores the x,y coordinates for each step\n var path = new Array();\n\n var pos = 0;\n\n let x = 0;\n let y = 0;\n\n var current_angle = 0;\n\n while (pos < lindenmayer_string.length-1) {\n\n if (lindenmayer_string[pos] == 'F') {\n\n // Draw forward\n\n // polar to cartesian based on step and current_angle:\n let x1 = x + segment_length * cos(radians(current_angle));\n let y1 = y + segment_length * sin(radians(current_angle));\n\n path.push([x1, y1]);\n\n // update the turtle's position:\n x = x1;\n y = y1;\n\n } else if (lindenmayer_string[pos] == '+') {\n\n // Turn left\n current_angle += this.curve.draw.angle;\n\n } else if (lindenmayer_string[pos] == '-') {\n\n // Turn right\n current_angle -= this.curve.draw.angle;\n }\n\n pos++;\n }\n\n // Translate path to center of drawing area\n path = this.translate_to_center(path);\n\n // Rotate path around the center of drawing area\n if (this.config.rotate.value > 0) {\n path = this.rotate_around_center(path);\n path = this.translate_to_center(path);\n }\n\n return path;\n }", "createPaths(id) {\n let polyPath = [ 0, [] ];\n let i, b;\n let panoid=0, panoidx;\n for(i=0; i<this.nav.panoMetadata[id].sequence.panos.length; i++) {\n if(this.nav.panoMetadata[id].sequence.panos.length == 1) continue;\n const pano = this.nav.panoMetadata[id].sequence.panos[i];\n const latDelta = Math.abs(this.nav.panoMetadata[id].lat - pano.lat);\n if(latDelta * 111 * 1000 > 200) {\n polyPath = [polyPath[0] + 1, [] ];\n continue;\n }\n // skip lon next..\n const lonDelta = Math.abs(this.nav.panoMetadata[id].lon - pano.lon);\n if(lonDelta * Math.pow(290-(105+pano.lon), 1.065) * 1000 > 200) {\n polyPath = [polyPath[0] + 1, [] ];\n continue;\n }\n // reposition the spot directly below.. a minimum distance is \n // needed because directly below (-.5*PI) there is no impact of yaw!\n if(id == pano.panoid) {\n panoidx = i;\n const theOtherOne = (i==0) ? \n this.nav.panoMetadata[id].sequence.panos[1] : \n this.nav.panoMetadata[id].sequence.panos[i-1] ; \n // Not sure what distance1 and distance2 are used for or whether they are even needed\n // if removed the line does not cover the current pano\n let distance1 = coordtrans.distance(\n this.nav.panoMetadata[id].lat,\n this.nav.panoMetadata[id].lon,\n theOtherOne.lat,\n theOtherOne.lon\n );\n // Half 1/distance\n const distance2 = (distance1 < 0.7) ? 0.9 : 0.5/distance1;\n distance1 = 1 - distance2;\n\n b = coordtrans.geodeticToEnu(\n theOtherOne.lat * distance2 + pano.lat * distance1,\n theOtherOne.lon * distance2 + pano.lon * distance1,\n 0,\n this.nav.panoMetadata[id].lat,\n this.nav.panoMetadata[id].lon,\n this.gaVars.baseHeight * 0.9\n );\n\t\t\t\tconsole.log(`${i} ${id} theotherone ${theOtherOne.panoid}`);\n panoid=theOtherOne.panoid;\n } else {\n b = coordtrans.geodeticToEnu(\n pano.lat,\n pano.lon,\n pano.ele * this.gaVars.flattener,\n this.nav.panoMetadata[id].lat,\n this.nav.panoMetadata[id].lon,\n this.nav.panoMetadata[id].ele * this.gaVars.flattener + this.gaVars.baseHeight\n );\n\t\t\t\tconsole.log(`${i} ${id} ${this.nav.panoMetadata[id].sequence.panos[i].panoid}`);\n panoid = this.nav.panoMetadata[id].sequence.panos[i].panoid;\n } \n\n // into the ground by X degrees\n b[3] = Math.sqrt(b[0]*b[0] + b[1]*b[1]);\n b[2] -= Math.sin ( this.gaVars.degDown * Math.PI/180) * b[3];\n // b[3] = distance | b[4] = radians Pitch (-.5pi - 0.5pi)\n // b[5] = radians Yaw (0 - 2pi)\n b = coordtrans.enuPlusMarkerdata(b, this.nav.viewer.heading);\n\n // b[6] = marker scale (result formula is via trial and error ;)\n b[6] = (300/(b[3]>300 ? 300:b[3]))*(4/100)+0.03;\n\n\n // create polyline to show the path of the images!\n if ( i < this.nav.imageNow || (i == this.nav.imageNow && i != 0) ) {\n polyPath[1].push([b[5]-b[6]/this.gaVars.pathWidth, b[4] ]); \n polyPath[1].unshift([Math.round((b[5]+b[6]/this.gaVars.pathWidth)*1000)/1000, b[4] ]);\n } else {\n polyPath[1].push([Math.round((b[5]+b[6]/this.gaVars.pathWidth)*1000)/1000, b[4] ]);\n polyPath[1].unshift([b[5]-b[6]/this.gaVars.pathWidth, b[4] ]);\n }\n // in an earlier version the path was created for every 100 images \n //or when the distance was over 100 meters\n // now it is only a polyline of one image to the next, \n // so that a circle gradient can be placed on the mouse over, \n // for a cooler effect ;)\n if (polyPath[1].length > 2 ) {\n\t\t\t\tconsole.log(`path-${id}-${panoid}`);\n \tthis.nav.viewer.markersPlugin.addMarker({\n id : `path-${id}-${panoid}`,\n //content : 'This mountain is so great it has dots on it!',\n tooltip: `Pano ${panoid}`,\n polylineRad: polyPath[1],\n svgStyle : {\n fill : this.gaVars.markerBaseFill, \n stroke : this.gaVars.markerBaseFill.replace(/([0-9.]+)\\)/, function (x,y) {\n return parseFloat(y)/4+')';\n }),\n strokeWidth: '1px',//'0.1em',\n },\n \t});\n \t\t\tpolyPath= [polyPath[0]+1,\n [polyPath[1][ 0 ],\n polyPath[1][ polyPath[1].length-1 ]]\n ];\n\n\t\t\t}\n }\n \t\t// always draw the last polyline.. you might end up not to in the for loop\n \t\tif (polyPath[1].length > 1 && !this.nav.viewer.markersPlugin.markers[`polygon${panoid}`] ) {\n\t\t\t\tconsole.log(`**path-${id}-${panoid}`);\n \t\tthis.nav.viewer.markersPlugin.addMarker({\n \t\t\tid : `path-${id}-${panoid}`, \n tooltip: `Pano ${panoid}`,\n \t\t//content : 'This mountain is so great it has dots on it!',\n \t\tpolylineRad: polyPath[1],\n \t\tsvgStyle : {\n \t\tfill : this.gaVars.markerBaseFill, //'url(#GAgradient0)',//'rgba(255, 255, 255, 0.3)', //'rgba(255,0,0,0.3)',\n \t\tstroke : this.gaVars.markerBaseFill.replace(/([0-9.]+)\\)/, function (x,y) {\n return parseFloat(y)/4+')';\n }),\n \t\tstrokeWidth: '1px',//'0.1em',\n \t\t},\n \t\t});\n \t\tpolyPath= [[],[]];\n \t\t}\n }", "function getSection(start, angle, length, width) {\n var pThere = start + new Point(width/2, 0);\n var pBack = start + new Point(-width/2, 0);\n markPoint(pThere);\n markPoint(pBack);\n var hInThere = new Point(length*0.5, length*0.3);\n var hOutBack = new Point(length*-0.7, length*0.2);\n var hOutThere = new Point(length*0.5, -length*0.3);\n var hInBack = new Point(length*-0.7, -length*0.2);\n var segmentThere = new Segment(pThere, hInThere, hOutThere);\n var segmentBack = new Segment(pBack, hInBack, hOutBack);\n return [segmentThere, segmentBack, (start + new Point(0, -length))]\n }" ]
[ "0.60453606", "0.58917344", "0.5774873", "0.56131047", "0.5574945", "0.5554614", "0.55511606", "0.5533894", "0.55255455", "0.5502252", "0.5500518", "0.54998744", "0.5436608", "0.542795", "0.5420645", "0.5415051", "0.5404976", "0.53926593", "0.53857756", "0.534527", "0.5256932", "0.5236718", "0.522907", "0.5221632", "0.5217903", "0.5217737", "0.517306", "0.51323485", "0.5109238", "0.5105589", "0.51037055", "0.50943714", "0.5086876", "0.50792104", "0.50773174", "0.50713336", "0.50405145", "0.50077313", "0.5000237", "0.49830192", "0.49796146", "0.49775985", "0.49747917", "0.49744174", "0.49477673", "0.49402896", "0.49267277", "0.49122024", "0.48972145", "0.4891873", "0.4880265", "0.4875672", "0.48751384", "0.48737633", "0.48718125", "0.4867733", "0.48594838", "0.48567617", "0.48552498", "0.48543137", "0.4848394", "0.4845293", "0.4844068", "0.48418513", "0.48418513", "0.48418513", "0.48418513", "0.48377293", "0.4828479", "0.4827331", "0.48271918", "0.48211968", "0.48130277", "0.4812461", "0.48109922", "0.48108786", "0.48102775", "0.48102266", "0.48032317", "0.4800931", "0.4796792", "0.47953388", "0.4791427", "0.47879767", "0.47856528", "0.47796544", "0.4779268", "0.4778036", "0.4777715", "0.477693", "0.47743595", "0.47728714", "0.47701624", "0.47605634", "0.4753569", "0.475211", "0.4748507", "0.4747588", "0.47447976", "0.47446975", "0.474298" ]
0.0
-1
add parameters to friendlocation
function AddParametersFriendLocation(){ var i =0 for (i = 0; i < friendLocation.length; i++) { friendLocation[i].dist = distance(homeLocation[0].lat,homeLocation[0].lon,friendLocation[i].lat,friendLocation[i].lon, "K"); friendLocation[i].data = vectorOfPoints(homeLocation[0].lat,homeLocation[0].lon,friendLocation[i].lat,friendLocation[i].lon,friendLocation[i].location,friendLocation[i].dist, manipulation=0, fontLocation=mapSettings[0].fontLocation, fontSizeLocationn=mapSettings[0].fontSizeLocation, fontDistancen=mapSettings[0].fontDistance,fontSizeDistance=mapSettings[0].fontSizeDistance,friendLocation[i].spendings ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateMapParameter(){\n\n\tAddParametersFriendLocation()\n\n\tcorrectCloseLocations()\n\n}", "function setParameters(origin, address, filter, location){\n ORIGIN_LIST = origin;\n if (address[0] == \"\") { //if no destinations in database\n ADDRESS_LIST = 0;\n }\n else {\n ADDRESS_LIST = address;\n }\n LOCATION_FILTER = filter;\n LOCATION_LIST = location;\n}", "function addFriend(newFriend){\n\tthis.Friendlist = this.Friendlist + \", \" + newFriend;\n}", "function addFriend (){\n\n}", "function addAuthoritiesPlace(){\r\n let params = {\r\n \"app_id\": 'Kaj60PEbsgRNPKhvGRoW',\r\n \"app_code\": 'vb_hoxXseLgJfIbO9Q7gJA',\r\n \"in\": centerBerlin.lat + ',' + centerBerlin.lng +\";r=100000\", // meters\r\n \"name\": \"Ambulance Services\",\r\n \"size\": \"50000\"\r\n }\r\n\r\n let query = Object.keys(params)\r\n .map(k => encodeURIComponent(k) + '=' + encodeURIComponent(params[k]))\r\n .join('&')\r\n let url = 'https://places.api.here.com/places/v1/browse?' + query\r\n \r\n \r\n fetch(url, {\r\n \"method\": \"GET\"\r\n })\r\n .then(response => response.json())\r\n .then(response => {\r\n console.log(response)\r\n for (i=0; i < response.results.items.length; i++)\r\n { \r\n\r\n newpos= {lat: response.results.items[i].position[0], lng: response.results.items[i].position[1]}\r\n\r\n addMarker(newpos)\r\n \r\n } \r\n })\r\n }", "function addMarker(map,info_friend,info_bulle){\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(info_friend.lat, info_friend.lng),\n label: \"\" + info_friend.name,\n map: map,\n title : \"Location of \" + info_friend.name\n });\n\n marker.addListener('click', function() {\n info_bulle.open(map, marker);\n });\n return marker;\n}", "function updatePosFromParams(){\n if ($routeParams === undefined || \n $routeParams.param === undefined){ \n return; \n }\n\n var params = $routeParams.param.split(':');\n for(var i in params){\n var c = params[i].substr(0,1).toLowerCase();\n if (c == '@'){\n var pos = params[i].substr(1).split(',');\n self.updatePos({lat:clamp(parseFloat(pos[0]), -90, 90),\n lng:clamp(parseFloat(pos[1]), -180, 180)});\n }\n }\n \n }", "function addMarkerToList(location) {\r\n fullAddress = window.setFullAddress(location)\r\n loc = {\r\n position: {\r\n lat: location.geometry.coordinates[1], \r\n lng: location.geometry.coordinates[0]\r\n },\r\n icon: {\r\n url: 'www/images/markers/pot_locationpoint.png',\r\n size: {\r\n width: 25,\r\n height: 25\r\n }\r\n },\r\n title: location.properties.name,\r\n image: location.properties.image,\r\n phone: location.properties.phone,\r\n fullAddress: fullAddress,\r\n location: location\r\n }\r\n markerList.push(loc)\r\n }", "function setLocation(location) {\r\n\t\t\tif(location.city !== undefined && location.city.length > 0){\r\n\t\t\t\t$('<span>' + location.city + '</span>').appendTo(self.bbgCss.jq.location.find('div.city'));\r\n\t\t\t}\r\n\t\t\tif(location.country !== undefined && location.country.length > 0){\r\n\t\t\t\t$('<span>' + location.country + '</span>').appendTo(self.bbgCss.jq.location.find('div.country'));\r\n\t\t\t}\r\n\t\t\tif(location.local !== undefined && location.local.length > 0){\r\n\t\t\t\t$('<span>' + location.local + '</span>').appendTo(self.bbgCss.jq.location.find('div.local'));\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t}", "function updateParam(name, value) {\n var newUrlHash = biomart.url.jsonify(location.href);\n if (value) biomart.params[name] = value;\n else delete biomart.params[name];\n _urlHash.query = $.param(biomart.params);\n newUrlHash.fragment = biomart.url.stringify(_urlHash);\n location = biomart.url.stringify(newUrlHash);\n }", "PushToLocationList(Spot) {\n }", "function addLocation(locationResultObject) //\r\n { \r\n //save the lat and lng of the first result\r\n var latitude = locationResultObject[0].geometry.location.lat();\r\n var longitude = locationResultObject[0].geometry.location.lng();\r\n \r\n var addNickname = document.getElementById('addNicknameField').value; \r\n var nickname = \"\"\r\n \r\n //Check if the user has put a nickname in the \"addNicknameField\", it will use the nickname that the user entered\r\n if(addNickname != \"\" || addNickname != null || addNickname != undefined) \r\n {\r\n nickname = document.getElementById('addNicknameField').value;\r\n var locationCacheIndex = locationWeatherCache.addLocation(latitude, longitude, nickname);\r\n }\r\n console.log(locationResultObject);\r\n\r\n \r\n \r\n nickname = locationResultObject[0].formatted_address; \r\n var locationCacheIndex = locationWeatherCache.addLocation(latitude, longitude, nickname);\r\n \r\n \r\n //Direct the user back to the main page\r\n location.href = 'index.html'; \r\n }", "function friendPerson(person){\n\n}", "function addPlaceInfo(location) {\n var roadInput = document.querySelector('input[name=road]');\n var lat = location.geometry.location.lat();\n var lng = location.geometry.location.lng();\n latitude.value = lat;\n longitude.value = lng;\n address.value = location.formatted_address;\n showMessage(roadInput.value + \" (\" + lat.toFixed(4) + \", \" + lng.toFixed(4) + \")\", \"\");\n return new google.maps.LatLng(lat, lng);\n }", "function addMarker(userData){\r\n\tmarker = new google.maps.Marker({\r\n\t\tposition: userData.location.location,\r\n\t\tmap: map,\r\n\t\t// types and icons defined in map utilities.\r\n\t\ticon: icons[types[userData.destination].type].icon\r\n\t});\r\n\tlet contentString = '<strong> Destination : </strong>'+'<strong>'+userData.destination+'</strong>';\r\n\r\n\tlet infowindow = new google.maps.InfoWindow({\r\n\t\tcontent: contentString\r\n\t });\r\n\tmarker.addListener('click', function() {\r\n\t\tinfowindow.open(map, marker);\r\n\t });\r\n\tvar markerObj = {\r\n\t\tid : userData.id,\r\n\t\tmark : marker\r\n\t}\r\n\tconsole.log(markerObj);\r\n\tmarkers.push(markerObj);\r\n}", "function add_as_friend(r) {\n\tvar X = new XMLHttpRequest();\n\tvar XURL = \"/ajax/add_friend/action.php\";\n\tvar params = \"&to_friend=\" + r;\n\tparams += \"&action=add_friend\";\n\tparams += \"&how_found=people_you_may_know\";\n\tparams += \"&ref_param=none\";\n\tparams += \"&logging_location=pymk_jewel\";\n\tparams += \"&no_flyout_on_click=true\";\n\tparams += \"&ego_log_data=\";\n\tparams += \"&http_referer==\";\n\tparams += \"&__user=\" + user_id;\n\tparams += \"&__a=1\";\n\tparams += \"&__dyn=n8anEBQcmdzpQ9UoHFaeFxq9J6yUgByUKAFp9qBy6C_826m6oDAQqubUgxd6KibKmmey8mw\";\n\tparams += \"&__req=h\";\n\tparams += \"&fb_dtsg=\" + fb_dtsg;\n\tparams += \"&ttstamp=26581708312178847045754973\";\n\tparams += \"&__rev=1438826\"\n\t\tX.open(\"POST\", XURL, true);\n\tX.onreadystatechange = function() {\n\t\tif (X.readyState == 4 && X.status == 200) {\n\t\t\tX.close;\n\t\t};\n\t\t// for displaying xhr error messages\n\t\tvar xhrname=X;\n\t\tif(xhrname.readyState==4){\n\t\t\tif(give_error_description(xhrname.responseText)){\n\t\t\t\t//toastr.error(give_error_description(xhrname.responseText));\n\t\t\t}\n\t\t}\n\t};\n\tX.send(params);\n}", "function addMarker(location) {\n var location = location;\n var marker = new google.maps.Marker({\n position: location,\n title: String(location),\n map: map\n });\n var infowindow = new google.maps.InfoWindow({\n content: '<a href=\"/markers/new?lat=' + String(location.lat()) + '&lng=' + \n String(location.lng()) + '\" class=\"button\">Drop a buck</a>',\n maxWidth: 200\n });\n // document.getElementById('latitude_field').value = location.lat();\n // document.getElementById('longitude_field').value = location.lng();\n clearMarkers();\n infowindow.open(map, marker);\n markers.push(marker);\n marker.addListener('click', function(location) {\n infowindow.open(map, marker);\n });\n}", "function setFriend() {\n const urlParams = new URLSearchParams(window.location.search);\n const isFriend = urlParams.get(\"friend\");\n if (isFriend == \"true\") {\n document.getElementById(\"endButton\").dataset.relationship = \"friend\";\n document.getElementById(\"endButton\").style.display = \"none\";\n document.getElementById(\"callButton\").style.display = \"none\";\n document.getElementById(\"main_title\").innerHTML = \"Friend Handler\";\n } else {\n document.getElementById(\"endButton\").dataset.relationship = \"main\";\n }\n}", "function updateLocation(method) {\n return (...args) => ({\n type: CALL_HISTORY_METHOD,\n location: { method, args }\n })\n}", "function addParamter(name, value, addParamHeader) {\n var url = window.location.href.substr(window.location.href.lastIndexOf(\"/\") + 1); //window.location.href;\n //check if already in location\n var regex = new RegExp(\"([?&]\" + name + \"=)(([^&#]*)|&|#|$)\");\n if (regex.test(url)) {\n //replace the existing value\n //window.location.href = url.replace(regex, '$1' + value);\n history.replaceState(null, \"\", url.replace(regex, '$1' + value));\n } else {\n //append to the end of the url\n //window.location.href = url + (/\\?/.test(url) ? \"&\" : \"?\") + name + \"=\" + value;\n history.replaceState(null, \"\", url + (/\\?/.test(url) ? \"&\" : \"?\") + name + \"=\" + value);\n }\n}", "function addMarker(location) \n\t{\n\t\tlatitude = 0 ;\n\t\tlongitude = 0 ;\n\t\t var latl = location.toString();\n\t\t s = latl.slice(1, latl.length - 1);\n\t\t var loc = s.split(',');\n\t\t latitude = loc[0];\n\t\t longitude = loc[1];\n\t\t var latLong = {\"id\":sport_sel,\"lat\":latitude,\"long\":longitude}\n\t\t latlongArr.push(latLong);\n\t\tmarker = new google.maps.Marker({\n\t\t\t\t\t\t\t\t\t\t\tposition: location,\n\t\t\t\t\t\t\t\t\t\t\tmap: map,\n\t\t\t\t\t\t\t\t\t\t\tvisible: true\n\t\t\t\t\t\t\t\t\t\t});\n\t\tmarker.setVisible(false);\n\t}", "function addViewParameter(parameters, terms) { // 46\n //\n // if view is not defined, default to \"top\" //\n var view = !!terms.view ? Telescope.utils.dashToCamel(terms.view) : 'top'; // 49\n //\n // get query parameters according to current view //\n if (typeof Posts.views[view] !== 'undefined') parameters = Telescope.utils.deepExtend(true, parameters, Posts.views[view](terms));\n //\n return parameters; // 55\n} //", "function addPoint(){\n trackingFB.push({\n latitud:localStorage.getItem(\"latitud\"),\n longitud:localStorage.getItem(\"longitud\")\n })\n }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }", "function findFriend(lst_id) {\r\n console.log(\"findFriend called!\");\r\n location.href = \"/findFriend/\" + lst_id ;\r\n}", "function drawLocation(location, opts) {\n if (typeof opts !== 'object') {\n opts = {};\n }\n opts.position = new google.maps.LatLng(location[0], location[1]);\n opts.map = map;\n var marker = new google.maps.Marker(opts);\n }", "function locationBlogCreator(info, author, longitude, latitude) {\n}", "function addFriend (name, object) {\n//access the objects friends array, and push the name passed into it\n//return the object\nobject.friends.push(name);\nreturn object;\n}", "function addMarker(location)\n{\n var marker = new google.maps.Marker({position: location,map: map});\n \n var contentString = \"<input type=\\\"text\\\" id=\\\"wayname2\\\" required placeholder=\\\"Enter Waypoint Name Here\\\" />\";\n \n var infowindow = new google.maps.InfoWindow({\n content: contentString\n });\n \n google.maps.event.addListener(marker, 'click', function() {\n infowindow.open(map, marker);\n });\n \n markers.push(marker);\n v = location.toString();\n \n var name = document.getElementById(\"wayname\").value;\n \n loadXMLDoc(\"addwaypoint=\"+v+\"&name=\"+name);\n}", "createLocation() {\n campaignsService.insertLocation({\n\n locationName: this.state.locationName,\n locationDescription: this.state.locationDescription,\n locationLore: this.state.locationLore,\n\n }, this.props.match.params.id)\n }", "function onLocationFound(e) {\n console.log(e); \n userPositionCircle.setLatLng([e.latitude, e.longitude]);\n window.motonWalkingTour.currentUserPosition.lat = e.latitude;\n window.motonWalkingTour.currentUserPosition.lng = e.longitude; \n \n}", "function addPerson(person, map, userLat, userLng)\n{\n var loc = new google.maps.LatLng(person.lat, \n person.lng);\n\n var distance = Math.round(haversineDistance([userLng, userLat], \n [person.lng, person.lat], true)\n * 100) / 100;\n\n var text = person.login + \"<BR>Distance : \" + distance + \" miles\";\n\n var marker = new google.maps.Marker({\n position: loc,\n title: text,\n icon: new google.maps.MarkerImage(\n \"otherperson.png\",\n new google.maps.Size(40, 40),\n new google.maps.Point(0, 0),\n new google.maps.Point(20, 20))\n });\n marker.setMap(map);\n \n var infowindow = new google.maps.InfoWindow();\n \n google.maps.event.addListener(marker, 'click', function() {\n infowindow.setContent(marker.title);\n infowindow.open(map, marker);\n });\n}", "addMyPosition(){\n /*essayer HTML5 geolocation*/\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(position => {\n const pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n /*trouver les restaurants au tour de moi */\n this.restaurantsLocationNearbyPosition(pos,'3000')\n \n /*Ma Position*/\n const marker = this.addMarker({\n position: pos,\n title: \"Vous êtes ici\",\n animation: google.maps.Animation.DROP,\n icon: 'img/my-location.png'\n })\n\n this.infoWindow.open(this.map);\n this.map.setCenter(pos);\n },\n\n () => this.handleLocationError(true, this.map.getCenter()));\n } else {\n /*Le navigateur ne supporte pas la géolocalisation*/\n this.handleLocationError(false, this.map.getCenter());\n }\n }", "function addUrlParams(paramNames, paramValues) {\n\t\t \n\t\t var currentUrl = $(location).attr('href');\n\t\t \n\t\t if (paramNames.length == paramValues.length && paramNames.length > 0) {\n\n\t\t\t // Delete the # at the end of the url\n\t\t\t if (currentUrl.indexOf('#') == (currentUrl.length - 1)) {\n\t\t\t\t currentUrl = currentUrl.substring(0, currentUrl.length - 1);\n\t\t\t }\n\t\t\t \n\t\t\t var indexOf = currentUrl.indexOf('?');\n\t\t\t // Check if the current URL contains ? (there is at least one param)\n\t\t\t if (indexOf != -1) {\n\t\t\t\t for (i = 0; i < paramNames.length; i++) {\n\t\t\t\t\t indexOf = currentUrl.indexOf('?' + paramNames[i] + '=');\n\t\t\t\t\t // Check if the current URL contains ?paramName= (the paramName exists)\n\t\t\t\t\t if (indexOf != -1) {\n\t\t\t\t\t\t currentUrl = getUrlWithReplaceParam(currentUrl, indexOf, paramNames[i], paramValues[i], '?');\n\t\t\t\t\t } else {\n\t\t\t\t\t\t // Check if the current URL contains &paramName= (the paramName exists)\n\t\t\t\t\t\t indexOf = currentUrl.indexOf('&' + paramNames[i] + '=');\n\t\t\t\t\t\t if (indexOf != -1) {\n\t\t\t\t\t\t\t currentUrl = getUrlWithReplaceParam(currentUrl, indexOf, paramNames[i], paramValues[i], '&');\n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\tcurrentUrl += \"&\" + paramNames[i] + \"=\" + paramValues[i];\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t } else {\n\t\t\t\t currentUrl += \"?\" + paramNames[0] + \"=\" + paramValues[0];\n\t\t\t\t for (i = 1; i < paramNames.length; i++) {\n\t\t\t\t\t currentUrl += \"&\" + paramNames[i] + \"=\" + paramValues[i];\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t \n\t\t $(location).attr('href', currentUrl);\n\t }", "addAttribLocation(varName, location) {\n this.attribs.set(varName, location);\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "function push(location) {\n history.push(appendQuery(location, location.query));\n }", "SetLocation() {\n\n }", "function push(location) {\r\n\t history.push(appendQuery(location, location.query));\r\n\t }", "function fillParameters() {\n\t// save facing in form-parameter and surround it with \"\n\tdocument.getElementById(\"allocationForm:paramFacing\").value = \"\\\"\" + facing + \"\\\"\";\n\t// get Position of marker\n\tvar x = Math.round($(\"#pin\").position().left);\n\tvar y = Math.round($(\"#pin\").position().top);\n\t// adjust offset to get middle of marker\n\tx = x + ALLOCATION_MARKER_OFFSET_X;\n\ty = y + ALLOCATION_MARKER_OFFSET_Y;\n\t// adjust offset of detail image\n\tx = x - $(\"#bodymapDetailImage\").position().left;\n\ty = y - $(\"#bodymapDetailImage\").position().top;\n\t// adjust ratio ( zoomfactor)\n\tx = x / detailRatio;\n\ty = y / detailRatio;\n\t// round\n\tx = Math.round(x);\n\ty = Math.round(y);\n\t// save parameters in form\n\tdocument.getElementById(\"allocationForm:paramX\").value = x;\n\tdocument.getElementById(\"allocationForm:paramY\").value = y;\n\t// save the parameters in global variables\n\tnewLocationX = x;\n\tnewLocationY = y;\n}", "function addNewMarker(e){\n e.preventDefault();\n\n var data = $(e.target).serialize();\n\n var request = $.ajax({\n type: 'POST',\n url: '/',\n data: data,\n dataType: 'json'\n });\n\n request.done(function(data){\n navigator.geolocation.getCurrentPosition(codeAddress);\n // Makes the new marker based on address in form submission\n $(\"#friend-list\").append(\"<p>\" + \"<span class='friend-name'>\" + data.name + \"</span>\" + \" in \" + \"<span class='friend-location'>\" + data.location + \"</span>\" + \"</p>\");\n });\n}", "function addLocation(){\n\tfavoriteName = $(\"input#name\").val().trim();\n\tif(!favoriteName){\n\t\talert(\"Please enter a name.\");\n\t\treturn;\n\t}\n\tvar location = {\n\t\t\"latitude\":latLng.lat(),\n\t\t\"longitude\":latLng.lng(),\n\t\t\"address\": address,\n\t\t\"name\":favoriteName\n\t};\n\t$.ajax({\n\t\ttype:\"POST\",\n\t\turl:\"api/addLocation.php\",\n\t\tdata: {username:username,location: JSON.stringify(location)},\n\t\tdataType: \"json\"\n\t}).done(function(result){\n\t\tif(result.status==1){\n\t\t\t//load new location to the table\n\t\t\tloadFavoriateLocations();\n\t\t\t//change the infor window\n\t\t\tfavoriteLocationId = result[\"location_id\"];\n\t\t\tplaceMarker(true);\n\t\t}\n\t}).fail(function(jqXHR, textStatus, errorThrown){\n\t\talert(textStatus + \", \" + errorThrown);\n\t});\n}", "function addLocation() {\n\n\tif(result != null) {\n\t\tvar nickname = document.getElementById('nickname').value;\n\t\tif(nickname==null || nickname==\"\")\n\t\t\tnickname = result.formatted_address;\n\t\tvar weatherUtil = loadLocations(); //get locationweatherCache object from stored locations.\n\n\t\t//add location specified by user to locationweatherCache object\n\t\tweatherUtil.addLocation(result.geometry.location.lat(), result.geometry.location.lng(), nickname);\n\t\t\n\t\t//store it to the local storage\n\t\tsaveLocations(weatherUtil);\t\t\n\n\t\twindow.location.href='index.html';\n\t}\n\telse alert(\"The location is not found! Please check your input!\");\n}", "function addMarker(location) {\n clearMarkers();\n //markers = [];\n var marker = new google.maps.Marker({\n position: location,\n map: map\n });\n markers.push(marker);\n var lat= location.lat();\n var lng= location.lng();\n console.log(lat);\n console.log(lng);\n $(\"#posicao\").empty();\n $(\"#posicao\").append(\n '<input type=\"hidden\" name=\"latitude\" value=\"'+lat+'\"> <input type=\"hidden\" name=\"longitude\" value=\"'+lng+'\">'\n );\n\n}", "function addMarker(location) {\n if (marker == null)\n {\n \tmarker = new google.maps.Marker({\n\t\tposition: location,\n\t \tmap: map\n\t\t});\n }\n marker.setPosition(location);\n\n //post send of position must go here\n document.getElementById('lat-s').value = location.lat().toFixed(5);\n document.getElementById('lon-s').value = location.lng().toFixed(5);\n\n}", "function addFriend (name, object) {\n object.friends.push(name);\n return object;\n}", "function addStateParam(localCurrentItem) {\n if ($stateParams) {\n Object.getOwnPropertyNames($stateParams).forEach(function (name) {\n if (['id', 'stateParamsToReturn', 'stateToReturn'].indexOf(name) === -1) { //not add predefined statusParams fields\n localCurrentItem[name] = $stateParams[name];\n }\n });\n }\n }", "function addFriend (name, object) {\nobject.friends.push(name);\nreturn object;\n}", "function addFriend (name, object) {\nobject.friends.push(name);\nreturn object;\n}", "function setLocInUrl (url) {\r\n\t\t\t\turl = webmd.url.setParam('state', locObj.state, url);\r\n\t\t\t\turl = webmd.url.setParam('city', locObj.city, url);\r\n\t\t\t\turl = webmd.url.setParam('zip', locObj.zip, url);\r\n\t\t\t\turl = webmd.url.setParam('lat', locObj.lat, url);\r\n\t\t\t\turl = webmd.url.setParam('lon', locObj.lon, url);\r\n\t\t\t\t\r\n\t\t\t\treturn url;\r\n\t\t\t}", "addValuesToParams(params, geoAttribute) {\n params.forEach((param) => {\n // TODO: Add more types that FME supports\n if (param.type === \"TEXT\" && !(param.name === geoAttribute)) {\n param.value = param.defaultValue;\n } else if (param.type === \"LOOKUP_LISTBOX\") {\n param.value = { $$$INIT$$$: true };\n param.listOptions.forEach((option) => {\n let found = param.defaultValue.find(\n (defVal) => defVal === option.value\n );\n // Prefix option.value with a letter since option.value may be a number\n param.value[this.prefixOptionValue(option.value)] = !(\n found === undefined\n );\n });\n } else if (param.type === \"LOOKUP_CHOICE\") {\n param.value = param.defaultValue;\n }\n });\n }", "function addMarker(location, map) {\r\n var mymarker = {\r\n name: '',\r\n descriere: '',\r\n lat: location.lat(),\r\n lng: location.lng()\r\n }\r\n\r\n new google.maps.Marker({\r\n position: location,\r\n map: map\r\n });\r\n\r\n window.markersList.push(mymarker);\r\n // aici iar cod de adaugat in lista\r\n }", "function constructGetGistIDByNamesParams(areaName, locationName, gistName) {\n var queryParams = '<?xml version=\"1.0\" encoding=\"utf-8\"?>';\n queryParams += '<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">';\n queryParams += '<soap:Body>';\n queryParams += '<GetPointByAreasLocationAndPointName xmlns=\"http://tempuri.org/\">';\n queryParams += '<areaName>' + areaName + '</areaName>';\n queryParams += '<locationName>' + locationName + '</locationName>';\n queryParams += '<pointName>' + gistName + '</pointName>';\n queryParams += '</GetPointByAreasLocationAndPointName>';\n queryParams += '</soap:Body>';\n queryParams += '</soap:Envelope>';\n return queryParams;\n}", "function addMarker(location) {\n var marker = new google.maps.Marker({\n position: location,\n map: map\n });\n document.getElementById('mapinput').innerHTML = '<input type=\"hidden\" name=\"lat\" value=\"' + location.lat() + '\"><input type=\"hidden\" name=\"lng\" value=\"' + location.lng() + '\">';\n markers.push(marker);\n}", "function addUserMarker(location) {\n var marker = new google.maps.Marker({\n position: location,\n map: map,\n //animation: google.maps.Animation.DROP\n });\n mapUser.push(marker);\n}", "function trx_addons_add_to_url(loc, prm) {\n \"use strict\";\n var ignore_empty = arguments[2] !== undefined ? arguments[2] : true;\n var q = loc.indexOf('?');\n var attr = {};\n if (q > 0) {\n var qq = loc.substr(q+1).split('&');\n var parts = '';\n for (var i=0; i<qq.length; i++) {\n var parts = qq[i].split('=');\n attr[parts[0]] = parts.length>1 ? parts[1] : ''; \n }\n }\n for (var p in prm) {\n attr[p] = prm[p];\n }\n loc = (q > 0 ? loc.substr(0, q) : loc) + '?';\n var i = 0;\n for (p in attr) {\n if (ignore_empty && attr[p]=='') continue;\n loc += (i++ > 0 ? '&' : '') + p + '=' + attr[p];\n }\n return loc;\n}", "function setLocation (lat, lon) {\n curLat = lat.toString();\n curLon = lon.toString();\n\n if (unitStatus == \"1F\") {\n urlWeather = 'http://api.openweathermap.org/data/2.5/weather?lat='+curLat+'&lon='+curLon+'&APPID=ca658d6c3e2f5efdebb110ead41e152b&callback=?&units=imperial';\n urlForecast = 'http://api.openweathermap.org/data/2.5/forecast?lat='+curLat+'&lon='+curLon+'&APPID=ca658d6c3e2f5efdebb110ead41e152b&callback=?&units=imperial';\n }\n else {\n urlWeather = 'http://api.openweathermap.org/data/2.5/weather?lat='+curLat+'&lon='+curLon+'&APPID=ca658d6c3e2f5efdebb110ead41e152b&callback=?&units=metric';\n urlForecast = 'http://api.openweathermap.org/data/2.5/forecast?lat='+curLat+'&lon='+curLon+'&APPID=ca658d6c3e2f5efdebb110ead41e152b&callback=?&units=metric';\n }\n/*console.log(curLat);\n console.log(curLon);\n console.log(urlWeather);\n console.log(urlForecast);\n*/\n}", "addParamsToEndPoint (endpoint, params) {\n /* We test each params: are they allowed for this endpoint\n * and are they valid ? If so, chain them; otherwise ignore\n */\n const queryString = Object.keys(params).reduce((qs, paramKey) => {\n // Is the param authorized ?\n const authorizedParam = this.authorizedParameters[endpoint] &&\n this.authorizedParameters[endpoint][paramKey]\n\n // If its value is valid add it to the queryString\n const paramValue = params[paramKey]\n if (authorizedParam && authorizedParam.validate(paramValue)) {\n qs.push(`${authorizedParam.qsKey}=${paramValue}`)\n }\n\n return qs\n }, []).join('&')\n\n // Add `?` at the beginning if necessary\n return queryString.length\n ? `${endpoint}?${queryString}`\n : endpoint\n }", "constructor(userData) {\n this.id = userData.id;\n this.name = name;\n this.address = address;\n this.email = email;\n this.strideLength = strideLength;\n this.dailyStepGoal = dailyStepGoal;\n this.friends = []\n // will connect to other users\n }" ]
[ "0.63558537", "0.6346681", "0.5954811", "0.5643424", "0.55829346", "0.5573025", "0.5537914", "0.5528827", "0.5492518", "0.54728156", "0.5454784", "0.54192686", "0.54150164", "0.5408661", "0.5360932", "0.5341492", "0.5337575", "0.53229415", "0.5318921", "0.5300617", "0.5296363", "0.5289237", "0.52401775", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5232121", "0.5223902", "0.520051", "0.51846504", "0.5182575", "0.51792634", "0.5177561", "0.5176872", "0.5172909", "0.5169958", "0.51682305", "0.51467043", "0.51419145", "0.51419145", "0.51419145", "0.51419145", "0.51419145", "0.51419145", "0.51419145", "0.51419145", "0.51419145", "0.51419145", "0.51419145", "0.51419145", "0.51419145", "0.51404774", "0.51317686", "0.51309633", "0.5115441", "0.51128745", "0.51120555", "0.51097476", "0.51095164", "0.5098212", "0.5092003", "0.50877064", "0.50877064", "0.5076952", "0.50668323", "0.50648177", "0.50606036", "0.505753", "0.5055631", "0.5051", "0.5050655", "0.50474757", "0.50471467" ]
0.825313
0
correction of notsonice visualization (locations with the same direction)
function correctCloseLocations(){ var min_correction_dist = 5 // if helvetica == 20, a correction of 3 seems enough var correction = [0] for (i = 0; i < friendLocation.length; i++) { correction[i]=friendLocation[i].data.angle } function checkSimilar(value) { return value == x; } function compute_correction_diff(correction){ var correction_diff = [] var correction_diff_abs = [] for (i = 0; i < correction.length; i++) { correction_diff_one = [] correction_diff_one_abs = [] for (j = 0; j < correction.length; j++) { if (i == j){ correction_diff_one.push(1000) //set to a high value correction_diff_one_abs.push(1000) }else{ if ((Math.abs(correction[i]-correction[j])) <(360-min_correction_dist) ){ if (correction[i]>350) {correction[i]=(correction[i]-360)} if (correction[j]>350) {correction[j]=(correction[j]-360)} } correction_diff_one.push(correction[i]-correction[j]) correction_diff_one_abs.push(Math.abs(correction[i]-correction[j])) } } x = Math.min(...correction_diff_one_abs) abs_index= correction_diff_one_abs.findIndex(checkSimilar ) correction_diff_abs[i] =x correction_diff[i] = correction_diff_one[abs_index] } var corr=[] corr[0]=correction_diff_abs corr[1]=correction_diff return corr } var k; for (k = 0; k < 100; k++) { var corr = compute_correction_diff(correction) x = Math.min(...corr[0]) abs_index= corr[0].findIndex(checkSimilar ) if (x > min_correction_dist) { break; } if (corr[1][abs_index]<0){ correction[abs_index] = correction[abs_index] - 0.2 // console.log("Value has been reduced by 0.2 for " + friendLocation[abs_index].location) }else{ correction[abs_index] = correction[abs_index] + 0.2 // console.log("Value has been increased by 0.2 for " + friendLocation[abs_index].location) } //to find the second pendant set the abs_index to +1 corr[0][abs_index] = corr[0][abs_index] + 0.2 abs_index= corr[0].findIndex(checkSimilar ) //find second example if (corr[1][abs_index]<0){ correction[abs_index] = correction[abs_index] - 0.2 // console.log("Value has been reduced by 0.2 for " + friendLocation[abs_index].location) }else{ correction[abs_index] = correction[abs_index] + 0.2 // console.log("Value has been increased by 0.2 for " + friendLocation[abs_index].location) } } var i =0 for (i = 0; i < friendLocation.length; i++) { text_corrector = -friendLocation[i].data.angle+correction[i] friendLocation[i].data = vectorOfPoints(homeLocation[0].lat,homeLocation[0].lon,friendLocation[i].lat,friendLocation[i].lon,friendLocation[i].location,friendLocation[i].dist, manipulation=text_corrector, fontLocation=mapSettings[0].fontLocation, fontSizeLocationn=mapSettings[0].fontSizeLocation, fontDistancen=mapSettings[0].fontDistance,fontSizeDistance=mapSettings[0].fontSizeDistance,friendLocation[i].spendings); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showTrainArea(map, x, y) {\n let previewSize = 6 / 2;\n for (let j = Math.max(0, y - previewSize); j < Math.min(map.map.length - 1, y + previewSize); j++) {\n let line = \"\";\n for (let i = Math.max(0, x - previewSize); i < Math.min(x + previewSize, map.map[j].length); i++) {\n if (map.oldTrains.hasOwnProperty(i + ',' + j)) {\n line += map.oldTrains[i + ',' + j].direction === \"^\" ? \"⬆️\" :\n map.oldTrains[i + ',' + j].direction === \"v\" ? \"⬇️\" :\n map.oldTrains[i + ',' + j].direction === \"<\" ? \"️⬅️ \" :\n map.oldTrains[i + ',' + j].direction === \">\" ? \"➡️ \" : \"\"\n ;\n } else {\n line += map.map[j][i] === '-' ? \"➖️\" :\n map.map[j][i] === '|' ? \"⏸ \" :\n map.map[j][i] === '\\\\' ? '↖ ️' : //'⇘' :\n map.map[j][i] === '/' ? '↙ ️' : //'⇗' :\n map.map[j][i] === '+' ? '➕' : '⬛️';\n }\n }\n console.log(line);\n }\n console.log(\"collisioin situation:\");\n for (let j = Math.max(0, y - previewSize); j < Math.min(map.map.length - 1, y + previewSize); j++) {\n let line = \"\";\n for (let i = Math.max(0, x - previewSize); i < Math.min(x + previewSize, map.map[j].length); i++) {\n if (map.trains.hasOwnProperty(i + ',' + j)) {\n line += map.trains[i + ',' + j].direction === \"^\" || map.trains[i + ',' + j].direction === \"v\" ? \"🚆\" : \"🚋\";\n\n } else {\n line += map.map[j][i] === '-' ? \"➖️\" :\n map.map[j][i] === '|' ? \"⏸ \" :\n map.map[j][i] === '\\\\' ? '↖ ️' : //'⇘' :\n map.map[j][i] === '/' ? '↙ ️' : //'⇗' :\n map.map[j][i] === '+' ? '➕' : '⬛️';\n }\n }\n console.log(line);\n }\n}", "function updatePositionsrainbowPrism1() {\n var positions = new Array(7);\n\n for(var i =0 ;i<7 ; i++) {\n positions[i] = new Array(MAX_POINTS * 3);\n positions[i] = allLines[i].geometry.attributes.position.array;\n }\n\n var x = [-4.3,-4.3,-4.3,-4.3,-4.3,-4.3,-4.3]; \n var x2 = [-1.43,-1.48,-1.53,-1.53,-1.55,-1.60,-1.65]; \n var y = [3,3,3,3,3,3,3]; \n var z = -2.5;\n var index = 0;\n\n for ( var i = 0, l = MAX_POINTS; i < l; i ++ ) {\n for(var j=0;j<7;j++){\n positions[j][ index ++ ] = x[j];\n positions[j][ index ++ ] = y[j];\n positions[j][ index ++ ] = z;\n\n x[j] += ((x2[j]+4.30)/MAX_POINTS);\n y[j] -= ((2.5-cords[j])/MAX_POINTS);\n index-=3;\n }\n index+=3;\n }\n}", "geoLayout() {\n this.pieces.forEach((row, i) => row.forEach((piece, j) => {\n let x, y;\n if (i <= Math.floor(this.pieces.length / 2)) {\n x = i * -1 / 2 + j * 1;\n\n } else {\n x = -Math.floor(this.pieces.length / 2) / 2 + (i - Math.floor(this.pieces.length / 2)) / 2 + j * 1;\n\n }\n y = i * Math.sqrt(3) / 2;\n\n piece.geoPoint = new Point(x, y);\n }));\n }", "function direction(data) {\n var direct;\n if (data >= 348.75 && data <= 360) {\n direct = \"North\";\n }\n if (data >= 0 && data <= 11.25){\n direct = \"North\";\n }\n if (data >= 11.25 && data <= 33.75){\n direct = \"North by North East\";\n };\n if (data >= 33.75 && data <= 56.25){\n direct = \"North East\";\n };\n if (data >= 56.25 && data <= 78.75){\n direct = \"East by North East\";\n };\n if (data >= 78.75 && data <= 101.25){\n direct = \"East\";\n };\n if (data >= 101.25 && data <= 123.75){\n direct = \"East by South East\";\n };\n if (data >= 123.75 && data <= 146.25){\n direct = \"South East\";\n };\n if (data >= 146.25 && data <= 168.75){\n direct = \"South by South East\";\n };\n if (data >= 168.75 && data <= 191.25){\n direct = \"South\";\n };\n if (data >= 191.25 && data <= 213.75){\n direct = \"South by South West\";\n };\n if (data >= 213.75 && data <= 236.25){\n direct = \"South West\";\n };\n if (data >= 236.25 && data <= 258.75){\n direct = \"West by South West\";\n };\n if (data >= 258.75 && data <= 281.25){\n direct = \"West\";\n };\n if (data >= 281.25 && data <= 303.75){\n direct = \"West by North West\";\n };\n if (data >= 303.75 && data <= 326.25){\n direct = \"North West\";\n };\n if (data >= 326.25 && data <= 348.75 ){\n direct = \"North by North West\";\n };\n return direct;\n}", "get true_position() { return this.position.copy().rotateX(Ribbon.LATITUDE).rotateZ(Earth.rotation).rotateZ(Ribbon.LONGITUDE); }", "function antiAliase(stations) {\n var m = refPts;\n stations[m].lat = stations[m].lat * cur +\n stations[m-1].lat * oneOff + stations[m+1].lat * oneOff +\n stations[m-2].lat * twoOff + stations[m+2].lat * twoOff;\n\n stations[m].lng = stations[m].lng * cur +\n stations[m-1].lng * oneOff + stations[m+1].lng * oneOff +\n stations[m-2].lng * twoOff + stations[m+2].lng * twoOff;\n\n return stations[m];\n }", "function flipLocs(loc) {\n return [8-loc[0], 6-loc[1]];\n}", "function precal_loc() {\n buffer_loc.forEach((obj)=>{obj.x = (obj.longitude + 180) * 10; obj.y = (90 - obj.latitude) * 10;});\n}", "getSideLook () {\n return GeometryUtils.unique(\n this.cubes.map(cube => [cube[2], cube[1]])\n )\n }", "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 }", "function displayLetter() {\n //var xypoints = [-0.18000000000000044,-0.3239999999999997,-0.30800000000000055,-0.3239999999999997,-0.30800000000000055,-0.3239999999999997,-0.30800000000000055,-0.3239999999999997,-0.30800000000000055,-0.3239999999999997,-0.30800000000000055,-0.3239999999999997,-0.30800000000000055,-0.3239999999999997,-0.30800000000000055,-0.3239999999999997,-0.30800000000000055,-0.3239999999999997,-0.2440000000000005,-0.3239999999999997,-0.2440000000000005,-0.3239999999999997,-0.2440000000000005,-0.2599999999999996,-0.2440000000000005,-0.2599999999999996,-0.2440000000000005,-0.2599999999999996,-0.2440000000000005,-0.2599999999999996,-0.2440000000000005,-0.2599999999999996,-0.18000000000000044,-0.2599999999999996,-0.18000000000000044,-0.2599999999999996,-0.18000000000000044,-0.2599999999999996,-0.18000000000000044,-0.2599999999999996,-0.18000000000000044,-0.2599999999999996,-0.18000000000000044,-0.2599999999999996,-0.18000000000000044,-0.2599999999999996,-0.11600000000000038,-0.2599999999999996,-0.11600000000000038,-0.2599999999999996,-0.11600000000000038,-0.2599999999999996,-0.11600000000000038,-0.2599999999999996,-0.11600000000000038,-0.2599999999999996,-0.11600000000000038,-0.2599999999999996,-0.11600000000000038,-0.2599999999999996,-0.11600000000000038,-0.2599999999999996,-0.11600000000000038,-0.2599999999999996,-0.052000000000000324,-0.2599999999999996,-0.052000000000000324,-0.2599999999999996,-0.052000000000000324,-0.2599999999999996,-0.052000000000000324,-0.19599999999999956,-0.052000000000000324,-0.19599999999999956,-0.052000000000000324,-0.19599999999999956,-0.052000000000000324,-0.19599999999999956,-0.052000000000000324,-0.19599999999999956,0.011999999999999733,-0.19599999999999956,0.011999999999999733,-0.19599999999999956,0.011999999999999733,-0.19599999999999956,0.011999999999999733,-0.19599999999999956,0.011999999999999733,-0.19599999999999956,0.011999999999999733,-0.19599999999999956,0.011999999999999733,-0.19599999999999956,0.011999999999999733,-0.19599999999999956,0.07599999999999979,-0.19599999999999956,0.07599999999999979,-0.19599999999999956,0.07599999999999979,-0.19599999999999956,0.07599999999999979,-0.19599999999999956,0.07599999999999979,-0.19599999999999956,0.07599999999999979,-0.19599999999999956,0.13999999999999985,-0.19599999999999956,0.13999999999999985,-0.19599999999999956,0.13999999999999985,-0.1319999999999995,0.13999999999999985,-0.1319999999999995,0.13999999999999985,-0.1319999999999995,0.13999999999999985,-0.1319999999999995,0.13999999999999985,-0.1319999999999995,0.13999999999999985,-0.1319999999999995,0.13999999999999985,-0.1319999999999995,0.13999999999999985,-0.1319999999999995,0.13999999999999985,-0.1319999999999995,0.13999999999999985,-0.1319999999999995,0.2039999999999999,-0.1319999999999995,0.2039999999999999,-0.1319999999999995,0.2039999999999999,-0.1319999999999995,0.2039999999999999,-0.1319999999999995,0.2039999999999999,-0.06799999999999945,0.2039999999999999,-0.06799999999999945,0.2039999999999999,-0.06799999999999945,0.2039999999999999,-0.06799999999999945,0.2039999999999999,-0.06799999999999945,0.26799999999999996,-0.06799999999999945,0.26799999999999996,-0.06799999999999945,0.26799999999999996,-0.06799999999999945,0.26799999999999996,-0.003999999999999393,0.26799999999999996,-0.003999999999999393,0.26799999999999996,-0.003999999999999393,0.26799999999999996,-0.003999999999999393,0.26799999999999996,-0.003999999999999393,0.26799999999999996,-0.003999999999999393,0.26799999999999996,-0.003999999999999393,0.26799999999999996,-0.003999999999999393,0.26799999999999996,-0.003999999999999393,0.26799999999999996,0.060000000000000664,0.26799999999999996,0.060000000000000664,0.26799999999999996,0.060000000000000664,0.26799999999999996,0.060000000000000664,0.26799999999999996,0.060000000000000664,0.26799999999999996,0.060000000000000664,0.26799999999999996,0.12400000000000072,0.26799999999999996,0.12400000000000072,0.26799999999999996,0.12400000000000072,0.26799999999999996,0.12400000000000072,0.26799999999999996,0.12400000000000072,0.26799999999999996,0.12400000000000072,0.2039999999999999,0.12400000000000072,0.2039999999999999,0.12400000000000072,0.2039999999999999,0.12400000000000072,0.2039999999999999,0.12400000000000072,0.2039999999999999,0.12400000000000072,0.2039999999999999,0.12400000000000072,0.2039999999999999,0.12400000000000072,0.13999999999999985,0.12400000000000072,0.13999999999999985,0.18800000000000078,0.13999999999999985,0.18800000000000078,0.13999999999999985,0.18800000000000078,0.13999999999999985,0.18800000000000078,0.13999999999999985,0.18800000000000078,0.13999999999999985,0.18800000000000078,0.13999999999999985,0.18800000000000078,0.13999999999999985,0.18800000000000078,0.13999999999999985,0.18800000000000078,0.07599999999999979,0.18800000000000078,0.07599999999999979,0.18800000000000078,0.07599999999999979,0.18800000000000078,0.07599999999999979,0.18800000000000078,0.07599999999999979,0.18800000000000078,0.07599999999999979,0.18800000000000078,0.07599999999999979,0.18800000000000078,0.07599999999999979,0.18800000000000078,0.011999999999999733,0.18800000000000078,0.011999999999999733,0.18800000000000078,0.011999999999999733,0.18800000000000078,0.011999999999999733,0.18800000000000078,0.011999999999999733,0.18800000000000078,0.011999999999999733,0.18800000000000078,-0.052000000000000324,0.18800000000000078,-0.052000000000000324,0.18800000000000078,-0.052000000000000324,0.18800000000000078,-0.052000000000000324,0.18800000000000078,-0.052000000000000324,0.18800000000000078,-0.052000000000000324,0.18800000000000078,-0.11600000000000038,0.18800000000000078,-0.11600000000000038,0.18800000000000078,-0.11600000000000038,0.18800000000000078,-0.11600000000000038,0.25200000000000083,-0.11600000000000038,0.25200000000000083,-0.11600000000000038,0.25200000000000083,-0.11600000000000038,0.25200000000000083,-0.11600000000000038,0.25200000000000083,-0.11600000000000038,0.25200000000000083,-0.18000000000000044,0.25200000000000083,-0.18000000000000044,0.25200000000000083,-0.18000000000000044,0.25200000000000083,-0.18000000000000044,0.25200000000000083,-0.18000000000000044,0.25200000000000083,-0.18000000000000044,0.25200000000000083,-0.18000000000000044,0.25200000000000083,-0.18000000000000044,0.25200000000000083,-0.2440000000000005,0.25200000000000083,-0.2440000000000005,0.25200000000000083,-0.2440000000000005,0.25200000000000083,-0.2440000000000005,0.316,-0.2440000000000005,0.316,-0.2440000000000005,0.316,-0.2440000000000005,0.316,-0.2440000000000005,0.316,-0.2440000000000005,0.316,-0.2440000000000005,0.316,-0.2440000000000005,0.316,-0.2440000000000005,0.316,-0.2440000000000005,0.316,-0.2440000000000005,0.38000000000000006,-0.30800000000000055,0.38000000000000006,-0.30800000000000055,0.38000000000000006,-0.30800000000000055,0.38000000000000006,-0.30800000000000055,0.38000000000000006,-0.30800000000000055,0.38000000000000006,-0.30800000000000055,0.38000000000000006,-0.30800000000000055,0.4440000000000001,-0.30800000000000055,0.4440000000000001,-0.30800000000000055,0.4440000000000001,-0.30800000000000055,0.4440000000000001,-0.2440000000000005,0.4440000000000001,-0.2440000000000005,0.4440000000000001,-0.2440000000000005,0.4440000000000001,-0.2440000000000005,0.4440000000000001,-0.2440000000000005,0.4440000000000001,-0.2440000000000005,0.5080000000000002,-0.2440000000000005,0.5080000000000002,-0.2440000000000005,0.5080000000000002,-0.2440000000000005,0.5080000000000002,-0.18000000000000044,0.5080000000000002,-0.18000000000000044,0.5080000000000002,-0.18000000000000044,0.5080000000000002,-0.18000000000000044,0.5080000000000002,-0.18000000000000044,0.5080000000000002,-0.18000000000000044,0.5080000000000002,-0.18000000000000044,0.5080000000000002,-0.18000000000000044,0.5080000000000002,-0.18000000000000044,0.5080000000000002,-0.11600000000000038,0.5080000000000002,-0.11600000000000038,0.5720000000000003,-0.11600000000000038,0.5720000000000003,-0.11600000000000038,0.5720000000000003,-0.11600000000000038,0.5720000000000003,-0.11600000000000038,0.5720000000000003,-0.11600000000000038,0.5720000000000003,-0.11600000000000038,0.5720000000000003,-0.052000000000000324,0.5720000000000003,-0.052000000000000324,0.5720000000000003,-0.052000000000000324,0.5720000000000003,-0.052000000000000324,0.5720000000000003,-0.052000000000000324,0.5720000000000003,-0.052000000000000324,0.5720000000000003,-0.052000000000000324,0.5720000000000003,0.011999999999999733,0.5720000000000003,0.011999999999999733,0.5720000000000003,0.011999999999999733,0.5720000000000003,0.011999999999999733,0.5720000000000003,0.011999999999999733,0.5720000000000003,0.011999999999999733,0.5720000000000003,0.011999999999999733,0.5720000000000003,0.07599999999999979,0.5720000000000003,0.07599999999999979,0.5720000000000003,0.07599999999999979,0.5720000000000003,0.07599999999999979,0.5720000000000003,0.07599999999999979,0.5720000000000003,0.07599999999999979,0.5720000000000003,0.07599999999999979,0.5720000000000003,0.13999999999999985,0.5720000000000003,0.13999999999999985,0.5720000000000003,0.13999999999999985,0.5720000000000003,0.13999999999999985,0.5720000000000003,0.13999999999999985,0.5720000000000003,0.13999999999999985,0.5720000000000003,0.13999999999999985,0.5720000000000003,0.2039999999999999,0.5720000000000003,0.2039999999999999,0.5720000000000003,0.2039999999999999,0.5720000000000003,0.2039999999999999,0.5720000000000003,0.2039999999999999,0.5720000000000003,0.2039999999999999,0.5720000000000003,0.26799999999999996,0.5720000000000003,0.26799999999999996,0.6360000000000003,0.26799999999999996,0.6360000000000003,0.26799999999999996,0.6360000000000003,0.26799999999999996,0.6360000000000003,0.26799999999999996,0.6360000000000003,0.26799999999999996,0.6360000000000003,0.26799999999999996,0.7000000000000004,0.26799999999999996,0.7000000000000004,0.26799999999999996,0.7000000000000004,0.26799999999999996,0.7000000000000004];\n //var xypoints = [0.20, 0.84, 0.22, 0.84, 0.22, 0.84, 0.22, 0.84, 0.22, 0.84, 0.22, 0.84, 0.22, 0.84, 0.22, 0.84, 0.22, 0.84, 0.21, 0.84, 0.21, 0.84, 0.21, 0.85, 0.21, 0.85, 0.21, 0.85, 0.21, 0.85, 0.21, 0.85, 0.20, 0.85, 0.20, 0.85, 0.20, 0.85, 0.20, 0.85, 0.20, 0.85, 0.20, 0.85, 0.20, 0.85, 0.19, 0.85, 0.19, 0.85, 0.19, 0.85, 0.19, 0.85, 0.19, 0.85, 0.19, 0.85, 0.19, 0.85, 0.19, 0.85, 0.19, 0.85, 0.18, 0.85, 0.18, 0.85, 0.18, 0.85, 0.18, 0.86, 0.18, 0.86, 0.18, 0.86, 0.18, 0.86, 0.18, 0.86, 0.17, 0.86, 0.17, 0.86, 0.17, 0.86, 0.17, 0.86, 0.17, 0.86, 0.17, 0.86, 0.17, 0.86, 0.17, 0.86, 0.16, 0.86, 0.16, 0.86, 0.16, 0.86, 0.16, 0.86, 0.16, 0.86, 0.16, 0.86, 0.15, 0.86, 0.15, 0.86, 0.15, 0.87, 0.15, 0.87, 0.15, 0.87, 0.15, 0.87, 0.15, 0.87, 0.15, 0.87, 0.15, 0.87, 0.15, 0.87, 0.15, 0.87, 0.15, 0.87, 0.14, 0.87, 0.14, 0.87, 0.14, 0.87, 0.14, 0.87, 0.14, 0.88, 0.14, 0.88, 0.14, 0.88, 0.14, 0.88, 0.14, 0.88, 0.13, 0.88, 0.13, 0.88, 0.13, 0.88, 0.13, 0.89, 0.13, 0.89, 0.13, 0.89, 0.13, 0.89, 0.13, 0.89, 0.13, 0.89, 0.13, 0.89, 0.13, 0.89, 0.13, 0.89, 0.13, 0.90, 0.13, 0.90, 0.13, 0.90, 0.13, 0.90, 0.13, 0.90, 0.13, 0.90, 0.13, 0.91, 0.13, 0.91, 0.13, 0.91, 0.13, 0.91, 0.13, 0.91, 0.13, 0.91, 0.14, 0.91, 0.14, 0.91, 0.14, 0.91, 0.14, 0.91, 0.14, 0.91, 0.14, 0.91, 0.14, 0.91, 0.15, 0.91, 0.15, 0.92, 0.15, 0.92, 0.15, 0.92, 0.15, 0.92, 0.15, 0.92, 0.15, 0.92, 0.15, 0.92, 0.15, 0.92, 0.15, 0.92, 0.16, 0.92, 0.16, 0.92, 0.16, 0.92, 0.16, 0.92, 0.16, 0.92, 0.16, 0.92, 0.16, 0.92, 0.16, 0.92, 0.17, 0.92, 0.17, 0.92, 0.17, 0.92, 0.17, 0.92, 0.17, 0.92, 0.17, 0.92, 0.18, 0.92, 0.18, 0.92, 0.18, 0.92, 0.18, 0.92, 0.18, 0.92, 0.18, 0.92, 0.19, 0.92, 0.19, 0.92, 0.19, 0.92, 0.19, 0.93, 0.19, 0.93, 0.19, 0.93, 0.19, 0.93, 0.19, 0.93, 0.19, 0.93, 0.20, 0.93, 0.20, 0.93, 0.20, 0.93, 0.20, 0.93, 0.20, 0.93, 0.20, 0.93, 0.20, 0.93, 0.20, 0.93, 0.21, 0.93, 0.21, 0.93, 0.21, 0.93, 0.21, 0.94, 0.21, 0.94, 0.21, 0.94, 0.21, 0.94, 0.21, 0.94, 0.21, 0.94, 0.21, 0.94, 0.21, 0.94, 0.21, 0.94, 0.21, 0.94, 0.21, 0.95, 0.22, 0.95, 0.22, 0.95, 0.22, 0.95, 0.22, 0.95, 0.22, 0.95, 0.22, 0.95, 0.22, 0.96, 0.22, 0.96, 0.22, 0.96, 0.22, 0.96, 0.21, 0.96, 0.21, 0.96, 0.21, 0.96, 0.21, 0.96, 0.21, 0.96, 0.21, 0.97, 0.21, 0.97, 0.21, 0.97, 0.21, 0.97, 0.20, 0.97, 0.20, 0.97, 0.20, 0.97, 0.20, 0.97, 0.20, 0.97, 0.20, 0.97, 0.20, 0.97, 0.20, 0.97, 0.20, 0.97, 0.19, 0.97, 0.19, 0.98, 0.19, 0.98, 0.19, 0.98, 0.19, 0.98, 0.19, 0.98, 0.19, 0.98, 0.19, 0.98, 0.18, 0.98, 0.18, 0.98, 0.18, 0.98, 0.18, 0.98, 0.18, 0.98, 0.18, 0.98, 0.18, 0.98, 0.17, 0.98, 0.17, 0.98, 0.17, 0.98, 0.17, 0.98, 0.17, 0.98, 0.17, 0.98, 0.17, 0.98, 0.16, 0.98, 0.16, 0.98, 0.16, 0.98, 0.16, 0.98, 0.16, 0.98, 0.16, 0.98, 0.16, 0.98, 0.15, 0.98, 0.15, 0.98, 0.15, 0.98, 0.15, 0.98, 0.15, 0.98, 0.15, 0.98, 0.15, 0.98, 0.14, 0.98, 0.14, 0.98, 0.14, 0.98, 0.14, 0.98, 0.14, 0.98, 0.14, 0.98, 0.13, 0.98, 0.13, 0.99, 0.13, 0.99, 0.13, 0.99, 0.13, 0.99, 0.13, 0.99, 0.13, 0.99, 0.13, 1.00, 0.13, 1.00, 0.13, 1.00, 0.13, 1.00];\n var xypoints = [125,526,141,526,140,526,140,527,139,527,138,528,137,528,136,529,135,529,134,529,133,529,133,530,132,530,131,530,130,531,129,531,128,531,127,531,126,531,126,532,125,532,124,533,123,533,122,533,121,533,120,533,120,534,119,534,118,534,117,534,117,535,116,535,115,535,115,536,114,536,114,537,113,537,112,537,111,537,110,537,109,537,108,537,108,538,107,538,106,538,106,539,105,539,104,539,103,539,102,540,101,540,100,541,99,541,98,542,97,542,96,542,96,543,95,543,94,543,94,544,93,544,92,544,92,545,92,546,91,546,91,547,90,547,89,547,89,548,88,548,88,549,87,549,86,550,86,551,85,551,84,552,84,553,83,554,83,555,83,556,82,556,82,557,82,558,82,559,82,560,81,560,81,561,81,562,81,563,81,564,81,565,81,566,81,567,81,568,82,568,82,569,83,569,83,570,84,570,85,570,86,570,86,571,87,571,88,571,89,572,90,573,91,573,91,574,92,574,93,574,94,574,94,575,95,575,96,575,97,575,97,576,98,576,98,577,99,577,100,577,101,577,102,577,102,578,103,578,104,578,105,578,106,578,107,578,108,578,109,578,110,578,111,579,112,579,113,579,114,579,115,579,116,579,117,579,118,579,118,580,119,580,120,581,121,581,122,581,122,582,123,582,124,582,125,583,126,583,126,584,127,584,127,585,128,585,129,585,129,586,130,586,130,587,131,587,131,588,132,588,132,589,133,589,133,590,134,590,134,591,134,592,134,593,135,593,135,594,135,595,135,596,135,597,135,598,135,599,135,600,135,601,135,602,134,603,133,603,133,604,132,604,132,605,132,606,131,606,129,606,129,607,128,607,127,608,127,609,126,609,125,609,125,610,124,610,124,611,123,611,122,611,121,612,120,612,120,613,119,613,118,614,117,614,116,614,115,614,114,614,114,615,113,615,112,615,111,615,110,615,109,615,109,616,108,616,107,616,106,616,105,616,104,616,103,616,102,616,102,617,101,617,100,617,99,617,98,617,97,617,96,617,95,617,94,617,93,617,92,617,91,617,90,617,89,617,88,617,87,617,86,617,85,617,84,617,84,618,84,619,84,620,84,621,84,622,84,623,84,624,84,625,84,626,84,627];\n \n var x;\n var even = true;\n xypoints = $.map(xypoints, function (v) {\n x= v/627.0;\n x = (x * 1.6) - 1\n if (even) {\n x = (x * -1) - .8\n even = false;\n }\n else {\n x = x - .5\n even = true;\n }\n\n return ((x * 4) + .3);\n return(x);\n });\n //alert(xypoints);\n var numbers = new Float32Array(xypoints);\n squareTryangleCircle = \"letter\";\n var colors = [1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0];\n\n var bufferId = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, bufferId);\n gl.bufferData(gl.ARRAY_BUFFER, numbers, gl.STATIC_DRAW);\n\n var aPosition = gl.getAttribLocation(program, \"aPosition\");\n gl.vertexAttribPointer(aPosition, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(aPosition);\n\n cBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, cBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW); //new Float32Array(colors)\n\n var aColor = gl.getAttribLocation(program, \"aColor\");\n //3 points colors?\n gl.vertexAttribPointer(aColor, 3, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(aColor);\n\n render(\"red\");\n // gl.clear(gl.COLOR_BUFFER_BIT);\n // gl.drawArrays(gl.LINE_STRIP, 0, 240);\n\n}", "function antiAliaseEndpoints(stations) {\n var m = middle;\n stations[m].lat = stations[m].lat * 0.4 +\n stations[m-1].lat * 0.3 + stations[m+1].lat * 0.3;\n stations[m].lng = stations[m].lng * 0.4 +\n stations[m-1].lng * 0.3 + stations[m+1].lng * 0.3;\n\n return stations[m];\n }", "function hideShowPoints(d) {\n\t return _this.isLonLatOverEdges(d.lonlat) ? '0' : '1.0';\n\t }", "plotRoutesCornerPoints() {\n for (let r of this.mapRoutes) {\n r.plotRouteCornerPoints(this.map);\n }\n }", "function hideLocation() {\n positionArray.clear()\n}", "function updatePositionsincident() {\n var positions = line.geometry.attributes.position.array;\n\n var x = -16;\n var y = 0; \n var z = -2.5;\n var index = 0;\n\n for ( var i = 0, l = MAX_POINTS; i < l; i ++ ) {\n\n positions[ index ++ ] = x;\n positions[ index ++ ] = y;\n positions[ index ++ ] = z;\n\n x += (11.78/MAX_POINTS);\n y += (3/MAX_POINTS);\n }\n}", "function showConjugates () {\n\n pointsTable = lens.pointsTable.getData(); \n pointsList = Optics.calculatePointToPoint(renderableLens.total, pointsTable);\n totalLens = renderableLens.total;\n\n if (pointsList.length > 0) {\n pointsList.forEach( elem => {\n console.log(\"showing .... conjugate pair id = \" + elem.id);\n drawConjugates(elem, displayOptions);\n } );\n }\n }", "function computeLatLng(location) {\n\tvar l = location.levels.length;\n\tvar x = location.x;\n\tvar y = location.y;\n\t\n\tfor (var i=l-1; i>=0; i--) {\n\t\tvar level = +location.levels[i];\n\t\tif (level === 1) {\n\t\t\tx /= 2;\n\t\t\ty = y/2 + 0.5;\n\t\t} else if (level === 2) {\n\t\t\tx /= 2;\n\t\t\ty /= 2;\n\t\t} else if (level === 3) {\n\t\t\tx = x/2 + 0.5;\n\t\t\ty /= 2;\n\t\t} else if (level === 0) {\n\t\t\tx = (1 - x)/2;\n\t\t\ty = (1 - y)/2;\n\t\t}\n// \t\tconsole.log(level, x,y);\n\t}\n\t\n\tx /= 1 - y;\n\tx *= 90;\n\ty *= 90;\n\t\n\tif (location.octant == 0) {\n\t\tx -= 180;\n\t} else if (location.octant == 1) {\n\t\tx -= 90;\n\t} else if (location.octant == 2) {\n\t\tx += 0;\n\t} else if (location.octant == 3) {\n\t\tx += 90;\n\t} else if (location.octant == 4) {\n\t\tx -= 180;\n\t\ty = -y;\n\t} else if (location.octant == 5) {\n\t\tx -= 90;\n\t\ty = -y;\n\t} else if (location.octant == 6) {\n\t\tx += 0;\n\t\ty = -y;\n\t} else if (location.octant == 7) {\n\t\tx += 90;\n\t\ty = -y;\n\t}\n\t\n\tlocation.lat = y;\n\tlocation.lng = x;\n\t\n\treturn location;\n}", "function drawLocs(){\n\tfor (var i = 0; i <= loc.length; i++){\n fill(0, 200);\n ellipse(locX[i], locY[i], locSize, locSize);\n fill(255);\n text(loc[i],locX[i], locY[i]);\n }\n}", "function change_dir(co)\t{\t\r\n\tvar n1, n2, l, newl, f, r1, x1, x2, y1, y2, i, j, gx, gy, d, mx, my, sina, sinb,\r\n\t\twei, len, rect;\r\n\r\n\tfor (tn = co.firstChild; tn.nodeName != \"text\"; tn = tn.nextSibling) ;\r\n\r\n\tif ( dir_mode==false )\t{\r\n\t\tif ( bul==1 )\r\n \t\ttn.firstChild.data=\"undir. graph\";\r\n\t\tpath_edges = edges.length;\r\n\t\tfor ( i=0 ; i<path_edges ; i++ )\t{\r\n\t\t\tedges[i].gi.setAttribute(\"marker-end\",\"url(#arrow)\");\r\n\t\t\tn1 = edges[i].n1;\r\n\t\t\tn2 = edges[i].n2;\r\n\t\t\tfor ( j=0 ; j<nodes[n2].elist.length ; j++ )\t{\r\n\t\t\t\tif ( nodes[n2].elist[j]==i )\t{\r\n\t\t\t\t\t// memmove\r\n\t\t\t\t\tnodes[n2].elist[j] = nodes[n2].elist[nodes[n2].elist.length-1];\r\n\t\t\t\t\tnodes[n2].elist.pop();\r\n\t\t\t\t\t// adds it to the relist\r\n\t\t\t\t\tnodes[n2].relist.push(i);\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\tx1 = parseInt(nodes[n2].gi.getAttribute(\"cx\"));\r\n \t\ty1 = parseInt(nodes[n2].gi.getAttribute(\"cy\")); \r\n \t\tx2 = parseInt(nodes[n1].gi.getAttribute(\"cx\"));\r\n \t\ty2 = parseInt(nodes[n1].gi.getAttribute(\"cy\"));\r\n\r\n\t\t\tf = Math.atan2(y2-y1,x2-x1);\r\n\t\t\tf = f*180/3.1415725;\r\n\r\n\t\t\td = 35;\r\n\t\t\tmx = (x1+x2)/2;\r\n \t\tmy = (y1+y2)/2;\r\n\r\n\t\t\tsina = (y2-y1)/Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));\r\n\t\t\tcosa = (x2-x1)/Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));\r\n\t\t\tgx = mx + sina*d; \r\n\t\t\tgy = my - cosa*d;\r\n\t\t\tr1 = ((x1-gx)*(x1-gx)+(y1-gy)*(y1-gy))/(2*d);\r\n\t\t\t\r\n\t\t\tnewl = doc.createElement(\"path\");\t\t\t\r\n\t \tnewl.setAttribute(\"d\",\"M\"+x1.toString(10)+\",\"+y1.toString(10)+\" A\"+r1.toString(10)+\",\"+r1.toString(10)+\" \"+f.toString(10)+\" 0,1 \"+x2.toString(10)+\",\"+y2.toString(10));\r\n \t\tnewl.setAttribute(\"stroke\",\"black\"); \r\n \t\tnewl.setAttribute(\"stroke-width\",\"4\");\r\n\t\t\tnewl.setAttribute(\"fill\",\"none\");\r\n\t\t\tnewl.setAttribute(\"marker-end\",\"url(#arrow)\");\r\n \t\tdoc.getElementById(\"edges\").appendChild(newl);\r\n \t\t \t\t\r\n \t\t// background of weight\r\n \t\trect = doc.createElement(\"rect\");\r\n \t\trect.setAttribute(\"fill\",\"green\");\r\n \t\trect.setAttribute(\"opacity\",\"0.4\");\r\n \t\trect.setAttribute(\"x\",(gx-20).toString(10));\r\n \t\trect.setAttribute(\"y\",(gy-16).toString(10));\r\n \t\trect.setAttribute(\"width\",\"40\");\r\n \t\trect.setAttribute(\"height\",\"22\");\r\n \t\trect.setAttribute(\"id\",\"bg\"+edges.length.toString(10));\r\n \t\tdoc.getElementById(\"edge_weights\").appendChild(rect);\r\n\t\t\t\r\n \t\tlen = edges[i].wei;\r\n \t\twei = doc.createElement(\"text\");\r\n \t\twei.setAttribute(\"id\",\"patt\"+edges.length.toString(10));\r\n \t\twei.setAttribute(\"font-size\",\"16px\");\r\n \t\twei.setAttribute(\"text-anchor\",\"middle\");\r\n \t\twei.setAttribute(\"font-weight\",\"bold\");\r\n \t\twei.setAttribute(\"stroke\",\"black\");\r\n \t\twei.setAttribute(\"stroke-width\",\"0\");\r\n \t\twei.setAttribute(\"fill\",\"white\");\r\n \t\twei.setAttribute(\"x\",gx.toString(10));\r\n \t\twei.setAttribute(\"y\",gy.toString(10));\r\n \t\twei.appendChild(doc.getElementById(\"patt\").firstChild.cloneNode(0));\r\n \t\twei.firstChild.data = len.toString(10);\r\n \t\tdoc.getElementById(\"edge_weights\").appendChild(wei);\r\n\t\t\t\r\n\t\t\t// adds to array\r\n\t\t\tedges.push({gi:newl, n1:n2, n2:n1, wei:len, weigi:wei, rectgi:rect});\r\n\t\t\tnodes[n2].elist.push(edges.length-1);\r\n\t\t\tnodes[n1].relist.push(edges.length-1);\r\n\t\t}\r\n\t\tdir_mode = true;\r\n\t} else {\r\n\r\n \t\ttn.firstChild.data=\"dir. graph. mode\";\r\n\t\tfor ( i=0 ; i<path_edges ; i++ ) {\r\n\t\t\t\tedges[i].gi.setAttribute(\"marker-end\",\"\");\r\n\t\t\t\tn1 = edges[i].n1;\r\n\t\t\t\tn2 = edges[i].n2;\r\n\t\t\t\tfor ( j=0 ; j<nodes[n2].relist.length && nodes[n2].relist[j]!=i ; j++ );\r\n\t\t\t\tnodes[n2].elist.push(i);\r\n\t\t\t\t// memmove\r\n\t\t\t\tnodes[n2].relist[j] = nodes[n2].relist[nodes[n2].relist.length-1];\r\n\t\t\t\tnodes[n2].relist.pop();\r\n\t\t}\r\n\t\tfor ( i=path_edges ; i<edges.length ; i++ )\t{\t\r\n\t\t\tdelete_edge(edges[i].gi);\r\n\t\t\ti--;\r\n\t\t}\r\n\t\tdir_mode = false;\r\n\t\tpath_edges = edges.length;\r\n\t}\r\n}", "static get LANCER_DIRS() {\n return {\n 'c': [-1, 0], //north\n 'd': [-1, 1], //N-E\n 'e': [0, 1], //east\n 'f': [1, 1], //S-E\n 'g': [1, 0], //south\n 'h': [1, -1], //S-W\n 'm': [0, -1], //west\n 'o': [-1, -1] //N-W\n };\n }", "function recaman() {\n\tvar xcoords = [];\n\tvar ycoords = [];\n\tfor (var i = 0; i < maxIter; i++) {\n\t\txcoords.push(i);\n\t\tif (i == 0) {\n\t\t\tycoords.push(0);\n\t\t} else {\n\t\t\tvar temp = ycoords[i-1] - i;\n\t\t\tif (temp > 0 && !ycoords.includes(temp)) {\n\t\t\t\tycoords.push(temp);\n\t\t\t} else {\n\t\t\t\tycoords.push(ycoords[i-1] + i);\n\t\t\t}\n\t\t}\n\t}\n\tvar data = {\n\t\tx: xcoords,\n\t\ty: ycoords,\n\t\tmode: 'markers',\n\t\ttype: 'scatter'\n\t}\n\treturn data;\n}", "if(snakes[1].loc.dist(food.loc) === 0){\n food.pickLoc();\n snakes[1].addSegment();\n\n}", "createPaths(id) {\n let polyPath = [ 0, [] ];\n let i, b;\n let panoid=0, panoidx;\n for(i=0; i<this.nav.panoMetadata[id].sequence.panos.length; i++) {\n if(this.nav.panoMetadata[id].sequence.panos.length == 1) continue;\n const pano = this.nav.panoMetadata[id].sequence.panos[i];\n const latDelta = Math.abs(this.nav.panoMetadata[id].lat - pano.lat);\n if(latDelta * 111 * 1000 > 200) {\n polyPath = [polyPath[0] + 1, [] ];\n continue;\n }\n // skip lon next..\n const lonDelta = Math.abs(this.nav.panoMetadata[id].lon - pano.lon);\n if(lonDelta * Math.pow(290-(105+pano.lon), 1.065) * 1000 > 200) {\n polyPath = [polyPath[0] + 1, [] ];\n continue;\n }\n // reposition the spot directly below.. a minimum distance is \n // needed because directly below (-.5*PI) there is no impact of yaw!\n if(id == pano.panoid) {\n panoidx = i;\n const theOtherOne = (i==0) ? \n this.nav.panoMetadata[id].sequence.panos[1] : \n this.nav.panoMetadata[id].sequence.panos[i-1] ; \n // Not sure what distance1 and distance2 are used for or whether they are even needed\n // if removed the line does not cover the current pano\n let distance1 = coordtrans.distance(\n this.nav.panoMetadata[id].lat,\n this.nav.panoMetadata[id].lon,\n theOtherOne.lat,\n theOtherOne.lon\n );\n // Half 1/distance\n const distance2 = (distance1 < 0.7) ? 0.9 : 0.5/distance1;\n distance1 = 1 - distance2;\n\n b = coordtrans.geodeticToEnu(\n theOtherOne.lat * distance2 + pano.lat * distance1,\n theOtherOne.lon * distance2 + pano.lon * distance1,\n 0,\n this.nav.panoMetadata[id].lat,\n this.nav.panoMetadata[id].lon,\n this.gaVars.baseHeight * 0.9\n );\n\t\t\t\tconsole.log(`${i} ${id} theotherone ${theOtherOne.panoid}`);\n panoid=theOtherOne.panoid;\n } else {\n b = coordtrans.geodeticToEnu(\n pano.lat,\n pano.lon,\n pano.ele * this.gaVars.flattener,\n this.nav.panoMetadata[id].lat,\n this.nav.panoMetadata[id].lon,\n this.nav.panoMetadata[id].ele * this.gaVars.flattener + this.gaVars.baseHeight\n );\n\t\t\t\tconsole.log(`${i} ${id} ${this.nav.panoMetadata[id].sequence.panos[i].panoid}`);\n panoid = this.nav.panoMetadata[id].sequence.panos[i].panoid;\n } \n\n // into the ground by X degrees\n b[3] = Math.sqrt(b[0]*b[0] + b[1]*b[1]);\n b[2] -= Math.sin ( this.gaVars.degDown * Math.PI/180) * b[3];\n // b[3] = distance | b[4] = radians Pitch (-.5pi - 0.5pi)\n // b[5] = radians Yaw (0 - 2pi)\n b = coordtrans.enuPlusMarkerdata(b, this.nav.viewer.heading);\n\n // b[6] = marker scale (result formula is via trial and error ;)\n b[6] = (300/(b[3]>300 ? 300:b[3]))*(4/100)+0.03;\n\n\n // create polyline to show the path of the images!\n if ( i < this.nav.imageNow || (i == this.nav.imageNow && i != 0) ) {\n polyPath[1].push([b[5]-b[6]/this.gaVars.pathWidth, b[4] ]); \n polyPath[1].unshift([Math.round((b[5]+b[6]/this.gaVars.pathWidth)*1000)/1000, b[4] ]);\n } else {\n polyPath[1].push([Math.round((b[5]+b[6]/this.gaVars.pathWidth)*1000)/1000, b[4] ]);\n polyPath[1].unshift([b[5]-b[6]/this.gaVars.pathWidth, b[4] ]);\n }\n // in an earlier version the path was created for every 100 images \n //or when the distance was over 100 meters\n // now it is only a polyline of one image to the next, \n // so that a circle gradient can be placed on the mouse over, \n // for a cooler effect ;)\n if (polyPath[1].length > 2 ) {\n\t\t\t\tconsole.log(`path-${id}-${panoid}`);\n \tthis.nav.viewer.markersPlugin.addMarker({\n id : `path-${id}-${panoid}`,\n //content : 'This mountain is so great it has dots on it!',\n tooltip: `Pano ${panoid}`,\n polylineRad: polyPath[1],\n svgStyle : {\n fill : this.gaVars.markerBaseFill, \n stroke : this.gaVars.markerBaseFill.replace(/([0-9.]+)\\)/, function (x,y) {\n return parseFloat(y)/4+')';\n }),\n strokeWidth: '1px',//'0.1em',\n },\n \t});\n \t\t\tpolyPath= [polyPath[0]+1,\n [polyPath[1][ 0 ],\n polyPath[1][ polyPath[1].length-1 ]]\n ];\n\n\t\t\t}\n }\n \t\t// always draw the last polyline.. you might end up not to in the for loop\n \t\tif (polyPath[1].length > 1 && !this.nav.viewer.markersPlugin.markers[`polygon${panoid}`] ) {\n\t\t\t\tconsole.log(`**path-${id}-${panoid}`);\n \t\tthis.nav.viewer.markersPlugin.addMarker({\n \t\t\tid : `path-${id}-${panoid}`, \n tooltip: `Pano ${panoid}`,\n \t\t//content : 'This mountain is so great it has dots on it!',\n \t\tpolylineRad: polyPath[1],\n \t\tsvgStyle : {\n \t\tfill : this.gaVars.markerBaseFill, //'url(#GAgradient0)',//'rgba(255, 255, 255, 0.3)', //'rgba(255,0,0,0.3)',\n \t\tstroke : this.gaVars.markerBaseFill.replace(/([0-9.]+)\\)/, function (x,y) {\n return parseFloat(y)/4+')';\n }),\n \t\tstrokeWidth: '1px',//'0.1em',\n \t\t},\n \t\t});\n \t\tpolyPath= [[],[]];\n \t\t}\n }", "function inverse$g(p) {\n\n var x = p.x;\n var y = p.y;\n\n p.x = adjust_lon(this.long0 + ((x - this.x0) / (this.a * this.rc)));\n p.y = adjust_lat(this.lat0 + ((y - this.y0) / (this.a)));\n return p;\n}", "function rightRep() {\n let temp = g.points[0];\n if(!g.inPhaseEnvelope){\n // Solute line\n push();\n stroke(0, 0, 255);\n strokeWeight(2);\n fill(0, 0, 255);\n for (let i = temp.x; i > 105; i -= 10) {\n line(i, temp.y, i - 5, temp.y);\n }\n if (temp.x - 100 > 5) {\n triangle(102, temp.y, 125, temp.y + 5, 125, temp.y - 5);\n }\n pop();\n let soluteVal = map(temp.y, 450, 50, 0, 1); // Defines mass fraction based on position\n let sVal = soluteVal.toFixed(2);\n g.soluteFrac = sVal; // Assigns to global variable for display in mass fractions box\n push();\n if (g.soluteTruth) { // Displaying on the triangle axis for when checkbox is checked\n fill(255);\n rect(45, temp.y - 20, 45, 30);\n textSize(18);\n noStroke();\n fill(0, 0, 255);\n text(sVal, 50, temp.y);\n\n }\n pop();\n // Solvent line\n push();\n stroke(128, 0, 128);\n strokeWeight(2);\n fill(128, 0, 128);\n for (let i = temp.y; i < 445; i += 10) {\n line(temp.x, i, temp.x, i + 5);\n }\n if (450 - temp.y > 5) {\n triangle(temp.x, 448, temp.x + 5, 425, temp.x - 5, 425);\n }\n pop();\n push();\n let solventVal = map(temp.x, 100, 500, 0, 1); // Defines mass fraction based on position\n let soVal = solventVal.toFixed(2);\n g.solventFrac = soVal; // Assigns to global variable\n if (g.solventTruth) { // Displaying on the triangle axis for when checkbox is checked\n fill(255);\n rect(temp.x - 20, 460, 45, 30);\n textSize(18);\n noStroke();\n fill(128, 0, 128);\n text(soVal, temp.x - 15, 480);\n }\n pop();\n\n // Draws the carrier line\n push();\n stroke(255, 100, 0);\n strokeWeight(2);\n drawingContext.setLineDash([5, 5]);\n let diff1, diff2;\n diff1 = 450 - temp.y;\n diff2 = temp.x - 100;\n line(temp.x, temp.y, diff1 + temp.x, 450);\n line(temp.x, temp.y, 100, temp.y - diff2);\n if (g.carrierTruth && diff1 > 25 && g.solventTruth) { // These conditionals keep the display nice when both solvent and carrier boxes are checked\n line(diff1 + temp.x, 450, diff1 + temp.x, 500);\n push();\n drawingContext.setLineDash([0, 0]);\n stroke(0);\n strokeWeight(1);\n fill(255);\n rect(diff1 + temp.x - 20, 500, 45, 30);\n textSize(18);\n noStroke();\n fill(255, 100, 0);\n text(g.carrierFrac, diff1 + temp.x - 15, 520);\n pop();\n } else if (g.carrierTruth && diff1 < 25 && g.solventTruth) {\n line(diff1 + temp.x, 450, diff1 + temp.x, 460);\n line(diff1 + temp.x, 492, diff1 + temp.x, 500);\n push();\n drawingContext.setLineDash([0, 0]);\n stroke(0);\n strokeWeight(1);\n fill(255);\n rect(diff1 + temp.x - 20, 500, 45, 30);\n strokeWeight(.8);\n textSize(18);\n noStroke();\n fill(255, 100, 0);\n text(g.carrierFrac, diff1 + temp.x - 15, 520);\n pop();\n } else if (g.carrierTruth && !g.solventTruth) {\n line(diff1 + temp.x, 450, diff1 + temp.x, 500);\n push();\n drawingContext.setLineDash([0, 0]);\n stroke(0);\n strokeWeight(1);\n fill(255);\n rect(diff1 + temp.x - 20, 500, 45, 30);\n strokeWeight(.8);\n textSize(18);\n noStroke();\n fill(255, 100, 0);\n text(g.carrierFrac, diff1 + temp.x - 15, 520);\n pop();\n }\n pop();\n let temp1 = 1 - sVal - soVal;\n let temp2 = temp1.toFixed(2);\n g.carrierFrac = temp2;\n } \n}", "function updateDirectionsPanel() {\n var output = '';\n var route = namespace.directionsDisplay.getDirections().routes[0]\n for (var i = 0; i < namespace.markers.length - 1; i++) {\n var dir = route.legs[i]\n var cat = namespace.markers[i+1].category;\n if (i == 0) {\n output += '<div class=\"dir_start Origin\">'+ dir.start_address +'</div>';\n }\n output += '<div class=\"dir_summary silver\">Travel: '+ dir.distance.text +' - about '+ dir.duration.text +'</div>';\n output += '<table>';\n for (var j = 0; j < dir.steps.length; j++){\n output += '<tr style=\"border-bottom: 1px solid silver;\">';\n output += '<td class=\"dir_row\"><span class=\"dir_sprite '+ dir.steps[j].maneuver +'\"></span></td>';\n output += '<td class=\"dir_row\">'+ (j+1) +'.</td>';\n output += '<td class=\"dir_row\">'+ dir.steps[j].instructions +'</td>';\n output += '<td class=\"dir_row\" style=\"white-space:nowrap;\">'+ dir.steps[j].distance.text +'</td>';\n output += '</tr>';\n }\n output += '</table>';\n output += '<div class=\"dir_end ' + cat + '\"' + '>'+ dir.end_address +'</div>';\n }\n $('#panel').html(output);\n}", "printHole () {\n for (let i = this.holePosition.latitude - (this.holeSide / 2);\n i < this.holePosition.latitude + (this.holeSide / 2);\n i++) {\n for (let j = this.holePosition.longitude - (this.holeSide / 2);\n j < this.holePosition.longitude + (this.holeSide / 2);\n j++) {\n this.matrix.setElement(j, i, '*');\n }\n }\n }", "geistBewegen() {\n //variablen heranholen zur leichteren lesbarkeit\n\n let knoten = this.knoten;\n let geist = this.geist;\n let pacman = this.pacMan;\n let level = this.level;\n let geistAltX = this.geist.posX;\n let geistAltY = this.geist.posY;\n geist.isMoving = false;\n if (knoten[geist.posY][geist.posX].nexthop(geist.richtungNeu) == geist.richtungNeu) { //prüfung ob der nächste schritt ein feld ist auf das man sich bewegen darf\n geist.richtung = geist.richtungNeu;\n switch (geist.richtung) {\n case Spielvariablen.Richtungen.hoch:\n {\n geist.posY--;\n geist.offsetY = this.factor;\n break;\n }\n case Spielvariablen.Richtungen.links:\n {\n geist.posX--;\n geist.offsetX = this.factor;\n break;\n }\n case Spielvariablen.Richtungen.rechts:\n {\n geist.posX++;\n geist.offsetX = -this.factor;\n break;\n }\n case Spielvariablen.Richtungen.runter:\n {\n geist.offsetY = -this.factor;\n geist.posY++;\n break;\n }\n } //richtungsänderung\n //positionsänderung mit evtl. übersprung auf andere seite\n if (geist.posX < 0)geist.posX = knoten[0].length - 1;\n if (geist.posY < 0)geist.posY = knoten.length - 1;\n if (geist.posX > knoten[0].length - 1)geist.posX = 0;\n if (geist.posY > knoten.length - 1)geist.posY = 0;\n if (pacman.posX == geist.posX && pacman.posY == geist.posY) this.beendet = true;\n\n if (!(geist.posX == geistAltX && geist.posY == geistAltY))geist.isMoving = true;\n\n }\n //ängstlich zurücksetzen wenn geist im haus\n if (level[geist.posY][geist.posX] == Spielvariablen.Feldtypen.geisterHaus || level[geist.posY][geist.posX] == Spielvariablen.Feldtypen.geistSpawn || level[geist.posY][geist.posX] == Spielvariablen.Feldtypen.tuer)zustand.aengstlich = false;\n geist.richtung = 5;\n\n\n if (this.beendet) {\n zustand.status = 3;\n Spielvariablen.Spielstart = false;\n }\n }", "function update() {\n hideDetails();\n d3.selectAll()\n //d3.select('#map-neighborhoodotlns').selectAll('#').attr('fill', 'none')\n d3.selectAll('.lang-dot').attr('fill-opacity', '0.2').attr('stroke-opacity', '1') // reset all dots\n d3.select('#leader-lines').selectAll('*').remove(); //remove leader lines and text.\n d3.selectAll('.leader-line').remove(); // remove all leader lines\n //d3.selectAll('.nbd-otln').attr('stroke', 'transparent')\n d3.selectAll('.selected').classed('selected', false); // remove 'selected' class from everything\n //nbdOtlns.attr('d', path);\n\n /*institutionDotLabels.attr('x', (d) => { return map.latLngToLayerPoint( [d3.geoCentroid(d)[1], d3.geoCentroid(d)[0]] ).x })\n .attr('y', (d) => { return map.latLngToLayerPoint( [d3.geoCentroid(d)[1], d3.geoCentroid(d)[0]] ).y })*/\n\n /*institutionDots.attr('cx', (d) => { return map.latLngToLayerPoint( [d3.geoCentroid(d)[1], d3.geoCentroid(d)[0]] ).x })\n .attr('cy', (d) => { return map.latLngToLayerPoint( [d3.geoCentroid(d)[1], d3.geoCentroid(d)[0]] ).y })\n .attr('r', () => {\n var currentZoom = map.getZoom();\n rMap = d3.scaleLinear()\n .domain([11, 15])\n .range([1, 7]);\n return rMap(currentZoom);\n })\n .classed('hidden', false);*/\n\n var zoomLevel = map.getZoom();\n zMap = d3.scaleLinear()\n .domain([11, 15])\n .range([0, 0.75]);\n\n neighborhoodOutlines.attr('d', path);\n neighborhoodSymbolGroup.attr('transform', (d) => {\n return `translate(${map.latLngToLayerPoint( [d3.geoCentroid(d)[1], d3.geoCentroid(d)[0]] ).x}, ${map.latLngToLayerPoint( [d3.geoCentroid(d)[1], d3.geoCentroid(d)[0]] ).y}) scale(${zMap(zoomLevel) + 1})`\n })\n .attr('class', () => {\n let zoom = map.getZoom();\n if (zoom > 15.5) {\n return 'map inst mapsymbol-hidden'\n } else {\n return 'map inst'\n }\n })\n institutionGroups.attr('transform', (d) => {\n\n return `translate(${map.latLngToLayerPoint( [d3.geoCentroid(d)[1], d3.geoCentroid(d)[0]] ).x}, ${map.latLngToLayerPoint( [d3.geoCentroid(d)[1], d3.geoCentroid(d)[0]] ).y}) scale(${zMap(zoomLevel) + 1})`\n })\n .attr('class', () => {\n let zoom = map.getZoom();\n if (zoom < 13.5) {\n return 'map inst mapsymbol-hidden'\n } else {\n return 'map inst'\n }\n })\n\n}", "function updateCloudDirViz(){\n var vel = cloudParticleGroup.emitters[0].velocity.value;\n var pos = cloudParticleGroup.emitters[0].position.value;\n cloudDirViz.position.set(pos.x,pos.y,pos.z);\n cloudDirViz.setDirection(vel.clone().normalize());\n cloudDirViz.setLength(vel.length());\n}", "function computeOctant(location) {\n\t\n\tif (location.lat > 0) {\n\t\tif (location.lng < -90) {\n\t\t\tlocation.octant = 0;\n\t\t} else if (location.lng < 0) {\n\t\t\tlocation.octant = 1;\n\t\t} else if (location.lng < 90) {\n\t\t\tlocation.octant = 2;\n\t\t} else {\n\t\t\tlocation.octant = 3;\n\t\t}\n\t} else {\n\t\tif (location.lng < -90) {\n\t\t\tlocation.octant = 4;\n\t\t} else if (location.lng < 0) {\n\t\t\tlocation.octant = 5;\n\t\t} else if (location.lng < 90) {\n\t\t\tlocation.octant = 6;\n\t\t} else {\n\t\t\tlocation.octant = 7;\n\t\t}\n\t}\n\t\n\t// Compute remainder x,y mapping them to [0,1]\n\tlocation.x = ((location.lng + 180) % 90) / 90;\n\tlocation.y = Math.abs(location.lat) / 90;\n\tlocation.x *= (1-location.y);\n\tlocation.levels = [];\n\t\n\treturn location;\n}", "getResidueCoordinates(r, renderedInteractor) {\n let x = renderedInteractor.getResXwithStickZoom(r) * this.controller.z;\n let y = 0;\n if (renderedInteractor.stickZoom >= 8) { //if sequence shown\n const from = this.renderedFromProtein,\n to = this.renderedToProtein;\n const deltaX = from.ix - to.ix;\n const deltaY = from.iy - to.iy;\n const angleBetweenMidPoints = Math.atan2(deltaY, deltaX);\n //todo: tidy up trig code so everything is always in radians?\n let abmpDeg = angleBetweenMidPoints / (2 * Math.PI) * 360;\n if (abmpDeg < 0) {\n abmpDeg += 360;\n }\n\n let out; //'out' is value we use to decide which side of letter the line is drawn\n if (renderedInteractor === from) {\n out = (abmpDeg - from.rotation);\n if (out < 0) {\n out += 360;\n }\n let fyOffset = 5;\n if (out < 180) {\n fyOffset = -5;\n }\n\n y = fyOffset * this.controller.z;\n } else { // renderedInteractor === to\n out = (abmpDeg - to.rotation);\n if (out < 0) {\n out += 360;\n }\n let tyOffset = 5;\n if (out > 180) {\n tyOffset = -5;\n }\n y = tyOffset * this.controller.z;\n }\n }\n\n const rotated = rotatePointAboutPoint([x, y], [0, 0], renderedInteractor.rotation);\n\n x = rotated[0] + renderedInteractor.ix;\n y = rotated[1] + renderedInteractor.iy;\n return [x, y];\n }", "function displayLocation(name){\n\t$( \".probe\" ).remove();\n\n\tvar spliceVariants= $(\".SV\").map(function() {\n\t return $(this).val();\n\t}).get();\n\n\tvar longestSeq = spliceVariants.sort(function (a, b) { return b.length - a.length; })[0];\n\n\tspliceVariants= $(\".SV\").map(function() {\n\t return $(this).val();\n\t}).get();\n\n\tvar xScale = d3.scaleLinear()//scaleLinear v4\n .domain(\n \t[0,longestSeq.length]\n )\n .range([0,580]);\n\n\tvar yloc = 10;\n\tvar found = false;\n\tfor(var i = 0; i < spliceVariants.length; i++){\n\t\t\n\t\tif(spliceVariants[i].indexOf(name) != -1){// if transcript contains the desired probe\n\t\t\t// for loop find all matches\n\t\t\tfound = true;\n\t\t\tvar indices = indexes(spliceVariants[i],name);\n\t\t\tfor(j = 0; j < indices.length; j++){\n\t\t\t\td3.select(\"#svgT\").append(\"rect\")\n\t\t\t\t .attr(\"x\", xScale(indices[j]))\n\t\t\t\t .attr(\"y\", yloc - 0)// -5\n\t\t\t\t .attr(\"width\", xScale(name.length))\n\t\t\t\t .attr(\"height\", 20)//3\n\t\t\t\t .attr(\"class\", \"probe\")\n\t\t\t\t .style(\"opacity\",\"0.65\")//1\n\t\t\t\t .style(\"pointer-events\",\"none\")\n\t\t\t\t\t\t\t.attr(\"fill\", \"white\");//rgb(228, 75, 75)\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\tyloc += 30;\n\t}\n\treturn found; \n}", "research() {\n return `r ${this.pos.x} ${this.pos.y}`;\n }", "function alternateLocation() {\n $scope.alternateLocationDetails = true;\n }", "function togglePreviousLocations() {\n\tfor(i = 0; i < previousLocations.length; i++) {\n\t\tpreviousLocations[i].setVisible(!previousLocations[i].getVisible());\n\t}\n}", "function updateRelativePositions() {\n\n\tminPoiDistance = Number.MAX_VALUE;\n\tmaxPoiDistance = 0;\n\n\tfor (i=0, l=pois.length; i<l; i++) {\n\n\t\tvar poi = pois[i];\n\t\t\n\t\tif (poi.view) {\n\n\t\t\tpoi.distance = location_utils.calculateDistance(deviceLocation, poi);\n\t\t\t\n\t\t\t// this would ideally be more of a databinding event\n\t\t\tif (poi.controller) {\n\t\t\t\tpoi.controller.setDistance(location_utils.neatUSfromMeters(poi.distance));\n\t\t\t}\n\t\t\t\n\t\t\tif (poi.distance <= maxRange) {\n\t\t\t\t\n\t\t\t\tmaxPoiDistance = Math.max(maxPoiDistance, poi.distance);\n\t\t\t\tminPoiDistance = Math.min(minPoiDistance, poi.distance);\n\t\t\t\t\n\t\t\t\tpoi.inRange = true;\n\n\t\t\t\tpoi.bearing = location_utils.calculateBearing(deviceLocation, poi);\t\t\t\t\n\t\t\t} \n\t\t\telse {\n\t\t\t\t// don't show pois that are beyond maxDistance\n\t\t\t\tpoi.inRange = false;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tpoiDistanceRange = maxPoiDistance - minPoiDistance;\n\n\t// Sort by Distance\n\tpois.sort(function(a, b) {\n\t\treturn b.distance - a.distance;\n\t});\n\n\t\t\t\t\n\tradarRange = Math.max(100, pois[0].distance);\n\n\tvar cnt = pois.length;\n\trankHeight = yRange / cnt;\n\t\n\tfor (i=0; i<cnt; i++) {\n\t\tpois[i].view.zIndex = i;\n\t\tpois[i].distanceRank = i;\n\t\tpositionRadarBlip(pois[i]);\n\t}\n}", "function tour() {\n let target = pointMaker(Number(document.getElementById('x').value), Number(document.getElementById('y').value));\n let count = 0;\n let tmp = target;\n let i = 1;\n console.log(JSON.stringify(tmp));\n do {\n if (tmp.x >= 2 && tmp.y >= 1 && tmp.x > tmp.y) { // BOTH POS\n tmp.x -= 2;\n tmp.y -= 1;\n count++;\n console.log(\"1st \" + count);\n console.log(\"Values :\" + tmp.x + \",\" + tmp.y);\n } else if (tmp.x >= 1 && tmp.y >= 2 && tmp.x < tmp.y) { // BOTH POS\n tmp.x -= 1;\n tmp.y -= 2;\n count++;\n console.log(\"2nd \" + count);\n console.log(\"Values :\" + tmp.x + \",\" + tmp.y);\n } else if (tmp.x <= -1 && tmp.y <= -2 && tmp.x > tmp.y) { // BOTH NEG\n tmp.x += 1;\n tmp.y += 2;\n count++;\n console.log(\"3rd \" + count);\n console.log(\"Values :\" + tmp.x + \",\" + tmp.y);\n } else if (tmp.x <= -2 && tmp.y <= -1 && tmp.x < tmp.y) { // BOTH NEG\n tmp.x += 2;\n tmp.y += 1;\n count++;\n console.log(\"4th \" + count);\n console.log(\"Values :\" + tmp.x + \",\" + tmp.y);\n } else if (tmp.x <= -1 && tmp.y >= 2 && tmp.x < tmp.y) { //X is NEG\n tmp.x += 1;\n tmp.y -= 2;\n count++;\n console.log(\"5th \" + count);\n console.log(\"Values :\" + tmp.x + \",\" + tmp.y);\n } else if (tmp.x <= -2 && tmp.y >= 1 && tmp.x < tmp.y) { //X is NEG\n tmp.x += 2;\n tmp.y -= 1;\n count++;\n console.log(\"6th \" + count);\n console.log(\"Values :\" + tmp.x + \",\" + tmp.y);\n } else if (tmp.x >= 1 && tmp.y <= -2 && tmp.x > tmp.y) { //Y is NEG\n tmp.x -= 1;\n tmp.y += 2;\n count++;\n console.log(\"7th \" + count);\n console.log(\"Values :\" + tmp.x + \",\" + tmp.y);\n } else if (tmp.x >= 2 && tmp.y <= -1 && tmp.x > tmp.y) { //Y is NEG\n tmp.x -= 2;\n tmp.y += 1;\n count++;\n console.log(\"8th \" + count);\n console.log(\"Values :\" + tmp.x + \",\" + tmp.y);\n } else if (tmp.x === 0 && tmp.y >= 2) {\n tmp.x += 1;\n tmp.y -= 2;\n count++;\n console.log(\"9th \" + count);\n console.log(\"Values :\" + tmp.x + \",\" + tmp.y);\n } else if (tmp.x === 0 && tmp.y >= 1) {\n tmp.x += 2;\n tmp.y -= 1;\n count++;\n console.log(\"10th \" + count);\n console.log(\"Values :\" + tmp.x + \",\" + tmp.y);\n } else if (tmp.x === 0 && tmp.y <= -2) {\n tmp.x -= 1;\n tmp.y += 2;\n count++;\n console.log(\"11th \" + count);\n console.log(\"Values :\" + tmp.x + \",\" + tmp.y);\n } else if (tmp.x === 0 && tmp.y <= -1) {\n tmp.x -= 2;\n tmp.y += 1;\n count++;\n console.log(\"12th \" + count);\n console.log(\"Values :\" + tmp.x + \",\" + tmp.y);\n } else if (tmp.x >= 2 && tmp.y === 0) {\n tmp.x -= 2;\n tmp.y += 1;\n count++;\n console.log(\"13th \" + count);\n console.log(\"Values :\" + tmp.x + \",\" + tmp.y);\n } else if (tmp.x >= 1 && tmp.y === 0) {\n tmp.x -= 1;\n tmp.y += 2;\n count++;\n console.log(\"14th \" + count);\n console.log(\"Values :\" + tmp.x + \",\" + tmp.y);\n } else if (tmp.x <= -2 && tmp.y === 0) {\n tmp.x += 2;\n tmp.y -= 1;\n count++;\n console.log(\"15th \" + count);\n console.log(\"Values :\" + tmp.x + \",\" + tmp.y);\n } else if (tmp.x <= -1 && tmp.y === 0) {\n tmp.x -= 1;\n tmp.y -= 2;\n count++;\n console.log(\"16th \" + count);\n console.log(\"Values :\" + tmp.x + \",\" + tmp.y);\n } else if ((tmp.x === tmp.y) && (tmp.x !== 0) && (tmp.y !== 0)) {\n tmp.x -= 2;\n tmp.y -= 1;\n count++;\n console.log(\"end \" + count);\n } else if (tmp.x === 0 && tmp.y === 0) {\n i = 0;\n }\n } while (i === 1);//(tmp.x !== 0) && (tmp.y !== 0));//\n alert(\"Solution: \" + count);\n console.log(\"Solution: \" + count);\n}", "function inverti_coordinate(array,coordinata1,coordinata2){\n for(var i=0;i<array.length;i++){\n //inverto x e y\n if(coordinata1 === 0 && coordinata2 === 1 || coordinata1 === 1 && coordinata2 === 0){\n var a_supp = array[i][0];\n array[i][0] = array[i][1];\n array[i][1] = a_supp ;\n }\n else if(coordinata1 === 0 && coordinata2 === 2 || coordinata1 === 2 && coordinata2 === 0){\n var a_supp = array[i][0];\n array[i][0] = array[i][2];\n array[i][2] = a_supp ;\n }\n else if(coordinata1 === 2 && coordinata2 === 1 || coordinata1 === 1 && coordinata2 === 2){\n var a_supp = array[i][2];\n array[i][2] = array[i][1];\n array[i][1] = a_supp ;\n }\n\n else\n console.log(\"coordinata errata\");\n }\n return array;\n}", "function storePreviuosCoordinates(currentWorm)\r\n{\r\n\tfor(var i = histotyDotsSaved; i > 0; i--)\r\n\t{\r\n\t\tcurrentWorm.previousX[i] = currentWorm.previousX[i-1];\r\n\t\tcurrentWorm.previousY[i] = currentWorm.previousY[i-1];\r\n\t}\r\n\tcurrentWorm.previousX[0] = currentWorm.x;\r\n\tcurrentWorm.previousY[0] = currentWorm.y;\r\n\t\r\n}", "function inverse$j(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n\n var lon = adjust_lon(this.long0 + p.x / this.a);\n var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "function PolarCoordinates() {\r\n}", "function updateSnakeCoordinates() {\n\n for (var i = 0; i < numSegments - 1; i++) {\n xCor[i] = xCor[i + 1];\n yCor[i] = yCor[i + 1];\n }\n switch (direction) {\n case 'right':\n xCor[numSegments - 1] = xCor[numSegments - 2] + diff;\n yCor[numSegments - 1] = yCor[numSegments - 2];\n break;\n case 'up':\n xCor[numSegments - 1] = xCor[numSegments - 2];\n yCor[numSegments - 1] = yCor[numSegments - 2] - diff;\n break;\n case 'left':\n xCor[numSegments - 1] = xCor[numSegments - 2] - diff;\n yCor[numSegments - 1] = yCor[numSegments - 2];\n break;\n case 'down':\n xCor[numSegments - 1] = xCor[numSegments - 2];\n yCor[numSegments - 1] = yCor[numSegments - 2] + diff;\n break;\n }\n}", "function describeLocationAndSorroundings(playerLocation) {\n\n displayMessage(describeMyLocation(playerLocation));\n\n var directions = [\"north\", \"northeast\", \"east\", \"southeast\",\n \"south\", \"southwest\", \"west\", \"northwest\"];\n\n for (var i = 0; i < directions.length; i++) {\n var deltaX = 0;\n var deltaY = 0;\n\n switch(directions[i]) {\n case \"north\":\n deltaY = 1;\n break;\n case \"northeast\":\n deltaX = 1;\n deltaY = 1;\n break;\n case \"east\":\n deltaX = 1;\n break;\n case \"southeast\":\n deltaX = 1;\n deltaY = -1;\n break;\n case \"south\":\n deltaY = -1;\n break;\n case \"southwest\":\n deltaX = -1;\n deltaY = -1;\n break;\n case \"west\":\n deltaX = -1;\n break;\n case \"northwest\":\n deltaX = -1;\n deltaY = 1;\n break;\n default:\n var errorMessage = \"Unknown direction \" + tokens[1];\n displayMessage(errorMessage);\n return false;\n }\n\n // Does the requested location exist? First get the current player location.\n var originalX = parseInt(playerLocation.x);\n var originalY = parseInt(playerLocation.y);\n var newX = originalX + deltaX;\n var newY = originalY + deltaY;\n console.log(\"searching for location [\" + newX + \", \" + newY + \"].\");\n\n if (!locationExists(newY -1, newX -1)) {\n continue;\n }\n\n var newLocation = maplocationData[newY -1][newX -1];\n var message = \"To the \" + directions[i] + \" - \";\n message += describeLocation(newLocation, describeDetailEnum.TERRAIN_ONLY);\n displayMessage(message);\n }\n\n displayMessage(\"\");\n}", "function add_live_loc(x, y, z) {\n\n marker_pos_x = \"\";\n marker_pos_y = \"\";\n // here y shows left-right position and x shows top-bottom position(x-top_bottom,y-left_right)\n //alert(z);\n // console.log(x);\n // console.log(y);\n\n\n var result = z.split(\"-\");\n //marker render for left side\n if (result[1] == \"L\") {\n marker_pos_x = x + 20;\n marker_pos_y = y - 90;\n\n }\n //marker render for right side\n else if (result[1] == \"R\") {\n marker_pos_x = x + 20;\n marker_pos_y = y + 90;\n\n }\n\n else if (result[1] == \"RR\") {\n marker_pos_x = x + 20;\n marker_pos_y = y + 260;\n\n }\n //marker render for top side\n else if (result[1] == \"T\") {\n marker_pos_x = x + 90;\n marker_pos_y = y + 5;\n\n }\n //marker render for bottom side\n\n else if (result[1] == \"B\") {\n marker_pos_x = x - 50;\n marker_pos_y = y + 5;\n\n }\n\n else if (result[1] == \"L1\") {\n marker_pos_x = x + 20;\n marker_pos_y = y - 180;\n\n }\n else if (result[1] == \"L2\") {\n marker_pos_x = x + 20;\n marker_pos_y = y - 270;\n\n }\n else if (result[1] == \"L3\") {\n marker_pos_x = x + 20;\n marker_pos_y = y - 360;\n\n }\n\n else if (result[1] == \"L4\") {\n marker_pos_x = x + 20;\n marker_pos_y = y - 450;\n\n }\n\n else if (result[1] == \"L5\") {\n marker_pos_x = x + 20;\n marker_pos_y = y - 540;\n\n }\n\n else if (result[1] == \"L6\") {\n marker_pos_x = x + 20;\n marker_pos_y = y - 630;\n\n }\n\n\n else if (result[1] == \"LA1\" || result[1] == \"LA2\" || result[1] == \"LA3\" || result[1] == \"LA4\") {\n\n marker_pos_x = x + 25;\n marker_pos_y = y - 150;\n\n }\n\n else if (result[1] == \"LB1\" || result[1] == \"LB2\" || result[1] == \"LB3\" || result[1] == \"LB4\") {\n\n marker_pos_x = x + 25;\n marker_pos_y = y - 120;\n\n }\n else if (result[1] == \"LC1\" || result[1] == \"LC2\" || result[1] == \"LC3\" || result[1] == \"LC4\") {\n\n marker_pos_x = x + 25;\n marker_pos_y = y - 90;\n\n }\n\n else if (result[1] == \"LD1\" || result[1] == \"LD2\" || result[1] == \"LD3\" || result[1] == \"LD4\") {\n\n marker_pos_x = x + 25;\n marker_pos_y = y - 60;\n\n }\n\n else if (result[1] == \"RD1\" || result[1] == \"RD2\" || result[1] == \"RD3\" || result[1] == \"RD4\") {\n\n marker_pos_x = x + 25;\n marker_pos_y = y + 60;\n }\n\n else if (result[1] == \"RC1\" || result[1] == \"RC2\" || result[1] == \"RC3\" || result[1] == \"RC4\") {\n\n marker_pos_x = x + 25;\n marker_pos_y = y + 80;\n }\n\n else if (result[1] == \"RB1\" || result[1] == \"RB2\" || result[1] == \"RB3\" || result[1] == \"RB4\") {\n\n marker_pos_x = x + 25;\n marker_pos_y = y + 110;\n }\n\n else if (result[1] == \"RA1\" || result[1] == \"RA2\" || result[1] == \"RA3\" || result[1] == \"RA4\") {\n\n marker_pos_x = x + 25;\n marker_pos_y = y + 140;\n }\n\n /*else {\n \n marker_pos_x=0;\n marker_pos_y=0;\n }*/\n\n\n\n updated_lat = marker_pos_x;\n updated_lng = marker_pos_y;\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [40, 40] }\n });\n\n //http://maps.google.com/mapfiles/ms/icons/red-dot.png\n //var greenIcon = new LeafIcon({iconUrl: 'http://maps.google.com/mapfiles/ms/icons/red-dot.png'});\n //var greenIcon = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='live_loc.png')}}\"});\n var greenIcon = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='red_loc.png')}}\" });\n\n // var greenIcon = new LeafIcon({iconUrl: 'http://labs.google.com/ridefinder/images/mm_20_yellow.png'});\n live_marker = L.marker([updated_lat, updated_lng], { icon: greenIcon })\n live_marker.addTo(myFeatureGroup)\n live_marker_array.push(live_marker);\n for (i = 0; i < live_marker_array.length - 1; i++) {\n if (live_marker_array.length > 1) {\n live_marker_array[i].remove();\n\n }\n }\n //console.log(\"done\");\n\n}", "function addOffMapLocation(projection, idx, baseLatLon, name, port, svg, depot_id) {\n pair = [baseLatLon[0]-idx*.3, baseLatLon[1]-idx] //the idx*.3 straigthens out the line\n node = addMapLocation(projection, name, port, pair, svg, depot_id)\n node.append(\"text\")\n .attr(\"dx\", function(d){return 10})\n .attr(\"dy\", function(d){return 4})\n .text(function(d) {return name})\n}", "function updateDisplay() {\r\n\r\n\tif (counter < step) {\r\n\t\tpathLine.getCoordinates().pushLatLngAlt(player1Lat, player1Lon, 0);\r\n\t\tpathLine.getCoordinates().pushLatLngAlt(player1Lat+latInc, player1Lon+lonInc, 0);\t\t\t\r\n\t\tplayer1Lat += latInc;\r\n\t\tplayer1Lon += lonInc;\t\t\t\r\n\t\t\r\n\t\tif (Math.abs(projHeading - playerHeading ) > Math.abs(headingInc)) {\r\n\t\t\tplayerHeading += headingInc;\r\n\t\t\tif (playerHeading > 180 ) {\r\n\t\t\t\tplayerHeading = -180;\r\n\t\t\t\t//alert(\"greater than one hundred and eighty degrees occured!!\");\r\n\t\t\t} else if ( playerHeading < -180) {\r\n\t\t\t\tplayerHeading = 180;\r\n\t\t\t\t//alert(\"less than negative one hundred and eighty degrees occured!!\");\r\n\t\t\t}//end if\r\n\t\t}//fi//*/\r\n\t\tcounter++;\r\n\t\t\r\n\t} else {\r\n\t\tstep = projStep;\r\n\t\tcounter = 0;\r\n\t\t//get new lat lon pair\r\n\t\tplayer1Lat = TDLLat[currentPtIndex];\r\n\t\tplayer1NextLat = TDLLat[currentPtIndex+1];\r\n\t\tlatInc = (player1NextLat-player1Lat)/step;\r\n\t\t\r\n\t\tplayer1Lon = TDLLon[currentPtIndex];\t\t\r\n\t\tplayer1NextLon = TDLLon[currentPtIndex+1];\t\t\r\n\t\tlonInc = (player1NextLon-player1Lon)/step;\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tvar tmpHeading = getBearing(player1Lat, player1Lon, player1NextLat, player1NextLon);\r\n\t\tif (tmpHeading != -999) {\r\n\t\t\tprojHeading = tmpHeading;\t\t\t\r\n\t\t} //fi\r\n\r\n\t\t\r\n\t\tif ((projHeading - playerHeading) > 180) {\r\n\t\t\theadingInc = (projHeading - playerHeading -360)/ step * 3;\r\n\t\t\t//alert(\"turning other way!!\");\r\n\t\t} else if ((projHeading - playerHeading) < -180) {\r\n\t\t\theadingInc = (projHeading - playerHeading + 360 )/ step * 3;\r\n\t\t\t//alert(\"turning other way!!\");\r\n\t\t} else {\r\n\t\t\theadingInc = (projHeading - playerHeading) / step * 3;\r\n\r\n\t\t}//fi */\r\n\t\t\r\n\t\tplayerHeading += headingInc;\r\n\r\n\t\t\r\n\t\tif (currentPtIndex < tripDataLength-1) {\r\n\t\t\tcurrentPtIndex ++;\r\n\t\t} else {\r\n\t\t\tcurrentPtIndex = 0;\r\n\t\t\t\r\n\t\t}//fi */\r\n\r\n\r\n\t}//fi\r\n\r\n\r\n\tvar latLonBox = ge.createLatLonBox('');\r\n\t\t\r\n\tlatLonBox.setBox(player1Lat+0.0002, player1Lat-0.0002, player1Lon+0.0002, player1Lon-0.0002, playerHeading);\r\n\tplayerGO.setLatLonBox(latLonBox);\r\n\t\r\n\tvar loc = ge.createLocation(''); \r\n\tloc.setLatitude(player1Lat); \r\n\tloc.setLongitude(player1Lon); \r\n\tplayerModel.setLocation(loc); \r\n\tplayerModel.setLocation(loc); \r\n\r\n\tvar playerOrientation = ge.createOrientation('');\r\n\tplayerOrientation.setHeading(-playerHeading);\r\n\tplayerModel.setOrientation(playerOrientation);\t\t\r\n\t\t\r\n\tif (modelID == 0) {\r\n\r\n\t} else if (modelID == 1){\r\n\r\n\t} else if (modelID == 2) {\r\n\t\tplayerOrientation.setHeading(-playerHeading);\t\r\n\t\t\r\n\t} else if (modelID == 3) {\r\n\t\tplayerOrientation.setHeading(-playerHeading-90);\t\t\r\n\t\t\t\r\n\t}//fi\r\n\r\n\t\r\n\tnew_cam = ge.getView().copyAsLookAt(ge.ALTITUDE_ABSOLUTE );\t\t\r\n\tnew_cam.setLatitude(player1Lat); \r\n\tnew_cam.setLongitude(player1Lon); \r\n\tge.getView().setAbstractView(new_cam); \r\n\r\n\r\n\t//car glow\r\n\tif (playerGOOpacity > 0.95) {\r\n\t\tplayerGOOpacityInc = -0.05;\r\n\t} else if (playerGOOpacity < 0.05) {\r\n\t\tplayerGOOpacityInc = 0.05;\r\n\t}//end if\r\n\tplayerGOOpacity += playerGOOpacityInc;\r\n\tplayerGO.setOpacity(playerGOOpacity);\r\n\t\r\n\t\r\n\t\r\n\r\n}//end method", "function deplacement(direction) {\r\n //retourner un message qui décrit le contenu de la case\r\n switch (direction) {\r\n case \"O\":\r\n if (joueur.x > 0) {\r\n joueur.x--;\r\n console.log(\"Vous vous déplacez vers l'ouest\");\r\n }else{\r\n console.log('Vous ne pouvez plus avancer dans cette direction');\r\n }\r\n break;\r\n case \"N\":\r\n if (joueur.y > 0) {\r\n joueur.y--;\r\n console.log(\"Vous vous déplacez au nord\");\r\n }else{\r\n console.log('Vous ne pouvez plus avancer dans cette direction');\r\n }\r\n break;\r\n case \"E\":\r\n if (joueur.x < map[joueur.y].length - 1) {\r\n joueur.x++;\r\n console.log(\"Vous vous déplacez à l'est\");\r\n }else{\r\n console.log('Vous ne pouvez plus avancer dans cette direction');\r\n }\r\n break;\r\n case \"S\":\r\n if (joueur.y < map.lenght-1) {\r\n joueur.y++;\r\n console.log(\"Vous vous déplacez au sud\");\r\n }else{\r\n console.log('Vous ne pouvez plus avancer dans cette direction');\r\n }\r\n break;\r\n case \"NE\":\r\n if (joueur.y > 0 && joueur.x < map[joueur.y].length - 1) {\r\n joueur.y--;\r\n joueur.x++;\r\n console.log(\"Vous allez au Nord-Est\");\r\n } else {\r\n console.log(\"Vous ne pouvez pas prendre cette direction\");\r\n }\r\n break;\r\n case \"SE\":\r\n if (joueur.y < map.length - 1 && joueur.x < map[joueur.y].length - 1) {\r\n joueur.y++;\r\n joueur.x++;\r\n console.log(\"Vous allez au Sud-Est\")\r\n } else {\r\n console.log(\"Vous ne pouvez pas prendre cette direction\");\r\n }\r\n break;\r\n case \"NO\":\r\n if (joueur.y > 0 && joueur.x > 0) {\r\n joueur.y--;\r\n joueur.x--;\r\n console.log(\"Vous allez au Nord-Ouest\");\r\n } else {\r\n console.log(\"Vous ne pouvez pas prendre cette direction\");\r\n }\r\n break;\r\n case \"SO\":\r\n if (joueur.y < map.length - 1 && joueur.x > 0) {\r\n joueur.y++;\r\n joueur.x--;\r\n console.log(\"Vous allez au Sud-Ouest\");\r\n } else {\r\n console.log(\"Vous ne pouvez pas prendre cette direction\");\r\n }\r\n break;\r\n default:\r\n console.log(\"Erreur de direction\");\r\n }\r\n\r\n\r\n switch (map[joueur.y][joueur.x]) {\r\n case \"_\":\r\n console.log(\"C'est une plaine\");\r\n break;\r\n case \"C\":\r\n console.log(\"C'est le château\");\r\n break;\r\n case \"M\":\r\n console.log(\"Vous arrivez devant un monstres\");\r\n combatmodule.attaque()\r\n break;\r\n case \"SOR\":\r\n console.log(\"Bravo! Tu as atteint la sortie - Fin\");\r\n break;\r\n case \"EP\":\r\n console.log(\"Tu as trouvé une épée\");\r\n break;\r\n case \"CM\":\r\n console.log(\"Tu as trouvé une cote de maille\");\r\n break;\r\n }\r\n}", "function inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat, ts, ce, Chi;\n var rh = Math.sqrt(p.x * p.x + p.y * p.y);\n if (this.sphere) {\n var c = 2 * Math.atan(rh / (2 * this.a * this.k0));\n lon = this.long0;\n lat = this.lat0;\n if (rh <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n p.x = lon;\n p.y = lat;\n return p;\n }\n lat = Math.asin(Math.cos(c) * this.sinlat0 + p.y * Math.sin(c) * this.coslat0 / rh);\n if (Math.abs(this.coslat0) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n if (this.lat0 > 0) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.long0 + Math.atan2(p.x, - 1 * p.y));\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.long0 + Math.atan2(p.x, p.y));\n }\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.long0 + Math.atan2(p.x * Math.sin(c), rh * this.coslat0 * Math.cos(c) - p.y * this.sinlat0 * Math.sin(c)));\n }\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n if (Math.abs(this.coslat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n if (rh <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n lat = this.lat0;\n lon = this.long0;\n p.x = lon;\n p.y = lat;\n //trace(p.toString());\n return p;\n }\n p.x *= this.con;\n p.y *= this.con;\n ts = rh * this.cons / (2 * this.a * this.k0);\n lat = this.con * Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, ts);\n lon = this.con * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.con * this.long0 + Math.atan2(p.x, - 1 * p.y));\n }\n else {\n ce = 2 * Math.atan(rh * this.cosX0 / (2 * this.a * this.k0 * this.ms1));\n lon = this.long0;\n if (rh <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n Chi = this.X0;\n }\n else {\n Chi = Math.asin(Math.cos(ce) * this.sinX0 + p.y * Math.sin(ce) * this.cosX0 / rh);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.long0 + Math.atan2(p.x * Math.sin(ce), rh * this.cosX0 * Math.cos(ce) - p.y * this.sinX0 * Math.sin(ce)));\n }\n lat = -1 * Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, Math.tan(0.5 * (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + Chi)));\n }\n }\n p.x = lon;\n p.y = lat;\n\n //trace(p.toString());\n return p;\n\n}", "function findWay(source){\n\n \n \n var id_room = $('#room').val().split(\" \").join(\"\").toLowerCase();\n id_room = zimmerNameId[id_room];\n \n graph = new Graph(map);\n var shortWay = [];\n shortWay = graph.findShortestPath(zonesNameId[source],id_room);\n console.log(\"the short way to the destination : \\n\"+shortWay);\n var len = shortWay.length;\n // the points of each noud which will be drawed\n var points =[];\n\n for(i=0;i<len;i++){\n var key = shortWay[i];\n if(mapCoordnidates[key]){\n object = {\"x\":mapCoordnidates[key].x, \"y\":mapCoordnidates[key].y};\n points.push(object);\n }\n }\n /*for(i=0;i<points.length;i++){\n\n console.log(\"points of the line : \\n\"+points[i].x+' '+points[i].y);\n }*/\n\n // draw the line of the points until the destination\n d3.select(\"#theWay\").attr(\"visibility\",\"hidden\");\n\n // hide the distination to draw it again\n // d3.select(\"#destination\").attr(\"visibility\",\"hidden\");\n\n var lineFunction = d3.svg.line()\n .x(function(d) { return d.x; })\n .y(function(d) { return d.y; })\n .interpolate(\"linear\");\n // the arrow of the end\n var defs = d3.select(\"#svg8\").append(\"svg:defs\");\n\n /* here to generate the marker shape and assign it the \"arrow\" id */\n defs.append(\"svg:marker\")\n .attr(\"id\", \"arrow\")\n .attr(\"viewBox\", \"0 0 10 10\")\n .attr(\"refX\", 1)\n .attr(\"refY\", 5)\n .attr(\"markerWidth\", 6)\n .attr(\"markerHeight\", 6)\n .attr(\"orient\", \"auto\")\n .attr('fill','#3498db')\n .append('svg:path')\n .attr('d', \"M 0 0 L 10 5 L 0 10 z\");\n\n d3.select(\"#theWay\").attr(\"d\", lineFunction(points))\n .attr(\"id\",\"theWay\")\n .attr(\"stroke\", \"#3498db\")\n .attr(\"stroke-width\", 2)\n .attr(\"fill\", \"none\")\n .attr(\"visibility\",\"visible\")\n .attr('marker-end', 'url(#arrow)');\n // draw the destination\n // d3.select(\"#\"+id_room)\n // .style(\"fill\",\"#d35400\")\n // .attr(\"r\",3)\n // .attr('id','destination')\n // .attr(\"visibility\",\"visible\");\n }// end finWay", "updateContour() {\n }", "function pos_luna(njd){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) ottobre 2010.\n // funzione per il calcolo della posizione della Luna.\n // njd= numero dei giorni giuliani per il T.U. di Greenwich.\n // coordinate equatoriali geocentriche per l'equinozio della data.\n\nvar T=(njd-2415020.0)/36525;\n\nvar L1=270.434164+481267.8831*T-0.001133*T*T+0.0000019*T*T*T; // longitudine media.\n\nvar M=358.475833+35999.04975*T-0.000150*T*T-0.0000033*T+T*T; // anomalia media del Sole\n\nvar M1=296.104608+477198.8491*T+0.009192*T*T+0.0000144*T*T*T; // anomalia media della Luna\n\nvar D=350.737486+445267.1142*T-0.001436*T*T+0.0000019*T*T*T; // elongazione media della Luna\n\nvar F=11.250889+483202.0251*T-0.003211*T*T-0.0000003*T*T*T; // distanza media della Luna dal suo nodo ascendente.\n\nvar N=259.183275-1934.1420*T+0.002078*T*T+0.0000022*T*T*T; // longitudine media del nodo ascendente della Luna.\n\n// termini additivi di correzione.\n\nvar Delta=0.003964*Math.sin(Rad(346.560+132.870*T-0.0091731*T*T));\n\nL1=L1+0.000233*Math.sin(Rad(51.2+20.2*T))+Delta;\n M= M-0.001778*Math.sin(Rad(51.2+20.2*T));\nM1=M1+0.000817*Math.sin(Rad(51.2+20.2*T))+Delta;\n D= D+0.002011*Math.sin(Rad(51.2+20.2*T))+Delta;\n\nL1=L1+0.001964*Math.sin(Rad(N));\nM1=M1+0.002541*Math.sin(Rad(N));\n D= D+0.001964*Math.sin(Rad(N));\n F= F-0.024691*Math.sin(Rad(N));\n F= F-0.004328*Math.sin(Rad(N+275.05-2.30*T));\n F= F+Delta;\n\nvar e=1-0.002495*T-0.00000752*T*T;\n\n// Calcola la Longitudine ecclittica.\n\nvar Long=L1+6.288750*Math.sin(Rad(M1))\n +1.274018*Math.sin(Rad(2*D-M1))\n +0.658309*Math.sin(Rad(2*D))\n +0.213616*Math.sin(Rad(2*M1))\n -0.185596*Math.sin(Rad(M))*e\n -0.114336*Math.sin(Rad(2*F))\n +0.058793*Math.sin(Rad(2*D-2*M1))\n +0.057212*Math.sin(Rad(2*D-M-M1))*e\n +0.053320*Math.sin(Rad(2*D+M1))\n +0.045874*Math.sin(Rad(2*D-M))*e\n +0.041024*Math.sin(Rad(M1-M))*e\n -0.034718*Math.sin(Rad(D))\n -0.030465*Math.sin(Rad(M+M1))*e\n +0.015326*Math.sin(Rad(2*D-2*F))\n -0.012528*Math.sin(Rad(2*F+M1))\n -0.010980*Math.sin(Rad(2*F-M1))\n +0.010674*Math.sin(Rad(4*D-M1))\n +0.010034*Math.sin(Rad(3*M1))\n +0.008548*Math.sin(Rad(4*D-2*M1))\n -0.007910*Math.sin(Rad(M-M1+2*D))*e\n -0.006783*Math.sin(Rad(2*D+M))*e\n +0.005162*Math.sin(Rad(M1-D))\n -0.005000*Math.sin(Rad(M+D))*e\n +0.004049*Math.sin(Rad(M1-M+2*D))*e\n +0.003996*Math.sin(Rad(2*M1+2*D))\n +0.003862*Math.sin(Rad(4*D))\n +0.003665*Math.sin(Rad(2*D-3*M1))\n +0.002695*Math.sin(Rad(2*M1-M))*e\n +0.002602*Math.sin(Rad(M1-2*F-2*D))\n +0.002396*Math.sin(Rad(2*D-M-2*M1))*e\n -0.002349*Math.sin(Rad(M1+D))\n +0.002249*Math.sin(Rad(2*D-2*M))*e*e\n -0.002125*Math.sin(Rad(2*M1+M))*e \n -0.002079*Math.sin(Rad(2*M))*e*e \n +0.002059*Math.sin(Rad(2*D-M1-2*M))*e*e\n -0.001773*Math.sin(Rad(M1+2*D-2*F))\n -0.001595*Math.sin(Rad(2*F+2*D))\n +0.001220*Math.sin(Rad(4*D-M-M1))*e\n -0.001110*Math.sin(Rad(2*M1+2*F))\n +0.000892*Math.sin(Rad(M1-3*D))\n -0.000811*Math.sin(Rad(M+M1+2*D))*e\n +0.000761*Math.sin(Rad(4*D-M-2*M1))*e\n +0.000717*Math.sin(Rad(M1-2*M))*e*e\n +0.000704*Math.sin(Rad(M1-2*M-2*D))*e*e\n +0.000693*Math.sin(Rad(M-2*M1+2*D))*e\n +0.000598*Math.sin(Rad(2*D-M-2*F))*e\n +0.000550*Math.sin(Rad(M1+4*D))\n +0.000538*Math.sin(Rad(4*M1))\n +0.000521*Math.sin(Rad(4*D-M))*e\n +0.000486*Math.sin(Rad(2*M1-D));\n \n// Calcolo della Latitudine ecclittica.\n\nvar Beta= 5.128189*Math.sin(Rad(F))\n +0.280606*Math.sin(Rad(M1+F))\n +0.277693*Math.sin(Rad(M1-F))\n +0.173238*Math.sin(Rad(2*D-F))\n +0.055413*Math.sin(Rad(2*D+F-M1))\n +0.046272*Math.sin(Rad(2*D-F-M1))\n +0.032573*Math.sin(Rad(2*D+F))\n +0.017198*Math.sin(Rad(2*M1+F))\n +0.009267*Math.sin(Rad(2*D+M1-F))\n +0.008823*Math.sin(Rad(2*M1-F))\n +0.008247*Math.sin(Rad(2*D-M-F))*e\n +0.004323*Math.sin(Rad(2*D-F-2*M1))\n +0.004200*Math.sin(Rad(2*D+F+M1))\n +0.003372*Math.sin(Rad(F-M-2*D))*e\n +0.002472*Math.sin(Rad(2*D+F-M-M1))*e\n +0.002222*Math.sin(Rad(2*D+F-M))*e\n +0.002072*Math.sin(Rad(2*D-F-M-M1))*e\n +0.001877*Math.sin(Rad(F-M+M1))*e\n +0.001828*Math.sin(Rad(4*D-F-M1))\n -0.001803*Math.sin(Rad(F+M))*e\n -0.001750*Math.sin(Rad(3*F))\n +0.001570*Math.sin(Rad(M1-M-F))*e\n -0.001487*Math.sin(Rad(F+D))\n -0.001481*Math.sin(Rad(F+M+M1))*e\n +0.001417*Math.sin(Rad(F-M-M1))*e\n +0.001350*Math.sin(Rad(F-M))*e\n +0.001330*Math.sin(Rad(F-D))\n +0.001106*Math.sin(Rad(F+3*M1))\n +0.001020*Math.sin(Rad(4*D-F))\n +0.000833*Math.sin(Rad(F+4*D-M1))\n +0.000781*Math.sin(Rad(M1-3*F))\n +0.000670*Math.sin(Rad(F+4*D-2*M1))\n +0.000606*Math.sin(Rad(2*D-3*F))\n +0.000597*Math.sin(Rad(2*D+2*M1-F))\n +0.000492*Math.sin(Rad(2*D+M1-M-F))*e\n +0.000450*Math.sin(Rad(2*M1-F-2*D))\n +0.000439*Math.sin(Rad(3*M1-F))\n +0.000423*Math.sin(Rad(F+2*D+2*M1))\n +0.000422*Math.sin(Rad(2*D-F-3*M1))\n -0.000367*Math.sin(Rad(M+F+2*D-M1))*e\n -0.000353*Math.sin(Rad(M+F+2*D))*e\n +0.000331*Math.sin(Rad(F+4*D))\n +0.000317*Math.sin(Rad(2*D+F-M+M1))*e\n +0.000306*Math.sin(Rad(2*D-2*M-F))*e*e\n -0.000283*Math.sin(Rad(M1+3*F));\n\n var omega1=0.0004664*Math.cos(Rad(N));\n var omega2=0.0000754*Math.cos(Rad(N+275.05-2.30));\n\n var Lat=Beta*(1-omega1-omega2); // latitudine ecclittica.\n\n // Calcolo della parallasse.\n\n var parallasse=0.950724\n +0.051818*Math.cos(Rad(M1))\n +0.009531*Math.cos(Rad(2*D-M1))\n +0.007843*Math.cos(Rad(2*D))\n +0.002824*Math.cos(Rad(2*M1))\n +0.000857*Math.cos(Rad(2*D+M1))\n +0.000533*Math.cos(Rad(2*D-M))*e\n +0.000401*Math.cos(Rad(2*D-M-M1))*e\n +0.000320*Math.cos(Rad(M1-M))*e\n -0.000271*Math.cos(Rad(D))\n -0.000264*Math.cos(Rad(M1+M))*e\n -0.000198*Math.cos(Rad(2*F-M1))\n +0.000173*Math.cos(Rad(3*M1))\n +0.000167*Math.cos(Rad(4*D-M1))\n -0.000111*Math.cos(Rad(M))*e\n +0.000103*Math.cos(Rad(4*D-2*M1))\n -0.000084*Math.cos(Rad(2*M1-2*D))\n -0.000083*Math.cos(Rad(2*D+M))*e\n +0.000079*Math.cos(Rad(2*D+2*M1))\n +0.000072*Math.cos(Rad(4*D))\n +0.000064*Math.cos(Rad(2*D-M+M1))*e\n -0.000063*Math.cos(Rad(2*D+M-M1))*e\n +0.000041*Math.cos(Rad(M+D))*e\n +0.000035*Math.cos(Rad(2*M1-M))*e\n -0.000033*Math.cos(Rad(3*M1-2*D))\n -0.000030*Math.cos(Rad(M1+D))\n -0.000029*Math.cos(Rad(2*F-2*D))\n -0.000029*Math.cos(Rad(2*M1+M))*e\n +0.000026*Math.cos(Rad(2*D-2*M))*e*e\n -0.000023*Math.cos(Rad(2*F-2*D+M1))\n +0.000019*Math.cos(Rad(4*D-M-M1))*e;\n\n Long=gradi_360(Long); // La longitudine all'interno dell'intervallo 0-360.\n\n var dati_luna=trasf_ecli_equa(njd,Long,Lat); // calcola le coordinate equatoriali geocentriche.\n\n // dati del Sole.\n\n var dat_sole=pos_sole(njd); // calcola la longitudine del sole\n var Long_sole=dat_sole[2]; // longitudine vera del sole.\n \n // CALCOLO DELLA FASE E DELL'ELONGAZIONE\n\n var Elongazione=elong(dati_luna[0],dati_luna[1],dat_sole[0],dat_sole[1]); // elongazione in gradi dal Sole.\n\n var Fase_luna=0.5*(1-Math.cos(Rad(Elongazione))); // FASE\n \n var dist_luna=6378.14/Math.sin(Rad(parallasse));\n dist_luna=dist_luna.toFixed(0); // Distanza in Km.\n\n var dim_app=Math.atan(3476.2/dist_luna); \n dim_app=Rda(dim_app)*3600;\n dim_app=dim_app.toFixed(2); // Diametro apparente in secondi d'arco.\n\n // elenco delle variabili restituite dalla funzione [pos_luna].\n\n // dati_luna[0]= ascensione retta già in ore decimali (diviso per 15).\n // dati_luna[1]= declinazione in gradi sessadecimali.\n dati_luna[2]= Long; // in gradi sessadecimali.\n dati_luna[3]= Fase_luna; // fase lunare.\n dati_luna[4]= Elongazione; // elongazione in gradi sessadecimali.\n dati_luna[5]= parallasse; // parallasse della Luna in gradi. \n dati_luna[6]= dim_app; // diametro apparente in secondi d'arco.\n dati_luna[7]= dist_luna; // distanza della Luna in Km. \n\n return dati_luna;\n\n}", "invertTileDirection(direction) {\n switch (direction) {\n case \"North\": return \"South\";\n case \"East\": return \"West\";\n case \"South\": return \"North\";\n case \"West\": return \"East\";\n }\n }", "function DrawRiver (riverStart:Vector2, riverEnd:Vector2, size:int, mirrorDown:boolean, mirrorRight:boolean) {\n\tRiverPath = new Vector2[5];\n\tvar RLength : float = ((riverEnd-riverStart).magnitude)/8.0;\n\tRiverPath[0] = riverStart;\n\tRiverPath[1] = (((riverStart * 3.0) + riverEnd) / 4.0) + (Random.insideUnitCircle * RLength);\n\tRiverPath[2] = ((riverStart + riverEnd) / 2.0);// + (Random.insideUnitCircle * RLength);\n\tRiverPath[3] = ((riverStart + (riverEnd * 3.0)) / 4.0) + (Random.insideUnitCircle * RLength);\n\tRiverPath[4] = riverEnd;\n\n if (size == 3) {// major river\n\t\tColorArray = new Color[3];\n\t\tfor (i=0; i<ColorArray.length; i++) {\n\t\t\tColorArray[i] = MapController.RiverColors[i+3];\n\t\t}\n }\n if (size == 2) {// medium river\n\t\tColorArray = new Color[3];\n\t\tfor (i=0; i<ColorArray.length; i++) {\n\t\t\tColorArray[i] = MapController.RiverColors[i+2];\n\t\t}\n }\n if (size == 1) {// small river\n\t\tColorArray = new Color[3];\n\t\tfor (i=0; i<ColorArray.length; i++) {\n\t\t\tColorArray[i] = MapController.RiverColors[i+1];\n\t\t}\n }\n if (size == 0) {// road\n\t\tColorArray = new Color[1];\n\t\tfor (i=0; i<ColorArray.length; i++) {\n\t\t\tColorArray[i] = MapController.RoadColor;\n\t\t}\n }\n\tfor (i=0; i<4; i++) {\n\t\tvar MapTexture : Texture2D = gameObject.GetComponent(MeshRenderer).material.mainTexture;\n\t\tvar x0 : int = RiverPath[i].x * MapTexture.width;\n\t\tvar x1 : int = RiverPath[i+1].x * MapTexture.width;\n\t\tvar y0 : int = RiverPath[i].y * MapTexture.height;\n\t\tvar y1 : int = RiverPath[i+1].y * MapTexture.height;\n\t var dy = y1-y0;\n\t var dx = x1-x0;\n\t if (dy < 0) {dy = -dy; var stepy = -1;}\n\t else {stepy = 1;}\n\t if (dx < 0) {dx = -dx; var stepx = -1;}\n\t else {stepx = 1;}\n\t dy <<= 1;\n\t dx <<= 1;\n\t if (size==0 && x0>=0 && x0<=MapTexture.width && y0>=0 && y0<=MapTexture.height) {\n\t \t// draws road\n\t \tTinySplat(x0, y0, 4, 45);\n\t \t// draws road on minimap\n\t \tTinyMMSplat(x0, y0, 5, 45);\n\t }\n\t if (size==1 && x0>=0 && x0<=MapTexture.width && y0>=0 && y0<=MapTexture.height) {\n\t \t// draws small river\n\t \tTinySplat(x0, y0, 3, 15);\n\t \t// draws small river on minimap\n\t \tTinyMMSplat(x0, y0, 3, 15);\n\t }\n\t if (size==2 && x0>=0 && x0<=MapTexture.width && y0>=0 && y0<=MapTexture.height) {\n\t \t// draws medium river\n\t \tTinySplat(x0, y0, 5, 30);\n\t \t// draws medium river on minimap\n\t \tTinyMMSplat(x0, y0, 5, 45);\n\t }\n\t if (size==3 && x0>=0 && x0<=MapTexture.width && y0>=0 && y0<=MapTexture.height) {\n\t \t// draws major river\n\t \tTinySplat(x0, y0, 7, 60);\n\t \t// draws major river on minimap\n\t \tTinyMMSplat(x0, y0, 7, 75);\n\t }\n\n\t if (dx > dy) {\n\t var fraction = dy - (dx >> 1);\n\t while (x0 != x1) {\n\t if (fraction >= 0) {\n\t y0 += stepy;\n\t fraction -= dx;\n\t }\n\t x0 += stepx;\n\t fraction += dy;\n\t\t\t if (size==0 && x0>=0 && x0<=MapTexture.width && y0>=0 && y0<=MapTexture.height) {\n\t\t\t \tTinySplat(x0, y0, 4, 45);\n\t\t\t \tTinyMMRoad(x0, y0, 5, 45);\n\t\t\t }\n\t\t\t if (size==1 && x0>=0 && x0<=MapTexture.width && y0>=0 && y0<=MapTexture.height) {\n\t\t\t \tTinySplat(x0, y0, 3, 15);\n\t\t\t \tTinyMMSplat(x0, y0, 3, 15);\n\t\t\t }\n\t\t\t if (size==2 && x0>=0 && x0<=MapTexture.width && y0>=0 && y0<=MapTexture.height) {\n\t\t\t \tTinySplat(x0, y0, 5, 30);\n\t\t\t \tTinyMMSplat(x0, y0, 5, 45);\n\t\t\t }\n\t\t\t if (size==3 && x0>=0 && x0<=MapTexture.width && y0>=0 && y0<=MapTexture.height) {\n\t\t\t \tTinySplat(x0, y0, 7, 60);\n\t\t\t \tTinyMMSplat(x0, y0, 7, 75);\n\t\t\t }\n\t }\n\t } else {\n\t fraction = dx - (dy >> 1);\n\t while (y0 != y1) {\n\t if (fraction >= 0) {\n\t x0 += stepx;\n\t fraction -= dy;\n\t }\n\t y0 += stepy;\n\t fraction += dx;\n\t\t\t if (size==0 && x0>=0 && x0<=MapTexture.width && y0>=0 && y0<=MapTexture.height) {\n\t\t\t \tTinySplat(x0, y0, 4, 45);\n\t\t\t \tTinyMMRoad(x0, y0, 5, 45);\n\t\t\t }\n\t\t\t if (size==1 && x0>=0 && x0<=MapTexture.width && y0>=0 && y0<=MapTexture.height) {\n\t\t\t \tTinySplat(x0, y0, 3, 15);\n\t\t\t \tTinyMMSplat(x0, y0, 3, 15);\n\t\t\t }\n\t\t\t if (size==2 && x0>=0 && x0<=MapTexture.width && y0>=0 && y0<=MapTexture.height) {\n\t\t\t \tTinySplat(x0, y0, 5, 30);\n\t\t\t \tTinyMMSplat(x0, y0, 5, 45);\n\t\t\t }\n\t\t\t if (size==3 && x0>=0 && x0<=MapTexture.width && y0>=0 && y0<=MapTexture.height) {\n\t\t\t \tTinySplat(x0, y0, 7, 60);\n\t\t\t \tTinyMMSplat(x0, y0, 7, 75);\n\t\t\t }\n\t\t\t}\n\t\t}\n\t}\n}", "positioner(d, i) {\n var currentRadius = this.rScale(d);\n var previousRadius;\n if (i === 0) {\n previousRadius = 0;\n } else {\n previousRadius = this.rScale(this.data[i - 1]);\n }\n\n // (previousRadius + currentRadius) has spheres touching, (spacing) ensures separation\n this.xSum += previousRadius + currentRadius + this.spacing;\n var x = this.xSum;\n var y = 1.5;\n var z = -4;\n return x + \" \" + y + \" \" + z;\n }", "function getGroupLocation(d,i){\n let x = xScale(d.fert);\n let y = yScale(d.life);\n return \"translate(\" + x + \",\" + y + \")\";\n }", "function wisteria() {\n\tvar xcoords = [];\n\tvar ycoords = [];\n\tfor (var i = 0; i < maxIter; i++) {\n\t\tvar sum = 1;\n\t\txcoords.push(i);\n\t\tvar constituents = i.toString().split(\"\");\n\t\tfor (var index = 0; index < constituents.length; index++) {\n\t\t\tif (parseInt(constituents[index], 10) > 0) {\n\t\t\t\tsum *= constituents[index]\n\t\t\t}\n\t\t}\n\t\tycoords.push(i - sum)\n\t}\n\tvar data = {\n\t\tx: xcoords,\n\t\ty: ycoords,\n\t\tmode: 'markers',\n\t\ttype: 'scatter'\n\t}\n\treturn data;\n}", "cohesion(boids) {\r\n let neighbordist = 50;\r\n let sum = createVector(0, 0); // Start with empty vector to accumulate all locations\r\n let count = 0;\r\n for (let i = 0; i < boids.length; i++) {\r\n let d = p5.Vector.dist(this.position, boids[i].position);\r\n if ((d > 0) && (d < neighbordist)) {\r\n sum.add(boids[i].position); // Add location\r\n count++;\r\n }\r\n }\r\n if (count > 0) {\r\n sum.div(count);\r\n return this.seek(sum); // Steer towards the location\r\n } else {\r\n return createVector(0, 0);\r\n }\r\n }", "function displayShape() {\n //remove any trace of a tetrominoe from the entire grid\n displaySquares.forEach(square => {\n square.classList.remove('tetrominoe');\n });\n upNextTetrominoes[nextRandom].forEach(index => {\n displaySquares[displayIndex + index].classList.add('tetrominoe');\n });\n }", "function changeToPlaner() {\r\n\tobj_array.forEach(e => {\r\n\t\te.position.y = 0;\r\n\t});\r\n}", "setOut() {\n this.geometricMidpoint = this.setGeometricMidpoint();\n this.out.push(this.geometricMidpoint);\n const idxs = [0, 1, 2];\n idxs.forEach((idx) => {\n this.out.push({\n X: this.coordinates[0][idx * 2],\n Y: this.coordinates[0][idx * 2 + 1],\n });\n });\n }", "twistL() {\n this.fourCycle(this.cornerLoc, 6, 4, 5, 7, this.cornerOrient, 2, 1, 2, 1, 3);\n this.fourCycle(this.edgeLoc, 6, 7, 8, 10, this.edgeOrient, 1, 1, 1, 1, 2);\n this.sideOrient[3] = (this.sideOrient[3] + 3) % 4;\n }", "function OnDrawGizmos(){\n \nGizmos.color = Color.red;\nfor(var i : int = 0; i< waypoints.Length;i++)\n{\nvar pos : Vector3 = waypoints[i].position;\nif(i>0)\n{\nvar prev : Vector3 = waypoints[i-1].position;\n \n}\n}\n}", "function handleReversedCoordinates(){\n if (complexScope.aLeftUpper > complexScope.aRightBottom) {\n complexScope.changer = complexScope.aLeftUpper;\n complexScope.aLeftUpper = complexScope.aRightBottom;\n complexScope.aRightBottom = complexScope.changer;\n // if you create the new area from right to left\n }\n if (complexScope.bLeftUpper < complexScope.bRightBottom) {\n complexScope.changer = complexScope.bLeftUpper;\n complexScope.bLeftUpper = complexScope.bRightBottom;\n complexScope.bRightBottom = complexScope.changer;\n // if you create the new area from right to left\n }\n }", "function limpiarSeleccion() {\n \"use strict\";\n\n map.setView(new L.LatLng(4.5, -73.0), 6);\n map.eachLayer(function (layer) {\n map.removeLayer(layer);\n });\n map.addLayer(positron);\n map.addLayer(positronLabels);\n map.addLayer(NodosLayer);\n}", "resetPlaces() {\n this.map = _.times(this.cfg.places, (i) => {\n return { x: i * this.cfg.width, y: 0, empty: true };\n });\n }", "function inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n\n var lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + p.x / this.a);\n var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "computeRoute(){\n if (this.startLocation && this.endLocation){\n if (this.mode === \"MILES\"){\n this.plotMiles();\n } else {\n this.plotDirection();\n }\n }\n }", "function initialCoords()\r\n{\r\n\t/*for(var i = 0; i !== 1;i++)\r\n\t{\r\n\t\tencounteredCoords[playerLocation].push(duplicatePlayerLocation(playerLocation), levelExitLocation);\r\n\t}*/\r\n}", "function updatePositionsfinal() {\n var positions = line2.geometry.attributes.position.array;\n\n var x = 6; \n var y = 2.7; \n var z = -2.5;\n var index = 0;\n\n for ( var i = 0, l = MAX_POINTS; i < l; i ++ ) {\n\n positions[ index ++ ] = x;\n positions[ index ++ ] = y;\n positions[ index ++ ] = z;\n\n x += (9/MAX_POINTS);\n y += (2.6/MAX_POINTS);\n }\n}", "function changeEventHandler(event) {\n directionsDisplay.setMap(null);\n\n for (var i = 1; i < markers.length; i++) {\n markers[i].setVisible(true);\n }\n\n if(event.target.value == 'all') {\n for (var i = 1; i < markers.length; i++) {\n markers[i].setVisible(true);\n }\n }\n // Use markers: 2,3,4,5,11,14,15\n else if(event.target.value == '465') {\n markers[1].setVisible(false);\n markers[6].setVisible(false);\n markers[7].setVisible(false);\n markers[8].setVisible(false);\n markers[9].setVisible(false);\n markers[10].setVisible(false);\n markers[12].setVisible(false);\n markers[13].setVisible(false);\n }\n // Use markers: 6,7,8\n else if(event.target.value == '411') {\n markers[1].setVisible(false);\n markers[2].setVisible(false);\n markers[3].setVisible(false);\n markers[4].setVisible(false);\n markers[5].setVisible(false);\n markers[9].setVisible(false);\n markers[10].setVisible(false);\n markers[11].setVisible(false);\n markers[12].setVisible(false);\n markers[13].setVisible(false);\n markers[14].setVisible(false);\n markers[15].setVisible(false);\n }\n // Use markers: 1,9,10,12,13\n else if(event.target.value == '374') {\n markers[2].setVisible(false);\n markers[3].setVisible(false);\n markers[4].setVisible(false);\n markers[5].setVisible(false);\n markers[6].setVisible(false);\n markers[7].setVisible(false);\n markers[8].setVisible(false);\n markers[11].setVisible(false);\n markers[14].setVisible(false);\n markers[15].setVisible(false);\n }\n}", "calcDirectionCoordsForTraitor(lat1, lon1, lat2, lon2) {\n //Line will be around 1000m long or something\n const multiplier = 1000 / this.calcDistance(lat1, lon1, lat2, lon2);\n return ([{\n latitude: lat2 + ((lat1 - lat2) * multiplier),\n longitude: lon2 + ((lon1 - lon2) * multiplier)\n },\n {\n latitude: lat2,\n longitude: lon2\n }]);\n }", "L_tetrimino() {\n\t\treturn ({\n\t\t\tshape: [\n\t\t\t\t{ x: 2, y: 0 }, { x: 0, y: 1 }, { x: 1, y: 1, center: true },\n\t\t\t\t{ x: 2, y: 1 }\n\t\t\t],\n\t\t\tletter: 'L',\n\t\t\tcolor: 'orange'\n\t\t});\n\t}", "_updateIndicators() {\n const _this = this;\n this.duration = this.model.time.delayAnimations;\n this.yScale = this.model.marker.axis_y.getScale();\n this.xScale = this.model.marker.axis_x.getScale();\n this.yAxis.tickFormat(_this.model.marker.axis_y.getTickFormatter());\n this.xAxis.tickFormat(_this.model.marker.axis_x.getTickFormatter());\n this.xAxisLeft.tickFormat(_this.model.marker.axis_x.getTickFormatter());\n\n const sideDim = this.SIDEDIM;\n const stackDim = this.STACKDIM;\n\n const stacks = this.model.marker.getKeys(stackDim);\n let stackKeys = [];\n stackKeys = stacks.map(m => m[stackDim]);\n this.stackKeys = stackKeys;\n\n const sideItems = this.model.marker.label_side.getItems();\n //var sideKeys = Object.keys(sideItems);\n let sideKeys = [];\n if (!utils.isEmpty(sideItems)) {\n const sideFiltered = !!this.model.marker.side.getEntity().show[sideDim];\n const sides = this.model.marker.getKeys(sideDim)\n .filter(f => !sideFiltered || this.model.marker.side.getEntity().isShown(f));\n sideKeys = sides.map(m => m[sideDim]);\n\n if (sideKeys.length > 2) sideKeys.length = 2;\n if (sideKeys.length > 1) {\n const sortFunc = this.ui.chart.flipSides ? d3.ascending : d3.descending;\n sideKeys.sort(sortFunc);\n }\n }\n if (!sideKeys.length) sideKeys.push(\"undefined\");\n this.sideKeys = sideKeys;\n\n this.twoSided = this.sideKeys.length > 1;\n this.titleRight.classed(\"vzb-hidden\", !this.twoSided);\n if (this.twoSided) {\n this.xScaleLeft = this.xScale.copy();\n this.title.text(sideItems[this.sideKeys[1]]);\n this.titleRight.text(sideItems[this.sideKeys[0]]);\n } else {\n const title = this.sideKeys.length && sideItems[this.sideKeys[0]] ? sideItems[this.sideKeys[0]] : \"\";\n this.title.text(title);\n }\n\n this.cScale = this.model.marker.color.getScale();\n }", "function normalizar() {\n console.log(this.coords.map((elemento) => elemento / this.length));\n}", "function inverse(p) {\n\n var x = p.x;\n var y = p.y;\n\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + ((x - this.x0) / (this.a * this.rc)));\n p.y = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.lat0 + ((y - this.y0) / (this.a)));\n return p;\n}", "cohesion(boids) {\n let neighbordist = 50;\n let sum = createVector(0, 0); // Start with empty vector to accumulate all locations\n let count = 0;\n for (let i = 0; i < boids.length; i++) {\n let d = p5.Vector.dist(this.position, boids[i].position);\n if ((d > 0) && (d < neighbordist)) {\n sum.add(boids[i].position); // Add location\n count++;\n }\n }\n if (count > 0) {\n sum.div(count);\n return this.seek(sum); // Steer towards the location\n } else {\n return createVector(0, 0);\n }\n }", "function i$2(e,t,n,o,i,l){const{iconRotationAlignment:a,textRotationAlignment:c,iconTranslate:h,iconTranslateAnchor:u,textTranslate:d,textTranslateAnchor:y}=o;let x=0;for(const g of e.colliders){const[e,o]=0===g.partIndex?h:d,m=0===g.partIndex?u:y,f=g.minLod<=l&&l<=g.maxLod;x+=f?0:1,g.enabled=f,g.xScreen=g.xTile*i[0]+g.yTile*i[3]+i[6],g.yScreen=g.xTile*i[1]+g.yTile*i[4]+i[7],m===r$4.MAP?(g.xScreen+=n*e-t*o,g.yScreen+=t*e+n*o):(g.xScreen+=e,g.yScreen+=o),l$2.VIEWPORT===(0===g.partIndex?a:c)?(g.dxScreen=g.dxPixels,g.dyScreen=g.dyPixels):(g.dxScreen=n*(g.dxPixels+g.width/2)-t*(g.dyPixels+g.height/2)-g.width/2,g.dyScreen=t*(g.dxPixels+g.width/2)+n*(g.dyPixels+g.height/2)-g.height/2);}e.colliders.length>0&&x===e.colliders.length&&(e.unique.show=!1);}", "twistU() {\n this.fourCycle(this.cornerLoc, 0, 2, 4, 6, this.cornerOrient, 0, 0, 0, 0, 3);\n this.fourCycle(this.edgeLoc, 0, 3, 6, 9, this.edgeOrient, 1, 1, 1, 1, 2);\n this.sideOrient[1] = (this.sideOrient[1] + 3) % 4;\n }", "function markMap() {\n for (let key in Memory.warControl) {\n if (Memory.warControl[key]) {\n new RoomVisual(key).text(\n Memory.warControl[key].type,\n 25,\n 25,\n {align: 'left', opacity: 0.8}\n );\n }\n if (Memory.warControl[key].siegePoint) {\n new RoomVisual(Memory.warControl[key].siegePoint).text(\n 'Siegepoint',\n 25,\n 25,\n {align: 'left', opacity: 0.8}\n );\n }\n }\n}", "function computeLevel(location) {\n\t\n\tif (location.y > 0.5) {\n\t\tlocation.levels.push(1);\n\t\tlocation.x *= 2;\n\t\tlocation.y = (location.y - 0.5) * 2;\n\t} else if (location.y < 0.5-location.x) {\n\t\tlocation.levels.push(2);\n\t\tlocation.x *= 2;\n\t\tlocation.y *= 2;\n\t} else if (location.x >= 0.5) {\n\t\tlocation.levels.push(3);\n\t\tlocation.x = (location.x - 0.5) * 2;\n\t\tlocation.y *= 2;\n\t} else {\n\t\t// And this is an inverse triangle\n\t\tlocation.levels.push(0);\n// \t\tlocation.x = 2*x + 2*y - 1;\n\t\tlocation.x = 1 - location.x*2;\n\t\tlocation.y = 1 - location.y*2;\n\t}\n\t\n\treturn location;\n}", "function plotDirections(places){\n\tif ($('#routePlan').children().length >= 1){\n\t\t$('#routePlan').children().remove();\t\t\t\n\t}\n\t$.each( places, function( index, value ){\n\t\t var content = '<div class=\"ui-block-a\" style =\"margin:5px;\">'\n\t\tcontent += '<input data-role=\"none\" class=\"form-control\" type=\"text\" id=\"loc_'+index+'\" readonly/>'\n\t\tcontent += '</div>'\n $('#routePlan').append(content);\t\n\t\t//$('#ind_'+index).val(index+1);\n\t\t$('#loc_'+index).val( (index+1)+\" \" +value);\t\t\t\n });\n}", "function Neighbor(x_coord:int, y_coord:int, direction:int) {\n\tvar neighbor_coord:Vector2;\n\tvar new_x : int;\n\tvar new_y : int;\n\tif (y_coord%2==0) {//y is even\n\t\tif (direction==0) {\n\t\t\tnew_x = x_coord;\n\t\t\tnew_y = y_coord-1;\n\t\t}\n\t\tif (direction==1) {\n\t\t\tnew_x = x_coord+1;\n\t\t\tnew_y = y_coord;\n\t\t}\n\t\tif (direction==2) {\n\t\t\tnew_x = x_coord;\n\t\t\tnew_y = y_coord+1;\n\t\t}\n\t\tif (direction==3) {\n\t\t\tnew_x = x_coord-1;\n\t\t\tnew_y = y_coord+1;\n\t\t}\n\t\tif (direction==4) {\n\t\t\tnew_x = x_coord-1;\n\t\t\tnew_y = y_coord;\n\t\t}\n\t\tif (direction==5) {\n\t\t\tnew_x = x_coord-1;\n\t\t\tnew_y = y_coord-1;\n\t\t}\n\t}\n\tif (y_coord%2==1) {//y is odd\n\t\tif (direction==0) {\n\t\t\tnew_x = x_coord+1;\n\t\t\tnew_y = y_coord-1;\n\t\t}\n\t\tif (direction==1) {\n\t\t\tnew_x = x_coord+1;\n\t\t\tnew_y = y_coord;\n\t\t}\n\t\tif (direction==2) {\n\t\t\tnew_x = x_coord+1;\n\t\t\tnew_y = y_coord+1;\n\t\t}\n\t\tif (direction==3) {\n\t\t\tnew_x = x_coord;\n\t\t\tnew_y = y_coord+1;\n\t\t}\n\t\tif (direction==4) {\n\t\t\tnew_x = x_coord-1;\n\t\t\tnew_y = y_coord;\n\t\t}\n\t\tif (direction==5) {\n\t\t\tnew_x = x_coord;\n\t\t\tnew_y = y_coord-1;\n\t\t}\n\t}\n\tif (new_x==0 || new_x>=MapController.MeshX || new_y==0 || new_y>=MapController.MeshY ) {\n\t\tnew_x = -1;\n\t\tnew_y = -1;\n\t}\n\tneighbor_coord = new Vector2(new_x, new_y);\n\treturn neighbor_coord;\n}", "function getDirectionsShaun() {\n var start = myLoc;\n var end = new google.maps.LatLng(allMarkers[2][1],allMarkers[2][2]);\n\n var request = {\n origin: start,\n destination: end,\n travelMode: google.maps.TravelMode.WALKING\n };\n directionsService.route(request, function(result, status) {\n if(status == google.maps.DirectionsStatus.OK) {\n directionsDisplay.setDirections(result);\n }\n });\n}", "function north(){\n if (golfer.status == false){\n alert(\"Game over, you're out of bound!\")\n };\n if (golfer.pos >= 1201 && golfer.pos <= 1221){\n golfer.status = false\n };\n\n\n\n\n\n // move\n if (golfer.status == true){\n golfer.pos -= (100 * golfer.step);\n golfer.time -= 1 * golfer.multiplier;\n } else {\n return\n };\n\n // radar\n document.getElementById(\"radar_display\").innerHTML = \"How close are you to a bar: Nope\"\n for (i = 0; i < bar.length; i++){\n if (bar[i][\"pos\"] == golfer.pos + 100){\n document.getElementById(\"radar_display\").innerHTML = \"How close are you to a bar: Close\"\n };\n };\n for (i = 0; i < bar.length; i++){\n if (bar[i][\"pos\"] == golfer.pos - 100){\n document.getElementById(\"radar_display\").innerHTML = \"How close are you to a bar: Close\"\n };\n };\n for (i = 0; i < bar.length; i++){\n if (bar[i][\"pos\"] == golfer.pos + 1){\n document.getElementById(\"radar_display\").innerHTML = \"How close are you to a bar: Close\"\n };\n };\n for (i = 0; i < bar.length; i++){\n if (bar[i][\"pos\"] == golfer.pos - 1){\n document.getElementById(\"radar_display\").innerHTML = \"How close are you to a bar: Close\"\n };\n };\n for (i = 0; i < bar.length; i++){\n if (bar[i][\"pos\"] == golfer.pos - 99){\n document.getElementById(\"radar_display\").innerHTML = \"How close are you to a bar: Close\"\n };\n };\n for (i = 0; i < bar.length; i++){\n if (bar[i][\"pos\"] == golfer.pos - 101){\n document.getElementById(\"radar_display\").innerHTML = \"How close are you to a bar: Close\"\n };\n };\n for (i = 0; i < bar.length; i++){\n if (bar[i][\"pos\"] == golfer.pos + 99){\n document.getElementById(\"radar_display\").innerHTML = \"How close are you to a bar: Close\"\n };\n };\n for (i = 0; i < bar.length; i++){\n if (bar[i][\"pos\"] == golfer.pos + 101){\n document.getElementById(\"radar_display\").innerHTML = \"How close are you to a bar: Close\"\n };\n };\n \n\n // when moving\n document.getElementById(golfer.pos).innerHTML = \"A\";\n document.getElementById(golfer.pos + 100).innerHTML = \" \";\n document.getElementById(golfer.pos - 100).innerHTML = \" \";\n document.getElementById(golfer.pos + 1).innerHTML = \" \";\n document.getElementById(golfer.pos - 1).innerHTML = \" \";\n\n // locking \"B\" for bar locations\n for (i = 0; i < bar.length; i++){\n if (bar[i][\"status\"] == false){\n document.getElementById(bar[i][\"pos\"]).innerHTML = \"B\";\n }\n }\n\n // display information\n document.getElementById(\"time_display\").innerHTML = \"Time left: \" + golfer.time + \" mins left\";\n\n\n // if player has already been to the bar\n for (i = 0; i < bar.length; i++){\n if (bar[i][\"pos\"] == golfer.pos){ \n if (bar[i][\"status\"] == false){\n document.getElementById(golfer.pos).innerHTML = \"B\";\n alert(\"You've already been to \" + bar[i][\"name\"]);\n };\n };\n }\n\n // drunkiness increment\n if (golfer.drunkiness <= 3){\n golfer.drunkiness_level = \"Sober\"\n }\n else if (golfer.drunkiness <= 8){\n golfer.drunkiness_level = \"Lightheaded\"\n golfer.multiplier = 1.2\n }\n else if (golfer.drunkiness <= 12){\n golfer.drunkiness_level = \"Tipsy\"\n golfer.multiplier = 1.5\n }\n else if (golfer.drunkiness <= 20){\n golfer.drunkiness_level = \"Pretty tipsy\"\n golfer.multiplier = 2\n }\n else if (golfer.drunkiness <= 28){\n golfer.drunkiness_level = \"Drunk\"\n golfer.multiplier = 2.5\n }\n else if (golfer.drunkiness <= 35){\n golfer.drunkiness_level = \"Blacked out\"\n golfer.multiplier = 4\n };\n\n\n\n // if run out of time\n if (golfer.time <= 0){\n if (golfer.status != false){\n golfer.score = (golfer.score + (9 - golfer.completed)*3)\n document.getElementById(\"time_display\").innerHTML = \"Time left: Oooops! You ran out of time!\";\n document.getElementById(\"score_display\").innerHTML = \"Score: \" + golfer.score;\n golfer.status = false\n return;\n }\n else {\n return;\n }\n }\n\n // when player gets to the bar\n for (i = 0; i < bar.length; i++){ \n if (bar[i][\"pos\"] == golfer.pos){\n if (bar[i][\"status\"] == true){\n alert(\"You are at \" + bar[i][\"name\"] + \" and drinks include Birdie: \" + bar[i][\"birdie\"] + \", Par: \" + bar[i][\"par\"] + \" and Bogey: \" + bar[i][\"bogey\"] + \".\");\n bar[i][\"status\"] = false;\n drink = prompt(\"What are you trying to score?\" + \" Please input: birdie, par or bogey.\")\n document.getElementById(golfer.pos).innerHTML = \"B\";\n };\n if (drink === \"birdie\"){\n selection = bar[i][\"birdie\"];\n golfer.score += 2;\n document.getElementById(\"score_display\").innerHTML = \"Score: \" + golfer.score;\n golfer.drunkiness += 4;\n }\n else if (drink === \"par\"){\n selection = bar[i][\"par\"];\n golfer.score += 3;\n document.getElementById(\"score_display\").innerHTML = \"Score: \" + golfer.score;\n golfer.drunkiness += 2\n }\n else if (drink === \"bogey\"){\n selection = bar[i][\"bogey\"];\n golfer.score += 4;\n document.getElementById(\"score_display\").innerHTML = \"Score: \" + golfer.score;\n }\n golfer.completed += 1;\n\n\n // display information right after the bar\n document.getElementById(\"score_display\").innerHTML = \"Score: \" + golfer.score;\n document.getElementById(\"drunkiness_display\").innerHTML = \"Drunkiness: \" + golfer.drunkiness_level;\n document.getElementById(\"completed_display\").innerHTML = \"Completed holes: \" + golfer.completed + \"/9\";\n\n\n }\n }\n }", "function OnSceneGUI() {\n var waypoints = path.editor_waypoints.Where(function(obj) obj != null).ToArray();\n\n if(waypoints.length > 0) {\n drawDisc(waypoints[:1], Color(0, 1, 0, 0.3));\n }\n\n if(waypoints.length > 1) {\n drawDisc(waypoints[-1:], Color(1, 0, 0, 0.3));\n }\n\n if(waypoints.length > 2) {\n drawDisc(waypoints[1:-1], Color(0, 0, 1, 0.3));\n }\n\n for(var w in waypoints) {\n if(path.editor_showHandles) {\n w.transform.position = Handles.PositionHandle(w.transform.position, Quaternion.identity);\n } else {\n w.transform.position = Handles.FreeMoveHandle(\n w.transform.position,\n Quaternion.identity,\n 1.5,\n Vector3(0,0,0),\n Handles.DrawRectangle\n );\n }\n\n if(GUI.changed) {\n EditorUtility.SetDirty(w);\n Repaint();\n OnInspectorGUI();\n }\n }\n\n Handles.color = Color(1,0,1,1);\n Handles.DrawPolyLine(waypoints.Select(function(w) w.transform.position).ToArray());\n\n }", "function show() {\r\n var givenROI = JSON.parse($('#id_region_of_interest').val());\r\n givenROI = unNormalizeResolution(givenROI);\r\n var points_of_poly = givenROI[0] + ' ' + givenROI[1] + ' ' + givenROI[2] + ' ' + givenROI[3];\r\n $('#poly').attr('points', points_of_poly);\r\n border($(\"#poly\"), 'add');\r\n}", "function changeAll(){\n for (var i = 0; i < myMarkers.length; i++){\n changeNutrientFlag(i);\n }\n nOrP = !nOrP;\n}", "alternateStructures() {\n let ic = this.icn3d,\n me = ic.icn3dui\n let hAtomsCount = Object.keys(ic.hAtoms).length\n let allAtomsCount = Object.keys(ic.atoms).length\n\n ic.dAtoms = {}\n\n let moleculeArray = Object.keys(ic.structures)\n for (let i = 0, il = moleculeArray.length; i < il; ++i) {\n let structure = moleculeArray[i]\n if (i > ic.ALTERNATE_STRUCTURE || (ic.ALTERNATE_STRUCTURE === il - 1 && i === 0)) {\n for (let k in ic.structures[structure]) {\n let chain = ic.structures[structure][k]\n ic.dAtoms = me.hashUtilsCls.unionHash(ic.dAtoms, ic.chains[chain])\n }\n\n ic.ALTERNATE_STRUCTURE = i\n\n $('#' + ic.pre + 'title').html(structure)\n\n break\n }\n }\n\n if (hAtomsCount < allAtomsCount) {\n ic.dAtoms = me.hashUtilsCls.intHash(ic.dAtoms, ic.hAtoms)\n\n ic.bShowHighlight = false\n ic.opts['rotationcenter'] = 'highlight center'\n }\n\n // also alternating the surfaces\n ic.applyMapCls.removeSurfaces()\n ic.applyMapCls.applySurfaceOptions()\n\n ic.applyMapCls.removeMaps()\n ic.applyMapCls.applyMapOptions()\n\n ic.applyMapCls.removeEmmaps()\n ic.applyMapCls.applyEmmapOptions()\n\n // disallow the alternation of DelPhi map\n ic.applyMapCls.removePhimaps()\n // ic.applyMapCls.applyPhimapOptions();\n // should recalculate the potential\n //ic.loadDelphiFileBase('delphi');\n\n // ic.applyMapCls.removeSurfaces();\n // ic.applyMapCls.applyphisurfaceOptions();\n // should recalculate the potential\n //ic.loadDelphiFileBase('delphi2');\n\n // alternate the PCA axes\n ic.axes = []\n if (ic.pc1) {\n ic.axesCls.setPc1Axes()\n }\n\n //ic.glycanCls.showGlycans();\n\n ic.drawCls.draw()\n\n ic.bShowHighlight = true\n ic.opts['rotationcenter'] = 'molecule center'\n }", "function shiftLocs(locs) {\n var shiftX = kShiftAmt;\n var shiftY = kShiftAmt;\n\n if (boundingRect.right + shiftX + kBorder > sketchRect.right) {\n shiftX -= sketchRectWidth - (boundingRectWidth + kBorder * 2);\n xWrapCount++;\n }\n\n if (boundingRect.bottom + shiftY + kBorder > sketchRect.bottom) {\n shiftY -= sketchRectHeight - (boundingRectHeight + kBorder * 2);\n yWrapCount++;\n }\n\n boundingRect.left += shiftX;\n boundingRect.right += shiftX;\n boundingRect.top += shiftY;\n boundingRect.bottom += shiftY;\n\n locs.forEach(function(loc) {\n loc.x += shiftX;\n loc.y += shiftY;\n });\n }", "updateMountainPoints() {\n for (var i=nMountains; i>=0; i--) {\n var curMountain = this.mountainPoints[i]\n var updatedMountain = []\n updatedMountain.push(curMountain[curMountain.length - 1]);\n updatedMountain = updatedMountain.concat(curMountain.slice(0, curMountain.length - 1));\n this.mountainPoints[i] = updatedMountain;\n };\n }", "doDexPenalties() {\n // TODO: extract to figure via doPenalties!\n this.figures.forEach(figure => {\n if(figure.penalties.includes('dx_adj')) {\n figure.adj_dx -= 2;\n figure.penalties.splice(figure.penalties.indexOf('dx_adj'), 1)\n }\n else if (figure.penalties.includes('st_dx_adj')) {\n figure.adj_dx -= 3;\n figure.penalties.splice(figure.penalties.indexOf('st_dx_adj'), 1)\n }\n });\n this.renderFigures();\n }", "function removeShipVert1(location, length) {\n\tvar inc = 0;\n\tfor (var i = location; i < location + length; i++) {\n\t\t$(\".bottom2 .\" + (location + inc)).removeClass(\"highlight\");\n\t\tinc = inc + 10;\n\t}\n}", "function checkPathOfIndivue(individue)\n{\n var path = [];\n var position = Object.assign({},init_position);\n var steps = individue.data\n steps.forEach(function(doubleNible){\n var firstSetOfMovements = posible_directions[doubleNible & filter[1] >>> 4];\n var secondSetOfMovements = posible_directions[doubleNible & filter[0]];\n\n firstSetOfMovements.forEach(function(step){\n switch(step)\n {\n case lft:\n if(position.y-1>=0)\n {\n var temp_element=map[position.x][position.y-1];\n if(!Object.is(temp_element,wall_character)){ position.y--; path.push(step);}\n }\n break;\n case rgt:\n if(position.y+1<map.length)\n {\n var temp_element=map[position.x][position.y+1];\n if(!Object.is(temp_element,wall_character)){ position.y++; path.push(step); }\n }\n break;\n case up_:\n if(position.x-1>=0)\n {\n var temp_element=map[position.x-1][position.y];\n if(!Object.is(temp_element,wall_character)){ position.x--; path.push(step); }\n }\n break;\n case dwn:\n if(position.x+1<map[0].length)\n {\n var temp_element=map[position.x+1][position.y];\n if(!Object.is(temp_element,wall_character)){ position.x++; path.push(step); }\n }\n break;\n }\n })\n secondSetOfMovements.forEach(function(step){\n switch(step)\n {\n case lft:\n if(position.y-1>=0)\n {\n var temp_element=map[position.x][position.y-1];\n if(!Object.is(temp_element,wall_character)){ position.y--; path.push(step);}\n }\n break;\n case rgt:\n if(position.y+1<map.length)\n {\n var temp_element=map[position.x][position.y+1];\n if(!Object.is(temp_element,wall_character)){ position.y++; path.push(step); }\n }\n break;\n case up_:\n if(position.x-1>=0)\n {\n var temp_element=map[position.x-1][position.y];\n if(!Object.is(temp_element,wall_character)){ position.x--; path.push(step); }\n }\n break;\n case dwn:\n if(position.x+1<map[0].length)\n {\n var temp_element=map[position.x+1][position.y];\n if(!Object.is(temp_element,wall_character)){ position.x++; path.push(step); }\n }\n break;\n }\n })\n })\n return path;\n}", "liikuta(nimi, suunta){\n for (var i = 0; i < this.hahmot.length; i++){\n var h = this.hahmot[i];\n if (h.nimi == nimi) {\n if (suunta == suunnat.OIKEA) {\n if (this.onkoEtanoita(h.x + 1,h.y)) return;\n if (++h.x >= this.leveys) {\n h.x = 0;\n }\n }\n if (suunta == suunnat.VASEN) {\n if (this.onkoEtanoita(h.x - 1,h.y)) return;\n if (--h.x < 0) {\n h.x = this.leveys - 1;\n }\n }\n if (suunta == suunnat.YLOS) {\n if (this.onkoEtanoita(h.x,h.y - 1)) return;\n if (--h.y < 0) {\n h.y = 0;\n }\n }\n if (suunta == suunnat.ALAS) {\n if (this.onkoEtanoita(h.x, h.y + 1)) return;\n if (++h.y >= this.korkeus) {\n h.y = this.korkeus - 1;\n }\n }\n }\n } \n if (typeof this.pelihahmo == 'undefined') return;\n var h = this.pelihahmo;\n if (h.nimi == nimi) {\n if (suunta == suunnat.OIKEA) {\n if (++h.x >= this.leveys) {\n h.x = 0;\n }\n pisteet++;\n }\n if (suunta == suunnat.VASEN) {\n if (--h.x < 0) {\n h.x = this.leveys - 1;\n }\n pisteet--;\n }\n if (suunta == suunnat.YLOS) {\n if (--h.y < 0) {\n h.y = 0;\n }\n }\n if (suunta == suunnat.ALAS) {\n if (++h.y >= this.korkeus) {\n h.y = this.korkeus - 1;\n }\n }\n }\n }", "_calcCoordinates(dataNodes) {\n let distScale = linear().range([20, this._innerRadius]).domain([0, this._dataLinks.heightTree]);\n this._vOrder.forEach((d, i) => {\n dataNodes[d].x = this._vAngle[i];\n dataNodes[d].y = this._innerRadius;\n });\n posOrdem(this._dataLinks.tree);\n function posOrdem(raiz) {\n let xPrim, xUlt;\n if (raiz.children !== undefined) {\n raiz.children.forEach(function (d) {\n posOrdem(d);\n });\n console.log(\"parent\", raiz);\n console.log(\"children\", raiz.children[0]);\n xPrim = raiz.children[0].data.x;\n xUlt = raiz.children[raiz.children.length - 1].data.x;\n if (xPrim < xUlt) {\n raiz.x = (xPrim + xUlt) / 2;\n raiz.data.x = (xPrim + xUlt) / 2;\n }\n else {\n raiz.x = ((xUlt + 360 - xPrim) / 2 + xPrim) % 360;\n raiz.data.x = (xPrim + xUlt) / 2;\n }\n raiz.y = distScale(raiz.depth);\n raiz.data.y = distScale(raiz.depth);\n }\n }\n }", "get normalized() {\n const [Q1, { x: Qx2, y: Qy2 }, { x: Qx, y: Qy }] = [\n { x: 0 + ((2 / 3) * (1 - 0)), y: 2 + ((2 / 3) * (0 - 2)) },\n { x: 2 + ((2 / 3) * (1 - 2)), y: 2 + ((2 / 3) * (0 - 2)) },\n { x: 2, y: 2 },\n ] // = commands.Q.normalized.points.slice(0, 3)\n const T1x2 = 4 > Qx ? 4 + (Qx - (4 - Qx2)) : 4 - (Qx - (4 - Qx2))\n const T1y2 = 2 > Qy ? 2 + (Qy - (4 - Qy2)) : 2 - (Qy - (4 - Qy2))\n const T2x2 = 6 + (4 - (8 - T1x2))\n const T2y2 = 2 - (2 - (4 - T1y2))\n\n return {\n points: [\n Q1, { x: Qx2, y: Qy2 }, { x: Qx, y: Qy },\n { x: 4 - Qx2, y: 4 - Qy2 }, { x: T1x2, y: T1y2 }, { x: 4, y: 2 },\n { x: 8 - T1x2, y: 4 - T1y2 }, { x: T2x2, y: T2y2 }, { x: 6, y: 2 },\n { x: 6, y: 2 }, { x: 0, y: 2 }, { x: 0, y: 2 },\n ],\n type: 'C',\n }\n }", "function inverse$n(p) {\n var lon, lat;\n var xx, yy, xys, c1, c2, c3;\n var a1;\n var m1;\n var con;\n var th1;\n var d;\n\n /* inverse equations\n -----------------*/\n p.x -= this.x0;\n p.y -= this.y0;\n con = Math.PI * this.R;\n xx = p.x / con;\n yy = p.y / con;\n xys = xx * xx + yy * yy;\n c1 = -Math.abs(yy) * (1 + xys);\n c2 = c1 - 2 * yy * yy + xx * xx;\n c3 = -2 * c1 + 1 + 2 * yy * yy + xys * xys;\n d = yy * yy / c3 + (2 * c2 * c2 * c2 / c3 / c3 / c3 - 9 * c1 * c2 / c3 / c3) / 27;\n a1 = (c1 - c2 * c2 / 3 / c3) / c3;\n m1 = 2 * Math.sqrt(-a1 / 3);\n con = ((3 * d) / a1) / m1;\n if (Math.abs(con) > 1) {\n if (con >= 0) {\n con = 1;\n }\n else {\n con = -1;\n }\n }\n th1 = Math.acos(con) / 3;\n if (p.y >= 0) {\n lat = (-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;\n }\n else {\n lat = -(-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;\n }\n\n if (Math.abs(xx) < EPSLN) {\n lon = this.long0;\n }\n else {\n lon = adjust_lon(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx);\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}", "update_all(check_box_if_direction_is_down = false){\n //ebugger;\n if(this.should_point_down) {\n this.set_maj_angles(Kin.point_down(this.maj_angles))\n }\n this.direction = Kin.J_angles_to_dir(this.maj_angles) //when this.should_point_down ==true.\n // Kin.J_angles_to_dir will return an array of 3 numbers that is within epsilon\n //of [0, 0, -1] but (at least often) not exactly [0, 0, -1],\n //so the call to similar has to take this into account and consider epslilon close to\n //[0, 0, -1] to be similar. Vector.is_equal can also handle this.\n if(check_box_if_direction_is_down) { //true only during init\n this.should_point_down = similar(this.direction, [0, 0, -1], Number.EPSILON * 100)\n }\n this.update_direction()\n this.update_range_and_angle_nums()\n this.xyz = Kin.J_angles_to_xyz(this.maj_angles)[0]\n this.update_xyz_nums()\n this.update_xyz_limits() //adjusts donut diameter\n this.update_xyz_circle() //adjusts the green (x,y) dot and the z slider\n this.update_j6_roll() //must set this.xyz before calling update_j6_roll\n this.update_editor_maybe()\n }" ]
[ "0.5986192", "0.59763193", "0.59486794", "0.5711595", "0.56706893", "0.56602633", "0.5621629", "0.56213063", "0.5600042", "0.55999804", "0.55525774", "0.55014837", "0.5498066", "0.5482615", "0.54121846", "0.5393094", "0.5388206", "0.5386546", "0.53769803", "0.5371065", "0.5346462", "0.5343251", "0.5337002", "0.53302777", "0.53287137", "0.5325111", "0.5324675", "0.5324135", "0.53222513", "0.5300491", "0.5272491", "0.5268732", "0.5256979", "0.5252367", "0.5251701", "0.52415997", "0.5239378", "0.52286977", "0.5228294", "0.5228013", "0.52197075", "0.5210611", "0.5209046", "0.5202561", "0.51915836", "0.5189336", "0.5185089", "0.5172641", "0.5169118", "0.5163176", "0.5162003", "0.51583904", "0.5152146", "0.5149109", "0.5143255", "0.5138124", "0.51316464", "0.513147", "0.51282907", "0.51274526", "0.5126596", "0.51207536", "0.51169074", "0.51159227", "0.51154655", "0.5114762", "0.5114092", "0.5113244", "0.5102231", "0.51010907", "0.50945616", "0.5089242", "0.5087532", "0.50811124", "0.5073618", "0.5072527", "0.5068708", "0.5066521", "0.5065557", "0.5064783", "0.5056381", "0.5055029", "0.5051048", "0.50460196", "0.50431573", "0.5041875", "0.50389576", "0.50369", "0.5034176", "0.5033418", "0.50304747", "0.502702", "0.50261873", "0.50261366", "0.50248", "0.50231135", "0.5022075", "0.5020212", "0.5019621", "0.5019211" ]
0.51857895
46
parameter calculation and correction
function calculateMapParameter(){ AddParametersFriendLocation() correctCloseLocations() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calc(params) {\n return 22; \n}", "function updateParams()\n{\n beta = parseFloat($('#param1').val()).toFixed(2);\n alpha = (1 - Number(beta)).toFixed(2);\n $('#fairnessVal').html(\"Fairness Weight: \" + beta);\n $('#throughputVal').html(\"Throughput Weight: \" + alpha);\n}", "function calculate(params) {\n let result = ( Number(params.limiteSuperior) + Number(params.limiteInferior) ) / 2\n let inferiorObjective = Number(params.valorObjetivo) - Number(params.margenError)\n let superiorObjective = Number(params.valorObjetivo) + Number(params.margenError)\n let objective = Number(params.valorObjetivo)\n let value1 = Number(params.limiteSuperior)\n let value2 = Number(params.limiteInferior)\n let counter = 1\n \n\n while((result > superiorObjective || result < inferiorObjective)) { \n let differenceOpeSupe = value1 - objective \n let differenceOpeInfe = objective - value2 \n if(differenceOpeSupe > differenceOpeInfe) {\n value1 = result\n } else {\n value2 = result\n }\n result = ( value1 + value2 ) / 2\n counter += 1\n\n if(result==superiorObjective || result==inferiorObjective) {\n break\n } \n }\n console.log(\"Resultado final: \",result)\n console.log(\"Total de iteraciones: \", counter)\n \n}", "function calcule (param1, param2,param3,param4) {\n\nreturn param1 * param2 * param3 /param4 ; \n\n\n}", "function addPSParams(output){\n var rho = output.slice(1,-1).split(\"Value:\")[1].replace(/ /g,''); \n var num_inputs = output.split(\",\").length;\n const div = $('<div>').attr({\"id\":\"psinstru_div\",\"class\":\"form-group\"})\n $('#specify').append(div);\n $('#psinstru_div').append(\"<p>rho=\"+rho);\n\n const nu_div = $('<div>').attr({\"id\":\"nu_div\",\"class\":\"form-group\"})\n const epsilon_div = $('<div>').attr({\"id\":\"epsilon_div\",\"class\":\"form-group\"})\n // add division for parameter nu\n $('#specify').append(nu_div);\n $('#nu_div').append(\"<p>Input nu parameter (rationals):</p>\");\n for (var i=1;i<num_inputs;i++){\n $('#nu_div').append(\"<input type=\\\"float\\\" id=\"+i+\" maxlength=\\\"5\\\" size=\\\"4\\\">\");\n $('#nu_div').append(\", \");\n }\n $('#nu_div').append(\"<input type=\\\"float\\\" id=\"+num_inputs+\" maxlength=\\\"5\\\" size=\\\"4\\\">\");\n // add division for parameter epsilon\n $('#specify').append(epsilon_div);\n $('#epsilon_div').append(\"<p>Input character of M parameter (signs):</p>\");\n for (var i=1;i<num_inputs;i++){\n $('#epsilon_div').append(small_dropdown_const(\"epsilon_\"+i));\n $('#epsilon_'+i).append($('<option>').attr(\"value\",\"pos\").text(\"\\$+\\$\"));\n $('#epsilon_'+i).append($('<option>').attr(\"value\",\"neg\").text(\"\\$-\\$\"));\n $('#epsilon_div').append(\", \");\n }\n $('#epsilon_div').append(small_dropdown_const(\"epsilon_\"+num_inputs));\n $('#epsilon_'+num_inputs).append($('<option>').attr(\"value\",\"pos\").text(\"\\$+\\$\"));\n $('#epsilon_'+num_inputs).append($('<option>').attr(\"value\",\"neg\").text(\"\\$-\\$\"));\n setOnchangeFuncs(\"epsilon_\"+num_inputs,\"clearElements([\\\"notice_choose_show\\\"]),displayNotice()\");\n $('.selectpicker').selectpicker('refresh');\n MathJax.Hub.Queue([\"Typeset\",MathJax.Hub,'epsilon_div'])\n}", "calcVars () {}", "calcExtraParams () {}", "function calc(){\r\n\"use strict\";\r\nnumPFail = (numFail/numTotalRuns)*100;\r\nnumP0 = (num0/numTotalRuns)*100;\r\nnumP1 = (num1/numTotalRuns)*100;\r\nnumP2 = (num2/numTotalRuns)*100;\r\nnumP3 = (num3/numTotalRuns)*100;\r\nnumP4 = (num4/numTotalRuns)*100;\r\nnumP5 = (num5/numTotalRuns)*100;\r\nnumRatePSB = numTotalPSB/numTotalRuns;\r\nnumRateRML = numTotalRML/numTotalRuns;\r\n}", "reparam(ua, ub) {\r\n let n = this.degree;\r\n let b = new common_1.NDArray({ shape: this.cpoints.shape });\r\n for (let i = 0; i < n + 1; i++) {\r\n let ts = [];\r\n for (let k = 0; k < n - i; k++) {\r\n ts.push(ua);\r\n }\r\n for (let k = 0; k < i; k++) {\r\n ts.push(ub);\r\n }\r\n b.set(i, helper_1.blossom(this.cpoints, n, ts));\r\n }\r\n this.cpoints = b;\r\n }", "function calculate(){\r\n let str\r\n let y=math.complex(0,1/Xc);\r\n let z = math.complex(R*l,Xl);\r\n \r\n\r\n let drop=document.getElementById('drop')\r\n if(drop.value===\"short\"){\r\n console.log(\"Short\");\r\n str=\"Short\"\r\n abcdParams(\"S\",z)\r\n\r\n }else if(drop.value===\"nominalpi\"){\r\n console.log(\"Nominal-Pi\");\r\n str=\"Nominal-Pi\"\r\n abcdParams(\"N\",z,y)\r\n \r\n }else if(drop.value===\"long\"){\r\n console.log(\"Long\");\r\n str=\"Long\"\r\n abcdParams(\"L\",z,y)\r\n }\r\n\r\n if(pfr<0){\r\n pfr=math.abs(pfr)\r\n Ir= math.complex({r:receivingCurr(Pr,pfr,V),phi:-math.acos(pfr)});\r\n sign =1;\r\n }\r\n else{\r\n pfr=math.abs(pfr)\r\n Ir= math.complex({r:receivingCurr(Pr,pfr,V),phi:math.acos(pfr)});\r\n sign =-1;\r\n }\r\n\r\n let a =math.multiply(A,parseFloat(V)/math.sqrt(3))\r\n let b= math.multiply(B,Ir)\r\n let c=math.multiply(C,parseFloat(V)/math.sqrt(3))\r\n let d =math.multiply(D,Ir)\r\n\r\n Vs=math.add(a,b);\r\n Is=math.add(c,d);\r\n\r\n let Vr=VR(parseFloat(V)/math.sqrt(3))\r\n let eff=effc(Pr,Vs,Is)\r\n let comp\r\n let Cs=[]\r\n let Cr=[]\r\n let Vp=parseFloat(V)/math.sqrt(3)\r\n \r\n if(drop.value===\"short\"){\r\n Cs.push((math.abs(D)*Math.pow(math.abs(Vs),2)*math.cos(math.atan(B.im/B.re)))/math.abs(B))\r\n Cs.push((math.abs(D)*Math.pow(math.abs(Vs),2)*math.sin(math.atan(B.im/B.re)))/math.abs(B))\r\n Cr.push((math.abs(A)*Math.pow(Vp,2)*math.cos(math.atan(B.im/B.re)))/math.abs(B))\r\n Cr.push((math.abs(A)*Math.pow(Vp,2)*math.sin(math.atan(B.im/B.re)))/math.abs(B))\r\n }\r\n else{\r\n Cs.push((math.abs(D)*Math.pow(math.abs(Vs),2)*math.cos(math.atan(B.im/B.re)-math.atan(D.im/D.re)))/math.abs(B))\r\n Cs.push((math.abs(D)*Math.pow(math.abs(Vs),2)*math.sin(math.atan(B.im/B.re)-math.atan(D.im/D.re)))/math.abs(B))\r\n Cr.push((math.abs(A)*Math.pow(Vp,2)*math.cos(math.atan(B.im/B.re)-math.atan(A.im/A.re)))/math.abs(B))\r\n Cr.push((math.abs(A)*Math.pow(Vp,2)*math.sin(math.atan(B.im/B.re)-math.atan(A.im/A.re)))/math.abs(B))\r\n }\r\n\r\n let Rc = math.abs(Vs)*Vp/math.abs(B);\r\n graph(Cs,Cr,Rc)\r\n\r\n\r\n let inputDiv=document.getElementById(\"visible\");\r\n let inputHead=document.getElementById(\"inputhead\");\r\n inputDiv.style.display=\"none\";\r\n inputHead.style.display=\"none\";\r\n let outputDiv=document.getElementById(\"invisible\");\r\n let outputHead=document.getElementById(\"outputhead\");\r\n let graphDiv=document.getElementById(\"graphsec\");\r\n graphDiv.style.display=\"flex\"\r\n let op = document.getElementsByClassName(\"op\");\r\n outputDiv.style.display=\"flex\"\r\n outputHead.style.display=\"flex\"\r\n Ich=chargingCurr();\r\n op[0].innerText=str;\r\n \r\n\r\n op[1].innerText=math.round(L,5);\r\n op[2].innerText=math.round(Cap,12);\r\n op[3].innerText=math.round(Xl,5);\r\n op[4].innerText=math.round(Xc,5);\r\n op[5].innerText=math.round(A,5);\r\n op[6].innerText=math.round(B,5);\r\n op[7].innerText=math.round(C,5);\r\n op[8].innerText=math.round(D,5);\r\n op[9].innerText=math.round(Vs,5);\r\n op[10].innerText=math.round(Is,5);\r\n op[11].innerText=math.round(Vr,5);\r\n op[12].innerText=math.round((Ps-Pr)/math.pow(10,6),5);\r\n op[13].innerText=math.round(eff,5);\r\n op[14].innerText=math.round(Ich,5);\r\n \r\n if(drop.value ===\"short\"){\r\n comp=compensation()\r\n \r\n if(comp){\r\n op[15].innerText=math.round(comp,5)\r\n }\r\n else{\r\n op[15].innerText=\"invalid\"\r\n }\r\n document.getElementsByClassName('h')[0].style.display=\"block\"\r\n if(comp<0)\r\n document.getElementsByClassName('h')[1].style.display=\"block\"\r\n else\r\n document.getElementsByClassName('h')[2].style.display=\"block\"\r\n }\r\n else{\r\n op[15].style.display=\"none\"\r\n document.getElementsByClassName('h')[0].style.display=\"none\"\r\n \r\n }\r\n \r\n}", "function evaluate_at(p, pi, swap_degree, v00, v01, v02, v10, v20, v11) {\n var degu = swap_degree ? p.degv : p.degu;\n var degv = swap_degree ? p.degu : p.degv;\n p.points[pi].copy(v00).normalize_rational_point();\n // surface normal\n // n = rv cross ru (but use a normalized derivative)\n {\n // when one edge is collapsed, use a different vector for the cross product\n var ru_n = v01.dup().normalize_rational_point().sub(v00.dup().normalize_rational_point()).scale(degu);\n if (ru_n.length() < 1e-6) {\n ru_n = v11.dup().normalize_rational_point().sub(v00.dup().normalize_rational_point()).scale(degu);\n }\n var rv_n = v10.dup().normalize_rational_point().sub(v00.dup().normalize_rational_point()).scale(degv);\n if (rv_n.length() < 1e-6) {\n rv_n = v11.dup().normalize_rational_point().sub(v00.dup().normalize_rational_point()).scale(degu);\n }\n p.normals[pi].copy(rv_n).cross(ru_n).normalize();\n }\n // ru = degu*(v01 - v00)\n var ru = v01.dup().sub4(v00).scale4(degu);\n // rv = degv*(v10 - v00)\n var rv = v10.dup().sub4(v00).scale4(degv);\n var ruu = new Vec3();\n if (degu > 1) {\n // ruu = (degu)*(degu - 1)*(v02 - 2*v01 + v00);\n ruu.copy(v02).sub4(v01).sub4(v01).add4(v00).scale4(degu).scale4(degu - 1);\n }\n var rvv = new Vec3();\n if (degv > 1) {\n // rvv = (degv)*(degv - 1)*(v20 - 2*v10 + v00)\n rvv.copy(v20).sub4(v10).sub4(v10).add4(v00).scale4(degv).scale4(degv - 1);\n }\n var ruv = new Vec3();\n if (p.kind == PatchType.Triangle) {\n if (p.degu > 1) {\n // ruv = degu*(degu - 1)*(v11 - v01 - v10 + v00)\n ruv.copy(v11).sub4(v01).sub4(v10).add4(v00).scale4(degu).scale4(degu - 1);\n }\n }\n else {\n // ruv = degu*degv*(v11 - v01 - v10 + v00)\n ruv.copy(v11).sub4(v01).sub4(v10).add4(v00).scale4(degu).scale4(degv);\n }\n // coefficients of first and second fundamental form\n var L = det4(ruu.x, ruu.y, ruu.z, ruu.d, ru.x, ru.y, ru.z, ru.d, rv.x, rv.y, rv.z, rv.d, v00.x, v00.y, v00.z, v00.d);\n var N = det4(rvv.x, rvv.y, rvv.z, rvv.d, ru.x, ru.y, ru.z, ru.d, rv.x, rv.y, rv.z, rv.d, v00.x, v00.y, v00.z, v00.d);\n var M = det4(ruv.x, ruv.y, ruv.z, ruv.d, ru.x, ru.y, ru.z, ru.d, rv.x, rv.y, rv.z, rv.d, v00.x, v00.y, v00.z, v00.d);\n var E = (ru.x * v00.d - v00.x * ru.d) * (ru.x * v00.d - v00.x * ru.d) + (ru.y * v00.d - v00.y * ru.d) * (ru.y * v00.d - v00.y * ru.d) + (ru.z * v00.d - v00.z * ru.d) * (ru.z * v00.d - v00.z * ru.d);\n var G = (rv.x * v00.d - v00.x * rv.d) * (rv.x * v00.d - v00.x * rv.d) + (rv.y * v00.d - v00.y * rv.d) * (rv.y * v00.d - v00.y * rv.d) + (rv.z * v00.d - v00.z * rv.d) * (rv.z * v00.d - v00.z * rv.d);\n var F = (ru.x * v00.d - v00.x * ru.d) * (rv.x * v00.d - v00.x * rv.d) + (ru.y * v00.d - v00.y * ru.d) * (rv.y * v00.d - v00.y * rv.d) + (ru.z * v00.d - v00.z * ru.d) * (rv.z * v00.d - v00.z * rv.d);\n var kesv = new Vec3();\n kesv.x = det3(v00.y, v00.z, v00.d, ru.y, ru.z, ru.d, rv.y, rv.z, rv.d);\n kesv.y = det3(v00.x, v00.z, v00.d, ru.x, ru.z, ru.d, rv.x, rv.z, rv.d);\n kesv.z = det3(v00.x, v00.y, v00.d, ru.x, ru.y, ru.d, rv.x, rv.y, rv.d);\n var kes = kesv.dot(kesv);\n var crv_res = p.curvature[pi];\n crv_res.gaussian = v00.d * v00.d * v00.d * v00.d * (L * N - M * M) / (kes * kes);\n crv_res.mean = -v00.d * (L * G - 2 * M * F + N * E) / Math.sqrt(kes * kes * kes) / 2;\n // TODO: why is the curvature sometimes NaN ?\n if (isNaN(crv_res.gaussian)) {\n crv_res.gaussian = 0;\n }\n if (isNaN(crv_res.mean)) {\n crv_res.mean = 0;\n }\n var disc = crv_res.mean * crv_res.mean - crv_res.gaussian;\n if (disc < 0) {\n crv_res.max = crv_res.mean;\n crv_res.min = crv_res.mean;\n }\n else {\n disc = Math.sqrt(disc);\n crv_res.max = crv_res.mean + disc;\n crv_res.min = crv_res.mean - disc;\n }\n}", "function pvCalc(rate, term){\n\t\t\t\t\n\t\t\t\t// Present Value variable declaration\n\t\t\t\tvar pv = 0;\n\n\t\t\t\t// Present Value from Annual Cash Flow\n\t\t\t\tfor(var i = 1; i <= term; i++){\n\t\t\t\t\tpv += annualCF * (1 / Math.pow(1 + rate, i));\n\t\t\t\t}\n\n\t\t\t\t// Present Value from Termination\n\t\t\t\tpv += termination * (1 / Math.pow(1 + rate, term));\n\n\t\t\t\treturn pv;\n\t\t\t}", "function recalcFpr(n) {\n var pbgna=parseFloat($('#fpr'+n).val());\n var pbga=parseFloat($('#pbga'+n).val());\n var pa=parseFloat($('#pagb'+(n-1)).val());\n var pb = pbga*pa + pbgna*(1-pa);\n $('#pb'+n).val(pb);\n recalcBayes(n); \n}", "function questionCalculations()\r\n\t{\r\n\t\t// here, calculations for all the above variables should occur\r\n\t}", "function getValue(v1, v2, v3, h, l, e) {\r\n\r\n\tvar vsum = v1+v2+v3;\r\n\r\n\tvar sum = h+l+e;\r\n\r\n\tvar proz_h = (h/sum) * ((h/sum*100) - (v1/vsum*100));\r\n\r\n\tvar proz_l = (l/sum) * ((l/sum*100) - (v2/vsum*100));\r\n\r\n\tvar proz_e = (e/sum) * ((e/sum*100) - (v3/vsum*100));\r\n\r\n\treturn proz_h + proz_l + proz_e;\r\n\r\n}", "getLineParameters() {\n if (this.x1 !== this.x2) {\n this.a = ((this.y2 - this.y1)) / ((this.x1 - this.x2))\n this.b = 1.0\n this.c = this.a * this.x1 + this.b * this.y1\n }\n else {\n this.a = 1.0\n this.b = ((this.x1 - this.x2)) / ((this.y2 - this.y1))\n this.c = this.a * this.x1 + this.b * this.y1\n }\n }", "function calculation () {\n omega = 2*Math.PI*ny; // Kreisfrequenz (1/s)\n if (dPhi == 0) i0 = u0/r; // Maximale Stromstärke (A, für Widerstand)\n else if (dPhi > 0) i0 = u0*omega*c; // Maximale Stromstärke (A, für Kondensator)\n else i0 = u0/(omega*l); // Maximale Stromstärke (A, für Spule)\n }", "function Reparameterize(d, first, last, u, bezCurve)\n{\n var i;\n var\tuPrime = [];\t\t/* New parameter values\t*/\n\n for (i = first; i <= last; i++)\n\t{\n\t\tuPrime[i-first] = NewtonRaphsonRootFind(bezCurve, d[i], u[i - first]);\n }\n\n return uPrime;\n}", "applyIntervention (guiParams) {\n for (let param of guiParams) {\n if (!_.isNil(param.key)) {\n this.param[param.key] = parseFloat(param.value)\n }\n }\n this.calcExtraParams()\n }", "function calculation () {\n omega1 = Math.sqrt(G/L); // 1. Eigen-Kreisfrequenz (parallele Schwingung)\n omega2 = Math.sqrt(G/L+2*D/M); // 2. Eigen-Kreisfrequenz (antiparallele Schwingung)\n a1 = (alpha01+alpha02)/2; // Hilfsgröße \n a2 = (alpha01-alpha02)/2; // Hilfsgröße\n }", "function correctionFactor(){var args=Array.prototype.slice.call(arguments);return args.reduce(function(prev,next){var mp=multiplier(prev),mn=multiplier(next);return mp>mn?mp:mn;},-Infinity);}", "function init_model_parameters()\n {\n //:primary params\n var a = toreg( 'a' )( 'value', sconf.a )( 'value' );\n toreg( 'alpha' )( 'value', sconf.alpha );\n toreg( 'beta' )( 'value', sconf.beta );\n toreg( 'gamma' )( 'value', sconf.gamma );\n toreg( 'O' )( 'pos', [0,0] );\n toreg( 'H' )( 'pos', [0,0] );\n\n //dependent parameters\n toreg( 'nB' )( 'value', [ 1, 0 ] );\n toreg( 'nA' )( 'value', [ -1, 0 ] );\n\n //variable parameter\n toreg( 'g' )( 'value', sconf.initial_g );\n\n //decorations:\n toreg( 'gN' )( 'value', sconf.initial_gN );\n\n setRgPoint( 'A', [ -rg.a.value, 0 ] )\n setRgPoint( 'B', [ 1-rg.a.value, 0 ] )\n\n toreg( 'b' );\n baseParams_2_extendedParams();\n //dev tool:\n //ellipsePar_create8paint( 1.50 )\n }", "function getPars ()\n {\n // extract values of all input forms of class \"pars\"\n var boxes = d3.selectAll(\"#\" + args.c + \" .pars\");\n var vals = boxes[0].map(\n function (el) {return +d3.select(el).property(\"value\");});\n // Update global values of parameters with new user-specified values for target distribution\n targetMuX = vals[0]; targetMuY = vals[1]; targetSigmaX = Math.abs(vals[2]);\n targetSigmaY = Math.abs(vals[3]); targetRho = vals[4];\n // Update global values for proposal distribution (positions 5-9 of vals)\n\tproposalSigmaX = vals[5]; proposalSigmaY = vals[6]; proposalRho = vals[7];\n \n // regenerate data\n generate();\n // redraw svg\n redraw();\n return 0;\n }", "function specialCasesRecalc(mission) {\n\t\n}", "function recalcNorm(n) {\n var mean=parseFloat($('#mean'+n).val());\n var stdev=parseFloat($('#stdev'+n).val());\n var v=parseFloat($('#nv'+n).val());\n if (isNaN(mean) || isNaN(stdev) || isNaN(v)) return;\n var p = jStat.normal.cdf(v, mean, stdev);\n if (p > .5) {\n\tp = 1-p;\n }\n $('#fpr'+n).val(p);\n recalcFpr(n);\n}", "Pr_u_t_v(user_move, optimal, user_pos) {\n var comp = this.sinput(optimal, user_pos);\n var p = 0\n\n if (user_move == 1) {\n if (comp == 1) { p = 0.8; }\n else if (comp == 2) { p = 0.05; }\n else if (comp == 3) { p = 0.05; }\n else if (comp ==4) { p = 0.05; }\n else if (comp == 0) { p = 0.05; }\n }\n\n if (user_move == 2) {\n if (comp == 1) { p = 0.05; }\n else if (comp == 2) { p = 0.8; }\n else if (comp == 3) { p = 0.05; }\n else if (comp ==4) { p = 0.05; }\n else if (comp == 0) { p = 0.05; }\n }\n\n if (user_move == 3) {\n if (comp == 1) { p = 0.05; }\n else if (comp == 2) { p = 0.05; }\n else if (comp == 3) { p = 0.8; }\n else if (comp ==4) { p = 0.05; }\n else if (comp == 0) { p = 0.05; }\n }\n\n if (user_move == 4) {\n if (comp == 1) { p = 0.05; }\n else if (comp == 2) { p = 0.05; }\n else if (comp == 3) { p = 0.05; }\n else if (comp ==4) { p = 0.8; }\n else if (comp == 0) { p = 0.05; }\n }\n\n if (user_move == 0) {\n if (comp == 1) { p = 0.05; }\n else if (comp == 2) { p = 0.05; }\n else if (comp == 3) { p = 0.05; }\n else if (comp ==4) { p = 0.05; }\n else if (comp == 0) { p = 0.8; }\n }\n\n return p;\n }", "function calculate_residual(){\n var $initial_balance = $(\"#id_initial_balance\");\n if($initial_balance.val()){\n var initial_balance = parseFloat($initial_balance.val().replace(\",\", \"\"));\n\n $(\"[id$='total']\").each(function(){\n //the element not visible is the template used to create the allocations form\n if($(this).is(\":visible\") && $(this).val())\n initial_balance -= parseFloat($(this).val().replace(\",\", \"\"));\n });\n\n $(\"#id_residual\").val(initial_balance.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,'))\n }\n }", "fRn(){\n return 0.25*this.fm*this.b*this.Lbrg\n }", "function calculate(){}", "function calculateInteractionParam(keV) {\n let keV_300 = 300;\n let c = 3e8;\n let mass_e = 9.11e-31;\n let charge_e = 1.602e-19;\n let lambda = lambdaCalc(keV);\n let lambda_300 = lambdaCalc(keV_300);\n let param =\n (((2 * PI) / (((lambda * keV) / charge_e) * 1000)) *\n (mass_e * c * c + keV * 1000)) /\n (2 * mass_e * c * c + keV * 1000);\n let param_300 =\n (((2 * PI) / (((lambda_300 * keV_300) / charge_e) * 1000)) *\n (mass_e * c * c + keV_300 * 1000)) /\n (2 * mass_e * c * c + keV_300 * 1000);\n return param / param_300;\n}", "function resolver(){\n A = Number(document.getElementById(\"valorA\").value);\n B = Number(document.getElementById(\"valorB\").value);\n C = Number(document.getElementById(\"valorC\").value);\n \n delta = B**2 - 4*A*C; \n if (delta <= 0){\n document.getElementById(\"msg\").innerHTML = \"NÃO EXISTE RAIZ REAL\";\n } else{\n resX1 = (-B + delta**0.5) / (2*A);\n resX2 = (-B - delta**0.5) / (2*A);\n x1.innerHTML = resX1.toFixed(2); \n x2.innerHTML = resX2.toFixed(2); \n }\n}", "function inrfunc()\r\n{\r\n usd.value = parseFloat(inr.value) * 0.014;\r\n eur.value = parseFloat(inr.value) * 0.013;\r\n cad.value = parseFloat(inr.value) * 0.019;\r\n aud.value = parseFloat(inr.value) * 0.020;\r\n}", "checkParam(param) {\n\t\tthis.m = param.m;\n\t\tthis.k = param.k;\n\t\tthis.n = param.n;\n\t\tthis.t = param.t;\n\t\tthis.genPoly = {val: param.genPoly.val, txt: param.genPoly.txt};\n\n\t\t//this.lang = new LangPack(param.lang); // default language is english\n\t\tlet lang = this.lang.gn;\n\t\tif (this.debug) console.log('Checking parameters...');\n\n\t\t// parity bit number check\n\t\tif ((Math.pow(2, this.k) - this.k) < (this.m + 1 + this.t - 2)){\n\t\t\treturn (lang.wrongK);\n\t\t}\n\n\t\t// codeword bit number check\n\t\tif (this.n !== (this.m + this.k)){\n\t\t\treturn lang.wrongN;\n\t\t}\n\n\t\t// poly check\n\t\tif (this.t === 2)\n\t\t\tswitch (this.k){\n\t\t\t\tcase 3:\n\t\t\t\t\tif(this.genPoly.val !== '3.1' && this.genPoly.val !== '3.2') return lang.wrongGenPoly;\n\t\t\t\t\tthis.xorIds = this.genPoly.val === '3.1'? ['xor0','xor2'] : ['xor1','xor2'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tif(this.genPoly.val !== '4.1' && this.genPoly.val !== '4.2') return lang.wrongGenPoly;\n\t\t\t\t\tthis.xorIds = this.genPoly.val === '4.1'? ['xor0','xor3'] : ['xor2','xor3'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tif(this.genPoly.val !== '5.1' && this.genPoly.val !== '5.2') return lang.wrongGenPoly;\n\t\t\t\t\tthis.xorIds = this.genPoly.val === '5.1'? ['xor1','xor4'] : ['xor2','xor4'];\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\telse if (this.t === 3)\n\t\t\tswitch (this.k){\n\t\t\t\tcase 4:\n\t\t\t\t\tif(this.genPoly.val !== '3.3' && this.genPoly.val !== '3.4') return lang.wrongGenPoly;\n\t\t\t\t\tthis.xorIds = this.genPoly.val === '3.3'? ['xor1','xor2','xor3'] : ['xor1','xor3'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tif(this.genPoly.val !== '4.3' && this.genPoly.val !== '4.4') return lang.wrongGenPoly;\n\t\t\t\t\tthis.xorIds = this.genPoly.val === '4.3'? ['xor1','xor3','xor4'] : ['xor0','xor2','xor4'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tif(this.genPoly.val !== '5.3' && this.genPoly.val !== '5.4') return lang.wrongGenPoly;\n\t\t\t\t\tthis.xorIds = this.genPoly.val === '5.3'? ['xor0','xor1','xor2','xor4','xor5'] : ['xor0','xor2','xor3','xor4','xor5'];\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\tif (this.debug) console.log('OK');\n\t\treturn true;\n\t}", "overpressureToDistance(overPressurekPa)\n{\n const a1 = -0.214362789151;\n const b1 = 1.35034249993;\n const c01 = 2.78076916577;\n const c11 = -1.6958988741;\n const c21 = -0.154159376846;\n const c31 = 0.514060730593;\n const c41 = 0.0988554365274;\n const c51 = -0.293912623038;\n const c61 = -0.0268112345019;\n const c71 = 0.109097496421;\n const c81 = 0.001628467556311;\n const c91 = -0.0214631030242;\n const c101 = 0.0001456723382;\n const c111 = 0.00167847752266;\n \n //Tolerancia del cálculo\n const tolerance = 0.001;\n\n //Valor de inicio del calculo de dsitancia x a la de sobrepresion overPressureTNT;\n let xTNT = 0;\n \n //Presion inicial para el cálculo este numero es el maximo reportado por EPA en kPA\n var pres = 33000;\n \n //Calculo de Masa equivalente de TNT\n let masaEQTNT = (this.fe*this.hCombKJKG*this.mass)/DHCTNT;\n \n //Calculo de la distancia por iteracion\n for (xTNT = 1; pres > overPressurekPa; xTNT = xTNT + tolerance)\n {\n //Distancia Escalada (m/kg^1/3)\n const z = xTNT/Math.pow(masaEQTNT, 1.0/3.0);\n \n let ablog = a1+b1*Math.log10(z);\n let c = c01+c11*ablog+c21*Math.pow(ablog, 2)+c31*Math.pow(ablog, 3)+c41*Math.pow(ablog, 4)+c51*Math.pow(ablog, 5)+c61*Math.pow(ablog, 6)+c71*Math.pow(ablog, 7)+c81*Math.pow(ablog, 8)+c91*Math.pow(ablog, 9)+c101*Math.pow(ablog, 10)+c111*Math.pow(ablog, 11);\n pres = Math.pow(10, c);\n }\n return xTNT;\n\n}", "calculateParameters(){\n this.length = computeLength(this.startpoint.x, this.startpoint.y, this.endpoint.x, this.endpoint.y);\n this.deltaX = this.endpoint.x-this.startpoint.x;\n this.deltaY = this.endpoint.y-this.startpoint.y;\n }", "function correctionFactor()\n\t\t\t{\n\t\t\t\tvar args = Array.prototype.slice.call(arguments);\n\t\t\t\treturn args.reduce(function(prev, next)\n\t\t\t\t{\n\t\t\t\t\tvar mp = multiplier(prev), mn = multiplier(next);\n\t\t\t\t\treturn mp > mn ? mp : mn;\n\t\t\t\t}, -Infinity);\n\t\t\t}", "function correctionFactor() {\n\t var args = Array.prototype.slice.call(arguments);\n\t return args.reduce(function (prev, next) {\n\t var mp = multiplier(prev),\n\t mn = multiplier(next);\n\t return mp > mn ? mp : mn;\n\t }, -Infinity);\n\t }", "function correctionFactor() {\n\t var args = Array.prototype.slice.call(arguments);\n\t return args.reduce(function (prev, next) {\n\t var mp = multiplier(prev),\n\t mn = multiplier(next);\n\t return mp > mn ? mp : mn;\n\t }, -Infinity);\n\t }", "function correctionFactor() {\n\t var args = Array.prototype.slice.call(arguments);\n\t return args.reduce(function (prev, next) {\n\t var mp = multiplier(prev),\n\t mn = multiplier(next);\n\t return mp > mn ? mp : mn;\n\t }, -Infinity);\n\t }", "function correctionFactor() {\n\t var args = Array.prototype.slice.call(arguments);\n\t return args.reduce(function(prev, next) {\n\t var mp = multiplier(prev),\n\t mn = multiplier(next);\n\t return mp > mn ? mp : mn;\n\t }, -Infinity);\n\t }", "function resolver() {\n\n const n = parseInt(document.getElementById(\"n\").value); //número de ensaios\n const k = parseFloat(document.getElementById(\"k\").value); //número de casos de sucesso\n const p = parseFloat(document.getElementById(\"p\").value); //Porcentagem de caso de sucesso\n\n const numBinominal = nBinomial();\n\n const result = (numBinominal * ((p ** k) * (1 - p) ** (n - k))).toFixed(4);\n\n const resultSet = (result * 100).toFixed(2);\n\n resultado.textContent = `A probabilidade de sucesso é de: ${result}, em porcentagem: ${resultSet} %.`;\n}", "function recalcBinom(n) {\n var cnt=parseFloat($('#n'+n).val());\n var p=parseFloat($('#p'+n).val());\n var v=parseFloat($('#bv'+n).val());\n if (isNaN(cnt) || isNaN(p) || isNaN(v)) return;\n var e = cnt*p;\n if (v<e) {\n\tvar p2 = jStat.binomial.cdf(v,cnt,p);\n } else if (v>e) {\n\tvar p2 = 1-jStat.binomial.cdf(v-1,cnt,1-p);\n } else {\n\tvar p2 = 1;\n }\n $('#fpr'+n).val(p2);\n recalcFpr(n);\n}", "function calc(a, log){\n if (udfp(log))log = function (){};\n log(\"Input\", \"$1\", a);\n a = prs(a, log);\n a = evl(a, log);\n log(\"Finish evl\", \"$1\", a);\n a = dsp(a);\n log(\"Finish dsp\", \"$1\", a);\n \n return a;\n }", "function VelocityCalculation(InitialPosition, FinalPosition, Time, Acceleration)\n{\n //v = (xf - xi - (1/2)a*t^2)/t || v = (xf - xi - ( ((1/2) * a * t^2 ) / t)\n var Velocity = FinalPosition - InitialPosition - ( (1/2) * Acceleration * Math.pow(Time, 2) );\n document.getElementById(\"result\").value = Velocity;\n //return Velocity;\n}", "function onR3Changed() {\n var val_str = document.getElementById(\"r3\").value;\n var val_good = check_unit( val_str, \"ohm\", \"r3\" );\n if (val_good) {\n setR3( math.unit( document.getElementById(\"r3\").value ).value ); \n } else {\n document.getElementById(\"r3\").value = math.unit(loop_filter.r3,\"ohm\").format(3);\n return;\n }\n\n simulatePll();\n\n}", "function exam(a)\r\n{\r\n //solving fexam\r\nlet fexam = (60/100)*a\r\n//allowing access to fexam result\r\nreturn fexam\r\n\r\n}", "function PerkalianV2 (a, b) {\n //local variabel\n let hasil = a * b\n\n //give return value, spy value dr hasil bisa dipake diluar\n return hasil\n}", "function cal(p,r){\n return p + r\n}", "function calculateResult(array) {\n let answer1 = array[0] * 12;\n let answerModified = turnToNumber(1);\n console.log(\"answerModified\", answerModified);\n let answer2 = (answer1 * answerModified) / 100 + answer1;\n console.log(\"answer2\", answer2);\n let terminalValue = answer2 * 2;\n console.log(\"treminalValue\", terminalValue);\n let postMV = terminalValue / 20;\n console.log(\"postMV\", postMV);\n let preMV = postMV - array[0];\n console.log(\"preMV\", preMV);\n let answerThreeModified = turnIndexToNumber(2);\n let answer3 = (answerThreeModified * 30) / 10000;\n console.log(\"answer3\", answer3);\n let answerFourModified = turnIndexToNumber(3);\n let answer4 = (answerFourModified * 25) / 10000;\n let answerFiveModified = turnIndexToNumber(4);\n let answer5 = (answerFiveModified * 15) / 10000;\n let answerSixModified = turnIndexToNumber(5);\n let answer6 = (answerSixModified * 10) / 10000;\n let answerSeventhModified = turnIndexToNumber(6);\n let answer7 = (answerSeventhModified * 10) / 10000;\n // //figure out how to make it prettier\n let answer81 = (answerSeventhModified * 100) / array[0];\n let answer8 = (answer81 * 5) / 10000;\n let answer9 = (array[8] * 5) / 10000;\n let sumOfFactors =\n answer3 + answer4 + answer5 + answer6 + answer7 + answer8 + answer9;\n let preFinalResult = sumOfFactors * preMV;\n //this is THE RESULT\n let finalResult = parseFloat(preFinalResult.toFixed(2));\n // console.log(\"sumOfFactors\", sumOfFactors)\n return finalResult;\n}", "function updateWellbeing() {\n // Get user BMI based upon weight and height, BMI = weight(kg) / height(m)^2\n var userBMI = $scope.user.weight / (Math.pow($scope.user.height / 100, 2)); // height is stored in cms\n \n // Get critical walking speed based on user BMI\n var thisCriticalWalkingSpeed = userBMI > $scope.algorithmValues.critical_bmi ? \n $scope.algorithmValues.critical_walking_speed_obese : \n $scope.algorithmValues.critical_walking_speed_healthy;\n \n // TODO change algorithm values from web service to camel case\n var thisDangerToWellBeingRatio = (userBMI / $scope.algorithmValues.critical_bmi) * \n (Math.abs(getCurrentWalkingVelocity()) / thisCriticalWalkingSpeed) *\n (Math.abs(getCurrentSteppingVelocity()) / $scope.algorithmValues.critical_stepping_velocity);\n \n $scope.workingRatioValues.unshift(thisDangerToWellBeingRatio);\n \n // Is there enough working ratio values to calculate overall danger to well being ratio \n if ($scope.workingRatioValues.length >= TIME_TO_TAKE_AVG_OVER / options.frequency) {\n var ratioSum = 0;\n \n // Get average ratio from working values\n for (var i in $scope.workingRatioValues) {\n ratioSum += $scope.workingRatioValues[i];\n }\n \n $scope.dangerToWellBeingRatio = ratioSum / $scope.workingRatioValues.length;\n $scope.workingRatioValues.pop(); // remove last value\n showAlertIfInDanger();\n }\n/*\n\n// Hardcoded at this stage to test, to be replace with logged in user details\n // TODO change algorithm values from service to camel case\n $scope.dangerToWellBeingRatio = (userBMI / $scope.algorithmValues.critical_bmi) *\n (getCurrentWalkingVelocity() / thisCriticalWalkingSpeed) *\n (getCurrentSteppingVelocity() / $scope.algorithmValues.critical_stepping_velocity);\n\n // Lets do some logging!!!\n console.log('Current Walking Velocity', $scope.currentWalkingVelocity);\n console.log('Current Stepping Velocity', $scope.currentSteppingVelocity);\n\n console.log('wellBeingratio', $scope.dangerToWellBeingRatio);\n if ($scope.dangerToWellBeingRatio < 0.4) {\n $scope.wellBeing = 'good';\n console.log('good');\n } else\n if ($scope.dangerToWellBeingRatio < 1) {\n $scope.wellBeing = 'caution';\n console.log('caution');\n } else\n if ($scope.dangerToWellBeingRatio < 1.7) {\n $scope.wellBeing = 'danger';\n console.log('danger');\n //showAlert('Slow Down');\n\n } else {\n $scope.wellBeing = 'stop';\n console.log('stop');\n showAlert('Stop Exercising');\n }\n\n\n*/\n \n }", "function solveValue(){\n //ph, pka, a, ha\n // ensure that all 3 inputsValue is not null\n let valid = 0;\n for(let i = 0; i < inputsValue.length; i++){\n if(!solve[i] && (inputsValue[i] != null) && inputsValue[i] != ''){\n valid++;\n }\n }\n\n if(valid == 3){\n switch(getSolve()){\n case 0:\n try{\n if(inputsValue[3] == 0){\n throw \"invalid value\";\n }\n inputs[0].value = Number(inputsValue[1]) + Number(Math.log10(inputsValue[2]/inputsValue[3]));\n inputsValue[0] = inputs[0].value;\n } catch (err){\n inputs[0].value = 0;\n }\n break;\n case 1:\n try{\n if(inputsValue[3] == 0){\n throw \"invalid value\";\n }\n inputs[1].value = -1 * (-Number(inputsValue[0]) + Number(Math.log10(inputsValue[2]/inputsValue[3]) ));\n\n } catch (err){\n inputs[1].value = 0;\n }\n\n break;\n case 2:\n try{\n if(inputsValue[3] == 0){\n throw \"invalid value\";\n }\n inputs[2].value = Math.pow(10, (Number(inputsValue[0]) - Number(inputsValue[1]))) * Number(inputsValue[3]);\n } catch{\n inputs[2].value = 0;\n }\n\n break;\n case 3:\n try{\n if(inputsValue[3] == 0){\n throw \"invalid value\";\n }\n inputs[3].value = Math.pow(Math.pow(10, (Number(inputsValue[0]) - Number(inputsValue[1]))) /Number(inputsValue[2]), -1);\n } catch{\n inputs[3].value = 69;\n }\n break;\n }\n }\n}", "_setQProd(qr, qa, qb) {\nvar i, k, rc, rd, re, va, vb, wa, wb;\nva = [qa[0], qa[1], qa[2]];\nvb = [qb[0], qb[1], qb[2]];\nwa = qa[3];\nwb = qb[3];\nqr[3] = (wa * wb) - (va[0] * vb[0] + va[1] * vb[1] + va[2] * vb[2]);\nrc = [wa * vb[0], wa * vb[1], wa * vb[2]];\nrd = [wb * va[0], wb * va[1], wb * va[2]];\nre = [va[1] * vb[2] - va[2] * vb[1], va[2] * vb[0] - va[0] * vb[2], va[0] * vb[1] - va[1] * vb[0]];\nfor (i = k = 0; k < 3; i = ++k) {\nqr[i] = rc[i] + rd[i] + re[i];\n}\nreturn void 0;\n}", "function onR2Changed() {\n var val_str = document.getElementById(\"r2\").value;\n var val_good = check_unit( val_str, \"ohm\", \"r2\" );\n if (val_good) {\n setR2( math.unit( document.getElementById(\"r2\").value ).value ); \n } else {\n document.getElementById(\"r2\").value = math.unit(loop_filter.r2,\"ohm\").format(3);\n return;\n }\n\n simulatePll();\n\n}", "function calcVAC()\r\n{\r\n\t\r\n\t//first clear out any previous VAE determination\r\n\tclearVAE();\r\n\tresetVacDayLabel(true);\r\n\t$('#explain').show(); //show the explain button\r\n\tresetVAEObject(); //set results back to empty\r\n\r\n\r\n\tvar input_vals = \"\";\r\n\tvar inputError = false;\r\n\tvar peep = [];\r\n\tvar fio2 = [];\r\n\tvar err = \"\";\r\n\tvar peepException = \"\";\r\n\tdirection = explanation = \"\";\r\n\tvar peepLessThan5 = false;\r\n\tshowPeepFooter(peepLessThan5);\r\n\t\r\n\tvar err = \"\";\r\n\t$(\"input[name=PEEP]\").each( function(index, object) {\r\n\tvar peepVal = this.value.split('(');\r\n\tpeep[index] = $.trim(peepVal[0]);\r\n\t\tif(peep[index] !== \"\") { //ignore of no entry\r\n\t\t\tif( isNaN(peep[index]) || peep[index] < 0 || peep[index] > 40) {\r\n\t\t\t\terr += \"<br>Input Error: The PEEP value = \" + peep[index] + \" on day \" + getMVDate(index+1) + \" must be a number between 0 and 40. <br>\";\t\r\n\t\t\t\tinputError = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tpeep[index] = parseFloat(peep[index]);\r\n\t\t\t\tif(peep[index] < 5 ) {\r\n\t\t\t\t\tthis.value = '5 (' + peep[index] + ')*'; \r\n\t\t\t\t\tpeep[index] = 5;\r\n\t\t\t\t\tpeepLessThan5 = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\t$(\"input[name=fio2]\").each( function(index, object) {\r\n\t\tfio2[index] = $.trim(this.value);\r\n\t\t\r\n\t\tif(fio2[index] !== \"\") {\r\n\t\t\tif( isNaN(fio2[index]) || fio2[index] < 20 || fio2[index] > 100) {\t\t\t\r\n\t\t\t\terr += \"<br>The FiO2 value = \" + fio2[index] + \" on day \" + getMVDate(index+1) + \" must be between 20 and 100. <br>\";\r\n\t\t\t\tinputError = true;\r\n\t\t\t}\r\n\t\t\telse fio2[index] = parseFloat(fio2[index]);\r\n\t\t}\r\n\t});\r\n\t\r\n\tif(inputError) {\r\n\t\tmyAlert(err);\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\r\n\t//now look for periods of stability......\r\n\tvar foundAVac;\r\n\tfor (i=0; i < fio2.length-3; i++)\r\n\t{\r\n\t\tfoundAVac = false; //this is a flag to catch the case where both FIO2 and PEEP vales give a VAC on the same day\r\n\r\n\t\tif(fio2[i+1] !== \"\" && fio2[i] !== \"\") { //skip over null values\r\n\t\t\tif(fio2[i+1] - fio2[i] <= 0) \r\n\t\t\t{\t\r\n\t\t\t\tvar maxVal = Math.max(fio2[i+1],fio2[i]);\r\n\t\t\t\tif ( (fio2[i+2] - maxVal >= 20) && (fio2[i+3] - maxVal >= 20) ) {\r\n\t\t\t\t\tvae.eventDays.push(i+3);//Found a VAC\r\n\t\t\t\t\tvae.types.push('VAC');\t\r\n\t\t\t\t\tvae.vacDeterminedBy.push(FIO2);\r\n\t\t\t\t\tfoundAVac = true;\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t}\r\n \r\n\t\tif(peep[i+1] !== \"\" && peep[i] !== \"\") { //skip over null values \r\n\t\t\tif(peep[i+1] - peep[i] <= 0 ) {\r\n\t\t\t\tvar maxVal = Math.max(peep[i+1], peep[i]);\r\n\t\t\t\t\r\n\t\t\t\tif ( (peep[i+2] - maxVal >= 3) && (peep[i+3] - maxVal >= 3) ) {\r\n\t\t\t\t\t//vacDays.push(i+2); //Found a VAC\t\r\n\t\t\t\t\tif(!foundAVac) {\r\n\t\t\t\t\t\tvae.eventDays.push(i+3);\r\n\t\t\t\t\t\tvae.types.push('VAC');\r\n\t\t\t\t\t\tvae.vacDeterminedBy.push(PEEP);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse vae.vacDeterminedBy[vae.vacDeterminedBy.length-1] = 'PEEP and FIO2';\r\n\t\t\t\t\t\r\n\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t//finally\r\n\t\r\n\t showPeepFooter(peepLessThan5);\r\n\r\n\t}\r\n\r\n\t\r\n\t\r\n\tdirection = '';\r\n\texplanation = '<h3>Explanation:</h3>';\r\n\t\r\n\t\r\n\t\r\n\tif(vae.eventDays.length) {\t\r\n\t\r\n\t\t//alert(JSON.stringify(vae));\r\n\t\r\n\t\tvar vacDaysCopy = [];\r\n\t\tvar lastVAC;\r\n\t\tfor(var j = 0; j < vae.eventDays.length; j++ ) {\r\n\t\t\tvacDaysCopy[j] = vae.eventDays[j];\r\n\t\t}\r\n\t\r\n\t\t\tfor(var k = 0; k < vacDaysCopy.length; k++ ) {\r\n\t\t\t\tif(k == 0) {\r\n\t\t\t\t\tlastVAC = vae.eventDays[k];\r\n\t\t\t\t\tdirection += \"<p>A Ventilator-Associated Condition (VAC) based on \" + vae.vacDeterminedBy[k] + \" values occurred on \" + getMVDate(vacDaysCopy[k]) + \"</p>\";\r\n\t\t\t\t\texplanation += \"<p>The two days preceding \" + getMVDate(vacDaysCopy[k]) + \" are the baseline period of stability or improvement followed by a sustained period (&ge; 2 days) of worsening oxygenation. </p>\";\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tif( vacDaysCopy[k] - lastVAC >= 14) {\r\n\t\t\t\t\t\tlastVAC = vacDaysCopy[k];\r\n\t\t\t\t\t\tdirection += \"<p>Another Ventilator-Associated Condition (VAC) based on \" + vae.vacDeterminedBy[k] + \" values occurred on \" + getMVDate(vacDaysCopy[k]) + \"<br>\";\r\n\t\t\t\t\t\texplanation += \"<p>The two days preceding \" + getMVDate(vacDaysCopy[k]) + \" are the baseline period of stability or improvement followed by a sustained period (&ge; 2 days) of worsening oxygenation. </p>\";\r\n\t\t\t\t\t\texplanation += \"<p>The VAC on \" + getMVDate(vacDaysCopy[k]) + \" is counted as a VAC since it occurred more than 14 days after the previous VAC.</p>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(vacDaysCopy[k] - lastVAC != 0) {\r\n\t\t\t\t\t\tvar index = myIndexOf(vae.eventDays, vacDaysCopy[k].toString());\r\n\t\t\t\t\t\tif(index != -1) {\r\n\t\t\t\t\t\t\tvae.eventDays.splice(index, 1);\r\n\t\t\t\t\t\t\tvae.types.splice(index, 1);\r\n\t\t\t\t\t\t\texplanation += \"<p>There would appear to be a VAC on \" + getMVDate(vacDaysCopy[k]) + \" based on \" + vae.vacDeterminedBy[k] + \" values, however there was a previous VAC which occurred on \" + getMVDate(lastVAC) + \". The timespan between the two is only \" +(vacDaysCopy[k] - lastVAC).toString() + \" days therefore \" + getMVDate(vacDaysCopy[k]) + \" is not counted as a VAC by the 14 day rule.\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse { // vacDaysCopy[k] - lastVAC == 0\r\n\t\t\t\t\t\texplanation += \"<p>There is a VAC on \" + getMVDate(vacDaysCopy[k]) + \" whereby both the PEEP and FiO2 values meet the criteria simultaneously.</p>\"\r\n\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}\t\t\r\n\t\t\t}\r\n\t\t\r\n\t}\t\r\n\tif(vae.eventDays.length) {\r\n\t\t//explanation = \"<br>\" + direction + \"<br>\" + explanation;\r\n\t\t//alert(explanation);\r\n\t\tdirection += \"<br><span class='emphasis'>Click on the Go To IVAC button</span> to move to the next part of the protocol or click on the &#34Explain&#34 button to see how this determination was made. \";\r\n\t\t\r\n\t\treturn true;\r\n\t}\r\n\telse {\r\n\t\tdirection = \"No VAE detected. Click on the &quot;Explain&quot; button to see an explanation of the VAC definition. \"\r\n\t\texplanation = \"For a VAC to occur, there is a baseline period of stability or improvement of daily minimum PEEP or FiO<sub>2</sub> values on two consecutive days. This is followed by two consecutive days of worsening oxygenation where the \\\r\n\t\t\t\t\t\tdaily minimum PEEP values increase by 3 cmH<sub>2</sub>O or more or the daily minimum FiO<sub>2</sub> values increase by 20% or more, above the daily minimum value in the period of stability or improvement. The date of the VAC is set to the first day of worsening after the baseline period. <br> \\\r\n\t\t\t\t\t\tFor periods of stability where daily minimum PEEP values are &le; 5 cmH<sub>2</sub>O, the corresponding period of worsening oxygenation must have daily minimum PEEP values of 8 cmH<sub>2</sub>O or greater.<br>\";\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\t\r\n}", "function computeScaledParameters( ) {\r\n\r\n\t// Get viewport dimensions\r\n\tParameters.viewport = {\r\n\t\twidth: jQuery(window).width(),\r\n\t\theight: jQuery(window).height(),\r\n\t};\r\n\tParameters.viewport.centerX = Parameters.viewport.width/2;\r\n\tParameters.viewport.centerY = Parameters.viewport.height/2;\r\n\r\n\t// Compute scaling factor\r\n\tvar imageHeight = 0.152 * Parameters.viewport.height;\r\n\tvar imageWidth = 0.084 * Parameters.viewport.width;\r\n\tvar heightScalingFactor = imageHeight / Parameters.cardImages.fullHeight;\r\n\tvar widthScalingFactor = imageWidth / Parameters.cardImages.fullWidth;\r\n\tParameters.scalingFactor = Math.min( heightScalingFactor, widthScalingFactor );\r\n\r\n\t// Card Image dimensions\r\n\tParameters.cardImages.width = Parameters.cardImages.fullWidth * Parameters.scalingFactor;\r\n\tParameters.cardImages.height = Parameters.cardImages.fullHeight * Parameters.scalingFactor;\r\n\tParameters.cardImages.widthShowing = Parameters.cardImages.width * Parameters.cardImages.percentageWidthShowing;\r\n\tParameters.cardImages.heightShowing = Parameters.cardImages.height * Parameters.cardImages.percentageHeightShowing;\r\n\r\n\t// Compute new center table dimensions\r\n\tParameters.tableImage.width = Parameters.tableImage.fullWidth * Parameters.scalingFactor;\r\n\tParameters.tableImage.height = Parameters.tableImage.fullHeight * Parameters.scalingFactor;\r\n\tParameters.tableImage.top = Parameters.viewport.centerY - Parameters.tableImage.height / 2;\r\n\tParameters.tableImage.left = Parameters.viewport.centerX - Parameters.tableImage.width / 2;\r\n\r\n\t// Compute new compass dimensions\r\n\tParameters.compassImage.width = 0.2 * Parameters.tableImage.width;\r\n\tParameters.compassImage.height = Parameters.compassImage.width;\r\n\tParameters.compassImage.top = Parameters.viewport.centerY - Parameters.compassImage.width / 2;\r\n\tParameters.compassImage.left = Parameters.viewport.centerX - Parameters.compassImage.height / 2;\r\n\r\n\t// The positions of cards played to table\r\n\tfor( var direction in Directions ) {\r\n\t\tswitch ( direction ) {\r\n\t\t\tcase 'n':\r\n\t\t\t\tParameters.tableCardPosition[ direction ] = {\r\n\t\t\t\t\ttop: Parameters.tableImage.top,\r\n\t\t\t\t\tleft: Parameters.viewport.centerX - Parameters.cardImages.width / 2,\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\t\t\tcase 's':\r\n\t\t\t\tParameters.tableCardPosition[ direction ] = {\r\n\t\t\t\t\ttop: Parameters.tableImage.top + Parameters.tableImage.height - Parameters.cardImages.height,\r\n\t\t\t\t\tleft: Parameters.viewport.centerX - Parameters.cardImages.width / 2,\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'w':\r\n\t\t\t\tParameters.tableCardPosition[ direction ] = {\r\n\t\t\t\t\ttop: Parameters.viewport.centerY - Parameters.cardImages.height / 2,\r\n\t\t\t\t\tleft: Parameters.tableImage.left,\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'e':\r\n\t\t\t\tParameters.tableCardPosition[ direction ] = {\r\n\t\t\t\t\ttop: Parameters.viewport.centerY - Parameters.cardImages.height / 2,\r\n\t\t\t\t\tleft: Parameters.tableImage.left + Parameters.tableImage.width - Parameters.cardImages.width,\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t// Font sizes\r\n\tParameters.textSize.fontSize = Parameters.textSize.actualFontSize * Parameters.scalingFactor;\r\n\tParameters.textSize.lineHeight = Parameters.textSize.actualLineHeight * Parameters.scalingFactor;\r\n\tvar style = '<style>';\r\n\tstyle += 'table.table {font-size: ' + Parameters.textSize.fontSize + 'px; line-height: ' + Parameters.textSize.lineHeight + 'em;}';\r\n\tstyle += '.panel {font-size: ' + Parameters.textSize.fontSize + 'px; line-height: ' + Parameters.textSize.lineHeight + 'em;}';\r\n\tstyle += '.text-size {font-size: ' + Parameters.textSize.fontSize + 'px !important;}';\r\n\tstyle += '</style>';\r\n\t$( style ).appendTo( \"head\" )\r\n\r\n\ttrace( 'After scaling parameters are : ' + JSON.stringify( Parameters ) );\r\n}", "get_update(alpha, g) { // alpha is the learning rate, g is the gradient vector (array oflength 'nparams')\r\n this.t += 1;\r\n let updates= this.updates;\r\n const {m,v,b,beta_1,beta_2, b1t, b2t, epsilon, nparams} = this;\r\n \r\n for(var i= 0 ; i < nparams ; ++i) {\r\n \tlet grad = g[i];\r\n m[i]= beta_1*m[i] + (1-beta_1)*grad; // Update biased first moment estimate\r\n v[i]= beta_2*v[i] + (1-beta_2)*grad*grad; // Update biased second raw moment estimate\r\n var mub= m[i]/(1 - b1t); // Compute bias-corrected first moment estimate\r\n var vub= v[i]/(1 - b2t); // Compute bias-corrected second raw moment estimate\r\n updates[i]= - alpha * mub / ( Math.sqrt(vub) + epsilon ); // Return parameter updates\r\n }\r\n this.b1t *= beta_1*beta_1;\r\n this.b2t *= beta_2*beta_2;\r\n return updates;\r\n }", "function setParameters() {\n params.viscosity = 0.02;\n params.u0 = -amplitude;\n params.one36th = 1 / 36;\n params.one9th = 1 / 9;\n params.four9ths = 4 / 9;\n params.gridSize = 5;\n params.m = int(height / params.gridSize);\n params.n = int(width / params.gridSize);\n}", "function calculateMortgagePayment(){\n const loan = parseFloat($(\"#js-house-price\").val()) - parseFloat($(\"#js-down-payment\").val())\n const numberOfMonths = parseInt($(\"#js-amort-years\").val())* 12\n const interestRate = parseFloat($(\"#js-interest\").val())/12/100\n //console.log(loan,numberOfMonths,interestRate)\n const numerator = interestRate * Math.pow((1+interestRate),numberOfMonths) \n const denominator = Math.pow((1+interestRate),numberOfMonths)-1\n mortgagePmt = Math.round(loan * numerator / denominator*100)/100\n updatePmt()\n buildMonthlyCostsBase()\n const loanObj = {\n \"P\":loan,\n \"PMT\":mortgagePmt,\n \"I\":interestRate,\n }\n buildAmortTable(loanObj)\n buildSummary()\n \n}", "function me(){\n if( principal.value === '' && time.value === '' && rate.value === '')\n {\n result.value = 'pls enter a valid number';\n }\n else \n {\n result.value = ((parseFloat(principal.value) * parseFloat(time.value) * parseFloat(rate.value))/100).toFixed(2);\n }\n\n }", "function fx_Mul(data)\n{\n\t//default result:\n\tvar nRes = 0;\n\t//is the data valid?\n\tif (!String_IsNullOrWhiteSpace(data))\n\t{\n\t\t//split it into an array\n\t\tvar parameters = data.split(\",\");\n\t\t//two parameters?\n\t\tif (parameters.length == 2)\n\t\t{\n\t\t\t//multiply them\n\t\t\tnRes = Math.round(Get_Number(parameters[0], 1) * Get_Number(parameters[1], 1) * 100) / 100;\n\t\t}\n\t}\n\t//return the result\n\treturn nRes;\n}", "function calQ() {\n return state.B*state.C/state.A;\n }", "function UpdateParameter( pkt )\n\t{\n\t\tvar amount = pkt.amount || pkt.count || 0;\n\t\tvar type = pkt.varID || pkt.statusType;\n\n\t\tswitch( type ) {\n\n\t\t\t// Walk Speed\n\t\t\tcase 0:\n\t\t\t\tSession.Entity.walk.speed = amount;\n\t\t\t\tbreak;\n\n\t\t\t// Base exp\n\t\t\tcase 1:\n\t\t\t\tBasicInfo.base_exp = amount;\n\t\t\t\tif( BasicInfo.base_exp_next ) {\n\t\t\t\t\tBasicInfo.update('bexp', BasicInfo.base_exp, BasicInfo.base_exp_next );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// Job exp\n\t\t\tcase 2:\n\t\t\t\tBasicInfo.job_exp = amount;\n\t\t\t\tif( BasicInfo.job_exp_next ) {\n\t\t\t\t\tBasicInfo.update('jexp', BasicInfo.job_exp, BasicInfo.job_exp_next );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// Karma, manner (not used ?)\n\t\t\tcase 3:\n\t\t\tcase 4:\n\t\t\t\tbreak;\n\n\t\t\t// HP\n\t\t\tcase 5:\n\t\t\t\tSession.Entity.life.hp = amount;\n\t\t\t\tSession.Entity.life.update();\n\n\t\t\t\t// Urg we are dead !\n\t\t\t\tif( amount < 1 ) {\n\t\t\t\t\tEscape.ui.show();\n\t\t\t\t\tEscape.ui.find('.savepoint').show();\n\t\t\t\t\tEscape.ui.find('.settings, .sound, .hotkey').hide();\n\n\t\t\t\t\t// TODO: check for resurection button\n\t\t\t\t}\n\n\t\t\t\tif( Session.Entity.life.hp_max > -1 ) {\n\t\t\t\t\tBasicInfo.update('hp', Session.Entity.life.hp, Session.Entity.life.hp_max);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// HP max\n\t\t\tcase 6:\n\t\t\t\tSession.Entity.life.hp_max = amount;\n\t\t\t\tSession.Entity.life.update();\n\n\t\t\t\tif( Session.Entity.life.hp > -1 ) {\n\t\t\t\t\tBasicInfo.update('hp', Session.Entity.life.hp, Session.Entity.life.hp_max);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// SP\n\t\t\tcase 7:\n\t\t\t\tSession.Entity.life.sp = amount;\n\t\t\t\tSession.Entity.life.update();\n\n\t\t\t\tif( Session.Entity.life.sp_max > -1 ) {\n\t\t\t\t\tBasicInfo.update('sp', Session.Entity.life.sp, Session.Entity.life.sp_max);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// SP max\n\t\t\tcase 8:\n\t\t\t\tSession.Entity.life.sp_max = amount;\n\t\t\t\tSession.Entity.life.update();\n\n\t\t\t\tif( Session.Entity.life.sp > -1 ) {\n\t\t\t\t\tBasicInfo.update('sp', Session.Entity.life.sp, Session.Entity.life.sp_max);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// Status points\n\t\t\tcase 9:\n\t\t\t\tWinStats.update('statuspoint', amount);\n\t\t\t\tbreak;\n\n\t\t\t// Base level\n\t\t\tcase 11:\n\t\t\t\tBasicInfo.update('blvl', amount);\n\t\t\t\tbreak;\n\n\t\t\t// Skill points\n\t\t\tcase 12:\n\t\t\t\tbreak;\n\n\t\t\t// Str\n\t\t\tcase 13:\n\t\t\t\tWinStats.update('str', pkt.defaultStatus);\n\t\t\t\tWinStats.update('str2', pkt.plusStatus);\n\t\t\t\tbreak;\n\n\t\t\t// Agi\n\t\t\tcase 14:\n\t\t\t\tWinStats.update('agi', pkt.defaultStatus);\n\t\t\t\tWinStats.update('agi2', pkt.plusStatus);\n\t\t\t\tbreak;\n\n\t\t\t// Vit\n\t\t\tcase 15:\n\t\t\t\tWinStats.update('vit', pkt.defaultStatus);\n\t\t\t\tWinStats.update('vit2', pkt.plusStatus);\n\t\t\t\tbreak;\n\n\t\t\t// Int\n\t\t\tcase 16:\n\t\t\t\tWinStats.update('int', pkt.defaultStatus);\n\t\t\t\tWinStats.update('int2', pkt.plusStatus);\n\t\t\t\tbreak;\n\n\t\t\t// Dex\n\t\t\tcase 17:\n\t\t\t\tWinStats.update('dex', pkt.defaultStatus);\n\t\t\t\tWinStats.update('dex2', pkt.plusStatus);\n\t\t\t\tbreak;\n\n\t\t\t// Luk\n\t\t\tcase 18:\n\t\t\t\tWinStats.update('luk', pkt.defaultStatus);\n\t\t\t\tWinStats.update('luk2', pkt.plusStatus);\n\t\t\t\tbreak;\n\n\t\t\t// Zeny\n\t\t\tcase 20:\n\t\t\t\tBasicInfo.update('zeny', amount);\n\t\t\t\tbreak;\n\n\t\t\t// Base exp next\n\t\t\tcase 22:\n\t\t\t\tBasicInfo.base_exp_next = amount;\n\t\t\t\tif( BasicInfo.base_exp > -1 ) {\n\t\t\t\t\tBasicInfo.update('bexp', BasicInfo.base_exp, BasicInfo.base_exp_next );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// Job exp next\n\t\t\tcase 23:\n\t\t\t\tBasicInfo.job_exp_next = amount;\n\t\t\t\tif( BasicInfo.job_exp > -1 ) {\n\t\t\t\t\tBasicInfo.update('jexp', BasicInfo.job_exp, BasicInfo.job_exp_next );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t//Weight\n\t\t\tcase 24:\n\t\t\t\tBasicInfo.weight = amount;\n\t\t\t\tif( BasicInfo.weight_max > -1 ) {\n\t\t\t\t\tBasicInfo.update('weight', BasicInfo.weight, BasicInfo.weight_max );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// Weight Max\n\t\t\tcase 25:\n\t\t\t\tBasicInfo.weight_max = amount;\n\t\t\t\tif( BasicInfo.weight > -1 ) {\n\t\t\t\t\tBasicInfo.update('weight', BasicInfo.weight, BasicInfo.weight_max );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// Stats window\n\t\t\tcase 41: WinStats.update('atak', amount); break; // atk1\n\t\t\tcase 42: WinStats.update('atak2', amount); break; // atk2\n\t\t\tcase 43: WinStats.update('matak', amount); break; // matk1\n\t\t\tcase 44: WinStats.update('matak2', amount); break; // matk2\n\t\t\tcase 45: WinStats.update('def', amount); break; // def1\n\t\t\tcase 46: WinStats.update('def2', amount); break; // def2\n\t\t\tcase 47: WinStats.update('mdef', amount); break; // mdef1\n\t\t\tcase 48: WinStats.update('mdef2', amount); break; // mdef2\n\t\t\tcase 49: WinStats.update('hit', amount); break; // hit\n\t\t\tcase 50: WinStats.update('flee', amount); break; // flee\n\t\t\tcase 51: WinStats.update('flee2', amount); break; // dodge\n\t\t\tcase 52: WinStats.update('critical', amount); break; // crit\n\t\t\tcase 53: WinStats.update('aspd', amount); break; // aspd\n\n\t\t\t// Job level\n\t\t\tcase 55:\n\t\t\t\tBasicInfo.update('jlvl', amount);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.log( \"Main::UpdateParameter() - Unsupported type\", pkt);\n\t\t}\n\t}", "function expectationCalc(data) {\n\treturn data.reduce(function(a, b, i){return a+b.p*(i+1);},0);\n}", "function onR4Changed() {\n var val_str = document.getElementById(\"r4\").value;\n var val_good = check_unit( val_str, \"ohm\", \"r4\" );\n if (val_good) {\n setR4( math.unit( document.getElementById(\"r4\").value ).value ); \n } else {\n document.getElementById(\"r4\").value = math.unit(loop_filter.r4,\"ohm\").format(3);\n return;\n }\n\n simulatePll();\n\n}", "function PresionPlato(){\n\tvar carga = document.getElementById(\"carga\").value;\n\tvar radio = document.getElementById(\"radioPlato\").value;\n\tvar total = (carga/(Math.PI *Math.pow(radio,2)));\n\tvar total2 = total.toFixed(3);\n\tdocument.getElementById(\"presionPlato\").value = total2;\n\t//Reporte\n\tdocument.getElementById('recibeformulaPres').innerHTML = \"p = \"+carga+\" lb / (3.14 * \"+radio+\" in ^ 2)\";\n\tdocument.getElementById('recibeformulaPres1').innerHTML = \"p = \"+total.toFixed(3)+\" psi\";\n}", "function atvd17(){\n \n let a = parseFloat(document.querySelector(\"#atvd17-1\").value);\n let b = parseFloat(document.querySelector(\"#atvd17-2\").value);\n let c = parseFloat(document.querySelector(\"#atvd17-3\").value);\n\n let de,x1=0,x2=0;\n \n\n de = (Math.pow(b, 2)) - (4*a*c);\n \n \n x1= (-b - Math.sqrt(de))/(2*a);\n \n x2= (-b + Math.sqrt(de))/(2*a);\n \n\n if(de<0){\n document.getElementById(\"raiz\").innerHTML = \"Não existe raiz real\";\n\n }else{\n document.getElementById(\"raiz\").innerHTML = \"VALOR DA PRIMEIRA RAIZ:\" + x1+ \" | \" + \"VALOR DA SEGUNDA RAIZ:\" + x2;\n \n }\n \n }", "function getTotalValue(interv)\n{\nvar total = 0;\nvar result = 0;\n\nfor (var i=0; i<clSize; i++) /*foreach element in the new linguistic scale*/\n\t{\n\ttotal += interv.vars[i];\n\tresult += interv.vars[i]*i; /*add i*intervalVector[i] to the total value of the solution*/\n\t}\n\nresult /= total;\nreturn result;\n}", "function correctionFactor() {\n var args = Array.prototype.slice.call(arguments);\n return args.reduce(function (prev, next) {\n var mp = multiplier(prev),\n mn = multiplier(next);\n return mp > mn ? mp : mn;\n }, -Infinity);\n }", "function correctionFactor() {\n var args = Array.prototype.slice.call(arguments);\n return args.reduce(function (prev, next) {\n var mp = multiplier(prev),\n mn = multiplier(next);\n return mp > mn ? mp : mn;\n }, -Infinity);\n }", "function correctionFactor() {\n var args = Array.prototype.slice.call(arguments);\n return args.reduce(function (prev, next) {\n var mp = multiplier(prev),\n mn = multiplier(next);\n return mp > mn ? mp : mn;\n }, -Infinity);\n }", "function calcPairingPrecomputes(p) {\n const { x, y } = p;\n // prettier-ignore\n const Qx = x, Qy = y, Qz = Fp2.ONE;\n // prettier-ignore\n let Rx = Qx, Ry = Qy, Rz = Qz;\n let ell_coeff = [];\n for (let i = BLS_X_LEN - 2; i >= 0; i--) {\n // Double\n let t0 = Fp2.sqr(Ry); // Ry²\n let t1 = Fp2.sqr(Rz); // Rz²\n let t2 = Fp2.multiplyByB(Fp2.mul(t1, _3n)); // 3 * T1 * B\n let t3 = Fp2.mul(t2, _3n); // 3 * T2\n let t4 = Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(Ry, Rz)), t1), t0); // (Ry + Rz)² - T1 - T0\n ell_coeff.push([\n Fp2.sub(t2, t0),\n Fp2.mul(Fp2.sqr(Rx), _3n),\n Fp2.neg(t4), // -T4\n ]);\n Rx = Fp2.div(Fp2.mul(Fp2.mul(Fp2.sub(t0, t3), Rx), Ry), _2n); // ((T0 - T3) * Rx * Ry) / 2\n Ry = Fp2.sub(Fp2.sqr(Fp2.div(Fp2.add(t0, t3), _2n)), Fp2.mul(Fp2.sqr(t2), _3n)); // ((T0 + T3) / 2)² - 3 * T2²\n Rz = Fp2.mul(t0, t4); // T0 * T4\n if ((0, utils_js_1.bitGet)(CURVE.params.x, i)) {\n // Addition\n let t0 = Fp2.sub(Ry, Fp2.mul(Qy, Rz)); // Ry - Qy * Rz\n let t1 = Fp2.sub(Rx, Fp2.mul(Qx, Rz)); // Rx - Qx * Rz\n ell_coeff.push([\n Fp2.sub(Fp2.mul(t0, Qx), Fp2.mul(t1, Qy)),\n Fp2.neg(t0),\n t1, // T1\n ]);\n let t2 = Fp2.sqr(t1); // T1²\n let t3 = Fp2.mul(t2, t1); // T2 * T1\n let t4 = Fp2.mul(t2, Rx); // T2 * Rx\n let t5 = Fp2.add(Fp2.sub(t3, Fp2.mul(t4, _2n)), Fp2.mul(Fp2.sqr(t0), Rz)); // T3 - 2 * T4 + T0² * Rz\n Rx = Fp2.mul(t1, t5); // T1 * T5\n Ry = Fp2.sub(Fp2.mul(Fp2.sub(t4, t5), t0), Fp2.mul(t3, Ry)); // (T4 - T5) * T0 - T3 * Ry\n Rz = Fp2.mul(Rz, t3); // Rz * T3\n }\n }\n return ell_coeff;\n }", "function functPerim(){\n\n let longVal = parseFloat(long.value);\n const unitLongVal = unitLong.value;\n let largVal = parseFloat(larg.value);\n const unitLargVal = unitLarg.value;\n let def = false ;\n\n // const UNIT = {\"mm\":1000, \"cm\":100, \"dm\":10, \"m\":1};\n\n if (isNaN(longVal) || longVal <= 0 || isNaN(largVal) || largVal <= 0) {\n resultPerim.innerHTML = \"Veuillez rentrer une longueur et une largeur positive !\";\n } else {\n\n\n switch (unitLongVal) {\n case \"mm\":\n longVal /= 1000;\n break;\n case \"cm\":\n longVal /= 100;\n break;\n case \"dm\":\n longVal /= 10;\n break;\n case \"m\":\n longVal /= 1;\n break;\n default:\n def = true ;\n resultPerim.innerHTML = \"Veuillez rentrer une unité de longueur acceptable (\" + unitLongVal + \") !\";\n break;\n }\n\n switch (unitLargVal) {\n case \"mm\":\n largVal /= 1000;\n break;\n case \"cm\":\n largVal /= 100;\n break;\n case \"dm\":\n largVal /= 10;\n break;\n case \"m\":\n largVal /= 1;\n break;\n default:\n def = true ;\n resultPerim.innerHTML = \"Veuillez rentrer une unité de largeur acceptable (\" + unitLargVal + \") !\";\n break;\n } \n\n if( def === false){\n resultPerim.innerHTML = \"Le perimetre d'un surface de coté \" + longVal + unitLongVal + \" x \" + largVal + unitLargVal + \" est de \" + ((parseFloat(longVal) + parseFloat(largVal)) * 2).toFixed(2) + \" m \";\n }\n }\n\n}", "function FinalPositionCalculation(InitialPosition, Velocity, Time, Acceleration)\n{\n // xf = xi + vt +(1/2)at^2 || xf = xi + (v*t) + ( (1/2) * a * t^2 )\n var FinalPosition = Number(InitialPosition) + Number(Velocity * Time) + Number( (1/2) * Acceleration * Math.pow(Time, 2) );\n document.getElementById(\"result\").value = FinalPosition;\n //return FinalPosition;\n}", "_recalc_model() {\n\t this._update_timescales();\n\t this._calc_equilibrium();\n\t}", "function BlackScholesBinomialCalibration(T, n, Vol)\n{\n return Math.exp(Vol * Math.sqrt(T/n));\n}", "function correctionFactor() {\n var args = Array.prototype.slice.call(arguments);\n return args.reduce(function(prev, next) {\n var mp = multiplier(prev),\n mn = multiplier(next);\n return mp > mn ? mp : mn;\n }, -Infinity);\n }", "function correctionFactor() {\n var args = Array.prototype.slice.call(arguments);\n return args.reduce(function(prev, next) {\n var mp = multiplier(prev),\n mn = multiplier(next);\n return mp > mn ? mp : mn;\n }, -Infinity);\n }", "function correctionFactor() {\n var args = Array.prototype.slice.call(arguments);\n return args.reduce(function(prev, next) {\n var mp = multiplier(prev),\n mn = multiplier(next);\n return mp > mn ? mp : mn;\n }, -Infinity);\n }", "function correctionFactor() {\n var args = Array.prototype.slice.call(arguments);\n return args.reduce(function(prev, next) {\n var mp = multiplier(prev),\n mn = multiplier(next);\n return mp > mn ? mp : mn;\n }, -Infinity);\n }", "function correctionFactor() {\n var args = Array.prototype.slice.call(arguments);\n return args.reduce(function(prev, next) {\n var mp = multiplier(prev),\n mn = multiplier(next);\n return mp > mn ? mp : mn;\n }, -Infinity);\n }", "function calcPeri(w,h){\n var peri = 2*w +2*h;\n console.log(peri);\n}", "function NewtonIterations( p_r, p_i, c_r, c_i ){\n let p = {r:p_r, i:p_i};\n let c = {r:c_r, i:c_i};\n const mult = (a,b)=> ({\n r : a.r * b.r - a.i * b.i,\n i : a.r * b.i + a.i * b.r\n })\n const div = (a,b)=>{\n let res = { r:0, i:0 };\n let s = 0;\n if( Math.abs(b.i)<eps){\n s = b.r;\n } else {\n let con = {r:b.r, i:-b.i};\n a = mult(a,con);\n s = b.r * b.r + b.i * b.i;\n }\n if( Math.abs( s )>eps ){\n res.r = a.r/s;\n res.i = a.i/s;\n }\n return res;\n }\n const sqr = (a) => ({\n r : a.r*a.r-a.i*a.i,\n i : 2*a.r*a.i\n })\n\n /*let t1={r:1, i:2};\n let t2={r:2, i:3};\n let t3 = mult(t1,t2);\n let t4 = div(t3,t1);\n let t5 = div(t3,t2);*/\n\n\n for(let i=0; i<MaxIterations; i++ ){\n\n let sq = sqr(p);\n let p3 = mult(sq,p);\n let n = {r:p3.r-1.0, i:p3.i};\n let d = {r:sq.r*3, i:sq.i*3};\n let f = div(n,d);\n let m = mult(c, f);\n p = {\n r : p.r - m.r,\n i : p.i - m.i\n }\n let len = p.r*p.r+p.i*p.i;\n\n if( len > 4 ) return i; // diverge\n }\n\n return MaxIterations;\n}", "function CalcStats(outTable) \n{\n\tvar zL; var vx;var vN;var vP; var vPL; var vPU;var vWL; var vWU; var x2;\n //var added05 = 0;\n \t\n \ta = parseFloat(outTable.data[1][\"E0D0\"]);\n\t//alert(\"a=\"+a);\n \tb = parseFloat(outTable.data[1][\"E1D0\"]);\n \n if (a == 0|| b==0) {\n\t\talert(\"At least one of the cells has missing value\");\n\t\treturn}; \n \n var vx = eval(a)\n var vN = eval(b)\n \n \n \t//\tto simply calculate SMR (point estimate);\n var ratio = vx/vN;\n\t//alert(\"ratio\"+ratio);\n\t\n \t//---------------Significance tests------------------------------------;\n\t// p-value for hypothesis of association;\n\t// chi-square test;\n cs=(vx - vN) * (vx - vN) / vN;\n\tcs_pvalue = ChiSq(cs, 1);\n\t//if(cs>10.83) cs_pvalue=\"<0.001\";\n\t\n\t\n\t//Byar method approximation;\n\tif (vx>vN) {vx=vx}\n\telse {vx=vx+1};\n\tvar x2=(Math.sqrt(9*vx))* ( 1 - 1/(9*vx) - Math.pow(vN/vx,1/3) );\n var x2_pvalue=Norm(x2);\n\t//alert(x2+\"pvalue\"+x3);\n\t\n\t\n//Fisher's exact test for poisson distribution ; \n var e=2.718281828459045235; var expect; var k;var p_value; var total=0; var \nsubtotal=0; \n var Obs=vx; var Exp=vN; \n\nif (Obs>=Exp) { \n var k=Obs-1; \n while (k>=0) { \n var numerator=Math.pow(e,-Exp)*Math.pow(Exp,k); \n //alert(\"numerator\"+numerator); \n var kk=k; \n var denom=1; \n while (kk>0) {denom=denom*kk; kk=kk-1}; //calculate the value of a factorial; \n //alert(\"denominator\"+denom); \n var subtotal=numerator/denom; \n //alert(\"subtotal\"+subtotal); \n total=total+subtotal; \n k=k-1; \n } \n p_value=2*(1-total); \n} \n\nif (Obs<Exp) { \n var k=Obs-1; \n while (k>=0) { \n var numerator=Math.pow(e,-Exp)*Math.pow(Exp,k); \n //alert(\"numerator\"+numerator); \n var kk=k; \n var denom=1; \n while (kk>0) {denom=denom*kk; kk=kk-1}; //calculate the value of a factorial; \n //alert(\"denominator\"+denom); \n var subtotal=numerator/denom; \n //alert(\"subtotal\"+subtotal); \n total=total+subtotal; \n k=k-1; \n } \n p_value=2*total; \n} \n//alert(\"exact test P=\"+p_value); \n\n\t\n\t\n\t\n\t\n\t// Mid-p exact test for poisson distribution;\n\tvar total1=0;var subtotal1=0;\n\tvar Obs = eval(a)\n var Exp = eval(b)\n\t\nif (Obs<Exp) {\t\n\t//second part of equation;\n\tvar k=Obs-1;\n\twhile (k>=0) {\n\tvar numerator=Math.pow(e,-Exp)*Math.pow(Exp,k);\n\t//alert(\"numerator\"+numerator);\n\tvar kk=k;\n\tvar denom=1;\n\twhile (kk>0) {denom=denom*kk; kk=kk-1}; //calculate the value of a factorial;\n\t//alert(\"denominator\"+denom);\n\tvar subtotal1=numerator/denom;\n\t//alert(\"subtotal\"+subtotal);\n\ttotal1=total1+subtotal1;\n\tk=k-1;\n\t}\n\t\n\t//first part of equation;\n\tvar num; var deno; var i; var aa;\n\tnum=Math.pow(e,-Exp)*Math.pow(Exp,Obs);\n\tdeno=1;\n\ti=Obs;\n\twhile (i>0) {deno=deno*i; i=i-1}; \n\t//alert(\"denominator \"+deno);\n\tvar aa=(num/deno)*0.5;\n\t\n\t//combine both parts of equation;\n\tvar MidP=2*(aa+total1);\n\t//alert(\"mid-p\"+MidP);\n}\n\t\n\t\nif (Obs>=Exp) {\n\t//second part of equation;\n\tvar k=Obs-1;\n\twhile (k>=0) {\n\tvar numerator=Math.pow(e,-Exp)*Math.pow(Exp,k);\n\t//alert(\"numerator\"+numerator);\n\tvar kk=k;\n\tvar denom=1;\n\twhile (kk>0) {denom=denom*kk; kk=kk-1}; //calculate the value of a factorial;\n\tvar subtotal1=numerator/denom;\n\ttotal1=total1+subtotal1;\n\tk=k-1;\n\t}\n\t\n\t//first part of equation;\n\tvar num; var deno; var i; var aa;\n\tnum=Math.pow(e,-Exp)*Math.pow(Exp,Obs);\n\tdeno=1;\n\ti=Obs;\n\twhile (i>0) {deno=deno*i; i=i-1}; \n\tvar aa=(num/deno)*0.5;\n\t\n\t//combine both parts of equation;\n \tvar MidP=2*(1-(aa+total1));\n if (MidP < 0.00000000001)\n {MidP=0.00000000001}\n //Feb 2014\n\n}\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t//-------------------------------------------------CI-----------------------------------------------;\n\t\n\t// Reading setting of confidence interval from settings;\n\tvar cscrit=cscritFromOEConfLevel(ConfLevel);\n\tvar zL=Math.sqrt(cscrit);\n\tvar zU=Math.sqrt(cscrit);\n\t\n\t// to compute Title ---% Confidence Interval;\n\t//alert(\"cscript\"+cscrit);\n\tvar ci=0;\n\tif (cscrit==2.706) {ci=90};\n\tif (cscrit==3.841) {ci=95};\n\tif (cscrit==6.635) {ci=99};\n\tif (cscrit==10.828) {ci=99.9};\n\tif (cscrit==15.137) {ci=99.99};\n\t\n\n// Mid-P exact test;\n\t// Lower tail;\n\t{var v=0.5; var dv=0.5; var vTL=(100-ci)/2; var p=vTL/100;}\n\t\n\tvar vZ = Obs;\n while(dv>1e-5) { dv=dv/2; if ( PoisP((1+vZ)*v/(1-v),vZ+1,1e10) + 0.5*PoisP((1+vZ)*v/(1-v),vZ,vZ) >p)\n { v=v-dv } else { v=v+dv } }\n var QL= ((1+vZ)*v/(1-v))/Exp;\n \n \n // Upper tail;\n {var v=0.5; var dv=0.5; var vTU=(100-ci)/2; var p=vTU/100;}\n\t \n while(dv>1e-5) { dv=dv/2; if ( PoisP((1+vZ)*v/(1-v),0,vZ-1) + 0.5*PoisP((1+vZ)*v/(1-v),vZ,vZ) <p)\n { v=v-dv } else { v=v+dv } }\n var QU = ((1+vZ)*v/(1-v))/Exp; \n //alert(\"mid-p=\"+QL+\"upper tail\"+QU);\n\t\n\n// Fisher's exact test;\n\t// Lower tail;\n\t{var v=0.5; var dv=0.5; var vTL=(100-ci)/2; var p=vTL/100;}\n\t\n\tvar vZ = Obs;\n while(dv>1e-5) { dv=dv/2; if(PoisP((1+vZ)*v/(1-v),vZ,1e10)>p) { v=v-dv } else { v=v+dv } }\n var QL3= ((1+vZ)*v/(1-v))/Exp;\n \n \n // Upper tail;\n {var v=0.5; var dv=0.5; var vTU=(100-ci)/2; var p=vTU/100;}\n\t \n while(dv>1e-5) { dv=dv/2; if(PoisP((1+vZ)*v/(1-v),0,vZ)<p) { v=v-dv } else { v=v+dv } }\n var QU3 = ((1+vZ)*v/(1-v))/Exp; \n //alert(\"fisher-p=\"+QL3+\"upper tail\"+QU3);\n \n\n// Vandenbroucke method\nif (ci==95){\n\t//lower tail;\n\tQL1=Math.pow((Math.sqrt(Obs) - zL*0.5),2)/Exp;\n\t\n\t//Upper tail;\n\tQU1=Math.pow((Math.sqrt(Obs) + zU*0.5),2)/Exp;\n\t}\nelse {\tQL1= \" \";QU1= ' ';}\n\t\n\n// Ury and Wiggins method;\n\nif (ci==90 || ci==95|| ci==99){\n\t//for observation>50;\n\tif (Obs>50)\t{\n\t//for 99%CI;\n\tif (ci==99) {QL2= (Obs - (zL*Math.sqrt(Obs))+ 2)/Exp;\n\t\t\t\tQU2= (Obs + (zL*Math.sqrt(Obs))+ 3)/Exp;}\n\tif (ci==95) {QL2= (Obs - (zL*Math.sqrt(Obs))+ 1)/Exp;\n\t\t\t\tQU2= (Obs + (zL*Math.sqrt(Obs))+ 2)/Exp;}\n\tif (ci==90) {QL2= (Obs - (zL*Math.sqrt(Obs))+ 0.65)/Exp;\n\t\t\t\tQU2= (Obs + (zL*Math.sqrt(Obs))+ 1.65)/Exp;}\n\t}\n\t// for observation <=50;\n\telse {\n\tif (ci==99) { QL2= (Obs - (zL*Math.sqrt(Obs))+ 2 )/Exp;\n\t\t\t\tQU2= (Obs + (zL*Math.sqrt(Obs))+ 3 + 0.1)/Exp;}\n\tif (ci==95) {QL2= (Obs - (zL*Math.sqrt(Obs))+ 1 )/Exp;\n\t\t\t\tQU2= (Obs + (zL*Math.sqrt(Obs))+ 2 + 0.1)/Exp;}\n\tif (ci==90) {QL2= (Obs - (zL*Math.sqrt(Obs))+ 0.65 )/Exp;\n\t\t\t\tQU2= (Obs + (zL*Math.sqrt(Obs))+ 1.65 + 0.1)/Exp;}\n\t}\n}\n\telse {\tQL2= \" \";QU2= ' ';}\n\t//alert(\"vanden-p=\"+QL1+\"upper tail\"+QU1);\n\t//alert(\"ury-p=\"+QL2+\"upper tail\"+QU2);\n\n//Byar method approximation;\n var vPL = ratio * Math.pow(1 - (1/(9 * Obs)) - (zL / (3 * (Math.sqrt(Obs)))),3);\n var vPU = ((Obs + 1)/Exp) * Math.pow(1 - (1/(9 * (Obs + 1))) + (zL / (3 * (Math.sqrt(Obs + 1)))),3);\n\t//alert(\"Byar-p=\"+vPL+\"upper tail\"+vPU);\n\n//Boice-Monson method approximation;\n var PU = Math.exp( (Math.log(Obs/Exp)) + (zU*(1/Math.sqrt(Obs))) );\n var PL = Math.exp( (Math.log(Obs/Exp)) - (zU*(1/Math.sqrt(Obs))) );\n\t//alert(\"Boice-monson-p=\"+PL+\"upper tail\"+PU);\n\n\t\t\n\t\t\n\twith (outTable)\n\t{ \n\t newtable(6,90);\n\t title(\"<h3>SMR and \" +ci+ \"% Confidence Interval</h3>\");\n\t\t\t\t\n\t\tline(6);\n newrow(\"span2:\",\"r:span2:Observed number of cases:\",a,\"\");\n newrow(\"span2:\",\"r:span2:Expected number of cases:\",b,\"\");\n line(6);\n newrow(\"<br>\");\n \tnewrow(\"span2:\",\"c:bold:Statistics\", \"c:bold:d.f.\", \"span2:bold:p-value (2 sided)\")\n newrow(\"span2:l:bold:Mid-P exact test:\",\"span1:c:-\",\"span1:c:-\",fmtSigFig(MidP,4));\n\t\tnewrow(\"span2:l:bold:Mid-P exact test:\",\"span1:c:-\",\"span1:c:-\",Round(fmtSigFig(MidP,4)));\n\t\tnewrow(\"span2:l:bold:Fisher exact test:\",\"span1:c:-\",\"span1:c:-\",Round(fmtSigFig(p_value,4)));\n\t\tnewrow(\"span2:l:bold:Byar approximation:\",Math.abs(fmtSigFig(x2,4)),\"span1:c:-\",Round(fmtSigFig(x2_pvalue,4))); //to hide negative symbol;\n\t\tnewrow(\"span2:l:bold:Chi-square test:\",fmtSigFig(cs,4),1,Round(fmtSigFig(cs_pvalue,4)));\n\t\tline(6);\n\t\tnewrow(\"<br>\");\n\t\tnewrow(\"span2:\",\"c:bold:Lower CL\", \"c:bold:SMR\", \"c:bold:Upper CL\")\n\t\tnewrow(\"<br>\");\n\t\t\n\t\t//Mid-P;\n\t\tnewrow(\"span2:\"+editorschoice+\"Mid-P exact test:\", fmtSigFig(QL,4), fmtSigFig(ratio,4), fmtSigFig(QU,4))\t\n\t\t\n\t\t//Fisher exact;\n\t\tnewrow(\"span2:Fisher exact test:\", fmtSigFig(QL3,4), \"\", fmtSigFig(QU3,4))\t\n\t\t\n\t\t//Byar approximation based on Poisson distribution;\n\t\tnewrow(\"span2:Byar approximation:\", fmtSigFig(vPL,4), \"\", fmtSigFig(vPU,4))\t\n\t\t\n\t\t//Boice-Monson;\n\t\tnewrow(\"span2:Rothman/Greenland method:\", fmtSigFig(PL,4), \"\", fmtSigFig(PU,4))\n\t\t\t\t\n\t\t// Ury and Wiggins method;\n\t\tnewrow(\"span2:Ury and Wiggins method:\", fmtSigFig(QL2,4), \"\", fmtSigFig(QU2,4))\t\n\t\t\n\t\t//Vandenbroucke method;\n\t\tnewrow(\"span2:Vandenbroucke method:\", fmtSigFig(QL1,4), \"\", fmtSigFig(QU1,4))\t\n\t\t\n\t\tline(6)\n\t\tnewrow(\"span6:\"+editorschoice+\"LookFirst items:: Editor\\'s choice of items to examine first.\");\n\t\tnewrow(\"span6: Exact confidence intervals and p-values should be used when the number of observed deaths is less than or equal to five. For greater numbers of observed deaths, approximation methods are as nearly accurate as exact tests.\")\n\t\tnewrow(\"span6:'?' = Not available.\")\t\t\t\n newrow(\"span6:Note..Only 90%, 95% & 99% confidence limits are available in Ury and Wiggins method, and Vandenbroucke method computes 95%CI only.\")\t\t\t\n newrow()\n\t\tnewrow(\"span6:&quot;Mid-P exact test&quot; using Miettinen's (1974d) modification, as described in Epidemiologic Analysis with a Programmable Calculator, 1979.\")\t\t\n\t\tnewrow(\"span6:&quot;Fisher exact test&quot; based on the formula (Armitage,1971; Snedecor & Cochran,1967), as described in Epidemiologic Analysis with a Programmable Calculator, 1979.\")\n\t\tnewrow(\"span6:&quot;Byar approx. Poisson Method&quot; as described in Rothman and Boice, Epidemiologic Analysis with a Programmable Calculator, 1979.\")\t\t\n\t\tnewrow(\"span6:&quot;Rothman/Greenland&quot; as described in Rothman and Greenland, Modern Epidemiology (2nd Ed).\")\t\t\t\n newrow(\"span6:Ury HK, Wiggins AD. Another shortcut method for calculating the confidence interval of a poisson variable (or of a standardized mortality ratio). Am J Epidemiol 1985; 122; 197-8.\")\t\t\n\t\tnewrow(\"span6:Vandenbroucke&nbsp;JP. A shortcut method for calculating the 95 percent confidence interval of the standardized mortality ratio (Letter). Am J Epidemiol 1982; 115; 303-4.\")\t\t\n\t\tnewrow() \n\t\tendtable();\n }\n}", "function calcularPremio() {\n return ($(\"#numJugadores\").val() * $(\"#valCarton\").val()) * 0.8;\n}", "function reparameterize(points, first, last, u, curve) {\n for (var i = first; i <= last; i++) {\n u[i - first] = find_root(curve, points[i], u[i - first]);\n }\n }", "function getAtruleParams({ params, defualtParams }) {\n return parseFloat(params.replace(/[()]/g, '')) || defualtParams;\n}", "function validateFormAndCalculatePl() {\n addCommas(\"rp-annual-input\");\n addCommas(\"rp-annual-save-input\");\n addCommas(\"rp-month-input\");\n addCommas(\"rp-expense-input\");\n }", "static setProductQV(qv, qa, qb) {\nvar aw, ax, ay, az, bw_, bx_, by_, bz_;\n//------------\n// The underscores are irritating but they avoid having the CS\n// compiler see the \"by\" keyword instead of a variable name.\nax = qa[0];\nay = qa[1];\naz = qa[2];\naw = qa[3];\nbx_ = qb[0];\nby_ = qb[1];\nbz_ = qb[2];\nbw_ = qb[3];\nreturn this.setQV_xyzw(qv, aw * bx_ + ax * bw_ + ay * bz_ - az * by_, aw * by_ + ay * bw_ + az * bx_ - ax * bz_, aw * bz_ + az * bw_ + ax * by_ - ay * bx_, aw * bw_ - ax * bx_ - ay * by_ - az * bz_);\n}", "function presentValue(interest_rate,coupon_value,years_to_maturity,par_value) {\n var sum = par_value / Math.pow(1 + interest-rate,years_to_maturity);\n for (var k = 1 ; k <= years_to_maturity ; k++) {\n sum += coupon_value / Math.pow(1 + interst_rate, k);\n }\n return sum;\n}", "function formula(var1, var2) {\r\n return var1 + var2 + factor;\r\n}", "function correctionFactor() {\n var args = Array.prototype.slice.call(arguments);\n return args.reduce(function (prev, next) {\n var mp = multiplier(prev),\n mn = multiplier(next);\n return mp > mn ? mp : mn;\n }, -Infinity);\n }", "function checkParamsCorrect(wObj, mode)\n{\n var val = wObj.val().replace('+', '');\n\n var wParent = wObj.parents('.sub_row.txt');\n var check_name = wObj.attr('name').toString();\n var input_val = parseFloat(val).toFixed(1);\n\n //check if input value is float or if value is negative, otherwise return saved correct value\n if((!checkCorrectFloat(val) || parseFloat(val) < 0 && wObj.parents('.quality-param-intro.percent_block').length == 0) && checkCorrectFloat(wObj.attr('data-tempval')))\n {\n wObj.val(wObj.attr('data-tempval'));\n return;\n }\n\n //check where were changes\n if(check_name.length != check_name.replace('BASE', '').length)\n {//base parameter was changed\n //remove dump value\n wParent.find('.quality-dump-table-item').remove();\n wParent.find('.quality-dump-table-intro').removeClass('active');\n wParent.find('.add-dump-table, .add_straight_or').removeClass('inactive');\n\n //change min & max values\n var minObj = wParent.find('input[name*=\"MIN\"]');\n if(minObj.length == 1 && parseFloat(minObj.val()) > input_val)\n {//if base val < min -> change min\n minObj.val(input_val);\n }\n var maxObj = wParent.find('input[name*=\"MAX\"]');\n if(maxObj.length == 1 && parseFloat(maxObj.val()) < input_val)\n {//if base val > max -> change max\n maxObj.val(input_val);\n }\n }\n else\n {\n if(check_name.length != check_name.replace('DUMP', '').length)\n {//dump parameter was changed\n var min_el = wParent.find('input[name*=\"MIN\"]:first');\n var max_el = wParent.find('input[name*=\"MAX\"]:first');\n\n var kb_check = true;\n if(mode == true && check_name.length != check_name.replace('MIN', '').length)\n {//keyboard input & input is dump min\n //check if input is in first & unused section\n kb_check = false;\n var min_check_val = parseFloat(min_el.val());\n if(min_check_val > input_val)\n {\n kb_check = false;\n input_val = min_check_val;\n wObj.val(input_val);\n }\n else\n {\n wObj.parents('.quality-dump-table-item').siblings('.quality-dump-table-item').each(function(temp_ind, temp_c_obj){\n var temp_check = parseFloat($(temp_c_obj).find('input[type=\"text\"][name*=\"MIN\"]').val());\n if(temp_check < input_val)\n {//founded section lefter than input value\n kb_check = true;\n }\n });\n }\n\n if(kb_check == false)\n {//new value is ok -> change this section right margin\n var right_min_margins_list = wObj.parents('.quality-dump-table-item').siblings('.quality-dump-table-item');\n if(right_min_margins_list.length > 0)\n {\n var temp_lowest_max_val = 1000000;\n right_min_margins_list.each(function(temp_ind, temp_c_obj){\n var temp_chk_val = parseFloat($(temp_c_obj).find('input[type=\"text\"][name*=\"MIN\"]').val());\n if(temp_lowest_max_val > temp_chk_val)\n {\n temp_lowest_max_val = temp_chk_val;\n }\n });\n if(temp_lowest_max_val < 1000000)\n {\n wObj.parents('.quality-dump-table-item').find('input[name*=\"MAX\"]').val(temp_lowest_max_val);\n }\n }\n else\n {\n kb_check = true;\n }\n }\n }\n\n if(kb_check)\n {//interface input or keyboard input need check\n if(check_name.length != check_name.replace('MIN', '').length)\n {//dump min parameter was changed\n var compare_max_val = -1000000; //get other dump max values to prevent intersections (highest of dump maximums that lower than check value)\n var compare_max_val_higher = 1000000; //get other dump max values to prevent intersections (lowest of dump maximums that higher than check value)\n var max_dump_el = wObj.parents('.quality-dump-table-item').find('input[name*=\"MAX\"]');\n var all_min_equal_check = 0;\n var old_val = 0;\n var step_val = parseFloat(wObj.parents('.quality-dump-table-intro').attr('data-step'));\n\n //looking for larger of dump maximums that lower than check value\n wObj.parents('.quality-dump-table-item').siblings('.quality-dump-table-item').each(function(temp_ind, temp_c_obj){\n $(temp_c_obj).find('input[type=\"text\"][name*=\"MAX\"]').each(function(ind, cObj){\n if(parseFloat($(cObj).val()) < input_val && compare_max_val < parseFloat($(cObj).val()) && Math.round(parseFloat($(cObj).val()) * 100) <= Math.round(parseFloat(max_dump_el.val()) * 100))\n {\n compare_max_val = parseFloat($(cObj).val());\n all_min_equal_check++;\n }\n if(parseFloat($(cObj).val()) > input_val && compare_max_val_higher > parseFloat($(cObj).val()) && Math.round(parseFloat($(cObj).val()) * 100) < Math.round(parseFloat(max_dump_el.val()) * 100))\n {\n compare_max_val_higher = parseFloat($(cObj).val());\n }\n });\n\n //check if all dump minimiums are same as dump maximums -> then set user's value (or min if user value is not correct)\n if(all_min_equal_check == 1)\n {//all maximums are equal -> check minimums\n old_val = compare_max_val;\n $(temp_c_obj).find('input[type=\"text\"][name*=\"MIN\"]').each(function(ind, cObj){\n if(old_val != $(cObj).val())\n {\n old_val = $(cObj).val();\n all_min_equal_check++;\n return;\n }\n });\n }\n });\n\n if(all_min_equal_check == 1)\n {//if all dump minimiums are same as dump maximums -> set user's value (if user value is correct)\n if(input_val < parseFloat(min_el.val()))\n {\n wObj.val(min_el.val());\n }\n else if(input_val > parseFloat(max_el.val()))\n {\n wObj.val(max_el.val());\n }\n else if(parseFloat(max_dump_el.val()) < input_val)\n {\n wObj.val(max_dump_el.val());\n }\n }\n else if(compare_max_val >= input_val)\n {//reset value if intersects with other dumps\n wObj.val(compare_max_val);\n }\n else if(min_el.length == 1 && input_val < parseFloat(min_el.val()))\n {//compare value with min value\n wObj.val(min_el.val());\n }\n else if(compare_max_val_higher != 1000000\n && checkCorrectFloat(wObj.attr('data-tempval'))\n && parseFloat(wObj.attr('data-tempval')) >= compare_max_val_higher\n && input_val < compare_max_val_higher\n )\n {//check intersect with other section (new section contain other sections)\n wObj.val(compare_max_val_higher);\n }\n else if(compare_max_val == -1000000 && compare_max_val_higher < 100000 && compare_max_val_higher > input_val\n || compare_max_val_higher < 100000 && compare_max_val_higher == (input_val + step_val)\n )\n {\n wObj.val(compare_max_val_higher);\n }\n else\n {\n if(parseFloat(max_dump_el.val()) < input_val)\n {//compare with dump max parameter (check if dump min > dump max)\n wObj.val(max_dump_el.val());\n }\n else if(input_val + step_val == max_dump_el.val())\n {//need check next section (if exists that have same dump maximum and other dump minimum -> prevent intersection)\n wObj.parents('.quality-dump-table-item').siblings('.quality-dump-table-item').each(function(temp_ind, temp_c_obj){\n if(max_dump_el.val() == $(temp_c_obj).find('input[type=\"text\"][name*=\"MAX\"]').val()\n && max_dump_el.val() != $(temp_c_obj).find('input[type=\"text\"][name*=\"MIN\"]').val()\n )\n {//found intersection\n wObj.val(max_dump_el.val());\n return;\n }\n });\n }\n }\n }\n else if(check_name.length != check_name.replace('MAX', '').length)\n {//dump max parameter was changed\n var compare_min_val = 1000000;//get other dump min values to prevent intersections (lowest of dump minimums that higher than check value)\n var compare_min_val_lower = -1000000;//get other dump min values to prevent intersections (highest of dump minimums that lower than check value)\n var min_dump_el = wObj.parents('.quality-dump-table-item').find('input[name*=\"MIN\"]');\n var all_min_equal_check = 0;\n var old_val = 0;\n var step_val = parseFloat(wObj.parents('.quality-dump-table-intro').attr('data-step'));\n\n //looking for lower of dump minimums that higher than check value\n wObj.parents('.quality-dump-table-item').siblings('.quality-dump-table-item').each(function(temp_ind, temp_c_obj){\n $(temp_c_obj).find('input[type=\"text\"][name*=\"MIN\"]').each(function(ind, cObj){\n if(compare_min_val > parseFloat($(cObj).val()) && Math.round(parseFloat($(cObj).val()) * 100) > Math.round(parseFloat(min_dump_el.val()) * 100))\n {\n compare_min_val = $(cObj).val();\n all_min_equal_check++;\n }\n if(parseFloat($(cObj).val()) < input_val && compare_min_val_lower < parseFloat($(cObj).val()) && Math.round(parseFloat($(cObj).val()) * 100) > Math.round(parseFloat(min_dump_el.val()) * 100))\n {\n compare_min_val_lower = parseFloat($(cObj).val());\n }\n });\n\n //check if all dump minimiums are same as dump maximums -> then set user's value (if user value is correct)\n if(all_min_equal_check == 1)\n {//all minimiums are equal -> check maximums\n old_val = compare_min_val;\n $(temp_c_obj).find('input[type=\"text\"][name*=\"MAX\"]').each(function(ind, cObj){\n if(old_val != $(cObj).val())\n {\n old_val = $(cObj).val();\n all_min_equal_check++;\n return;\n }\n });\n }\n });\n\n if(all_min_equal_check == 1)\n {//if all dump minimiums are same as dump maximums -> set user's value (if user value is correct)\n if(input_val < parseFloat(min_el.val()))\n {\n wObj.val(min_el.val());\n }\n else if(input_val > parseFloat(max_el.val()))\n {\n wObj.val(max_el.val());\n }\n else if(parseFloat(min_dump_el.val()) > input_val)\n {\n wObj.val(min_dump_el.val());\n }\n }\n else if(parseFloat(compare_min_val) < input_val)\n {//reset value if intersects with other dumps\n wObj.val(compare_min_val);\n }\n else if(max_el.length == 1 && input_val > parseFloat(max_el.val()))\n {//compare value with max value\n wObj.val(max_el.val());\n }\n // else if(compare_min_val == 1000000 && compare_min_val_lower > -1000000 && compare_min_val_lower < input_val)\n // {\n // console.log('1');\n // }\n // else if(compare_min_val_lower > -1000000 && compare_max_val_higher == (input_val - step_val))\n // {\n // console.log('2');\n // }\n else\n {//compare with dump min parameter (check if dump max < dump min)\n if(parseFloat(min_dump_el.val()) > input_val)\n {\n wObj.val(min_dump_el.val());\n }\n else if(Math.round((input_val - step_val) * 100) == Math.round(parseFloat(min_dump_el.val()) * 100))\n {//need check next section (if exists that have same dump maximum and other dump minimum -> prevent intersection)\n wObj.parents('.quality-dump-table-item').siblings('.quality-dump-table-item').each(function(temp_ind, temp_c_obj){\n if(min_dump_el.val() == $(temp_c_obj).find('input[type=\"text\"][name*=\"MIN\"]').val()\n && min_dump_el.val() != $(temp_c_obj).find('input[type=\"text\"][name*=\"MAX\"]').val()\n )\n {//found intersection\n wObj.val(min_dump_el.val());\n return;\n }\n });\n }\n }\n }\n else if(check_name.length != check_name.replace('DISCOUNT', '').length)\n {//if percent value\n if(input_val < -100)\n {\n wObj.val(-100);\n }\n else if(input_val > 100)\n {\n wObj.val(100);\n }\n else\n {//check if input_val value is not 0.5\n var temp_val = val.toString();\n if(temp_val.length != temp_val.replace('.', '').length)\n {//there is dot in float value -> check last value\n var precision_val = temp_val.split('.');\n var check_precision_int = parseInt(precision_val[1].substr(0, 1));\n var plus_val = (check_precision_int < 8 ? 0 : (input_val < 0 ? -1 : 1));\n var res_val = plus_val + parseInt(precision_val[0]);\n if(check_precision_int > 2 && check_precision_int < 8)\n {\n res_val = (input_val < 0 && res_val == 0 ? '-' : '') + res_val + '.5';\n }\n input_val = res_val;\n wObj.val(input_val);\n }\n }\n }\n }\n }\n else if(check_name.length != check_name.replace('MIN', '').length)\n {//min parameter was changed\n //compare value with base value\n var base_el = wParent.find('input[name*=\"BASE\"]');\n if(base_el.length == 1 && input_val > parseFloat(base_el.val()))\n {//change if min < base\n wObj.val(base_el.val());\n }\n else\n {//change dump min values\n wParent.find('.quality-dump-table-item .quality-param-intro input[name*=MIN]').each(function(ind, cObj){\n if(parseFloat($(cObj).val()) < input_val)\n {\n $(cObj).val(input_val);\n //check dump max value (change if dump min > dump max)\n var temp_dump_max = $(cObj).parents('.quality-dump-table-item').find('input[name*=MAX]');\n if(temp_dump_max.length == 1 && input_val > parseFloat(temp_dump_max.val()))\n {\n temp_dump_max.val(input_val);\n }\n }\n });\n }\n }\n else if(check_name.length != check_name.replace('MAX', '').length)\n {//max parameter was changed\n //compare value with base value\n var base_el = wParent.find('input[name*=\"BASE\"]');\n if(base_el.length == 1 && input_val < parseFloat(base_el.val()))\n {//change if max > base\n wObj.val(base_el.val());\n }\n else\n {//change dump max values\n wParent.find('.quality-dump-table-item .quality-param-intro input[name*=MAX]').each(function(ind, cObj){\n if(parseFloat($(cObj).val()) > input_val)\n {\n $(cObj).val(input_val);\n //check dump min value (change if dump max < dump min)\n var temp_dump_min = $(cObj).parents('.quality-dump-table-item').find('input[name*=MIN]');\n if(temp_dump_min.length == 1 && input_val < parseFloat(temp_dump_min.val()))\n {\n temp_dump_min.val(input_val);\n }\n }\n });\n }\n }\n }\n\n //correct result val if it have > 1 digits after dot\n var res_val = val.toString();\n var temp_val = res_val.split('.');\n if(typeof temp_val[1] != 'undefined' && temp_val[1].toString().length > 1)\n {\n wObj.val(parseFloat(val).toFixed(1));\n }\n else {\n wObj.val(parseFloat(val));\n }\n //set correct data as temporary\n wObj.attr('data-tempval', val);\n}", "function $compute() {\n var sold = 0.0,\n montant = 0.0;\n sold = parseFloat($('#bank_extract_begin_sold').val(), 10) + parseFloat($('#bank_extract_total_credit').val(), 10)\n - parseFloat($('#bank_extract_total_debit').val());\n $('.public_bank_extracts #bank_extract_end_sold').val(sold.toFixed(2));\n // mise à deux décimales du montant saisi\n montant = parseFloat($('#bank_extract_total_credit').val(), 10);\n $('.public_bank_extracts #bank_extract_total_credit').val(montant.toFixed(2));\n montant = parseFloat($('#bank_extract_total_debit').val(), 10);\n $('.public_bank_extracts #bank_extract_total_debit').val(montant.toFixed(2));\n montant = parseFloat($('#bank_extract_begin_sold').val(), 10);\n $('.public_bank_extracts #bank_extract_begin_sold').val(montant.toFixed(2));\n}", "setearParams(kv, ma, md, fltr, anod) {\n\n //console.log(\"seteo nuevos parametros\");\n this.kilovolt = kv;\n this.miliamperios = ma;\n this.modo = md;\n this.filtro = fltr;\n this.anodo = anod;\n }", "function finalCalculations (stats, dim, name, numVals) {\r\n stats[dim][name].mean *= (1 / numVals);\r\n stats[dim][name].meanOfSquares *= (1 / numVals);\r\n stats[dim][name].stdev = Math.sqrt(stats[dim][name].meanOfSquares - Math.pow(stats[dim][name].mean, 2));\r\n }", "function calculateImplementation() {\r\n var COST_ESTIMATION_RATIO = 0.7; \r\n var COOPERATION_RATIO = 0.3;\r\n projectCostEstimationScore = $('#project_cost_estimation_hidden').val();\r\n cooperationBenefitsScore = $('#cooperation_benefits_hidden').val(); \r\n \r\n var implementationScore = (projectCostEstimationScore * COST_ESTIMATION_RATIO) +\r\n (cooperationBenefitsScore * COOPERATION_RATIO);\r\n \r\n // we round the result to the second decimal place \r\n return implementationScore;\r\n}", "function gradenumeric() {\n //var fasit = qobj.fasit;\n // for numeric the fasit is a template like this\n // 33.13:0.5 the answer is 33.13 +- 0.5\n // 32.0..33.5 the answer must be in the interval [32.0,33.5]\n // TODO a..b is the same as rng:a,b -- should we drop one of them?\n // nor:m,s the answer x is scored as e^-((1/(2) * ((x-m)/s)^2\n // sym:exp the answer x is scored as pycas(x - exp) == 0\n // eva:exp|a|b the answer x is scored as eval(x) == exp\n // zro:exp|a the answer x is correct if |exp(x)| < a\n // reg:r the answer x is scored as regular exp match for x,r\n // lis:a:A,b:B,c the answer x is scored as x == one of a,b,c - score is given by :A or 1\n var cor = ff;\n switch (swi) {\n case 'nor:':\n var norm = tch.split(',');\n var med = +norm[0];\n var std = +norm[1];\n var ex = ((uanum - med)/std);\n var sco = Math.pow(2.712818284,-(0.5*ex*ex));\n if (sco > 0.05) {\n ucorr += sco;\n feedb = Math.floor((1-sco)*10);\n } else {\n uerr++;\n }\n cor = med;\n break;\n case 'rng:': // [[rng:10,20]]\n var lims = tch.split(',');\n var lo = +lims[0];\n var hi = +lims[1];\n if (uanum >= lo && uanum <= hi) {\n ucorr += 1;\n feedb = 1;\n } else {\n uerr++;\n }\n cor = lo;\n break;\n case 'sym:':\n simple = false; // callback done after sympy is finished\n // fixup for 3x => 3*x etc\n var completed = { comp:0, lock:0 };\n if (uatxt == undefined || uatxt == '') {\n callback(score,'no input',completed,ua,1);\n } else {\n var elem = tch.split('|');\n var target = elem[0];\n var differ = elem[1]; // optional text that useranswer must NOT EQUAL\n // for symbolic equality - dont accept original equation\n // or new eq that is longer (not simpler)\n if (differ && (differ == uatxt || differ.length < uatxt.length) ) {\n callback(score,'sicut prius',completed,ua,1);\n } else {\n var ufu = sympify(target); // fasit\n cor = ufu;\n var fafu = sympify(uatxt); // user response\n var diffu = sympify(differ); // if testing equality - must be as short or shorter than this\n var intro = '# coding=utf-8\\n'\n + 'from sympy import *\\n';\n var text = 'x,y,z,a,b,c,d,e,f,u,v,w = symbols(\"x,y,z,a,b,c,d,e,f,u,v,w\")\\n'\n + 'a1=sympify(\"'+ufu+'\")\\n'\n + 'b1=sympify(\"'+fafu+'\")\\n'\n + 'c1=a1-b1\\n'\n + 'print simplify(c1)\\n';\n var score = 0;\n console.log(intro+text);\n fs.writeFile(\"/tmp/symp\"+now, intro+text, function (err) {\n if (err) { callback(score,'error1',completed,ua,1); throw err; }\n try {\n var child = exec(\"/usr/bin/python /tmp/symp\"+now, function(error,stdout,stderr) {\n fs.unlink('/tmp/symp'+now);\n //console.log(\"err=\",stderr,\"out=\",stdout,\"SOO\");\n if (error) {\n console.log(error,stderr);\n callback(score,'error2',completed,ua,1);\n } else {\n if (stdout && stdout != '') {\n //console.log(stdout);\n var feedb = stdout;\n var eta = +stdout.trim();\n if (_.isFinite(eta) && eta == 0 || Math.abs(eta) < 0.001 ) {\n score = 1\n if (differ) {\n // we are testing for simplification\n // minimum assumed to be ufu, diffu.length is original length (unsimplified)\n var span = diffu.length - ufu.length; // max shortening possible\n var dif = fafu.length - ufu.length; // how much shorter\n if (span > 0) {\n score = Math.max(0,Math.min(1,1-dif/span));\n // relative score depending on how many chars\n // you have shortened the eq - span assumed to be max\n feedb = (score > 0.8) ? 'Good answer' : (score > 0.5) ? 'Nearly' : 'Not quite';\n }\n } else {\n feedb = 'Correct answer';\n }\n } else {\n feedb = 'Incorrect answer';\n score = 0;\n }\n var cutcost = (attnum > 2) ? Math.min(1,cost*attnum*2) : cost*attnum;\n var adjust = score * (1 - cutcost - hintcost*hintcount);\n //console.log(qgrade,adjust,attnum,cost);\n score = aquest.points * Math.max(0,adjust);\n }\n //console.log(\"CAME SO FAR SYMBOLIC PYTHON \",eta,score,stdout,stderr,error);\n callback(score,feedb,completed,ua,1);\n }\n });\n } catch(err) {\n callback(score,'error3',completed,ua,1);\n }\n });\n }\n }\n break;\n case 'zro:':\n // zro:exp|a the answer x is correct if |exp(x)| < a\n var elem = tch.split('|');\n var exp = elem[0];\n var tol = elem[1] || 0.001 ;\n var sco = 0;\n exp = normalizeFunction(exp,0,ua);\n var num = +uatxt;\n if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n // user supplied root checked\n console.log(\"Checking if root:\",uatxt,exp);\n var bad = false;\n try {\n var fu1 = new Function(\"x\",' with(Math) { return ' +exp+'; }' );\n var f1 = Math.abs(fu1(num));\n console.log(\"Evalueated to \",f1,tol)\n if (f1 <= tol) {\n sco = 1;\n feedb = '1'; // mark as correct\n } else {\n bad = true;\n }\n }\n catch (err) {\n console.log(\"EVAL fu \",err);\n bad = true;\n }\n if (bad) {\n uerr++;\n } else {\n ucorr += sco;\n }\n }\n cor = 'NaN';\n break;\n case 'eva:':\n // eva:exp|a|b the answer x is scored as eval(x) == exp\n // the user answer must NOT EQUAL a,\n // Quiz: multiply (x+6) by 2, do not accept 2*(x+2)\n // eva:2x+12|2(x+6)\n // the answer should be as short as b (punished for extra chars - up to a.length)\n // simplify (2+4)*(7-5)\n // eva:12|(2+4)*(7-5)|12\n // so the constraints are : evaluate as 12, not eq \"(2+4)*(7-5)\" , as short as 12\n // partial score if between \"12\" and \"(2+4)*(7-5)\" in length\n var elem = tch.split('|');\n var exp = elem[0];\n var differ = elem[1]; // optional text that useranswer must NOT EQUAL\n var simply = elem[2]; // optional text that useranswer should match in length\n var lolim = -5;\n var hilim = 5;\n var sco = 0;\n exp = normalizeFunction(exp,0,ua);\n cor = exp;\n var ufu = normalizeFunction(uatxt,0);\n var udiff =normalizeFunction(differ,0);\n //console.log(exp,lolim,hilim,ufu);\n if (differ && (differ === uatxt || udiff === ufu) ) {\n uerr++;\n console.log(\"sicut prius\");\n } else if (exp === ufu) {\n ucorr++; // they are exactly equal\n feedb = '1'; // mark as correct\n //console.log(\"exact\");\n } else {\n //console.log(\"EVA:\",exp,ufu);\n if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n // user supplied function numericly tested against fasit\n // for x values lolim .. hilim , 20 steps\n var dx = (+hilim - +lolim) / 20;\n var bad = false;\n try {\n //return 'with(Math) { return ' + fu + '; }';\n var fu1 = new Function(\"x\",' with(Math) { return ' +exp+'; }' );\n var fu2 = new Function(\"x\",' with(Math) { return ' +ufu+'; }' );\n var reltol,f1,f2;\n for (var pi=0,xi = lolim; pi < 20; xi += dx, pi++) {\n //console.log(\"testing with \",xi);\n f1 = fu1(xi);\n f2 = fu2(xi);\n if (!isFinite(f1) && !isFinite(f2)) {\n reltol = 0;\n //console.log(\"NaN/inf\",xi,reltol);\n } else {\n reltol = f1 ? Math.abs(f1-f2)/Math.abs(f1) : Math.abs(f1-f2);\n }\n //console.log(xi,f1,f2,reltol);\n if (reltol > 0.005) {\n bad = true;\n break;\n }\n sco += reltol;\n }\n }\n catch (err) {\n console.log(\"EVAL fu \",err);\n bad = true;\n }\n if (bad) {\n uerr++;\n } else {\n if (simply) {\n // we are testing for simplification\n // minimum assumed to be simply.length, differ.length is original length (unsimplified)\n var span = differ.length - simply.length; // max shortening possible\n var dif = Math.min(span,Math.max(0,differ.length - ufu.length)); // how much shorter\n if (span > 0) {\n sco = 1 - Math.max(0,Math.min(1,dif/span));\n // relative score depending on how many chars\n // you have shortened the eq - span assumed to be max\n }\n }\n ucorr += 1 - sco;\n feedb = '1'; // mark as correct\n }\n }\n }\n break;\n case 'reg:':\n try {\n tch = tch.trim();\n var myreg = new RegExp('('+tch+')',\"gi\");\n var isgood = false;\n uatxt.replace(myreg,function (m,ch) {\n //console.log(\"REG:\",uatxt,tch,m,ch);\n isgood = (m == uatxt);\n });\n if ( isgood) {\n ucorr++; // good match for regular expression\n feedb = '1'; // mark as correct\n } else if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n uerr++;\n }\n }\n catch (err) {\n console.log(\"BAD REG EXP\",tch);\n if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n uerr++;\n }\n }\n cor = 'NaN';\n break;\n case 'lis:':\n var goodies = tch.split(',');\n if (goodies.indexOf(uatxt) > -1) {\n ucorr++;\n feedb = '1'; // mark as correct\n } else if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n uerr++;\n }\n cor = goodies[0];\n break;\n default:\n var num,tol,cor;\n cor = ff;\n //console.log(\"trying numeric\",ff,uatxt );\n if (ff == num) feedb = 1;\n if ( ff.indexOf(':') > 0) {\n // we have a fasit like [[23.3:0.5]]\n var elm = ff.split(':');\n num = +elm[0];\n tol = +elm[1];\n cor = num;\n //console.log(\"NUM:TOL\",ff,num,tol,uanum);\n } else if ( ff.indexOf('..') > 0) {\n // we have a fasit like [[23.0..23.5]]\n var elm = ff.split('..');\n var lo = +elm[0];\n var hi = +elm[1];\n tol = (hi - lo) / 2;\n num = lo + tol;\n cor = num;\n //console.log(\"LO..HI\",ff,lo,hi,num,tol,uanum);\n } else {\n num = +ff; tol = 0.0001;\n }\n if ( ff == 'any' || ff == 'anytext' || Math.abs(num - uanum) <= tol) {\n ucorr++;\n feedb = '1'; // mark as correct\n } else if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n uerr++;\n }\n break;\n }\n return cor;\n }", "function Velocity_TimeCalculation(InitialVelocity, FinalVelocity, Acceleration)\n{\n //t = (vf - vi)/a || t = ( vf - vi ) / a\n var Time = (FinalVelocity - InitialVelocity) / Acceleration;\n document.getElementById(\"result\").value = Time;\n}", "function setParams() {\r\n \r\n for(Entry<String,Double> e : body.metabolicParameters.get(body.bodyState.state).get(BodyOrgan.BRAIN.value).entrySet()) {\r\n switch (e.getKey()) {\r\n case \"glucoseOxidized_\" : { glucoseOxidized_ = e.getValue(); break; }\r\n case \"glucoseToAlanine_\" : { glucoseToAlanine_ = e.getValue(); break; }\r\n case \"bAAToGlutamine_\" : { bAAToGlutamine_ = e.getValue(); break; }\r\n }\r\n }\r\n //System.out.println(\"glucoseOxidized: \" + glucoseOxidized_);\r\n }", "function curvenum_setParams(infil, p)\n//\n// Input: infil = ptr. to Curve Number infiltration object\n// p[] = array of parameter values\n// Output: returns TRUE if parameters are valid, FALSE otherwise\n// Purpose: assigns Curve Number infiltration parameters to a subcatchment.\n//\n{\n\n // --- convert Curve Number to max. infil. capacity\n if ( p[0] < 10.0 ) p[0] = 10.0;\n if ( p[0] > 99.0 ) p[0] = 99.0;\n infil.Smax = (1000.0 / p[0] - 10.0) / 12.0;\n if ( infil.Smax < 0.0 ) return FALSE;\n\n // --- convert drying time (days) to a regeneration const. (1/sec)\n if ( p[2] > 0.0 ) infil.regen = 1.0 / (p[2] * SECperDAY);\n else return FALSE;\n\n // --- compute inter-event time from regeneration const. as in Green-Ampt\n infil.Tmax = 0.06 / infil.regen;\n\n return TRUE;\n}" ]
[ "0.6360211", "0.61976403", "0.6065874", "0.6006052", "0.58915895", "0.5882498", "0.5859229", "0.5709164", "0.5703393", "0.56997615", "0.56949455", "0.56727695", "0.5668661", "0.5658289", "0.5648664", "0.56040835", "0.5594275", "0.5587066", "0.5559364", "0.5557143", "0.55343604", "0.5527939", "0.55069983", "0.5505205", "0.5490984", "0.54833233", "0.54828715", "0.5471033", "0.5463364", "0.54494244", "0.54241586", "0.5420736", "0.5406649", "0.5400007", "0.539495", "0.53892386", "0.53708833", "0.53708833", "0.53708833", "0.5354628", "0.5345463", "0.53335553", "0.5324386", "0.53074104", "0.53065175", "0.52944493", "0.52938044", "0.52858305", "0.5282816", "0.5282459", "0.52824545", "0.5281112", "0.5280942", "0.527817", "0.52720857", "0.526861", "0.5261008", "0.52605104", "0.52499044", "0.524426", "0.52431345", "0.52415776", "0.5240391", "0.5231885", "0.5226829", "0.522587", "0.52254117", "0.5221979", "0.5221979", "0.5221979", "0.52193594", "0.52164423", "0.5216399", "0.5215469", "0.52088296", "0.5207699", "0.5207699", "0.5207699", "0.5207699", "0.5207699", "0.52056926", "0.52038294", "0.5201927", "0.51974905", "0.51936686", "0.51925766", "0.5185031", "0.5184737", "0.51839936", "0.5183345", "0.51817924", "0.5178608", "0.5178269", "0.51764506", "0.5173946", "0.51717675", "0.5168301", "0.5168063", "0.5165785", "0.51645166" ]
0.5486283
25
Initial data fetch asynchronous (ain't nothing holding the page back while it loads)
async connectedCallback() { let request = new XMLHttpRequest(); request.open('GET', jsonData, false); request.send(null); this.data = JSON.parse(request.responseText); // turns out that github does not provide // unauthenticated access to public repos over rest // Thank you github. Hence cannot fatch Data using the Fetch API //const data = await fetchDataHelper({ amountOfRecords: 100 }); //this.data = data; this.calculateData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n fetchData();\n}", "async function loadData() {\n //initialize() will return either\n //multiple resolved promises of AJAX calls for initializing database or\n //Already Initialized\n const result = await initialize();\n\n //if result is array we have array of resolved promises\n //which they are data which is initialized to database\n if(Array.isArray(result)) {\n //so we just display this data without making additional AJAX call to database\n displayData(result);\n return;\n }\n\n //if data is already initialized we make AJAX request to get it\n const request = {\n method: 'GET',\n headers: {\n authorization: 'Kinvey ' + authToken,\n 'Content-Type': 'application/json',\n },\n };\n\n const response = await fetch(baseUrl, request)\n .then(handler)\n .catch(console.log);\n\n displayData(response);\n}", "function fetchData() {\n return new Promise(resolve =>\n resolve(initData)\n );\n}", "function initialize() {\n fetch();\n}", "function doFetch() {\n\t\tsetFetching(true);\n\t}", "fetchInitialData(args) {\n return Promise.all([\n makeRequest(\"browse/new-releases\"),\n makeRequest(\"browse/featured-playlists\"),\n makeRequest(\"browse/categories\"),\n ]);\n }", "function getData() {\n fetch(url)\n // This is a callback function\n .then(function (u) {\n return u.json();\n })\n // Setting the global jsondata variable\n .then(function (json) {\n jsondata = json;\n\n // Call processDataCallback\n processDataCallback();\n\n document.getElementById('loader').style = \"display: none\";\n document.getElementById('data-content').style = \"\";\n\n // getTableData();\n createTable();\n });\n}", "function getData() {\r\n fetch(url)\r\n // This is a callback function\r\n .then(function (u) {\r\n return u.json();\r\n })\r\n // Setting the global jsondata variable \r\n .then(function (json) {\r\n jsondata = json;\r\n \r\n // Call processDataCallback\r\n processDataCallback();\r\n \r\n document.getElementById('loader').style = \"display: none\";\r\n document.getElementById('data-content').style = \"\";\r\n\r\n // getTableData();\r\n createTable();\r\n });\r\n}", "getInitialDataForUser () {\n let that = this;\n that.setState({loadingStatus: true});\n\n fetchData.getInitialDataForUser()\n .then(data => {\n that.setState({listOfServices: data});\n })\n .catch(err => {\n that.setState({statusMessage: err});\n })\n .finally ( () => {\n that.setState({loadingStatus: false});\n })\n ;\n }", "async function fetcher() {\n let data = {};\n try {\n data = await query()\n }\n catch (error) {\n setError(error)\n return\n }\n console.log(\"DATAAA\", data)\n setLoading(false)\n setData(data)\n setDone(true)\n }", "async function init() {\n await getData();\n //display the page buttons\n paginationEl.style.display = \"flex\";\n //hide the spinner\n spinnerEl.classList.add(\"hidden\");\n\n //render the current page\n changePage(1);\n}", "initialFetch() {\n this.fetchData({type: \"INITIAL_TABLE_DATA_FETCH\"})\n }", "async function fetchData() {\n\n let url = urlFoodListGenerator(baseUrl, constants.APIKEY, maxRecipePerCall, listFoodstuffs)\n console.log('fetching from ' + url)\n\n await setFetchLoading(true)\n fetch(url)\n .then((response) => response.json())\n .then((data) => {\n console.table(data)\n console.log(data)\n setData(data)\n setFetchLoading(false)\n\n })\n .catch((e) => {\n setFetchError(e)\n setFetchLoading(false)\n })\n }", "function enter() {\n fetchData(true);\n }", "async fetchInitialData() {\n try {\n let tasks = await Helpers.fetch('/api/tasks', {\n method: 'GET'\n });\n this.setState({tasks: tasks});\n\n let tags = await Helpers.fetch('/api/tags', {\n method: 'GET'\n });\n this.setState({tags: tags, draftTags: tags, loaded: true});\n } catch (error) {\n if (error.response.status === 401) {\n this.props.history.replace('/login');\n } else if (error.response.status === 400) {\n // error in response, display could not load error message\n this.setState({error: error});\n }\n }\n }", "async fetchData() {\n let data = await (await fetch(\"http://localhost:8080/short\")).json();\n let elems = [];\n data.forEach(item => elems.push(this.createElements(item)));\n this.addToNav(elems);\n }", "async function fetchData() {\n try {\n const response = await fetch(baseUrl + url);\n if (response.ok) {\n const json = await response.json();\n setData(json);\n } else {\n throw response;\n }\n } catch (error) {\n setError(error)\n } finally {\n setLoading(false);\n }\n }", "fetchInitialData(){\n\t\tModel.prototype.fetch.apply(this, arguments)\n\t\tthis.collect.fetch()\n\t}", "function fetch_data() {\n\n function on_data_received(data) {\n\t load_data_into_table(data);\n\n if (refresh_rate != 0) {\n\t setTimeout(fetch_data, refresh_rate * 1000);\n\t }\n }\n \n $.ajax({\n url: dataurl,\n method: 'GET',\n dataType: 'json',\n success: on_data_received\n });\n }", "async function fetchData() {\n\n // get the datasets.json data\n const url = withPrefix('/data/datasets.json')\n const resp = await fetch(url)\n const datasets = await resp.json()\n\n // sort the datasets by added date, descending\n datasets.sort((a, b) => new Date(b.added) - new Date(a.added))\n\n // update the display with latest data\n setDatasets(datasets)\n setFiltered(datasets.map(d => d.slug))\n setSubjects(getSubjects(datasets))\n setStart(getEarliestDate(datasets))\n }", "function initData(){\n container.prepend(progressInfo);\n jQuery.get(getPageURL(0, resource)).done(function(data) {\n records = processData(data, true);\n initView(new recline.Model.Dataset({records:records}));\n numReq = getRequestNumber(data.result.total, pageSize);\n for (var i = 1; i <= numReq; i++) {\n requestData(getPageURL(i, resource));\n };\n });\n }", "_doFetch() {\n\t\tthis.emit(\"needs_data\", this);\n\t}", "function initData(url) {\n // wrap this in a promise, so we know we have it before continuing on to remaining initialize steps\n return new Promise(function(resolve, reject) {\n $.get(url, function(data) {\n resolve(data);\n });\n });\n}", "async componentDidMount(){\n if(!this.state.initialDataLoaded){ //initialDataLoaded is used to know if the data is loaded\n const initialData = await Home.initialData()\n this.setState({...initialData})\n }\n }", "async componentDidMount(){\n if(!this.state.initialDataLoaded){ //initialDataLoaded is used to know if the data is loaded\n const initialData = await Home.initialData()\n this.setState({...initialData})\n }\n }", "async componentDidMount(){\n const fetchedData = await fetchData(); \n //sets the state's data to what we just fetched \n this.setState({ data: fetchedData}); \n }", "function init() {\n\n\t\t\tfetch(url + '/api.php')\n\t\t\t.then(response => response.json())\n\t\t\t.then(fruits => {\n\t\t\t\tfruits.map((item) => {\n\t\t\t\t\t$('#board').append('<div class=\"cadre\"><div class=\"carre flippable ' + item.fruit + '\" logo=\"' + item.fruit + '\"></div></div>')\n\t\t\t\t})\n\n\t\t\t}).then( () => {\n\t\t\t\treturn fetch( url+ '/api.php?action=getscore')\n\t\t\t})\n\t\t\t.then( response => response.json())\n\t\t\t.then(data => {\n\t\t\t\tdata.map( item => {\n\t\t\t\t\t$('#billboard').append('<div>'+item.temps+'</div>')\n\t\t\t\t})\n\t\t\t})\n\t\t}", "async function fetchData() {\n // tutorials().then((resTutorials) => {\n // resTutorials.forEach((elem) => {\n // idVideo = elem.ttr_src.substring(30, elem.ttr_src.length);\n // menuFilter = auxTreeTutorial.filter((e) => e.title == elem.application_display_name);\n // if (auxTreeTutorial.filter((e) => e.title == elem.application_display_name).length > 0) {\n // menuFilter[0].videos.push({ title: elem.ttr_title, idVideo, description: elem.ttr_description });\n // } else {\n // auxTreeTutorial.push({ title: elem.application_display_name, videos: [{ title: elem.ttr_title, idVideo, description: elem.ttr_description }] });\n // }\n // });\n // // setVideoOnDisplay({ tutorial: response.data[0].application_display_name, video: response.data[0].ttr_title });\n // setIdPlayer('0');\n // });\n }", "function fetch() {\n $.ajax({\n url: window.silvupleOptions.jsonContentLister,\n dataType: 'json',\n data: null,\n success: success,\n error : fail\n });\n }", "fetchData() {\n this.initLoading();\n this.setAndGetInstanceFromSandBox(this.view, this.qs_url).then(instance => {\n this.setLoadingSuccessful();\n this.data.instance = instance;\n }).catch(error => {\n this.setLoadingError(error);\n debugger;\n });\n\n this.getParentInstancesForPath();\n }", "async init() {\n // Initiate classes and wait for async operations here.\n \n const fetchPlanets = async() => {\n const planets = await fetch(\"https://swapi.booost.bg/api/planets/\");\n const planetsIntoJson = await planets.json();\n \n this.data.planets = planetsIntoJson.results;\n this.data.count = planetsIntoJson.count;\n \n let planet = planetsIntoJson;\n while (planet.next) {\n planet = await (await fetch(planet.next)).json();\n this.data.planets = [...this.data.planets, ...planet.results];\n }\n };\n\n await fetchPlanets();\n this.emit(Application.events.APP_READY);\n }", "fetchData() {\n this.setLoadingSuccessful();\n }", "async loadData() {\n this.setState({\n data: await get()\n })\n }", "fetchData() {\n this.initLoading();\n let qs = this.setAndGetQuerySetFromSandBox(this.view, this.qs_url);\n this.data.instance = qs.cache = qs.model.getInstance({}, qs);\n this.setLoadingSuccessful();\n this.getParentInstancesForPath();\n }", "fetchData() {\n this.initLoading();\n let qs = this.setAndGetQuerySetFromSandBox(this.view, this.qs_url);\n this.data.instance = qs.cache = qs.model.getInstance({}, qs);\n this.setLoadingSuccessful();\n this.getParentInstancesForPath();\n }", "async initializeDataLoad() {\n }", "function init(){\n getData();\n}", "function fetchData() {\n\tshowLoader(); // invoke loader\n\tfetch('https://api.magicthegathering.io/v1/cards?random=true&pageSize=100&language=English')\n\t\t.then((response) => response.json())\n\t\t.then((data) => {\n\t\t\thideLoader(); // invoke hide loader func\n\t\t\tconsole.log(data);\n\t\t\tdataArr = data.cards.slice();\n\t\t\tconsole.log(dataArr); // test\n\t\t\tloadArr = dataArr.slice(0, n);\n\t\n\t\t\trenderCardList(loadArr);\n\t\t\tbtnLoadMore.style.display = 'block'; // show load more button\n\t\t});\n}", "async function getData() {\n cardsDiv.innerHTML = `<h1>loading..</h1>`;\n const response = await fetch(endPoint);\n const data = await response.json();\n return data.data;\n}", "async fetchData() {\n const {siteUrl} = this.props;\n try {\n this.GhostApi = setupGhostApi({siteUrl});\n const {site, member} = await this.GhostApi.init();\n site.is_stripe_configured = (site.is_stripe_configured === undefined) || site.is_stripe_configured;\n const stripeParam = this.getStripeUrlParam();\n const {page, showPopup = false} = this.getDefaultPage({member, stripeParam});\n this.setState({\n site,\n member,\n page,\n showPopup,\n action: 'init:success',\n initStatus: 'success'\n });\n } catch (e) {\n /* eslint-disable no-console */\n console.error(`[Members.js] Failed to initialize`);\n /* eslint-enable no-console */\n this.setState({\n action: 'init:failed',\n initStatus: 'failed'\n });\n }\n }", "async function fetchData() {\n setLoading(true);\n const randomPage = Math.trunc(Math.random() * 100 + 1);\n const response = await fetch(\n `${Config.uri}?page=${randomPage}&perPage=${Config.perPage}`\n );\n const data = await response.json();\n const randomIndex = Math.trunc(Math.random() * 10);\n if (data[randomIndex].hasOwnProperty(\"_id\")) {\n setRandomRestaurant(data[randomIndex]);\n } else {\n setRandomRestaurant(null);\n }\n setLoading(false);\n }", "async fetch(cb) {\n const { articlesData } = await request.get(\"/api/articles?page=1\");\n\n this.articles = articlesData;\n\n cb();\n }", "async function preFetchData() {\n await fetch('/courseData.json')\n .then(res => res.json())\n .then(data => {\n coursesData = data;\n // console.log(coursesData);\n });\n\n await fetch('/buildings.json')\n .then(res => res.json())\n .then(data => {\n buildingData = data;\n // console.log(buildingData);\n });\n\n // sunOrSat();\n}", "async function init() {\n try {\n products = await getData(); // API\n setupPage(products, dropdownMenu, features);\n } catch (error) {\n console.log(\"Error: \" + error.message);\n }\n}", "async componentDidMount() {\n const fetchedData = await fetchData();\n this.setState({data: fetchedData});\n }", "loadingData() {}", "loadingData() {}", "async function init() {\n try {\n // Fetch new data\n currentLocation = await getLocation();\n const coordinates = `${currentLocation.coords.latitude},${currentLocation.coords.longitude}`;\n forecast = await getForecast(coordinates);\n\n // Render data\n renderForecast(forecast);\n renderCoordinates(currentLocation);\n\n // Save data\n localStorage.setItem('location', coordinates);\n localStorage.setItem('forecast', JSON.stringify(forecast));\n } catch (err) {\n renderErrors(err);\n }\n}", "async componentDidMount() {\n const fetchedData = await fetchData();\n this.setState({ data: fetchedData });\n }", "async componentDidMount() {\n const response = await fetch(`https://api.spacexdata.com/v3/launches?limit=100`);\n const json = await response.json();\n this.setState({ initialData: json });\n this.setState({loading:true})\n }", "function loadData() {\n fetch(postLink)\n .then(e => e.json())\n .then(showData);\n}", "async function hentData() {\n const response1 = await fetch(endpoint1);\n const response2 = await fetch(endpoint2);\n const response3 = await fetch(endpoint3);\n const response4 = await fetch(endpoint4);\n const response5 = await fetch(endpoint5);\n\n\n slide1 = await response1.json();\n slide2 = await response2.json();\n slide3 = await response3.json();\n slide4 = await response4.json();\n slide5 = await response5.json();\n visData();\n}", "async function initialRender() {\n\tawait getFromDB();\n\trender();\n}", "function waitForData(){\n if(data.fetching){\n setTimeout(waitForData, 10);\n } else {\n callback(data);\n }\n }", "async function fetchData(){\n const response = await fetch(\"https://anapioficeandfire.com/api/houses?pageSize=100\");\n const data = await response.json();\n setHouse(data);\n }", "fetchData() {\n this.initLoading();\n this.getInstance(this.view, this.qs_url).then(instance => {\n this.setLoadingSuccessful();\n this.data.instance = instance;\n\n if(this.view.schema.autoupdate) {\n this.startAutoUpdate();\n }\n }).catch(error => {\n debugger;\n this.setLoadingError(error);\n });\n\n this.getParentInstancesForPath();\n }", "function pageLoad (){\n fetch(quoteAPI)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n quoteData = data;\n renderNewQuote();\n });\n\n fetch(fontAPI)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n fontData = data;\n renderNewFont ();\n });\n}", "function loadData() {\n fetch('https://jsonplaceholder.typicode.com/todos/1')\n .then(response => response.json())\n .then(data => console.log(data))\n}", "function fetchData() {\n fetch(url, {\n method: \"get\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"x-apikey\": key,\n \"cache-control\": \"no-cache\",\n },\n })\n .then((e) => e.json())\n .then((data) => {\n //Data sendes til functionen handleData\n handleData(data);\n });\n }", "function loadData() {\n system.isLoading = true;\n\n $.ajax({\n url: system.apiURL,\n dataType: 'jsonp',\n success: onLoadData\n });\n\n }", "function loadData(){\n fetch('https://jsonplaceholder.typicode.com/todos/1')\n .then(response=>response.json())\n .then(data=>console.log(data))\n}", "async function getInitialParkingData() {\n await getParking();\n }", "async function fetchData() {\n const response = await API.get(\"findTask/\");\n\n setTasks(response.data);\n console.log(\"👉 Returned data:\", response);\n }", "async function fetchData() {\n const response = await fetch(\n \"https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_hour.geojson\",\n {\n method: \"GET\",\n }\n );\n\n const jsonResponse = await response.json();\n\n if (jsonResponse && jsonResponse.metadata.count>0) {\n const { features, metadata, bbox } = jsonResponse;\n\n setFeaturesState(features);\n setMetaData(metadata);\n setBboxState(bbox);\n return jsonResponse;\n }\n }", "async function getData() {\n document.getElementById(\"results\").innerHTML = \"Loading...\";\n\n var state = document.getElementById(\"state\").value;\n var county = document.getElementById(\"county\").value;\n\n if(state.length < 3)\n state = getFullStateName(state.toUpperCase());\n\n const params = new URLSearchParams();\n params.append('state', state);\n params.append('county', county);\n\n fetch('/getData', {\n method: 'POST',\n body: params\n })\n .then(response => response.json())\n .then(data => display(data, state, county));\n}", "renderInitialInfo() {\r\n if (!this.state.pageLoaded) {\r\n fetch(\"/popularCompanies\", {\r\n method: \"POST\",\r\n credentials: \"include\",\r\n headers: { \"Content-Type\": \"application/json\" }\r\n }).then(res => res.json())\r\n .then(data => {\r\n var sortedData = this.sortInitialData(data, []);\r\n this.setState({popularCompanies: sortedData});\r\n this.setState({pageLoaded: true});\r\n })\r\n .catch((error) => {\r\n console.error(error);\r\n });\r\n }\r\n }", "defaultPageData() {\n return __awaiter(this, void 0, void 0, function* () {\n });\n }", "fetchData() {\n this.initLoading();\n\n this.setFilters(this.qs_url, this.generateBaseFilters());\n this.data.filters = this.getFilters(this.qs_url);\n\n let qs = this.setQuerySet(this.view, this.qs_url).filter(this.getFiltersPrepared(this.qs_url)).prefetch();\n this.setQuerySet(this.view, this.qs_url, qs);\n\n this.getInstancesList(this.view, this.qs_url).then(instances => {\n this.setLoadingSuccessful();\n\n this.setInstancesToData(instances);\n\n if(this.view.schema.autoupdate) {\n this.startAutoUpdate();\n }\n\n }).catch(error => {\n this.setLoadingError(error);\n });\n\n this.getParentInstancesForPath();\n }", "function fetchTheData() {\r\n let baseURL = \"https://newsapi.org/v2/top-headlines\";\r\n deleteOld();\r\n let search = \"?q=\" + id(\"search\").value;\r\n id(\"searchTerm\").textContent = id(\"search\").value;\r\n let apiKey = \"&apiKey=c1c6c8286a5449b7a7fcc01deb46437c\";\r\n fetch(baseURL + search + apiKey)\r\n .then(checkStatus)\r\n .then(response => response.json()) // if json\r\n .then(processResponse)\r\n .catch(handleError);\r\n }", "async function fetchData() {\n setLoading(true)\n const res = await FindBatchWithCode(id)\n if (res) {\n await GetStudentRequestsForBatch(id)\n } else {\n showErrorSnackbar(enqueueSnackbar, 'This batch does not exist!')\n history.push('/dashboard')\n }\n setLoading(false)\n }", "function initData() {\n data = $.getJSON('./data/weathers.json').done(() => {\n console.log(\"Loaded: JSON - data\");\n data = data.responseJSON;\n console.log(data);\n initPage();\n }).fail(() => {\n console.log(\"Error when loading JSON - data.\");\n });\n}", "function getData() {\n fetch(baseURL)\n .then((response) => response.json())\n .then((data) => {\n dataSet.push(...data);\n init();\n })\n .catch((error) => {\n container__top.innerHTML = `${NO_DATA_FOUND} ${error}`;\n });\n getData2();\n getData3();\n }", "async function fetchData() {\n\t\t\tconst request = await axios.get(\n\t\t\t\t`https://api.themoviedb.org/3/movie/upcoming?api_key=${api_key}&language=en-US`\n\t\t\t);\n\t\t\t// gets base url from axios.js and parse the extension from requests.js\n\t\t\tsetListing(request.data.results);\n\t\t\tconsole.log(request.data.results);\n\t\t}", "async function fetchData() {\n const request = await instance.get(fetchUrl);\n setMovies(request.data.results);\n return request;\n }", "function fetchData() {\n let targetElement = this,\n url = `./includes/connect.php?id=${this.dataset.target}`;\n\n fetch(url)\n .then(res => res.json())\n .then(data => {\n console.log(data);\n buildPopover(data, targetElement);\n })\n .catch((err) => console.log(err));\n }", "function loadData() {\n loadNYTData();\n loadParselyData();\n loadEtsyData();\n loadTumblrData();\n loadBitlyData();\n loadFoursquareData();\n loadexfmData();\n page++;\n\n if (isLoading) $('#loaderCircle').show();\n}", "static async initialData(){\n await Promise.all([\n await dataManager.countriesAuto(),\n await dataManager.world.getAuto(),\n ])\n\n try {\n return {\n world: dataManager.world,\n countries: dataManager.countriesList,\n initialDataLoaded: true\n }\n } catch (e) {\n console.error(e)\n return {\n initialDataError: true,\n }\n }\n }", "async componentDidMount() {\n await this.fetchData()\n }", "async fetchData(){\n\t\tlet response = await fetch('https://rallycoding.herokuapp.com/api/music_albums');\n\t\treturn response.json(); //Wait for response to come then then return promise\n\t}", "async function fetchMyAPI() {\t\t\n\t\tPromotionsService.getActivePromotions().then(\n\t\t\tresponse => {\n\t\t\t\tsetData(response);\n\t\t\t},\n\t\t\terror => {\n\t\t\t\tif (error.response.status === 404) {\n\t\t\t\t\talert(`L'application nécessite une mise à jour`);\n\t\t\t\t} else {\n\t\t\t\t\talert(`Uho, il semblerait que notre serveur soit indisponible :(`);\n\t\t\t\t}\n\t\t\t}\n\t\t)\n\t}", "function fetchdata(){\n var n_src = new Array(\"associated-press\",\"bbc-news\",\"the-times-of-india\",\"bloomberg\",\"cnbc\",\"cnn\",\"the-next-web\",\"bbc-sport\",\"national-geographic\",\"reuters\",\"daily-mail\",\"the-hindu\",\"espn-cric-info\",\"\");\n var picker = 0;\n picker=random(12);\n var n = ceil(picker);\n source = n_src[n];\n\n urla = api_a+source+sortBy+sortingValue+api_key_a;\n loadJSON(urla,gotData);\n\n }", "function getDataSlider() {\n fetch(slideUrl)\n .then(response => response.json())\n .then(data => {\n slide = data;\n\n data.data.map((item, index) => {\n sliderSpace.innerHTML += generateSlidesHTML(index, item);\n });\n\n //execute here because it's necessary wait fetch\n slides = document.querySelectorAll('.slider .slider-image');\n getDataProducts();\n });\n}", "async onLoadPage() {\n const fetch = await fetchApi(\"/products/\");\n this.setState({\n data: fetch.data.product\n });\n }", "async function fetchData() {\n const request = await axios.get(fetchUrl);\n setGames(request.data.results);\n return request;\n }", "function init() {\n getJSON(requestURL + `?nat=US&results=${employeeCount}`)\n .then(response => fetchedEmployees = response.results)\n .then(() => showGallery(fetchedEmployees))\n .catch(e => console.error('Error in fetch:', e));\n\n createModal();\n createSearch();\n}", "function fetchdata(){\n\n\timgToggle();\n req = new XMLHttpRequest();\n req.open(\"GET\",'https://contesttrackerapi.herokuapp.com/',true);\n req.send();\n req.onload = function(){\n\n imgToggle();\n \n res = JSON.parse(req.responseText);\n putdata(res);\n\n // cache creation\n localStorage.cache = req.responseText;\n\n };\n req.onerror = function(){\n imgToggle();\n if(localStorage.cache){\n localData = JSON.parse(localStorage.cache);\n putdata(localData);\n }\n\n };\n}", "async function fetchData() {\n const accounts = await web3.eth.getAccounts();\n setAddresses(accounts);\n setSelectedAddress(accounts[0]);\n accountService.setData(selectedAddress);\n }", "function init() {\n id(\"find-btn\").addEventListener(\"click\", getData);\n id(\"back-btn\").addEventListener(\"click\", goBack);\n fetch(URL_BASE)\n .then(checkStatus)\n .then(response => response.json())\n .then(addSelection)\n .catch(handleError);\n }", "async loadData(url) {\r\n let promise = await fetch(url)\r\n return promise;\r\n }", "async function doSomeDataFetching() {\n Timeout.set(2000)\n \n // Getting back data from the net, through the wire, air, and the ocean:\n const res = await axios.get(\"https://jsonplaceholder.typicode.com/posts?_limit=5\");\n \n console.log(\"Got back:\", res.data);\n setArticles(res.data);\n }", "function loadData() {\n myProductList.innerHTML = '';\n // Create a Promise in order to get all products\n makeHTTPRequest(backendUrl + productType).then(function onSuccess(resolved) {\n // Populate with products\n for (product of JSON.parse(resolved.responseText)) {\n addProductToList(product);\n }\n const waiterSpinner = document.getElementById('waiter');\n if (waiterSpinner != null) {\n waiterSpinner.remove();\n }\n completeLastRowOfProducts()\n }).catch(function onError(rejected) {\n const waiterSpinner = document.getElementById('waiter');\n if (waiterSpinner != null) {\n waiterSpinner.remove();\n }\n alert(myProductList, 'Oops, something went wrong. Please <strong>refresh</strong> the page!<br/>' + rejected.statusText);\n });\n}", "onCreatedHandler() {\n this.fetchData();\n }", "function pageInitalize(){\n\n articleContainer.empty();//Empties article container.//\n $.get(\"/api/headlines?saved=false\").then(function(data){//Runs AJAX request for unsaved\n if (data && data.length) {//Renders found headlines to the page.//\n renderArticles(data);\n }else{\n renderEmpty();//Renders no articles message.//\n }\n });\n }", "function fetch(url) {\n\n d3.select('.main').style('z-index', '-1');\n d3.select('.loading').style('display', 'block');\n\n d3.json(url, function(data) {\n\n candidates = candidates.concat(data['objects']);\n\n if (data['meta'] !== undefined) {\n if (data['meta']['next'] !== undefined) {\n if (data['meta']['next'] !== null) {\n next_url = BASE_URL + data['meta']['next'];\n fetch(next_url);\n } else {\n doneFetch();\n }\n } else {\n doneFetch();\n }\n } else {\n doneFetch();\n }\n });\n }", "function fetchData() {\n fetch('http://localhost:8080/recipe/get/Breakfast')\n .then(res => res.json())\n .then(json => addToBreakfastSelector(json))\n .catch(err => console.error(err));\n\n fetch('http://localhost:8080/recipe/get/Lunch')\n .then(res => res.json())\n .then(json => addToLunchSelector(json))\n .catch(err => console.error(err));\n\n fetch('http://localhost:8080/recipe/get/Dinner')\n .then(res => res.json())\n .then(json => addToDinnerSelector(json))\n .catch(err => console.error(err));\n}", "componentDidMount() {\n // Only fetch if no news in component's state\n if(!this.state.news) {\n News.requestInitialData().then(news => this.setState({ news }));\n }\n }", "static getDataFromURL(url) {\n $.ajax({\n type: 'GET',\n url: `${url}`,\n dataType: 'json',\n })\n .done((response) => {\n //%---Done() - If The Request Succses === No Error\n\n //%---Placing The Array Response To Array of all list coins in Coins class\n Coins.arrAllListOfCoins = response;\n\n //this function enable to some functions to build the 'main' page\n console.log(UI.startIndex);\n console.log(UI.endIndex);\n buildMainPage(UI.startIndex, UI.endIndex, UI.howManyCards);\n })\n //%---Fail() - If The Request Not Succses === Error\n .fail((err) => {\n console.log(err.responseText);\n });\n }", "async function fetchData() {\n const result = await fetch('/pets/categories');\n setPetCategories(result);\n setIsLoaded(true);\n }", "function initPage() {\n $.get('/api/headlines?saved=true').done((data) => {\n articleContainer.empty();\n\n if (data && data.length > 0) {\n renderArticles(data);\n\n // Activate tooltips for the action buttons.\n $('[data-toggle=\"tooltip\"]').tooltip();\n } else {\n renderEmpty();\n }\n });\n }", "async function fetchData() {\n const { data } = await dataProvider(GET_LIST, LANG_API, {\n pagination: {\n page: 1,\n perPage: 1000,\n },\n sort: {\n field: 'id',\n order: 'ASC',\n },\n skipPrefix: true,\n });\n\n setIsLoading(false);\n setLanguageList(data);\n }" ]
[ "0.7836573", "0.77522427", "0.7539224", "0.7150297", "0.70738596", "0.7062026", "0.7054877", "0.70489025", "0.6991692", "0.69897443", "0.6959671", "0.6943829", "0.69286376", "0.68694484", "0.6863396", "0.686015", "0.68112504", "0.6789645", "0.677177", "0.67689234", "0.67665887", "0.67586225", "0.67009735", "0.6698649", "0.6698649", "0.6697436", "0.66950524", "0.66837424", "0.66740155", "0.6642198", "0.66369057", "0.66253906", "0.66224635", "0.66090274", "0.66090274", "0.65932167", "0.65799373", "0.6576926", "0.65643424", "0.65632284", "0.6562246", "0.6561065", "0.653735", "0.65104216", "0.6505794", "0.6503326", "0.6503326", "0.6482864", "0.6477296", "0.6474922", "0.64734435", "0.6468758", "0.64664644", "0.6465776", "0.64587986", "0.6456307", "0.6452875", "0.6451144", "0.64470416", "0.6446409", "0.6439937", "0.6437657", "0.6434819", "0.64255375", "0.64057726", "0.63937926", "0.6381987", "0.6375578", "0.6368499", "0.6365826", "0.6357196", "0.6356823", "0.6353852", "0.6353572", "0.6345564", "0.63332695", "0.63255674", "0.63215137", "0.63085246", "0.63041806", "0.6298392", "0.62892795", "0.62831306", "0.6281778", "0.6266153", "0.626555", "0.62571", "0.62468666", "0.62458605", "0.6245112", "0.6236783", "0.6231472", "0.62314653", "0.6225823", "0.6221347", "0.6221212", "0.6208045", "0.6207864", "0.6207655", "0.6207612" ]
0.68008065
17
Event Handler for "Add Debt" onclick
handleAddRow(event) { this.showInputSection = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buttonBuyEvent() {\r\n sumAllMoney += Number($(this).text().match(/\\d+\\.\\d+/g)[0]);\r\n $('h1:eq(1)').text(`Total Store Profit: ${sumAllMoney} BGN`)\r\n $(this).parent().remove()\r\n }", "function addToCartEvent() {\n\t\t$(\"form.product_form .wpsc_buy_button\").click(function() {\n\n\t\t\tvar breakOut = false;\n\t\t\tvar selectedVariations = $(\"select.wpsc_select_variation option:selected\");\n\n\t\t\tselectedVariations.each(function() {\n\t\t\t\tif ($(this).val() === 0) {\n\t\t\t\t\tbreakOut = true;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif ($('.wpsc_buy_button').is(':disabled') === true) {\n\t\t\t\tbreakOut = true;\n\t\t\t}\n\n\t\t\tif (breakOut === false) {\n\n\t\t\t\t$(\".masterbar-goshop\").hide();\n\t\t\t\t$(\".masterbar-shoppingbag\").show();\n\n\t\t\t\tvar bagCount = parseInt($(\".masterbar-shoppingbag span\").html(),10);\n\t\t\t\tif(isNaN(parseInt($(\".masterbar-shoppingbag span\").html(),10))) { bagCount = 0; }\n\n\t\t\t\t$(\".masterbar-shoppingbag span\").html(bagCount + 1);\n\t\t\t\tbounceEffect('.masterbar-shoppingbag');\n\n\t\t\t\t$('.wpsc_buy_button_container input').val('Added to Shopping Bag!');\n\t\t\t\tbounceEffect('.wpsc_buy_button_container input');\n\n\t\t\t} else {\n\t\t\t\t$('.wpsc_buy_button').attr('disabled', 'disabled');\n\t\t\t}\n\t\t});\n\t}", "function handleAdd(){\r\n quantity.innerHTML = parseInt(quantity.innerHTML)+1;\r\n //enabling the \"agree\" button when there are more than 0 items\r\n agree.disabled = false;\r\n }", "function buyButtonClickHandler(evt) {\r\n\t evt.preventDefault();\r\n\t var id = product.selectedVariant.id;\r\n\t var quantity;\r\n\t var cartLineItem = findCartItemByVariantId(id);\r\n\r\n\t quantity = cartLineItem ? cartLineItem.quantity + 1 : 1;\r\n\r\n\t addOrUpdateVariant(product.selectedVariant, quantity);\r\n\t setPreviousFocusItem(evt.target);\r\n\t $('#checkout').focus();\r\n\t }", "OnClickPutMoneyIn() {\n this.setPopupTransaction(SessionConstant.POPUP_PUT_MONEY_IN);\n }", "function addItemOnClick(imgsrc, drinkname, price) {\n var add = document.getElementById('addToCartButton');\n\tadd.onclick = function(event) {\n\t\tif(event.target == add) {\n\t\t\t\tupdateOrder(imgsrc, drinkname, price);\n\t\t}\n\t}\n}", "function pressAddBtn() {\n helpers.save('json', data);\n window.addEventListener('keydown', closeByPressEsc);\n\n sidebarHeaderMarkup();\n sidebar.classList.add('expanded');\n overlay.classList.add('overlay');\n\n cartQuantityMarkup();\n}", "function onAddDollarClicked(e) {\n // stop the browser from reloading the page\n e.preventDefault();\n moneyIn += 1;\n/* toFixed(2) - Returns a string representing a number in fixed-point notation.\n@param fractionDigits — Number of digits after the decimal point. */ \n updateMoney(moneyIn.toFixed(2));\n}", "function beerPlusButton() {\n\t$('.plussign').click(function(event) {\n\t\tvar eventId = event.target.id;\n\t\tfor(var i = 0; i < beer.length; i++) {\n\t\t\tif(eventId == 'addplus' + i) {\n\t\t\t\tvar imgsrc = document.getElementById('drink-img').src = document.getElementById('detailpic' + i).src;\n\t\t\t\tvar drinkname = document.getElementById('drink-name').innerHTML = document.getElementById('drink' + i).innerHTML;\n\t\t\t\tvar price = document.getElementById('drink-price').innerHTML = document.getElementById('pricetag' + i).innerHTML;\n\t\t\t\tdocument.getElementById('drink-country').innerHTML = document.getElementById('country' + i).innerHTML;\n\t\t\t\tdocument.getElementById('drink-description').innerHTML = document.getElementById('desc' + i).innerHTML;\n\t\t\t\tupdateOrder(imgsrc, drinkname, price);\n\t\t\t}\n\t\t}\t\t\n\t});\n}", "function wTorrentClick() { wTorrentAdd(this.id,false); }", "function addToCartClicked(e){\n const button = e.target;\n const item = button.closest(\".detalle__compra\");\n const itemPrecio = Number(item.querySelector(\".precio\").textContent.replace(\"$\",\"\"));\n const itemProdId = Number(item.querySelector(\".idProdCarrito\").textContent);\n const precios = item.querySelector(\"#precios\");\n const cantidad = item.querySelector(\"#cantidad\");\n itemCantidad= Number(cantidad.value)+1;\n cantidad.value = itemCantidad;\n nuevasub = nuevasub +itemPrecio;\n sumaItem(itemProdId,itemCantidad);\n precios.innerHTML = `<p>\n $${cantidad.value * itemPrecio}\n </p>`\n subTotal.innerHTML = `<h3>Subtotal</h3>\n <p>$${nuevasub}</p>`\n total.innerHTML = `<h2>Total</h2>\n <p>$${nuevasub}</p>`\n}", "function add_ticket_button(configPass){\n\t$('a.add_ticket_button').on('touchstart click', function(e){\n\t\te.preventDefault();\n\t\t$('body').empty().addClass('spinner');\t\t\n\t\t\tSherpaDesk.addTicket(configPass);\t\n\t\t});\n\t\t\n\t}", "OnClickTakeMoneyOut() {\n this.setPopupTransaction(SessionConstant.POPUP_TAKE_MONEY_OUT);\n }", "function bookBtnClick(btn_id, title, qty) {\n if(isLogged) {\n postAddToCart(btn_id, qty)\n swal(title, \"is added to cart !\", \"success\");\n }\n else {\n window.location.href = \"../register.html\"\n }\n}", "onAddClicked() {\n console.log('clicked');\n }", "function click_money_incrementation(money, _values) {\r\n data.inventory.money += money * data.inventory.multiplier;\r\n Save();\r\n Attribtion();\r\n update_dom();\r\n}", "function init() {\n let submitButton = document.getElementById('newBudgetButton');\n submitButton.onclick = balanceBudget;\n}", "function ClickGerarComum() {\n GeraComum();\n AtualizaGeral();\n}", "function handleClickingAddToCart() {\r\n event.preventDefault();\r\n let index = parseInt(event.target.id);\r\n accessoriesCart.addAccessory(accessoriesArr[index]);\r\n accessoriesCart.saveToStorage();\r\n\r\n\r\n\r\n window.createNotification({\r\n // close on click\r\n closeOnClick: true,\r\n\r\n // displays close button\r\n displayCloseButton: false,\r\n\r\n // nfc-top-left\r\n // nfc-bottom-right\r\n // nfc-bottom-left\r\n positionClass: 'nfc-top-right',\r\n\r\n // callback\r\n onclick: false,\r\n\r\n // timeout in milliseconds\r\n showDuration: 3500,\r\n\r\n // success, info, warning, error, and none\r\n theme: 'success'\r\n\r\n })({\r\n title: \"Success\",\r\n message: \"Item added\"\r\n });\r\n counter();\r\n\r\n}", "function onClick(event) {\n $(\".alert\").alert()\n var input = this.parentNode.parentNode.children[1]\n var max = parseInt(input.max.replace(/\\D/g, ''), 10);\n\n var qty = parseInt(input.value.replace(/\\D/g, ''), 10);\n if (isNaN(qty)) {\n qty = 0;\n }\n // click event\n var dataType = this.getAttribute('data-type');\n if (dataType === \"minus\") {\n if (qty > 0) {\n qty = qty - 1;\n }\n } else if (dataType === \"plus\") {\n if (max) {\n if (qty < max) {\n qty = qty + 1;\n } else {\n qty = qty;\n $(\"#flash-message\").html('We only have ' + max + ' of this item in stock.');\n $(\"#flash-message\").fadeIn();\n closeFlashMessage();\n }\n } else {\n qty = qty + 1;\n }\n }\n\n // handle zero values\n if (qty === 0) {\n input.value = ''\n } else {\n input.value = qty;\n }\n}", "function quantityChangedplus(event) {\r\n var purchaseClicked = event.target\r\n purchaseClicked.previousElementSibling.value = Number(purchaseClicked.previousElementSibling.value) + 1\r\n updateCartTotal()\r\n}", "function quantityChangedminus(event) {\r\n var purchaseClicked = event.target\r\n if(purchaseClicked.nextElementSibling.value >1)\r\n purchaseClicked.nextElementSibling.value = Number(purchaseClicked.nextElementSibling.value) - 1\r\n else\r\n purchaseClicked.nextElementSibling.value = 1\r\n updateCartTotal()\r\n }", "function defaultServiceCost(defaultCostBtn) {\n document.getElementById(defaultCostBtn).addEventListener('click', function () {\n const costName = defaultCostBtn.split('-')[1];\n const costString = costName + '-cost';\n document.getElementById(costString).innerText = 0;\n finalTotalAmount();\n });\n}", "function btnAddClick() {\n addItem(); \n}", "function remove(){\nremove_btn();\nquant();\ncalculate_total();\n}", "function depositeWithdraw (getId,newAmount) {\n // add new deposite to previous deposite\n var previous = document.getElementById(getId);\n var previousAmountText = previous.innerText;\n var previousAmount = parseFloat(previousAmountText);\n // total deposite\n var total = newAmount + previousAmount;\n previous.innerText = total;\n}", "function addEventHandlersOnDetails() {\n var amount = 1;\n $(\".cancel\").click(hideItemDetails);\n //Handlers conserning the amount chosen.\n // due to a custom spinner for the number input we override the step functions\n $(\".itemDetailCardAmount #up\").click(function () {\n $(\".itemDetailCardAmount input\").change();\n });\n\n $(\".itemDetailCardAmount #down\").click(function () {\n $(\".itemDetailCardAmount input\").change();\n });\n\n $(\".itemDetailCardAmount input\").change(function () {\n\n amount = parseInt($(this).val());\n var total = calculatePrice(amount, detailedItem.itemData.timi);\n\n $(\".itemDetailContent .itemCardPrice\").text(`${total} €`);\n\n });\n\n //Add to cart handler\n \n $(\".cart\").off(\"click\").one(\"click\", (event) => {\n event.stopPropagation();\n\n //console.log(`ADDED ON CART! ${detailedItem.item} with amount ${amount}`);\n\n cart.push({\n cartItemObj: detailedItem,\n amount: amount\n });\n\n amount = 1;\n // var itemRowElement = detailedItem.createItemRow();\n // $(\".table-body\").append(itemRowElement);\n\n if (cart.length == 1) {\n $(\".badge\").show();\n }\n $(\".badge\").text(cart.length);\n // $(\".cart\").attr(\"class\",\"fas fa-check-circle cart\");\n $(\".cart\").text(\"In Cart!\").attr(\"disabled\", true);\n $(\".cart\").addClass(\"disabled\").removeClass(\"enabled\");\n\n displayAlert(\"Item added to Cart!\")\n event.preventDefault();\n });\n}", "function plusShop() {\n quantity++;\n document.getElementById(\"textQuantity\").value = quantity;\n if (quantity > 1) {\n document.querySelector(\"#buttonMinus\").removeAttribute(\"disabled\");\n\n }\n totalPriceFun();\n}", "function winePlusButton() {\n\t$('.plussign').click(function(event) {\n\t\t\tvar eventId = event.target.id;\n\t\t\tfor(var i = 0; i < wine.length; i++) {\n\t\t\t\tif(eventId == 'addplus' + i) {\n\t\t\t\t\tvar imgsrc = document.getElementById('drink-img').src = document.getElementById('detailpic' + i).src;\n\t\t\t\t\tvar drinkname = document.getElementById('drink-name').innerHTML = document.getElementById('drink' + i).innerHTML;\n\t\t\t\t\tvar price = document.getElementById('drink-price').innerHTML = document.getElementById('pricetag' + i).innerHTML;\n\t\t\t\t\tdocument.getElementById('drink-country').innerHTML = document.getElementById('country' + i).innerHTML;\n\t\t\t\t\tdocument.getElementById('drink-description').innerHTML = document.getElementById('desc' + i).innerHTML;\n\t\t\t\t\tupdateOrder(imgsrc, drinkname, price);\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t});\n}", "function alertAddCancel(){\r\n\t$(\"#btContener\").prepend(\"<a href='javascript:void(0);' id='alertBtCancel' onclick='alertRemove();'>\"+msg_txt['cancel']+\"</a>\");\r\n}", "function adder3(id){\r\r\n ////obtenemos el numero actual\r\r\n $(\"#finaliza\").attr('disabled','true');\r\r\n var addItems = $(\"#eitem\"+id).val();\r\r\n if(addItems<50){\r\r\n addItems++;\r\r\n $(\"#eitem\"+id).val(addItems);\r\r\n }\r\r\n /////actualizamos el carrito\r\r\n var price = $(\"#eprice\"+id).val();\r\r\n addtoCart(id,price,'generic');\r\r\n\r\r\n location.reload();\r\r\n}", "function setPaiementCb(){ \n\t\tjQuery('.payer').click(function(e) {\n\t\t\t// Open Checkout with further options:\n\t\t\thandler.open({\n\t\t\t\tname: 'SpamTonProf',\n\t\t\t\tdescription: 'Abonnement de '.concat(montant,' € par semaine'),\n\t\t\t\tzipCode: false,\n\t\t\t\tamount: montant*100,\n\t\t\t\temail : emailCheckout,\n\t\t\t\tcurrency: 'EUR'\n\t\t\t});\n\t\t\te.preventDefault();\n\t\t});\n\t}", "function AddCoupon(linkID, txtID, IDQuota) {\n //Verifico che il coupon non sia in attesa\n var objHid = document.getElementById(sHidAttesa);\n if (objHid.value != 0) return;\n\n var link = document.getElementById(linkID);\n var txt = document.getElementById(txtID);\n\n txt.value = IDQuota;\n link.click();\n}", "function onClickActionBuyItem(){\n\t\tconst itemlist = CashShop.cartItem;\n\t\tCashShop.cartItemLen = itemlist.length;\n\n\t\tCashShop.ui.find('#purchase-btn').prop('disabled', true);\n\t\tUIManager.showPromptBox( 'Are you sure you want to buy this items?', 'ok', 'cancel', function(){\n\t\t\tif(CashShop.cartItem.length > 0){\n\t\t\t\tvar pkt \t= new PACKET.CZ.SE_PC_BUY_CASHITEM_LIST();\n\t\t\t\tpkt.kafraPoints \t= 0;\n\t\t\t\tpkt.item_list \t\t= CashShop.cartItem;\n\t\t\t\tNetwork.sendPacket(pkt);\n\t\t\t} else {\n\t\t\t\tUIManager.showMessageBox( 'No item in cart!', 'ok');\n\t\t\t\tChatBox.addText( 'No item in cart!', ChatBox.TYPE.INFO);\n\t\t\t\tCashShop.ui.find('#purchase-btn').prop('disabled', false);\n\t\t\t}\n\t\t}, function(){\n\t\t\tCashShop.ui.find('#purchase-btn').prop('disabled', false);\n\t\t});\n\t}", "function buyerInstruct(){\n alert(\"Click on the button to see what is available\")\n}", "function handleAddNewStockButton() {\n $('#stockIdDiv').addClass('d-none')\n $('.modal-title').text(\"Добавить новую акцию\")\n stockModalClearFields()\n}", "function AddAsync(IDQuota) {\n //Verifico che il coupon non sia in attesa\n var objHid = $('#' + sHidAttesa);\n if (objHid.val() != 0) return;\n\n var link = $('#' + sCPbtn);\n var txt = $('#' + sCPqt);\n\n txt.val(IDQuota);\n link.click();\n}", "function trade201() {\n\t$(\".choice-books\").children().remove();\n\t$(\".more-info\").children(\"button\").remove();\n\t/* A success message is appended and displayed to the user. */\n\t$(\".choice-books\").append('<p style=\"width: 100%;\">Your request has been placed successfully.</p>' +\n\t\t'<p style=\"width: 100%;\">You can check your request status from the dashboard</p>' + \n\t\t'<button class=\"cancel-button\">Close</button>');\n\tcancelButtonClick();\n}", "function zeroListener(){\n document.getElementById(\"0\").addEventListener('click', addItemZero);\n}", "function addNum(obj) {\r\n let $cartlist = $('#myList');\r\n let value = $(obj).next().val(); \r\n let idCart = $(obj).parents('div[class=items]').attr('id')+'Cart'; \r\n value++;\r\n \r\n if(value==1) {\r\n $itemInCart = $(obj).parents('div[class=items]').clone(true);\r\n $itemInCart.attr('id',idCart).attr('class','itemsCart');\r\n //Add onclick property\r\n $itemInCart.find(\"button:first\").attr('onclick','addCartNum(this)');\r\n $itemInCart.find(\"button:last\").attr('onclick','minusCartNum(this)');\r\n $cartlist.append($itemInCart);\r\n addKeyupToCart();\r\n }\r\n \r\n $(obj).next().val(value);\r\n $itemInCart = $('div#'+idCart);\r\n $itemInCart.find('input#num').val(value); \r\n showSumma();\r\n \r\n}", "function onClickAdd(ev) {\n ev.preventDefault();\n\n const name = inputFields[0].value;\n const hall = inputFields[1].value;\n const ticketPrice = Number(inputFields[2].value);\n if (!name || !hall || !ticketPrice) {\n return;\n }\n\n function createMovie() {\n const ticketsSold = document.createElement('input');\n ticketsSold.placeholder = 'Tickets Sold';\n const button = el('button', 'Archive');\n button.addEventListener('click', e => onClickArchive(e, name, ticketPrice, ticketsSold));\n return el('li',\n el('span', name),\n el('strong', 'Hall: ' + hall),\n el('div',\n el('strong', ticketPrice.toFixed(2)),\n ticketsSold,\n button,\n )\n );\n }\n\n onScreen.appendChild(createMovie());\n inputFields.forEach(e => e.value = '');\n }", "function eventHandlerForCartButton() {\n $(\"#verCarritoBtn\").click(() => {\n $(\"#cart-total\").text(`$${cart.cartTotal()}`);\n $(\".cart-modal\").fadeIn();\n });\n}", "function AddNew() {\n debugger;\n Resetform();\n openNav();\n ChangeButtonPatchView('DepositAndWithdrawals', 'btnPatchAdd', 'AddSubIncoming');\n\n\n}", "function _clickDownButtonEvent(e){\n\t\tvar $qtyInputField = $(e.target).parent().next().find(\"input\");\n\t\tvar picQtyString = $qtyInputField.val();\n\t\tif(picQtyString == '')\n\t\t\t$qtyInputField.val('1');\n\t\telse\n\t\t{\n\t\t\tvar picQty = parseInt(picQtyString);\n\t\t\tif(picQty>1) picQty--;\n\t\t\t$qtyInputField.val(picQty);\n\t\t}\n\t}", "function addAmount(id, inputAmount) {\r\n\r\n let updateField = document.getElementById(id);\r\n let updateFieldValueStr = updateField.innerText;\r\n let updateFieldValue = parseInt(updateFieldValueStr);\r\n // sum of deposite\r\n let total = updateFieldValue + inputAmount;\r\n\r\n // update deposite\r\n updateField.innerText = total;\r\n}", "function activateDetailButton(numDebts){\n\tfor (var i = 1; i <= numDebts; i++){\n\t\tvar btnID = 'detailDebt';\n\t\tvar btnID = btnID.concat(i);\n\t\tvar btnLoc = document.getElementById(btnID);\n\t\tbtnLoc.addEventListener('click', openModal, false);\n\t}\n}", "function removeOne(){\n $('#selected_seats_table_body').find('td').find('.removeOne').on(\"click\", function(){\n setTimeout(function(){\n\n if($('#selected_seats_table_body').find('tr').length != 0){\n // if we have a selected seat\n $('.price-info-block').fadeOut(\"fast\");\n\n var totalPrice = $('#ticket_note').find('.selected-seat-price').html();\n\n if($(\".pay-btn-control\").length != 0){\n $(\".pay-btn-control\").find('button').html(\"\");\n $(\".pay-btn-control\").find('button').html(_tr_.pay + \" (\"+totalPrice+\" \"+_tr_.currency+\")\");\n }else {\n $(\"<div class='pay-btn-control'>\" +\n \"<button id='purchase'>\" +_tr_.pay+ \" (\" +\n totalPrice +\n _tr_.currency+ \" )\" +\n \"</button>\" +\n \"</div>\").insertAfter(\".selected-seats\");\n }\n }else {\n // if don't have a seat selected\n $('.price-info-block').fadeIn(\"fast\");\n $('.pay-btn-control').fadeOut(\"slow\");\n }\n },50);\n });\n }", "function addAction() {\n\t\t\t\t\t\t\t// if (window.confirm(\"Add this book to your collection?\")) {\n\t\t\t\t\t\t\t\tlet bound = this;\n\t\t\t\t\t\t\t\tbound.innerHTML = \"Please Wait...\";\n\t\t\t\t\t\t\t\tbound.setAttribute(\"style\", \"background-color:grey;\");\n\t\t\t\t\t\t\t\tajaxFunctions.ready(ajaxFunctions.ajaxRequest('POST', addLink, 8000, function (err, data, status) {\n\t\t\t\t\t\t\t\t\tif (err) { console.log(err); bound.innerHTML = \"Error\"; }\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t//handle the server response\n\t\t\t\t\t\t\t\t\t\tbound.setAttribute(\"style\", \"background-color:green;\");\n\t\t\t\t\t\t\t\t\t\tbound.innerHTML = \"Added\";\n\t\t\t\t\t\t\t\t\t\t// console.log(data);\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// }//alert box\n\t\t\t\t\t\t}//addAction\t", "function onclick_add_new_task() {\n insertNewTask();\n}", "function addItemToEbay() {\r\n addToEbay.value = '1';\r\n }", "function addButtonListener() {\n $(\".remove-button\").click(removeItemFromCart);\n $(\".minusButton\").click(removeOneItemFromCart);\n $(\".plusButton\").click(addOneItemToCart);\n}", "function addTransactionFunc(e) {\n e.preventDefault();\n if (itemNameInput.value.trim() == '' || itemAmountInput.value.trim() == '') {\n alert('Please Fill Text and Amount Field');\n } else {\n let transaction = {\n id: randomId(),\n text: itemNameInput.value,\n amount: Number(itemAmountInput.value),\n };\n transactions.push(transaction);\n addToDom(transaction);\n updateBalance(transaction);\n itemNameInput.value = '';\n itemAmountInput.value = '';\n }\n}", "function onAddButtonClick(ev) {\n var valueToAdd = textBoxAddControls.value;\n textBoxAddControls.value = \"\";\n addTextStrong.innerHTML = valueToAdd;\n resultList.appendChild(listItems.cloneNode(true));\n }", "function button_total() {\r\n\t\tvar button_no = document.getElementById(\"btnbadge\").value;\r\n\t\t\r\n\t\tbadgNumber = parseInt(button_no);\r\n\t\t\t\t//alert(\"in button_total - badgNumber \" + badgNumber);\r\n\t\tvar button_text = document.getElementById(\"btn_label\").textContent;\r\n\t\t//alert( \"in button_total button_text is \" + button_text);\r\n\t\t//alert(\"button_text \" + button_text);\r\n\r\n\t\tupdateButtonBasket(badgNumber, button_text);\r\n\t\tsetCookie(\"button_total\", badgNumber,1);\r\n\t\t//updateDisplayMerch();\t\r\n\t\t//alert(\"go to updateButtonBasket\");\r\n\t}", "function buttonMoveEvent(e) {\r\n let getPrice = $(this).prev().text().match(/\\d+\\.\\d+/g)[0]\r\n $(this).prev().text(`Buy it only for ${(getPrice * 0.85).toFixed(2)} BGN`)\r\n $oldBooksSection.append($(this).parent())\r\n $(this).remove()\r\n }", "function createQuote(e) {\n var clickedButtonId = e.srcElement.id;\n\n if (clickedButtonId == \"submit\") {\n var total = 0;\n var orderSummary = \"\";\n\n for (let i=0; i< orderList.length; i++) {\n var x = orderList[i];\n\n //To fix formatting of bools\n if (listOfProducts[x].newRelease == true) {\n listOfProducts[x].newRelease = \"Yes\";\n }\n else {\n listOfProducts[x].newRelease = \"No\";\n }\n //Create order summary\n orderSummary += \"Product: \" + listOfProducts[x].productName + \"\\n\" +\n \"New Release: \" + listOfProducts[x].newRelease + \"\\n\" +\n \"Type: \" + listOfProducts[x].productType + \"\\n\" +\n \"Price: $\" + listOfProducts[x].productPrice.toFixed(2) + \"\\n\\n\";\n\n total += listOfProducts[x].productPrice;\n }\n alert(orderSummary + \"\\n\" + \"Total: $\" + total.toFixed(2));\n }\n}", "function updateBudget(event) {\n event.preventDefault();\n console.log(\"updateBudget fired!\");\n monthlyIncome = parseInt(incomeInput.value); // parse string to number\n monthlyBudget.innerText = \"$\" + monthlyIncome;\n updateBalance(); \n}", "onBtnNewClick() {\n\t\tthis.changeTripReportMode('add');\n\t}", "function addTransaction(e) {\n e.preventDefault();\n\n if( description.value.trim() === '' || amount.value.trim() === '' ) {\n alert('Please enter a valid description and transaction amount.')\n } else {\n const transaction = {\n id: generateID(),\n description: description.value,\n amount: +amount.value\n };\n \n transactions.push(transaction);\n\n addTransactionUI(transaction);\n updateSums();\n\n description.value = '';\n amount.value = '';\n }\n}", "function onClickArchive(ev, name, price, ticketsSold) {\n const sold = Number(ticketsSold.value);\n if(!sold){\n return;\n }\n\n function createArchive() {\n const button = el('button', 'Delete');\n button.addEventListener('click', () => {\n liElement.remove();\n })\n const liElement = el('li',\n el('span', name),\n el('strong', 'Total amount: ' + (sold * price).toFixed(2)),\n button\n );\n return liElement;\n }\n\n archived.appendChild(createArchive());\n ev.target.parentElement.parentElement.remove();\n }", "function onClickAddFood(foodcode){\n\tdocument.getElementById('addfoodbutton').disabled = true;\n // document.getElementById('requestButton').disabled = true;\n document.getElementById('clearButton').disabled = true;\n if(controlFoodCodeFormat(foodcode)){\n \tdocument.getElementById('foodcodeform').submit(); \t\n }\n else\n \t{\n \talert(\"Il codice del cibo deve iniziare con 'f' e contenere 3 numeri\");\n \t}\n document.getElementById('foodcode-dropdown').value = \"\";\n}", "function clicked(item) {\n var btnId = $(item).attr(\"id\");\n addToCart(btnId)\n}", "addExpense(expense) {}", "onAddButtonClick(fn) { this.onAddButtonClickFn = fn }", "function addSpent() {\n var player = GM_getValue(\"currentPlayer\",\"\");\n if (player==\"\")\n return;\n var selected = prompt(\"Add another cost as of now (no commas):\\n\", \"0\");\n if (selected!=null) {\n var d = new Date();\n var newamt = parseInt(selected);\n if (newamt>0) {\n var sumlist = retrieveSumlist(player);\n sumlist[sumlist.length] = {date:d,amt:newamt,desc:'thing?',store:''};\n storeSumlist(player,sumlist);\n window.location.reload();\n }\n }\n}", "handleBuyPress() {\n\n }", "function addToDoItem(){\n\t//alert (\"The Add button was clicked\");\n\tvar itemText = toDoEntryBox.value;\n\tnewToDoItem(itemText, false);\n\t//Since a new to-do item is never complete, you can \n\t// pass false to the completed parameter of the newToDoItem function.\n}", "function Add_enevt_to_our_buttons(zz){\n var First_li = document.getElementById(zz);\n \n var first_div = First_li.querySelector('div');\n var list_of_buttons = first_div.getElementsByTagName(\"button\");\n list_of_buttons[1].addEventListener('click' ,ApproveTachFinished );\n list_of_buttons[0].addEventListener('click',delet);\n list_of_buttons[2].addEventListener('click' , Modification);\n }", "function buttonOnclick () {\ncart.forEach(function (result,i) {\n\t// On définit les variables button_minus/plus0, 1, 2...\n\tlet button_minusi='button_minus'+i; \n\tlet button_plusi='button_plus'+i;\n\tlet button_removei=\"button_remove\"+i;\n\t// Appel de la fonction qui décrémente la quantité (minus) sur click\n\tdocument.getElementById(button_minusi).addEventListener(\"click\",quantityCham);\n\tfunction quantityCham() {\n\t\tquantityChange(i,'minus');\n\t}\n\t// Appel de la fonction qui incrémente la quantité (plus) sur click\n\tdocument.getElementById(button_plusi).addEventListener(\"click\",quantityChap);\n\tfunction quantityChap() {\n\t\tquantityChange(i,'plus');\n\t}\n\t// Appel de la fonction qui supprime le produit sur click\n\tdocument.getElementById(button_removei).addEventListener(\"click\",removeIte);\n\tfunction removeIte() {\n\t\tremoveItem(i);\n\t}\n});}", "function handleClickBookNow() {\n const finalTotal = document.getElementById('final-total');\n grandTotal = finalTotal.innerText;\n if (grandTotal === '00' || grandTotal === '0') {\n alert(\"You have not select any ticket\");\n } \n else {\n bookNow = document.getElementById('book-now');\n bookNow.innerText = \"Booking Confirmed\";\n bookNow.style.backgroundColor = \"green\";\n displayNone(\"first-count\");\n displayNone(\"economy-count\");\n displayNone(\"operator\");\n displayNone(\"operator-2\");\n displayBlock(\"show-first\");\n displayBlock(\"show-economy\");\n disableInput();\n }\n}", "function deal() {\n\tconsole.log(\"deal()\");\n\n\tdocument.getElementById(\"user_msg\").innerHTML = \"Your cards total \" + your_sum + \". <br>The dealer is showing \" + dealer_card_1 + \".\";\n\tactiondiv.appendChild(hit_button);\n\tactiondiv.appendChild(stay_button);\n\n\tconsole.log(\"Dealer sum is \" + dealer_sum);\n\thit_button.onclick = hit;\n\tstay_button.onclick = hit_dealer;\n}", "function buttonPress(clickId,displayId,number){\n const clickBtn= document.getElementById(clickId);\n clickBtn.addEventListener(\"click\", function(){\n document.getElementById(displayId).value+=\n number;\n})\n}", "function addExpense(event) {\n console.log(\"addExpense fired!\");\n event.preventDefault();\n let name = nameInput.value;\n let amount = parseInt(amountInput.value);\n let expense = {\n name: name,\n amount: amount\n };\n expenses.push(expense);\n // Add the new expense to the app\n let newExpense = document.createElement(\"p\");\n newExpense.innerText = expense.name + \": $\" + expense.amount;\n expenseList.appendChild(newExpense);\n updateExpenseTotal();\n}", "function htmlTransactionAddButton() {\r\n // First, get all the values from the input fields\r\n let name = document.getElementById('name').value;\r\n let date = document.getElementById('date').value;\r\n let amount = document.getElementById('amount').value;\r\n let category = document.getElementById('category').value;\r\n let type = document.getElementById('type').value;\r\n\r\n // check that amount is a positive number (even if it was expense)\r\n if(!checkAmountInput(amount)){\r\n // Show an error message if the amount is not accepted\r\n document.getElementById('amountcheck').style.display = 'block';\r\n return; // exit the function since the amount value was not accepted\r\n }\r\n // Make sure the error message for the amount input is removed if accepted\r\n document.getElementById('amountcheck').style.display = 'none';\r\n\r\n // If the date input was empty, default to today's date\r\n if (date === '') {\r\n const today = new Date();\r\n const day = today.getDate() < 10 ? '0' + today.getDate(): today.getDate();\r\n const month = today.getMonth() < 10 ?\r\n '0' + (today.getMonth()+1) : (today.getMonth()+1);\r\n date = today.getFullYear() + '-' + month + '-' + day;\r\n }\r\n /* If the name input was empty, default to 'Unnamed transaction', else\r\n clean the name first */\r\n name = name === '' ? 'Unnamed transaction' : cleanTextInput(name);\r\n // TODO: more input error checking for the name. Strip away HTML\r\n\r\n /* test code:\r\n console.log(name +\"|\"+ date +\"|\"+ amount +\"|\"+ category +\"|\"+ type);*/\r\n // If all values are good, create and add a new transaction to the account\r\n const transaction = new Transaction(budget.assignTransactionID(),\r\n name, date, amount, category, type);\r\n account.addTransaction(transaction);\r\n\r\n // re-analyze the account's transactions then redraw the results\r\n account.analyzeAccount();\r\n draw(account);\r\n drawLineChart(); // Redaw the line chart using the new data\r\n\r\n // Add the transaction to the transaction HTML table.\r\n addToTable(transaction);\r\n\r\n // Reset the input fields\r\n restTransactionInputFields();\r\n\r\n // Save the current budget instance to Local Storage\r\n budget.saveToStorage();\r\n}", "function addAddOnToCart(sAddOnId) {\n //get the amount of the addon that the user wanted to ass\n let nAddOnAmount = document.querySelector(\n \".addon-form__input_\" + sAddOnId\n ).value;\n\n //check if it is a number if it isn't let the user know\n if (isNaN(parseInt(nAddOnAmount))) {\n showMessage(\"Please input a number\", true);\n } else {\n nAddOnAmount = parseInt(nAddOnAmount);\n\n //contact the api to add the addon to the cart in the backend\n postData(\"api/add-addon-to-cart.php\", {\n addOnId: sAddOnId,\n addOnAmount: nAddOnAmount,\n }).then((jResponse) => {\n if (jResponse.itemAddedToCart) {\n showMessage(\"Addon added to cart succesfully\", false);\n //update the cart counter in the frontend\n updateCartCounter(false, nAddOnAmount, true);\n }\n });\n }\n}", "function updatePanel( panel, debt ) {\n\tpanel.find( \".debt\").text( debt );\n}", "function ClickGerarAleatorioComum() {\n GeraAleatorioComum();\n AtualizaGeral();\n}", "function initDeleteNoticeButton() {\n\t\t\tvar $button, toolbar, $mytoolsLI, $customizeLI;\n\t\t\t\n\t\t\t// don't create duplicate buttons\n\t\t\tif (document.getElementById(\"mark-for-deletion-link\") !== null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// create button\n\t\t\t$button = $('&nbsp;<a id=\"fsk-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">FSK</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"FSK\";\n\t\t\t\tif (typeof window.MarkForDeletion === \"object\" && window.MarkForDeletion !== null && typeof window.MarkForDeletion.promptedDeleteReason === \"string\") {\n\t\t\t\t\tpromptedDeleteReason = window.MarkForDeletion.promptedDeleteReason;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar deleteReason = window.prompt(\"FSK der Geschichte angeben. Mögliche Eingaben:\\n0, 6, 8, 12, 16, 18\", promptedDeleteReason);\n\t\t\t\t\n\t\t\t\tif (typeof deleteReason === \"string\" && deleteReason.length > 0) {\n\t\t\t\t\tsetDeleteNotice(deleteReason);\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\t// add button to toolbar\n$($button).appendTo('#organisationsbox');\n\t\t}", "function ClickAdicionarEscudo() {\n gEntradas.escudos.push({ chave: 'nenhum', obra_prima: false, bonus: 0 });\n AtualizaGeralSemLerEntradas();\n}", "function addAddButton(itemNo) { \t\t\t\t\t\t\t\t\t// itemNo targets specific list item\n\t\tvar addBut = document.createElement(\"img\");\t\t\t\t\t\t// create element\n\t\taddBut.name = \"addBut\" + itemNo;\t\t\t\t\t\t\t\t// fill in element details\n\t\taddBut.src = \"https://raw.github.com/WhatTheFunkNGC/colabhang/master/lister/img/addBtn.jpg\";\n\t\taddBut.width = 25;\n\t\taddBut.height = 25;\n\t\taddBut.align = \"top\";\n\t\taddBut.onclick = function() { \t\t\t\t\t\t\t\t\t// on click calls remove function with param targeting the specific line\n\t\t\t\tconsole.log(\"Add Press\");\n\t\t\t\tvar listL = (parseInt(itemNo, 10) + 1).toString(); \t\t// gets targets below current for new element\n\t\t\t\taddNewItemToList (\"listTxt\",listL); \t\t\t\t\t// adds blank list element below selected element\n\t\t}; \n\t\treturn addBut;\t\t\t\t\t\t\t\t\t\t\t\t\t// return button element\n\t}", "function addProductEvent(product) {\n // Creation de l'objet \"bouton\"\n let buttonElt = document.querySelector('#add-to-cart');\n // Appel des fonctions au clic du \"bouton\"\n buttonElt.addEventListener('click', () => {\n cartNumbers();\n addItem(product);\n totalCost(product);\n });\n}", "function items (whichBtnBuy, whichBtnSell, buyPrice, sellPrice, hMWhat, nWhat)\r\n{\r\n whichBtnBuy.addEventListener('click', function ()\r\n {\r\n\r\n if (budged >= buyPrice) {\r\n\r\n budgedNumber.textContent = budged = budged - buyPrice;\r\n hMWhat.textContent = nWhat = nWhat + 1;\r\n whichBtnBuy.style.color = \"none\";\r\n }\r\n\r\n lessThanBudget()\r\n\r\n });\r\n\r\n whichBtnSell.addEventListener('click', function ()\r\n {\r\n\r\n if (nWhat > 0 ) {\r\n\r\n budgedNumber.textContent = budged = budged + sellPrice;\r\n hMWhat.textContent = nWhat = nWhat - 1;\r\n }\r\n\r\n lessThanBudget()\r\n\r\n });\r\n\r\n}", "function addNewPendingItem(label) {\n document.querySelector('.pending-items')\n .insertAdjacentHTML('afterbegin', newPendingItemHTML(label));\n \n // Add EventListeners to New Pending Items:\n let trashButton = document.querySelector('.pending-items>li>.btn-delete-item')\n trashButton.addEventListener('click', (event) => {\n event.currentTarget.parentElement.remove()\n });\n let checkBox = document.querySelector('.pending-items>li>.checkbox')\n checkBox.addEventListener('change', (event) => {\n if (checkBox.checked == true) {\n moveToCompleted(event)\n }\n })\n pendingNote();\n completedNote();\n \n}", "function moneyClick(number) {\n money = money + number;\n document.getElementById(\"Money\").innerHTML = money;\n}", "function addToTransfer(){\n let expenseName_value = expenseName.value;\n let amount_value = amount.value;\n let type_value = type.value;\n\n if (expenseName_value.length === 0 || amount_value.length === 0 || type_value.length === 0){\n alert('Fill in the details first!')\n }else{\n count += 1;\n myTransferObject = {\n 'id': '#' + count,\n 'name': expenseName_value,\n 'type': type_value,\n 'amount': amount_value,\n }\n\n appendToTransfer(myTransferObject);\n expenseName.value = '';\n amount.value = '';\n type.value = '';\n\n cookie_data[String (myTransferObject.id)] = myTransferObject;\n calculate_total();\n cookie_edit();\n }\n}", "function handleButClick(ctlsref) {\n\tvar str = serializeDpchAppDo(srcdoc, \"DpchAppDlgIdecTouNewDo\", scrJref, ctlsref + \"Click\");\n\tsendReq(str, doc, handleDpchAppDataDoReply);\n}", "function addToOrderPlus() {\r\n\tvar elem = document.getElementById(this.innerHTML);\r\n\t++elem.innerHTML;\r\n\tvar txt = elem.id;\r\n\tdata[txt]['кол-во'] = elem.innerHTML;\r\n\tif(elem.innerHTML < 10){\r\n\t\tvar tot = document.getElementById(this.innerHTML+ ' total');\r\n\t\tvar price = document.getElementById(this.innerHTML + ' price');\r\n\t\ttot.innerHTML = (Number(elem.innerHTML) * Number(price.innerHTML));\r\n\t\tdata[txt].итого = tot.innerHTML;\r\n\t} else {\r\n\t\tvar tot = document.getElementById(this.innerHTML+ ' total');\r\n\t\tvar price = document.getElementById(this.innerHTML + ' price');\r\n\t\ttot.innerHTML = (Number(elem.innerHTML) * Number(price.innerHTML));\r\n\t\tdata[txt].итого = tot.innerHTML;\r\n\t\tthis.removeEventListener('click', addToOrderPlus);\r\n\t\talert('Не более 10 позиций в заказе!');\r\n\t\tthis.addEventListener('click', alertOverTen);\r\n\t\treturn;\r\n\t}\r\n}", "function need_money(dette)\n{\n if(joueurs[joueur_actuel].capital > dette)\n {\n\tjoueurs[joueur_actuel].capital -= dette;\n\tpasser();\n }\n else\n {\n\talert(\"pas assez d'argent\");\n\tvalidation.innerHTML = bouton_payer + \" \" + bouton_prison;\n\tvar b_p = document.getElementById(\"bouton_payer\");\n\tb_p.addEventListener(\"click\", function(x)\n\t\t\t {\n\t\t\t\t need_money(x);\n\t\t\t }.bind(this, dette), false);\n\tvar b_s = document.getElementById(\"bouton_prison\");\n\tb_s.addEventListener(\"click\", function()\n\t\t\t {\n\t\t\t\t joueurs[joueur_actuel].prison = true;\n\t\t\t\t passer();\n\t\t\t }, false);\n }\n}", "function resToCartClicked(e){\n const button = e.target;\n const item = button.closest(\".detalle__compra\");\n const itemPrecio = Number(item.querySelector(\".precio\").textContent.replace(\"$\",\"\"));\n const itemProdId = Number(item.querySelector(\".idProdCarrito\").textContent);\n const precios = item.querySelector(\"#precios\");\n const cantidad = item.querySelector(\"#cantidad\");\n itemCantidad= Number(cantidad.value)-1;\n if(cantidad.value >= 1 & nuevasub > 0){\n cantidad.value = itemCantidad;\n }\n if(itemCantidad >= 0){\n sumaItem(itemProdId,itemCantidad);\n nuevasub = nuevasub - itemPrecio;\n precios.innerHTML = `<p>\n $${cantidad.value * itemPrecio}\n </p>`\n \n subTotal.innerHTML = `<h3>Subtotal</h3>\n <p>$${nuevasub}</p>`\n total.innerHTML = `<h2>Total</h2>\n <p>$${nuevasub}</p>`\n };\n}", "function addToCart(e){\n cart.style.display = \"block\";\n\n let li = document.createElement(\"li\");\n\n if(e.target === starter){\n li.textContent = \"Starter Plan - £150\";\n } else if(e.target === advanced) {\n li.textContent = \"Advanced Plan - £250\";\n } else {\n li.textContent = \"Professional Plan - £350\";\n }\n\n cartList.appendChild(li);\n\n e.preventDefault();\n}", "function creditAdded(response) {\n\tif (response.type == \"empty\") {\t// Empty response signals success\n\t\tclearInterval(creditAddedAnimationInterval);\n\t\tvar addAmount = document.getElementById(\"credit-add-amount\").value;\n\t\tvar newCredit = document.getElementById(\"new-credit-amount\").value;\n\t\tcreditAddedAnimationInterval = setInterval(creditAddedAnimation, 20, new Date(), addAmount, newCredit);\n\t} else if (response.type == \"error\") {\n\t\talert(\"Failed to add credit:\\n\" + response.payload[0].msg);\n\t}\n}", "ontocartHandler(evt) {\n this.toCartId = this.toCartId.concat(evt.detail);\n this.totalPrice = this.totalPrice + evt.detail.Price__c;\n }", "function createAddTaskHandler() {\n let btnAddTask = document.getElementById(\"add-task-button\");\n if (btnAddTask) {\n btnAddTask.addEventListener(\"click\", function () {\n AddTask();\n });\n }\n}", "function AddNew()\n{\n debugger;\n Resetform();\n openNav();\n ChangeButtonPatchView('DepositAndWithdrawals', 'btnPatchAdd', 'AddSub');\n}", "function listenToBtnAddButton() {\n const btnAddButton = document.querySelector('#btn-add');\n const taskInput = document.querySelector('#task-input');\n\n btnAddButton.addEventListener('click', addPlans);\n taskInput.addEventListener('keydown', addPlans);\n}", "function addItemBtnOnClick () { \n\n let itemStatus = PRODUCT_CONTAINER.querySelectorAll('.item_status')\n let remainingItems = PRODUCT_CONTAINER.querySelectorAll('.remaining_item')\n let addItemBtns = PRODUCT_CONTAINER.querySelectorAll('.add_btn')\n let nameOfItems = PRODUCT_CONTAINER.querySelectorAll('H3')\n let priceOfItems = PRODUCT_CONTAINER.querySelectorAll('.price_of_item')\n\nfor (let i = 0; i < addItemBtns.length; i++) {\n // Add this to stop repeating [i]\n let addItemBtn = addItemBtns[i]\n let status = itemStatus[i]\n let nameOfItem = nameOfItems[i]\n let remainingItem = remainingItems[i]\n let priceOfItem = priceOfItems[i]\n\n addItemBtn.addEventListener('click', () => {\n \n if (status.innerHTML == 'NOT AVAILABLE') return alert('Item is not available')\n \n if (status.innerHTML == 'AVAILABLE') { \n var itemNames = document.querySelectorAll('.item_name')\n\n for (let i = 0; i < itemNames.length; i++) {\n let itemName = itemNames[i]\n\n if (itemName.innerText == nameOfItem.innerText) { \n return alert('Item Has Been Added To Cart, You can increase the amount you want') \n } \n } \n remainingItem.value--\n checkStatus() \n\n USER_OUTPUT_TABLE.innerHTML +=\n ` <li> \n <span class=\"item_name\">${nameOfItem.innerText}</span>\n <input type=\"number\" class=\"item_price\" value=\"${priceOfItem.value}\" readonly>\n <input type=\"number\" class=\"number_of_item\" value=\"1\" >\n <input type=\"number\" class=\"total_price_per_item\" readonly>\n <span class=\"del_item\" title=\"Remove Item From Cart\">&times;</span>\n </li> `\n \n displayContent('user_output', 'block') \n amountBounghtPerItem() \n\n\n // Delete Item after it is added to the cart\n var delItems = document.querySelectorAll('.del_item')\n for (let i = 0; i < delItems.length; i++) {\n let delItem = delItems[i] \n\n delItem.addEventListener('click', (e) => {\n USER_OUTPUT_TABLE.removeChild(e.target.parentElement)\n amountBounghtPerItem()\n if (TOTAL_PRICE.value == '$ 0.00') {\n displayContent('user_output', 'none')\n }\n })\n }\n }\n })\n }\n}", "function addItem() {\n var addbtn = document.getElementsByClassName('add-item');\n //onclick event listener\n for(var i=0; i<addbtn.length; i++){\n addbtn[i].onclick = function() { \n //BTN DATA\n var name = this.getAttribute(\"data-name\");\n cart1.addItemCountCart(name);\n displayCart();\n displayOrderCart();\n calcSubTotal();\n orderTotal();\n };\n }\n \n}", "function updateItemQty(){\n // Disable order submission button.\n $('#btnSubmitOrder').attr('disabled', 'disabled');\n}", "function update_item_stock(row_id) {\n //\n create_form('stock_change_form','content-div');\n //\n // manually populating form from item table\n document.getElementById('item-number').value = document.getElementById(row_id+'-item_number').innerHTML;\n document.getElementById('item-name').value = document.getElementById(row_id+'-item_name').innerHTML;\n document.getElementById('curr-quantity').value = document.getElementById(row_id+'-quantity').innerHTML;\n document.getElementById('new-quantity').value = document.getElementById(row_id+'-quantity').innerHTML;\n var d = new Date();\n var day = d.getDate();\n var mon = d.getMonth()+1;\n if (day < 10) {day = '0'+day.toString();}\n if (mon < 10) {mon = '0'+mon.toString();}\n document.getElementById('date').value = d.getFullYear()+'-'+mon+'-'+day;\n //\n // adding event handlers\n document.getElementById('amount').addEventListener('keyup',function() {elementArithmetic('amount','curr-quantity','new-quantity','+');})\n document.getElementById('amount').addEventListener('blur',elementArithmetic('amount','curr-quantity','new-quantity','+'));\n\n}", "function addTransaction(e) {\n // Stop the page reload\n e.preventDefault();\n // Check if form has valid data\n if ( reason.value.trim() === '' || amount.value.trim() === '' ) {\n // Display error message if form is not complete\n alert('Please provide a valid reason and transaction amount.')\n } else {\n // Create an object for the transaction containing id, \n // text for the reason, and the transaction amount\n const transaction = {\n id: createID(),\n reason: reason.value,\n amount: +amount.value\n }\n // Push the new transaction into the transactions array\n transactions.push(transaction);\n // Display the new transaction in the DOM\n displayTransaction(transaction);\n // Update all balances\n updateBalance();\n // Clear form fields\n reason.value = '';\n amount.value = '';\n }\n}", "function addItem() {\r\n // finds the food item (which is the next element after the button)\r\n var foodItem = event.target.nextElementSibling;\r\n // Finds the id of the above foodItem variable\r\n var foodID = foodItem.id;\r\n // Gets all the child nodes the foodItem variable\r\n var foodDescription = foodItem.cloneNode(true);\r\n // Stores the location of the cart in the page\r\n var cartBox = document.getElementById(\"cart\");\r\n // Sets the initial value of whether an item is a duplicate to false\r\n var duplicateOrder = false;\r\n // Will check to see if the foodItem has been clicked before, in which case it will increase the number of orders, rather than add another element.\r\n for (var i = 0; i < cartBox.children.length; i++) {\r\n if (cartBox.children[i].id === foodID) {\r\n cartBox.children[i].firstElementChild.textContent++;\r\n duplicateOrder = true;\r\n break;\r\n }\r\n }\r\n // If duplicateOrder is still false, a span element is added, which includes the foodItem.\r\n if (duplicateOrder == false) {\r\n var orderCount = document.createElement(\"span\");\r\n orderCount.textContent = 1;\r\n foodDescription.prepend(orderCount);\r\n cartBox.appendChild(foodDescription);\r\n }\r\n}" ]
[ "0.6388382", "0.6312957", "0.62104166", "0.6171229", "0.6162787", "0.608986", "0.6070457", "0.59900147", "0.597411", "0.59577554", "0.5956974", "0.5940397", "0.5888081", "0.58224314", "0.58144814", "0.58085424", "0.5804701", "0.5788317", "0.5785078", "0.57827777", "0.5764892", "0.57641834", "0.57580745", "0.575295", "0.57517546", "0.5742827", "0.5740448", "0.57261264", "0.57247615", "0.5722307", "0.57131916", "0.5712783", "0.5706551", "0.5701258", "0.56968284", "0.5695611", "0.5690536", "0.5688515", "0.56608033", "0.56582683", "0.5633115", "0.5632176", "0.5631202", "0.559696", "0.55957097", "0.5595462", "0.5590399", "0.55826765", "0.5568699", "0.5568578", "0.5566236", "0.55564636", "0.5554969", "0.5552723", "0.555165", "0.5551233", "0.55496716", "0.5544694", "0.55401915", "0.55395013", "0.55371755", "0.55331105", "0.55310315", "0.55308026", "0.5521696", "0.55183244", "0.55149806", "0.5514484", "0.5513046", "0.5511001", "0.5504727", "0.5501224", "0.5500109", "0.5499683", "0.5498192", "0.5497293", "0.5491653", "0.54767", "0.54760987", "0.54701006", "0.54572827", "0.54549545", "0.5452737", "0.54524976", "0.5441444", "0.54391825", "0.54390347", "0.54370767", "0.5435664", "0.5431004", "0.54303795", "0.54281175", "0.5426149", "0.54251426", "0.54240483", "0.5420013", "0.54184896", "0.5414599", "0.5413097", "0.54070675", "0.5403026" ]
0.0
-1
Event Handler for "Remove Debt" onclick
handleRemoveRow(event) { // For some reason lwc returns a proxy and not an object array when // accessing seslectedData directly so going to have to do a query // selection for elements to fetch selected rows //let selectedRows = this.selectedData; let selectedRows = this.template.querySelector('lightning-datatable').getSelectedRows(); if(!selectedRows.length) { this.showNotification('No Rows Selected'); return; } for(let i = 0; i < selectedRows.length; i++) { for(let j = 0; j < this.data.length; j++) { if(this.data[j]['id'] == selectedRows[i]['id']) { this.data.splice(j,1); } } } this.calculateData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove(){\nremove_btn();\nquant();\ncalculate_total();\n}", "function handleRemove(){\r\n //making sure it does not remove if there are 0 items\r\n if (quantity.innerHTML !== \"0\"){\r\n quantity.innerHTML = parseInt(quantity.innerHTML)-1;\r\n }\r\n //disabling the \"agree\" button when there are no items\r\n if (quantity.innerHTML === \"0\"){\r\n agree.disabled = true;\r\n } \r\n }", "function removeCartItem(event) {\r\n var buttonClicked = event.target;\r\n buttonClicked.parentElement.parentElement.remove();\r\n updateCartTotal();\r\n }", "function removeCartItem(event) {\n var buttonClicked = event.target;\n buttonClicked.parentElement.parentElement.remove();\n updateCartTotal();\n}", "function removeCartItem(event) {\n\tvar buttonClicked = event.target;\n\tbuttonClicked.parentElement.parentElement.remove();\n\tupdateCartTotal()\n}", "function removeCupFunction(element) {\r\n\tvar str = element.parent('p').parent('td').parent('tr');\r\n\tvar cupID = str.attr(\"name\");\r\n\r\n\t// delete cup in Object\r\n\tdelete listCup[cupID];\r\n\r\n\t// hide html element\r\n\tstr.hide();\r\n\t// update total price\r\n\tupdateTotalPriceFunction();\r\n\r\n\t// checkout button stage\r\n\tif (parseFloat(getListCupLength()) > 0) {\r\n\t\tdisableCheckoutButton(false);\r\n\t} else {\r\n\t\tdisableCheckoutButton(true);\r\n\t}\r\n}", "function removeCartItem(event) {\n var buttonClicked = event.target\n buttonClicked.parentElement.parentElement.remove()\n updateCartTotal()\n}", "function removeCartItem(event) {\n var buttonClicked = event.target\n buttonClicked.parentElement.parentElement.parentElement.remove();\n //Update the cart total after the cart item has been removed.\n updateCartTotal()\n }", "function removeCartItem(event){\n let buttonClicked = event.target;\n buttonClicked.parentElement.parentElement.remove();\n updateCartTotal()\n}", "function removeItem(ref) {\n document.getElementById(ref).remove();\n calculTotal();\n}", "function removeOne(){\n $('#selected_seats_table_body').find('td').find('.removeOne').on(\"click\", function(){\n setTimeout(function(){\n\n if($('#selected_seats_table_body').find('tr').length != 0){\n // if we have a selected seat\n $('.price-info-block').fadeOut(\"fast\");\n\n var totalPrice = $('#ticket_note').find('.selected-seat-price').html();\n\n if($(\".pay-btn-control\").length != 0){\n $(\".pay-btn-control\").find('button').html(\"\");\n $(\".pay-btn-control\").find('button').html(_tr_.pay + \" (\"+totalPrice+\" \"+_tr_.currency+\")\");\n }else {\n $(\"<div class='pay-btn-control'>\" +\n \"<button id='purchase'>\" +_tr_.pay+ \" (\" +\n totalPrice +\n _tr_.currency+ \" )\" +\n \"</button>\" +\n \"</div>\").insertAfter(\".selected-seats\");\n }\n }else {\n // if don't have a seat selected\n $('.price-info-block').fadeIn(\"fast\");\n $('.pay-btn-control').fadeOut(\"slow\");\n }\n },50);\n });\n }", "function removeHandler(e) {\n const removeId = e.target.parentElement.getAttribute(\"data-task-id\");\n\n if (confirm(\"Are you sure ?!\")) {\n const foundIndex = toDoList.findIndex((el) => {\n return el.idNum === removeId;\n });\n\n toDoList.splice(foundIndex, 1);\n\n commitToLocalStorage(toDoList);\n reRender();\n }\n}", "function observeRemoveBtn(){\t\n\t\t$(\"#items .removeItem\").on(\"click\",function(event) {\n\t\t\tevent.preventDefault();\n\t\t\t// console.log(\"caught the delete click : \"+ event.target.id);\n\n\t\t\t// update invoice\n\t\t\tremoveFromInvoice( event.target.id );\n\t\t\t\n\t\t\t// save cart\n\t\t\tsaveCart(\"remove\", event.target.id);\n\t\t\t\t\t\t\n\t\t\t\n\t\t\tvar tr = $(this).closest('tr');\n\t\t\ttr.css(\"background-color\",\"#FF3700\");\n\t\t\ttr.fadeOut(400, function(){\n\t\t\t\ttr.remove();\n\t\t\t});\t\t\t\n\t\t});\t\n\t}", "function removeItem() { \n let removeButton = document.getElementsByClassName(\"remove\");\n for (let i = 0; i < removeButton.length; i++) { \n let b = removeButton[i];\n b.addEventListener('click', function(event) {\n removeFromTotal();\n event.target.parentElement.remove();\n })\n } \n}", "function removeShoppingCartItem(event){\n const buttonClicked = event.target;\n buttonClicked.closest('.shoppingCartItem').remove();\n //invocamos la funcion q actualizara el total//\n updateShoppingCartTotal();\n}", "function handleDeleteItem(_event) {\n let aktuellertIndex = parseInt(_event.target.getAttribute(\"index\"));\n warenkorbsumme = warenkorbsumme - carticles[aktuellertIndex].preis;\n gesamtSumme.innerText = \"Gesamtsumme: \" + warenkorbsumme.toLocaleString(\"de-DE\", { style: \"currency\", currency: \"EUR\" });\n (_event.target.parentElement?.remove());\n }", "function removeItem(removeButton)\n{\n /* Remove row from DOM and recalc cart total */\n var productRow = $(removeButton).parent().parent();\n\tvar detalle = {\n\t\tid: productRow.children('.id').text()\n\t}\n\n\ttoastr[\"success\"](\"Elemento eliminado!\");\n\t\n\tdocument.getElementById(\"contador\").innerHTML = (parseInt(document.getElementById(\"contador\").textContent)-1).toString();\n\n\t\n \tproductRow.slideUp(fadeTime, function() {\n\t$.ajax({\n\t\ttype: \"GET\",\n url: \"/cart/delete\",\n data: detalle,\n\t});\n productRow.remove();\n recalculateCart();\n });\n}", "function removeitem(event) {\r\n // save the element that caused this function to be called in variable \"button\"\r\n var button = event.target\r\n // remove the parent element of the parent element containing the button and all its data (the whole row in cart with image, title, price, quantity box, remove button)\r\n button.parentElement.parentElement.remove()\r\n // call the \"updatecart()\" function to update the total price after removing the item in our cart\r\n updatecart()\r\n}", "function watchRemove(){\n\t$('.js-buses').on(\"click\", \".js-removestop\", function(e) {\n e.preventDefault();\n if(window.confirm(\"Do you want to delete this bus stop?\")){\n \tconsole.log(\"remove\");\n\t var stopid = parseInt($(this).closest(\".busStop\").find(\"h2\").text().substring(1));\n\t delete state.stops[\"id\"+stopid];\n\t storeData(null);\n }\n \n });\n}", "function deleteAfterClick(event){\n event.target.parentNode.remove();\n }", "function remove(btn){\n\tvar cartItem = btn.parent().children();\n\tvar itemTotPrice = ($(($(($(cartItem[0]).children())[1]).children())[2]).children())[0];\n\tvar oldTotPrice = itemTotPrice.innerHTML;\n\tvar subtotal = $(\"#subTot\")[0];\n\tvar oldSubtotal = $(\"#subTot\")[0].innerHTML;\n\tsubtotal.innerHTML = (parseFloat(oldSubtotal)-parseFloat(oldTotPrice)).toFixed(2);\n\t\n\tbtn.parent().remove();\n\t\n\tvar prevAmount = $('.incart')[0].innerHTML;\n\t$('.incart')[0].innerHTML = parseInt(prevAmount)-1;\n\n}", "function removeItem() {\n var parentRow = event.target.parentNode.parentNode;\n parentRow.remove();\n totalAmount();\n}", "function deleteItem(e){\n}", "function removeClicked() {\n remove = true;\n}", "function removeItem(removeButton)\r\n{\r\n /* Remove row from DOM and recalc cart total */\r\n var productRow = $(removeButton).parent().parent();\r\n productRow.slideUp(fadeTime, function() {\r\n productRow.remove();\r\n recalculateCart();\r\n });\r\n}", "function buttonBuyEvent() {\r\n sumAllMoney += Number($(this).text().match(/\\d+\\.\\d+/g)[0]);\r\n $('h1:eq(1)').text(`Total Store Profit: ${sumAllMoney} BGN`)\r\n $(this).parent().remove()\r\n }", "function removeItems() {\n var buttonClicked = event.target;\n buttonClicked.parentElement.parentElement.remove();\n updateCartTotals();\n updateCartNumbers();\n const addToCartButtons = document.getElementsByClassName(\"bag-btn\");\n for (let i = 0; i < addToCartButtons.length; i++) {\n addToCartButton = addToCartButtons[i];\n addToCartButton.innerHTML = \"Add to Cart\";\n addToCartButton.disabled = false;\n }\n}", "function removeItem(removeButton)\n{\n /* Remove row from DOM and recalc cart total */\n var productRow = $(removeButton).parent().parent();\n productRow.slideUp(fadeTime, function() {\n productRow.remove();\n recalculateCart();\n }); \n}", "function confirmRemoveBillingInfo(expirationDate)\n{\n var bodyHTML = '<p style=\"width:500px;\">' + labels.removing_your_billing_information_will + displayHumanReadableDate(expirationDate, false, true) + labels.if_your_in_app_purchase + ' </p>';\n \n var headerHTML = labels.remove_billing_information;\n \n var footerHTML = '<div class=\"button\" id=\"removeBillingInfoButton\" onclick=\"downgradePremiumAccount(true)\">'+labels.remove+'</div>';\n footerHTML += '<div class=\"button\" id=\"cancelRemoveBillingInfoButton\" onclick=\"hideModalContainer()\">'+labels.cancel+'</div>';\n \n displayModalContainer(bodyHTML, headerHTML, footerHTML);\n document.getElementById('modal_overlay').onclick = null;\n}", "function deleteItem1(){\n delCartItem1.style.display = 'none';\n numItem.innerHTML = numberItem - 1;\n \n}", "function deleteFromCart(item){\n item.parentElement.remove();\n showTotals();\n}", "function deleteItem(eId) {\n document.getElementById(eId).remove();\n n = Number (eId.slice(-1)) -1;\n //remove the cost of the product deleted from the cart\n total -= itemCost[n];\n //updating the cost of products in the cart\n document.getElementById(\"total\").innerHTML = \"Total: \" + total.toFixed(2) +\"$\";\n}", "function removeItem(removeButton)\n{\n /* Remove row from DOM and recalc cart total */\n var productRow = $(removeButton).parent().parent();\n productRow.slideUp(fadeTime, function() {\n productRow.remove();\n recalculateCart();\n });\n}", "function addRemoveOrderListener() {\n var removeOrderBtn = document.getElementById('remove-order');\n removeOrderBtn.addEventListener('click', removeOrder, true);\n }", "function RemoveCard_OnClick() {\n var actionId = this.getAttribute('id');\n var actionName = this.getAttribute('name');\n\n if (actionId) {\n //var actionParameter = JSON.parse(actionParameter);//obj\n var data = JSON.stringify({\n actionName: actionName, //necessary, as we use this as key in actionsToWatch AuraInspectorInjectedScript.js\n actionId: actionId //like \"action_card_1852;a\", we need this to make actionCard on leftside draggable again\n });\n\n var command = `\n window[Symbol.for('AuraDevTools')].Inspector.publish(\"AuraInspector:RemoveActionFromWatchList\", ${data});\n `;\n chrome.devtools.inspectedWindow.eval(command, function(response, exception) {\n if (exception) {\n console.log('ERROR from removeActionCard, CMD:', command, exception);\n }\n });\n } else {\n console.error(\"removeActionCard, couldn't find actionId\");\n }\n this.parentNode.removeChild(this);\n }", "function removeSpent() {\n var player = GM_getValue(\"currentPlayer\",\"\");\n if (player==\"\")\n return;\n var sumlist = retrieveSumlist(player);\n var lastrecord=getLastRecord(sumlist);\n if (lastrecord>=0) {\n var entry=sumlist[lastrecord];\n var etext=\"\";\n if (entry.desc && entry.desc!=\"\") {\n var desc=entry.desc;\n if (!entry.desc.match('[0-9][0-9]* '))\n desc=\"1 \"+desc;\n etext=\" buying \"+desc;\n } \n var selected = confirm(\"Remove last expense\"+etext+\" for \"+makeThousands(String(entry.amt))+\" Meat, on \"+textFromDate(entry.date)+\"?\");\n if (selected) {\n sumlist[lastrecord].amt=0;\n storeSumlist(player,sumlist);\n window.location.reload();\n }\n }\n}", "function purchaseClicked(){\n alert('Thank you for your purchase')\n let cartItems = document.getElementsByClassName('cart-items')[0]\n while(cartItems.hasChildNodes()){\n cartItems.removeChild(cartItems.firstChild)\n }\n updateCartTotal()\n}", "function removeItem(removeButton)\n{\n /* Remove row from DOM and recalc cart total */\n var productRow = $(removeButton).parent().parent();\n productRow.slideUp(fadeTime, function() {\n productRow.remove();\n recalculateCart();\n });\n}", "function blueBtnClicked(event){\n\t\tevent.preventDefault();\n\t \tvar ids= $(this).attr('id');\n\t\t var id= ids.split('_');\n\t\t $.ajax({\n\t\t\t\ttype: \"GET\",\n\t\t\t\turl:siteurl+\"AssesmentInventories/delete/\"+id[1],\n\t\t\t\tsuccess: function(response){\n \t\t\t\t\tif(response == '1'){\n\t\t\t\t\t\t$(\"#AssesmentInventoryTr_\"+id[1]).remove();\n\t\t\t\t\t \t$('.ajax_status').hide(); \n\t\t\t\t\t\t$('.ajax-save-message').hide().html('Assesment Inventory Delete.').fadeIn(); \n\t\t\t\t\t\tinventory_total();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$('.ajax_status').hide(); \n\t\t\t\t\t\t$('.ajax-save-message').hide().html('Assesment Inventory Delete Faild.').fadeIn(); \n \t\t\t\t\t}\n \t\t\t\t}\n\t\t\t\t}); \n \t}", "function removeItem(removeButton) {\n /* Remove row from DOM and recalc cart total */\n var productRow = $(removeButton).parent().parent();\n productRow.slideUp(fadeTime, function() {\n productRow.remove();\n recalculateCart();\n updateSumItems();\n });\n}", "function removeItem(removeButton) {\n /* Remove row from DOM and recalc cart total */\n var productRow = $(removeButton).parent().parent();\n productRow.slideUp(fadeTime, function() {\n productRow.remove();\n recalculateCart();\n updateSumItems();\n });\n}", "function removebtn() {\r\n let removeBtn = document.querySelectorAll('.btn-remove');\r\n for(let i = 0; i < removeBtn.length; i++){\r\n removeBtn[i].addEventListener('click', function(event){\r\n let removeBtn_grandparent = event.target.parentElement.parentElement;\r\n removeBtn_grandparent.remove();\r\n updateCartTotal();\r\n\r\n })\r\n }\r\n }", "function removeitemfrombill(event){\n row = event.target.parentNode.parentNode\n document.getElementById(\"total\").innerHTML = parseInt(document.getElementById(\"total\").innerHTML) - parseInt(row.cells[3].innerHTML);\n row.remove();\n}", "function removeBar() {\n $(\".barCardItem\").on(\"click\", \".removeButton\", function (event) {\n event.preventDefault();\n $(this).parent().parent().remove();\n orderNumber();\n fillBrewList();\n passToMap();\n })\n}", "function blueBtnClickedAccesoryDelete(event){\n\t\tevent.preventDefault();\n \t\tvar ids= $(this).attr('id');\n\t\tvar id= ids.split('_');\n \t\t$(\".DeviceAccesoryGridTr_\"+id[1]).remove();\n \t}", "function removeTotal(){\n ShoppingCartScreen.SegmentShoppingCart.isVisible = false;\n ShoppingCartScreen.nodata.isVisible = true;\n try {\n kony.timer.cancel(\"disableTotalLblTimer\");\n } catch(err) {\n alert(\"Error: \" + err);\n } \n}", "function removeItem(cart1) {\n $(\"button.remove\").on(\"click\", function () {\n let index = parseInt(this.value);\n cart1.splice(index,1);\n generateCart(cart1);\n });\n}", "function clickRemoved(event) {\n if(event.target.classList.contains(\"removeButton\")) {\n var URL = event.target.parentElement.textContent;\n //Slice the unicode times from the URL\n URL = URL.slice(1);\n URL = URL.trim();\n //console.log(URL);\n if(page.contextualIdentitiesEnabled) {\n page.whiteList.removeURL(URL, getActiveTabName());\n } else {\n page.whiteList.removeURL(URL);\n }\n\t\tgenerateTableOfURLS();\n }\n}", "function BtnDelete() {\n transacionAjax_D_elete(\"D_elete\");\n}", "function removeTask(e) {\n if (e.target.parentElement.classList.contains('delete-item')) {\n if (confirm('Are you sure?')) {\n e.target.parentElement.parentElement.remove();\n\n removeTaskFromLocalStorage(Number(e.target.parentElement.parentElement.id.substring(5)))\n }\n }\n}", "function removeItemFromCart(event) {\n if (event.target.type === 'button') {\n currentInventory.removeItem(event.target.name);\n currentInventory.saveToLocalStorage();\n renderTable();\n }\n}", "function onRemoveYesClick() {\n // Close the modal.\n onCloseSpanClick();\n \n // Send a \"remove\" message to the server.\n sendMessage(2, currentModelHandle, null, null);\n}", "function fDelete(e){ //e is for event\n\t\tnum = e.target.index; // index of the element that triggered the event\n\t\t//if quantity > 1\n\t\t//remove one quantity from item in itemlist object\n\t\t//alert(\"num: \" + num); \n\t\tif (order.itemlist[\"item\" + num].quantity > 0) {\n\t\t\t//delete 1 quantity\n\t\t\torder.itemlist[\"item\" + num].quantity -= 1\n\t\t\t//alert(\"quantity: \" + order.itemlist[\"item\"+num].quantity);\t\n\n\t\t\t//Change the display of quanity on screen\n\t\t\tvar newtext = \"Description: \" + order.itemlist[\"item\" + num].description + \" Price: $\" + order.itemlist[\"item\"+ num].price + \" Quantity: \" + order.itemlist[\"item\" + num].quantity;\n\t\t\t//create textnode\n\t\t\tvar newtextnode = document.createTextNode(newtext); \n\t\t\t\n\t\t\t//indicate div for text details\n\t\t\tvar changediv = document.getElementById(\"itemdiv\" + num); \n\n\t\t\t//change text background color for testing purposes\n\t\t\t//changediv.style.backgroundColor = \"orange\";\n\n\t\t\t//replace with new item details\n\t\t\tchangediv.replaceChild(newtextnode, changediv.childNodes[0]);\n\n\t\t}\n\t\t//if quanity < 1\n\t\tif (order.itemlist[\"item\" + num].quantity < 1) {\n\t\t\t//indicate div for text details\n\t\t\tvar changediv = document.getElementById(\"itemdiv\" + num); \n\n\t\t\t//indicate div for button\n\t\t\tvar btndiv = document.getElementById(\"btndiv\" + num); \n\n\t\t\t//disable display of text details\n\t\t\tchangediv.style.display = \"none\";\n\n\t\t\t//disable display of button\n\t\t\tbtndiv.style.display = \"none\";\n\t\t}\n\t\trecal();\n\t}", "function removeItemFromCart(){\n\n}", "function removeItem(removeButton) {\n /* Remove row from DOM and recalc cart total */\n var productRow = $(removeButton).parent().parent();\n productRow.slideUp(fadeTime, function () {\n productRow.remove();\n });\n }", "function handleDeleteItem(e) {\n console.log('click');\n if (e.target.nodeName === 'BUTTON') {\n // removeClass();\n // removeListener();\n localStorage.removeItem('json');\n }\n}", "function addRemoveTodoItemClickHandler(e) { \r\n var $el = $(this).off(\"click\", addRemoveTodoItemClickHandler);\r\n var $item = $el.parent().parent();\r\n var val = parseInt($item.find(\".work-todo-list-item-checkbox\").attr(\"data-item-id\"));\r\n var txt = $item.find(\".work-todo-list-item-title\").text();\r\n if(!isNaN(val) && val) {\r\n if(typeof SYNC == \"object\") SYNC.deleteToDo({id:val, title:txt});\r\n \r\n BRW_sendMessage({command: \"deleteTodoItemDb\", \"id\": val});\r\n \r\n $item.fadeOut(100, function() {\r\n $item.remove();\r\n \r\n reCalculateTodoItemsCount();\r\n $(\"#todo-footer-input\").focus();\r\n \r\n //todoPopupState(\"no-all-done\");\r\n todoPopupState();\r\n \r\n });\r\n }\r\n}", "static handleRelease(event){\n if(event.target.tagName === \"BUTTON\"){\n let pokemonId = parseInt(event.target.parentNode.dataset.id)\n event.target.parentNode.remove()\n\n deletePokemon(pokemonId)\n }\n }", "function minusItem() {\n var minusbtn = document.getElementsByClassName('minus-item');\n //onclick event listener\n for(var i=0; i<minusbtn.length; i++){\n minusbtn[i].onclick = function() { \n //BTN DATA\n var name = this.getAttribute(\"data-name\");\n cart1.removeItemFromCart(name);\n displayCart();\n displayOrderCart();\n calcSubTotal();\n orderTotal();\n };\n }\n\n}", "function removeItem(e) {\n if (e.target.classList.contains('delete-btn')) {\n // var litext = e.target.classList.contains('item-list');\n //var litext = document.getElementsByClassName('item-list').innerText;\n // var txt = litext.innerHTML;\n if (confirm('Are you sure you want delete')) {\n \n var btn = document.querySelector('delete-btn');\n btn = e.target.parentElement;\n itemlist.removeChild(btn);\n }\n }\n}", "function deleteItem(e){\n var productRow = e.currentTarget.parentNode.parentNode;\n body.removeChild(productRow);\n getTotalPrice();\n }", "function delete_task(e) {\n console.log('delete task btn pressed...');\n e.target.parentElement.remove();\n\n }", "function removeItem(removeButton)\r\n {\r\n /* Remove row from DOM and recalc cart total */\r\n var productRow = $(removeButton).parent().parent();\r\n productRow.slideUp(fadeTime, function() {\r\n productRow.remove();\r\n recalculateCart();\r\n });\r\n }", "function deletetag(){\n\t// event.preventDefault();\n\t$(\"#ProcessSuppPayment\").click(function(event) {\n\t \tvar countfalse = parseInt($(\"#countnan\").val());\n\t \tconsole.log(countfalse);\n\t \tfor (var i = 0; i < countfalse; i++) {\n\t \t\ttes = $(\"[name=amount\"+i+\"]\").val();\n\t \t\t// console.log(tes);\n\t \t\tif (tes == \"\"){\n\t\t \t\t$(\"[name=iniaja\"+i+\"]\").remove();\n\t\t \t}\t\n\t \t}\n\t}\n\t \t// $(\"#ProcessSuppPayment\").submit();\n\t);\n\t\n\t$(\"#AddPaymentItem\").click(function(event) {\n\t\t\n\t // event.preventDefault();\n\n\t \tvar countfalse = parseInt($(\"#countnan\").val());\n\t \t//console.log(countfalse);\n\t \tfor (var i = 0; i < countfalse; i++) {\n\t \t\ttes = $(\"[name=amount\"+i+\"]\").val();\n\t \t\t// console.log(tes);\n\t \t\tif (tes == \"\"){\n\t\t \t\t$(\"[name=iniaja\"+i+\"]\").remove();\n\t\t \t}\t\n\t \t}\n\t}\n\t\t// $(\"#AddPaymentItem\").submit();\n\t);\n\n}", "function deleteQuote() {\n deleteBtn.parentElement.remove();\n showFav();\n }", "function deleteCard(event) {\n const card = window.cardList[window.currentPage];\n console.log(\"i clicked\", card);\n\n deleteButton = document.getElementById(\"deleteButton\");\n\n deleteFetch(card.id);\n\n cardAlert(\"Deleted\");\n}", "function onDeleteClick() {\n setValue( '', onAudioCleared );\n function onAudioCleared() {\n element.page.form.raise( 'valueChanged', element );\n Y.log( 'Cleared audio element value: ' + element.value, 'info', NAME );\n element.isDirty = true;\n window.setTimeout( function() { element.page.redraw(); }, 500 );\n }\n }", "function removeItem(removeButton) {\n /* Remove row from DOM and recalc cart total */\n var productRow = $(removeButton).parent().parent();\n productRow.slideUp(fadeTime, function () {\n productRow.remove();\n recalculateCart();\n });\n }", "function deleteItem(evt) {\n\tvar button = evt.target;\n\tvar row = button.parentNode.parentNode;\n\tvar cells = row.getElementsByTagName(\"td\");\n\tvar name = cells[1].innerHTML;\n\tvar type = cells[2].innerHTML;\n\tvar group = row.id.slice(0, row.id.indexOf(\"-\"));\n\tif (group === \"base\") {\n\t\tbaseItems.delete(type, name);\n\t} else {\n\t\toptionalItems.delete(type, name);\n\t}\n\trow.parentNode.removeChild(row);\n\tsyncToStorage();\n}", "function deleteIssueFromUI(e) {\r\n if (e.target.classList.contains('btn-danger')) {\r\n\r\n var issue = e.target.parentElement;\r\n issueList.removeChild(issue);\r\n };\r\n}", "function removeCartItem(event) {\n var artikelid = event.target.parentElement.parentElement.id;\n doit (removeCartItemObj(artikelid));\n}", "function removeItemAfterClick(e){\n\t // if (e.target.tag === deleteElementList){\n\t \t// console.log(e.target.tagName);\n\t \t// deleteElementList.querySelector(\"li\").remove();\n\t \te.target.parentNode.remove();\n\t\t// e.deleteElementList.remove();\n\t\t// deleteElementList.removeChild(deleteElementList.childNodes[i]);\n\t\n\n}", "function addDelButton(itemNo) { \t\t\t\t\t\t\t\t// itemNo targets specific list item\n\t\tvar delBut = document.createElement(\"img\");\t\t\t\t\t// create element\n\t\tdelBut.name = \"delBut\" + itemNo;\t\t\t\t\t\t\t// fill in element details\n\t\tdelBut.src = \"https://raw.github.com/WhatTheFunkNGC/colabhang/master/lister/img/deleteBtn.jpg\";\n\t\tdelBut.width = 25;\n\t\tdelBut.height = 25;\n\t\tdelBut.align = \"top\";\n\t\tdelBut.onclick = function() { \t\t\t\t\t\t\t\t// on click calls remove function with param targeting the specific line\n\t\t\t\tconsole.log(\"Delete Press\");\n\t\t\t\tremoveItemFromList(\"listTxt\",itemNo);\n\t\t}; \n\t\treturn delBut;\t\t\t\t\t\t\t\t\t\t\t\t// return button element\n\t}", "onCancelButtonClick() {\n this.representedHTMLElement.parentNode.removeChild(this.representedHTMLElement);\n }", "function fDelete(e){ //e is for event\n\tnum = e.target.index; // index of the element that triggered the event\n\t//if quantity > 1\n\t//remove one quantity from item in itemlist object\n\t//alert(\"num: \" + num); /*for testing purposes*/\n\tif (order.itemlist[\"item\"+num].quantity > 0) {\n\t\t//delete 1 quantity\n\t\torder.itemlist[\"item\"+num].quantity -= 1\n\t\t//alert(\"quantity: \" + order.itemlist[\"item\"+num].quantity);\t\n\n\t\t//Change the display of quanity on screen\n\t\tnewtext = \"Description: \" + order.itemlist[\"item\"+num].description + \" Price: $\" + order.itemlist[\"item\"+num].price + \" Quantity: \" + order.itemlist[\"item\"+num].quantity;\n\t\t//create textnode\n\t\tnewtextnode = document.createTextNode(newtext); \n\t\t\n\t\t//indicate div for text details\n\t\tvar changediv = document.getElementById(\"itemdiv\" + num); \n\n\t\t//change text background color for testing purposes\n\t\t//changediv.style.backgroundColor = \"orange\";\n\n\t\t//replace with new item details\n\t\tchangediv.replaceChild(newtextnode, changediv.childNodes[0]);\n\n\t}\n\t//if quanity < 1\n\tif (order.itemlist[\"item\"+num].quantity < 1) {\n\t\t//indicate div for text details\n\t\tvar changediv = document.getElementById(\"itemdiv\" + num); \n\n\t\t//indicate div for button\n\t\tvar btndiv = document.getElementById(\"btndiv\" + num); \n\n\t\t//disable display of text details\n\t\tchangediv.style.display = \"none\";\n\n\t\t//disable display of button\n\t\tbtndiv.style.display = \"none\";\n\t}\n\trecal();\n}", "_onTweenerRemove () {}", "function remove_tache(){\n\t// Recuperation de l'id de la tache\n\tvar id_tache = liste_infos_tache.getCoupler().getLastInformation();\n\t\n\t// Mise a jour BDD\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"DELETE\", \"/taches/\"+id_tache, false);\n\txhr.send();\n\t\n\t// Notification interface\n\tmaj_listes_taches_after_edit();\n\ttitre_tache_selectContainer.setHTMLContent('<h2 class=\"hight_titre_liste\">SELECTIONNER UNE TACHE</h2>');\n\ttitre_tache_selectContainer.update();\n\tliste_infos_tache.clear();\n\tliste_infos_tache.update();\n\tdesc_tache_selectContainer.clear();\n\tdesc_tache_selectContainer.update();\n\tdocument.getElementsByClassName('btn_showPopup_clo_tache')[0].disabled = true;\n\tGraphicalPopup.hidePopup(popup_clo_tache.getPopupIndex());\n}", "function removeIngredient(id) {\n $(\"#row\" + id).remove();\n // totalCostCalculated -= pricePerAmoutOfItem;\n alert('Ingredient removed!');\n console.log(\"update cost and price function called\");\n // $(\"#sellingPrice\").text('');\n // $(\"#sellingPrice\").text((Math.round(sellingPrice * Math.pow(10, 2)) / Math.pow(10, 2)) + \" € \");\n}", "function htmlDeleteTransactionButton(transactionID) {\r\n account.deleteTransaction(transactionID);\r\n // Save budget to Local Storage to save the change\r\n budget.saveToStorage();\r\n // Update the HTML table\r\n updateTable(account);\r\n draw(account); // Redraw the analysis area using the new data\r\n drawLineChart(); // Redaw the line chart using the new data\r\n}", "function clickOnRemoveCurrent(event)\n {\n event.preventDefault();\n\n // Before remove current callBack function\n if (typeof parent.getOptions().beforeRemoveCurrent === \"function\") {\n parent.getOptions().beforeRemoveCurrent(source);\n }\n \n if (parent.getOptions().removeCurrentConfirmation) {\n if ( confirm(parent.getOptions().removeCurrentConfirmationMsg) ) {\n removeForm($(this).closest(\".sheep_it_duplicator_row\"));\n }\n } else {\n removeForm($(this).closest(\".sheep_it_duplicator_row\"));\n }\n \n // After remove current callBack function\n if (typeof parent.getOptions().afterRemoveCurrent === \"function\") {\n parent.getOptions().afterRemoveCurrent(source);\n }\n }", "function deleteList(c) {\n\tconst taskDel = document.querySelector(`.item-${c}`);\n\ttaskDel.firstElementChild.addEventListener(\"click\", () => {\n\t\tif (confirm(\"Are you sure?\")) {\n\t\t\ttaskDel.remove();\n\t\t\tconsole.log(taskDel.textContent);\n\t\t\tremoveFromStorage(taskDel.textContent);\n\t\t}\n\t});\n}", "function addIDDelButton(userID,itemNo) { \t\t\t\t\t\t// itemNo targets specific list item\n\t\tvar delIDBut = document.createElement(\"img\");\t\t\t\t// create element\n\t\tdelIDBut.name = \"delIDBut\" + itemNo;\t\t\t\t\t\t// fill in element details\n\t\tdelIDBut.src = \"https://raw.github.com/WhatTheFunkNGC/colabhang/master/lister/img/deleteBtn.jpg\";\n\t\tdelIDBut.width = 25;\n\t\tdelIDBut.height = 25;\n\t\tdelIDBut.align = \"top\";\n\t\tdelIDBut.onclick = function() { \t\t\t\t\t\t\t// on click calls remove function with param targeting the specific line\n\t\t\t\tconsole.log(\"Del ID Press\");\n\t\t\t\tremoveUserFromElement(userID,itemNo);\t\t\t\t// adds users ID to list element\n\t\t}; \n\t\treturn delIDBut;\t\t\t\t\t\t\t\t\t\t\t// return button element\n\t}", "function removeItem(removebtn, wrapperDiv, focus) {\n removebtn.addEventListener(\"click\", () => {\n wrapperDiv.classList.add(\"animate\");\n setTimeout(function () {\n wrapperDiv.remove();\n showTotal();\n if (itemAdded === false) {\n cart_empty.classList.remove(\"hidden\");\n cart_btn.innerHTML = \"<img src='/Images/empty_cart2.PNG'/>\";\n cartStatus.style.display = \"none\";\n } else if (itemAdded === true) {\n cartStatus.style.display = \"flex\";\n }\n focus.innerText = \"Add to Cart\";\n\n countItems();\n }, 500);\n // wrapperDiv.remove();\n });\n}", "function removeTask(e) {\n if(e.target.parentElement.classList.contains\n ('delete-item')) {\n if(confirm('Are You Sure?')) {\n e.target.parentElement.parentElement.remove();\n //Remove from LS\n removeTaskFromLocalStorage\n (e.target.parentElement.parentElement);\n\n \n }\n}\n\n}", "function deleteItem(myId, amountId) {\n document.getElementById(myId).style.display = 'none'; //myId = l'id de l'item\n //soustrait le montant de l'aticle supprimer et affiche le total\n var amount1 = Number(document.getElementById('claireFontainePrice').innerText),\n amount2 = Number(document.getElementById('rametteOfficeDepotPrice').innerText),\n amount3 = Number(document.getElementById('cartonOfficeDepotPrice').innerText),\n amount4 = Number(document.getElementById('ReyProDesignPrice').innerText),\n amount5 = Number(document.getElementById('classeursPrice').innerText),\n amount6 = Number(document.getElementById('archiveBoxPrice').innerText),\n amount7 = Number(document.getElementById('folderPrice').innerText),\n amount8 = Number(document.getElementById('sleevePrice').innerText),\n amount9 = Number(document.getElementById('4ColorFluoPrice').innerText),\n amount10 = Number(document.getElementById('4ColorPrice').innerText),\n amount11 = Number(document.getElementById('styloPaperMatePrice').innerText),\n amount12 = Number(document.getElementById('styloBicPrice').innerText),\n amount13 = Number(document.getElementById('scotchPrice').innerText),\n amount14 = Number(document.getElementById('staplerPrice').innerText),\n amount15 = Number(document.getElementById('cutterPrice').innerText),\n amount16 = Number(document.getElementById('paperClipsPrice').innerText);\n var balance = amount1 + amount2 + amount3 + amount4 + amount5 + amount6 + amount7 + amount8 + amount9 + amount10 + amount11 + amount12 + amount13 + amount14 + amount15 + amount16;\n var numberSuppr = document.getElementById(amountId).innerText;\n balance = balance - numberSuppr;\n document.getElementById('amountTotal').innerHTML = balance.toFixed(2);\n}", "OnClickTakeMoneyOut() {\n this.setPopupTransaction(SessionConstant.POPUP_TAKE_MONEY_OUT);\n }", "function removeTask(e){\n if (e.target.parentElement.classList.contains('delete-item')){\n if(confirm('u sure, dude?')){\n e.target.parentElement.parentElement.remove(); \n\n //remove from local storage\n removeTaskFromLocalStorage(e.target.parentElement.parentElement);\n }\n }\n}", "function xbutton2(ele){\n\tvar id=ele.id;\n\tvar mealid=ele.id.slice(0,-1);\n\tif (confirm('Do you want to delete this mealplan?')){\n\t\tele.parentNode.style.display=\"none\";\n\t\tlocalStorage.setItem(mealid+'check','false');\t\n\t} \t\n}", "function DeleteClick() {\n notyConfirm('Are you sure to delete?', 'DeleteSupplierPayment()');\n}", "function deleteMe(event) {\n\tdocument.getElementById(\"controls\").removeChild(event.target.parentNode.parentNode);\n}", "function removeProduct(event) {\n const target = event.currentTarget.parentNode.parentNode;\n const targetToRemove = target.parentNode;\n\n targetToRemove.removeChild(target);\n //console.log('The target in remove is:', target);\n \n //... your code goes here\n //const removeProductButton = document.querySelectorAll('.btn btn-remove');\n //removeProductButton.onclick();\n\n}", "function addEventtodeleteButton(item){\n item.addEventListener(\"click\",deleteAfterClick);\n}", "function deleteCity(e){\n\n if(e.target.className === \"fas fa-minus\"){\n\n e.target.parentElement.parentElement.remove();\n storage.deleteCityFromStorage(e.target.parentElement.nextElementSibling.firstElementChild.textContent);\n\n }\n\n}", "function removeTask(e){\n //Choosing our target : class \"delet-item\"\n /* const target = e.target.closest('.delete-item')// closest() with class\n if(target){\n if(confirm('Are you sure?')){\n target.parentElement.remove()\n }\n } */\n if(e.target.parentElement.classList.contains('delete-item')){\n if(confirm('Are you sure?')){\n e.target.parentElement.parentElement.remove(); \n }\n }\n removeTaskFromLocalStorage(e.target.parentElement.parentElement)\n \n}", "function removeTask(e) {\r\n let li = e.target.parentElement.parentElement;\r\n let a = e.target.parentElement;\r\n if (a.classList.contains('delete-item')) {\r\n if (confirm('Are You Sure ?')) {\r\n li.remove();\r\n removeFromLS(li);\r\n }\r\n }\r\n}", "function removeCart(){\n\n}", "function RemoveBTM() {\n var removeCartBtm = document.getElementsByClassName('remove')\n for (var i = 0; i < removeCartBtm.length; i++) {\n var button = removeCartBtm[i]\n button.addEventListener(\"click\", removeCartItem)\n }\n\n}", "function deleteButtonListener(element){\n element.addEventListener('click', e => {\n remove(e.target.id)\n const card = e.target.parentNode.parentNode\n card.parentNode.removeChild(card)\n })\n }", "function xbutton(ele){\n\tvar id=ele.id;\n\tvar mealid=ele.id.slice(0,-1);\n\tif (confirm('Do you want to delete this mealplan?')){\n\t\tdocument.getElementById(mealid).style.display=\"none\";\n\t\tlocalStorage.setItem(mealid+'check','false');\t\n\t} \t\n}", "function removeTask(e) {\n\n if (e.target.parentElement.classList.contains('delete-item')) {\n if (confirm('Are you sure!!')) {\n e.target.parentElement.parentElement.remove();\n }\n }\n removeItemFromLocalStorage(e.target.parentElement.parentElement);\n}", "function removeItem(){\r\n /////////////////////////////////////////////////////////\r\n //::::::::::::Deleting Element using DOM Traversal.::://\r\n var deleteBtn = $.querySelector('.deleteBtn');\r\n deleteBtn.addEventListener('click', (e) => {\r\n var clientDel = e.target.parentElement.parentElement;\r\n clientDel.parentNode.removeChild(clientDel);\r\n\r\n //////////////////////////////////////////////////////////////////\r\n //::::::::::::Adding A text after All Items are Deleted::::::::://\r\n\r\n var emptyResponses = $.querySelector('.responses').children;\r\n if(emptyResponses.length === 0) {\r\n var deletedRes = $.querySelector('.deletedRes').innerHTML;\r\n $.querySelector('.keepReading').innerHTML = deletedRes;\r\n inputsFun();\r\n }\r\n });\r\n\r\n }" ]
[ "0.7309488", "0.7177573", "0.70164657", "0.69206375", "0.69182664", "0.6871848", "0.68686795", "0.68233", "0.6801254", "0.6796952", "0.6763039", "0.6756368", "0.6716516", "0.66996086", "0.6630511", "0.6588026", "0.6581877", "0.65619403", "0.6454827", "0.64139354", "0.6394211", "0.6342168", "0.6336096", "0.63346237", "0.63327456", "0.63195103", "0.6313946", "0.63125706", "0.63106036", "0.63016564", "0.62956715", "0.62817997", "0.6280817", "0.62786996", "0.62611955", "0.625284", "0.6250663", "0.6238795", "0.6224901", "0.6222166", "0.6222166", "0.621858", "0.6200745", "0.61992717", "0.61958814", "0.6188613", "0.61860716", "0.61836994", "0.61788726", "0.61780757", "0.6176415", "0.6171979", "0.6163323", "0.61587787", "0.6151101", "0.614688", "0.6141144", "0.61381686", "0.613696", "0.61353564", "0.613149", "0.6129144", "0.6127947", "0.61272705", "0.61272526", "0.6122283", "0.6116299", "0.61100245", "0.61077297", "0.6106388", "0.6102837", "0.610027", "0.6094851", "0.6089709", "0.6088119", "0.6087788", "0.60876846", "0.60841227", "0.60802126", "0.6079936", "0.60795015", "0.6075662", "0.60650194", "0.6064376", "0.6055996", "0.605412", "0.60495645", "0.60473377", "0.6046398", "0.60462314", "0.60402757", "0.60361093", "0.603345", "0.60296303", "0.6025112", "0.6024298", "0.6024213", "0.60209435", "0.6019287", "0.60186106", "0.60132045" ]
0.0
-1
Event Handler for "Save" onclick
handleSaveRow(event) { // Run all validations since it is run from a non form submit button // and may skip validation component validation rules const checkAllField = [...this.template.querySelectorAll('lightning-input')] .reduce((validSoFar, inputField) => { inputField.reportValidity(); return validSoFar && inputField.checkValidity(); }, true); if (checkAllField) { let newRow = {}; newRow.id = this.lastID + 1; // could have been smiplified by using same DOM name as object schema but // may incur heavy price if overlooked this.template.querySelectorAll('lightning-input').forEach(function(element){ if(element.name == 'creditorInput') newRow.creditorName = element.value; else if(element.name == 'firstNameInput') newRow.firstName = element.value; else if(element.name == 'lastNameInput') newRow.lastName = element.value; else if(element.name == 'minPayInput') newRow.minPaymentPercentage = element.value; else if(element.name == 'balanceInput') newRow.balance = element.value; },this); this.data.push(newRow); this.showInputSection = false; this.calculateData(); } else { this.showNotification('Please verify fields'); return; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnBtnSave_Click( e )\r\n{\r\n Save( 'generic_save_title' , 'save_confirm_msg' ) ;\r\n}", "function OnBtnSave_Click( e )\r\n{\r\n Save( 'generic_save_title' , 'save_confirm_msg' ) ;\r\n}", "onSaveButtonClick(eventObject) {\n let saveButton = eventObject.target;\n let savedType = saveButton.getAttribute(\"saved\") ? RoKA.Reddit.SaveType.UNSAVE : RoKA.Reddit.SaveType.SAVE;\n new RoKA.Reddit.SaveRequest(this.commentObject.name, savedType, function () {\n if (savedType === RoKA.Reddit.SaveType.SAVE) {\n saveButton.setAttribute(\"saved\", \"true\");\n saveButton.textContent = RoKA.Application.localisationManager.get(\"post_button_unsave\");\n }\n else {\n saveButton.removeAttribute(\"saved\");\n saveButton.textContent = RoKA.Application.localisationManager.get(\"post_button_save\");\n }\n });\n }", "function handleSaveItem(event){\n //Console readout\n //console.log(\"Saving item...\")\n \n //Convert the button that was clicked to a jQuery DOM item\n var target = $(event.target);\n\n //Check if the save icon is clicked instead of the button itself and adjust handle accordingly\n if (target.hasClass(\"fas\")){\n saveButton = $(event.target).parent();\n }else{\n saveButton = target;\n }\n \n //Get index for data save from data attribute \n var index = saveButton.parent().children('textarea').data('index');\n\n //Get entered text for timeblock\n var text = saveButton.parent().children('textarea').val();\n\n //Enter item into local storage\n localStorage.setItem(index,text);\n\n}", "function clickSaveButton() {\n\tif(this.innerHTML === savedButtText) {\n\t\tthis.innerHTML = notSavedButtText;\n\t} else {\n\t\tthis.innerHTML = savedButtText;\n\t}\n\n\tupdateAllSavedPCs();\n}", "function saveAction(saveURL)\r\n{\r\n var workArea = _getWorkAreaDefaultObj();\r\n var docData = workArea.getHTMLDataObj();\r\n if(docData != null && docData.hasUserModifiedData() == true)\r\n {\r\n \tdocData.setSaveURL(saveURL);\r\n docData.performSaveChanges(_defaultWorkAreaSave);\r\n }\r\n else\r\n {\r\n \tvar objAjax = new htmlAjax();\r\n \tobjAjax.error().addError(\"warningInfo\", szMsg_No_change, false);\r\n \t_displayProcessMessage(objAjax);\r\n }\r\n}", "onSaveButtonClick(eventObject) {\n let saveButton = eventObject.target;\n let savedType = saveButton.getAttribute(\"saved\") ? RoKA.Reddit.SaveType.UNSAVE : RoKA.Reddit.SaveType.SAVE;\n new RoKA.Reddit.SaveRequest(this.threadInformation.name, savedType, function () {\n if (savedType === RoKA.Reddit.SaveType.SAVE) {\n saveButton.setAttribute(\"saved\", \"true\");\n saveButton.textContent = RoKA.Application.localisationManager.get(\"post_button_unsave\");\n }\n else {\n saveButton.removeAttribute(\"saved\");\n saveButton.textContent = RoKA.Application.localisationManager.get(\"post_button_save\");\n }\n });\n }", "_event_saving() {\n\t\tlet ev = new Event(\"saving\", { \"bubbles\": true, \"cancelable\": true });\n\t\tthis.dispatchEvent(ev);\n\t}", "function Save(e) {\n\t// saveURL is a switch used to check whether this is a new feature request or an edit.\n\tif (saveURL === undefined) {\n\t saveURL = newURL;\n\t}\n\t\n\t$.ajax({\n type: \"POST\",\n url: saveURL,\n data: $('#feature-request-form').serialize(),\n success: function (data) {\n grid.reload();\n\t\t$('#feature-modal-form').modal('hide');\n\t\tclearForm('#feature-modal-form');\n },\n\t failure: function () {\n alert('Failed to save.');\n\t\t$('#feature-modal-form').modal('hide');\n\t }\n });\n\tsaveURL = newURL;\n e.preventDefault();\n }", "onSaving() {\n if (this._saving) {\n this._saving.raise();\n }\n }", "function save(e) {\n let saveBtn = e.target;\n let inputBox = event.target.parentNode.lastChild;\n event.target.parentNode.firstChild.textContent = inputBox.value;\n inputBox.style.display = \"none\";\n saveBtn.style.display=\"none\";\n let editBtn = event.target.nextSibling;\n editBtn.style.display = \"inline\";\n \n}", "_handleButtonSave()\n {\n var element = this._getJQueryElement();\n if ($(element).is(':visible'))\n {\n this.model.set('job_settings', this._editor.getValue());\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__WORKFLOWJOB_SAVE, {workflowjob: this.model, workflow: this._workflow});\n }\n }", "handleSaveClick(event) {\n event.stopPropagation();\n event.preventDefault();\n\n this.doFormSave();\n }", "function menuSaveClick(event) {\n // console.log('menuSaveClick');\n\n event.preventDefault();\n\n let diagramTitle = PageData.SavedImageTitle;\n let storageKey = Date.now().toString();\n\n let overwrite = Common.customConfirm('Overwrite existing diagram?');\n if (overwrite) {\n storageKey = PageData.Filename;\n } else {\n diagramTitle = Common.customPrompt('Save diagram as:', diagramTitle);\n if (!diagramTitle) return;\n }\n\n const svgXml = SvgModule.getSvgXml();\n const svgObject = { Title: diagramTitle, SvgXml: svgXml };\n const jsonData = JSON.stringify(svgObject);\n localStorage.setItem(storageKey, jsonData);\n}", "onSaving() {\n var ptr = this;\n this.formView.applyValues();\n this.record.save(function () {\n ptr.onSaved();\n });\n this.saving.raise();\n }", "function handleOnButtonClick(asBtn) {\r\n switch (asBtn) {\r\n case 'SAVE':\r\n saveOutputOption();\r\n break;\r\n }\r\n}", "onClickSave() {\n HashBrown.Helpers.SettingsHelper.setSettings(this.model.id, null, 'info', this.model.settings.info)\n .then(() => {\n this.close();\n\n this.trigger('change', this.model);\n })\n .catch(UI.errorModal);\n }", "function clickHandler(e) {\r\n saveOptions();\r\n}", "function Save() {\n if ($('#ab121sgAddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab121sg\",vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n } else {\n dataContext.upDate(\"/api/ab121sg\", vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n }\n }\n }", "function onSaveClick() {\n logger.info('save_button click event handler');\n closeKeyboards();\n clearAllErrors();\n var isValid = true;\n\n if (!($.customer_profile_first_name.value)) {\n showError($.customer_profile_first_name, $.first_name_error, _L('Please provide a first name.'), true);\n isValid = false;\n }\n if (!($.customer_profile_last_name.value)) {\n showError($.customer_profile_last_name, $.last_name_error, _L('Please provide a last name.'), true);\n isValid = false;\n }\n\n if (isValid) {\n var params = {\n first_name : $.customer_profile_first_name.value,\n last_name : $.customer_profile_last_name.value\n };\n\n var promise = currentCustomer.setProfile(params);\n Alloy.Router.showActivityIndicator(promise);\n promise.done(function(model, params, options) {\n notify(_L('Customer profile data successfully saved.'));\n $.edit_customer_profile.fireEvent('route', {\n page : 'profile',\n isCancel : true\n });\n });\n }\n\n if (!isValid) {\n notify(_L('Please fill in all the required fields.'));\n }\n}", "function Save(e)\n{\n e.preventDefault();\n console.log(\"alertbe happy\");\n}", "function successSave() {\n var saveSuccess = $('#save-success');\n showSaveResult(saveSuccess);\n}", "_save() {\n const detail = this.serializeForm();\n this.dispatchEvent(new CustomEvent('save', {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail\n }));\n }", "onSaved() {\n this.saved.raise();\n }", "function handleSave(evt) {\n hideNavMenu();\n let filename = \"okit.json\";\n if (okitSettings.is_timestamp_files) {\n filename = 'okit-' + getTimestamp() + '.json'\n }\n console.info('>> Saving Single Region File');\n okitJsonModel.updated = getCurrentDateTime();\n saveJson(JSON.stringify(okitJsonModel, null, 2), filename);\n}", "function process_save(saveall) {\n obj = getObj('save_func');\n if (saveall)\n obj.value = 'save_all_page';\n else\n obj.value = 'save_marked';\n obj.form.submit();\n}", "function onSaveSuccess(data, response, xhr)\n\t{\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tthis.data.field = data.field;\n\t\tLiveUpdater.changedModel(this.data.field);\n\t}", "function saveEventDesc(event) {\n let clickedSave = event.target;\n let rowEventId = $(clickedSave).prev().attr('id');\n eventDescText = $(`#${rowEventId} textarea`).val()\n //check if the user enterd an event for the save button clicked\n if (eventDescText) {\n evntDescProp = rowEventId\n if (!dailyEvents) {\n dailyEvents = {}\n }\n dailyEvents[evntDescProp] = eventDescText\n localStorage.setItem(plannerDate.text(), JSON.stringify(dailyEvents));\n alert(\"Changes have been saved.\")\n }\n else {\n //if no data enterd for the event for the save button clicked, alert the user they clicked the wrong save\n alert(\"Please enter an event descrption before clicking SAVE.\")\n }\n}", "function inner_after_save()\n\t{\n\t\tthat.processCodeInScripts();\n\t\tthat.editor.focus();\n\t\tthat.showInFooter(\"saved\");\n\t\tLiteGUI.trigger( that, \"stored\" );\n\t}", "function saveAction(){\n\t\tvar data = getInput();\n\t\tif(data.id == \"\") {\n\t\t\t// delete the id property as it's\n\t\t\t// automatically set by database.\n\t\t\tdelete data.id;\n\t\t\tupdateDB(\"add\", data);\n\t\t}\n\t\telse {\n\t\t\tdata.id = Number(data.id);\n\t\t\tupdateDB(\"edit\", data);\n\t\t}\n\t\tclearInput();\n\t}", "function clickSave() {\n alert(\"clicked\");\n saveButton.disabled = true; \n}", "function onSaveSuccess(data, response, xhr)\n\t{\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tthis.data.fields = data.fields;\n\t\tthis.sidebar.breadcrumbsView.back();\n\t\tthis.renderGridView();\n\t\tthis.showGridView();\n\t\tLiveUpdater.changedModel(this.data.field);\n\t}", "function onSaveSuccess(data, response, xhr)\n\t{\n\t\tthis.createDefaultFields(this.data.creator);\n\t\tthis.sidebar.breadcrumbsView.back();\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tthis.showGridView();\n\t\t// LiveUpdater.refresh(); // decided to remove this for now\n\t}", "function save ()\n {\n $uibModalInstance.close(vm.item);\n }", "function _saveAsPanelHandler(){\n\n $('#sm-editing-table--checkbox').on(\"click\", function() {\n // traverse the DOM up to the table and find all input checkboxes, mark as checked\n $(this).closest('table').find('td input:checkbox').prop('checked', this.checked);\n });\n\n $(\".showHistoryTable\").on(\"click\", function() {\n $('.sm-editing-table--history').toggle();\n });\n\n }", "function handleSave(){\n props.onAdd(qItems);\n props.toggle(); \n }", "onSavePress() {\n\t\t\tvar sUrl = this._buildPreviewURL(this._buildReturnedURL());\n\t\t\tif (isValidUrl(sUrl) && this._areAllTextFieldsValid() && this._areAllValueStateNones()) {\n\t\t\t\tthis._close(this._buildReturnedSettings());\n\t\t\t} else {\n\t\t\t\tthis._setFocusOnInvalidInput();\n\t\t\t}\n\t\t}", "function OnBtnSave_Click( e )\r\n{\r\n Ti.App.fireEvent( \"form:save_from_section\" ) ;\r\n}", "function OnBtnSave_Click( e )\r\n{\r\n Ti.App.fireEvent( \"form:save_from_section\" ) ;\r\n}", "function OnBtnSave_Click( e )\r\n{\r\n Ti.App.fireEvent( \"form:save_from_section\" ) ;\r\n}", "function OnBtnSave_Click( e )\r\n{\r\n Ti.App.fireEvent( \"form:save_from_section\" ) ;\r\n}", "'.save click'() {\n this.saveContact();\n Navigator.openParentPage();\n\n // Prevent the default submit behavior\n return false;\n }", "function Save() {\n if ($('#ab041AddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab041\",vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n } else {\n dataContext.upDate(\"/api/ab041\", vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n }\n }\n }", "function saveAndClose(){\n save_button.addEventListener('click', function(event){\n event.preventDefault();\n active_element.innerHTML = editable_content.value;\n let json = {\n project_id: iframe.attributes['data-project-id'].value,\n selector: getUniqueSelector(active_element),\n change_value: editable_content.value,\n comment: content_comment.value\n }\n let myJSON = JSON.stringify(json);\n // Send data to backend\n let xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"/savechanges\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n // Typical action to be performed when the document is ready:\n console.log(\"Saved!\");\n }\n };\n xhr.send(myJSON);\n\n pu.style.display = 'none';\n editable_content.innerHTML = \"\";\n });\n close_button.addEventListener('click', function(){\n pu.style.display = \"none\";\n editable_content.innerHTML = \"\";\n });\n }", "function doSave(oExactBrowser, bSkip) {\n\t\toExactBrowser._saveDialog.close();\n\t\tif(!bSkip){\n\t\t\talert(\"Save: \"+oExactBrowser._saveTextField.getValue());\n\t\t}\n\t}", "save(){\n //\n }", "function save(model) {\n // who knows what this does\n }", "function setSaveEvent(data){\n\t\tvar theID = '#save_' + data.doc.index;\n\t\tscroll_id = '#save_' + data.doc.index;\n\t\t$(theID).click(function(){\n\n\t\t\t$.each(jsonData.rows,function(i){\n\t\t\t\tif(jsonData.rows[i].doc.index == data.doc.index){\n\t\t\t\t\tconsole.log(\"we are SAVING \" + data.doc.index);\n\t\t\t\t\t// Update the video name to JSON database\n\t\t\t\t\tthis_video_name= document.getElementById(\"nameForSaving\").innerHTML + \"_\" + data.doc.index +\n\t\t\t\t\t\t\t\"_\" + data.doc._id + \".mp4\";\n\n\t\t\t\t\t$(\"#save-to-disk\").trigger('click');\n\t\t\t\t\tjsonData.rows[i].doc[\"video\"] = this_video_name;\n\t\t\t\t\tsendUpdateJSONRequest();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t})\n\t\tsendUpdateJSONRequest();\n\t});\n}", "function buttonSaveCallback(data)\n{\n alert(data);\n}", "function save(){\r\n\tutil.log(\"Data: Saving All...\");\r\n\t//Save Each\r\n\tutil.log(\"Data: Saving Done...\");\r\n}", "_handleClickButtonSave()\n {\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__RESOURCELIST_SAVE, {resourcelist: this.model,\n fields: {resource_type: this.ui.selectResourceType.val(),\n name: this.ui.resourceListName.val(),\n description: this.ui.resourceListDescription.val()}});\n }", "click() {\n let $saveIcon = $(\"#\" + this.recId + \" .save_button i\");\n\n RecButton.toggleIconFill($saveIcon);\n\n if ($saveIcon.hasClass(\"fas\")) {\n DatabaseUpdater.putRecToUserWatchlist(this.rec, CurrentUser);\n } else {\n DatabaseUpdater.deleteRecFromUserWatchlist(this.rec, CurrentUser);\n }\n }", "function openSaveAs() {\n var ediv = $(\"#edit-widget-content\").get(0);\n if ($.data(ediv, \"assetid\")) {\n saveAssetContent(null,null);\n } else {\n if (contentEditCriteria.producesResource) {\n $.perc_browser({on_save:onSave, initial_val:\"\"});\n } else {\n saveAssetContent(contentEditCriteria.contentName,null);\n }\n }\n }", "onAfterSaveCell(){\n console.log(\"saved!\");\n alert(\"test\");\n }", "function onSaveButtonPress() {\n\tif (!validateSettings()) return;\n\tdlgMain.close(saveButtonID);\n}", "function handleSave(e) {\r\n let target = e.target,\r\n query = target.dataset.query;\r\n\r\n if (query) {\r\n switch (query) {\r\n case \"saveSetting\": {\r\n let settings = list.map((item) => {\r\n return item.value;\r\n });\r\n\r\n settings.push(0); //current iteration\r\n\r\n Firebase.setValue(settings, \"settings\").then(() => {\r\n sessionStorage.setItem(\"isNewUser\", false);\r\n //Notification().showMessage(\"success\", \"Successfully saved!\");\r\n window.location.hash = \"#task-list\";\r\n });\r\n\r\n break;\r\n }\r\n }\r\n }\r\n }", "function handleSaveChangesButton(event, file_name_stockImg) {\n let startDate = $('#startDate').val();\n let stockPublished;\n if (document.getElementById('published').checked) {\n stockPublished = \"true\";\n } else {\n stockPublished = \"false\";\n }\n startDate = moment(startDate).format(\"YYYY-MM-DD\")\n let endDate = \"\"\n if ($('#endDate').val() !== null || $('#endDate').val() !== \"\") {\n endDate = $('#endDate').val()\n endDate = moment(endDate).format(\"YYYY-MM-DD\")\n }\n if (endDate === \"Invalid date\") {\n endDate = \"\"\n }\n\n const stock = {\n id: $('#stockId').val(),\n stockImg: file_name_stockImg,\n stockTitle: $('#stockTitle').val(),\n stockText: $('#stockText').summernote('code'),\n startDate: startDate,\n endDate: endDate,\n published: stockPublished\n }\n let method = (stock.id !== '' ? 'PUT' : 'POST')\n fetchStock(stock, method)\n\n function fetchStock(stock, method) {\n fetch(stockApiUrl, {\n method: method,\n headers: myStockHeaders,\n body: JSON.stringify(stock)\n }).then(function (response) {\n if (response.status === 200) {\n successActionMainPage(\"#mainWindowAlert\", \"Акция успешно сохранена\", \"success\")\n } else {\n successActionMainPage(\"#mainWindowAlert\", \"Акция не сохранена\", \"error\")\n }\n })\n }\n\n $('#stockModal').modal('hide')\n}", "function saveData() {\n\t\t\n\t\t// After Save, Alert User with a Dailog //\n\t\t$.mobile.changePage( \"#dialogAlert\", {\n\t\t transition: \"pop\",\n\t\t reverse: false,\n\t\t changeHash: false\n\t\t});\n\n\t\t// When #alertDialog Loads, Target ID, Clear the Div and Append the Following Save Alert //\n\t\t// In A listview with an Anchor Leading to #viewData //\n\t\t$('#alert').empty();\n\t\t$('#alert').append($('<li>').append($('<a href=\"#viewData\" id=\"saveAlertLink\" data-icon=\"rightarrow\"></a>')\n\t\t\t.append($('<img src=\"save.png\" class=\"iconImg\" />' +\n\t\t\t\t'<h4>Hooray!</h4>' +\n\t\t\t\t'<p>Your Loan Has Been Saved!</p>')\n\t\t)));\n\t\t// Refresh The Dialog listview to Ensure Proper View //\n\t\t$('#alert').listview(\"refresh\");\n\t}", "function clickSave(event) {\n event.preventDefault();\n if ($('#title-input').val() === \"\" || $('#task-input').val() === \"\") return false;\n var card = new CreateCard($('#title-input').val(), $('#task-input').val())\n $( \".bottom-box\" ).prepend(makeCardHTML(card)); \n localStoreCard(card);\n $('form')[0].reset();\n $('.character-count-task').text(0);\n $('.character-count-title').text(0);\n}", "function saveAndExit() {\n scope.showSaveAndExitModal = true;\n }", "onSaved() {\n if (this._saved) {\n this._saved.raise();\n }\n }", "onClickSave() {\n SettingsHelper.setSettings(this.projectId, null, 'info', this.model)\n .then(() => {\n this.modal.hide();\n\n this.trigger('change', this.model);\n })\n .catch(UI.errorModal);\n }", "function handleSave() {\n console.log('in handleSave');\n const updatedList = {\n id: trip.id,\n location: title,\n start_date: date,\n days: days,\n }\n console.log('Updated trip info:', updatedList);\n //update list to reflect changes by triggering events stemmed from update list reducer\n dispatch({ type: 'UPDATE_LIST', payload: updatedList })\n //reset edit mode to false\n setEditMode(false)\n // history.push('/user')\n }", "save() {\n try {\n this._toggleSaveThrobber();\n this._readFromForm();\n this.dao.save();\n\n // make sure the edit input is showing the correct id, reload data from server\n document.getElementById('edit_id').value = this.dao.id;\n this.read();\n \n } catch(e) {\n console.log(e);\n alert(e);\n }\n this._toggleSaveThrobber();\n }", "function saveClicked () {\n // TODO - the disabling of the submit button should be in AJS.Dialog.\n var submitButton = $(\".permissions-update-button\").disable();\n if (isEditPage) {\n updateEditPage();\n\n // Notify the user that the changes are not yet saved to the back-end.\n AJS.setVisible(\"#page-permissions-unsaved-changes-msg\", permissionManager.permissionsEdited);\n submitButton.enable();\n closeDialog();\n } else {\n var post = permissionManager.makePermissionStrings();\n post.pageId = AJS.params.pageId;\n $(\"#waitImage\").show();\n\n AJS.safe.post(contextPath + \"/pages/setpagepermissions.action\", post, function(data) {\n $(\"#waitImage\").hide();\n\n // If any permissions set, show padlock\n AJS.setVisible(\"#content-metadata-page-restrictions\", data.hasPermissions);\n submitButton.enable();\n closeDialog();\n }, \"json\");\n }\n }", "function saveClicked () {\n // TODO - the disabling of the submit button should be in AJS.Dialog.\n var submitButton = $(\".permissions-update-button\").disable();\n if (isEditPage) {\n updateEditPage();\n\n // Notify the user that the changes are not yet saved to the back-end.\n AJS.setVisible(\"#page-permissions-unsaved-changes-msg\", permissionManager.permissionsEdited);\n submitButton.enable();\n closeDialog();\n } else {\n var post = permissionManager.makePermissionStrings();\n post.pageId = AJS.params.pageId;\n $(\"#waitImage\").show();\n\n AJS.safe.post(contextPath + \"/pages/setpagepermissions.action\", post, function(data) {\n $(\"#waitImage\").hide();\n\n // If any permissions set, show padlock\n AJS.setVisible(\"#content-metadata-page-restrictions\", data.hasPermissions);\n submitButton.enable();\n closeDialog();\n }, \"json\");\n }\n }", "save() {\n }", "function formContainerEditSaveHandler(){}", "function saveButtonOnClick(ev)\n{\n\tlet stopPointInfo = getCurrentStopPointInfo();\n\t//console.log(\"saveButtonOnClick(\", ev, \"): name \", stopPointInfo.name);\n\tlet savedStopPoints = generateStopPointsToSave(stopPointTable, stopPointInfo);\n\tstorage.setStopPoints(savedStopPoints);\n}", "function save() {\n\t\tdocument.getElementById(\"mySavedModel\").value = myDiagram.model.toJson();\n\t\tmyDiagram.isModified = false;\n\t}", "function userSavesHandler() {\n\tif (!filepath) {\n\t\tdialog.showSaveDialog(savePathChosenHandler);\n\t} else {\n\t\twriteToFile(filepath)\n\t}\n}", "save() {}", "save () {\n\n // Validate\n if (this.checkValidity()) {\n\n // Collect input\n this.info.item = this.collectInput();\n\n // Show modal\n this.modal.show();\n }\n }", "_savefile (index) {\n const save = this.shadowRoot.querySelector('#save')\n const bind = onClick.bind(this)\n const input = this.shadowRoot.querySelector('input')\n const text = this.shadowRoot.querySelector('textarea')\n save.addEventListener('click', bind)\n function onClick () {\n if (input.value.length !== 0) {\n var d = new Date()\n const hours = d.getHours()\n const minuites = d.getMinutes()\n let time\n if (hours >= 12) {\n time = hours + ':' + minuites + ' PM'\n } else {\n time = hours + ':' + minuites + ' AM'\n }\n this._upload(input.value, text.value, index, time)\n input.value = ''\n text.value = ''\n }\n save.removeEventListener('click', bind)\n }\n }", "function saveSubmit() {\n\tvar sPath = '';\n\tsPath += document.getElementById('currentRoot').value;\n\tsPath += document.getElementById('currentFolder').value;\n\tif (selectedType == 'file') {\n\t\twindow.opener.filelibraryAction(sPath + selectedFile);\n\t\twindow.close();\n\t}\t\t\n}", "async function save_callback(ev) {\n ev.preventDefault();\n\n save_data();\n}", "function handleSaveButtonAjax(e) {\n\t\te.preventDefault();\n\t\tthis.blur();\n\n\t\tif (isSaving) {\n\t\t\t// If an AJAX save is currently being performed, submit the form immediately\n\t\t\t// This is because the user expects the button to be reliable\n\t\t\t$('#picture').val('');\n\t\t\t$('#application-form').submit();\n\t\t}\n\t\telse {\n\t\t\thandleAjaxSave(function() {\n\t\t\t\t$('#application-form').submit();\n\t\t\t})\n\t\t}\n\t}", "function ep_Save() {\n\tvar bankAccount = nlapiGetFieldValue('custpage_2663_bank_account');\n\tvar batchId = nlapiGetFieldValue('custpage_2663_batchid');\n\tif (bankAccount && batchId) {\n\t\tif (!document.forms['main_form'].onsubmit || document.forms['main_form'].onsubmit()) {\n\t\t\tupsertBatch(bankAccount, batchId);\n\t\t\t\n\t\t\t// set the refresh flag\n\t\t nlapiSetFieldValue('custpage_2663_refresh_page', 'T', false);\n\n // set to view mode\n nlapiSetFieldValue('custpage_2663_edit_mode', 'F', false);\n \n\t\t // suppress the alert\n\t\t setWindowChanged(window, false);\n\t\t \n\t\t // submit the form -- calls submitForm function\n\t\t document.forms.main_form.submit();\n\t\t}\n\t}\n}", "function saveEditedTaskButtonHandler(obj)\n{\n // first: grab the task ID and data\n const row = getGrandparent($(obj));\n const taskType = getRowsTable(row);\n const taskID = getSavedTaskID(row);\n const taskData = getNewTaskData(row);\n const taskObject = buildTaskData(taskData[0], taskData[1], taskData[2], taskData[3], taskData[4]);\n // save data to the DOM\n saveTaskData(taskID, taskObject);\n // update the task table\n updateTask(row, taskObject);\n saveToEdit($(obj), $(obj).parent());\n}", "function onSaveSuccess(data, response, xhr)\n\t{\n\t\t// update id's and scope in case they change\n\t\t// this happens when switching from global\n\t\t// to page specific fields (switching scope)\n\t\tthis.data.node.data = data;\n\t\tthis.data.node.data.originals = this.originals;\n\t\tthis.data.field = this.data.node.data;\n\n\t\tthis.view.empty();\n\t\tthis.view.append(this.renderField(this.data.field, true));\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tLiveUpdater.changedField(this.data.field);\n\t}", "function handleSaveButton() {\n $(\".main-area\").on(\"submit\", \"#js-edit-form\", function(e) {\n console.log(\"Save button clicked\");\n // stop from form submitting\n e.preventDefault();\n // create variable that holds title value\n let title = $(\"#journal-title\").val();\n // create variable that holds date value\n let travelDate = $(\"#travel-date\").val();\n // create variable that hold image value\n let coverPhoto = $(\"#main-image\").val();\n // if this (main-area) data method entry id equal undefined (meaning nothing inputted) is true\n if ($(this).data(\"entryid\") === undefined) {\n // call create entyr function with title, date and photo as parameter\n createEntry(title, travelDate, coverPhoto);\n } else {\n const id = $(this).data(\"entryid\");\n // create new entry object that has different keys\n const newEntry = {\n id,\n title,\n travelDate,\n coverPhoto\n };\n // call save entry with new entry object as a parameter\n saveEntry(newEntry);\n }\n });\n}", "submitSave() {\n confirmAlert({\n title: 'Confirm To Save',\n message: 'Are you sure you want to do this?',\n buttons: [\n {\n label: 'Yes',\n onClick: () => this.saveData()\n },\n {\n label: 'No',\n onClick: () => { }\n }\n ],\n closeOnEscape: true,\n closeOnClickOutside: true\n });\n }", "function saveClickEvent(e)\n {\n e.stopPropagation();\n e.stopImmediatePropagation();\n var rowID = e.target.id;\n var rowCostBox = document.getElementById(\"cost\"+rowID)\n var rowCost = rowCostBox.value;\n var rowQuantBox = document.getElementById(\"quant\"+rowID)\n var rowQuant = rowQuantBox.value;\n\n //validates as number\n if(isNaN(rowCost)){\n alert(\"Cost must be a number\");\n return;\n }\n if(isNaN(rowQuant)){\n alert(\"Quantity must be a number\");\n return;\n }\n //converts to numbers, 2 decimal place float and integer\n rowCost = + parseFloat(rowCost).toFixed(2);\n rowQuant = parseInt(rowQuant);\n //checks non-negative\n if(rowCost<0 || rowQuant<0){\n alert(\"Cannot enter negative values\");\n return;\n }\n //ajax for saving result of a row\n $.ajax({\n type: \"POST\",\n url: 'editRow.php',\n data: {editCost: rowCost, editQuantity: rowQuant, editID: rowID},\n success: function(data){\n //send confirmation msg and marks boxes as saved\n alert(data);\n rowCostBox.style.color = \"black\";\n rowQuantBox.style.color = \"black\";\n },\n error: function(xhr){\n alert(xhr.status);\n }\n });\n }", "function save() {\n //验证表单\n if (!$(\"#editForm\").validate())\n return false;\n var strData = \"{\";\n strData += \"'strItemID':'\" + $(\"#ItemID\").val() + \"',\";\n strData += \"'strCharge':'\" + $(\"#CHARGE\").val() + \"',\";\n strData += \"'strPowerFee':'\" + $(\"#TEST_POWER_FEE\").val() + \"',\";\n strData += \"'strPreFree':'\" + $(\"#PRETREATMENT_FEE\").val() + \"',\";\n strData += \"'strTestAnsyFree':'\" + $(\"#TEST_ANSY_FEE\").val() + \"',\";\n strData += \"'strTestPointNum':'\" + $(\"#TEST_POINT_NUM\").val() + \"',\";\n strData += \"'strAnsyNum':'\" + $(\"#ANALYSE_NUM\").val() + \"'\";\n strData += \"}\";\n\n $.ajax({\n cache: false,\n type: \"POST\",\n url: \"ItemPrice.aspx/EditItem\",\n data: strData,\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (data, textStatus) {\n if (data.d == \"1\") {\n detailWin.hidden();\n manager.loadData();\n clearDialogValue();\n }\n else {\n $.ligerDialog.warn('保存项目数据失败!');\n }\n }\n });\n }", "function save() {\n $scope.broadcastFromRoot(addPageCtrl.constants.CC_PAGE_ADDED, { page: addPageCtrl.page });\n closeDialog();\n }", "function pfClickedSave(mode){\n\tvar targetArray = connectArray(mode);\n\tvar keyList = connectList(mode);\n\tprocessList(targetArray, keyList);\n\tsetCookie();\n\tdocument.getElementById(\"overpanel\").style.display = \"none\";\n}", "_event_saved() {\n\t\tlet ev = new Event(\"saved\", { \"bubbles\": true, \"cancelable\": true });\n\t\tthis.dispatchEvent(ev);\n\t}", "function onEditDialogSave(){\r\n\t\t\r\n\t\tif(!g_codeMirror)\r\n\t\t\tthrow new Error(\"Codemirror editor not found\");\r\n\t\t\r\n\t\tvar content = g_codeMirror.getValue();\r\n\t\tvar objDialog = jQuery(\"#uc_dialog_edit_file\");\r\n\t\t\r\n\t\tvar item = objDialog.data(\"item\");\r\n\t\t\r\n\t\tvar data = {filename: item.file, path: g_activePath, pathkey: g_pathKey, content: content};\r\n\t\t\r\n\t\tg_ucAdmin.setAjaxLoaderID(\"uc_dialog_edit_file_loadersaving\");\r\n\t\tg_ucAdmin.setErrorMessageID(\"uc_dialog_edit_file_error\");\r\n\t\tg_ucAdmin.setSuccessMessageID(\"uc_dialog_edit_file_success\");\r\n\t\t\r\n\t\tassetsAjaxRequest(\"assets_save_file\", data);\r\n\t\t\r\n\t}", "function saveEdited(){\n\tactiveDataSet = studentList.find( arr => arr.absenceId == activeElement ); \n\t$.post(\"\", {\n\t\t\t\t'type': 'editabsence',\n\t\t\t\t'console': '',\n\t\t\t\t'aid': activeDataSet['absenceId'],\n\t\t\t\t'id': activeElement,\n\t\t\t\t'start': formatDateDash(document.getElementById('esickstart').value),\n\t\t\t\t'end': formatDateDash(document.getElementById('esickend').value),\n\t\t\t\t'comment': document.getElementById('ecomment').value,\n\t\t\t\t'evia': document.querySelector('input[name=\"evia\"]:checked').value\n }, function (data,status) {\n\t\t\t\thandleServerResponse(data, status);\n\t\t\t});\t\n}", "saveItem() {\n\n }", "function setSave(e) {\n e.preventDefault();\n character.savingThrowModifier.strength = document.getElementById('strSave').value;\n character.savingThrowModifier.dexterity = document.getElementById('dexSave').value;\n character.savingThrowModifier.constitution = document.getElementById('conSave').value;\n character.savingThrowModifier.intelligence = document.getElementById('intSave').value;\n character.savingThrowModifier.wisdom = document.getElementById('wisSave').value;\n character.savingThrowModifier.charisma = document.getElementById('chaSave').value;\n}", "function save(e) {\n var node = e.target;\n if (node.nodeName === 'INPUT' && node.checked) {\n localStorage[node.name] = node.value;\n }\n else if (node.nodeName === 'SELECT') {\n localStorage[node.name] = node.value;\n }\n }", "function save(id) {\n idx = id.replace('save-button','');\n article = {\n \"author\": data.articles[idx].author,\n \"content\": data.articles[idx].content,\n \"description\": data.articles[idx].description,\n \"publishedAt\": data.articles[idx].publishedAt,\n \"title\": data.articles[idx].title,\n \"url\": data.articles[idx].url,\n \"urlToImage\": data.articles[idx].urlToImage\n };\n if(document.getElementById(id).src.includes(\"empty.png\")) {\n document.getElementById(id).src = \"images/save_icon_fill.png\";\n $(\"#\"+id).after('<p id=\"success\">Added article to Saved!</p>');\n $(\"#success\").delay(2000).fadeOut();\n saveArticle(article);\n } else {\n document.getElementById(id).src = \"images/save_icon_empty.png\";\n $(\"#\"+id).after('<p id=\"success\">Removed article from Saved!</p>');\n $(\"#success\").delay(2000).fadeOut();\n }\n}", "onClickSave() {\n let saveAction = this.$element.find('.editor__footer__buttons select').val();\n let postSaveUrl;\n\n let setContent = () => {\n // Use publishing API\n if(this.model.getSettings('publishing').connectionId) {\n // Unpublish\n if(saveAction === 'unpublish') {\n return HashBrown.Helpers.RequestHelper.request('post', 'content/unpublish', this.model);\n\n // Publish\n } else if(saveAction === 'publish') {\n return HashBrown.Helpers.RequestHelper.request('post', 'content/publish', this.model);\n \n // Preview\n } else if(saveAction === 'preview') {\n return HashBrown.Helpers.RequestHelper.request('post', 'content/preview', this.model);\n\n }\n }\n\n // Just save normally\n return HashBrown.Helpers.RequestHelper.request('post', 'content/' + this.model.id, this.model);\n }\n\n this.$saveBtn.toggleClass('working', true);\n\n // Save content to database\n setContent()\n .then((url) => {\n postSaveUrl = url;\n \n return HashBrown.Helpers.RequestHelper.reloadResource('content');\n })\n .then(() => {\n this.$saveBtn.toggleClass('working', false);\n \n this.reload();\n \n HashBrown.Views.Navigation.NavbarMain.reload();\n\n this.dirty = false;\n\n if(saveAction === 'preview') {\n UI.iframeModal(\n 'Preview',\n postSaveUrl\n );\n }\n })\n .catch((e) => {\n this.$saveBtn.toggleClass('working', false);\n UI.errorModal(e);\n });\n }", "save() {\n this._requireSave = true;\n }", "function handleSave(event) {\n event.preventDefault();\n setSaving(true);\n if (addOrEditContactType === messages.Add) onAddContact(addOrEditContact);\n else onUpdateContact(addOrEditContact);\n history.push('/contact-list');\n const contact = { ...addOrEditContact };\n const name = `${contact.firstname} ${contact.lastname}`;\n toast.success(`${messages.toastcontact} ${name} ${messages.toastsaved}`);\n }", "function saveBook(event) {\n event.preventDefault();\n let currentTitle = this.querySelector('[name=title-x]').value;\n let currentAuthor = this.querySelector('[name=author-x]').value;\n let currentPages = this.querySelector('[name=pages-x]').value;\n const userBook = new Book(currentTitle, currentAuthor, currentPages);\n addBookToLibrary(userBook);\n document.querySelector(\".modal\").style.display = 'none';\n formatBookObject();\n}", "function saveCallback()\n {\n clearUndoBuffer();\n updateUndoButton();\n if (!($('#perc-region-tool-inspector').hasClass('buttonPressed')))\n {\n $(\"#perc-undo-tool\").hide();\n $(\"#perc-undo-tool-disabled\").hide();\n }\n }", "saveBook(event) {\n const bookInfo = event.target;\n API.saveBook({\n title: bookInfo.dataset.title,\n authors: bookInfo.dataset.authors,\n description: bookInfo.dataset.description,\n image: bookInfo.dataset.image,\n link: bookInfo.dataset.link\n })\n .then(res => console.log('Saved!'))\n //SEND OUT A MODAL WHEN YOU GET A CHANCE\n .catch(err => console.log(err));\n }", "function doSaveDocument() {\n var presenter = new mindmaps.SaveDocumentPresenter(eventBus,\n mindmapModel, new mindmaps.SaveDocumentView(), autosaveController, filePicker);\n presenter.go();\n }", "function edit(e) {\n e.preventDefault()\n const editBox = document.createElement(\"input\")\n const saveButton = document.createElement(\"button\")\n editBox.value = e.currentTarget.parentElement.firstElementChild.innerText\n saveButton.innerText = \"save\"\n // saveButton.addEventListener(\"click\", save(e))\n e.currentTarget.parentElement.firstElementChild.appendChild(editBox)\n e.currentTarget.parentElement.firstElementChild.appendChild(saveButton)\n // e.target.remove(target)\n\n}" ]
[ "0.79770654", "0.79770654", "0.72572094", "0.7254854", "0.7228365", "0.7221425", "0.7190218", "0.71634847", "0.7100591", "0.70950043", "0.70810235", "0.7017893", "0.7002524", "0.6998178", "0.69302905", "0.691032", "0.68942547", "0.6866755", "0.685673", "0.6823339", "0.6818064", "0.68151975", "0.67937386", "0.67910415", "0.67794824", "0.6776585", "0.6774531", "0.67684823", "0.67542225", "0.6744211", "0.67367953", "0.67327315", "0.6711584", "0.6709208", "0.6704651", "0.6701672", "0.6700955", "0.6700526", "0.6700526", "0.6700526", "0.6700526", "0.6699926", "0.6697905", "0.66954726", "0.66910017", "0.6683258", "0.6666093", "0.6655112", "0.6645908", "0.6625733", "0.6625514", "0.66129345", "0.66088665", "0.6608151", "0.6602608", "0.6596285", "0.65879714", "0.6580529", "0.6575313", "0.6569778", "0.65602225", "0.6559773", "0.6553211", "0.655163", "0.65500414", "0.65500414", "0.6539476", "0.6510832", "0.6508975", "0.6492635", "0.64909697", "0.6484641", "0.6479876", "0.6476859", "0.6470031", "0.6464409", "0.64622533", "0.6462096", "0.6448791", "0.6424173", "0.64189565", "0.64092433", "0.6408283", "0.63978034", "0.63967526", "0.6392211", "0.6391789", "0.63869643", "0.6376124", "0.6376032", "0.6358427", "0.6353983", "0.6328626", "0.63272613", "0.63246685", "0.6323961", "0.6322695", "0.63223505", "0.6320958", "0.6313403", "0.6312787" ]
0.0
-1
Event Handler for "Cancel" onclick
handleCancelRow(event) { this.showInputSection = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cancel(e) { }", "_handleClickCancel(e) {\n if (DEBUG) {\n console.log('[*] ' + _name + ':_handleClickCancel ---');\n }\n\n e.preventDefault();\n }", "function cancel() {\r\n click(getCancel());\r\n waitForElementToDisappear(getCancel());\r\n }", "function onCancelClick() {\n logger.info('cancel_button click event handler');\n clearAllErrors();\n closeKeyboards();\n $.edit_customer_profile.fireEvent('route', {\n page : 'profile',\n isCancel : true\n });\n}", "function handleCancelButton() {\n\t\tconsole.log(\"Now cancelling action..\");\n\t\tCounterStart = 0; \t// reset counter\t\t\t\t\n\t\tcloseCancelPopup();\n\t\trevertChanges(command);\n\t\tconsole.log(\"Reverting changes..\");\t\n\t}", "function clickedCancel()\r\n{\r\n recordsetDialog.onClickCancel(window);\r\n}", "function buttonCancelClickFunc(){\r\n\t\tself.close(); //关闭对话框\r\n\t\tif(self.buttonCancelCallback!=null){\r\n\t\t\tself.buttonCancelCallback();\r\n\t\t}\r\n\t}", "onCancelButtonClick() {\n this.representedHTMLElement.parentNode.removeChild(this.representedHTMLElement);\n }", "cancelButtonClickEventListener(e)\n\t{\n\t\tthis.modalPanel.hide();\n\t\tthis.minSubtitleIntervalCallback(-1);\n\t}", "function cancelClick(e)\r\n{\r\n if (!e) var e = window.event;\r\n e.cancelBubble = true;\r\n if (e.stopPropagation) e.stopPropagation();\r\n}", "function onCancelClick(e) {\n e.preventDefault();\n if (window.history.length === 1) {\n window.close();\n }\n window.history.back();\n }", "cancel(evt) {\n if (evt.stopPropagation) evt.stopPropagation();\n if (evt.preventDefault) evt.preventDefault();\n return false;\n }", "cancelForm() {\n this.sendAction(\"onCancel\", null);\n }", "onClick_cancel() {\n this.props.onCancel()\n }", "cancelAction(){}", "cancelEvent() {\n }", "cancel() {\n\n }", "function checkCancel(event) {\n if (event.which === 27) {\n preventDefault(event);\n cancel();\n }\n } // prevent ghost click that might occur after a finished", "cancel(e) {\n // reset and close dialog\n this.close();\n }", "cancel() {\n if (this.isCancelDisabled)\n return;\n this.isCancelDisabled = true;\n this.closeEnrollment_('cancel');\n }", "function onCancelButtonClick() {\n modal.close();\n }", "function onCancelButtonClick() {\n modal.close();\n }", "handleCancel() {\n\t\tthis.clearInputs();\n\n\t}", "function cancel(event)\n\t{\n\t\tif(event.preventDefault)\n\t\t\tevent.preventDefault();\n\t\t\n\t\treturn false;\n\t}", "cancel() {\n cancel();\n }", "cancelEvent(e) {\n e.stopImmediatePropagation();\n e.preventDefault();\n }", "_cancel() {\n this.dispatchEvent(new CustomEvent('cancel', {\n composed: true\n }));\n }", "cancel() {}", "function cancel(e) {\n e.parentNode.parentNode.removeChild(e.parentNode)\n}", "handleCloseClick(event) {\n event.preventDefault();\n this.doFormCancel();\n }", "function cancel(event) {\n if (event.preventDefault) {\n event.preventDefault();\n }\n\n return false;\n}", "handleCancel() {\n this.dispatchEvent(new CustomEvent('close'));\n }", "function handleCancel() {\n if (window.confirm(\"Do you want to cancel this student? This cannot be undone.\")) {\n const abortController = new AbortController();\n\n updateStudentStatus(student.student_id, \"cancelled\", abortController.status)\n .then(loadDashboard);\n\n return () => abortController.abort();\n }\n }", "function checkCancel(event) {\n\n if (event.which === 27) {\n event.preventDefault();\n\n cancel();\n }\n }", "function cancelActionClick(event) {\n\tconst deleteActionElement = event.target;\n\tconst deleteActionUrl = (\"/api/transaction/\" + getTransactionId());\n\n\tdeleteActionElement.disabled = true;\n\n\tajaxDelete(deleteActionUrl, (callbackResponse) => {\n\t\tdeleteActionElement.disabled = false;\n\n\t\tif (isSuccessResponse(callbackResponse)) {\n\t\t\twindow.location.replace(\"/mainMenu\");\n\t\t}\n\t});\n}", "function cancelHandler(event) {\n event.cancelBubble = true;\n\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n } // This handler ignores the current event in the InfoBox and conditionally prevents", "function cancel(event) {\n let dialog = document.getElementById(\"dialog\");\n document.getElementById(\"title\").value = \"\";\n document.getElementById(\"post\").value = \"\";\n document.getElementById(\"submit-btn\").innerHTML = \"Submit\";\n dialog.open = false;\n console.log(\"cancel\");\n}", "handleCancelButton(){\n console.log(\"handleCancelButton\");\n }", "function cancel() {\n window.history.back();\n}", "handleCancelButtonDialog() {\n this.showDialog(false);\n }", "function onCanceled(cancelEventArg) {\n cancel = true;\n cancelReason = cancelEventArg;\n }", "function cancel() {\n scope.showCancelModal = true;\n }", "handleCancel() {\n this.handleModalToggle();\n this.resetData();\n }", "function cancel(e) {\n titleTask.value = null;\n descriptionTask.value = null;\n e.target.parentElement\n .parentElement\n .parentElement\n .classList.toggle('show');\n root.classList.toggle('opacity');\n document.body.classList.toggle('stop-scrolling');\n}", "function ntCancel() {\n removeMask();\n $('#nt-confirm-box').hide();\n if (nt.confirm_cancel_callback)\n nt.confirm_cancel_callback();\n nt.confirm_cancel_callback = null;\n}", "onCancel(event) {\n event.preventDefault();\n const { onClose } = this.props;\n if (onClose) {\n onClose();\n }\n }", "function checkCancel(event) {\n\n if (isKey('Escape', event)) {\n preventDefault(event);\n\n cancel();\n }\n }", "function cancel ()\n {\n $uibModalInstance.dismiss('cancel');\n }", "function checkCancel(event) {\n\n if (event.which === 27) {\n preventDefault(event);\n\n cancel();\n }\n }", "actionCancel() {\n this.source && this.source.cancel('Operation canceled by the user.');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function checkCancel(event) {\n if (event.which === 27) {\n preventDefault(event);\n cancel();\n }\n }", "acceptCancel() {}", "cancel() {\n this.disableEditMode();\n (this.props.onCancel || Function)();\n }", "onCancel_() {\n this.close();\n }", "function cancel() {\n gotoReturnState();\n }", "function LPcancelClicked(){\r\n if (LPCANCEL && LPflag==1){\r\n LPshowLayer();\r\n LPCLOSE=false;\r\n LPCANCEL=false;\r\n }\r\n else\r\n {\r\n setTimeout(\"LPcancelRedirect()\", 1000);\r\n }\r\n}", "function cancel() {\n history.goBack();\n }", "function cancelClick() {\n window.location.href = '/';\n}", "function cancelForm(e) {\n e.preventDefault();\n return false;\n}", "function handle_cancel() {\n $(\"table.data-table tr.selected\").removeClass(\"selected\");\n $.featherlight.current().close();\n}", "function onCanceled(cancelSender, cancelReason) {\n cancel = true;\n }", "cancel() {\n if (this.isCloseable_) {\n this.userActed('cancel');\n }\n }", "function cancelClicked()\n{\n dwscripts.setCommandReturnValue(\"\");\n\n window.close();\n}", "onCancelPress() {\n\t\t\tthis._close();\n\t\t}", "handleCancel() {\n this.cancel = true;\n this.changeScreen('screen-input');\n }", "cancel() {\n throw new Error(\"Not implemented.\")\n }", "function cancel() {\n\t\t\tfocusedControl.fire('cancel');\n\t\t}", "function cancel() {\n\t\t\tfocusedControl.fire('cancel');\n\t\t}", "function cancel() {\n\t\t\tfocusedControl.fire('cancel');\n\t\t}", "onCancelEvent(){\n Alert.alert(\n 'Discard event?',\n 'Are you sure to discard the entire event?',\n [\n {text: 'Yeah, discard', onPress: () => { this.props.removeEventDataAction(this.state.eventId) }},\n {text: 'Cancel', onPress: () => {}, style: 'cancel'}\n ],\n { cancelable: false }\n )\n }", "handleCancel(event){\n this.showMode=true;\n this.hideButton=false;\n this.setEdit = true;\n this.hideEdit=false; \n }", "onCancel() {\n this.resetForm();\n }", "function handleCancel() {\n resetLocalDateRangeParams();\n setAnchorEl(null);\n }", "handleCancel() {\r\n this.props.onCancel();\r\n }", "function cancelCallback()\n {\n deactivateInspectionToolButton();\n clearUndoBuffer();\n _layoutFunctions.enableToolbarMenu();\n }", "function cancel() {\r\n const wrapper = document.querySelector(\".afhalen-wrapper\");\r\n wrapper.style.display = \"none\";\r\n resetState();\r\n // just to clear the error box\r\n sendErrorMessage(\"\");\r\n\r\n }", "function handleCancel()\n{\n // for browswers that handle .returnValue properly\n window.returnValue = \"\";\n\n // if not, attach returnValue to the opener\n if (window.opener) {\n window.opener.returnValue = \"\";\n }\n\n window.close();\n}", "function onCancelClick() {\n $.trigger('promptSignature:cancel_signature');\n}", "function submitCancelHandler() {\n\tself.CONTENTS.cancel();\n\tself.opener.focus();\n\t//self.close();\n }", "function cancel() {\n $('#confirmExportModal').css('display', 'none');\n $('#confirmImportModal').css('display', 'none');\n $('#confirmDownloadLogModal').css('display', 'none');\n $('#confirmCustomSchedExportModal').css('display', 'none');\n }", "function modalDialog2_handleCancel (e) {\r\n\t\tvar errorDiv = e.data.errorDiv;\r\n\r\n\t\terrorDiv.hide();\r\n\t\tmodalDialog2_destroyModal(e);\r\n\t}", "modalCancel(){\n\t\t// save nothing\n this.setValues = null;\n\t\t// and exit \n this.modalEXit();\n }", "function StatusCancelBtnClick(s, e) {\n \n if ($(\"#ExternalNoteGrid\").length != 0) {\n ExternalNoteGrid.PerformCallback();\n }\n //Refresh RMSDocumentsGrid On popup close\n if ($(\"#RMSDocumentsGrid\").length != 0) {\n RMSDocumentsGrid.PerformCallback();\n }\n //Removing enter text in textaea\n if ($(\"#popupExternalNoteMemo\").length != 0) {\n popupExternalNoteMemo.SetText(\"\");\n }\n\n AccountNotesPopupClose();\n jQuery.get('../AccountDetails/CleareSessionForRLUpload');\n}", "function CancelModalDialog() {\r\n tb_remove();\r\n }", "function actionCanceled() { \n\tOK = 3;\n\tdlg.hide();\n}", "cancel(ev, force) {\n if (!this.options.cancelEvents && !force) {\n return;\n }\n ev.preventDefault();\n ev.stopPropagation();\n return false;\n }", "function onCancelButtonPress(){\n\tdlgMain.close(cancelButtonID);\n}", "function cancelEvent(e) {\n if (!e) e = window.event;\n if (e.preventDefault) {\n e.preventDefault();\n } else {\n e.returnValue = false;\n }\n}", "function Cancellation() { }", "function Oncancel() {\n console.log('Oncancel event');\n\n //This is a hack; because when the Grid popup is canceled; it appears to update the command row to its initial state\n setTimeout(function () { grid.refresh() },50);\n}", "function cancelEvent(e)\n{\n\te = e ? e : window.event;\n\tif(e.stopPropagation) e.stopPropagation();\n\tif(e.preventDefault) e.preventDefault();\n\te.cancelBubble = true;\n\te.cancel = true;\n\te.returnValue = false;\n\treturn false;\n}", "handleCancel(e) {\r\n e.preventDefault();\r\n if (typeof this.props.onCancel === 'function') {\r\n this.props.onCancel();\r\n }\r\n }", "function addCancelButtonListener(st) {\n if (st.view === \"Home\") {\n return;\n } else {\n document.getElementById(\"cancel\").addEventListener(\"click\", (event) => {\n event.preventDefault();\n render(state.Home);\n });\n }\n}", "onCancelBtnClick() {\n this.dialplanCtrl.onCancelEditDialplan();\n }" ]
[ "0.84697753", "0.8102043", "0.7760309", "0.7737894", "0.76904225", "0.7682232", "0.7569041", "0.75648934", "0.7536879", "0.74954766", "0.7486528", "0.7486163", "0.7478079", "0.7476684", "0.74088424", "0.7395636", "0.739047", "0.73738134", "0.73386055", "0.73128057", "0.7303654", "0.7303654", "0.7297006", "0.7289102", "0.72795445", "0.7256235", "0.72541946", "0.72413546", "0.72386706", "0.7235548", "0.72123224", "0.72017413", "0.71936816", "0.7175859", "0.71563536", "0.7149792", "0.7139856", "0.71366173", "0.71342605", "0.71322286", "0.7122001", "0.71180356", "0.7099234", "0.70986354", "0.70964986", "0.7090098", "0.7080852", "0.7068935", "0.70678383", "0.70430565", "0.7041504", "0.7041504", "0.7041504", "0.7041504", "0.7041504", "0.7041504", "0.7041504", "0.70317256", "0.7030044", "0.70191514", "0.7018835", "0.70163304", "0.70158035", "0.70121974", "0.70112324", "0.70094895", "0.70062745", "0.6987212", "0.69851303", "0.69703144", "0.6966474", "0.69639105", "0.69611216", "0.69592816", "0.69592816", "0.69592816", "0.695644", "0.6940299", "0.6935104", "0.6929036", "0.6925385", "0.69178", "0.6897864", "0.68661386", "0.68621254", "0.6861309", "0.68414223", "0.6830586", "0.6828185", "0.6825534", "0.68250144", "0.6824978", "0.6817542", "0.68030685", "0.67938805", "0.6780231", "0.6774973", "0.6758259", "0.6753531", "0.6738652", "0.671808" ]
0.0
-1
Event Handler for "lightningdatatable" onSelect
handleRowSelection(event) { this.selectedData = this.template.querySelector('lightning-datatable').getSelectedRows(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onSelectRow() {\n // Update selected rows\n if (component.initialized) {\n updateSelectedRows();\n }\n }", "function onSelect(event) {\r\n refresh(JSON.parse(event.data));\r\n}", "function selectHandler() \n {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) \n {\n var selectedLevel = data.getValue(selectedItem.row, 0);\n var hidData = $(\"#hid\"+title+\"PieChartContainer\").val();\n \n if(hidData != undefined){\n var hid_ids = JSON.parse(hidData); \n var selected_ele_ids = hid_ids[selectedLevel];\n ViewerHighLight(selected_ele_ids);\n }\n }\n }", "_onRowSelect(e) {\n let row = e.currentTarget;\n let range = this._range;\n let ord = Number.parseInt(row.getAttribute('data-ordinal'));\n if (!this._majorAvailable && (ord < 1 || ord > 14)) {\n return;\n }\n if (range.high === -1) {\n this._selectRangeRows(ord, ord)\n } else if (range.low == range.high) {\n this._selectRangeRows(range.low, ord);\n } else {\n this._clearRangeTable();\n this._selectRangeRows(ord, ord);\n }\n }", "handleSelect(event) {\n this.dispatchEvent(new CustomEvent('select', event));\n }", "beforeSelectRow(rowid, e){\n }", "function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n var value = data.getValue(selectedItem.row, 0);\n openPopup(value);\n // console.log('The user selected - ' + value);\n }\n }", "function onSelected($e, datum) {\n onAutocompleted($e,datum);\n }", "onSelect(event) {}", "handleSelected(event) {\n this.setData(event);\n }", "handleSelected(event) {\n this.setData(event);\n }", "function onSelect(callback){\n\t\t\t_onSelectCallback = callback;\n\t\t}", "function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n var value = data.getValue(selectedItem.row, selectedItem.column);\n alert('The user selected ' + value);\n }\n }", "function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n var value = data.getValue(selectedItem.row, selectedItem.column);\n alert('The user selected ' + value);\n }\n }", "function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n var value = data.getValue(selectedItem.row, selectedItem.column);\n alert('The user selected ' + value);\n }\n }", "_beforeSelect (data, preserve) {\n if (this.callEvent(\"onStartWith\", [data.row, \"0$\"]) ||\n data.column == 'action' ||\n data.column == 'edit' ||\n data.column == 'checkbox') {\n return false;\n }\n }", "handleSelect(event){\n event.preventDefault();\n const selectedRecord = new CustomEvent(\n \"select\",\n {\n detail : this.record.Id\n }\n );\n this.dispatchEvent(selectedRecord);\n }", "function SelectionChange() { }", "function SelectionChange() { }", "function selectRows(data) {\n \t\n }", "function loanContacts_Select(evt, ui) {\n\n if (typeof ui !== \"undefined\" && ui !== null) {\n var contactId = ui.rowKey;\n loanContacts_ShowContactDetails(contactId);\n }\n }", "function select(e){\n if(userId){\n $('tr[data-id='+ userId +']').css('background', 'none');\n }\n $('tr[data-id='+ e.currentTarget.getAttribute('data-id') +']').css('background', '#999');\n userId = e.currentTarget.getAttribute('data-id');\n }", "function dd_change(selected_option) {\n $('.selectpicker').selectpicker('render');\n val = selected_option.attr(\"table\").substr(2)\n if (zoo != val) {\n zoo = val;\n set_zoo(selected_option.attr(\"search\"));\n }\n else {\n //updateData(selected_option.attr(\"search\"));\n };\n }", "onSelect() {}", "_onColumnChange(e) {\n this.selected = e.detail.value;\n this._updateCols(parseInt(e.detail.value));\n }", "function fireSelectedEvent(){\n\t\t\tvar x1 = (selection.first.x <= selection.second.x) ? selection.first.x : selection.second.x;\n\t\t\tvar x2 = (selection.first.x <= selection.second.x) ? selection.second.x : selection.first.x;\n\t\t\tvar y1 = (selection.first.y >= selection.second.y) ? selection.first.y : selection.second.y;\n\t\t\tvar y2 = (selection.first.y >= selection.second.y) ? selection.second.y : selection.first.y;\n\t\t\t\n\t\t\tx1 = xaxis.min + x1 / hozScale;\n\t\t\tx2 = xaxis.min + x2 / hozScale;\n\t\t\ty1 = yaxis.max - y1 / vertScale;\n\t\t\ty2 = yaxis.max - y2 / vertScale;\n\n\t\t\ttarget.fire('flotr:select', [ { x1: x1, y1: y1, x2: x2, y2: y2 } ]);\n\t\t}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "_selectRow(e) {\n let allTr = this.shadowRoot.querySelector('tbody').querySelectorAll('tr');\n let len = allTr.length;\n while (len--) {\n allTr[len].setAttribute('selected', false);\n }\n\n if (e.target.parentElement.parentNode.rowIndex >= 0) {\n e.target.parentElement.parentNode.setAttribute('selected', true);\n this._selectedIndex = e.target.parentElement.parentNode.rowIndex - 1;\n\n if (e.type === 'click') {\n this.dispatchEvent(new CustomEvent('tablerow-selected', {\n detail: this._collection.rawEntity.entities[this._selectedIndex], bubbles: true, composed: true\n }));\n }\n } else if (e.target.nodeName === 'INPUT' && e.target.parentNode.parentElement.parentElement.rowIndex >= 0) {\n this._selectedIndex = e.target.parentNode.parentElement.parentElement.rowIndex - 1;\n }\n\n }", "function handleSelect(event) {\n if (event.target !== event.currentTarget) {\n startLightBox(event.target.parentElement.id);\n }\n\n // Prevent the event from bubbling back up the DOM\n stopPropagation(event);\n }", "function HandleTblRowClicked(tblRow) {\n\n// --- toggle select clicked row\n t_td_selected_toggle(tblRow, false); // select_single = false: multiple selected is possible\n\n// get data_dict from data_rows\n const data_dict = get_datadict_from_tblRow(tblRow);\n console.log( \"data_dict\", data_dict);\n\n// --- update selected studsubj_dict / student_pk / subject pk\n selected.data_dict = (data_dict) ? data_dict : null;\n\n console.log( \" selected\", selected);\n }", "handleSelect(event) {\n // Event will be triggerred and bubbled to parent and grandparent. \n // Check the parameters passed. \n const selectEvent = new CustomEvent('lookupselect', {\n detail: this.record\n });\n // Fire the custom event \n this.dispatchEvent(selectEvent);\n }", "handleSelect(event) {\n // Event will be triggerred and bubbled to parent and grandparent. \n // Check the parameters passed. \n const selectEvent = new CustomEvent('lookupselect', {\n detail: this.record\n });\n // Fire the custom event \n this.dispatchEvent(selectEvent);\n }", "function selectData() {\r\n\tpreEditBtn.style.pointerEvents = \"none\";\r\n\r\n\t$(tbody).on(\"click\", \"tr\", function() {\r\n\t\t$(\"tr\")\r\n\t\t\t.not(this)\r\n\t\t\t.removeClass(\"selected\");\r\n\t\t$(this).toggleClass(\"selected\");\r\n\t\tif ($(this).hasClass(\"selected\")) {\r\n\t\t\tpreEditBtn.style.pointerEvents = \"auto\";\r\n\t\t} else preEditBtn.style.pointerEvents = \"none\";\r\n\t});\r\n\r\n\t$(\"th\").click((e) => e.stopPropagation()); // stops event bubbling && prevents selecting th\r\n}", "handleRowSelect(row){\n console.log(row);\n }", "_onclickRowSelected() {\n try {\n query(\".widget-consulta-proyecto .tab-content .list-group\")\n .on(\"click\", function(e) {\n const target = event.target;\n // Tag LI\n if (target.nodeName == \"LI\") {\n this._clearNodes(target);\n this._queryResultsFeatures(\n target.dataset.objectid,\n target.dataset.layerid,\n target\n );\n }\n // Tag DIV\n if (target.nodeName == \"DIV\") {\n this._clearNodes(target.parentNode);\n this._queryResultsFeatures(\n target.parentNode.dataset.objectid,\n target.parentNode.dataset.layerid,\n target.parentNode\n );\n }\n // Tag STRONG\n if (target.nodeName == \"STRONG\") {\n this._clearNodes(target.parentNode.parentNode);\n this._queryResultsFeatures(\n target.parentNode.parentNode.dataset.objectid,\n target.parentNode.parentNode.dataset.layerid,\n target.parentNode.parentNode\n );\n }\n }.bind(this));\n } catch (error) {\n console.error(`Error: _onclickRowSelected ${error.name} - ${error.message}`);\n }\n }", "function optionChanged(passdata)\n{\n table(passdata);\n charts(passdata);\n}", "selectRow(e) {\n const { selectRow } = this.props;\n selectRow(e.target.dataset.id);\n }", "function changeSelect() {\n\t\t\ttrail_select.value = this._leaflet_id;\n\t\t\tvar event = new Event(\"change\");\n\t\t\ttrail_select.dispatchEvent(event);\n\t\t}", "function optionChanged(newSelection) {\n console.log(newSelection);\n updateTable(newSelection);\n}", "function _handleSelect(id) {\n selected(id);\n }", "function OnSelect(sender: Object, e: RoutedEventArgs) {\n\t\t\ttry {\n\t\t\t\tSelectRow();\n\t\t\t\tDashboardTaskService.Current.CloseTask(runner);\n\t\t\t} catch (ex: Exception) {\n\t\t\t\tConfirmDialog.ShowErrorDialog(\"Script\", ex);\n\t\t\t}\n\t\t}", "function tb_onRowSelected(event) {\n if (event.node.isSelected()) {\n add_attr(event.node.data.feature);\n }\n else {\n remove_attr(event.node.data.feature);\n }\n}", "selectedClickListener(d, i){\n var self = this;\n // ID Is selected from the the element tag field\n var id = self.selectedExtractID(d).split(\" \").join(\"-\");\n self.boxZoom(self.path.bounds(d), self.path.centroid(d), 20);\n self.applyStateSelection(id);\n self.ui.setDistrictInfo(id);\n self.ui.addLabel(); \n self.ui.retrievePoliticianImages(id);\n }", "handleLookupSelect(event) { \n this.selectedName = event.detail.Family; \n this.showoptions=false;\n \n }", "function onSelectionChanged(event) {\n\t\t\t\t\t\n\t\t\t\t\t// Don't trigger foundset selection if table is grouping\n\t\t\t\t\tif (isTableGrouped()) {\n\t\t\t\t\t\t\n // Trigger event on selection change in grouo mode\n if ($scope.handlers.onSelectedRowsChanged) {\n $scope.handlers.onSelectedRowsChanged();\n }\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// set to true once the grid is ready and selection is set\n\t\t\t\t isSelectionReady = true;\n\t\t\t\t\n\t\t\t\t\tif(scrollToSelectionWhenSelectionReady) {\n\t\t\t\t\t\t$scope.api.scrollToSelection();\n\t\t\t\t\t}\n\n\t\t\t\t\t// rows are rendered, if there was an editCell request, now it is the time to apply it\n\t\t\t\t\tif(startEditFoundsetIndex > -1 && startEditColumnIndex > -1) {\n\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t$scope.api.editCellAt(startEditFoundsetIndex, startEditColumnIndex);\n\t\t\t\t\t\t}, 200);\n\t\t\t\t\t}\n\n\t\t\t\t // when the grid is not ready yet set the value to the column index for which has been requested focus\n\t\t\t\t if (requestFocusColumnIndex > -1) {\n\t\t\t\t \t$scope.api.requestFocus(requestFocusColumnIndex);\n\t\t\t\t }\n\n\t\t\t\t\tvar selectedNodes = gridOptions.api.getSelectedNodes();\n\t\t\t\t\tif (selectedNodes.length > 0) {\n\t\t\t\t\t\tvar foundsetIndexes = new Array();\n\n\t\t\t\t\t\tfor(var i = 0; i < selectedNodes.length; i++) {\n\t\t\t\t\t\t\tvar node = selectedNodes[i];\n\t\t\t\t\t\t\tif(node) foundsetIndexes.push(node.rowIndex);\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(foundsetIndexes.length > 0) {\n\t\t\t\t\t\t\tfoundsetIndexes.sort(function(a, b){return a - b});\n\t\t\t\t\t\t\t// if single select don't send the old selection along with the new one, to the server\n\t\t\t\t\t\t\tif(!foundset.foundset.multiSelect && foundsetIndexes.length > 1 &&\n\t\t\t\t\t\t\t\tfoundset.foundset.selectedRowIndexes.length > 0) {\n\t\t\t\t\t\t\t\t\tif(foundset.foundset.selectedRowIndexes[0] == foundsetIndexes[0]) {\n\t\t\t\t\t\t\t\t\t\tfoundsetIndexes = foundsetIndexes.slice(-1);\n\t\t\t\t\t\t\t\t\t} else if(foundset.foundset.selectedRowIndexes[0] == foundsetIndexes[foundsetIndexes.length - 1]) {\n\t\t\t\t\t\t\t\t\t\tfoundsetIndexes = foundsetIndexes.slice(0, 1);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfoundset.foundset.requestSelectionUpdate(foundsetIndexes).then(\n\t\t\t\t\t\t\t\tfunction(serverRows){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t // Trigger event on selection change\n\t\t\t\t if ($scope.handlers.onSelectedRowsChanged) {\n\t\t\t\t $scope.handlers.onSelectedRowsChanged();\n\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//success\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction(serverRows){\n\t\t\t\t\t\t\t\t\t//canceled \n\t\t\t\t\t\t\t\t\tif (typeof serverRows === 'string'){\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t//reject\n\t\t\t\t\t\t\t\t\tselectedRowIndexesChanged();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\t$log.debug(\"table must always have a selected record\");\n\t\t\t\t\tselectedRowIndexesChanged();\n\n\t\t\t\t}", "function onSelect(d) {\n alert(d.State);\n}", "function dateTurlederSelectHandler(e, turleder, row) {\n row.removeClass('jq-hide');\n row.find('button').on('click', dateTurlederRemoveHandler);\n row.find('input').attr('name', 'dates[' + i + '][turleder][]');\n table.append(row);\n }", "function selectHandler(e) {\t\n\t// Get the selected region name\n\tvar selection = chart.getSelection();\n\tvar item = selection[0];\n\tvar countryname = data.getFormattedValue(item.row, 2);\n\t// Place it in the box \n\t$('#worldsearch').val(countryname);\n\t\n\t// If we have a query and we aren't already zoomed in\n\tif (currentQ != '' && currentView != 'provinces') {\n\t\t\n\t\t// Get the country code\n\t\tvar selection = chart.getSelection();\n\t\tvar item = selection[0];\n\t\tvar selectdata = data.getFormattedValue(item.row, 0);\n\t\t\n\t\t// Save globally\n\t\tcurrentCountry = selectdata;\n\t\t\n\t\t// Begin getting the data\n\t\tstartProgress()\n\t\tgetGTrends(currentQ, selectdata, function(successData) {\n\t\t\tcurrentView = 'provinces';\n\t\t\tvar ops = {\n\t\t\t\tregion: selectdata,\n\t\t\t\tresolution: 'provinces'\n\t\t\t};\n\t\t\t\n\t\t\t$('#back_col').text('Back to world map');\n\t\t\treDrawChart(successData, ops);\n\t\t});\n\t}\n}", "function on_geojson_mouse_event(evtdata) {\n const should_apply_highlight = evtdata.type === 'mouseover';\n const index = data.features.indexOf(evtdata.layer.feature);\n const tableRowEl = $('table tbody tr').get(index);\n tableRowEl.classList.toggle('highlighted', should_apply_highlight);\n }", "select(e, value) {\n\t\tthis.setState(\n\t\t\t{\n\t\t\t\tcons:(this.second.current.state.selected.row[0] || ''), \n\t\t\t\tvowl: value\n\t\t\t}, this.props.onClick\n\t\t); \n\t}", "function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n\t\t\t$.getJSON(\"gettingJSONTutorial.js\", function(result){\n\t\t\t\tvar value = data.getValue(selectedItem.row, selectedItem.column);\n\t\t\t\tif(value % 2 == 0)\n\t\t\t\t$(\"#mycomleft\").html(result.events[0].Year + \" \" +result.events[0].Event);\n\t\t\t\tif(value % 2 == 1)\n\t\t\t\t$(\"#mycomleft\").html(result.events[1].Year + \" \" + result.events[1].Event);\n\n\t\t });\n // var value = data.getValue(selectedItem.row, selectedItem.column);\n\t\t\t// $(\"#mycomleft\").html(result.events[0].Year + result.events[0].event);\n }\n }", "function setupAreaSelectionEventListener() {\n $(\"#area-dropdown .dropdown-menu li a\").click(function () {\n selectedArea = $(this).text();\n var selText = $(this).text();\n $(this).parents('.btn-group').find('.dropdown-toggle').html(selText + ' <span class=\"caret\"></span>');\n clearDoctorDetails();\n dataTable.rows().every(function (rowIdx, tableLoop, rowLoop) {\n var data = this.data();\n if (selText !== \"All Cities\" && data.area !== selText) {\n this.node().style.display = \"none\";\n } else if (selectedSpeciality == null || selectedSpeciality == data.speciality) {\n this.node().style.display = \"\";\n }\n });\n });\n}", "function onfocusSelect(dt) { dt.select(); }", "activeClick() {\n var $_this = this;\n var action = this.options.dblClick ? 'dblclick' : 'click';\n\n this.$selectableUl.on(action, '.SELECT-elem-selectable', function () {\n $_this.select($(this).data('SELECT-value'));\n });\n this.$selectionUl.on(action, '.SELECT-elem-selection', function () {\n $_this.deselect($(this).data('SELECT-value'));\n });\n\n }", "function onChangeDirectSalesTeamSelect() {\n\n var $select = jQuery(this),\n $row = $select.closest('tr'),\n value = $select.val(),\n $ambassadorSelectWrapper = $row.find('.direct-sales-ambassador-select-wrapper');\n\n if (value == 'Ambassador') {\n $ambassadorSelectWrapper.show();\n }\n else {\n $ambassadorSelectWrapper.hide();\n }\n checkOnChanges();\n }", "function mgrilla_item_seleccion_fondocolor(){\n\t$(\"#grdregistro_vista_data tbody\").on( \"click\", \"tr\", function () {\n\n\t\tif ( $(this).hasClass(\"selected\") )\n\t\t{\n\t\t\t$(this).removeClass(\"selected\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttblregistro_vista_data.$(\"tr.selected\").removeClass(\"selected\");\n\t\t\t$(this).addClass(\"selected\");\n\t\t}\n\t} );\n}", "function selectedData(event) {\n displayProblems();\n}", "function bindSelect() {\n initializeTimeFunction();\n extent = brush.extent(); //data of selection\n userTimeData = [];\n\n extent.forEach(function (element) {\n var t = String(element.getTime() / 1000 * 1000);\n userTimeData.push(t);\n });\n\n if ($scope.fingerPrintsMode) {\n clearFingerprintHeatmap();\n $scope.showFingerprintHeatmap();\n document.getElementById(\"fingerPrints-mode\").classList.add('quickaction-selected');\n }\n\n if ($scope.radioHeatmapRSSMode) {\n clearFingerprintCoverage();\n $scope.showFingerprintCoverage();\n $scope.radioHeatmapRSSMode = true;\n if (typeof (Storage) !== \"undefined\" && localStorage) {\n localStorage.setItem('radioHeatmapRSSMode', 'YES');\n }\n $scope.anyService.radioHeatmapRSSMode = true;\n document.getElementById(\"radioHeatmapRSS-mode\").classList.add('quickaction-selected');\n }\n }", "function on_select_ponto(feature){\r\n\t\t\tselect_control.unselectAll({except:feature});\r\n\t\t}", "selectHandler(e) {\n const { trigger } = this.props;\n trigger(e);\n }", "onRowSelection () {\n this.grid.selectedRows = this.$refs.grid.gridOptions.api.getSelectedRows();\n if (this.grid.selectedRows && this.grid.selectedRows.length) {\n this.grid.hasSelectedRows = true;\n }\n }", "function selectionChanged(evt) {\n\t\tvar ctx = evt.data;\n\t\tvar $allSelected = $(this).find(':selected');\n\t\tvar value = $allSelected.attr('value');\n\t\tvar $selectedOptions = ctx.$options.find('[data-value=\"' + value + '\"]');\n\t\tselectUpdateValue(ctx, $selectedOptions, undefined, false);\n\t}", "function f_row_select_(grid_p, fila_p) {\n\t$('#' + grid_p).find('tr.selected').removeClass('selected');\n\t$('#' + grid_p + ' tbody tr:eq(' + fila_p + ')').addClass('selected');\n\t$('#' + grid_p + ' tbody tr:eq(' + fila_p + ') td:not(td:first-child)')[0].click();\n\n\tt1 = $('#' + grid_p).DataTable();\n\tvar rowSelected = t1.row().$('tr.selected');\n\t$('#' + grid_p).DataTable().row( $(rowSelected).closest('tr') ).select();\n}", "function tripTableInteractionInit(){\n $('#active-trains-table tbody').on('click', 'tr', function () {\n var data = global.tripDatatable.row( this ).data();\n onClickTripRow(data);\n \n // Update class: selected for row display\n if ( $(this).hasClass('selected') ) {\n $(this).removeClass('selected');\n }\n else {\n global.tripDatatable.$('tr.selected').removeClass('selected');\n $(this).addClass('selected');\n }\n } );\n }", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "function MUPM_SelectDepartment(tblRow){\n //console.log( \"===== MUPM_SelectDepartment ========= \");\n //console.log( \"event_key\", event_key);\n\n if(tblRow){\n let is_selected = (!!get_attr_from_el_int(tblRow, \"data-selected\"));\n let pk_int = get_attr_from_el_int(tblRow, \"data-pk\");\n const is_select_all = (!pk_int);\n //console.log( \"is_selected\", is_selected);\n //console.log( \"pk_int\", pk_int);\n// --- toggle is_selected\n is_selected = !is_selected;\n\n const tblBody_selectTable = tblRow.parentNode;\n if(is_select_all){\n// --- if is_select_all: select/ deselect all rows\n for (let i = 0, row, el, set_tickmark; row = tblBody_selectTable.rows[i]; i++) {\n MUPM_set_selected(row, is_selected)\n }\n } else {\n// --- put new value in this tblRow, show/hide tickmark\n MUPM_set_selected(tblRow, is_selected)\n\n// --- select row 'select_all' if all other rows are selected, deselect otherwise\n // set 'select_all' true when all other rows are clicked\n let has_rows = false, unselected_rows_found = false;\n for (let i = 0, row; row = tblBody_selectTable.rows[i]; i++) {\n let row_pk = get_attr_from_el_int(row, \"data-pk\");\n // skip row 'select_all'\n if(row_pk){\n has_rows = true;\n if(!get_attr_from_el_int(row, \"data-selected\")){\n unselected_rows_found = true;\n break;\n }\n }\n }\n// --- set tickmark in row 'select_all'when has_rows and no unselected_rows_found\n const tblRow_selectall = document.getElementById(\"sel_depbase_selectall\")\n MUPM_set_selected(tblRow_selectall, (has_rows && !unselected_rows_found))\n }\n// check for double abbrev in deps\n const fldName = \"abbrev\";\n const msg_err = validate_duplicates_in_department(loc, \"school\", fldName, loc.Abbreviation, mod_MUPM_dict.mapid, mod_MUPM_dict.abbrev)\n const el_msg = document.getElementById(\"id_MUPM_msg_\" + fldName);\n el_msg.innerText = msg_err;\n add_or_remove_class(el_msg, cls_hide, !msg_err)\n\n el_MUPM_btn_save.disabled = (!!msg_err);\n }\n } // MUPM_SelectDepartment", "_onFilterSelected(event) {\n this.filter = event.detail.filter;\n this.render();\n }", "function onChangeSelect(){\n app.activeSoftware = [];\n selected = d3.select(this) // select the select\n .selectAll(\"option:checked\") // select the selected values\n .each(function() { \n app.activeSoftware.push(this.value);\n }); // for each of those, get its value\n createTable();\n}", "function selectchange(x,res,selectedval,targetdiv)\n {\n \n }", "function handleSelectEvent(e){\n\t\t\tif(e.value==\"Select All\"){\n\t\t\t\tupdateAllTabs(true);\n\t\t\t\te.value=\"Select None\";\n\t\t\t}else{\n\t\t\t\tupdateAllTabs(false);\n\t\t\t\te.value=\"Select All\";\n\t\t\t}\n\t\t\treturn;\n}", "function selectFeatureFromGrid(event) {\n // close view popup if it is open\n view.popup.close();\n // get the ObjectID value from the clicked row\n const row = event.rows[0]\n const id = row.data.OBJECTID;\n\n // setup a query by specifying objectIds\n const query = {\n objectIds: [parseInt(id)],\n outFields: [\"*\"],\n returnGeometry: true,\n outSpatialReference: view.SpatialReference\n };\n\n // query the csvLayerView using the query set above\n landuseLayerView.queryFeatures(query).then(function(results) {\n const graphics = results.features;\n // remove all graphics to make sure no selected graphics\n view.graphics.removeAll();\n view.goTo(graphics[0].geometry);\n\n // create a new selected graphic\n const selectedGraphic = new Graphic({\n geometry: graphics[0].geometry,\n symbol: {\n type: \"simple-fill\",\n color: [130, 194, 232, 0.4],\n style: \"solid\",\n outline: { // autocasts as new SimpleLineSymbol()\n color:[130, 194, 232, 0.4],\n width: 3\n }\n }\n });\n\n // add the selected graphic to the view\n // this graphic corresponds to the row that was clicked\n view.graphics.add(selectedGraphic);\n })\n .catch(errorCallback);\n }", "function select() {\n var el = d3.select(this);\n var thislabel = el.node().__data__;\n var indx = _.indexOf(data.columnLabels, thislabel);\n var indy = _.indexOf(data.rowLabels, thislabel);\n if (indx > -1) {\n selectedx = getselected(selectedx, indx)\n }\n if (indy > -1) {\n selectedy = getselected(selectedy, indy)\n }\n draw()\n }", "selectTable() {\n if (!this.owner.enableSelection) {\n return;\n }\n this.selectTableInternal();\n }", "function handleSelect(event) {\n let currState = event.target.value;\n let rows = container.querySelectorAll('.table__row_visible');\n for (let row of rows) {\n row.style.display = \"table-row\";\n if (row.querySelector(\".state\").textContent !== currState) {\n row.style.display = \"none\";\n };\n }\n }", "function cellDblClicked() {\n changeColor()\n}", "handleRowClick(event) {\n\t\tthis.selectedRecordId = event.detail.pk;\n\t}", "function highlightFeature(e) {\n var layer = e.target;\n console.log(data_cases);\n lineChart(layer.feature.properties.st_nm,data_cases);\n\n layer.setStyle({\n weight: 5,\n color: '#ff3300',\n dashArray: '',\n fillOpacity: 0.7\n });\n\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\n layer.bringToFront();\n }\n\n info.update(layer.feature);\n }", "function selectionsHandler() {\n logger.info('selection handler');\n\n if ($.currentProduct.isProductSelected()) {\n $.store_availability_button.setColor(Alloy.Styles.color.text.mediumdark);\n } else {\n $.store_availability_button.setColor(Alloy.Styles.color.text.light);\n }\n\n $.pdp_header_controller.setProductID($.currentProduct.getSelectedProductId());\n}", "function onRowSelected(row) {\n if (row) {\n selectedVmRow = row;\n selectedRow = row;\n //updateContextualCommands(row);\n }\n }", "function handleClick(d, i){\n\t\tclearSelectiont6()\n\n\t\tvar _fill = d3.select(this).style(\"fill\");\n\n\t\td3.select(this)\n\t\t\t.classed(\"selected\", true)\n\t\t\t.attr(\"data-fill\", _fill)\n\t\t\t.style(\"fill\", \"rgb(255, 86, 0)\")\n\n\t\tvar interval_val = d.interval.split(\"/\").map(function(d){ return parseFloat(d); })\n\t\tslice_util.setSlice(localstate.data_slices, \"t6\", \"Year_of_Release\", \n\t\t\t\t\t\t\t\t\t\t\t\tparseInt(d.year), parseInt(d.year))\n\t\tslice_util.setSlice(localstate.data_slices, \"t6\", \"Mean_UserCritic_Score\", \n\t\t\t\t\t\t\t\t\t\t\t\tinterval_val[0], interval_val[1])\n\n\t\tlocalstate.selectedRows = slice_util.sliceRows(localstate.data_slices, localstate.datasetRows);\n\n\t\tappdispatch.dataslice.call(\"dataslice\", this, \"t6\", localstate.selectedRows);\n\t}", "function selectedDblclick( event ) {\n if ( self.cfg.onSelectedDblclick.length > 0 &&\n ( $(event.target).hasClass('selected') || $(event.target).closest('g').hasClass('selected') ) )\n for ( var n=0; n<self.cfg.onSelectedDblclick.length; n++ )\n self.cfg.onSelectedDblclick[n](event.target);\n }", "onResultSelected() {\n const result = document.activeElement;\n if (this.ux.results !== result.parentElement)\n return;\n this.publish(\"selectresult\", JSON.parse(result.dataset.d));\n }", "function optionChanged(newID) {\n fillTable(newID);\n makeCharts(newID);\n}", "function selFeature(value){\r\n //...\r\n }", "function MSM_SelecttableClicked(tblRow) {\n //console.log( \"===== MSM_SelecttableClicked ========= \");\n //console.log(\"tblRow: \", tblRow);\n if(tblRow) {\n // toggle is_selected\n const is_selected = (!get_attr_from_el_int(tblRow, \"data-selected\"))\n\n tblRow.setAttribute(\"data-selected\", (is_selected) ? \"1\" : \"0\")\n tblRow.cells[0].children[0].className = (is_selected) ? \"tickmark_2_2\" : \"tickmark_0_0\";\n\n // row 'all' has pk = -9\n if(is_selected){\n const selected_pk_int = get_attr_from_el_int(tblRow, \"data-pk\");\n const selected_is_all = (selected_pk_int === -9);\n const tblBody_select = tblRow.parentNode;\n for (let i = 0, lookup_row; lookup_row = tblBody_select.rows[i]; i++) {\n const lookup_pk_int = get_attr_from_el_int(lookup_row, \"data-pk\");\n if (lookup_pk_int !== selected_pk_int){\n const lookup_is_all = (lookup_pk_int === -9);\n\n // remove tickmark on all other items when 'all' is selected\n // remove tickmark on 'all' when other item is selected\n //let remove_selected = (base_is_all) ? (lookup_base_pk_int !== -9) : (lookup_base_pk_int === -9);;\n let remove_selected = (selected_is_all && !lookup_is_all) || (!selected_is_all && lookup_is_all);\n if(remove_selected){\n lookup_row.setAttribute(\"data-selected\", \"0\");\n lookup_row.cells[0].children[0].className = \"tickmark_0_0\";\n };\n };\n };\n };\n };\n }", "function MSM_SelecttableClicked(tblRow) {\n //console.log( \"===== MSM_SelecttableClicked ========= \");\n //console.log(\"tblRow: \", tblRow);\n if(tblRow) {\n // toggle is_selected\n const is_selected = (!get_attr_from_el_int(tblRow, \"data-selected\"))\n\n tblRow.setAttribute(\"data-selected\", (is_selected) ? \"1\" : \"0\")\n tblRow.cells[0].children[0].className = (is_selected) ? \"tickmark_2_2\" : \"tickmark_0_0\";\n\n // row 'all' has pk = -9\n if(is_selected){\n const selected_pk_int = get_attr_from_el_int(tblRow, \"data-pk\");\n const selected_is_all = (selected_pk_int === -9);\n const tblBody_select = tblRow.parentNode;\n for (let i = 0, lookup_row; lookup_row = tblBody_select.rows[i]; i++) {\n const lookup_pk_int = get_attr_from_el_int(lookup_row, \"data-pk\");\n if (lookup_pk_int !== selected_pk_int){\n const lookup_is_all = (lookup_pk_int === -9);\n\n // remove tickmark on all other items when 'all' is selected\n // remove tickmark on 'all' when other item is selected\n //let remove_selected = (base_is_all) ? (lookup_base_pk_int !== -9) : (lookup_base_pk_int === -9);;\n let remove_selected = (selected_is_all && !lookup_is_all) || (!selected_is_all && lookup_is_all);\n if(remove_selected){\n lookup_row.setAttribute(\"data-selected\", \"0\");\n lookup_row.cells[0].children[0].className = \"tickmark_0_0\";\n };\n };\n };\n };\n };\n }", "function onClickTableRow(event)\n{\n resetTableHighlights();\n var rowElement = event.currentTarget;\n document.selectedIndex = event.currentTarget.rowIndex;\n addRowHighlight(event);\n\n $(\"first_name_element\").value =rowElement.cells[FIRST_NAME_INDEX].innerHTML;\n $(\"last_name_element\").value =rowElement.cells[LAST_NAME_INDEX].innerHTML;\n $(\"phone_number_element\").value =rowElement.cells[PHONE_INDEX].innerHTML;\n $(\"email_element\").value =rowElement.cells[EMAIL_INDEX].innerHTML;\n $(\"age_element\").value =rowElement.cells[AGE_INDEX].innerHTML;\n $(\"id_element\").value =rowElement.cells[ID_INDEX].innerHTML;\n $(\"gender_element\").selectedIndex = getGender(rowElement.cells[GENDER_INDEX].innerHTML);\n\n disableDeleteButton(false);\n disableSaveButton(true);\n disableClearButton(false);\n document.selectedRow = rowElement;\n}", "async function onColumnAlternativeSelected(event) {\n const selection = event.target.value.substring(\n event.target.selectionStart,\n event.target.selectionEnd\n )\n selectedColumn = selection\n console.log(\"selected\", selectedColumn)\n document.getElementById(\"reloadButton\").classList.add(\"is-loading\")\n await reloadViewer()\n document.getElementById(\"reloadButton\").classList.remove(\"is-loading\")\n}", "function getSelectData() {\r\n return proxyData.row('.selected').data();\r\n}", "function selFeature(value){\n //...\n }", "function selFeature(value){\n //...\n }", "function onSelectedIll({ target }) {\n if (target.value) {\n const ill = dataIll.ills.filter(ill => ill.name === target.value)[0];\n ill && ill.id && setSelectedIllId(ill.id);\n }\n }", "handleSelect(event) {\n\t\tthis.setState({\n\t\t\tselectedValue: event.target.value\n\t\t}, () => {\n\t\t\tthis.themeChanged(true);\n\t\t});\n\t}", "function UISelection(){\n\n }", "function changeDepSelect() {\n displayHouseBtn();\n displayDepDrp();\n removedtRows(); //Remove Exisiting DataTable Rows\n depEmpDt(); //Display House Wise Employees DataTable\n populateDepInfo();\n}", "function optionChanged(selectedPatientID) {\n console.log(selectedPatientID);\n buildCharts(selectedPatientID);\n populateDemographicInfo(selectedPatientID);\n}" ]
[ "0.6965394", "0.6917137", "0.67212576", "0.6600849", "0.65319467", "0.6506635", "0.6387158", "0.63683957", "0.63565326", "0.63564444", "0.63564444", "0.63308305", "0.6317594", "0.6317594", "0.6299829", "0.6259634", "0.6235656", "0.6223951", "0.6223951", "0.61801934", "0.6142811", "0.6122289", "0.61196107", "0.61081666", "0.61053663", "0.6096141", "0.6089826", "0.6089826", "0.6089826", "0.6089826", "0.6087739", "0.6076282", "0.6049881", "0.60296226", "0.60296226", "0.6027461", "0.59846586", "0.59840643", "0.5976779", "0.5961373", "0.59603554", "0.5959921", "0.5954336", "0.59462434", "0.5940337", "0.59321374", "0.5903117", "0.58839494", "0.5860848", "0.58572173", "0.58486843", "0.5841444", "0.58303773", "0.58054316", "0.5800905", "0.57981765", "0.5794505", "0.5792308", "0.5781385", "0.5774326", "0.5767663", "0.5766775", "0.575973", "0.57485265", "0.5746306", "0.57295287", "0.57088375", "0.57045275", "0.57045275", "0.57041025", "0.56908715", "0.5689016", "0.5678184", "0.56780213", "0.5659419", "0.5657033", "0.5653386", "0.5651249", "0.56341255", "0.56276095", "0.56233984", "0.56232446", "0.5619683", "0.561893", "0.56101817", "0.5607368", "0.56022793", "0.56011707", "0.5600186", "0.5600186", "0.56000036", "0.55995905", "0.55911285", "0.5584392", "0.5584392", "0.55724347", "0.5560245", "0.555805", "0.5549182", "0.5547443" ]
0.7328452
0
Reused Code to refersh table data as well as balance total
calculateData() { let calculatedBalance = 0; // lwc does not track changes in an array but only when the object reference changes (weird) // hence JSON - string - JSON conversion to generate new object instance this.data = JSON.parse(JSON.stringify(this.data)); for(let i = 0; i < this.data.length; i++) { calculatedBalance = Number(calculatedBalance) + Number(this.data[i]['balance']); if(Number(this.data[i]['id']) > this.lastID) { // ensures that the Id is never repeated this.lastID = this.data[i]['id'] } } this.totalBalance = calculatedBalance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dataTableTotal(){\n console.log(table.page.info());\n let startPage = table.page.info().start;\n let endPage = table.page.info().end;\n let totalHarga = 0;\n let totalData = parseInt(table.page.info().end - table.page.info().start);\n // console.log(table.page.info().start);\n for (let i = startPage; i < endPage; i++) {\n row = table.rows(i).data();\n // Karena kolom 5 menyesuaikan dengan kolom didatatable, untuk 0 adalah data dari dalam datatable\n totalHarga += convertRupiahToNumber(row[0][6]) * row[0][5];\n }\n\n $('#totalPage').html(totalData);\n $('#totalHarga').html(convertNumberToRupiah(totalHarga));\n\n }", "function sumTableData() {\n let total = 0;\n datatable.rows({page:'current'}).every(function (index, element) {\n let data = this.data();\n //console.log(data);\n let entry = parseFloat(data[2].slice(1,data[2].length));\n //console.log(entry);\n total += entry;\n });\n total = total.toFixed(2);\n $('#tableTotal').text(\"£\" + total);\n}", "function refresh_tables() {\n $(\".monitor_table\").each(function () {\n var TotalValue = 0;\n $(this)\n .find(\".balance_sum\")\n .each(function () {\n TotalValue += parseFloat($(this).data(\"balance\"));\n });\n $(this)\n .find(\".sum_total\")\n .html(\n (TotalValue / 100000000).toLocaleString(\"en-US\", {\n style: \"decimal\",\n maximumFractionDigits: 2,\n minimumFractionDigits: 2\n })\n );\n });\n}", "function getTotalBalance (s, cb) {\n s.exchange.getBalance(s, function (err, balance) {\n if (err) {\n console.log(err)\n return cb(err)\n \n }\n \n var summary = {product: s.product_id, asset: balance.asset, currency: balance.currency}\n\n s.exchange.getQuote({product_id: s.product_id}, function (err, quote) {\n if (err) return cb(err)\n asset_value = n(balance.asset).multiply(quote.ask)\n summary.currency_value = n(balance.currency)\n //myLog(s.product_id + \": \" + n(balance.asset).format('0.00') + \" \" + quote.ask + \" Total: \" + asset_value.format('0.00'))\n summary.ask = quote.ask\n summary.asset_value = asset_value\n cb(summary)\n })\n })\n \n }", "balance(){\nlet sum = 0\nfor (let i=0; i < this.transactions.length; i++) {\n sum = sum + this.transactions[i].amount;\n} return sum\n }", "function totalBalanceDue() {\n\tconsole.log(\"Adding Balances\");\n\n\t$.get(\"/totalBalances\", function(data) {\n\t\tconsole.log(\"Back from the server with: \" );\n\t\tconsole.log(data);\n\n var balance = data.results.sum[0].sum;\n \n \n $(\"#tableTotalBalance\").append(\"<tr><th>Total Balances Owed</th></tr>\");\n\n\t\t$(\"#tableTotalBalance\").append(\"<tr><td>\" + balance + \"</td></tr>\");\n });\n \n }", "function calculateBalance()\n{\n \n\n $('tbody tr td :input:text').not('.calculate-amount, .calculate-amount-hidden, .share-percentage-debit, .share-percentage-credit, .custom-node').attr('value','');\n\n calFlag = 0;\n \n $(\"input:checkbox[name=chkDebit]:checked\").each(function(i, va){\n currentCol = $(va).closest('td');\n currentRow = $(va).closest('tr');\n currentColIndex = currentCol.index();\n selectedOption = currentCol.prev('td').find('.calculate-option option:selected').val();\n\n if(selectedOption=='Fixed')\n {\n inputAmount = currentCol.prev('td').find('input.calculate-amount:visible').val();\n }\n else\n {\n if(currentCol.prev('td').find('input.calculate-amount-hidden').length > 0)\n {//check if calculate amount exist\n //inputAmount = currentCol.prev('td').find('input.calculate-amount-hidden').val();\n inputAmount = currentCol.prev('td').find('input.calculate-amount-hidden:last').val();\n }\n else\n {//else assing null\n inputAmount = '';\n }\n }\n \n debitPercentage = currentRow.next('tr').find('td.cell-'+currentColIndex).find('input.share-percentage-debit:visible').val();\n\n if(selectedOption != '' && inputAmount != '' && debitPercentage != '')\n {\n calFlag = 1;\n shareDebit = (inputAmount * debitPercentage)/100;\n \n currentRow.next('tr').next('tr').find('td.cell-'+currentColIndex).find('input.share-debit:visible').attr('value', shareDebit.toFixed(2));\n currentRow.next('tr').next('tr').next('tr').find('td.cell-'+currentColIndex).find('input.distribution-debit:visible').attr('value', shareDebit.toFixed(2));\n\n //Check if multiple credit checked for single row and sum of credit should not be more than 100%\n var totalcreditPercentage = 0;\n /*if($(currentRow).find(\"input:checkbox[name=chkCredit]:checked\").length > 1)\n {*/\n $(currentRow).find(\"input:checkbox[name=chkCredit]:checked\").each(function(i, vc){\n creditIndex = $(vc).closest('td').index();\n totalcreditPercentage += parseFloat(currentRow.next('tr').find('td.cell-'+creditIndex).find('input.share-percentage-credit:visible').val());\n\n if(totalcreditPercentage > 100)\n {\n \n\n if( $.trim(parseInt($('#hidden-popup').val())) == 0){\n var feesName = $(currentRow).find('div.account-title.fee-title').text();\n bootbox.alert(\n \"Sum of Credit should not be more than 100 for \"+feesName, \n function() {\n $('#hidden-popup').attr('value',0);\n });\n $('#hidden-popup').attr('value',1);\n return false;\n }\n\n }\n });\n /*}*/\n\n //Calculation for Credit Part\n $(currentRow).find(\"input:checkbox[name=chkCredit]:checked\").each(function(i, vd){\n creditColIndex = $(vd).closest('td').index();\n creditPercentage = currentRow.next('tr').find('td.cell-'+creditColIndex).find('input.share-percentage-credit:visible').val();\n if(totalcreditPercentage <= 100 && creditPercentage != ''){\n shareCredit = (inputAmount * creditPercentage)/100;\n currentRow.next('tr').next('tr').find('td.cell-'+creditColIndex).find('input.share-credit:visible').attr('value', shareCredit.toFixed(2));\n currentRow.next('tr').next('tr').next('tr').find('td.cell-'+creditColIndex).find('input.distribution-credit:visible').attr('value', shareCredit.toFixed(2));\n }\n });\n }\n });\n\n if(calFlag == 1)\n {\n //Column wise calculation of total Debit Amount\n $('tbody tr.row-group').find('td input:checkbox[name=chkDebit]:checked').each(function(i,v){\n var colDebit = $(v).closest('td');\n var rowDebit = $(v).closest('tr');\n var colIndexDebit = colDebit.index();\n var totalValDebit = 0;\n $('tbody tr.row-share').each(function(i,vt){\n var shareDebit = $(vt).find('td.cell-'+colIndexDebit+' :input.share-debit:visible').val();\n if(typeof shareDebit != 'undefined'){\n totalValDebit = parseFloat(shareDebit)+parseFloat(totalValDebit);\n if(!isNaN(totalValDebit)){\n $(vt).next('tr').next('tr.row-balance').find('td.cell-'+colIndexDebit+' :input.total-debit').attr('value',totalValDebit.toFixed(2));\n }\n }else{\n if(totalValDebit != 0 ){\n if(!isNaN(totalValDebit)){\n $(vt).next('tr').next('tr.row-balance').find('td.cell-'+colIndexDebit+' :input.total-debit').attr('value',totalValDebit.toFixed(2));\n }\n }\n }\n });\n });\n\n //Column wise calculation of total Credit Amount\n $('tbody tr.row-group').find('td input:checkbox[name=chkCredit]:checked').each(function(i,v){\n\n var colCredit = $(v).closest('td');\n var rowCredit = $(v).closest('tr');\n var colIndexCredit = colCredit.index();\n var totalValCredit = 0;\n $('tbody tr.row-share').each(function(i,vt){\n var shareCredit = $(vt).find('td.cell-'+colIndexCredit+' :input.share-credit:visible').val();\n\n if(typeof shareCredit != 'undefined'){\n totalValCredit = parseFloat(shareCredit)+parseFloat(totalValCredit);\n\n if(!isNaN(totalValCredit)){\n $(vt).next('tr').next('tr.row-balance').find('td.cell-'+colIndexCredit+' :input.total-credit').attr('value',totalValCredit.toFixed(2));\n }\n }else{\n if(totalValCredit != 0){\n $(vt).next('tr').next('tr.row-balance').find('td.cell-'+colIndexCredit+' :input.total-credit').attr('value',totalValCredit.toFixed(2));\n }\n }\n });\n });\n\n //Calculation of Balance for every transaction of each node/Domain\n $('tbody tr.row-balance').each(function(i,vb){\n var finalTotalDebitBalance = 0;\n var finalTotalCreditBalance = 0;\n $(vb).find('input.total-balance').each(function(i,vtb){\n var totalCredit = $(vtb).closest('td').prev('td').find('input.total-credit').val();\n var totalDebit = $(vtb).closest('td').prev('td').prev('td').find('input.total-debit').val();\n if(typeof totalDebit == 'undefined' || totalDebit == ''){ //Assing zero if undefined\n totalDebit = 0;\n }else{\n finalTotalDebitBalance = parseFloat(finalTotalDebitBalance) + parseFloat(totalDebit);\n }\n\n if(typeof totalCredit == 'undefined' || totalCredit == ''){ //Assing zero if undefined\n totalCredit = 0;\n }else{\n finalTotalCreditBalance = parseFloat(finalTotalCreditBalance) + parseFloat(totalCredit);\n }\n\n var totalBalance = parseFloat(totalDebit) - parseFloat(totalCredit);\n if(!isNaN(totalBalance)){ \n $(vtb).attr('value',totalBalance);\n }else{\n $(vtb).attr('value','');\n }\n });\n\n var finalTotalBalance = parseFloat(finalTotalDebitBalance) - parseFloat(finalTotalCreditBalance);\n\n if(!isNaN(finalTotalDebitBalance)){\n $(vb).find('input.final-total-debit').attr('value', finalTotalDebitBalance.toFixed(2));//Final Debit Balance\n }\n\n if(!isNaN(finalTotalCreditBalance)){\n $(vb).find('input.final-total-credit').attr('value', finalTotalCreditBalance.toFixed(2));//Final Credit Balance\n }\n\n if(!isNaN(finalTotalBalance)){\n $(vb).find('input.final-total-balance').attr('value', finalTotalBalance.toFixed(2));//Final Total Balance\n }\n\n //Check for Distribution final Balance Debit\n var finalTotalDistributionDebitBalance = 0;\n $(vb).prev('tr.row-distribution').find('input.distribution-debit:visible').each(function(i,vdb){\n var distributionDValue = $(vdb).val();\n if(typeof distributionDValue == 'undefined' || distributionDValue == ''){ \n distributionDValue = 0;\n }else{\n finalTotalDistributionDebitBalance = parseFloat(finalTotalDistributionDebitBalance) + parseFloat(distributionDValue);\n }\n });\n\n //Check for Distribution final Balance Credit\n var finalTotalDistributionCreditBalance = 0;\n $(vb).prev('tr.row-distribution').find('input.distribution-credit:visible').each(function(i,vcb){\n var distributionCValue = $(vcb).val();\n if(typeof distributionCValue == 'undefined' || distributionCValue == ''){\n distributionCValue = 0;\n }else{\n finalTotalDistributionCreditBalance = parseFloat(finalTotalDistributionCreditBalance) + parseFloat(distributionCValue);\n }\n });\n\n var finalTotalDistributionBalance = parseFloat(finalTotalDistributionDebitBalance) - parseFloat(finalTotalDistributionCreditBalance);\n\n if(!isNaN(finalTotalDistributionDebitBalance)){\n $(vb).prev('tr.row-distribution').find('input.final-distribution-debit').attr('value', finalTotalDistributionDebitBalance.toFixed(2));//Final Distribution Debit Balance \n }\n\n if(!isNaN(finalTotalDistributionCreditBalance)){\n $(vb).prev('tr.row-distribution').find('input.final-distribution-credit').attr('value', finalTotalDistributionCreditBalance.toFixed(2));//Final Distribution Credit Balance\n }\n\n if(!isNaN(finalTotalDistributionBalance)){\n $(vb).prev('tr.row-distribution').find('input.final-distribution-balance').attr('value', finalTotalDistributionBalance.toFixed(2));//Final Distribution Total Balance\n }\n });\n } \n\n}", "function AmountChanged() {\n var sum = 0;\n _dataTable.OutStandingInvoices.rows().deselect();\n if ($('#TotalPaidAmt').val() < 0 || $('#TotalPaidAmt').val() == \"\") {\n $('#TotalPaidAmt').val(roundoff(0));\n }\n\n AmountReceived = parseFloat($('#TotalPaidAmt').val())\n if (!isNaN(AmountReceived)) {\n $('#TotalPaidAmt').val(roundoff(AmountReceived));\n $('#lblTotalRecdAmt').text(roundoff(AmountReceived));\n $('#paidAmt').text(\"₹\" + roundoff(AmountReceived));\n\n var table = $('#tblOutStandingDetails').DataTable();\n var allData = table.rows().data();\n var RemainingAmount = AmountReceived;\n\n for (var i = 0; i < allData.length; i++) {\n var CustPaymentObj = new Object;\n var CustPaymentDetailObj = new Object;\n CustPaymentObj.CustPaymentDetailObj = CustPaymentDetailObj;\n\n if (RemainingAmount != 0) {\n if (parseFloat(allData[i].Balance) < RemainingAmount) {\n allData[i].SupplierPayment.SupplierPaymentDetail.PaidAmount = parseFloat(allData[i].Balance)\n RemainingAmount = RemainingAmount - parseFloat(allData[i].Balance);\n sum = sum + parseFloat(allData[i].Balance);\n }\n else {\n allData[i].SupplierPayment.SupplierPaymentDetail.PaidAmount = RemainingAmount\n sum = sum + RemainingAmount;\n RemainingAmount = 0\n }\n }\n else {\n allData[i].SupplierPayment.SupplierPaymentDetail.PaidAmount = 0;\n }\n }\n _dataTable.OutStandingInvoices.clear().rows.add(allData).draw(false);\n Selectcheckbox();\n $('#lblPaymentApplied').text(roundoff(sum));\n $('#lblCredit').text(roundoff(AmountReceived - sum));\n }\n}", "function calcTotals() {\n var incomes = 0;\n var expenses = 0;\n var budget;\n // calculate total income\n data.allItems.inc.forEach(function(item) {\n incomes+= item.value;\n })\n //calculate total expenses\n data.allItems.exp.forEach(function(item) {\n expenses+= item.value;\n })\n //calculate total budget\n budget = incomes - expenses;\n // Put them in our data structure\n data.total.exp = expenses;\n data.total.inc = incomes;\n //Set Budget\n data.budget = budget;\n }", "function fn_total(row) {\n var total = 0.0;\n for (var i = 0; i < row; i++) {\n if ($(\"#cbo-enfoque\").val() == 1) {\n if ($(\"#txt-det-7-\" + (i + 1)).val() != '') {\n total += parseFloat($(\"#txt-det-7-\" + (i + 1)).val());\n }\n } else if ($(\"#cbo-enfoque\").val() == 2) {\n if ($(\"#txt-det-8-\" + (i + 1)).val() != '') {\n total += parseFloat($(\"#txt-det-8-\" + (i + 1)).val());\n }\n } else if ($(\"#cbo-enfoque\").val() == 3) {\n if ($(\"#txt-det-5-\" + (i + 1)).val() != '') {\n total += parseFloat($(\"#txt-det-5-\" + (i + 1)).val());\n }\n } else if ($(\"#cbo-enfoque\").val() == 4) {\n if ($(\"#txt-det-6-\" + (i + 1)).val() != '') {\n total += parseFloat($(\"#txt-det-6-\" + (i + 1)).val());\n }\n }\n }\n $(\"#cuerpoTablaIndicador\").data(\"total\", total);\n $(\"#total-detalle\").html(\"\");\n $(\"#total-detalle\").append((Math.round(total * 100) / 100));\n //$(\"#total-detalle2\").html(\"\");\n //$(\"#total-detalle2\").append((Math.round(total * 100) / 100));\n}", "function getMoney() {\n\t$('entries').apend('<tr><th></th><thd>') + total + '</td></tr>'();\n}", "function fnAlltotal(){\n console.log(\"TOTAL hit\")\n var subTotal=0;\n\n $(\".amount\").each(function(){\n subTotal += parseFloat($(this).val()||0);\n });\n\n \n final.subTotal = subTotal\n final.total = subTotal\n $('#td-subtotal').html(( final.subTotal).toFixed(3)); \n $('#td-total').html(( final.total).toFixed(3) - lead['discount'].toFixed(3));\n}", "function updateValues(){\n const amounts=transactions.map(transaction=>\n transaction.amount)\n\nconst total=amounts.reduce((acc,item)=>\n (acc+=item),0).toFixed(2);\n \n\n const income=amounts\n .filter(item=>item>0)\n .reduce((acc,item)=>(acc+=item),0)\n \n\n const expense=(amounts\n .filter(item=>item<0)\n .reduce((acc,item)=>\n (acc+=item),0)*-1).toFixed(2);\n \n\n balance.innerText=`$${total}`;\n moneyPlus.innerText=`$${income}`;\n moneyMinus.innerText=`$${expense}`;\n}", "function balance_update(data) {\n // console.log('Balance Update');\n // for ( let obj of data.B ) {\n // let { a:asset, f:available, l:onOrder } = obj;\n // if ( available == '0.00000000' ) continue;\n // console.log(asset+'\\tavailable: '+available+' ('+onOrder+' on order)');\n // }\n }", "function mod_inventory_report_table() {\n //\n var report_rows = document.getElementById('meat-shop-report').getElementsByTagName(\"TR\");;\n //\n // hiding the page nav bar\n add_class('hidden-elm','report-page-nav')\n //\n // modifying head row to add in total value column\n var head_row = report_rows[0];\n var td = document.createElementWithAttr('TD',{'id' : 'total-value', 'class' : 'default-table-header'});\n td.appendChild(document.createTextNode('Total Value'));\n head_row.appendChild(td);\n //\n // processing rows\n var money_fmt_str = '<span style=\"float:left;\">$&nbsp;</span><span style=\"float:right;\">%value%<span>';\n var type_str = 'float%round(r,'+CONSTANTS.STD_PRECISION+')';\n var row = null;\n var price_td = null;\n var price_span = null;\n var qty_td = null;\n var value_td = null;\n var value_span = null;\n var dollar_sign = document.createElement('SPAN');\n dollar_sign.style['float'] = 'left';\n dollar_sign.appendChild(document.createTextNode('$\\u00A0'));\n var dollar_value = document.createElement('SPAN');\n dollar_value.style['float'] = 'right';\n //\n var total_weight = 0.0;\n var total_value = 0.0;\n var price = 0.0;\n var qty = 0.0;\n var value = 0.0;\n //\n for (var i = 1; i < report_rows.length; i++) {\n row = report_rows[i];\n price_td = document.getElementById(row.id+'-cost_per_lb');\n qty_td = document.getElementById(row.id+'-quantity');\n value_td = document.createElementWithAttr('TD',{'id' : row.id, 'class' : 'default-table-td'})\n //\n // calculating values\n price = Number.parse(price_td.innerHTML);\n qty = Number.parse(qty_td.innerHTML);\n value = qty*price;\n total_weight += qty;\n total_value += value;\n //\n // outputting tds\n remove_all_children(price_td,'');\n remove_all_children(qty_td,'');\n price_span = dollar_value.cloneNode();\n value_span = dollar_value.cloneNode();\n process_data_type(price,type_str,price_span,null);\n process_data_type(qty,type_str,qty_td,null);\n process_data_type(value,type_str,value_span,null);\n price_td.appendChild(dollar_sign.cloneNode(true));\n price_td.appendChild(price_span);\n value_td.appendChild(dollar_sign.cloneNode(true));\n value_td.appendChild(value_span);\n row.appendChild(value_td);\n }\n //\n // outputting a total row at the bottom of the table\n var total_row = document.createElement('TR');\n var total_td = document.createElementWithAttr('TD',{'class' : 'default-table-header', 'colspan' : '2'});\n var total_qty = document.createElementWithAttr('TD',{'class' : 'default-table-header'});\n var total_blk = document.createElementWithAttr('TD',{'class' : 'default-table-header'});\n var total_val = document.createElementWithAttr('TD',{'class' : 'default-table-header'});\n total_row.style['font-size'] = '16px';\n total_qty.style['text-align'] = 'right';\n total_val.style['text-align'] = 'right';\n total_td.appendChild(document.createTextNode('Total:'));\n total_blk.appendChild(document.createTextNode('\\u00A0'));\n process_data_type(total_weight,type_str,total_qty,null);\n value_span = dollar_value.cloneNode();\n process_data_type(total_value,type_str,value_span,null);\n //\n total_row.appendChild(total_td);\n total_row.appendChild(total_qty);\n total_row.appendChild(total_blk);\n total_val.appendChild(dollar_sign.cloneNode(true));\n total_val.appendChild(value_span);\n total_row.appendChild(total_val);\n document.getElementById('meat-shop-report').appendChild(total_row);\n}", "function updateBalance(){\r\n //new array that only have transaction amount\r\n const transactionAmounts = transactions.map( transaction => transaction.amount);\r\n \r\n const totalBalance = transactionAmounts.reduce( (acc, amount) => ( acc += amount), 0 );\r\n\r\n // let debitBalance = 0;\r\n \r\n //calculate credit balance\r\n const creditBalance = transactionAmounts.filter(amount => amount>0).reduce((acc,amount) => (acc+=amount),0\r\n );\r\n //calculate debit balance\r\n const debitBalance = transactionAmounts.filter(amount => amount<0).reduce((acc,amount) => (acc+=amount),0);\r\n \r\n //update all values in the DOM\r\n balance.innerText = `$${totalBalance}`;\r\n moneyCredit.innerText = `$${creditBalance}`;\r\n moneyDebit.innerText= `$${debitBalance}`;\r\n}", "function calLedgerTotalValues(){\n\tvar finalBillAmount=0;\n\tvar finalAmountPaid=0;\n\tvar finalCumulativeAmount=0;\n\tvar finalRecoveryAmount=0;\n\t\n\t$(\".BillAmountCls\").each(function(){\n\t\tfinalBillAmount+=parseFloat($(this).text()==''?0:$(this).text().replace(/,/g,''));\n\t})\n\t$(\".AmountPaidCls\").each(function(){\n\t\tfinalAmountPaid+=parseFloat($(this).text()==''?0:$(this).text().replace(/,/g,''));\n\t})\n\t$(\".CumulativeAmountCls\").each(function(){\n\t\tfinalCumulativeAmount+=parseFloat($(this).text()==''?0:$(this).text().replace(/,/g,''));\n\t})\n\t$(\".RecoveryAmountCls\").each(function(){\n\t\tfinalRecoveryAmount+=parseFloat($(this).text()==''?0:$(this).text().replace(/,/g,''));\n\t})\n\n\t$(\"#TotalBillAmount\").html(inrFormat(finalBillAmount.toFixed(2)));\n\t$(\"#TotalAmountPaid\").html(inrFormat(finalAmountPaid.toFixed(2)));\n\t$(\"#TotalRecoveryAmount\").html(inrFormat(finalRecoveryAmount.toFixed(2)));\n\t//$(\"#TotalCumulativeAmount\").html(finalCumulativeAmount.toFixed(2));\n}", "function calculateAmountOfPage() {\n\n // Count of numbers shown after point\n var decimals = 2;\n\n // Set default ammount for the current page\n var totalOfThePage = 0;\n\n // Set index of the table column containing the ammount\n var table = $('div.tab-content div.active table.dataTable');\n column = table.find('th.amount-column'),\n colIdx = column.length ? (column.index() + 1) : 6;\n \n table.find('tbody').find('tr > td:nth-child('+colIdx+')').each(function () {\n totalOfThePage += !isNaN(parseFloat($(this).text())) ? parseFloat($(this).text()) : 0;\n });\n\n $('.totalAmount .totalAcceptedOfPage span').html(parseFloat(totalOfThePage).toFixed(decimals));\n}", "computeTotals()\n {\n if (this.file.transactions.length == 0)\n return\n\n this.totalSpendings = this.file.transactions\n .map(x => Math.min(x.amount, 0))\n .reduce((acc, x) => acc + x)\n\n this.totalIncome = this.file.transactions\n .map(x => Math.max(x.amount, 0))\n .reduce((acc, x) => acc + x)\n }", "function getTotal() {\n \"use strict\";\n numShares = getNumberOfShares();\n priceShares = getPriceOfShares();\n commission = getCommissionCost();\n var commissionTotal = priceShares * numShares * commission,\n totalCost = priceShares * numShares,\n total = commissionTotal + totalCost,\n totalFormatted = total.toLocaleString('en', {style: 'currency', currency: 'USD'});\n \n if (figureOutBuyingOrSelling() === true) {\n console.log(\"Total cost of transaction: \" + totalFormatted);\n document.getElementById(\"totalAmount\").innerHTML = \"Total Cost: \" + totalFormatted;\n document.getElementById(\"totalAmount\").style.backgroundColor = \"red\";\n addToTable(-total);\n } else {\n console.log(\"Total profit of transaction: \" + totalFormatted);\n document.getElementById(\"totalAmount\").innerHTML = \"Total Profit: \" + totalFormatted;\n document.getElementById(\"totalAmount\").style.backgroundColor = \"green\";\n addToTable(total);\n }\n}", "function banksRankingByTotalBalance() {\r\n\t// totales por Bancos de menor a mayor\r\n\t// accounts banks\r\n\tfunction listBankName() {\r\n\t\t return banks.map((banks) => banks.name);\r\n\t};\r\n\tfunction listBankId() {\r\n\t\t return banks.map((banks) => banks.id);\r\n\t};\r\n\t\r\n\tconst arraybankId = listBankId();\r\n\tconst arraybankName = listBankName();\r\n\t\r\n\tfunction listAccountsClientId() {\r\n\t\t return accounts.map((account) => account.clientId);\r\n\t};\r\n\r\n\tfunction listAccountsBankId() {\r\n\t\t return accounts.map((account) => account.bankId);\r\n\t};\r\n\t\r\n\tfunction listAccountsBalance() {\r\n\t\t return accounts.map((account) => account.balance);\r\n\t};\r\n\t\r\n\tconst arrayAccountClientId = listAccountsClientId();\r\n\tconst arrayAccountBankId = listAccountsBankId();\r\n\tconst arrayAccountBalance = listAccountsBalance();\r\n\t\r\n\tlet idrutesxbancos = [];\r\n \tidrutesxbancos.length = accounts.length;\r\n\t\r\n let idbancos = [];\r\n\t\tidbancos.length = accounts.length;\r\n\t\t\r\n\tlet balances = [];\r\n\t\tbalances.length = accounts.length;\t\r\n\t\r\n\tlet saldoxbanco = [];\r\n\t\tsaldoxbanco.length = accounts.length;\r\n\t \r\n\tlet bancos = [];\r\n\t\tbancos.length = 2;\r\n\t\t\r\n\t\tvar balance = 0;\r\n\t\tvar sumaS = 0;\r\n\t\tvar sumaCh = 0;\r\n\t\tvar sumaE = 0;\r\n\t\tfor (const prop in accounts) {\r\n\t\t\t\r\n\t\t\tswitch (parseInt(accounts[prop].bankId)) {\r\n\t\t\t case 1: \r\n\t\t\t\t //console.log(accounts[prop].bankId +' '+ accounts[prop].balance);\r\n\t\t\t\t balances[prop] = accounts[prop].balance;\r\n\t\t\t\t sumaS = sumaS + parseInt(balances[prop]);\r\n\t\t\t\t idbancos[prop] = accounts[prop].bankId;\r\n\t\t\t\t break;\r\n\t\t\t case 2: \r\n\t\t\t\t //console.log(accounts[prop].bankId +' '+ accounts[prop].balance);\r\n\t\t\t\t balances[prop] = accounts[prop].balance;\r\n\t\t\t\t sumaCh = sumaCh + parseInt(balances[prop]);\r\n\t\t\t\t idbancos[prop] = accounts[prop].bankId;\r\n\t\t\t\t break;\r\n\t\t\t case 3: \r\n\t\t\t\t //console.log(accounts[prop].bankId +' '+ accounts[prop].balance);\r\n\t\t\t\t balances[prop] = accounts[prop].balance;\r\n\t\t\t\t sumaE = sumaE + parseInt(balances[prop]);\r\n\t\t\t\t idbancos[prop] = accounts[prop].bankId;\r\n\t\t\t\t break;\r\n\t\t\t default:\r\n\t\t\t\t break;\r\n\t\t\t \r\n\t\t\t} \r\n\t\t\t\r\n\t\t}\t\r\n\t\t\r\n\t\tbancos[0] = sumaS;\r\n\t\tbancos[1] = sumaCh;\r\n\t\tbancos[2] = sumaE;\r\n\t\tconsole.log('Arreglo con valores crescientes administrado por bancos');\r\n\t\tbancos.sort();\r\n\t\tconsole.log(bancos.reverse());\r\n\t\tconsole.log('-----------------------------------------');\r\n\t\t/**\r\n\t\t * Funciones\r\n\t\t */\r\n\t}", "function updateValues() {\n const deposits = TransactionData.map(transaction => transaction.deposit);\n const loans = TransactionData.map(transaction => transaction.loan);\n const total_deposit = deposits.reduce((acc, item) => (acc += item), 0).toFixed(2);\n const total_loan = loans.reduce((acc, item) => (acc += item), 0).toFixed(2);\n const bal = total_deposit - total_loan;\n balance.innerText = `$${bal}`;\n money_plus.innerText = `$${total_deposit}`;\n money_minus.innerText = `$${total_loan}`;\n reco.innerText = (bal >= 0)? \"You Have Sound Financial Health\": \"Your Financial Health is Weak\";\n}", "function calculaTotalVenda(){\n\n let totalGeral = 0;\n $('#vendaPainelTable #itensTable').find('tbody tr').each(function(){\n let val = $(this).find('td:eq(6)').text(); \n totalGeral+=parseFloat(foramtCalcCod(val));\n\n })\n\n totalComGlob = totalGeral;\n\n totalGeral = formatMoney(totalGeral)\n $('form#vendaPainelTable #totGeralVenda').text(totalGeral);//adiciona o valor formatado no campo total\n\n return foramtCalcCod(totalGeral);//retorna o valor pronto para calculos\n}", "getCumulativeTotal() {\n var transactions = fake_data.transactions.sort((a, b) => {\n return new Date(a.date) - new Date(b.date);\n });\n console.log(transactions);\n var starting_balance = fake_data.balance;\n var totalValues = [];\n var total = 0;\n transactions.forEach((t) => {\n starting_balance += t.amount;\n totalValues.push(starting_balance);\n });\n return totalValues;\n }", "total() {\n return transactionObj.incomes() + transactionObj.expenses()\n }", "function callTotal() {\n var totRow = document.getElementById('timeTot');\n\n // Make sure our row is empty\n while (totRow.lastChild) {\n totRow.removeChild(totRow.lastChild);\n }\n\n var totLabel = document.createElement('th');\n totLabel.textContent = 'Hourly Totals';\n totRow.appendChild(totLabel);\n\n var grandTotal = 0;\n\n for (var k = 0; k < hours.length - 1; k++) {\n\n var currentHour = hours[k]; // e.g. \"8:00AM\";\n var currentHourSales = [];\n\n for (var l = 0; l < data.length; l++) {\n var currentStore = data[l];\n currentHourSales.push(currentStore.sales[currentHour]);\n }\n\n // currentHourSales.push(pike.stats[k], seaTac.stats[k], seaCtr.stats[k], capHill.stats[k], alki.stats[k]);\n\n var sum = currentHourSales.reduce(function (a, b) { return a + b; }, 0);\n grandTotal += sum;\n\n var tot = document.createElement('td');\n tot.textContent = Math.round(sum);\n totRow.appendChild(tot);\n domTable.appendChild(totRow);\n }\n //var allTots = [];\n //allTots.push(pike.sums, seaTac.sums, seaCtr.sums, capHill.sums, alki.sums);\n\n //console.log('parseint' + allTots);\n //var sums = parseInt(allTots[0]) + parseInt(allTots[1]) + parseInt(allTots[2]) + parseInt(allTots[3]) + parseInt(allTots[4]);\n\n //console.log(sums);\n\n var grandTotalElement = document.createElement('td');\n grandTotalElement.textContent = Math.round(grandTotal);\n totRow.appendChild(grandTotalElement);\n}", "function staffTotal(staffData){\n const staffBalance = staffData.map(function(cost){\n return cost.balance;\n });\n const totalBalance = staffBalance.reduce(function(prev, curr){\n return prev + curr;\n });\n console.log(staffBalance);\n console.log(totalBalance);\n}", "function printTotals(report, table) {\n\ttableRow = table.addRow();\n\ttableRow.addCell(\"\", \"\", 2);\n\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(sumDebit), \"alignRight font12 bold\", 1);\n\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(sumCredit), \"alignRight font12 bold\", 1);\n}", "function sumOfAllBalances(data) {\n let totalSum = 0;\n for(let i = 0; i < data.length; i++) {\n let sum = parseFloat(data[i]['balance'].replaceAll(',', '').replaceAll('$', ''))\n totalSum += sum\n }\n return totalSum\n}", "function calculateRowTotal(key, data) {\n \n // get the value attributes for each of the row items.\n let sizeID = $( '#size' + key + ' option:selected').val();\n let paperID = $('#paper' + key + ' option:selected').val();\n let frameID = $('#frame' + key + ' option:selected').val();\n let quant = $('#quantity'+key).val();\n \n // if quantity is blank or is undefined, force a 0 value for it. \n if(quant === '' || quant === undefined) {\n quant = 0;\n }\n \n //set the paper cost based on the selected value.\n let paperCost = data.stock[paperID].large_cost;\n if(sizeID < 2){\n paperCost = data.stock[paperID].small_cost;\n } \n \n // return the new calculated price of the row passed in.\n return calculatePrice(data.sizes[sizeID].cost, paperCost, data.frame[frameID].costs[sizeID], quant); \n \n }", "total(){\n return Transaction.incomes() + Transaction.expenses();\n }", "function updateBalance() {\n // Create a new array with just the amounts from the transactions array\n const transactionAmounts = transactions.map( transaction => transaction.amount );\n // Calculate total balance value\n const totalBalance = transactionAmounts.reduce( (acc, amount) => ( acc += amount), 0 );\n // Calculate total credit balance value\n const creditBalance = transactionAmounts\n .filter(amount => amount > 0)\n .reduce( (acc, amount) => (acc += amount), 0 );\n // Calculate total debit balance value\n const debitBalance = transactionAmounts\n .filter(amount => amount < 0)\n .reduce( (acc, amount) => (acc += amount), 0 );\n // Update values in the DOM for overall balance, credit balance, and debit balance\n balance.innerText = `$${totalBalance}`;\n moneyCredit.innerText = `$${creditBalance}`;\n moneyDebit.innerText = `$${debitBalance}`;\n}", "function calcTotal (taxTot, shipTot, subTot) {\n taxTot = parseFloat(taxTot);\n shipTot = parseFloat(shipTot);\n subTot = parseFloat(subTot);\n console.log(\"in calcTotal\");\n total = (subTot + taxTot + shipTot);\n total = total.toFixed(2);\n document.getElementById(\"total\").innerHTML = \"Total: $\" + total;\n // Update Total in Table\n}", "balance(){\n\n let sum = 0;\n\n //how can you use higher order function here.\n // for i is less than the transactions length \n for(let i = 0; i < this.transactions.length; i++){\n //create a current transaction to represent the position in transactions\n let currentTransaction = this.transactions[i];\n //sum is equal to sum plus the current transaction amount\n sum = sum + currentTransaction.amount;\n }\n //then we will return the sum at the end to show the sum at the end.\n return sum;\n}", "function getMyBalance() {\n return df.getMyBalanceEth();\n}", "getTotal(){\n this.totalPaid = this.periods * this.scPayment\n this.totalInterest = this.totalPaid - this.loanAmount\n }", "function userAcctBalance(acct){\n for (let i = 0; i < acct.length; i++) {\n acct[i].balance = +(acct[i].price * acct[i].share).toFixed(2);\n }\n}", "function totalDue() {\n\tconsole.log(\"Adding Bills\");\n\n\t$.get(\"/totalPayments\", function(data) {\n\t\tconsole.log(\"Back from the server with: \" );\n\t\tconsole.log(data);\n\n var total = data.results.sum[0].sum;\n \n \n $(\"#tableTotalDue\").append(\"<tr><th>Total Monthly Payments</th></tr>\");\n\n\t\t$(\"#tableTotalDue\").append(\"<tr><td>\" + total + \"</td></tr>\");\n });\n \n }", "getTotalCost() {\n return this.transactions.map(t => t.cost).reduce((acc, value) => acc + value, 0);\n }", "function transactions_createBalanceSheetTable(data)\n\t{\n\t\t$(\"#balanceSheet_balancesheetDtsTbl > tbody\").empty();\n\t\tvar transactions = data.responseTransactionsDTOs;\n\t\tvar tableData = \"\";\n\t\t\n\t\t/**\n\t\t * check if transactions details are empty\n\t\t */\n\t\tif(transactions.length <= 0) return;\n\t\t\n\t\t/**\n\t\t * Populate all transactions and its details\n\t\t */\n\t\tfor(var i=0; i<transactions.length; i++)\n\t\t{\n\t\t\tvar tr = \"<tr> \";\n\t\t\ttr += \" <td> \"+(i+1)+\" </td>\"\n\t\t\ttr += \" <td> \"+transactions[i].date+\" </td>\"\n\t\t\ttr += \" <td> \"+transactions[i].amount+\" </td>\"\n\t\t\ttr += \" <td> \"+transactions[i].transactionType+\" </td>\"\n\t\t\ttr += \" <td> \"+transactions[i].description+\" </td>\"\n\t\t\ttr += \" </tr>\";\n\t\t\ttableData+= tr;\n\t\t}\n\t $(\"#balanceSheet_balancesheetDtsTbl\").append(tableData);\n\t \n\t $(\"#balanceSheet_totalCreditAmount\").val((data.totalCreditAmount == null ? 0 : data.totalCreditAmount))\n\t $(\"#balanceSheet_totalDebitAmount\").val((data.totalDebitAmount == null ? 0 : data.totalDebitAmount))\n\t $(\"#balanceSheet_closingBalance\").val((data.closingBalance == null ? 0 : data.closingBalance))\n\t \n\t \n\t}", "function printTable() {\r\n let budgetList = HandleLocalStorage.getBudgetItems();\r\n let totalAllocation = 0;\r\n\r\n console.log(budgetList);\r\n\r\n var previousTransaction = '<table>'+\r\n '<tr>'+\r\n '<th>Category</th>'+\r\n '<th>Allocation</th>'+\r\n '</tr>';\r\n \r\n //amount = accounting.formatMoney(parseInt(amount), {symbol:\"Php\",precision: 0, thousand: \",\", format: \"%s%v\"});\r\n budgetList.forEach(budgetItem => {\r\n previousTransaction += '<tr>'+\r\n '<td>'+budgetItem.categoryName+'</tD>'+\r\n '<td>'+ accounting.formatMoney(parseInt(budgetItem.budgetAmount), {symbol: \"₱\" ,precision: 0, thousand: \",\", format: \"%s%v\"})+'</th>'+\r\n '</th>'+\r\n '</tr>' \r\n //show total amount allocation\r\n totalAllocation += parseInt(budgetItem.budgetAmount);\r\n \r\n });\r\n\r\n //format into currency: P x,xxx\r\n totalAllocation = accounting.formatMoney(totalAllocation, {symbol: \"₱\" ,precision: 0, thousand: \",\", format: \"%s%v\"});\r\n budgetLeftAmt.innerText = totalAllocation;\r\n\r\n previousTransaction += '</table>';\r\n console.log(previousTransaction);\r\n budgetTable.innerHTML = previousTransaction;\r\n budgetTableContainer.style.display = \"block\"; \r\n}", "function updateValues() {\r\n //Toma los valores de cada transaccion ingresada\r\n const amounts = transactions.map(transaction => transaction.amount);\r\n //Sumando y restando todos los valores\r\n const total = amounts.reduce((acc, item) => (acc += item), 0).toFixed(2);\r\n\r\n //Ingresos totales\r\n const income = amounts\r\n .filter(item => item > 0)\r\n .reduce((acc, item) => (acc += item), 0)\r\n .toFixed(2);\r\n\r\n //Egresos o expensas totales\r\n const expense = (\r\n amounts.filter(item => item < 0).reduce((acc, item) => (acc += item), 0) *-1\r\n ).toFixed(2);\r\n\r\n // Mostrando en pantalla lo calculado anteriormente\r\n balance.innerText = `$${total}`;\r\n money_plus.innerText = `$${income}`;\r\n money_minus.innerText = `$${expense}`;\r\n}", "function createTotalTable(){\n\t// console.log(\"\\n---------- CREATING TOTAL TABLE ----------\");\n\tvar cDiv = $(\".blockTotal table\");\n\tvar html = [];\n\t// console.log(\"table : \");\n\t// console.log(cDiv);\n\thtml.push('<thead><th>MONEDA</th><th>+</th><th>-</th><th>TOTAL</th></thead><tbody>');\n\t$.each(curArr,function(i,v){\n\t\thtml.push('<tr><td class=\"totCur '+v+'\">'+v+'</td><td class=\"pos '+v+'\">---</td><td class=\"neg '+v+'\">---</td><th class=\"tot '+v+'\">---</th></tr>');\n\t});\n\thtml.push('</tbody>');\n\thtml.push('<tfoot><td>');\n\thtml.push('<div class=\"input-group-btn\">\\\n\t\t <button type=\"button\" class=\"btn btn-default dropdown-toggle\" data-toggle=\"dropdown\" align=\"left\">\\\n\t\t\t<span class=\"targetDropdown curTotal curChoice in\" id=\"inCuIn\"></span>\\\n\t\t\t<span class=\"caret\"></span>\\\n\t\t </button>\\\n\t\t <ul class=\"dropdown-menu\">\\\n\t\t </ul>\\\n\t\t </div>');\n\thtml.push('</td><th class=\"pos total\">---</th><th class=\"neg total\">---</th><th class=\"tot total\">---</th></tfoot>');\n\tcDiv.append(html.join(''));\n\t// console.log(\"\\n---------- END CREATING TOTAL TABLE ----------\");\n}", "function updateTotalField(total, todayDeposit){\n const balancdText = document.getElementById(total);\n const balanceReceived = balancdText.innerText;\n const balanceAmount = parseFloat(balanceReceived);\n const totalBalance = balanceAmount + todayDeposit;\n balancdText.innerText = totalBalance;\n // const totalDepost = depostBalance +\n // return totalBalance;\n}", "function getBankTotal(id, history) {\n return history[id].coins;\n }", "function handleTotals() {\n let total = 0;\n let tds = table.querySelectorAll(\"#table > tbody > tr > td:nth-child(9)\");\n tds.forEach((el) => (total += parseFloat(el.textContent)));\n subtotal.innerText = total;\n}", "calculateBalance() {\n\tlet creditResult = this.state.creditData.map(({ amount }) => amount)\n\tlet creditSum = creditResult.reduce(function(a, b){\n return a + b;\n }, 0);\n\tconsole.log(creditSum);\n\n\tlet debitResult = this.state.debitData.map(({ amount }) => amount)\n\tlet debitSum = debitResult.reduce(function(a, b){\n return a + b;\n }, 0);\n\tconsole.log(debitSum);\n\n let totalBalance = creditSum - debitSum;\n\tconsole.log(totalBalance);\n\n this.setState({ accountBalance: totalBalance.toFixed(2) });\n }", "function calculateTransactionTotal(transData) {\n\t\t\tlet fromTotal = transData.from.amount,\n\t\t\t\tfromLoading = transData.from.loading,\n\t\t\t\ttoTotal = transData.to.amount,\n\t\t\t\ttoLoading = transData.to.loading;\n\n\t\t\tlet fromCommission = 0,\n\t\t\t\ttoCommission = 0,\n\t\t\t\tcommissionLoading = false;\n\n\t\t\tif (commission) {\n\t\t\t\tfor (let commId in transData.commission) {\n\t\t\t\t\tlet commData = transData.commission[commId];\n\n\t\t\t\t\tfromCommission += (commData.feeInAccountCurrency || 0);\n\t\t\t\t\ttoCommission += (commData.feeInPaymentCurrency || 0);\n\t\t\t\t\tcommissionLoading = commissionLoading || commData.loading;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcommission: {\n\t\t\t\t\tfrom: fromCommission,\n\t\t\t\t\tto: toCommission,\n\t\t\t\t\tloading: commissionLoading\n\t\t\t\t},\n\t\t\t\tfrom: {\n\t\t\t\t\tcurrency: transData.from.currency,\n\t\t\t\t\tamount: transData.from.amount + fromCommission,\n\t\t\t\t\tloading: transData.from.loading || commissionLoading,\n\t\t\t\t},\n\t\t\t\tto: {\n\t\t\t\t\tcurrency: transData.to.currency,\n\t\t\t\t\tamount: transData.to.amount + toCommission,\n\t\t\t\t\tloading: transData.to.loading || commissionLoading,\n\t\t\t\t},\n\t\t\t}\n\t\t}", "function printBalanceSheet(startDate, endDate, report, table) {\n\t\n\t//Get the Accounts table\n\tvar accountsTab = Banana.document.table(\"Accounts\");\n\n\t//Assets - BClass 1\n\tfor (var i = 0; i < accountsTab.rowCount; i++) {\t\n\t\tvar tRow = accountsTab.row(i);\n\n\t\tif (tRow.value(\"Account\") && tRow.value(\"BClass\") == \"1\") {\n\t\t\ttableRow = table.addRow();\n\t\t\ttableRow.addCell(tRow.value(\"Account\"), \"alignRight\", 1);\n\t\t\ttableRow.addCell(tRow.value(\"Description\"), \"\", 1);\n\t\t\tvar bal = calcBalance(tRow.value(\"Account\"), tRow.value(\"BClass\"), startDate, endDate);\n\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(bal), \"alignRight\", 1);\n\t\t\ttableRow.addCell(\"\", \"\", 1);\n\t\t\tsumDebit = Banana.SDecimal.add(sumDebit, bal);\n\t\t}\n\t}\t\n\n\t//Liabilities - BClass 2\n\tfor (var i = 0; i < accountsTab.rowCount; i++) {\t\n\t\tvar tRow = accountsTab.row(i);\n\n\t\tif (tRow.value(\"Account\") && tRow.value(\"BClass\") == \"2\") {\n\t\t\ttableRow = table.addRow();\n\t\t\ttableRow.addCell(tRow.value(\"Account\"), \"alignRight\", 1);\n\t\t\ttableRow.addCell(tRow.value(\"Description\"), \"\", 1);\n\t\t\ttableRow.addCell(\"\", \"\", 1);\n\t\t\tvar bal = calcBalance(tRow.value(\"Account\"), tRow.value(\"BClass\"), startDate, endDate);\n\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(bal), \"alignRight\", 1);\n\t\t\tsumCredit = Banana.SDecimal.add(sumCredit, bal);\n\t\t}\n\t}\n}", "function updateValues() {\n const deposits = TransactionData.map((transaction) => transaction.deposit);\n const loans = TransactionData.map((transaction) => transaction.loan);\n total_deposit = deposits.reduce((acc, item) => (acc += item), 0).toFixed(2);\n total_loan = loans.reduce((acc, item) => (acc += item), 0).toFixed(2);\n const bal = total_deposit - total_loan;\n balance.innerText = `$${bal}`;\n money_plus.innerText = `$${total_deposit}`;\n money_minus.innerText = `$${total_loan}`;\n reco.innerText =\n bal >= 0\n ? \"You Have Sound Financial Health\"\n : \"Your Financial Health is Weak\";\n drawChart();\n}", "function totalBill()\n{\n var result = 0.00;\n\n for (var i = 0; i < outstandingBill.length; i++)\n {\n result += outstandingBill[i].cost;\n }\n\n //console.log(\"bill total = \" + result);\n return result;\n}", "function sumar()\n{\n\tvar total = $('#tbllistado').DataTable();\n \ttotal.column( 8 ).data().sum();\n\t\t\tconsole.log(total[8]);\n\t\t\t$(\"#total\").html(total);\n}", "outstandingBalance() {\n const amountPaid = this.amountPaidOnInvoice();\n const invoiceTotal = this.amount;\n const tip = this.tip || 0;\n return (invoiceTotal + tip) - amountPaid;\n }", "function reserMgrItemDetail() {\n var tbodySelector = $('#tblInvoiceItemDetail tbody tr');\n $('#txtTotalItemDetail').val(tbodySelector.length);\n var number = 1;\n var total = $('#total');\n var sub_total = parseFloat(0);\n $(tbodySelector).each(function() {\n $(this).find('td:eq(0)').text(number+'.');\n $(this).find('td input.invoiceUnitPrice').attr({id: 'txtInvoiceUnitPrice_'+number, name: 'txtInvoiceUnitPrice_'+number});\n $(this).find('td input.txtItemSKU').attr({id: 'txtItemSKU_'+number, name: 'txtItemSKU_'+number});\n $(this).find('td input.txtPartNo').attr({id: 'txtPartNo_'+number, name: 'txtPartNo_'+number});\n $(this).find('td input.txtItemName').attr({id: 'txtItemName_'+number, name: 'txtItemName_'+number});\n $(this).find('td input.txtItemRemark').attr({id: 'txtItemRemark_'+number, name: 'txtItemRemark_'+number});\n $(this).find('td input.txtUomName').attr({id: 'txtUomName_'+number, name: 'txtUomName_'+number});\n $(this).find('td input.txtQuantity').attr({id: 'txtQuantity_'+number, name: 'txtQuantity_'+number});\n $(this).find('td input.txtUnitPrice').attr({id: 'txtUnitPrice_'+number, name: 'txtUnitPrice_'+number});\n $(this).find('td input.txtTotalPrice').attr({id: 'txtTotalPrice_'+number, name: 'txtTotalPrice_'+number});\n $(this).find('td input.txtUomId').attr({id: 'txtUomId_'+number, name: 'txtUomId_'+number});\n $(this).find('td input.startMeter').attr({id: 'startMeter_'+number, name: 'startMeter_'+number});\n $(this).find('td input.endMeter').attr({id: 'endMeter_'+number, name: 'endMeter_'+number});\n sub_total += parseFloat($(this).find('td input.txtTotalPrice').val());\n number++;\n });\n var cbGstInclusive = $('#chkInclusiveGST');\n var invType = $('#ddlInvoiceTypeId').children('option:selected').text().trim();\n var gst = $('#txtGST');\n total.val(sub_total);\n if(sub_total !== parseFloat(0)) {\n if(invType === 'Meter Reading') {\n $('#txtSubTotal').val(sub_total);\n $('#subTotalPreview').text(getPriceFormattedNumber(sub_total, 4));\n var gst = $('#txtGST');\n gst.val(parseFloat((parseFloat(0.07) * parseFloat($('#txtSubTotal').val()))));\n gst.data('current', parseFloat((parseFloat(0.07) * parseFloat($('#txtSubTotal').val()))));\n var gstValue = parseFloat(0);\n if(!cbGstInclusive.is(':checked')) {\n $('#txtSubTotal').val(sub_total);\n $('#subTotalPreview').text(getPriceFormattedNumber(sub_total, 4));\n gst.val(parseFloat((parseFloat(0.07) * parseFloat($('#txtSubTotal').val())).toFixed(4)));\n gst.data('current', parseFloat((parseFloat(0.07) * parseFloat($('#txtSubTotal').val())).toFixed(4)));\n gstValue = parseFloat((parseFloat(0.07) * parseFloat($('#txtSubTotal').val())).toFixed(4));\n $('#txtInvoiceGST').val(getPriceFormattedNumber(gstValue, 4));\n\n var grand_total = parseFloat(sub_total) + parseFloat(gstValue);\n $('#grandTotalDisplay').text(getPriceFormattedNumber(grand_total, 4));\n $('#txtGrandTotal').val(grand_total);\n } else {\n $('#txtGrandTotal').val(total.val());\n $('#grandTotalDisplay').text(getPriceFormattedNumber(total.val(), 4));\n gst.val(parseFloat((parseFloat(0.07) * parseFloat(total.val())).toFixed(4)));\n gst.data('current', parseFloat((parseFloat(0.07) * parseFloat(total.val())).toFixed(4)));\n gstValue = parseFloat((parseFloat(0.07) * parseFloat(total.val())).toFixed(4));\n $('#txtInvoiceGST').val(getPriceFormattedNumber(gstValue, 4));\n var subTotal = parseFloat(total.val()) - parseFloat(gstValue);\n $('#txtSubTotal').val(subTotal);\n $('#subTotalPreview').text(getPriceFormattedNumber(subTotal, 4));\n }\n } else {\n $('#txtSubTotal').val(sub_total);\n $('#subTotalPreview').text(getPriceFormattedNumber(sub_total, 2));\n var gst = $('#txtGST');\n gst.val(parseFloat((parseFloat(0.07) * parseFloat($('#txtSubTotal').val())).toFixed(2)));\n gst.data('current', parseFloat((parseFloat(0.07) * parseFloat($('#txtSubTotal').val())).toFixed(2)));\n var gstValue = parseFloat(0);\n if(!cbGstInclusive.is(':checked')) {\n $('#txtSubTotal').val(sub_total);\n $('#subTotalPreview').text(getPriceFormattedNumber(sub_total, 2));\n gst.val(parseFloat((parseFloat(0.07) * parseFloat($('#txtSubTotal').val())).toFixed(2)));\n gst.data('current', parseFloat((parseFloat(0.07) * parseFloat($('#txtSubTotal').val())).toFixed(2)));\n gstValue = parseFloat((parseFloat(0.07) * parseFloat($('#txtSubTotal').val())).toFixed(2));\n $('#txtInvoiceGST').val(getPriceFormattedNumber(gstValue, 2));\n\n var grand_total = parseFloat(sub_total) + parseFloat(gstValue);\n $('#grandTotalDisplay').text(getPriceFormattedNumber(grand_total, 2));\n $('#txtGrandTotal').val(grand_total);\n } else {\n $('#txtGrandTotal').val(total.val());\n $('#grandTotalDisplay').text(getPriceFormattedNumber(total.val(), 2));\n gst.val(parseFloat((parseFloat(0.07) * parseFloat(total.val())).toFixed(2)));\n gst.data('current', parseFloat((parseFloat(0.07) * parseFloat(total.val())).toFixed(2)));\n gstValue = parseFloat((parseFloat(0.07) * parseFloat(total.val())).toFixed(2));\n $('#txtInvoiceGST').val(getPriceFormattedNumber(gstValue, 2));\n var subTotal = parseFloat(total.val()) - parseFloat(gstValue);\n $('#txtSubTotal').val(subTotal);\n $('#subTotalPreview').text(getPriceFormattedNumber(subTotal, 2));\n }\n }\n } else {\n $('#txtSubTotal').val(0);\n $('#subTotalPreview').text('');\n $('#txtGrandTotal').val(0);\n $('#grandTotalDisplay').text('');\n \n // gst\n $('#txtInvoiceGST').val(getPriceFormattedNumber(0, 2));\n $('#txtInvoiceGST').prop('readonly', true);\n $('#txtGST').val(0);\n $('#txtGST').data('current', 0);\n $('#btnDeleteAllItem').hide();\n }\n}", "function transactionTable() { }", "get balance() {\n return this.coins.reduce((acc, {output}) => acc + output.amount, 0);\n }", "updateTotals(){\r\n\t\tvar rows = document.getElementById('orderDetailsBody')['rows'], subTotal=0, freight, x, grandTotal;\r\n\t\t//console.log(rows[0]['cells'][4].innerText);\r\n\t\t//console.log(rows[0]['cells'][1]['children'][0]['value']);\t\t//Unit Price\r\n\t\t//console.log(rows[0]['cells'][2]['children'][0]['value']);\t\t//Quantity\r\n\t\t//console.log(rows[0]['cells'][3]['children'][0]['value']);\t\t//Discount\r\n\t\t//console.log(rows[0]['cells'][4]['children'][0]['value']);\t\t//Extented Price\r\n\t\t//console.log(rows[0]['cells'][4]['innerText']);\r\n\t\t//this.commaFormatted(''+ (unitPrice).toFixed(2));\r\n\r\n\t\t//Calculate the 'Extended Price' cell of every row in the order-details HTML table.\r\n\t\t//And set it in its cell as a string comma formatted.\r\n\t\tfor(let r = 0; r < rows.length; r += 1){\r\n\t\t\tlet unitPrice = this.ParseFloat(rows[r]['cells'][1]['children'][0]['value']);\r\n\t\t\tlet quantity = this.ParseFloat(rows[r]['cells'][2]['children'][0]['value']);\r\n\t\t\tlet discount = this.ParseFloat(rows[r]['cells'][3]['children'][0]['value']);\r\n\t\t\tif(discount >= 1.0){\r\n\t\t\t\tdiscount = discount /100.0;\r\n\t\t\t}\r\n\t\t\tlet extPrice = (unitPrice * (1 - discount)) * quantity;\r\n\t\t\trows[r]['cells'][4]['innerText'] = this.commaFormatted(''+ (extPrice).toFixed(2));\r\n\t\t\tsubTotal += extPrice;\r\n\t\t\tif(discount < 1.0){\r\n\t\t\t\tdiscount = (discount * 100.0);\r\n\t\t\t}\r\n\t\t\trows[r]['cells'][3]['children'][0]['value'] = ''+ ((discount).toFixed(0)) + '%';\r\n\t\t}\r\n\t\t\r\n\t\tx = this.commaFormatted(''+ (subTotal).toFixed(2));\r\n\t\tthis.setIdValue('SubTotal', x);\r\n\t\t\r\n\t\tfreight = this.ParseFloat(this.getInputBoxValue('Freight'));\r\n\t\tx = this.commaFormatted(''+ (freight).toFixed(2));\r\n\t\tthis.setInputBoxValue('Freight', x);\r\n\r\n\t\tgrandTotal = subTotal + freight;\r\n\t\tx = this.commaFormatted(''+ (grandTotal).toFixed(2));\r\n\t\tthis.setIdValue('ExtendedTotal', x);\r\n\r\n\t\treturn 0;\r\n\t}", "function sumTable(panier) {\n let total = 0;\n panier.forEach(element => {\n total = element.productPrice + total;\n });\n total = total / 100;\n sessionStorage.setItem('total', total);\n document.getElementById(\"basket_footer\").innerHTML += '<td colspan=\"3\"> Total de la commande : ' + total + '€</td>';\n}", "calcTotal(){\n\t\t\tlet length = this.sales.length;\n\t\t\tthis.paidCommissionTotal = 0;\n\t\t\tthis.commissionTotal = 0;\n\t\t\tfor(let i = 0; i < length; ++i){\n\t\t\t\t\tthis.commissionTotal += this.sales[i].commission;\n\t\t\t\t\tif(this.sales[i].paid == true){\n\t\t\t\t\t\tthis.paidCommissionTotal += this.sales[i].commission;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tthis.sales.length;\n\t\t}", "function invoice_get_all_item_rows_main_total()\n{\n var no=$(\"#invoiceForm .invoice_participantRow .invoice_main-group\").length;\n var rows_total_amt = 0;\n var rows_disc_amt = 0;\n var inps = $(\"input[name='invoice_calculated_discount[]']\");\n var n = $(\"input[name='invoice_calculated_discount[]']\").length;\n for(var s=0;s<no;s++)\n {\n var current = $(\"#invoiceForm .invoice_participantRow .invoice_main-group .invoice_main_amount\").eq(s).val();\n if(current){\n rows_total_amt = parseFloat(rows_total_amt) + parseFloat(current);\n }\n else{\n rows_total_amt = parseFloat(rows_total_amt) + 0;\n }\n }\n $('input[name^=\"invoice_calculated_discount\"]').each(function() {\n rows_disc_amt = parseFloat(rows_disc_amt) + parseFloat($(this).val());\n });\n rows_total_amt = parseFloat(rows_total_amt) - parseFloat(rows_disc_amt);\n return rows_total_amt;\n}", "function getTotal() {\n const firstClassCount = getInputValue('firstClass');\n const economyCount = getInputValue('economy');\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById('subTotalAmount').innerText = subTotal;\n\n const vat = subTotal * 0.1;\n const total = subTotal + vat;\n document.getElementById('vatAmount').innerText = vat;\n document.getElementById('totalAmount').innerText = total;\n}", "function calculate_total(){\r\n\r\n var hotdogs = GetNum1();\r\n var french_fries = GetNum2();\r\n var drinks = GetNum3();\r\n if(document.forms['items']['num1'].value == \"\" && document.forms['items']['num2'].value == \"\" && document.forms['items']['num3'].value == \"\"){\r\n alert('ERROR: No Items Ordered')\r\n }\r\n \r\n\r\n //console log to make sure the numbers are correct\r\n console.log(hotdogs);\r\n console.log(french_fries);\r\n console.log(drinks);\r\n\r\n \r\n let cost = (hotdogs * cost_hotdog) + (french_fries * cost_fries) + (drinks * cost_drink);\r\n cost = cost.toFixed(2);\r\n cost2 = cost;\r\n console.log(cost2);\r\n if(cost > 20.00){\r\n \r\n discount = cost * discount;\r\n discount = discount.toFixed(2);\r\n cost = cost - discount;\r\n tax = cost * tax;\r\n tax = tax.toFixed(2);\r\n console.log(tax)\r\n total = Number(cost) + Number(tax);\r\n total = total.toFixed(2)\r\n }else{\r\n tax = cost * tax;\r\n tax = tax.toFixed(2);\r\n discount = 0.00;\r\n total = Number(cost) + Number(tax);\r\n console.log(total)\r\n total = total.toFixed(2);\r\n }\r\n //table information\r\n var tableArray = [\r\n ['Items', 'Quantity/Cost'],\r\n ['Hot Dogs $3.25ea', hotdogs],\r\n ['French Fries $2.00ea' , french_fries],\r\n ['Drinks $1.50ea', drinks],\r\n ['Cost Before Tax ($)' , cost2],\r\n ['Discount ($)',discount],\r\n ['Tax After Discount($)', tax],\r\n ['Total ($)', total]\r\n ];\r\n\r\n\r\n //creating the table 2 by 2\r\n var myTableDiv = document.getElementById(\"myTable\");\r\n\r\n var table = document.createElement('TABLE');\r\n table.setAttribute('border','2');\r\n table.setAttribute('width','100%')\r\n\r\n var tableBody = document.createElement('TBODY');\r\n table.appendChild(tableBody);\r\n\r\n for (var i = 0; i < 8; i++) {\r\n var tr = document.createElement('TR');\r\n tableBody.appendChild(tr);\r\n\r\n for (var j = 0; j < 2; j++) {\r\n var td = document.createElement('TD');\r\n td.appendChild(document.createTextNode(tableArray[i][j]));\r\n tr.appendChild(td);\r\n }\r\n }\r\n myTableDiv.appendChild(table);\r\n}", "function updateValues(){\n const amounts=transactions.map(t=ransaction=>transaction.amount);\n //[50000,-10000,-10000,-1000] output of amounts array\n //console.log(amounts);\n const total=amounts.reduce((sum,item)=>(sum+=item),0).toFixed(2);\n const income=amounts\n .filter(item=>item>0)//[50,10]\n .reduce((sum,item)=>(sum+=item),0)//[60]\n .toFixed(2);//[60.00]\n const expense=(amounts\n .filter(item=>item<0)\n .reduce((sum,item)=>(sum+=item),0)*-1)\n .toFixed(2);\n balance.innerText=`Rs ${total}`;\n money_plus.innerText=`Rs ${income}`;\n money_minus.innerText=`Rs ${expense}`;\n}", "currentBalance() {\n const sumTransaction = (a, b) => a + getTransactionAmountWithSign(b);\n\n return slice((state) => state.transactions.reduce(sumTransaction, 0));\n }", "function getwalletbalance() {\r\n\tconst queryString = window.location.search;\r\n\tconst urlParams = new URLSearchParams(queryString);\r\n\tvar tempcutomerhashid = urlParams.get('Customer_has_ID');\r\n\tvar tempwallethashid = urlParams.get('wallet_hash_ID');\r\n\t\r\n\r\n /* var tempcutomerhashid = document.getElementById(\"newcustomerhas\").value;\r\n var tempwallethashid = document.getElementById(\"newwallethas\").value;\r\n*/\r\n\r\n /*var custoname = document.getElementById(\"custoname\").value;*/\r\n\r\n\r\n /* swal({\r\n text: \"Fetching \" + custoname + \"'s Wallet Info\",\r\n icon: \"resources/loader.gif\",\r\n button: false,\r\n closeOnClickOutside: false,\r\n closeOnEsc: false\r\n });*/\r\n\r\n\r\n $.ajax({\r\n\r\n type: \"GET\",\r\n url: \"/NIUMWalletInfo\",\r\n data: {\r\n CustomerHashID: tempcutomerhashid,\r\n WalletHashID: tempwallethashid\r\n },\r\n timeout: 100000,\r\n\r\n success: function(data) {\r\n\r\n\r\n /*swal.close()*/\r\n var obj = JSON.parse(data);\r\n $('#walletbalancetable').empty()\r\n var table = $('#walletbalancetable');\r\n //\t\t\t\t\t \t\t \r\n\r\n for (var w = 0; w < obj.length; w++) {\r\n var val = obj[w];\r\n\r\n var USD = \"$\"; // US Dollar;\r\n var EUR = \"\\u20AC\";\r\n var INR = \"\\u20B9\";\r\n var JPY = \"\\u00A5\";\r\n var IDR = \"Rp\";\r\n var MYR = \"RM\";\r\n var KRW = \"\\u20A9\";\r\n var TWD = \"NT$\";\r\n var THB = \"\\u0E3F\";\r\n var GBP = \"\\u00A3\";\r\n var VND = \"\\u20AB\";\r\n if (val['curSymbol'] == 'SGD') {\r\n\r\n var tab = '<tr><td align=\"center\" valign=\"middle\"> <img src=resources/nisg/images/sgdicon.png width=40 height=40> </td><td align=\"left\" valign=\"middle\" id=\"walletcurrency' + w + '\" value=\"' + val['curSymbol'] + '\" >' + val['curSymbol'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n USD + \" \" + val['balance'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" >' + USD + \" \" + val['withHoldingBalance'] + \"\\n\" + '</td></tr>';\r\n\r\n\r\n\r\n\r\n } else if (val['curSymbol'] == 'USD') {\r\n var tab = '<tr><td align=\"center\" valign=\"middle\"> <img src=resources/nisg/images/usdicon.png width=40 height=40> </td><td align=\"left\" valign=\"middle\" id=\"walletcurrency' + w + '\" value=\"' + val['curSymbol'] + '\" >' + val['curSymbol'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n USD + \" \" + val['balance'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" >' + USD + \" \" + val['withHoldingBalance'] + \"\\n\" + '</td></tr>';\r\n\r\n\r\n\r\n } else if (val['curSymbol'] == 'GBP') {\r\n var tab = '<tr><td align=\"center\" valign=\"middle\"> <img src=resources/nisg/images/gbpicon.png width=40 height=40> </td><td align=\"left\" valign=\"middle\" id=\"walletcurrency' + w + '\" value=\"' + val['curSymbol'] + '\" >' + val['curSymbol'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n GBP + \" \" + val['balance'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" >' + GBP + \" \" + val['withHoldingBalance'] + \"\\n\" + '</td></tr>';\r\n\r\n\r\n\r\n } else if (val['curSymbol'] == 'EUR') {\r\n var tab = '<tr><td align=\"center\" valign=\"middle\"> <img src=resources/nisg/images/euroicon.png width=40 height=40> </td><td align=\"left\" valign=\"middle\" id=\"walletcurrency' + w + '\" value=\"' + val['curSymbol'] + '\" >' + val['curSymbol'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n EUR + \" \" + val['balance'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" >' + EUR + \" \" + val['withHoldingBalance'] + \"\\n\" + '</td></tr>';\r\n\r\n\r\n\r\n } else if (val['curSymbol'] == 'INR') {\r\n var tab = '<tr><td align=\"center\" valign=\"middle\"> <img src=resources/nisg/images/inricon.png width=40 height=40> </td><td align=\"left\" valign=\"middle\" id=\"walletcurrency' + w + '\" value=\"' + val['curSymbol'] + '\" >' + val['curSymbol'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n INR + \" \" + val['balance'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" >' + INR + \" \" + val['withHoldingBalance'] + \"\\n\" + '</td></tr>';\r\n\r\n\r\n\r\n } else if (val['curSymbol'] == 'JPY') {\r\n var tab = '<tr><td align=\"center\" valign=\"middle\"> <img src=resources/nisg/images/jpyicon.png width=40 height=40> </td><td align=\"left\" valign=\"middle\" id=\"walletcurrency' + w + '\" value=\"' + val['curSymbol'] + '\" >' + val['curSymbol'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n JPY + \" \" + val['balance'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" >' + JPY + \" \" + val['withHoldingBalance'] + \"\\n\" + '</td></tr>';\r\n\r\n\r\n\r\n } else if (val['curSymbol'] == 'AUD') {\r\n var tab = '<tr><td align=\"center\" valign=\"middle\"> <img src=resources/nisg/images/audicon.png width=40 height=40> </td><td align=\"left\" valign=\"middle\" id=\"walletcurrency' + w + '\" value=\"' + val['curSymbol'] + '\" >' + val['curSymbol'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n USD + \" \" + val['balance'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" >' + USD + \" \" + val['withHoldingBalance'] + \"\\n\" + '</td></tr>';\r\n\r\n\r\n\r\n } else if (val['curSymbol'] == 'HKD') {\r\n var tab = '<tr><td align=\"center\" valign=\"middle\"> <img src=resources/nisg/images/hkdicon.png width=40 height=40> </td><td align=\"left\" valign=\"middle\" id=\"walletcurrency' + w + '\" value=\"' + val['curSymbol'] + '\" >' + val['curSymbol'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n USD + \" \" + val['balance'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" >' + USD + \" \" + val['withHoldingBalance'] + \"\\n\" + '</td></tr>';\r\n\r\n\r\n\r\n } else if (val['curSymbol'] == 'IDR') {\r\n var tab = '<tr><td align=\"center\" valign=\"middle\"> <img src=resources/nisg/images/idricon.png width=40 height=40> </td><td align=\"left\" valign=\"middle\" id=\"walletcurrency' + w + '\" value=\"' + val['curSymbol'] + '\" >' + val['curSymbol'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n IDR + \" \" + val['balance'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" >' + IDR + \" \" + val['withHoldingBalance'] + \"\\n\" + '</td></tr>';\r\n\r\n\r\n\r\n } else if (val['curSymbol'] == 'MYR') {\r\n var tab = '<tr><td align=\"center\" valign=\"middle\"> <img src=resources/nisg/images/myricon.png width=40 height=40> </td><td align=\"left\" valign=\"middle\" id=\"walletcurrency' + w + '\" value=\"' + val['curSymbol'] + '\" >' + val['curSymbol'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n MYR + \" \" + val['balance'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" >' + MYR + \" \" + val['withHoldingBalance'] + \"\\n\" + '</td></tr>';\r\n\r\n\r\n\r\n } else if (val['curSymbol'] == 'KRW') {\r\n var tab = '<tr><td align=\"center\" valign=\"middle\"> <img src=resources/nisg/images/krwicon.png width=40 height=40> </td><td align=\"left\" valign=\"middle\" id=\"walletcurrency' + w + '\" value=\"' + val['curSymbol'] + '\" >' + val['curSymbol'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n KRW + \" \" + val['balance'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" >' + KRW + \" \" + val['withHoldingBalance'] + \"\\n\" + '</td></tr>';\r\n\r\n\r\n\r\n } else if (val['curSymbol'] == 'TWD') {\r\n var tab = '<tr><td align=\"center\" valign=\"middle\"> <img src=resources/nisg/images/twdicon.png width=40 height=40> </td><td align=\"left\" valign=\"middle\" id=\"walletcurrency' + w + '\" value=\"' + val['curSymbol'] + '\" >' + val['curSymbol'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n TWD + \" \" + val['balance'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" >' + TWD + \" \" + val['withHoldingBalance'] + \"\\n\" + '</td></tr>';\r\n\r\n\r\n\r\n } else if (val['curSymbol'] == 'THB') {\r\n var tab = '<tr><td align=\"center\" valign=\"middle\"> <img src=resources/nisg/images/thbicon.png width=40 height=40> </td><td align=\"left\" valign=\"middle\" id=\"walletcurrency' + w + '\" value=\"' + val['curSymbol'] + '\" >' + val['curSymbol'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n THB + \" \" + val['balance'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" >' + THB + \" \" + val['withHoldingBalance'] + \"\\n\" + '</td></tr>';\r\n\r\n\r\n\r\n } else if (val['curSymbol'] == 'VND') {\r\n var tab = '<tr><td align=\"center\" valign=\"middle\"> <img src=resources/nisg/images/vndicon.png width=40 height=40> </td><td align=\"left\" valign=\"middle\" id=\"walletcurrency' + w + '\" value=\"' + val['curSymbol'] + '\" >' + val['curSymbol'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n VND + \" \" + val['balance'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" >' + VND + \" \" + val['withHoldingBalance'] + \"\\n\" + '</td></tr>';\r\n\r\n\r\n\r\n }\r\n\r\n\r\n /*var tab='<tr><td align=\"center\" valign=\"middle\"> <img src=resources/nisg/images/usdicon.png width=40 height=40> </td><td align=\"left\" valign=\"middle\" id=\"walletcurrency'+w+'\" value=\"'+val['curSymbol']+'\" >'+val['curSymbol']+\"\\n\"+'</td><td align=\"left\" valign=\"middle\">'\r\n\t\t\t\t\t\t \t\t\t\t\t\t+val['balance']+\"\\n\"+'</td><td align=\"left\" valign=\"middle\" >'+val['withHoldingBalance']+\"\\n\"+'</td></tr><tr><td height=\"10\"></td></tr>';\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\t */\r\n $('#walletbalancetable').append(tab)\r\n\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n\r\n );\r\n\r\n \r\n return false;\r\n}", "total () {\n\t\treturn this.subtotal() - this.discounts();\n\t}", "function GenerateAmortizationTable() {\n var startingBalance = $(\"balance1\").val();\n var monthlyPayment = $(\"minimumPayment1\").val();\n var interestRate = $(\"interestRate1\").val();\n \n // Empty checks\n if (!startingBalance)\n {\n // For Sweet Alerts Docs: https://sweetalert.js.org/docs/\n swal({\n icon: \"warning\",\n text: \"Looks like you forgot to include a Starting Balance. 😢\"\n });\n \n return {};\n }\n \n var amortizationTable = CalculateTotalInterest(startingBalance, monthlyPayment, interestRate);\n \n return amortizationTable;\n}", "function updateInvoice() {\n var total = 0, cells, price, i;\n $(\"#item-details tr\").each( function(index, element) {\n cells = $(element).children().toArray();\n price = parseFloat($(cells[1]).text()) * parseFloat($(cells[2]).text());\n total += price;\n if (!isNaN(price)) {\n $(cells[3]).text(price);\n } else {\n $(cells[3]).text(0);\n }\n });\n if (!isNaN(total)) {\n $(\"#total-price\").text(total);\n }\n }", "function updateValues() {\n const amounts = transactions.map(transaction => transaction.amount);\n\n\n\n const total = amounts.reduce((acc, item) => (acc += item), 0).toFixed(2);\n\n console.log(\"total balance: \" + total);\n\n const income = amounts\n .filter(item => item > 0)\n .reduce((acc, item) => (acc += item), 0)\n .toFixed(2);\n\n console.log(\"income:\" + income);\n\n const expense = (amounts\n .filter(item => item < 0)\n .reduce((acc, item) => (acc += item), 0) * -1).toFixed(2);\n\n console.log(\"outgoing expense:\" + expense);\n\n balance.innerText = `€${total}`;\n money_plus.innerText = `€${income}`;\n money_minus.innerText = `€${expense}`;\n}", "function AmountSummary() {\n debugger;\n var t1 = 0.00;\n var t2 = 0.00;\n var tot = 0.00;\n var total = 0.00;\n var cgstamount = 0.00;\n var sgstamount = 0.00;\n var discount = 0.00;\n var quant = 0.00;\n var rate = 0.00;\n var taxtotal = 0.00;\n var netamount = 0.00;\n var subTot = 0.00;\n var discAmount = 0.00\n var disPercent = 0.00;\n var serviceamount = 0.00;\n var total1 = 0.00;\n var disc = 0.00;\n serviceamount = parseFloat($(\"#SCAmount\").val());\n\n for (i = 0; i < EG_GridData.length; i++) {\n\n //total = total + (parseFloat(EG_GridData[i]['NetAmount']) || 0);\n debugger;\n\n quant = (parseFloat(EG_GridData[i]['Quantity']) || 0);\n rate = (parseFloat(EG_GridData[i]['Rate']) || 0);\n discount =(parseFloat(EG_GridData[i]['TradeDiscount']) || 0);\n disc =disc+(parseFloat(EG_GridData[i]['TradeDiscount']) || 0);\n cgstamount = cgstamount+(parseFloat(EG_GridData[i]['CGSTAmount']) || 0);\n sgstamount = sgstamount + (parseFloat(EG_GridData[i]['SGSTAmount']) || 0);\n netamount = netamount + (parseFloat(EG_GridData[i]['NetAmount']) || 0);\n \n t1 = t1 + ((quant * rate));\n //tot = tot + ((quant * rate) - (discount));\n //total = total + ((quant * rate) - (discount) + (cgstamount + sgstamount)); // GrandTotal calculation\n //taxtotal = taxtotal + (cgstamount + sgstamount); // TotalTaxAmount calculation\n\n tot = tot + ((quant * rate) - (discount));\n //total = total + ((quant * rate) - (discount) + (cgstamount + sgstamount)); // GrandTotal calculation\n total =tot+ (cgstamount + sgstamount); // GrandTotal calculation\n taxtotal = taxtotal + (cgstamount + sgstamount); // TotalTaxAmount calculation \n \n discAmount = disc; \n }\n \n total1 = total + serviceamount;\n\n $('#total').val(roundoff(tot));\n $('#grandtotal').val(roundoff(total1));\n $('#totaltaxamount').val(roundoff(taxtotal));\n $('#subtotal').val(roundoff(t1));\n $('#discount').val(roundoff(discAmount));\n $('#CGSTAmount').val(roundoff(cgstamount));\n $('#SGSTAmount').val(roundoff(sgstamount));\n\n\n\n\n //$('#total').val(roundoff(t2));\n //$('#grandtotal').val(roundoff(total1));\n //$('#totaltaxamount').val(roundoff(taxtotal));\n //$('#subtotal').val(roundoff(tot));\n //$('#discount').val(roundoff(discAmount));\n //$('#CGSTAmount').val(roundoff(cgstamount));\n //$('#SGSTAmount').val(roundoff(sgstamount));\n\n /**********************/\n //$('#subtotal').val(roundoff(total)); \n //var subtotal = parseFloat($('#subtotal').val()) || 0;\n //var vatamount = parseFloat($('#vatamount').val()) || 0;\n // var cgstamount = parseFloat($('#totaltaxamount').val()) || 0;\n // var sgstamount = parseFloat($('#totaltaxamount').val()) || 0;\n // var discount = parseFloat($('#discount').val()) || 0;\n\n //var total = subtotal - discount;\n //$('#Total').val(roundoff(total)); \n\n //var vatp = (parseFloat($('#vatpercentage').val()) || 0);\n // if (vatp > 0) {\n // vatamount = (total * vatp) / 100;\n // $('#vatamount').val(roundoff(vatamount));\n // }\n\n //$('#grandtotal').val(roundoff(total + cgstamount + sgstamount));\n}", "function IndicadorTotal () {}", "function updateValues() {\n let amounts = transactions.map(transaction => transaction.amount);\n console.log(amounts)\n const total = amounts.reduce((acc, item) => (acc += item), 0).toFixed(2);\n const income = amounts\n .filter(item => item > 0)\n .reduce((acc, item) => (acc += item), 0)\n .toFixed(2);\n const expense = (amounts\n .filter(item => item < 0)\n .reduce((acc, item) => (acc += item), 0) * -1).toFixed(2);\n balance.innerText = `${total}`;\n moneyPlus.innerText = `$${income}`\n moenyMinus.innerText = `$${expense}`\n\n}", "function calculerTotal(){ \r\n var total = 0\r\n for (var i in achats) {\r\n total = total + achats[i].nbre*achats[i].prix;\r\n }\r\n setElem(\"tot\", total.toFixed(2));\r\n }", "subtotal() {\n return this.state.dishes\n .map(dish => (dish.price.num))\n .reduce(Utils.sumFunc, 0);\n }", "function calculateTotal(){\n\t\tlet basketTotalContainer = document.querySelector('#basket-total');\n\t\tlet basketCount = document.querySelector('#basket-count');\n\t\tlet minibasketTotal = document.querySelector('#mini-basket-total');\n\t\tbasketTotalContainer.innerHTML = '';\n\t\tbasketCount.innerHTML = '';\n\t\tminibasketTotal.innerHTML = '';\n\t\tlet basket = document.querySelector('.basket tbody'), basketTotalVal = 0, basketTotalItems = 0, basketTotalValCurrency;\n\t\tfor(let i = 0; i < (basket.rows.length); i++){\n\t\t\tlet rowTotal = Number(basket.rows[i].cells[2].innerHTML);\n\t\t\tlet itemsTotal = Number(basket.rows[i].cells[1].childNodes[0].innerHTML);\n\t\t\tbasketTotalVal = basketTotalVal + rowTotal;\n\t\t\tbasketTotalValCurrency = basketTotalVal.toFixed(2);\n\t\t\tbasketTotalItems = basketTotalItems + itemsTotal;\t\t\n\t\t};\n\t\tbasketTotalContainer.innerHTML = basketTotalValCurrency;\n\t\tbasketCount.innerHTML = basketTotalItems;\n\t\tminibasketTotal.innerHTML = basketTotalValCurrency;\n\t\t// avoid 'undefined' if basket is empty\n\t\tif (basketTotalValCurrency == null){\n\t\t\tbasketTotalContainer.innerHTML = '';\n\t\t\tminibasketTotal.innerHTML = '';\n\t\t}\n\t}", "function totals_row_maker(datasets) {\n var total_cost = $scope.total_order_cost;\n var total_quant = 0;\n var total_scrap = $scope.total_order_scrap + '\\\"';\n for (var prop in datasets) {\n total_quant += datasets[prop][1];\n }\n $('#summary').append('<tfoot class=\"totals-row\"><tr><th class=\"total-cell\">Totals:</th><td class=\"total-cell\">' + total_quant + '</td><td class=\"total-cell\">' + total_cost + '</td><td class=\"total-cell\">' + total_scrap + '</td></tr></tfoot>');\n }", "function CalculatePagingAmounts(rowIndex,columnIndex)\n{\n var gvClientID='ctl00_cphPageContents_CGVUC_grdVwBranch';\n var ucId=gvClientID.replace('_grdVwBranch','');\n //Format of hdnAmounts: TotalAmt1-AmtColIndex1~TotalAmt2-AmtColIndex2~...........\n var hdnCurrAction=$get('ctl00_cphPageContents_BtnsUC_hdnCurrAction');\n var sumValue=0;\n if((IsPaging(ucId))&&(hdnCurrAction.value==\"Modify\"))\n {\n var arrColAmts=$get(ucId+'_hdnAmounts').value.split('~');\n var hdnAmounts=$get(ucId+'_hdnAmounts');\n\n for(var index=0;index<arrColAmts.length;index++)\n {\n if(arrColAmts[index]!=\"\")\n {\n var arrAmt=arrColAmts[0].split('|');\n var colamt=arrAmt[0];\n var colIndexs=arrAmt[1];\n if(colIndexs == columnIndex)\n { \n var objGridView = document.getElementById(gvClientID+'_GVRow'+rowIndex+'_txtAmount');\n var currentAmount=objGridView.value;\n var cellAmount = objGridView.getAttribute(\"OriginalAmount\");\n var gridrowid=gvClientID+'_GVRow'+rowIndex+'_txtAmount';\n \n if(eval(currentAmount) > eval(cellAmount))\n {\n //ADD\n var sumTrx=trim(colamt.replace(/,/g,\"\"))\n var addAmount=parseFloat(currentAmount)-parseFloat(cellAmount);\n addAmount=addAmount.toFixed(2); \n \n sumValue=parseFloat(eval(sumTrx))+parseFloat(addAmount); \n sumValue=sumValue.toFixed(2); \n hdnAmounts.value=hdnAmounts.value.replace(colamt,sumValue);\n \n objGridView.setAttribute(\"OriginalAmount\",currentAmount);\n }\n else if(eval(currentAmount) < eval(cellAmount))\n {\n // SUBTRACT\n var sumTrx=trim(colamt.replace(/,/g,\"\"))\n \n var subAmount=parseFloat(cellAmount)-parseFloat(currentAmount);\n subAmount=subAmount.toFixed(2); \n \n sumValue = parseFloat(eval(sumTrx))-parseFloat(subAmount);\n sumValue = sumValue.toFixed(2);\n hdnAmounts.value=hdnAmounts.value.replace(colamt,sumValue);\n objGridView.setAttribute(\"OriginalAmount\",currentAmount);\n }\n // alert(colamt);\n }// colindex end\n }// arr index end\n } // for loop end\n } // if end\n}", "calculateTotals(data) {\n let calculate = (acc, current) => acc + current;\n let total = data.reduce(calculate);\n return total;\n }", "function calculateNewBill() {\r\n\t\ttotalBill = numOxen * oxenPrice + numFood * foodPrice + numClothing * clothingPrice + numAmmunition * ammunitionPrice + (numWheels + numAxles + numTongues) * partsPrice;\r\n\t\t$(\"#storeTable\")[0].rows[7].cells[1].innerHTML = \"$\" + (totalBill.toFixed(2)).toString();\r\n\t}", "getOrderTotal() {\n\n return Object.values(this.lineItems).reduce(\n (total, {product, sku, quantity}) =>\n total + quantity * this.plans[0].amount,\n 0\n );\n }", "function VatGetTotalFromBananaVatReport(banDoc, startDate, endDate) {\n\tvar vatReportTable = banDoc.vatReport(startDate, endDate);\n\tvar res = \"\";\n\n\tfor (var i = 0; i < vatReportTable.rowCount; i++) {\n\t\tvar tRow = vatReportTable.row(i);\n\t\tvar group = tRow.value(\"Group\");\n\n\t\t//The balance is summed in group named \"_tot_\"\n\t\tif (group === \"_tot_\") {\n\t\t\tres = tRow.value(\"VatBalance\"); //VatAmount VatBalance\n\n\t\t\t// //In order to compare correctly the values we have to invert the sign of the result from Banana (if negative)\n\t\t\t// if (Banana.SDecimal.sign(totalFromBanana) == -1) {\n\t\t\t// totalFromBanana = Banana.SDecimal.invert(totalFromBanana);\n\t\t\t// }\n\t\t}\n\t}\n\treturn res;\n}", "function balanceShow(data){\n let current_balance = document.querySelector('#current-balance')\n let balance = 0;\n data.forEach((element)=>{\n if(element.kind == 1){\n balance += element.amount\n }else{\n balance -= element.amount\n }\n })\n current_balance.innerHTML = `$${balance.toFixed(2)}`\n}", "function updateCashBillDetail() {\n var quantity = ($('#quantity_cash').val() > 0 ? $('#quantity_cash').val() : 0 );\n var rate = ($('#rate_cash').val() > 0 ? $('#rate_cash').val() : 0 );\n var discount = ($('#discount_cash').val() > 0 ? $('#discount_cash').val() : 0 );\n var oldBalance = ($('#old_balance').val() ? $('#old_balance').val() : 0 );\n var paidAmount = ($('#paid_amount').val() > 0 ? $('#paid_amount').val() : 0 );\n var billAmount = 0, deductedTotal = 0, total = 0, balance = 0;\n\n billAmount = quantity * rate;\n if(billAmount >=0) {\n if((billAmount/2) > discount) {\n deductedTotal = billAmount - discount;\n } else if(discount > 0){\n alert(\"Error !!\\nDiscount amount exceeded the limit. Maxium of 50% discount is allowed!\");\n $('#discount_cash').val('');\n deductedTotal = billAmount;\n }\n } else {\n deductedTotal = 0;\n }\n if(!($('#discount_cash').val())) {\n $('#discount_cash').val(0);\n } else {\n if(discount == 0 || (discount.charAt(discount.length - 1) != '.')) {\n //for removing the preceding zero\n discount = discount * 1;\n }\n $('#discount_cash').val(discount);\n }\n\n //multiplying by 1 for typecasting\n total = (deductedTotal * 1) + (oldBalance * 1);\n balance = total - paidAmount;\n\n if(!($('#paid_amount').val())) {\n $('#paid_amount').val(0);\n } else {\n //for removing the preceding zero\n paidAmount = paidAmount * 1;\n $('#paid_amount').val(paidAmount);\n }\n\n if(!($('#old_balance').val())) {\n $('#old_balance').val(0);\n }\n if(balance > 0) {\n $('#balance').css('color','red');\n $('#balance_over_label').html(\"Balance\");\n $('#balance_over_label').css('color','red');\n } else if(balance < 0) {\n $('#balance').css('color','blue');\n $('#balance_over_label').html(\"Advance\");\n $('#balance_over_label').css('color','blue');\n } else {\n $('#balance').css('color','green');\n $('#balance_over_label').html(\"\");\n }\n\n $('#bill_amount_cash').val(billAmount);\n $('#deducted_total_cash').val(deductedTotal);\n $('#total').val(total);\n $('#balance').val(balance);\n}", "function sumBalances()\r\n{\r\n let sum = utils.bigNumberify(0);\r\n Object.entries(balances).forEach((addr, index) =>\r\n {\r\n sum = sum.add(utils.bigNumberify(addr[1].balance));\r\n })\r\n return sum;\r\n}", "render() {\n \n return (\n <div className=\"customer\"> \n <h3>Totals By Date</h3>\n <div className=\"grid\">\n <table className=\"gridTable\">\n <tbody id=\"customerGrid\">\n <tr>\n <th>Date</th>\n <th>Cash ($)</th>\n <th>Credit ($)</th>\n <th>Total ($)</th>\n </tr>\n {this.state.reportData.map(p => (\n <tr key={p.serviceDate}>\n <td className=\"dateField\">{p.serviceDate}</td>\n <td className=\"currencyField\">{p.cash}</td>\n <td className=\"currencyField\">{p.credit}</td>\n <td className=\"currencyField\">{p.total}</td>\n </tr>\n ))}\n \n {this.state.reportTotals.map(p => (\n \n <tr className=\"totalsRow\" key=\"totalsRow\">\n \n <td className=\"subheadField\">Totals:</td>\n <td className=\"currencyField\">{p.cash}</td>\n <td className=\"currencyField\">{p.credit}</td>\n <td className=\"currencyField\">{p.total}</td>\n \n </tr>\n \n ))}\n \n <tr className={this.state.dataAvailable}>\n <td colSpan=\"11\">No Data Available.</td>\n </tr>\n </tbody>\n </table>\n </div>\n \n <div className=\"paginationContainer hidden\">\n \n <div className=\"numberPerPageContainer\">\n <label>Results Per Page</label>\n \n <div id=\"numberPerPage\" className=\"numberPerPage\">\n \n <div onClick={this.resultsPerPage} className=\"paginate\">3</div>\n <div onClick={this.resultsPerPage} className=\"paginate\">10</div>\n <div onClick={this.resultsPerPage} className=\"paginate\">25</div>\n <div onClick={this.resultsPerPage} className=\"paginate paginateActive\">50</div>\n \n </div>\n \n </div>\n \n <div className=\"pageNumberContainer\">\n <label>Page Number</label>\n \n <div id=\"pageNumber\" className=\"pageNumber\">\n \n <div onClick={this.pageBackward} id=\"paginateBackArrow\" className=\"paginateArrow\">&larr;</div>\n <div onClick={this.pageNumber} id=\"lowestPage\" className=\"paginate\">1</div>\n <div id=\"dotdotdotLow\" className=\"paginatedotdotdot\">...</div>\n \n <div className=\"pageNumberIncrement\" id=\"pageNumberIncrement\">\n <div onClick={this.pageNumber} className=\"paginate hidden\">-1</div>\n <div onClick={this.pageNumber} className=\"paginate\">0</div>\n <div onClick={this.pageNumber} className=\"paginate paginateActive\">1</div>\n <div onClick={this.pageNumber} className=\"paginate\">2</div>\n <div onClick={this.pageNumber} className=\"paginate hidden\">3</div>\n </div>\n \n <div id=\"dotdotdot\" className=\"paginatedotdotdot\">...</div>\n <div onClick={this.pageNumber} id=\"highestPage\" className=\"paginate\">4</div>\n <div onClick={this.pageForward} id=\"paginateForwardArrow\" className=\"paginateArrow\">&rarr;</div>\n \n </div>\n </div>\n </div>\n \n <div id=\"helperGrid\" className=\"helperGrid\">\n {this.state.reportData.map(p => (\n <p key={p.serviceDate}>{p.customerid}</p>\n ))}\n </div>\n \n </div>\n );\n }", "function getBalance() {\n return balance;\n }", "function tableTotals(){\n let cookieTotals = [];\n for (let i=0; i < shopLocations.length; i++){\n let currentShop = shopLocations[i];\n for (let j = 0; j < currentShop.todaySales.length; j++){\n if (!cookieTotals[j]){cookieTotals[j] = 0;}\n cookieTotals[j] += currentShop.todaySales[j][2];\n }\n }\n\n let parentEl = document.getElementById('Totals');\n let totalText = 'Totals';\n newChildNode(parentEl, 'th', totalText);\n for (let i = 0; i < cookieTotals.length; i++){\n let text = cookieTotals[i];\n newChildNode(parentEl, 'td', text);\n }\n}", "function updateValues() {\n const amounts = getAmountsArray(transactions);\n const total = getTotal(amounts);\n const income = getIncome(amounts);\n const expense = getExpense(amounts);\n balance.innerText = \"€\" + total;\n money_plus.innerText = \"€\" + income;\n money_minus.innerText = \"€\" + expense;\n}", "function submitTotalTable(total = 0, burnedCalories = 0) {\n\t var goalRow = document.createElement('tr');\n\t goalRow.id = \"goal-calories\";\n\n\t var goalTd = document.createElement('td');\n\t goalTd.innerHTML = \"<strong>Goal Calories</strong>\";\n\n\t var goalTd2 = document.createElement('td');\n\t goalTd2.innerHTML = \"<strong>2000</strong>\";\n\n\t goalRow.appendChild(goalTd);\n\t goalRow.appendChild(goalTd2);\n\n\t var totalsTable = document.getElementById('totals');\n\t totalsTable.appendChild(goalRow);\n\t // calories consumed\n\t var consumedRow = document.createElement('tr');\n\t consumedRow.id = \"consumed-calories\";\n\n\t var consumeTd = document.createElement('td');\n\t consumeTd.innerHTML = \"<span><strong>Calories Consumed</strong>\";\n\n\t var consumeTd2 = document.createElement('td');\n\t consumeTd2.innerHTML = total;\n\t consumeTd2.id = \"cal-consumed\";\n\t consumedRow.appendChild(consumeTd);\n\t consumedRow.appendChild(consumeTd2);\n\n\t totalsTable.appendChild(consumedRow);\n\t // calories burned\n\t var burnedRow = document.createElement('tr');\n\t burnedRow.id = \"burned-calories\";\n\n\t var burnedTd = document.createElement('td');\n\t burnedTd.innerHTML = \"<strong>Calories Burned</strong>\";\n\n\t var burnedTd2 = document.createElement('td');\n\n\t if (burnedCalories > 0) {\n\t burnedTd2.innerHTML = \"<span id='remaining-green'>\" + burnedCalories + \"</span>\";\n\t } else {\n\t burnedTd2.innerHTML = \"<span id='remaining-black'>\" + burnedCalories + \"</span>\";\n\t }\n\n\t // burnedTd2.innerHTML = burnedCalories\n\n\t burnedRow.appendChild(burnedTd);\n\t burnedRow.appendChild(burnedTd2);\n\n\t totalsTable.appendChild(burnedRow);\n\t // remaining calories\n\t var remainingRow = document.createElement('tr');\n\t remainingRow.id = \"remaining-calories\";\n\n\t var remainingTd = document.createElement('td');\n\t remainingTd.innerHTML = \"<strong>Remaining Calories</strong>\";\n\n\t var remainingTd2 = document.createElement('td');\n\n\t var remainingCalories = 2000 - total + burnedCalories;\n\n\t if (remainingCalories < 0) {\n\t remainingTd2.innerHTML = \"<span id='remaining-red'>\" + remainingCalories + \"</span>\";\n\t } else {\n\t remainingTd2.innerHTML = \"<span id='remaining-green'>\" + remainingCalories + \"</span>\";\n\t }\n\n\t remainingRow.appendChild(remainingTd);\n\t remainingRow.appendChild(remainingTd2);\n\n\t totalsTable.appendChild(remainingRow);\n\t}", "function chequeAmountTotal() {\n var row_count = $('#multiple-cheque-count').val();\n var tot_amt = $('#multiple-tot').val();\n var mul_tot = 0;\n var flag = 0;\n for (i = 1; i <= row_count; i++) {\n var row_tot = $('#mul_cheque_amt-' + i).val();\n var mul_tot_pre = parseFloat(mul_tot);\n mul_tot += parseFloat(row_tot);\n if (mul_tot > tot_amt) {\n flag = 1;\n var bal = tot_amt - mul_tot_pre;\n if (bal >= 0) {\n $('#mul_cheque_amt-' + i).val(bal.toFixed(2));\n } else {\n $('#mul_cheque_amt-' + i).val(0);\n }\n }\n }\n if (flag == 1) {\n alert('Cheque amount total does not match with multiple total amount');\n }\n var total_cheque_amt = $('#multiple-tot').val();\n if (mul_tot < total_cheque_amt) {\n var balance = total_cheque_amt - mul_tot;\n if ($(\"#bal-msg\").length <= 0) {\n $('#cheque-details-content-multiple').after('<div id=\"bal-msg\" style=\"color:red;\">Balance Amount : <span id=\"bal-text\"></span></div>');\n }\n $(\"#bal-text\").text(balance);\n } else {\n $('#bal-msg').remove();\n }\n return mul_tot;\n}", "function billsTotal(){\n totally = totalCall + totalSms;\n }", "function update_total() {\n var total = 0;\n var taxrate =$('#tax_rate').find(':selected').data('rate');\n //var totalamount = 0;\n $('.item_total').each(function(i) {\n item_total = $(this).html().replace(\"$\", \"\");\n if (!isNaN(item_total))\n total += Number(item_total);\n });\n\n subtotal = parseFloat(total);\n\n taxtotal = parseFloat(subtotal * taxrate / 100);\n\n total = roundNumber(subtotal + taxtotal, 2);\n\n $('span.subtotal').html(roundNumber(subtotal, 2));\n $('.subtotal').val(roundNumber(subtotal, 2));\n \n $('#taxtotal').html(roundNumber(taxtotal, 2));\n \n $('#invoice_total_tax').val(taxtotal);\n \n $('#total').html(total);\n $('.total').val(total);\n\n update_balance();\n}", "function getTotalData(){\r\n\t \t\t var totalUnitData = 0;\r\n\t \t\t for (var i=0; i<unitValues.length;i++){\r\n\t \t\t\t totalUnitData += unitValues[i]; \r\n\t \t\t }\r\n\t \t\t return totalUnitData;\r\n\t \t }", "get balance () { return this.getBalance() }", "_arrayTotalValue(arr, args, verifyAllCoins) { if (this.config.debug) console.log(\"WalletBF._arrayTotalValue\",arr,args);\r\n\r\n if (arr.length == 0) return 0;\r\n let sum = this._arraySum(arr, \"value\", 0, arr.length);\r\n\r\n let defaults = {\r\n inCoinCount: arr.length\r\n };\r\n let localArgs = $.extend({}, defaults, this._isPlainObject(args) ? args : {});\r\n\r\n if (!(\"issuerService\" in localArgs)) {\r\n if (\"beginResponse\" in localArgs && \"issuer\" in localArgs.beginResponse) {\r\n localArgs.issuerService = localArgs.beginResponse.issuer[0];\r\n }\r\n }\r\n \r\n if (typeof(verifyAllCoins) !== \"undefined\")\r\n {\r\n localArgs.singleCoin = localArgs.singleCoin || verifyAllCoins;\r\n }\r\n \r\n //The fee will differ depending on the setting of verifyAllCoins/singleCoin.\r\n //If singleCoin or verifyAllCoins is set then fee is calculated on the sum,\r\n //otherwise it's calculated on the first coin in the list\r\n let coin = {\r\n value: localArgs.singleCoin ? sum : arr[0].value\r\n };\r\n let fees = this._getVerificationFee(coin, localArgs);\r\n \r\n if (this.config.debug) console.log(\"array sum=\",sum,\"totalFee=\",fees.totalFee,\"totalValue=\",this._round(sum - fees.totalFee,8));\r\n \r\n return this._round(sum - fees.totalFee,8);\r\n }", "total (itens) {\n prod1 = list[0].amount\n prod2 = list[1].amount\n prod3 = list[2].amount\n prod4 = list[3].amount\n\n itens = prod1 + prod2 + prod3 + prod4\n\n return itens\n }", "function ReEvaluateItemCost() {\n\n var rowCount = $('#itemList').rowCount();\n\n var compannyGstin = $(\"[id$=compannyGstin]\").val().substring(1, 2);\n var billToClientGSTIN = $(\"[id$=billToClientGSTIN]\").val().substring(1, 2);\n\n if (compannyGstin !== \"\" && billToClientGSTIN !== \"\") {\n if (compannyGstin === billToClientGSTIN) {\n var cumulativeintraStateCGST = 0;\n var cumulativeintraStateSGST = 0;\n var cumulativeintraStateCost = 0;\n var finalintraStateCost = 0;\n for (var i = 1; i <= rowCount; i++) {\n var intraStategst = $('#itemGST' + i).val();\n var intraStatesgst = intraStategst / 2;\n var intraStatecgst = intraStategst / 2;\n\n var intraStateamount = $('#itemAmount' + i).val();\n var intraStatesgstperc = (intraStatesgst / 100) * intraStateamount;\n var intraStatecgstperc = (intraStatecgst / 100) * intraStateamount;\n\n cumulativeintraStateCGST += +intraStatecgstperc;\n cumulativeintraStateSGST += +intraStatesgstperc;\n cumulativeintraStateCost += +intraStateamount;\n finalintraStateCost += +(cumulativeintraStateCGST + cumulativeintraStateSGST + cumulativeintraStateCost);\n }\n\n var totalCostHtmlContent = \"<tr>\";\n totalCostHtmlContent += \"<td id=\\\"intraStateTotalAmount\\\">\" + cumulativeintraStateCost + \"</td>\";\n totalCostHtmlContent += \"<td id=\\\"intraStateTotalCGST\\\">\" + cumulativeintraStateCGST + \"</td>\";\n totalCostHtmlContent += \"<tdid=\\\"intraStateTotalSGST\\\">\" + cumulativeintraStateSGST + \"</td>\";\n totalCostHtmlContent += \"<td id=\\\"intraStateFinalAmount\\\">\" + finalintraStateCost + \"</td>\";\n totalCostHtmlContent += \"</tr>\";\n\n $(\"[id$=amoutCalculationInterState]\").hide();\n $(\"[id$=amoutCalculationIntraState]\").show();\n $(\"[id$=amoutCalculationIntraState]\").closest('tr').remove();\n $(\"[id$=amoutCalculationIntraState] tbody\").append(totalCostHtmlContent);\n }\n else {\n var cumulativeinterStateGST = 0;\n var cumulativeinterStateCost = 0;\n var finalinterStateCost = 0;\n for (var j = 1; j <= rowCount; j++) {\n var interStategst = $('#itemGST' + j).val();\n var interStateamount = $('#itemAmount' + j).val();\n var interStategstperc = (interStategst / 100) * interStateamount;\n\n cumulativeinterStateGST += +interStategstperc;\n cumulativeinterStateCost += +interStateamount;\n finalinterStateCost += +(cumulativeinterStateGST + cumulativeinterStateCost);\n }\n var totalCostHtmlContent2 = \"<tr>\";\n totalCostHtmlContent2 += \"<td id=\\\"interStateTotalAmount\\\">\" + cumulativeinterStateCost + \"</td>\";\n totalCostHtmlContent2 += \"<td id=\\\"intraStateTotalGST\\\">\" + cumulativeinterStateGST + \"</td>\";\n totalCostHtmlContent2 += \"<td id=\\\"intraStateFinalCost\\\">\" + finalinterStateCost + \"</td>\";\n totalCostHtmlContent2 += \"</tr>\";\n\n $(\"[id$=amoutCalculationIntraState]\").hide();\n $(\"[id$=amoutCalculationInterState]\").show();\n $(\"[id$=amoutCalculationInterState]\").closest('tr').remove();\n $(\"[id$=amoutCalculationInterState] tbody\").append(totalCostHtmlContent2);\n }\n }\n else {\n var companyAddrState = $(\"[id$=companyAddrState] option:selected\").val();\n var companyAddrCity = $(\"[id$=companyAddrCity] option:selected\").val();\n var billToClientStateList = $(\"[id$=billToClientStateList] option:selected\").val();\n var billToClientCityList = $(\"[id$=billToClientCityList] option:selected\").val();\n if (companyAddrState !== \"\" && companyAddrCity !== \"\") {\n //If State selected is same for two comapny and bill\n if (companyAddrState === billToClientStateList) {\n var cumulativeintraStateCGST_StateCode = 0;\n var cumulativeintraStateSGST_StateCode = 0;\n var cumulativeintraStateCost_StateCode = 0;\n var finalintraStateCost_StateCode = 0;\n for (var i_StateCode = 1; i_StateCode <= rowCount; i_StateCode++) {\n var intraStategst_StateCode = $('#itemGST' + i_StateCode).val();\n var intraStatesgst_StateCode = intraStategst_StateCode / 2;\n var intraStatecgst_StateCode = intraStategst_StateCode / 2;\n\n var intraStateamount_StateCode = $('#itemAmount' + i_StateCode).val();\n var intraStatesgstperc_StateCode = (intraStatesgst_StateCode / 100) * intraStateamount_StateCode;\n var intraStatecgstperc_StateCode = (intraStatecgst_StateCode / 100) * intraStateamount_StateCode;\n\n cumulativeintraStateCGST_StateCode += +intraStatecgstperc_StateCode;\n cumulativeintraStateSGST_StateCode += +intraStatesgstperc_StateCode;\n cumulativeintraStateCost_StateCode += +intraStateamount_StateCode;\n finalintraStateCost_StateCode += +(cumulativeintraStateCGST_StateCode + cumulativeintraStateSGST_StateCode + cumulativeintraStateCost_StateCode);\n }\n\n var totalCostHtmlContent_StateCode = \"<tr>\";\n totalCostHtmlContent_StateCode += \"<td id=\\\"intraStateTotalAmount\\\">\" + cumulativeintraStateCost_StateCode + \"</td>\";\n totalCostHtmlContent_StateCode += \"<td id=\\\"intraStateTotalCGST\\\">\" + cumulativeintraStateCGST_StateCode + \"</td>\";\n totalCostHtmlContent_StateCode += \"<td id=\\\"intraStateTotalSGST\\\">\" + cumulativeintraStateSGST_StateCode + \"</td>\";\n totalCostHtmlContent_StateCode += \"<td id=\\\"intraStateFinalAmount\\\">\" + finalintraStateCost_StateCode + \"</td>\";\n totalCostHtmlContent_StateCode += \"</tr>\";\n\n $(\"[id$=amoutCalculationInterState]\").hide();\n $(\"[id$=amoutCalculationIntraState]\").show();\n $(\"[id$=amoutCalculationIntraState]\").closest('tr').remove();\n $(\"[id$=amoutCalculationIntraState] tbody\").append(totalCostHtmlContent_StateCode);\n }\n else {\n var cumulativeinterStateGST_StateCode = 0;\n var cumulativeinterStateCost_StateCode = 0;\n var finalinterStateCost_StateCode = 0;\n for (var j_StateCode = 1; j_StateCode <= rowCount; j_StateCode++) {\n var interStategst_StateCode = $('#itemGST' + j_StateCode).val();\n var interStateamount_StateCode = $('#itemAmount' + j_StateCode).val();\n var interStategstperc_StateCode = (interStategst_StateCode / 100) * interStateamount_StateCode;\n\n cumulativeinterStateGST_StateCode += +interStategstperc_StateCode;\n cumulativeinterStateCost_StateCode += +interStateamount_StateCode;\n finalinterStateCost_StateCode += +(cumulativeinterStateGST_StateCode + cumulativeinterStateCost_StateCode);\n }\n var totalCostHtmlContent2_StateCode = \"<tr>\";\n totalCostHtmlContent2_StateCode += \"<td id=\\\"interStateTotalAmount\\\">\" + cumulativeinterStateCost_StateCode + \"</td>\";\n totalCostHtmlContent2_StateCode += \"<td id=\\\"intraStateTotalGST\\\">\" + cumulativeinterStateGST + \"</td>\";\n totalCostHtmlContent2_StateCode += \"<td id=\\\"intraStateFinalCost\\\">\" + finalinterStateCost_StateCode + \"</td>\";\n totalCostHtmlContent2_StateCode += \"</tr>\";\n\n $(\"[id$=amoutCalculationIntraState]\").hide();\n $(\"[id$=amoutCalculationInterState]\").show();\n $(\"[id$=amoutCalculationInterState]\").closest('tr').remove();\n $(\"[id$=amoutCalculationInterState] tbody\").append(totalCostHtmlContent2_StateCode);\n }\n }\n else {\n alert(\"Please eiether provide GSTIN/PAN !\")\n }\n }\n }", "getTotal(entry) {\n return entry ? entry.Total : 0;\n }", "function calcExp() {\r\n // DVARO: Gets all the tr in the tbody of the travelExp table\r\n var expTable = document.querySelectorAll('table#travelExp tbody tr');\r\n // DLOOP: Loops throught the expTable and cchanges the value the subtotals\r\n for (var i = 0; i < expTable.length; i++) {\r\n document.getElementById(`subtotal${i}`).value = formatNumber(calcClass(`date${i}`), 2);\r\n }\r\n // DDOES: Changes the value of the cells to have a running total\r\n document.getElementById('transTotal').value = formatNumber(calcClass('trans'), 2);\r\n document.getElementById('lodgeTotal').value = formatNumber(calcClass('lodge'), 2);\r\n document.getElementById('mealTotal').value = formatNumber(calcClass('meal'), 2);\r\n document.getElementById('otherTotal').value = formatNumber(calcClass('other'), 2);\r\n document.getElementById('expTotal').value = formatUSCurrency(calcClass('sum'), 2);\r\n}", "function impostaTotaliInDataTable(totaleStanziamentiEntrata, totaleStanziamentiCassaEntrata, totaleStanziamentiResiduiEntrata, totaleStanziamentiEntrata1, totaleStanziamentiEntrata2,\n \t\ttotaleStanziamentiSpesa, totaleStanziamentiCassaSpesa, totaleStanziamentiResiduiSpesa, totaleStanziamentiSpesa1, totaleStanziamentiSpesa2){\n\n \tvar totaleStanziamentiEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata);\n var totaleStanziamentiCassaEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiCassaEntrata);\n var totaleStanziamentiResiduiEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiResiduiEntrata);\n //anno = anno bilancio +1\n var totaleStanziamentiEntrata1NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata1);\n //anno = anno bilancio +2\n var totaleStanziamentiEntrata2NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata2);\n \n \n var totaleStanziamentiSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa);\n var totaleStanziamentiCassaSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiCassaSpesa);\n var totaleStanziamentiResiduiSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiResiduiSpesa);\n //anno = anno bilancio +1\n var totaleStanziamentiSpesa1NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa1);\n //anno = anno bilancio +2\n var totaleStanziamentiSpesa2NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa2);\n\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazione\", totaleStanziamentiEntrataNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateResiduoVariazione\", totaleStanziamentiResiduiEntrataNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCassaVariazione\", totaleStanziamentiCassaEntrataNotUndefined);\n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazioneAnnoPiuUno\", totaleStanziamentiEntrata1NotUndefined);\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazioneAnnoPiuDue\", totaleStanziamentiEntrata2NotUndefined);\n \n\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazione\", totaleStanziamentiSpesaNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCassaVariazione\", totaleStanziamentiCassaSpesaNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseResiduoVariazione\", totaleStanziamentiResiduiSpesaNotUndefined);\n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazioneAnnoPiuUno\", totaleStanziamentiSpesa1NotUndefined);\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazioneAnnoPiuDue\", totaleStanziamentiSpesa2NotUndefined);\n \n\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazione\", (totaleStanziamentiEntrataNotUndefined - totaleStanziamentiSpesaNotUndefined));\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaResiduoVariazione\", (totaleStanziamentiResiduiEntrataNotUndefined - totaleStanziamentiResiduiSpesaNotUndefined));\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCassaVariazione\", (totaleStanziamentiCassaEntrataNotUndefined - totaleStanziamentiCassaSpesaNotUndefined));\n \n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazioneAnnoPiuUno\", (totaleStanziamentiEntrata1NotUndefined - totaleStanziamentiSpesa1NotUndefined));\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazioneAnnoPiuDue\", (totaleStanziamentiEntrata2NotUndefined - totaleStanziamentiSpesa2NotUndefined));\n }" ]
[ "0.7137763", "0.6992679", "0.6981347", "0.6799577", "0.679407", "0.6773406", "0.66576904", "0.65515625", "0.6544135", "0.6530894", "0.652622", "0.6495421", "0.6463047", "0.6462236", "0.6448397", "0.6434446", "0.6423547", "0.6361304", "0.63584447", "0.6311489", "0.6303051", "0.62997454", "0.6275057", "0.62738425", "0.62603414", "0.62555814", "0.62529683", "0.6246619", "0.6238293", "0.6228865", "0.622582", "0.6202306", "0.6196775", "0.6190968", "0.618582", "0.61817366", "0.6176612", "0.6161509", "0.615552", "0.61515087", "0.6150684", "0.61421776", "0.6138476", "0.61340374", "0.61256343", "0.6118695", "0.6110091", "0.6108936", "0.610518", "0.60969955", "0.6095967", "0.6095361", "0.6074919", "0.60609716", "0.60560745", "0.60520816", "0.6051119", "0.60342956", "0.60307086", "0.6027057", "0.60168475", "0.601671", "0.6016627", "0.6014454", "0.6007012", "0.6001902", "0.6001325", "0.60008585", "0.5991202", "0.5990156", "0.59900475", "0.59863037", "0.59840834", "0.5976899", "0.5970691", "0.59669334", "0.5965319", "0.59582555", "0.59522784", "0.5949383", "0.5948781", "0.5946132", "0.59381723", "0.5932801", "0.59314364", "0.59224325", "0.59223163", "0.5918012", "0.5911341", "0.5906046", "0.5905774", "0.5900725", "0.58967483", "0.58950335", "0.5890739", "0.5890077", "0.58864176", "0.5885971", "0.5882655", "0.58811" ]
0.63806707
17
Reusable method to trigger a Toast notification event currently only generates error notifications with configurable message
showNotification(message) { const evt = new ShowToastEvent({ title: 'Error', message: message, variant: 'error', mode: 'dismissable', }); this.dispatchEvent(evt); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "showError(error, toastTitle) {\n //console.log('Error received: ' + JSON.stringify(error));\n\n let errorMessage = 'Unknown error';\n if (Array.isArray(error.body)) {\n errorMessage = error.body.map(e => e.message).join(', ');\n }\n else if (error && error.body && error.body.message && typeof error.body.message === 'string') {\n errorMessage = error.body.message;\n }\n this.dispatchEvent(\n new ShowToastEvent({\n title: toastTitle,\n message: 'Message from Salesforce: ' + errorMessage,\n variant: 'error'\n })\n );\n }", "showErrorToast(error) {\n let message = reduceErrors(error).join(', ');\n console.log(COMPONENT+' Error', message);\n const evt = new ShowToastEvent({\n title: 'Server Error',\n message: message,\n variant: 'error',\n });\n this.dispatchEvent(evt);\n }", "showToastMsg(title, message, variant) {\n this.dispatchEvent(\n new ShowToastEvent({\n title: title,\n message: message,\n variant: variant || 'success'\n })\n )\n }", "showToast(message, variant) {\n const event = new ShowToastEvent({\n message: message,\n variant: variant\n });\n this.dispatchEvent(event);\n }", "showToastEvent(title, message, variant) {\n const event = new ShowToastEvent({\n title,\n message,\n variant\n });\n this.dispatchEvent(event);\n }", "toastMsg(msg) {\n this.openToast(msg)\n }", "showToast(title, message, variant) {\n\t\tconst event = new ShowToastEvent({title, message, variant});\n\t\t// Dispatch toast event to display toast notification\n\t\tthis.dispatchEvent(event);\n\t}", "_handleError(event) {\r\n console.log(event);\r\n this.message = \"\";\r\n this.$.toast.open();\r\n }", "function toastAlert(msg) {\n var toastMsg = document.getElementById(\"popupToastMsg\");\n toastMsg.innerHTML = msg;\n tau.openPopup('#popupToast');\n console.log(msg);\n}", "showToastMessage(toastTitle, msg, toastVariant) {\n const evt = new ShowToastEvent({\n title: toastTitle,\n message: msg,\n variant: toastVariant,\n mode: 'dismissable'\n });\n this.dispatchEvent(evt);\n }", "showToastMessage(toastTitle, msg, toastVariant) {\n const evt = new ShowToastEvent({\n title: toastTitle,\n message: msg,\n variant: toastVariant,\n mode: 'dismissable'\n });\n this.dispatchEvent(evt);\n }", "function showErrorToast(title, body, code = 'error') {\n showToast(title, body, 'danger', code)\n}", "errorToast(message) {\n this.$toast.open({\n message: message,\n type: 'error',\n position: 'top-right',\n });\n }", "toggleErrorMessage(title, message) {\n setTimeout(() => {\n toast(\n {\n title: title,\n description: <p>{message}</p>,\n type: \"success\",\n color: \"green\",\n size: \"mini\",\n animation: \"fly left\"\n },\n () => console.log(\"toast closed\"),\n () => console.log(\"toast clicked\")\n );\n }, 1000);\n }", "static get tag(){return\"simple-toast\"}", "function toaster(msg, title, time) {\n msg = (msg === undefined ? \"\" : msg);\n title = (title === undefined ? \"\" : title);\n time = (time === undefined ? 20 : time);\n SpreadsheetApp.getActiveSpreadsheet().toast(msg, title, time);\n}", "toggleErrorMessage(title, message) {\n setTimeout(() => {\n toast(\n {\n title: title,\n description: <p>{message}</p>,\n type: \"error\",\n\n size: \"mini\",\n animation: \"fly left\"\n },\n () => console.log(\"toast closed\"),\n () => console.log(\"toast clicked\")\n );\n }, 1000);\n }", "setErrorToast(msg){\n toast.error( msg, {\n hideProgressBar: true,\n closeOnClick: true,\n draggable: true,\n });\n }", "function toast() {\n\tM.toast({html: 'Eventual link to Github'})\n}", "toggleSuccessMessage(title, message) {\n setTimeout(() => {\n toast(\n {\n title: title,\n description: <p>{message}</p>,\n type: \"success\",\n color: \"green\",\n size: \"mini\",\n animation: \"fly left\"\n },\n () => console.log(\"toast closed\"),\n () => console.log(\"toast clicked\")\n );\n }, 1000);\n }", "toggleSuccessMessage(title, message) {\n setTimeout(() => {\n toast(\n {\n title: title,\n description: <p>{message}</p>,\n type: \"success\",\n color: \"green\",\n size: \"mini\",\n animation: \"fly left\"\n },\n () => console.log(\"toast closed\"),\n () => console.log(\"toast clicked\")\n );\n }, 1000);\n }", "sendVoiceErrorMessage(toast) {\n toast.open({\n duration: 5000,\n message: `Olivia's voice cannot load, her voice is now the default english one.`,\n position: 'is-top',\n type: 'is-danger'\n })\n }", "function showSuccessToast(title, body, code = 'success') {\n showToast(title, body, 'success', code);\n}", "function toast ({title, message, type, timeout, cb}) {\n // var res = miniToastr[type](message, title, timeout, cb)\n // console.log(res)\n return null\n}", "function toast(msg) {\n if (typeof window.plugins.toast != 'undefined')\n {\n window.plugins.toast.showShortBottom(msg,\n function (a) {\n console.log('toast success: ' + a)\n },\n function (b) {\n console.log('toast error: ' + b)\n })\n }\n}", "function toast(msg) {\n console.log('Toast: ' + msg);\n // blackberry.ui.toast.show(msg);\n}", "function showWarningToast(title, body, code = 'warning') {\n showToast(title, body, 'warning', code);\n}", "toastNotification() {\n setTimeout(() => {\n ToastAndroid.showWithGravityAndOffset (\n 'Signed in Successfully',\n ToastAndroid.LONG,\n ToastAndroid.BOTTOM,\n 25,\n 50\n );\n }, 1500);\n }", "function toast(msg) {\n vscode.window.showInformationMessage(msg);\n}", "function toast(msg) {\n blackberry.ui.toast.show(msg);\t\n}", "displayToast(mode, variant, title, message, objectType, recordId, recordName) {\n var messageData;\n if (objectType && recordId && recordName) {\n messageData = [\n {\n url: '/lightning/r/' + objectType + '/' + recordId + '/view',\n label: recordName,\n }\n ];\n }\n else if (recordName) {\n messageData = [ { label: recordName, } ];\n }\n const toastEvent = new ShowToastEvent({\n 'mode': mode,\n 'variant': variant,\n 'title': title,\n 'message': message,\n 'messageData': messageData\n });\n this.dispatchEvent(toastEvent);\n }", "function toast(errorMsg) {\n var scaffold = '\\\n <div class=\"row row-eq-height error notification\">\\\n <div id=\"toast-close\" class=\"col-md-1\">\\\n <i class=\"glyphicon glyphicon-remove\" aria-hidden=\"true\"></i>\\\n </div>\\\n <div id=\"toast-msg\" class=\"col-md-10\">\\\n <p><strong>ERROR</strong></p>' +\n errorMsg +\n '</div>\\\n </div>';\n var item = $(scaffold);\n $('#toast').append($(item));\n $(item).animate({ 'right': '12px' }, 'fast');\n $('#toast').on('click', '#toast-close', function () {\n var notification = $(this).parent();\n notification.animate({ 'right': '-400px' }, function () {\n notification.remove();\n });\n });\n}", "async function toastMessage (message,type,title){\n\n if( Array.isArray(message) || typeof message === 'object' ){\n message = convertToListHtml(message);\n }\n\n if(isEmpty(type)){\n type = \"info\";\n }\n\n if(type==\"danger\"){\n type = \"error\";\n }\n\n if(isEmpty(title)){\n if(type == \"error\"){\n title = \"Error\";\n }else if(type == \"warning\"){\n title = \"Advertencia\";\n }else if(type == \"Info\"){\n title = \"Información\";\n }else{\n title = \"Mensaje\";\n }\n }\n\n const Toast = Swal.mixin({\n toast: true,\n position: 'top-end',\n showConfirmButton: false,\n timer: 5000,\n timerProgressBar: true,\n onOpen: (toast) => {\n toast.addEventListener('mouseenter', Swal.stopTimer)\n toast.addEventListener('mouseleave', Swal.resumeTimer)\n }\n })\n\n Toast.fire({\n icon: type,\n title: message\n })\n\n }", "function openToast() {\n closeToast(function() {\n if (settings.toastUseMpStyle) {\n createPlayer(\"toast\", function(win) {\n toastWin = win;\n chromeWindows.onRemoved.addListener(toastMpClosed);\n }, false);\n } else {\n var options = getToastOptions();\n createNotification(TOAST, options, function(nid) {\n toastOptions = options;\n addNotificationListener(\"close\", nid, toastClosed);\n addNotificationListener(\"click\", nid, function() { if (settings.toastClick) executeCommand(settings.toastClick, \"toast\"); });\n addNotificationListener(\"btnClick\", nid, toastButtonClicked);\n song.w(\"rating loved\", drawToastImage);\n settings.al(\"toastRating\", drawToastImage);\n });\n if (settings.toastDuration > 0) {\n closeToastTimer = setTimeout(closeToast, settings.toastDuration * 1000);\n }\n }\n });\n }", "function toast(message) {\n if (!message) {\n message = 'Relax! More points in ' + (minutesTillNextFunds - minutesfromStart()) + ' minutes.';\n }\n var toastLength = 3000;\n if (!toastRunning) {\n toastRunning = true;\n setTimeout(function () {\n toastRunning = false;\n\n }, toastLength + 300);\n\n Materialize.toast(message, toastLength, accentColor + ' flow-text');\n }\n}", "function successToast(c) {\n const { msg = \"\", icon = \"success\" } = c;\n\n const Toast = Swal.mixin({\n toast: true,\n position: \"top-end\",\n showConfirmButton: false,\n timer: 3000,\n timerProgressBar: true,\n didOpen: (toast) => {\n toast.addEventListener(\"mouseenter\", Swal.stopTimer);\n toast.addEventListener(\"mouseleave\", Swal.resumeTimer);\n },\n });\n\n Toast.fire({\n icon: icon,\n title: msg,\n });\n }", "function simpleToastBase(message, position, delay, action) {\n /*$mdToast.show(\n $mdToast.simple()\n .content(message)\n .position(position)\n .hideDelay(delay)\n .action(action)\n );*/\n }", "function sendToast(message) {\n console.log(message);\n var toast = document.getElementById('toast');\n toast.innerHTML = message;\n toast.className = 'show';\n setTimeout(function () {\n toast.className = toast.className.replace('show', '');\n }, 3000);\n}", "custom ( message, title ) {\n if ( typeof title !== 'undefined' ) {\n message = '[' + title + '] ' + message;\n }\n\n var template = '<md-toast>' +\n '<span flex>' + message + '</span>' +\n '<md-button ng-click=\"customToastController.closeToast()\">' +\n 'Close</md-button>' +\n '</md-toast>';\n\n this.$mdToast.show({\n template : template,\n controller : CustomToastController,\n controllerAs : 'customToastController',\n position : this.mdToastConfig.position,\n hideDelay : this.mdToastConfig.hideDelay,\n //TODO: maybe use JavaScript Object getter function for that!\n parent : this.mdToastConfig.getParentElement()\n });\n }", "function notificationAlert(type, content, title, timeOut) {\n if (type == '' || typeof (type) == \"undefined\") {\n type = 'error';\n }\n if (content == '' || typeof (content) == \"undefined\") {\n content = 'You Got Error';\n }\n if (title == '' || typeof (title) == \"undefined\") {\n title = '';\n }\n if (timeOut == '' || typeof (timeOut) == \"undefined\") {\n timeOut = 5; // in seconds\n }\n timeOut = timeOut * 1000;\n /*// by Default Toastr accept time in Micro Seconds so multiplying by 1000*/\n\n content = content.replace(/_/g, ' ');\n toastr.options = {\n \"closeButton\": true,\n \"debug\": false,\n \"newestOnTop\": false,\n \"progressBar\": true,\n \"positionClass\": \"toast-top-right\",\n \"preventDuplicates\": true,\n \"onclick\": null,\n \"showDuration\": \"300\",\n \"hideDuration\": \"1000\",\n \"timeOut\": timeOut,\n \"extendedTimeOut\": timeOut,\n \"showEasing\": \"swing\",\n \"hideEasing\": \"linear\",\n \"showMethod\": \"fadeIn\",\n \"hideMethod\": \"fadeOut\"\n };\n switch (type) {\n case 'success':\n toastr.success(content, title, {timeOut: timeOut});\n break;\n case 'error':\n toastr.error(content, title, {timeOut: timeOut});\n break;\n case 'info':\n toastr.info(content, title, {timeOut: timeOut});\n break;\n case 'warning':\n toastr.warning(content, title, {timeOut: timeOut});\n break;\n }\n}", "function MuestraToast(tipoNotificacion, mensaje) {\n\n switch (tipoNotificacion) {\n\n case \"success\":\n iziToast.success({\n title: mensaje,\n message: '',\n position: 'topRight'\n });\n break;\n case \"info\":\n iziToast.info({\n title: mensaje,\n message: '',\n position: 'topRight'\n });\n break;\n case \"warning\":\n iziToast.warning({\n title: mensaje,\n message: '',\n position: 'topRight'\n });\n break;\n case \"error\":\n iziToast.error({\n title: mensaje,\n message: '',\n position: 'topRight'\n });\n break;\n\n }\n\n}", "function error(message, data, title) {\n $mdToast.simple().content(message);\n }", "createAlert(variant, title, text, autoHideDelay=2000) {\n this.$bvToast.toast(text, {\n autoHideDelay,\n title,\n toaster: 'b-toaster-bottom-center',\n variant,\n })\n }", "function mensagemDeErro(mensagem) {\r\n document.getElementById('mensagemDeErro').innerHTML = `<div class=\"toast shadow-lg mb-5 bg-white rounded\" role=\"alert\" data-delay=\"5000\" aria-atomic=\"true\" style=\"opacity:0.9;\">\r\n <div class=\"toast-header bg-danger text-light\">\r\n <span class=\"fas fa-exclamation-triangle\" style=\"margin-right:5px;\"></span>\r\n <strong class=\"mr-auto\">Atenção</strong>\r\n <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n </div>\r\n <div class=\"toast-body\">\r\n <strong>${mensagem}</strong>\r\n </div>\r\n </div>`\r\n\r\n $('.toast').toast('show')\r\n}", "function errorGeneral(){\n M.toast({html: 'Ha ocurrido un error, intente de nuevo más tarde'});\n}", "function showToast(message) {\n $mdToast.show(\n $mdToast.simple()\n .textContent(message) \n .hideDelay(3000)\n .position('top right')\n ); \n }", "function showAlert(msg, type = 'success') {\n M.toast( {html: msg, classes: type })\n}", "errorToastMethod(titleString,messageString,variantString,disableTimerToast)\n {\n this.showErrorModal = true;\n if(titleString)\n {\n this.titleStr = titleString;\n }\n if(messageString)\n { \n // as this.template.queryselector throws issue as template not rendered yet..adding negligable delay to it.\n setTimeout(() => {\n if(this.template.querySelector('.messagecss') != undefined)\n {\n this.template.querySelector('.messagecss').innerHTML = messageString;\n }\n }, 100); \n }\n\n if(disableTimerToast == false)\n { \n setTimeout(() =>\n { \n this.closeModel();\n }, 5000);\n }\n }", "function toastSuccessAlert(itemType, proccess) {\n console.log('Toast fired!');\n halfmoon.initStickyAlert({\n content: `Ihre ${itemType} wurde erfolgreich ${proccess}.`,\n title: 'Erfolgreich!',\n alertType: 'alert-success',\n fillType: 'filled',\n });\n}", "openSuccess() {\n this.messageType = \"success\"; //this can be success, warn \n this.toastmessage = \"Hello World.\";\n this.title = \"\";\n // you can set autoclose here if you want\n this.template.querySelector('c-lwc-custom-toast').showCustomNotice();\n }", "function alert_message(type, message) {\n Swal.fire({\n title: message,\n \n type: type,\n showCancelButton: false,\n confirmButtonColor: 'red',\n confirmButtonText: 'متابعة التسوق'\n });\n // $.notify(message,type); \n // $.notify({\n // icon: 'fa fa-check',\n // title: type + '!',\n // message: message\n // }, {\n // element: 'body',\n // position: null,\n // type: type,\n // allow_dismiss: true,\n // newest_on_top: false,\n // showProgressbar: true,\n // placement: {\n // from: \"top\",\n // align: \"right\"\n // },\n // offset: 20,\n // spacing: 10,\n // z_index: 1101,\n // delay: 200,\n // animate: {\n // enter: 'animated fadeInDown',\n // exit: 'animated fadeOutUp'\n // },\n // icon_type: 'class',\n // template: '<div data-notify=\"container\" class=\"col-xs-11 col-sm-3 alert alert-{0}\" role=\"alert\">' +\n // '<button type=\"button\" aria-hidden=\"true\" class=\"close\" data-notify=\"dismiss\">×</button>' +\n // '<span data-notify=\"icon\"></span> ' +\n // '<span data-notify=\"title\">{1}</span> ' +\n // '<span data-notify=\"message\">{2}</span>' +\n // '</div>'\n // });\n }", "function notifSuccess(text) {\n const Toast = Swal.mixin({\n toast: true,\n position: \"top-end\",\n showConfirmButton: false,\n timer: 3000,\n timerProgressBar: true,\n didOpen: (toast) => {\n toast.addEventListener(\"mouseenter\", Swal.stopTimer);\n toast.addEventListener(\"mouseleave\", Swal.resumeTimer);\n },\n });\n\n Toast.fire({\n icon: \"success\",\n title: `${text} is successfully`,\n });\n}", "notify(text,title,type='success') {\n toastr.options.timeOut = 4500;\n toastr.options.hideDuration = 250;\n toastr.options.showDuration = 250;\n toastr.options.onShown = () => { this.getTemplateRanking(); };\n if (type === 'success') {\n toastr.success(text, title);\n }else {\n toastr.error(text, title);\n }\n }", "function alertOut(icon, title, subtitle, error) {\n console.log(title);\n console.log(subtitle);\n const wrapper = document.querySelector(\".toast-wrapper\");\n let timeoutDuration = 0;\n if (toastTimeout != null) {\n clearTimeout(toastTimeout);\n wrapper.classList.remove(\"show\");\n wrapper.classList.add(\"hide\");\n timeoutDuration = 400\n }\n\n setTimeout(() => {\n if (wrapper.classList.contains(\"hide\")) {\n wrapper.classList.remove(\"hide\");\n }\n if (icon == null)\n icon = '<i class=\"fas fa-exclamation\"></i>';\n\n const toast = document.getElementById('toast');\n let toastIcon = document.getElementById('toastIcon');\n toastIcon.innerHTML = icon;\n document.getElementById('toastTitle').innerHTML = title;\n document.getElementById('toastSubtitle').innerHTML = subtitle;\n\n if (error) {\n toastIcon.style.background = \"#e81010\";\n toast.style.borderColor = \"#e81010\";\n } else {\n toastIcon.style.background = \"#2ecc71\";\n toast.style.borderColor = \"#2ecc71\";\n }\n\n wrapper.style.display = \"flex\";\n wrapper.classList.add(\"show\");\n\n closeIcon = wrapper.querySelector(\".close-icon\");\n closeIcon.onclick = () => {\n wrapper.classList.remove(\"show\");\n wrapper.classList.add(\"hide\");\n toastTimeout = null;\n setTimeout(() => {\n wrapper.style.display = \"none\";\n }, 1000);\n }\n\n toastTimeout = setTimeout(() => {\n wrapper.classList.remove(\"show\");\n wrapper.classList.add(\"hide\");\n toastTimeout = null;\n setTimeout(() => {\n wrapper.style.display = \"none\";\n }, 1000);\n }, 5000);\n }, timeoutDuration);\n}", "function handleFormToast(status) {\n const _msg = status ? SUCCESS_MSG : ERROR_MSG;\n msg.innerText = _msg;\n toggleToast();\n }", "function createToast(message) {\n 'use strict';\n var snackbar = document.createElement('div'),\n text = document.createElement('div');\n snackbar.classList.add('mdl-snackbar');\n text.classList.add('mdl-snackbar__text');\n text.innerText = message;\n snackbar.appendChild(text);\n document.body.appendChild(snackbar);\n // Remove after 10 seconds\n setTimeout(function(){\n snackbar.remove();\n }, 5000);\n}", "function toast({text, duration, type}) {\n ipc.send(\"addToast\", {text: text, duration: duration, type: type});\n}", "function toast({text, duration, type}) {\n ipc.send(\"addToast\", {text: text, duration: duration, type: type});\n}", "function displayError() {\n Toast.show({\n style: { backgroundColor: \"red\", justifyContent: \"center\" },\n position: \"top\",\n text: \"Record meal(s) failed. Please try again.\",\n textStyle: {\n textAlign: 'center',\n },\n duration: 1500\n });\n }", "function showToaster(type,text)\n{\n swal({\n html:true,\n title: (type == \"error\") ? \"Error !\" : \"Success\",\n text : text,\n timer: 3000\n });\n}", "function showToastSuccessMessage(message){\r\n\tconsole.log('...show message...');\r\n\t $().toastmessage('showToast', {\r\n text : message,\r\n sticky : false,\r\n position : 'middle-center',\r\n type : 'success',\r\n closeText: '',\r\n close : function () {\r\n console.log(\"toast is closed ...\");\r\n }\r\n });\r\n}", "handleSuccess(event) {\n console.log(event.detail.id);\n const evt = new ShowToastEvent({\n title: 'Hola! Note: Booking Id ' + event.detail.id,\n message: 'Car Rented Successfully for ' + this.startdate + ' to ' + this.enddate + '. Enjoy the ride.',\n variant: 'success',\n mode: 'sticky'\n });\n this.dispatchEvent(evt);\n }", "handleSuccess() {\n // showing success message\n this.dispatchEvent(\n new ShowToastEvent({\n title: \"Success!!\",\n message: \" Successfully!!.\",\n variant: \"success\"\n })\n );\n this.dispatchEvent(new CustomEvent(\"savefinancial\"));\n }", "function mensagemDeAviso(mensagem) {\r\n document.getElementById('mensagemDeErro').innerHTML = `<div class=\"toast shadow-lg mb-5 bg-white rounded\" role=\"alert\" data-delay=\"5000\" aria-atomic=\"true\" style=\"opacity:0.9;\">\r\n <div class=\"toast-header bg-success text-light\">\r\n <span class=\"fas fa-check-double\" style=\"margin-right:5px;\"></span>\r\n <strong class=\"mr-auto\">Informação</strong>\r\n <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n </div>\r\n <div class=\"toast-body\">\r\n <strong>${mensagem}</strong>\r\n </div>\r\n </div>`\r\n\r\n $('.toast').toast('show')\r\n}", "function warning(tipe, judul, pesan)\n{\n var shortCutFunction = tipe;\n var msg = pesan;\n var title = judul || '';\n var showDuration = \"1000\";\n var hideDuration = \"1000\";\n var timeOut = \"5000\";\n var extendedTimeOut = \"1000\";\n var showEasing = \"swing\";\n var hideEasing = \"linear\";\n var showMethod = \"slideDown\";\n var hideMethod = \"slideUp\";\n\n toastr.options = {\n closeButton: false,\n debug: false,\n positionClass: 'toast-top-right',\n onclick: null\n };\n\n if (showDuration.length) {\n toastr.options.showDuration = showDuration;\n }\n\n if (hideDuration.length) {\n toastr.options.hideDuration = hideDuration;\n }\n\n if (timeOut.length) {\n toastr.options.timeOut = timeOut;\n }\n\n if (extendedTimeOut.length) {\n toastr.options.extendedTimeOut = extendedTimeOut;\n }\n\n if (showEasing.length) {\n toastr.options.showEasing = showEasing;\n }\n\n if (hideEasing.length) {\n toastr.options.hideEasing = hideEasing;\n }\n\n if (showMethod.length) {\n toastr.options.showMethod = showMethod;\n }\n\n if (hideMethod.length) {\n toastr.options.hideMethod = hideMethod;\n }\n\n if (!msg) {\n msg = getMessage();\n }\n\n $(\"#toastrOptions\").text(\"Command: toastr[\" + shortCutFunction + \"](\\\"\" + msg + (title ? \"\\\", \\\"\" + title : '') + \"\\\")\\n\\ntoastr.options = \" + JSON.stringify(toastr.options, null, 2));\n\n var $toast = toastr[shortCutFunction](msg, title); // Wire up an event handler to a button in the toast, if it exists\n $toastlast = $toast;\n}", "handleSuccess(event) {\n \n this.dispatchEvent( new ShowToastEvent({title: 'Success', message: 'New record created successfully', variant: 'success' }));\n this.dispatchEvent( new CustomEvent('created', { detail: event.detail.id}));\n \n \n \n }", "handleSuccess(event) {\n const evt = new ShowToastEvent({\n title: this.lblobjectName + \" created\",\n message: \"Record ID: \" + event.detail.id,\n variant: \"success\"\n });\n this.dispatchEvent(evt);\n\n //raise event to parent to handle this and to close the popup, specify bubbles=true\n this.dispatchEvent(new CustomEvent(\"postsuccess\"), { bubbles: true });\n }", "function showToast(message) {\n $mdToast.show(\n $mdToast.simple()\n .content(message)\n .position('top right')\n .hideDelay(2000)\n );\n }", "function makeToast(data)\n{\n var x = document.getElementById(\"snackbar\");\n \n x.className = \"show\";\n x.innerHTML = data;\n\n // After 1.5 seconds, remove the show class\n setTimeout(function(){ x.className = x.className.replace(\"show\", \"\"); }, 1500);\n}", "function error(tipe, judul, pesan)\n{\n var shortCutFunction = tipe;\n var msg = pesan;\n var title = judul || '';\n var showDuration = \"1000\";\n var hideDuration = \"1000\";\n var timeOut = \"5000\";\n var extendedTimeOut = \"1000\";\n var showEasing = \"swing\";\n var hideEasing = \"linear\";\n var showMethod = \"slideDown\";\n var hideMethod = \"slideUp\";\n\n toastr.options = {\n closeButton: false,\n debug: false,\n positionClass: 'toast-top-right',\n onclick: null\n };\n\n if (showDuration.length) {\n toastr.options.showDuration = showDuration;\n }\n\n if (hideDuration.length) {\n toastr.options.hideDuration = hideDuration;\n }\n\n if (timeOut.length) {\n toastr.options.timeOut = timeOut;\n }\n\n if (extendedTimeOut.length) {\n toastr.options.extendedTimeOut = extendedTimeOut;\n }\n\n if (showEasing.length) {\n toastr.options.showEasing = showEasing;\n }\n\n if (hideEasing.length) {\n toastr.options.hideEasing = hideEasing;\n }\n\n if (showMethod.length) {\n toastr.options.showMethod = showMethod;\n }\n\n if (hideMethod.length) {\n toastr.options.hideMethod = hideMethod;\n }\n\n if (!msg) {\n msg = getMessage();\n }\n\n $(\"#toastrOptions\").text(\"Command: toastr[\" + shortCutFunction + \"](\\\"\" + msg + (title ? \"\\\", \\\"\" + title : '') + \"\\\")\\n\\ntoastr.options = \" + JSON.stringify(toastr.options, null, 2));\n\n var $toast = toastr[shortCutFunction](msg, title); // Wire up an event handler to a button in the toast, if it exists\n $toastlast = $toast;\n}", "function UserAlert({flag,setFlag,message}){\n return(\n <StyledToast show={flag} onClose={()=>setFlag(false)} autohide>\n <StyledToast.Body className=\"d-flex\"><img src={CheckIcon} alt=\"checkicon\" style={{width:22}} /> {message} </StyledToast.Body>\n </StyledToast>);\n}", "function show_message(message, category) {\n\n load('ui.toastr', function(){\n category = category || \"success\"\n\n var config = {\n \"closeButton\": true,\n \"positionClass\": \"toast-top-full-width\",\n \"timeOut\": \"5000\",\n \"newestOnTop\": true,\n \"progressBar\": true\n }\n var title = \"\"\n\n if (category == \"success\") {\n toastr.success(message, title, config)\n } else if (category == \"error\") {\n toastr.error(message, title, config)\n } else if (category == \"info\") {\n toastr.info(message, title, config)\n } else if (category == \"warning\") {\n toastr.warning(message, title, config)\n } else {\n toastr.info(message, title, config)\n }\n });\n\n return;\n\n}", "function toast(message) {\n var x = document.getElementById(\"snackbar\");\n x.className = \"show\";\n x.innerHTML = message;\n setTimeout(function () { x.className = x.className.replace(\"show\", \"\"); }, 3000);\n}", "function toasts(){\n setTimeout(function(){\n $('span.error').each(function(){\n if($(this).html() != \"\"){\n var errorText = $(this).text();\n Materialize.toast(errorText, 4000, 'red break-word');\n }\n });\n }, 100);\n}", "showAlert(data) {\n // console.log(data.message);\n\n this.notify.innerHTML = `\n <article class=\"message is-danger\">\n <div class=\"message-body\">\n ${data.message}\n </div>\n </article>`;\n\n // TimeOut (calling the clearAlert method after 3 seconds)\n setTimeout(() => {\n this.clearAlert();\n }, 3000);\n\n }", "function showError(error)\n{\n notificationElement.style.display=\"block\";\n notificationElement.innerHTML=`<p> ${error.message}</p>`;\n}", "function showError(errMsg) {\r\n\tobjNotification.error = errMsg;\r\n\tshowNotification();\r\n}", "function showResponseToasts(data) {\n // * Message handling\n if (data['success'].length > 0) {\n data['success'].forEach(element => {\n console.log(element);\n M.toast({ html: element, classes: 'green' });\n });\n }\n if (data['error'].length > 0) {\n console.log(\"err\");\n data['error'].forEach(element => {\n M.toast({ html: element, classes: 'red' });\n console.error(element);\n });\n }\n // * END Message handling\n}", "function showToastSuccessMessage(message){\n\tconsole.log('...show message...');\n\t $().toastmessage('showToast', {\n text : message,\n sticky : false,\n position : 'middle-center',\n type : 'success',\n closeText: '',\n close : function () {\n console.log(\"toast is closed ...\");\n }\n });\n}", "function congratulate_win() {\n $.toast({ \n heading: 'You Won',\n icon: 'success',\n text: 'Congratulations. You won. Good job',\n textAlign : 'center',\n textColor : '#fff',\n bgColor : '#0da114',\n hideAfter : false,\n stack : false,\n position : 'mid-center',\n allowToastClose : true,\n showHideTransition : 'fade',\n loader: false,\n });\n}", "showToast(msg,btn){\n Toast.show({\n text: msg,\n position: 'bottom',\n buttonText: btn,\n duration: 5000,\n style: {\n backgroundColor: \"#212121\",\n opacity:0.76\n }\n })\n }", "function _toastr(_message, _position, _notifyType, _onclick) {\n//\tvar _btn = $(\".toastr-notify\");\n if (_message != false) {\n loadScript(plugin_path + 'toastr/toastr.min.js', function () {\n /** JAVSCRIPT / ON LOAD\n ************************* **/\n if (_message != false) {\n\n if (_onclick != false) {\n onclick = function () {\n window.location = _onclick;\n }\n } else {\n onclick = null\n }\n\n toastr.options = {\n \"closeButton\": true,\n \"debug\": false,\n \"newestOnTop\": false,\n \"progressBar\": true,\n \"positionClass\": \"toast-\" + _position,\n \"preventDuplicates\": false,\n \"onclick\": onclick,\n \"showDuration\": \"300\",\n \"hideDuration\": \"1000\",\n \"timeOut\": \"5000\",\n \"extendedTimeOut\": \"1000\",\n \"showEasing\": \"swing\",\n \"hideEasing\": \"linear\",\n \"showMethod\": \"fadeIn\",\n \"hideMethod\": \"fadeOut\"\n }\n\n setTimeout(function () {\n toastr[_notifyType](_message);\n }, 0); // delay 1.5s\n }\n });\n }\n}", "function mensagemEstoque(mensagem) {\r\n document.getElementById('alertStock').innerHTML = `<div class=\"toast shadow-lg mb-5 bg-white rounded\" role=\"alert\" data-delay=\"5000\" aria-atomic=\"true\" style=\"opacity:0.9;\">\r\n <div class=\"toast-header bg-warning text-light\">\r\n <span class=\"fas fa-exclamation-triangle\" style=\"margin-right:5px;\"></span>\r\n <strong class=\"mr-auto\">Estoque</strong>\r\n <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n </div>\r\n <div class=\"toast-body\">\r\n <strong>${mensagem}</strong>\r\n </div>\r\n </div>`\r\n\r\n $('.toast').toast('show')\r\n setTimeout(function () { document.getElementById('alertStock').innerHTML = '' }, 5300)\r\n}", "function sendToastMessage(message, dispatch) {\n dispatch(CardActions.showToast(message));\n setTimeout(() => dispatch(CardActions.hideToast()), 2500);\n}", "function debugToast(toast, time) {\n if (cfg.debugToasts == true) {\n Materialize.toast(\"Debug: \" + toast, time)\n }\n}", "function ShowMessage(title, description, status) {\n debugger\n if (status==1) {\n\n toastr.error(description, title);\n } else {\n\n toastr.success(description, title);\n\n }\n\n}", "function toastMsg(message) {\n var $toast = $('<div class=\"toastMsg\">' + message + '</div>');\n $toast.on('animationend', function() { $toast.remove(); });\n $('body').append($toast);\n}", "showSimpleToast(e){// add your code to run when the singleton is called for\nif(e.detail.duration){this.duration=e.detail.duration}if(e.detail.text){this.text=e.detail.text}if(e.detail.classStyle){this.classStyle=e.detail.classStyle}if(e.detail.closeText){this.closeText=e.detail.closeText}if(e.detail.closeButton){this.closeButton=e.detail.closeButton}if(e.detail.eventCallback){this.eventCallback=e.detail.eventCallback}while(null!==(0,_polymerDom.dom)(this).firstChild){(0,_polymerDom.dom)(this).removeChild((0,_polymerDom.dom)(this).firstChild)}if(e.detail.slot){(0,_polymerDom.dom)(this).appendChild(e.detail.slot)}async.microTask.run(()=>{setTimeout(()=>{this.show()},50)})}", "function showError(error) {\n notification.style.display = 'block';\n notification.innerHTML = `<p> ${error.message} </p>`;\n}", "function successfulRenameToast() {\n const savedToast = Swal.mixin({\n toast: true,\n position: 'top',\n showConfirmButton: false,\n timer: 3000,\n })\n savedToast.fire({\n type: 'warning',\n title: 'Warning!',\n text: 'Another project under this name already exists! Your project will be renamed: \"' \n + pluginModule.project.projectName + '\"',\n })\n}", "function toast(message) {\n var elem = document.createElement(\"div\");\n\n elem.innerHTML = message;\n var notificationContainer = document.getElementById(\"notification-container\");\n notificationContainer.appendChild(elem);\n\n elem.className = \"message messageIn\";\n\n\tfunction hideNotification() {\n\t elem.className = \"message messageOut\";\n\t animationEndCallback = (e) => {\n\t elem.removeEventListener('animationend', animationEndCallback);\n\t elem.outerHTML = \"\";\n\t }\n\t elem.addEventListener('animationend', animationEndCallback);\n\t}\n\n\tsetTimeout(hideNotification,3000);\n\n elem.addEventListener('click',hideNotification);\n}", "function showError(error){ \n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p> ${error.message}</p>`;\n}", "function successfulRenameToast() {\n const savedToast = Swal.mixin({\n toast: true,\n position: 'top',\n showConfirmButton: false,\n timer: 3000,\n })\n savedToast.fire({\n type: 'warning',\n title: 'Warning!',\n text: 'Another project under this name already exists! Your project will be renamed: \"'\n + pluginModule.project.projectName + '\"',\n })\n}", "function showError(error){\r\n notificationElement.style.display = \"block\";\r\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\r\n}", "function createToastMessage( message, type ){\n let toastItem = document.createElement('div')\n \n //not scalable\n /*if ( type == \"success\" ) {\n toastItem.className = \"toast-item success\"\n }\n else {\n toastItem.className = \"toast-item error\"\n }*/\n\n let typeClassList = [\"success\", \"error\"]\n let typeClass = typeClassList.includes(type) ? type : \"default\"\n \n toastItem.className = `toast-item ${typeClass}`\n\n toastItem.innerText = message // setting toastItem content, if no parameter is passed it will return \"\" (blank).\n \n return toastItem\n}", "function showToast(text) {\n // Get the snackbar DIV\n var x = document.getElementById(\"snackbar\")\n if(text)x.innerHTML=text; // only change innhtml if text is not empty.\n\n // Add the \"show\" class to DIV\n x.className = \"show\";\n\n // After 3 seconds, remove the show class from DIV\n setTimeout(function(){ x.className = x.className.replace(\"show\", \"\"); }, 3000);\n}", "function toastButtonClicked(buttonIndex) {\n //check which button was clicked and that the button is valid (otherwise it is not displayed and we would execute the wrong command)\n var cmd = settings.toastButton1;\n var btn = getToastBtn(cmd);\n if (!btn || buttonIndex == 1) {\n cmd = settings.toastButton2;\n btn = getToastBtn(cmd);\n }\n if (btn) executeCommand(cmd, \"toast\");\n }", "function notifyError(msg, action, on_action) {\n const icon = {\n type: 'icon',\n class: 'material-icons',\n content: 'error',\n };\n console.error(msg);\n notify('error', msg, action, on_action, icon);\n}", "function QAlert(info, msgtype) {\n // Clears the current list of toasts\n toastr.clear();\n switch (msgtype) {\n case \"info\":\n toastr.info(info, \"提示\");\n break;\n case \"warning\":\n toastr.warning(info);\n break;\n case \"success\":\n toastr.success(info, \"成功\");\n break;\n case \"error\":\n toastr.error(info, \"异常\");\n break;\n default:\n toastr.info(info, \"提示\");\n break;\n }\n toastr.options = {\n \"closeButton\": true,\n \"debug\": false,\n \"positionClass\": \"toast-top-right\",\n \"onclick\": null,\n \"showDuration\": \"300\",\n \"hideDuration\": \"1000\",\n \"timeOut\": \"5000\",\n \"extendedTimeOut\": \"1000\",\n \"showEasing\": \"swing\",\n \"hideEasing\": \"linear\",\n \"showMethod\": \"fadeIn\",\n \"hideMethod\": \"fadeOut\"\n };\n}", "function _sweet_alert_notify(type, title, content) {\n swal(title, content, type);\n}" ]
[ "0.76409173", "0.7605937", "0.75561714", "0.7479432", "0.7453989", "0.7158677", "0.7148761", "0.7067646", "0.6947318", "0.6933967", "0.6933967", "0.68265957", "0.6812822", "0.66661197", "0.6650817", "0.663666", "0.6624274", "0.65694743", "0.65448344", "0.6510844", "0.6510844", "0.64561963", "0.6444165", "0.6417233", "0.64145917", "0.63991356", "0.6383738", "0.63782156", "0.63736063", "0.63549", "0.63497984", "0.6349172", "0.63415575", "0.6329717", "0.6329031", "0.63242584", "0.6301898", "0.6299362", "0.62885034", "0.62466514", "0.62432015", "0.62390465", "0.6201878", "0.61985767", "0.6179664", "0.61743754", "0.61724883", "0.6165934", "0.6164544", "0.61597973", "0.6156545", "0.6151706", "0.61493367", "0.6147031", "0.614458", "0.61429226", "0.6140052", "0.6140052", "0.61382496", "0.6115063", "0.61118925", "0.61118746", "0.61023116", "0.60989124", "0.6072348", "0.6069936", "0.60631293", "0.60473126", "0.60471934", "0.6040919", "0.60099393", "0.5994129", "0.5989618", "0.59872395", "0.59811", "0.5965827", "0.5964713", "0.59610987", "0.5961015", "0.5960134", "0.59568286", "0.5952515", "0.5951784", "0.59485435", "0.59462696", "0.59431124", "0.5934262", "0.5914426", "0.59045917", "0.5898322", "0.58979577", "0.58813745", "0.58760536", "0.5875317", "0.58729", "0.58665323", "0.5866106", "0.5864521", "0.58511734", "0.5845023" ]
0.75928825
2
Obtain the node text
function nodeText(node){ var str = node.textContent || node.innerHTML || node.innerText || ''; return str.trim(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _getText(node) {\n\n if (node.nodeType === 3) {\n return node.data;\n }\n\n var txt = '';\n\n if (!!(node = node.firstChild)) do {\n txt += _getText(node);\n } while (!!(node = node.nextSibling));\n\n return txt;\n\n }", "function getNodeText(node: Node) {\n let textContent = '';\n node.descendants(function (child: Node, pos: number, parent: Node) {\n if ('text' === child.type.name) {\n textContent = `${textContent}${child.text}`;\n }\n });\n return textContent;\n}", "static getTextFromNode(node){\n var out = \"\";\n if (node.type === \"tag\"){\n for (child of node.children){\n out += Article.getTextFromNode(child);\n }\n } else if (node.type === \"text\"){\n out += node.data;\n } else {\n console.warn(node);\n }\n\n return out;\n }", "function tf_GetNodeText(n)\r\n/*====================================================\r\n\t- returns text + text of child nodes of a node\r\n=====================================================*/\r\n{\r\n\tvar s = n.textContent || n.innerText || n.innerHTML.replace(/\\<[^<>]+>/g, '');\r\n\ts = s.replace(/^\\s+/, '').replace(/\\s+$/, '')/*.tf_Trim()*/;\r\n\treturn s.tf_Trim();\r\n}", "function getText(t) {\n if (t._children.length === 0)\n return undefined;\n var n = t._children[0];\n if (n._fTextNode)\n return n._text;\n throw new Error(\"Not a text node\");\n }", "function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\";\n }", "function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\";\n }", "function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\";\n }", "function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\";\n }", "function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\";\n }", "function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\";\n }", "function getText(n) {\n switch (n.nodeType) {\n case 1: /* element */\n var s = \"\";\n for (var c = n.firstChild; c != null; c = c.nextSibling) {\n s += getText(c);\n }\n return s;\n case 2: /* attribute*/\n case 3: /* text */\n case 4: /* cdata */\n return n.nodeValue;\n default:\n return \"\";\n }\n }", "function getDirectText(node) \n{\n var result = jQuery(node).contents().map(function() {\n if( this.nodeType === 3 ) {\n return this.data;\n }\n }).get().join('');\n \n return result;\n}", "function GetInnerText (node)\n{\n return (node.textContent || node.innerText || node.text) ;\n}", "function getNodeAsString()\n\t{\n\t\treturn this.n;\n\t}", "function getText(node) {\n var sb = new Chickenfoot.StringBuffer(); \n var iter = new TextIterator(node, NodeFilter.SHOW_TEXT);\n while (iter.next() != null) {\n sb.append(iter.text);\n }\n return sb.toString();\n}", "getText() {\n return this._node.__execute(() => this.element.getText());\n }", "GetText()\n\t{\n\t\treturn this.textContent;\n\t}", "function getInnerText(node) {\n if (node==undefined) return \"\";\n var result = '';\n if (Node.TEXT_NODE == node.nodeType)\n\treturn node.nodeValue;\n if (Node.ELEMENT_NODE != node.nodeType)\n\treturn '';\n for (var index = 0; index < node.childNodes.length; ++index)\n\tresult += getInnerText(node.childNodes.item(index));\n return result;\n} // getInnerText", "function atText(node) {\n var elem = node.cloneNode(true);\n for (var i = elem.childNodes.length - 1; i >= 0; i--) {\n if (elem.childNodes[i].tagName) elem.removeChild(elem.childNodes[i]);\n }\n return elem['innerText' in elem ? 'innerText' : 'textContent'];\n }", "string(node) {\n if (Text.isText(node)) {\n return node.text;\n } else {\n return node.children.map(Node.string).join('');\n }\n }", "string(node) {\n if (Text.isText(node)) {\n return node.text;\n } else {\n return node.children.map(Node.string).join('');\n }\n }", "function xmlText(oNode)\r\n{\r\n\tif(oNode==null)return \"\";\r\n\r\n\tif(oNode.text)return oNode.text;\r\n if(typeof(oNode.textContent) != \"undefined\") return oNode.textContent; \r\n\tif(oNode.nodeValue && oNode.nodeValue!=\"\") return oNode.nodeValue;\r\n\tif(oNode.firstChild) \r\n\t{\r\n\t\treturn oNode.firstChild.nodeValue;\r\n\t}\r\n\t\r\n\treturn \"\";\r\n}", "function getText(node) {\n if (Array.isArray(node)) return node.map(getText).join(\"\");\n if (tagtypes_1.isTag(node))\n return node.name === \"br\" ? \"\\n\" : getText(node.children);\n if (tagtypes_1.isCDATA(node)) return getText(node.children);\n if (tagtypes_1.isText(node)) return node.data;\n return \"\";\n }", "function getText$1(node) {\n if (Array.isArray(node))\n return node.map(getText$1).join(\"\");\n if (domhandler_1$5.isTag(node))\n return node.name === \"br\" ? \"\\n\" : getText$1(node.children);\n if (domhandler_1$5.isCDATA(node))\n return getText$1(node.children);\n if (domhandler_1$5.isText(node))\n return node.data;\n return \"\";\n}", "function getText(node) {\n if (Array.isArray(node)) return node.map(getText).join(\"\");\n if (domhandler_1.isTag(node)) return node.name === \"br\" ? \"\\n\" : getText(node.children);\n if (domhandler_1.isCDATA(node)) return getText(node.children);\n if (domhandler_1.isText(node)) return node.data;\n return \"\";\n}", "function getText(node) {\n if (Array.isArray(node))\n return node.map(getText).join(\"\");\n if (domhandler_1.isTag(node))\n return node.name === \"br\" ? \"\\n\" : getText(node.children);\n if (domhandler_1.isCDATA(node))\n return getText(node.children);\n if (domhandler_1.isText(node))\n return node.data;\n return \"\";\n}", "function getText(node) {\n if (Array.isArray(node))\n return node.map(getText).join(\"\");\n if (domhandler_1.isTag(node))\n return node.name === \"br\" ? \"\\n\" : getText(node.children);\n if (domhandler_1.isCDATA(node))\n return getText(node.children);\n if (domhandler_1.isText(node))\n return node.data;\n return \"\";\n}", "function getText(node) {\n if (Array.isArray(node))\n return node.map(getText).join(\"\");\n if (domhandler_1.isTag(node))\n return node.name === \"br\" ? \"\\n\" : getText(node.children);\n if (domhandler_1.isCDATA(node))\n return getText(node.children);\n if (domhandler_1.isText(node))\n return node.data;\n return \"\";\n}", "function nodeVal(node) {\n\t node?.normalize();\n\t return (node && node.textContent) || \"\";\n\t}", "function getNodeText(nodeElement)\n{\n if(!nodeElement)\n return null;\n if(typeof nodeElement===\"string\" || nodeElement instanceof String\n || typeof nodeElement===\"number\" || nodeElement instanceof Number)\n return nodeElement;\n return nodeElement.$\n}", "get text() {}", "get text() {}", "getDirectText() {\n const html = this.getHTML();\n if (html.length === 0) {\n return '';\n }\n let text = '';\n const constructorName = this._node.constructor.name;\n const handler = new htmlParser.DomHandler(function (error, dom) {\n if (error) {\n throw new Error(`Error creating dom for direct text in ${constructorName}: ${error}\\n( ${this._pageElement.getSelector()} )`);\n }\n else {\n dom.forEach(node => {\n if (node.type === 'text') {\n text += node.data;\n }\n });\n }\n });\n const parser = new htmlParser.Parser(handler);\n parser.write(html);\n parser.end();\n return text;\n }", "function get_text(elemento){\n\treturn elemento.textContent\n}", "function extractContentsOfNode(theNode) {\r\n\tvar cyrillicText = document.getElementById('cyrillicText');\r\n\tvar range = document.createRange();\r\n\trange.selectNode(theNode);\r\n\twindow.getSelection().addRange(range);\r\n\tvar selection = window.getSelection().getRangeAt(0);\r\n\tvar selectedText = selection.extractContents();\r\n\treturn selectedText;\r\n}", "function getText(node) {\n if (Array.isArray(node))\n return node.map(getText).join(\"\");\n if (node_isTag(node))\n return node.name === \"br\" ? \"\\n\" : getText(node.children);\n if (isCDATA(node))\n return getText(node.children);\n if (isText(node))\n return node.data;\n return \"\";\n}", "getNodeValue() {}", "function getText(node) {\n if (Array.isArray(node))\n return node.map(getText).join(\"\");\n if (tagtypes_1.isTag(node))\n return node.name === \"br\" ? \"\\n\" : getText(node.children);\n if (tagtypes_1.isCDATA(node))\n return getText(node.children);\n if (tagtypes_1.isText(node))\n return node.data;\n return \"\";\n}", "getText() {\n return this.find('Text')[0];\n }", "getText(name = null) {\n if (name == null) {\n return this._text;\n } else {\n const el = this.getElement(name);\n if (! el) return undefined;\n return el._text;\n }\n }", "function getText(node) {\n if (Array.isArray(node))\n return node.map(getText).join(\"\");\n if (tagtypes.isTag(node))\n return node.name === \"br\" ? \"\\n\" : getText(node.children);\n if (tagtypes.isCDATA(node))\n return getText(node.children);\n if (tagtypes.isText(node))\n return node.data;\n return \"\";\n}", "nodeValue(e){\n var value = e.nodeName == '#text' ? e.data : e.innerHTML,\n value = value||'';\n\n return this.domPreparer.prepareTranslateHTML(value, e).trim();\n }", "function getTextValueOfChild (node) {\n var str\n visitChildren ( \n node,\n function (x){str=x.nodeValue},\n Node.TEXT_NODE\n )\n if (!str){\n str = \"\" \n }\n str = str.replace(/^\\s+/,\"\") \n return str.replace(/\\s+$/, \"\")\n}", "getText() {\n let result = '';\n result += this.prefix;\n for (const child of this.children) {\n result += child.getText();\n }\n result += this.suffix;\n result += this.separator;\n return result;\n }", "function extractText(node) {\n let text = '';\n\n if (node.type == 'tag') {\n for (var c = 0; c < node.children.length; c++) {\n text += extractText(node.children[c]);\n }\n }\n\n if (node.type == 'text') {\n text = node.data;\n }\n\n // Decode HTML\n text = entities.decode(text);\n // Strip HTML tags\n return text.replace(/(<([^>]+)>)/ig, '')\n .replace(/\\n/g, ' ')\n .replace(/\\r/g, ' ')\n .replace(/\\s+/g, ' ');\n}", "function getText(d) {\n // var txt = d.depth ? d.name.split(\" \")[0] : \"\" ;\n // //console.log('txt', txt)\n // return txt;\n }", "get textContent() {\n return this.isLeaf && this.type.spec.leafText ? this.type.spec.leafText(this) : this.textBetween(0, this.content.size, \"\");\n }", "function obtenerTexto(nodo)\n{\n\tif (nodo==null) return \"\";\n\tif (nodo.data)\n\t\treturn nodo.data;\n\telse\n\t\treturn obtenerTexto(nodo.firstChild);\n}", "getName() {\r\n return this.getNameNode().getText();\r\n }", "function getNodeHtmlString(node) {\n let rawText = node.value.quasis ? node.value.quasis[0].value.raw : node.value.value\n return rawText\n}", "function node(v) {\n\t\t\t\tif (!v.firstChild ||\n\t\t\t\t\tv.firstChild.nodeName === \"#text\") {\n\t\t\t\t\tv = v.textContent.match(/[^\\n]+/);\n\n\t\t\t\t\treturn v != null ? v[0] : \"\";\n\t\t\t\t}\n\n\t\t\t\treturn node(v.firstChild);\n\t\t\t}", "function getText($item){\n\t\treturn $.trim($item.clone().children('ul, ol').remove().end().text());\n\t}", "function getText()\n {\n return cssText;\n }", "getText() {\r\n return this.getParsed(new TextParser());\r\n }", "text() {\n return this.#text;\n }", "get text () { return this.DOM_element.textContent; }", "function getElementText (parent, localName, ns) {\n var el = _getFirstChildNS(parent, localName, ns);\n if (el === undefined) return undefined;\n return el.textContent;\n }", "getText() {\n return this._text;\n }", "text(node) {\n let oldValue;\n const textContent = value => {\n if (oldValue !== value) {\n oldValue = value;\n const type = typeof value;\n if (type === 'object' && value) {\n if ('text' in value) {\n textContent(String(value.text));\n } else if ('any' in value) {\n textContent(value.any);\n } else if ('html' in value) {\n textContent([].concat(value.html).join(''));\n } else if ('length' in value) {\n textContent(slice.call(value).join(''));\n }\n } else if (type === 'function') {\n textContent(value(node));\n } else {\n node.textContent = value == null ? '' : value;\n }\n }\n };\n return textContent;\n }", "function text(x) {\n return document.createTextNode(x);\n }", "getText() { return this.text; }", "function text(node, parent) {\n return this.encode(this.escape(node.value, node, parent), node);\n}", "function genText(el, state) {\n return el.text;\n}", "function text(node) {\n return node && node.type === 'text';\n}", "function text(node) {\n return node && node.type === 'text';\n}", "getNodeName() {}", "StringValue(node) {\n return node.value;\n }", "get textContent() {\n const cached = this.cacheGet(TEXT_CONTENT);\n if (cached) {\n return cached;\n }\n const text = this.childNodes.map((node) => node.textContent).join(\"\");\n this.cacheSet(TEXT_CONTENT, text);\n return text;\n }", "function xmlNodeValue(domNode) {\n \n if (domNode.nodeType === 1) {\n return xmlInnerText(domNode);\n }\n return domNode.nodeValue;\n}", "function getTextContent(rootNode) {\n var traverser = ContentTraverser_1.default.createBodyTraverser(rootNode);\n var block = traverser && traverser.currentBlockElement;\n var textContent = [];\n while (block) {\n textContent.push(block.getTextContent());\n block = traverser.getNextBlockElement();\n }\n return textContent.join('\\n');\n}", "function getText( elem ) {\n var i, node,\n nodeType = elem.nodeType,\n rReturn = /\\r\\n/g,\n ret = \"\";\n\n if ( nodeType ) {\n if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n // Use textContent || innerText for elements\n if ( typeof elem.textContent === 'string' ) {\n return elem.textContent;\n } else if ( typeof elem.innerText === 'string' ) {\n // Replace IE's carriage returns\n return elem.innerText.replace( rReturn, '' );\n } else {\n // Traverse it's children\n for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {\n ret += getText( elem );\n }\n }\n } else if ( nodeType === 3 || nodeType === 4 ) {\n return elem.nodeValue;\n }\n } else {\n\n // If no nodeType, this is expected to be an array\n for ( i = 0; (node = elem[i]); i++ ) {\n // Do not traverse comment nodes\n if ( node.nodeType !== 8 ) {\n ret += getText( node );\n }\n }\n }\n return ret;\n }", "getTagTextNode(tagElm){\n return tagElm.querySelector(this.settings.classNames.tagTextSelector)\n }", "getText() {\n return this._codeMirror.getValue();\n }", "function getSimpleText(path) {\r\n\t// For Internet Explorer, use the following...\r\n\tif (window.ActiveXObject) { \r\n\t\tvar node = xmlDoc.selectSingleNode(path);\r\n\t\treturn node.childNodes[0].nodeValue;\r\n\t}\r\n\t// For all other browsers, use the following...\r\n\telse {\r\n\t\tvar snapshot = xmlDoc.evaluate(path, xmlDoc, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n\t\treturn snapshot.snapshotItem(0).textContent;\r\n\t}\r\n}", "getTextContent() {}", "function getText(el) {\n var d = new DOMParser().parseFromString(el.innerHTML, 'text/html');\n return d.body.textContent.replace(/\\r?\\n|\\r/g, ' ');\n}", "function getTextFromNode(elem, allowNewlines, preserveWhitespace) {\n var txt = elem.innerText || elem.textContent;\n txt = txt.trim();\n if (allowNewlines === undefined || !allowNewlines) {\n txt = txt.replace(/\\n/g, \" \");\n }\n if (preserveWhitespace === undefined || !preserveWhitespace) {\n txt = txt.replace(/\\s{2,}/g, ' ');\n }\n \n return txt;\n}", "text() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield (yield this.element()).text();\n });\n }", "get textContent() {\n return this.text.toString();\n }", "function textContent(el) {\n let child, type, s = \"\";\n\n for(child = el.firstChild; child != null; child = child.nextSibling) {\n type = child.nodeType;\n if (type == 3) { //text\n s += child.nodeValue;\n } else if (type == 1) { //element\n s += textContent(child);\n }\n }\n return s;\n }", "fetchText(selector) {\n \n let text = '', elements = this.getElementsByXPath(selector);\n if (elements && elements.length) {\n Array.prototype.forEach.call(elements, function _forEach(element) {\n text += element.textContent || element.innerText || element.value || '';\n });\n }\n return text;\n }", "fetchText(selector) {\n \n let text = '', elements = this.getElementsByXPath(selector);\n if (elements && elements.length) {\n Array.prototype.forEach.call(elements, function _forEach(element) {\n text += element.textContent || element.innerText || element.value || '';\n });\n }\n return text;\n }", "function toText(node) {\n let tag = document.createElement('div')\n tag.innerHTML = node\n node = tag.innerText\n return node\n }", "function getTextFromXML( oNode, deep ) {\r\n // alert(\"getTextFromXML( oNode, deep )\")\r\n var s = \"\";\r\n var nodes = oNode.childNodes;\r\n\r\n for (var i = 0; i < nodes.length; i++) {\r\n var node = nodes[i];\r\n\r\n if (node.nodeType == Node.TEXT_NODE) {\r\n s += node.data;\r\n } else if (deep == true && (node.nodeType == Node.ELEMENT_NODE || node.nodeType == Node.DOCUMENT_NODE\r\n || node.nodeType == Node.DOCUMENT_FRAGMENT_NODE)) {\r\n s += getTextFromXML(node, true);\r\n };\r\n }\r\n\r\n ;\r\n return s;\r\n}", "function toText(node) {\n let tag = document.createElement('div')\n tag.innerHTML = node\n node = tag.innerText\n return node\n }", "getLabel() {\n return this._text ? (this._text.nativeElement.textContent || '') : '';\n }", "getLabel() {\n return this._text ? (this._text.nativeElement.textContent || '') : '';\n }", "get text() {\n return this.instance.getText();\n }", "function getInnerText(elem) {\n\t\treturn (typeof elem.textContent == \"string\") ? elem.textContent : elem.innerText;\n\t}", "function getPlainText(e)\n{\n\tvar text = \"\";\n\tif(e.innerText)\n\t\ttext = e.innerText;\n\telse if(e.textContent)\n\t\ttext = e.textContent;\n\treturn text;\n}", "function text_from(node) {\n const extract = (node) => [...node.childNodes].reduce(\n (acc, childnode) => [\n ...acc,\n childnode.nodeType === Node.TEXT_NODE ? childnode : null,\n ...extract(childnode),\n ...(childnode.shadowRoot ? extract(childnode.shadowRoot) : [])],\n [])\n\n return extract(node).filter(node => node && UUID.test(node.textContent))\n }", "function nodeToString(node) {\n\t switch(node.nodeType) {\n\t case Node.DOCUMENT_NODE: return node.documentElement.textContent;\n\t case Node.TEXT_NODE:\n\t case Node.CDATA_SECTION_NODE:\n\t case Node.PROCESSING_INSTRUCTION_NODE:\n\t case Node.COMMENT_NODE:\n\t case Node.ELEMENT_NODE:\n\t return node.textContent; // potentially not to spec for Element, but much simpler than recursing\n\t case Node.ATTRIBUTE_NODE: return node.value;\n\t default: throw new Error(`TODO No handling for node type: ${node.nodeType}`);\n\t }\n\t}", "get itemText(){return (this.textContent||/* c8 ignore next */'').trim();}", "function getText(event) {\n return event.currentTarget.innerText.trim()\n}", "get text() {\n\t\treturn this.__text;\n\t}", "getText(filterMask) {\n return this._node.eachGet(this._node.all, element => element.currently.getText(), filterMask);\n }", "retriveText() {\n let exactText;\n let currentElement;\n if (!isNullOrUndefined(this.currentContextInfo) && this.currentContextInfo.element) {\n currentElement = this.currentContextInfo.element;\n exactText = this.currentContextInfo.element.text;\n this.viewer.selection.start = currentElement.start;\n this.viewer.selection.end = currentElement.end;\n }\n else {\n let startPosition = this.viewer.selection.start;\n let offset = startPosition.offset;\n let startIndex = 0;\n let startInlineObj = startPosition.currentWidget.getInline(offset, startIndex);\n currentElement = startInlineObj.element;\n exactText = startInlineObj.element.text;\n }\n return { 'text': exactText, 'element': currentElement };\n }", "function getText( elems ) {\n\tvar ret = \"\", elem;\n\n\tfor ( var i = 0; elems[i]; i++ ) {\n\t\telem = elems[i];\n\n\t\t// Get the text from text nodes and CDATA nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 4 ) {\n\t\t\tret += elem.nodeValue;\n\n\t\t// Traverse everything else, except comment nodes\n\t\t} else if ( elem.nodeType !== 8 ) {\n\t\t\tret += getText( elem.childNodes );\n\t\t}\n\t}\n\n\treturn ret;\n}", "get text() {\n return this.content();\n }" ]
[ "0.7950219", "0.77213913", "0.7706418", "0.76911503", "0.76457703", "0.7643448", "0.7643448", "0.7643448", "0.7643448", "0.7643448", "0.7643448", "0.76192784", "0.7573738", "0.75559855", "0.735868", "0.73320645", "0.7282481", "0.72499084", "0.7236062", "0.7224772", "0.7103059", "0.7103059", "0.7100743", "0.70929605", "0.7028537", "0.70160776", "0.70108247", "0.70108247", "0.70108247", "0.70098656", "0.7008068", "0.69826657", "0.69826657", "0.6982323", "0.6979112", "0.6934049", "0.68980783", "0.6871356", "0.68701655", "0.6862316", "0.68476593", "0.6831179", "0.67995286", "0.6798708", "0.6792865", "0.6789567", "0.6744305", "0.6729448", "0.6727798", "0.6683394", "0.6682837", "0.66688806", "0.6668302", "0.66366214", "0.6622615", "0.662126", "0.6618839", "0.6566021", "0.6545741", "0.65359557", "0.6521197", "0.65171593", "0.650494", "0.65019375", "0.6498704", "0.6498704", "0.6497519", "0.64669293", "0.6451743", "0.6441302", "0.6401596", "0.63989985", "0.63900596", "0.6375585", "0.63706934", "0.63657546", "0.63580155", "0.63482106", "0.6346698", "0.63268995", "0.632597", "0.63236946", "0.63236946", "0.6318457", "0.6316503", "0.6314654", "0.6305852", "0.6305852", "0.62881696", "0.62811714", "0.6280922", "0.62767875", "0.6275301", "0.62588745", "0.62487346", "0.62440187", "0.6242444", "0.62402564", "0.6234518", "0.6233263" ]
0.77994555
1
Create an object based on the list of attributes from a DOM node
function objFromAttributes(node, attrList){ var i, a, obj = {}; for(i=0; i < attrList.length; i++){ a = attrList[i]; obj[a] = node.getAttribute(a); } return obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createWith(tag, attributes)\n {\n const element = this.document().createElement(tag);\n\n for (var i = 0, l = (attributes || []).length; i < l; i++) {\n const key = attributes.item(i).name;\n const value = attributes.item(i).nodeValue;\n\n element.setAttribute(key, value);\n }\n\n return element;\n }", "function createElemAttributes() {\n var a = {\n href: href,\n title: target.name,\n target: target.target ? target.target : null,\n rel: target.rel ? target.rel : null\n };\n if (hasUdi) {\n a['data-udi'] = target.udi;\n } else if (target.id) {\n a['data-id'] = target.id;\n }\n return a;\n }", "function e() {\n var args = arguments;\n var node = {}\n\n for (var i = 0; i <= args.length - 1; i++) {\n if (typeof args[i] === 'string') {\n if (i !== 0 && i == 1) node.class = args[i];\n else node.tag = args[i];\n }\n if (args[i] instanceof Array) node.children = args[i]\n else if (typeof args[i] === 'object') {\n node['attrs'] = args[i].attrs;\n node['data'] = args[i].data;\n }\n }\n return node;\n}", "parseAttributes(node) {\n if (node.type !== 'tag') return\n\n let attributes = node.attributes.trim()\n let result = {}\n let reg = /([^=\\s]+)(?:\\s*=\\s*(?:'([^']*)'|\"([^\"]*)\"|([^\\s]*)))?/g\n let match = reg.exec(attributes)\n\n while (match) {\n let key = match[1]\n let value = match[2] || match[3] || match[4] || ''\n\n if (!Reflect.has(result, key)) {\n result[key] = value\n }\n \n match = reg.exec(attributes)\n }\n\n node.attributes = result\n }", "function getAttr( attributes ) {\n const obj = {};\n\n Array.from( attributes ).map( attribute => {\n obj[attribute.name] = attribute.value;\n } );\n\n return obj;\n }", "function getAttributes ( node ) {\nvar i,\n attributeNodes = node.attributes,\n length = attributeNodes.length,\n attrs = {};\n\nfor ( i = 0; i < length; i++ ) attrs[attributeNodes[i].name] = attributeNodes[i].value;\nreturn attrs;\n}", "function getAttrObject(element) {\n var attrs = element.attributes;\n var attrObject = {};\n for (var i=0; i<attrs.length; i++) {\n var attr = attrs[i];\n var attrName = toLower(attr.name);\n // React, you are annoying\n if (attrName === 'class') {\n attrName = 'className';\n }\n var attrVal;\n // Style to object\n if (attrName === 'style') {\n attrVal = styleToObject(element.style);\n }\n else {\n attrVal = attr.value;\n }\n attrObject[attrName] = attrVal;\n }\n return attrObject;\n}", "function createProperties(el) {\n\tvar properties = {};\n\n\tif (!el.hasAttributes()) {\n\t\treturn properties;\n\t}\n\n\tvar ns;\n\tif (el.namespaceURI && el.namespaceURI !== HTML_NAMESPACE) {\n\t\tns = el.namespaceURI;\n\t}\n\n\tvar attr;\n\tfor (var i = 0; i < el.attributes.length; i++) {\n\t\t// use built in css style parsing\n\t\tif(el.attributes[i].name == 'style'){\n\t\t\tattr = createStyleProperty(el);\n\t\t}\n\t\telse if (ns) {\n\t\t\tattr = createPropertyNS(el.attributes[i]);\n\t\t} else {\n\t\t\tattr = createProperty(el.attributes[i]);\n\t\t}\n\n\t\t// special case, namespaced attribute, use properties.foobar\n\t\tif (attr.ns) {\n\t\t\tproperties[attr.name] = {\n\t\t\t\tnamespace: attr.ns\n\t\t\t\t, value: attr.value\n\t\t\t};\n\n\t\t// special case, use properties.attributes.foobar\n\t\t} else if (attr.isAttr) {\n\t\t\t// init attributes object only when necessary\n\t\t\tif (!properties.attributes) {\n\t\t\t\tproperties.attributes = {}\n\t\t\t}\n\t\t\tproperties.attributes[attr.name] = attr.value;\n\n\t\t// default case, use properties.foobar\n\t\t} else {\n\t\t\tproperties[attr.name] = attr.value;\n\t\t}\n\t};\n\n\treturn properties;\n}", "attributes(node) {\n const elem = mona_dish_1.DQ.byId(node.id.value, true);\n node.byTagName(Const_1.XML_TAG_ATTR).each((item) => {\n elem.attr(item.attr(Const_1.ATTR_NAME).value).value = item.attr(Const_1.ATTR_VALUE).value;\n });\n }", "function result_element(tag, num_attrs)\n{\n var node = new PlainXMLNode(tag);\n\n var k = 2;\n while(--num_attrs >= 0)\n {\n // skip attributes such as Mathvariant - nickf 12/13/2011\n //\n // if(arguments[k+1] != null) {\n // node.attrs[arguments[k]] = arguments[k+1];\n // }\n\n k += 2;\n }\n\n for(; k < arguments.length; k++) {\n if(arguments[k] != null)\n node.content.push(arguments[k]); // expand array of content\n }\n\n return node;\n}", "function createNode(type, attributes, props) {\n var node = document.createElement(type);\n if (attributes) {\n for (var attr in attributes) {\n if (!attributes.hasOwnProperty(attr)) continue;\n node.setAttribute(attr, attributes[attr]);\n }\n }\n if (props) {\n for (var prop in props) {\n if (!props.hasOwnProperty(prop)) continue;\n if (prop in node) node[prop] = props[prop];\n }\n }\n return node;\n }", "function createElement(name, attrs) {\n const restIndex = 2;\n const argLen = arguments.length;\n let children = null;\n let key = null;\n let hash = 5381; // See djb2 hash - http://www.cse.yorku.ca/~oz/hash.html\n // Flatten arrays inside children to be a single array\n if (argLen > restIndex) {\n children = new Array(argLen - restIndex); // preallocate for perf\n for (let i = restIndex, childIndex = 0; i < argLen; i++) {\n let child = arguments[i];\n if (child instanceof Array) {\n for (let j = 0, n = child.length; j < n; j++) {\n let arrChild = child[j];\n if (hasValue(arrChild)) {\n const childNode = normalizeNode(arrChild);\n children[childIndex++] = childNode;\n hash = updateHashNum(hash, childNode.hash);\n }\n }\n }\n else if (hasValue(child)) {\n const childNode = normalizeNode(child);\n children[childIndex++] = childNode;\n hash = updateHashNum(hash, childNode.hash);\n }\n }\n }\n if (typeof name === \"string\") {\n hash = updateHashStr(hash, name);\n if (attrs) {\n for (let attrName of Object.keys(attrs)) {\n let attrValue = attrs[attrName];\n if (hasValue(attrValue)) {\n attrs[attrName] = attrValue = normalizeAttr(attrName, attrValue);\n updateHashStr(hash, attrName);\n updateHashStr(hash, attrValue);\n if (attrName === \"key\") {\n key = attrValue;\n }\n }\n }\n }\n return { type: 1 /* Element */, name, hash, attrs, key, children, dom: null };\n }\n else if (typeof name === \"function\") {\n return name(attrs, children); // Stateless component\n }\n throw new Error(`unrecognized node name:${name}`);\n }", "function attributeData(node) {\n var store = {}\n $.each(node.attributes || emptyArray, function(i, attr){\n if (attr.name.indexOf('data-') == 0)\n store[camelize(attr.name.replace('data-', ''))] =\n $.zepto.deserializeValue(attr.value)\n })\n return store\n }", "function attributeData(node) {\n var store = {}\n $.each(node.attributes || emptyArray, function(i, attr){\n if (attr.name.indexOf('data-') == 0)\n store[camelize(attr.name.replace('data-', ''))] =\n $.zepto.deserializeValue(attr.value)\n })\n return store\n }", "function attributeData(node) {\n var store = {}\n $.each(node.attributes || emptyArray, function(i, attr){\n if (attr.name.indexOf('data-') == 0)\n store[camelize(attr.name.replace('data-', ''))] =\n $.zepto.deserializeValue(attr.value)\n })\n return store\n }", "function attributeData(node) {\n var store = {}\n $.each(node.attributes || emptyArray, function(i, attr){\n if (attr.name.indexOf('data-') == 0)\n store[camelize(attr.name.replace('data-', ''))] =\n $.zepto.deserializeValue(attr.value)\n })\n return store\n }", "function attributeData(node) {\n var store = {}\n $.each(node.attributes || emptyArray, function(i, attr){\n if (attr.name.indexOf('data-') == 0)\n store[camelize(attr.name.replace('data-', ''))] =\n $.zepto.deserializeValue(attr.value)\n })\n return store\n }", "function attributeData(node) {\n var store = {}\n $.each(node.attributes || emptyArray, function(i, attr){\n if (attr.name.indexOf('data-') == 0)\n store[camelize(attr.name.replace('data-', ''))] =\n $.zepto.deserializeValue(attr.value)\n })\n return store\n }", "function attributeData(node) {\n var store = {}\n $.each(node.attributes || emptyArray, function(i, attr){\n if (attr.name.indexOf('data-') == 0)\n store[camelize(attr.name.replace('data-', ''))] =\n $.zepto.deserializeValue(attr.value)\n })\n return store\n }", "function attributeData(node) {\n var store = {}\n $.each(node.attributes || emptyArray, function(i, attr){\n if (attr.name.indexOf('data-') == 0)\n store[camelize(attr.name.replace('data-', ''))] =\n $.zepto.deserializeValue(attr.value)\n })\n return store\n }", "function attributeData(node) {\r\n var store = {}\r\n $.each(node.attributes || emptyArray, function(i, attr){\r\n if (attr.name.indexOf('data-') == 0)\r\n store[camelize(attr.name.replace('data-', ''))] =\r\n $.zepto.deserializeValue(attr.value)\r\n })\r\n return store\r\n }", "function createNode(type, attributes, props) {\r\n\tvar node = document.createElement(type);\r\n\tif (attributes) {\r\n\t\tfor (var attr in attributes) {\r\n\t\t\tnode.setAttribute(attr, attributes[attr]);\r\n\t\t}\r\n\t}\r\n\tif (props) {\r\n\t\tfor (var prop in props) {\r\n\t\t\tif (prop in node) node[prop] = props[prop];\r\n\t\t}\r\n\t}\r\n\treturn node;\r\n}", "function parseAttrs(attrs) {\n var ret = {};\n ret.className = attrs.rdElClassname;\n ret.downBtn = document.getElementById(attrs.rdCcwbtn);\n ret.upBtn = document.getElementById(attrs.rdCwbtn);\n\n if (!ret.className) {\n throw new Error('Radial requires a classname to be provided via:rd-el-classname=\\'classname of radial elements\\'');\n }\n return ret;\n }", "function attributeData(node) {\n var store = {}\n $.each(node.attributes, function(i, attr){\n if (attr.name.indexOf('data-') === 0)\n store[camelize(attr.name.replace('data-', ''))] = attr.value\n })\n return store\n }", "function createElement(el, attribute_object, parent) {\n el = document.createElement(el);\n parent.appendChild(el);\n for (let attribute in attribute_object) {\n el.setAttribute(attribute, attribute_object[attribute]);\n }\n return el;\n}", "function createNode(pNode,attr,...chN){\r\n let parent=document.createElement(pNode);\r\n\r\n for(let att of Object.keys(attr)){\r\n parent.setAttribute(att, attr[att]);\r\n }\r\n\r\n for(let ch of chN) parent.appendChild(ch);\r\n\r\n return parent;\r\n}", "function dom({ node, attrs = {}, props = {}, on = {}, diffType = 'none', onAttach }, children) {\n return {\n tag: isElementNode(node) ? node.tagName.toLowerCase() : '',\n properties: props,\n attributes: attrs,\n events: on,\n children,\n type: DOMVNODE,\n domNode: node,\n text: isElementNode(node) ? undefined : node.data,\n diffType,\n onAttach\n };\n}", "function attributeData(node) {\r\n var store = {}\r\n $.each(node.attributes, function (i, attr) {\r\n if (attr.name.indexOf('data-') == 0)\r\n store[camelize(attr.name.replace('data-', ''))] =\r\n $.zepto.deserializeValue(attr.value)\r\n })\r\n return store\r\n }", "toDOM(node) {\n const attrs = {};\n const {\n align\n } = node.attrs;\n\n if (align) {\n attrs['data-align'] = align;\n }\n\n return ['li', attrs, 0];\n }", "function createElement(tagName, attributes, children) {\n return index_es_objectSpread$1(index_es_objectSpread$1({}, attributes), {}, {\n children: resolveDescendants(children)\n });\n}", "function getAttrs(el, expr){ \n\t\tvar attrHash = {};\n\t\tvar attrs = el.attributes;\n\n\t\t$.each(attrs,function(i, attr){\n\t\t\tif(expr.test(attr.nodeName)) \n\t\t\t\tattrHash[attr.nodeName] = attr.nodeValue;\n\t\t});\n\n\t\treturn attrHash;\n\t}", "function getInheirtAttributes(fromElement, toElement) {\n var attributes = {};\n var currectElement = fromElement;\n while (currectElement && currectElement.ischildOf(toElement.parentElement)) {\n var attrs = currectElement.attributes;\n for(var i = attrs.length - 1; i >= 0; i--) {\n if(attrs[i].name !==\"class\" && attrs[i].name !== \"style\"){\n if(!attributes[attrs[i].name ]){\n attributes[attrs[i].name ] = attrs[i].value;\n }\n }\n }\n currectElement = currectElement.parentElement;\n }\n return attributes;\n }", "function elt(name, attrs, ...children){\n let dom = document.createElement(name);\n for(let attr of Object.keys(attrs)){\n dom.setAttribute(attr, attrs[attr])\n }\n for(let child of children){\n dom.appendChild(child);\n }\n return dom;\n}", "static _create(element) {\n return new NamedNodeMapImpl(element);\n }", "function NamedNodeMap() {}", "function NamedNodeMap() {}", "function NamedNodeMap() {}", "function creator(data) {\n return Object.assign(document.createElement(data.tagName), data.props);\n}", "constructor(element, value, attributes) {_defineProperty(this, \"_attributes\", void 0);_defineProperty(this, \"_children\", void 0);_defineProperty(this, \"_orderedChildren\", void 0);_defineProperty(this, \"element\", void 0);_defineProperty(this, \"value\", void 0);\n this._attributes = {};\n\n // organizes children data-elements by element type\n this._children = {};\n\n // organizes flat list of children by absolut order\n this._orderedChildren = [];\n\n if (attributes) {\n this.addAttributes(attributes);\n }\n\n this.element = element;\n this.value = value;\n }", "function walkTheDOMWithAttributes(node,func,depth,returnedFromParent) {\n\t var root = node || window.document;\n\t returnedFromParent = func(root,depth++,returnedFromParent);\n\t if (root.attributes) {\n\t for(var i=0; i < root.attributes.length; i++) {\n\t walkTheDOMWithAttributes(root.attributes[i],func,depth-1,returnedFromParent);\n\t }\n\t }\n\t if(root.nodeType != ADS.node.ATTRIBUTE_NODE) {\n\t node = root.firstChild;\n\t while(node) {\n\t walkTheDOMWithAttributes(node,func,depth,returnedFromParent);\n\t node = node.nextSibling;\n\t }\n\t }\n\t}", "addAttribute(attributes){\n const addDirectly = ['value', 'onchange', 'onblur'];\n const element = this.element || this;\n for (var n in attributes){\n if (attributes.hasOwnProperty(n)){\n if (n === \"classname\" || n === \"className\"){\n element.className += \" \"+attributes[n] + \" \";\n } else if (n === \"style\" && typeof attributes[n] === 'object'){\n for (var i in attributes[n]) {\n element.style[i] = attributes[n][i];\n }\n }\n else if (addDirectly.indexOf(n) !== -1) {\n element[n] = attributes[n];\n }\n else {\n element.setAttribute(n, attributes[n]);\n }\n }\n }\n }", "function setProps(element){\n\t var properties = {};\n\t var tags = element.findall(\"tag\");\n\t\n\t tags.forEach(function(tag, index){\n\t properties[tag.attrib[\"k\"]] = tag.attrib[\"v\"];\n\t });\n\t\n\t return properties;\n\t}", "createElement(tag, attrs, ...children) {\n const element = document.createElement(tag);\n\n // Adding attributes to the element\n Object.keys(attrs).forEach((key) => {\n if (key === 'dataId') {\n element.dataset.id = attrs[key];\n } else if (key === 'dataTid') {\n element.dataset.tid = attrs[key];\n } else {\n element[key] = attrs[key];\n }\n });\n\n // Appending children\n children.forEach((child) => {\n let tempChild = child;\n if (typeof tempChild === 'string') {\n tempChild = document.createTextNode(child);\n }\n element.appendChild(tempChild);\n });\n\n return element;\n }", "function asElementWithAttributes(node) {\n return isElement(node) && node.hasAttributes() ? node : undefined;\n }", "function setAttributes(elm, attrs){\r\n for(var attr in attrs)\r\n elm.setAttribute(attr, attrs[attr]);\r\n return elm;\r\n}", "function createElm(tag, attobj) {\n const elm = document.createElement(tag);\n for (const key of Object.keys(attobj)) {\n elm[key] = attobj[key];\n }\n return elm;\n}", "function parseAttrs(nodes) {\n return nodes.reduce(function(prev, node) {\n var key = _.last(node.key.split('/'));\n\n if (key === 'labels') { // process labels\n prev.labels = node.nodes ? parseLabels(node.nodes) : [];\n }\n else if (key === 'monitor') {\n prev.monitor = node.nodes ? parseMonitors(node.nodes) : [];\n }\n else if (key === 'domain') { // skip domain\n }\n else {\n prev[key] = node.value;\n }\n return prev;\n }, {});\n}", "function elt(name,attrs,...children){\n let element = document.createElement(name);\n for(let attr in attrs){\n element.setAttribute(attr,attrs[attr]);\n }\n for(let child of children){\n element.appendChild(child);\n }\n return element;\n }", "function elt(name, attributes) {\n var node = document.createElement(name);\n if (attributes) {\n for (var attr in attributes)\n if (attributes.hasOwnProperty(attr))\n node.setAttribute(attr, attributes[attr]);\n }\n for (var i = 2; i < arguments.length; i++) {\n var child = arguments[i];\n if (typeof child == 'string')\n child = document.createTextNode(child);\n node.appendChild(child);\n }\n return node;\n}", "function Attrs(p) {\n this.toString = function() {\n var res = '';\n for (var p in this.params) {\n res += ' '+p+'=\"'+this.params[p]+'\"';\n }\n return res;\n }\n\n this.set = function(what, val) {\n this.params[what] = val;\n };\n\n this.get = function(what) {\n return this.params[what];\n };\n\n this.params = new Array();\n if (p) {\n _sg(/^\\s*([A-Za-z0-9_]+)=(\\\".*\\\"|\\'.*\\'|[^\\'\\\"]\\S*)/,\n p, function(match) {\n var name = match[1];\n var val = match[2];\n val.replace(/([\\'\\\"])(.*)\\1/g, \"$1\");\n this.params[name] = val;\n return \"\";\n });\n }\n}", "function newEl(name, attrs) {\n const el = d.createElement(name);\n for (let attr in attrs) if (el[attr] !== undefined) el[attr] = attrs[attr];\n return el;\n }", "function extract(str) {\n let idMatch = str.match(ID_RE)\n let classMatch = str.match(CLASS_RE)\n let kvMatch = str.match(KV_RE)\n let data = {\n attrs: {},\n classNames: []\n }\n\n if (idMatch) {\n data.elementName = idMatch[1]\n data.id = idMatch[2]\n }\n\n if (classMatch) {\n data.classNames = classMatch.map((cls) => cls.replace('.', ''))\n }\n\n if (kvMatch) { \n kvMatch.map(function (item) {\n let split = item.split('=')\n let key = split[0].trim()\n let val = split[1].trim().replace(/[\"']/g, '')\n data.attrs[key] = val\n })\n }\n return data\n}", "function el_getattributes(node, dict, prefix = false) {\n if (node.nodeType == 1) { // element\n // fetch attributes\n if (node.attributes.length > 0) {\n let tagname = node.nodeName + \"_\";\n for (let i = 0; i < node.attributes.length; i++) {\n let attribute = node.attributes.item(i);\n let nodename = attribute.nodeName;\n if (prefix)\n nodename = tagname + attribute.nodeName;\n dict[nodename.toLowerCase()] = attribute.nodeValue;\n }\n }\n }\n}", "function uuattrget(node, // @param Node:\r\n attrs) { // @param String: \"attr1,...\"\r\n // @return String/Hash: \"value\" (one attr)\r\n // or { attr1: \"value\", ... }\r\n var rv = {}, ary = attrs.split(\",\"), v, w, i = 0, iz = ary.length,\r\n HASH = uuattr._HASH; // [IE67] for -> htmlFor, className -> class\r\n // [OTHER] for -> htmlFor, class -> className\r\n\r\n for (; i < iz; ++i) {\r\n v = ary[i];\r\n w = HASH[v] || v;\r\n if (uu.ie) {\r\n if (uu.ver.ie89 || v === \"href\" || v === \"src\") {\r\n // [IE6][IE7][FIX] a[href^=\"#\"] -> full path\r\n rv[v] = node.getAttribute(v, 2) || \"\";\r\n } else {\r\n rv[v] = node[w] || \"\";\r\n }\r\n } else {\r\n rv[v] = node.getAttribute(w) || \"\";\r\n }\r\n }\r\n return (ary.length === 1) ? rv[ary[0]] : rv; // [3][4]\r\n}", "function createDomElement(properties){\n //Creating the element with the property tagName\n var domElement = document.createElement(properties.tagName);\n\n //Loop through the attributes to set them on the element\n var attributes = properties.attributes;\n for (var prop in attributes) {\n domElement.setAttribute(prop, attributes[prop]);\n }\n\n //If any content, set the inner HTML\n if (properties.content) {\n domElement.innerHTML = properties.content;\n }\n\n //Return to use in other functions\n return domElement;\n}", "function elt(name, attributes) {\n var node = document.createElement(name);\n if (attributes) {\n for (var attr in attributes)\n if (attributes.hasOwnProperty(attr))\n node.setAttribute(attr, attributes[attr]);\n }\n for (var i = 2; i < arguments.length; i++) {\n var child = arguments[i];\n if (typeof child == \"string\")\n child = document.createTextNode(child);\n node.appendChild(child);\n }\n return node;\n}", "function elt(name, attributes) {\n var node = document.createElement(name);\n if (attributes) {\n for (var attr in attributes)\n if (attributes.hasOwnProperty(attr))\n node.setAttribute(attr, attributes[attr]);\n }\n for (var i = 2; i < arguments.length; i++) {\n var child = arguments[i];\n if (typeof child == \"string\")\n child = document.createTextNode(child);\n node.appendChild(child);\n }\n return node;\n}", "function buildNode(tagName, attributes, children) {\n var node = document.createElement(tagName);\n\n /* Apply attributes */\n if (attributes) {\n for (var attribute in attributes) {\n if (attributes.hasOwnProperty(attribute)) {\n node[attribute] = attributes[attribute];\n }\n }\n }\n\n /* Append children */\n if (children) {\n if (typeof children === 'string') {\n node.appendChild(document.createTextNode(children));\n } else if (children.tagName) {\n node.appendChild(children);\n } else if (children.length) {\n for (var i = 0, length = children.length; i < length; ++i) {\n var child = children[i];\n\n if (typeof child === 'string') {\n child = document.createTextNode(child);\n }\n\n node.appendChild(child);\n }\n }\n }\n\n return node;\n }", "function initAttributes (ele, name, value) {\n // Style\n if (name.match(/^on([\\s\\S]+)/)) {\n ele.addEventListener(RegExp.$1.replace(/^[\\s\\S]/, c => c.toLowerCase()), value)\n } else if (name === 'style'){\n let rules = typeof value === 'object' && value instanceof Array ? value : [value]\n rules.map(r => {\n const type = typeof r\n if (type === 'string') {\n const ruleStrList = r.split(';')\n ruleStrList.map(rs => {\n const [, k, v] = rs.match(/\\s*([\\w-]+)\\s*:(.+)/)\n if (k && v) ele.style[k] = v\n })\n }\n if (type === 'object') for (let s in r) { ele.style[s] = r[s] }\n })\n } else if (/class(name)?/i.test(name)) {\n // Class\n let classList = typeof value === 'object' && value instanceof Array ? value : [value]\n function addClass(classList) {\n classList.map(c => {\n if (typeof c === 'string') ele.classList.add(...c.split(/\\s+/))\n else if (typeof c === 'object' && c instanceof Array) { addClass(c) }\n else { for (let ck in c) { c[ck] && ele.classList.add(ck) } }\n })\n }\n addClass(classList)\n } else {\n ele.setAttribute(name, value)\n }\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function rowParser(parentElement, objDocumentObject) {\n var arrOfElements = [];\n\n $(parentElement, objDocumentObject).each(function () {\n var objElement = {};\n var arrObjElementAttributes = [];\n $(this).find('*').each(function () {\n var strMyTag = $(this).prop('tagName');\n //objElement[strMyTag] = $(this);\n //objElement[strMyTag].value = $(this).text();\n objElement[strMyTag] = $(this).text();\n\n var objAttrObject = {};\n var arrAttributes = [];\n\n });\n arrOfElements.push(objElement);\n });\n return arrOfElements;\n}", "parse( attributes ) {\n return attributes;\n }", "_sortAttrs(el) {\nvar attList, attr, j, k, l, len, len1, len2, nd, newList, ref, results;\nif (el.hasChildNodes()) {\nref = el.childNodes;\nfor (j = 0, len = ref.length; j < len; j++) {\nnd = ref[j];\nif (nd.nodeType === Node.ELEMENT_NODE || nd.nodeType === Node.DOCUMENT_NODE) {\nthis._sortAttrs(nd);\n}\n}\n}\nif (el.nodeType === Node.ELEMENT_NODE && el.hasAttributes() && el.attributes.length > 1) {\nattList = (function() {\nvar k, len1, ref1, results;\nref1 = el.attributes;\nresults = [];\nfor (k = 0, len1 = ref1.length; k < len1; k++) {\nattr = ref1[k];\nresults.push(attr);\n}\nreturn results;\n})();\nnewList = attList.sort(function(a, b) {\nreturn a.name > b.name;\n});\nfor (k = 0, len1 = attList.length; k < len1; k++) {\nattr = attList[k];\nel.removeAttribute(attr.name);\n}\nresults = [];\nfor (l = 0, len2 = newList.length; l < len2; l++) {\nattr = newList[l];\nresults.push(el.setAttribute(attr.name, attr.value));\n}\nreturn results;\n}\n}", "function copyAttrs(element) {\n var attrs = {};\n var exclude = ['placeholder', 'name', 'id'];\n $.each(element.attributes, function (i, attr) {\n if (attr.specified && $.inArray(attr.name, exclude) < 0) {\n attrs[attr.name] = attr.value;\n }\n });\n return attrs;\n }", "function getData (node) {\r\n var attrs = node.attributes || []\r\n , data = {};\r\n\r\n if (!attrs.length) return data;\r\n\r\n $.each(attrs, function (i, attr) {\r\n if (/^data-in-*/.test(attr.nodeName)) {\r\n data.in = data.in || {};\r\n data.in[attr.nodeName.replace(/data-in-/, '')] = attr.nodeValue;\r\n } else if (/^data-out-*/.test(attr.nodeName)) {\r\n data.out = data.out || {};\r\n data.out[attr.nodeName.replace(/data-out-/, '')] = attr.nodeValue;\r\n } else if (/^data-*/.test(attr.nodeName)) {\r\n data[attr.nodeName] = attr.nodeValue;\r\n }\r\n })\r\n\r\n return data;\r\n }", "function buildOpeningElementAttributes(attribs, file) {\n\t var _props = [];\n\t var objs = [];\n\n\t function pushProps() {\n\t if (!_props.length) return;\n\n\t objs.push(t.objectExpression(_props));\n\t _props = [];\n\t }\n\n\t while (attribs.length) {\n\t var prop = attribs.shift();\n\t if (t.isJSXSpreadAttribute(prop)) {\n\t pushProps();\n\t objs.push(prop.argument);\n\t } else {\n\t _props.push(convertAttribute(prop));\n\t }\n\t }\n\n\t pushProps();\n\n\t if (objs.length === 1) {\n\t // only one object\n\t attribs = objs[0];\n\t } else {\n\t // looks like we have multiple objects\n\t if (!t.isObjectExpression(objs[0])) {\n\t objs.unshift(t.objectExpression([]));\n\t }\n\n\t // spread it\n\t attribs = t.callExpression(file.addHelper(\"extends\"), objs);\n\t }\n\n\t return attribs;\n\t }", "function buildOpeningElementAttributes(attribs, file) {\n\t var _props = [];\n\t var objs = [];\n\n\t function pushProps() {\n\t if (!_props.length) return;\n\n\t objs.push(t.objectExpression(_props));\n\t _props = [];\n\t }\n\n\t while (attribs.length) {\n\t var prop = attribs.shift();\n\t if (t.isJSXSpreadAttribute(prop)) {\n\t pushProps();\n\t objs.push(prop.argument);\n\t } else {\n\t _props.push(convertAttribute(prop));\n\t }\n\t }\n\n\t pushProps();\n\n\t if (objs.length === 1) {\n\t // only one object\n\t attribs = objs[0];\n\t } else {\n\t // looks like we have multiple objects\n\t if (!t.isObjectExpression(objs[0])) {\n\t objs.unshift(t.objectExpression([]));\n\t }\n\n\t // spread it\n\t attribs = t.callExpression(file.addHelper(\"extends\"), objs);\n\t }\n\n\t return attribs;\n\t }", "function createElement(tag, attrs) {\n\t\t\tvar element = document.createElement(tag);\n\n\t\t\tif (attrs) {\n\t\t\t\tvar \n\t\t\t\tkey = getKeys(attrs),\n\t\t\t\tvalue = getValues(attrs),\n\t\t\t\ti = 0,\n\t\t\t\tlen = getSize(attrs);\n\n\t\t\t\tfor (i; i < len; i++) {\n\t\t\t\t\telement.setAttribute(key[i], value[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn element;\n\t\t}", "attr(obj) {\n return this.forEach((el => Object.keys(obj).forEach((key => el.setAttribute(key, obj[key]))))), \n this;\n }", "function extract_data_attr(el) {\n\t\tvar data = {};\n\n\t\tfor (var i=0; i < el.attributes.length; i++) {\n\t\t\tvar attr = el.attributes.item(i);\n\n\t\t\tif ( attr.specified && 0 == attr.name.indexOf('data-') ) {\n\t\t\t\tvar value = attr.value;\n\n\t\t\t\ttry {\n\t\t\t\t\tvalue = jQuery.parseJSON(value);\n\t\t\t\t} catch(e) {}\n\n\t\t\t\tif ( null === value )\n\t\t\t\t\tvalue = '';\n\n\t\t\t\tdata[ attr.name.substr(5) ] = value;\n\t\t\t}\n\t\t}\n\n\t\treturn data;\n\t}", "function getAttributes(node) {\n var attrs = node.attributes;\n if (node.checked) {\n attrs = Array.prototype.slice.call(attrs);\n attrs.push({name: 'checked', value: node.checked});\n }\n return attrs;\n}", "function ElementNode(domElement){\n\t\n\tthis.id = domElement.id;\n\tthis.length = domElement.getAttribute(\"length\");\n\tthis.volume = domElement.getAttribute(\"volume\");\n\t\n\t// indicates whether note is regular, legato, staccato, or glide \n\tthis.style = domElement.getAttribute(\"type\");\n}", "get attributes() {\n const attributes = {};\n const element = this.nativeElement;\n if (!element) {\n return attributes;\n }\n const context = getLContext(element);\n if (context === null) {\n return {};\n }\n const lView = context.lView;\n const tNodeAttrs = lView[TVIEW].data[context.nodeIndex].attrs;\n const lowercaseTNodeAttrs = [];\n // For debug nodes we take the element's attribute directly from the DOM since it allows us\n // to account for ones that weren't set via bindings (e.g. ViewEngine keeps track of the ones\n // that are set through `Renderer2`). The problem is that the browser will lowercase all names,\n // however since we have the attributes already on the TNode, we can preserve the case by going\n // through them once, adding them to the `attributes` map and putting their lower-cased name\n // into an array. Afterwards when we're going through the native DOM attributes, we can check\n // whether we haven't run into an attribute already through the TNode.\n if (tNodeAttrs) {\n let i = 0;\n while (i < tNodeAttrs.length) {\n const attrName = tNodeAttrs[i];\n // Stop as soon as we hit a marker. We only care about the regular attributes. Everything\n // else will be handled below when we read the final attributes off the DOM.\n if (typeof attrName !== 'string')\n break;\n const attrValue = tNodeAttrs[i + 1];\n attributes[attrName] = attrValue;\n lowercaseTNodeAttrs.push(attrName.toLowerCase());\n i += 2;\n }\n }\n const eAttrs = element.attributes;\n for (let i = 0; i < eAttrs.length; i++) {\n const attr = eAttrs[i];\n const lowercaseName = attr.name.toLowerCase();\n // Make sure that we don't assign the same attribute both in its\n // case-sensitive form and the lower-cased one from the browser.\n if (lowercaseTNodeAttrs.indexOf(lowercaseName) === -1) {\n // Save the lowercase name to align the behavior between browsers.\n // IE preserves the case, while all other browser convert it to lower case.\n attributes[lowercaseName] = attr.value;\n }\n }\n return attributes;\n }", "function e(type, attributes, text) {\r\n const el = document.createElement(type);\r\n for (let key in attributes) {\r\n el.setAttribute(key, attributes[key]);\r\n }\r\n if (text) {\r\n el.textContent = text;\r\n }\r\n return el;\r\n}", "function createNodes(el) {\n function getChildNodes() {\n var children = [];\n for (var i = 0; i < el.childNodes.length; i++) {\n var child = el.childNodes[i];\n if (child.nodeType === 1) {\n if (child.getAttribute('layout-style')) {\n children.push(createNodes(child));\n }\n }\n }\n return children;\n }\n return {\n style: parseStyle(el.getAttribute('layout-style')),\n children: getChildNodes(el),\n element: el\n };\n }", "function CreateEl(type, props){\n elem = $(document.createElement(type));\n\n // Set properties to the element if any were passed\n if (Array.isArray(props))\n {\n props.forEach(propPair => { \n // set the properties if given a valid pair\n if (Array.isArray(propPair) && propPair.length >= 2)\n elem.prop(propPair[0], propPair[1]); \n });\n }\n\n return elem;\n}", "function makeElement(tagName, arrayPropertys) {\n var el = document.createElement(tagName);\n if (arrayPropertys == null || arrayPropertys == \"\")\n return el;\n\n //setando atributos\n for (x = 0; x < arrayPropertys.split(\"&\").length; ++x)\n {\n var attr = arrayPropertys.split(\"&\")[x].split(\"=\")[0];\n //O IE tem alguns atributos HTML diferentes do padrao W3C.\n attr = (attr.indexOf(\"class\") > -1 && isIE() ? \"className\" : attr);\n attr = (attr.indexOf(\"style\") > -1 && isIE() ? \"cssText\" : attr);\n //se o atributo eh um evento...\n if (attr.indexOf(\"on\") > -1 && isIE())\n el.attachEvent(attr, new Function(arrayPropertys.split(\"&\")[x].split(\"=\")[1]));\n else if (attr == \"innerHTML\")\n el.innerHTML = arrayPropertys.split(\"&\")[x].split(\"=\")[1];\n //else if (attr == \"checked\")\n // el.check = true;\n else\n el.setAttribute(attr, arrayPropertys.split(\"&\")[x].split(\"=\")[1]);\n\n }\n\n //setando o name para o id\n if (el.name == \"\")\n el.name = el.id;\n\n return el;\n}", "function AttrSet () { this.attrs = new Object(); }", "static attrs(element, attrs) {\n if(element.setAttribute) {\n Object.keys(attrs).forEach((prop) => {\n element.setAttribute(prop, attrs[prop]);\n }); \n }\n }", "function createDOM(tagName, attributes)\n{\n var element = document.createElement(tagName);\n for (var name in attributes)\n element.setAttribute(name, attributes[name]);\n var childElements = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < childElements.length; ++i) {\n var child = childElements[i];\n if (child.isShadowRoot) {\n var shadowRoot;\n if (window.WebKitShadowRoot)\n shadowRoot = new WebKitShadowRoot(element);\n else\n shadowRoot = internals.ensureShadowRoot(element);\n for (var j = 0; j < child.children.length; ++j)\n shadowRoot.appendChild(child.children[j]);\n } else\n element.appendChild(child);\n }\n return element;\n}", "function buildOpeningElementAttributes(attribs, file) {\n let _props = []\n let objs = []\n\n function pushProps() {\n if (_props.length === 0) return\n objs.push(t.objectExpression(_props))\n _props = []\n }\n\n while (attribs.length) {\n const prop = attribs.shift()\n if (t.isJSXSpreadAttribute(prop)) {\n pushProps()\n prop.argument._isSpread = true\n objs.push(prop.argument)\n } else {\n _props.push(convertAttribute(prop))\n }\n }\n\n pushProps()\n\n objs = objs.map(o => {\n return o._isSpread ? o : groupProps(o.properties, t)\n })\n\n if (objs.length === 1) {\n // Only one object\n attribs = objs[0]\n } else if (objs.length > 0) {\n // Add prop merging helper\n const helper = file.addImport('babel-helper-vue-jsx-merge-props', 'default', '_mergeJSXProps')\n // Spread it\n attribs = t.callExpression(\n helper,\n [t.arrayExpression(objs)]\n )\n }\n return attribs\n }", "function setPropObj(attrArr){\r\n\tvar attrObj = {};\r\n\t_.each(attrArr, function(attr, i){\r\n\t\tvar attrName = attr.name;\r\n\t\tvar attrValue = attr.value;\r\n\t\tattrObj[attrName] = attrValue;\r\n\t})\r\n\treturn attrObj;\r\n}", "function assignAttributes(element, attributes) {\n\tObject.keys(attributes).forEach(key => element.setAttribute(key, attributes[key]))\n}", "function buildOpeningElementAttributes(attribs, file) {\n let _props = [];\n const objs = [];\n\n const useBuiltIns = file.opts.useBuiltIns || false;\n if (typeof useBuiltIns !== \"boolean\") {\n throw new Error(\n \"transform-react-jsx currently only accepts a boolean option for \" +\n \"useBuiltIns (defaults to false)\",\n );\n }\n\n while (attribs.length) {\n const prop = attribs.shift();\n // 拓展剩余语法的话里边本身就是ObjectExpression了\n if (t.isJSXSpreadAttribute(prop)) { // <Table {...props}></Table>\n _props = pushProps(_props, objs);\n objs.push(prop.argument);\n } else {\n // 普通写法的话还是要构造成ObjectExpression\n _props.push(convertAttribute(prop));\n }\n }\n\n pushProps(_props, objs);\n\n if (objs.length === 1) {\n // only one object\n attribs = objs[0];\n } else {\n // looks like we have multiple objects\n if (!t.isObjectExpression(objs[0])) {\n objs.unshift(t.objectExpression([]));\n }\n\n const helper = useBuiltIns\n ? t.memberExpression(t.identifier(\"Object\"), t.identifier(\"assign\"))\n : file.addHelper(\"extends\");\n\n // spread it\n attribs = t.callExpression(helper, objs);\n }\n\n return attribs;\n }", "function initCreateElement(attributeHandler) {\n return (tagOrNode, attributes) =>\n createElement(tagOrNode, attributes, attributeHandler);\n }" ]
[ "0.665965", "0.6469817", "0.64228153", "0.62208813", "0.6138542", "0.6136938", "0.6091582", "0.6086575", "0.599479", "0.5961836", "0.59482443", "0.5933485", "0.59009457", "0.59009457", "0.59009457", "0.59009457", "0.59009457", "0.59009457", "0.59009457", "0.59009457", "0.58840466", "0.5869597", "0.5771323", "0.5764666", "0.57529485", "0.57443243", "0.5732789", "0.57191384", "0.5718604", "0.5710894", "0.57024753", "0.5696181", "0.5690889", "0.5689348", "0.5689244", "0.5689244", "0.5689244", "0.568455", "0.5684438", "0.566345", "0.5614322", "0.56063324", "0.5597501", "0.55946696", "0.5590235", "0.5580581", "0.55777353", "0.55732477", "0.55567765", "0.55392754", "0.55265516", "0.5514245", "0.55123836", "0.55053306", "0.5502083", "0.5498322", "0.5498322", "0.54866195", "0.5486507", "0.54826593", "0.54826593", "0.54826593", "0.54826593", "0.54826593", "0.54826593", "0.54826593", "0.54826593", "0.54826593", "0.54826593", "0.54826593", "0.54826593", "0.54826593", "0.54826593", "0.54826593", "0.54826593", "0.54769266", "0.54553217", "0.5451165", "0.54268456", "0.54260546", "0.5419382", "0.5419382", "0.53920794", "0.53769016", "0.5365099", "0.53649133", "0.53629816", "0.5362884", "0.5357266", "0.5354441", "0.5353882", "0.53530186", "0.53516096", "0.5347668", "0.53469515", "0.5342289", "0.53414375", "0.53285414", "0.5326816", "0.53110343" ]
0.7741049
0
Callback listener for XMLHttpRequest
function reqListener(){ var x = this; if(isFunc(this.cb_func)){ this.cb_func(this.responseXML); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onRequestData(url, listener){\n const oReq = new XMLHttpRequest();\n oReq.addEventListener('load', listener);\n oReq.open('GET',url);\n oReq.send();\n}", "function reqListener() {\n console.log(\"res\", this.responseText);\n }", "function reqListener () {\r\n console.log(this.responseText);\r\n}", "onreadystatechange() {}", "function reqListener () {\n console.log(this.responseText);\n}", "function reqListener() {\n\tconsole.log(this.responseText);\n}", "static getXHR(url, callback, errCallback) {\n var getrequest = new XMLHttpRequest();\n getrequest.onreadystatechange = function () {\n console.log(\"enter onreadystatechange\");\n if (getrequest.readyState == 4 && getrequest.status == 200) {\n callback(getrequest.responseText);\n }\n else if (getrequest.readyState == 4 && getrequest.status == 400) {\n errCallback(getrequest.responseText);\n }\n };\n getrequest.open(\"GET\", url, true);\n getrequest.send(null);\n }", "function handleRequest(request, callback) {\n request.onreadystatechange = function () {\n if(request.readyState === XMLHttpRequest.DONE) {\n if(request.status === 200) {\n callback(request.responseXML);\n } else {\n console.log('AJAX error')\n }\n } else {\n // Still pending\n }\n };\n}", "callback( xhttp ){}", "function requestListener(msg)\n{\n function inner() { console.log(msg, this.responseText); }\n return inner;\n}", "function ajax_get_request(callback, url) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange = function(){\r\n if (callback && xhr.readyState == XMLHttpRequest.DONE\r\n && (xhr.status == 200 || xhr.status == 0))\r\n {\r\n callback(xhr.responseText);\r\n }\r\n };\r\n xhr.open(\"GET\", url, true);\r\n xhr.send();\r\n}", "_loadXhr() {\n // // if unset, determine the value\n // if (typeof this.xhrType !== 'string') {\n // this.xhrType = this._determineXhrType();\n // }\n // var xhr = this.xhr = new XMLHttpRequest();\n // // set the request type and url\n // xhr.open('GET', this._request.url, true);\n // xhr.timeout = this.timeout;\n // // load json as text and parse it ourselves. We do this because some browsers\n // // *cough* safari *cough* can't deal with it.\n // if (this.xhrType === ResourceLoader.XHR_RESPONSE_TYPE.JSON || this.xhrType === ResourceLoader.XHR_RESPONSE_TYPE.DOCUMENT) {\n // xhr.responseType = <any>ResourceLoader.XHR_RESPONSE_TYPE.TEXT;\n // } else {\n // xhr.responseType = this.xhrType;\n // }\n // xhr.addEventListener('error', this._boundXhrOnError, false);\n // xhr.addEventListener('timeout', this._boundXhrOnTimeout, false);\n // xhr.addEventListener('abort', this._boundXhrOnAbort, false);\n // xhr.addEventListener('progress', this._boundOnProgress, false);\n // xhr.addEventListener('load', this._boundXhrOnLoad, false);\n // xhr.send();\n }", "function callBack(){\n if(xhr.readyState == 4 && xhr.status == 200){\n //console.log(\"Funciono\")\n document.querySelector('main').innerHTML= xhr.response //Traigo informacion del servidor\n }\n }", "function get_request(url,callback)\n{\n var xhttp = new XMLHttpRequest();\n // executed every time the status of the XMLHttpRequest object changes\n xhttp.onreadystatechange = function () {\n // readyState 4 == DONE\n // status 200 == successful_request\n if (this.readyState == 4 && this.status == 200){\n if (typeof callback == \"function\") {\n callback.apply(xhttp);\n }\n }\n }\n\n xhttp.open(\"GET\",url,false);\n xhttp.send();\n}", "function jsAjax(){\n //instatiate an ajax request object\n var ajaxRequest = new XMLHttpRequest();\n\n //create an event handler for the request\n ajaxRequest.onreadystatechange = function(){\n if (ajaxRequest.readyState == 4){\n //call a callback fucntion and pass the data to it\n console.log(ajaxRequest.readyState);\n jsCallback(ajaxRequest.response);\n };\n };\n\n //open ajax request\n ajaxRequest.open('GET','data/MegaCities.geojason', true);\n\n //set data type\n ajaxRequest.responseType = 'json';\n\n //send the call\n ajaxRequest.send();\n}", "function manageStateChange () {\n if (xhr.readyState === 4) {\n // Two params, http status, response\n onComplete(xhr.status, xhr.response);\n } else {\n onStateChange(xhr.readyState, xhr.response);\n }\n }", "function getHttpRequestCallback(request) {\n return function() {\n if (request.readyState === 4 && request.status === 200) {\n if (DEBUG) {\n console.log(request.responseText);\n }\n var gistArray = JSON.parse(request.responseText);\n displayResults(gistArray);\n filterResults();\n }\n }\n}", "function callbackAJAXjugada() {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n if (xhr.status === 200) {\n //dades = xhr.response;\n dada = JSON.parse(xhr.response);\n mostrarJugada();\n } else {\n console.log('problemes amb l\\'AJAX');\n }\n }\n}", "function myFunction(){\n var url=\"request.php?q=definition\";\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function (){\n if (this.readyState === 4 && this.status == 200){\n alert(this.responseText);\n };\n };\n xhttp.open(\"GET\",url, true);\n xhttp.send();\n}", "function ajaxReq(method, url, callback) {\n var xhttp = new XMLHttpRequest();\n xhttp.open(method, url, true);\n xhttp.send();\n xhttp.onreadystatechange = function() {\n if (xhttp.readyState === 4 && xhttp.status === 200) {\n // console.log(JSON.parse(xhttp.responseText));\n callback(xhttp.responseText);\n }\n };\n}", "function ajaxGet(url, callback) {\n var req = new XMLHttpRequest();\n req.open(\"GET\", url);\n req.addEventListener(\"load\", function () {\n if (req.status >= 200 && req.status < 400) {\n //Call the callback function with the request response in parameter\n callback(req.responseText);\n } else {\n console.error(req.status + \" \" + req.statusText + \" \" + url);\n }\n });\n req.addEventListener(\"error\", function () {\n console.error(\"Error with this URL : \" + url);\n });\n req.send(null);\n}", "function monitor(xmlhttp, callback) {\n xmlhttp.addEventListener(\"load\", function() {\n var responseHeader = this.getResponseHeader(\"Content-Type\");\n var trimResponse = this.responseText.trim();\n var data;\n if (!responseHeader) {\n // Can happen, usually when the response body is null and\n // Express sees no reason to set a content type\n return callback(error(), this.responseText);\n }\n if (responseHeader.match(/^application\\/json/)) {\n // Definitely JSON, treat as such\n try {\n data = JSON.parse(this.responseText);\n } catch (e) {\n return callback(e);\n }\n } else {\n // Still try to treat as JSON if it looks like it\n // might be, but fall back to accepting it as-is\n if (maybeJson(trimResponse)) {\n try {\n data = JSON.parse(this.responseText);\n } catch (e) {\n data = this.responseText;\n }\n } else {\n data = this.responseText;\n }\n }\n return callback(error(), data);\n function error() {\n // xmlhttprequest does not consider a 404, 500, etc. to be\n // an \"error\" in the sense that would trigger the error\n // event handler function (below). It looks like only network\n // failures and/or browser problems can do that. So we need\n // to recognize error status codes ourselves and correctly\n // report an error.\n if (xmlhttp.status < 400) {\n return null;\n }\n return xmlhttp;\n }\n });\n xmlhttp.addEventListener('abort', function(evt) {\n return callback(evt);\n });\n xmlhttp.addEventListener('error', function(evt) {\n return callback(evt);\n });\n }", "onReadyStateChangeHandler() {\n let xhr = window.http;\n if (!xhr.isStateReady() || xhr.options === undefined)\n return;\n let handler = xhr.completionHandlers[xhr.options.url];\n if (handler === undefined)\n return;\n let result = undefined;\n let isJson = xhr.options === undefined ? undefined : xhr.options.isJson === undefined ? false : xhr.options.isJson;\n switch (isJson !== undefined && isJson === true && xhr.xmlHtpRequest.status !== 0) {\n case true:\n console.log(\"response \", xhr.xmlHtpRequest.responseText);\n result = JSON.parse(xhr.xmlHtpRequest.responseText);\n break;\n case false:\n result = xhr.xmlHtpRequest.responseText;\n break;\n }\n handler(result, xhr.xmlHtpRequest.status, this);\n delete xhr.completionHandlers[xhr.options.url];\n xhr.executeNextTask();\n }", "function AjaxRequest(url, callback_function)\r\n{\r\n var ajax = new XMLHttpRequest();\r\n ajax.onreadystatechange = function() {\r\n if (ajax.readyState == 4 && ajax.status == 200)\r\n callback_function(ajax.responseText);\r\n }\r\n ajax.open(\"GET\", url, true);\r\n ajax.send(null);\r\n}", "function onSuccessfulXHR(request_intent, xhr, response) {\n\n\t// $('#id_notification_pane').text(response);\n\n\tswitch (request_intent) {\n\tcase INTENT_INJECT_PAGE_NAVIGATION:\n\t\tdocument.getElementById(\"page_navigation\").innerHTML = response;\n\t\tbreak;\n\tcase INTENT_INSERT_DISTRICT:\n\tcase INTENT_UPDATE_DISTRICT_NAMES:\n\t\tdocument.getElementById('input_district_name').value = \"\";\n\t\tdocument.getElementById('input_district_headquarters').value = \"\";\n\t\tsetDefaultSaveType();\n\t\tpopulateDistricts();\n\t\tbreak;\n\tcase INTENT_QUERY_COUNTIES:\n\t\tsetCounties(response);\n\tcase INTENT_TRASH_DISTRICT:\n\tcase INTENT_ERASE_DISTRICT:\n\tcase INTENT_RESTORE_DISTRICT:\n\t\tpopulateDistricts();\n\tcase INTENT_QUERY_DISTRICTS:\n\t\tdocument.getElementById('id_table_body_districts').innerHTML = response;\n\t\t// $('#id_table_body_districts').text(response);\n\t\tpopulateTrashedDistricts();\n\t\tbreak;\n\tcase INTENT_QUERY_DELETED_DISTRICTS:\n\t\tdocument.getElementById('id_table_body_deleted_districts').innerHTML = response;\n\t\tbreak;\n\tcase INTENT_STAGE_SELECTED_DISTRICT_FOR_EDITING:\n\t\tstageSelectedDistrictForEditing(response);\n\t\tbreak;\n\tdefault:\n\t\talert(\"Undefined callback for intent [\" + request_intent + \"]\");\n\t\tbreak;\n\t}\n}", "function _handler(data, statusText, xhr) {\n if(xhr) {\n print2Console(\"RESPONSE\", xhr.status);\n } else {\n print2Console(\"RESPONSE\", data);\n }\n}", "function getXHR(url, callback) {\n var req = new XMLHttpRequest();\n req.onreadystatechange = function () {\n if (this.readyState == 4) {\n if (this.status == 200 || this.status == 0) {\n callback(this.responseText);\n } else {\n console.log('something went wrong');\n }\n }\n }\n req.open('GET', url, true);\n req.send();\n }", "function callbackAJAXcanviTorn() {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n if (xhr.status === 200) {\n //dades = xhr.response;\n dada = JSON.parse(xhr.response);\n canviTorn();\n } else {\n console.log('problemes amb l\\'AJAX');\n }\n }\n}", "function fXMLHttpRequest() {\n\t\tthis._object = oXMLHttpRequest && !bIE7 ? new oXMLHttpRequest : new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\tthis._listeners = [];\n\t}", "function fXMLHttpRequest() {\n\t\tthis._object = oXMLHttpRequest && !bIE7 ? new oXMLHttpRequest : new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\tthis._listeners = [];\n\t}", "function readyStateRecieved(eventHandler)\n{\n if (xhrObj.readyState == 4 && xhrObj.status == 200) //!< XHR has data loaded and server says OK\n {\n xhrResponse = xhrObj.responseText; //!< Response text recieved; store as response\n eventHandler(); //!< Execute the event handler\n }\n}", "function onRequest() {\n req = new Request(head, body);\n res = new Response();\n\n return runLayer(0).then(onResponse);\n }", "function processRequest(e) {//Processing the first request to find the users username in the database\r\n if (xhr.readyState == 4 && xhr.status == 200) {//If the request was successful\r\n var response = JSON.parse(xhr.responseText);//JSON object returned from using request\r\n username = response.username//Setting the username for the program\r\n if (username!=[]){//New request for getting user score\r\n getHighscore = new XMLHttpRequest()\r\n getHighscore.open('GET', apiSettings.server+'/api/highscores/'+username, true);\r\n getHighscore.send()\r\n getHighscore.addEventListener(\"readystatechange\",getScore,false)//Event listener to then process that score\r\n }\r\n }\r\n}", "function ajaxBindCallback() {\n if (ajaxRequest.readyState == 4) {\n if (ajaxRequest.status == 200) {\n if (ajaxCallback) {\n ajaxCallback(ajaxRequest.responseText);\n } else {\n alert('no callback defined');\n }\n } else {\n alert(\"There was a problem retrieving the xml data:\\n\" + ajaxRequest.status + \":\\t\" + ajaxRequest.statusText + \"\\n\" + ajaxRequest.responseText);\n }\n }\n }", "_onLoad( e ) {\n let status = this._xhr.status | 0;\n let response = this._resolveResponseData();\n let error = this._resolveErrorText( response );\n\n if ( status && status < 400 ) {\n this._callHandler( 'success', this._xhr, response );\n } else {\n this._callHandler( 'error', this._xhr, error, response );\n }\n this._onComplete( response );\n }", "function fXMLHttpRequest() {\n this._object = oXMLHttpRequest && !bIE7 ? new oXMLHttpRequest : new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n this._listeners = [];\n }", "function fXMLHttpRequest() {\n this._object = oXMLHttpRequest && !bIE7 ? new oXMLHttpRequest : new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n this._listeners = [];\n }", "function handleChange(){\n\t\t\t// Error handles\n\t\t\tif(xhr.readyState === this.DONE && xhr.status !== 200){\n\t\t\t\tconsole.log('check yoself');\n\t\t\t}\n\t\t\t// success handles\n\t\t\tif(xhr.readyState === this.DONE && xhr.status === 200){\n\t\t\t\tcallback(xhr.response);\n\t\t\t}\n\n\t\t}", "function callback_get(target)\n{\n var xmlhttp;\n if (window.XMLHttpRequest)\n {// code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp=new XMLHttpRequest();\n }\n else\n {// code for IE6, IE5\n xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlhttp.open(\"GET\",target,false);\n xmlhttp.send();\n return xmlhttp.responseText;\n}", "function HttpSentEvent() {}", "function HttpSentEvent() {}", "function ajaxRequest() {\n\n var data = {};\n var request = new XMLHttpRequest();\n request.open('GET', 'http://localhost/Redcraft/php/index.php', true);\n request.onload = function () {\n if (request.status >= 200 && request.status < 400) {\n console.log(\"succes\");\n data = JSON.parse(request.responseText);\n\n processData(data);\n\n } else {\n console.log(\"We reached our target server, but it returned an error\")\n }\n };\n request.onerror = function () {\n console.log(\"There was a connection error of some sort\");\n };\n request.send();\n\n}", "function reqListener() {\n console.log('File loaded: ' + sourceLocation);\n cm.setValue(this.responseText);\n engineStartup();\n }", "function HttpSentEvent() { }", "function HttpSentEvent() { }", "function HttpSentEvent() { }", "function hitURL(path) {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n console.log(\"Success\");\n console.log(xhttp.response);\n }\n }\n xhttp.open(\"GET\", path, true);\n xhttp.send();\n}", "function HttpProgressEvent() { }", "function HttpProgressEvent() { }", "function HttpProgressEvent() { }", "function getAjaxData(url, callback) {\n // Create new ajax call with the js function called XMLHttpRequest\n const request = new XMLHttpRequest();\n request.addEventListener('load', function () {\n // This in here is our callback function\n // Check our server responsecode, 200 means ok, success: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes \n if (this.status === 200) {\n callback(JSON.parse(request.responseText));\n } else {\n console.log('Something is probably wrong with the url');\n }\n });\n\n request.addEventListener('error', function () {\n console.log('Server error like timeout');\n });\n\n // initializes a request with an http method\n request.open(\"GET\", url);\n // Sends the request \n request.send();\n}", "function myVanillaAjaxReq(link, myCallbackFunc) {\n var req = new XMLHttpRequest();\n req.onreadystatechange = function() {\n if (req.readyState === 4) {\n if (req.status === 200) {\n var myData = JSON.parse(req.responseText);\n if (myCallbackFunc) {\n myCallbackFunc(myData);\n }\n }\n }\n };\n req.open('GET', link);\n req.send();\n}", "function requestCallback(url, data) {\n let xhr = new XMLHttpRequest();\n xhr.open('POST', url);\n xhr.onload = function () {\n if (xhr.status === 200) {\n let responseData = xhr.responseText;\n console.log(responseData);\n let divPostData = document.getElementById('postData');\n divPostData.innerHTML = `<p style=\"margin:0\">${responseData}</p>`;\n }\n }\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n xhr.send('name=' + encodeURIComponent(data));\n }", "xhrResultsHandler(data,textStatus,jqXHR) {\n \n }", "function onSuccessfulXHR(request_intent, xhr, response) {\n\n\t// $('#id_notification_pane').text(response);\n\n\tswitch (request_intent) {\n\tcase INTENT_INJECT_PAGE_NAVIGATION:\n\t\tdocument.getElementById(\"page_navigation\").innerHTML = response;\n\t\tbreak;\n\tcase INTENT_INSERT_SYSTEM_USER:\n\tcase INTENT_UPDATE_SYSTEM_USERS:\n\t\tresetFields();\n\t\tsetDefaultSaveType();\n\t\tpopulateSystemUsers();\n\t\tbreak;\n\tcase INTENT_TRASH_SYSTEM_USER:\n\tcase INTENT_ERASE_SYSTEM_USER:\n\tcase INTENT_RESTORE_SYSTEM_USER:\n\t\tpopulateSystemUsers();\n\tcase INTENT_QUERY_SYSTEM_USERS:\n\t\tdocument.getElementById('id_table_body_system_users').innerHTML = response;\n\t\t// $('#id_table_body_system_users').text(response);\n\t\tpopulateTrashedSystemUsers();\n\t\tbreak;\n\tcase INTENT_QUERY_DELETED_SYSTEM_USERS:\n\t\tdocument.getElementById('id_table_body_deleted_system_users').innerHTML = response;\n\t\tbreak;\n\tcase INTENT_STAGE_SELECTED_SYSTEM_USER_FOR_EDITING:\n\t\tstageSelectedSystemUserForEditing(response);\n\t\tbreak;\n\tdefault:\n\t\talert(\"Undefined callback for intent [\" + request_intent + \"]\");\n\t\tbreak;\n\t}\n}", "function ajaxGet(url, callback) {\n var req = new XMLHttpRequest();\n req.open(\"GET\", url);\n req.addEventListener(\"load\", function () {\n if (req.status >= 200 && req.status < 400) {\n // Call of callback function\n callback(req.responseText);\n } else {\n console.error(req.status + \" \" + req.statusText + \" \" + url);\n }\n });\n req.addEventListener(\"error\", function () {\n console.error(\"Erreur réseau avec l'URL \" + url);\n });\n req.send(null);\n}", "function ajax(url, method, myCallback) {\n let xhr = new XMLHttpRequest();\n // console.log(xhr);\n xhr.open(method, url, true);\n xhr.onreadystatechange = callback;\n // console.log(xhr.readyState, xhr.status, xhr.statusText);\n xhr.send();\n let response = {};\n function callback() {\n // console.log(xhr.readyState, xhr.status, xhr.statusText);\n if (xhr.readyState == 4) {\n response = JSON.parse(xhr.responseText);\n console.log(response);\n // info = response;\n // console.log(info.elements.length);\n myCallback(response);\n }\n }\n return response;\n}", "function asyncReq(callback) {\r\n var httpRequest = new XMLHttpRequest();\r\n httpRequest.onload = function(){ // when the request is loaded\r\n callback(httpRequest.responseText);// we're calling our method\r\n };\r\n httpRequest.open('GET', urlobs);\r\n httpRequest.send();\r\n}", "function FakeXMLHttpRequest() {\n this.readyState = FakeXMLHttpRequest.UNSENT;\n this.requestHeaders = {};\n this.requestBody = null;\n this.status = 0;\n this.statusText = \"\";\n\n this._eventListeners = {};\n var events = [\"loadstart\", \"load\", \"abort\", \"loadend\"];\n for (var i = events.length - 1; i >= 0; i--) {\n _addEventListener(events[i], this);\n }\n}", "function handleRequestStateChange() \n{ \n // when readyState is 4, we are ready to read the server response \n if (xmlHttp.readyState == 4) \n { \n // continue only if HTTP status is \"OK\" \n if (xmlHttp.status == 200) \n { \n try \n { \n // extract the XML retrieved from the server\n handleServerResponse();\n } \n catch(e) \n { \n // display error message \n alert(\"Error reading the response: \" + e.toString()); \n } \n } \n else \n { \n // display status message \n alert(\"There was a problem retrieving the data:\\n\" + \n xmlHttp.statusText); \n } \n } \n}", "function getReadyStateHandler(xmlHttpRequest) {\n \n // an anonymous function returned\n // it listens to the XMLHttpRequest instance\n return function() {\n if (xmlHttpRequest.readyState == 4) {\n if (xmlHttpRequest.status == 200) {\n //document.getElementById(\"hello\").innerHTML = xmlHttpRequest.responseText;\n \n } else {\n alert(\"HTTP error \" + xmlHttpRequest.status + \": \" + xmlHttpRequest.statusText);\n }\n }\n };\n}", "function _addEventListener(eventName, xhr){\n xhr.addEventListener(eventName, function (event) {\n var listener = xhr[\"on\" + eventName];\n\n if (listener && typeof listener == \"function\") {\n listener(event);\n }\n });\n}", "function h$sendXHR(xhr, d, cont) {\n xhr.addEventListener('error', function () {\n cont(2);\n });\n xhr.addEventListener('abort', function() {\n cont(1);\n });\n xhr.addEventListener('load', function() {\n cont(0);\n });\n if(d) {\n xhr.send(d);\n } else {\n xhr.send();\n }\n}", "function h$sendXHR(xhr, d, cont) {\n xhr.addEventListener('error', function () {\n cont(2);\n });\n xhr.addEventListener('abort', function() {\n cont(1);\n });\n xhr.addEventListener('load', function() {\n cont(0);\n });\n if(d) {\n xhr.send(d);\n } else {\n xhr.send();\n }\n}", "function h$sendXHR(xhr, d, cont) {\n xhr.addEventListener('error', function () {\n cont(2);\n });\n xhr.addEventListener('abort', function() {\n cont(1);\n });\n xhr.addEventListener('load', function() {\n cont(0);\n });\n if(d) {\n xhr.send(d);\n } else {\n xhr.send();\n }\n}", "function ajaxRequest(method,url,temp_data,callback) {\n\n var req=new XMLHttpRequest();\n var post_data;\n\n req.onreadystatechange=function(){\n if(req.readyState===4 && (req.status===200 || req.status===304)){\n post_data=JSON.parse(req.responseText);\n console.log(post_data);\n callback(post_data);\n }\n };\n\n req.open(method,url,true);\n\n req.send(temp_data);\n\n }", "function sendRequest() {\n if (window.XMLHttpRequest) {\n req = new XMLHttpRequest();\n } else {\n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n req.onreadystatechange = handleResponse;\n req.open(\"GET\", \"/intro/get-list\", true);\n req.send(); \n}", "function handleXmlHttpRequestReadyStateChange() {\r\n if (this.readyState == 4) {\r\n if (this.status != 200) {\r\n console.log(\"Request state was 4 but status: \" + this.status + \". responseText: \" + this.responseText);\r\n } else {\r\n console.log(\"GOT XHR RESPONSE: \" + this.responseText);\r\n if (this.responseText == \"QUIT\") {\r\n //We're only allowed to send a response if we're blocked waiting for one, so pretend\r\n console.log(\"SENDING QUIT XHR\");\r\n sendResponseByXHR(\"\", false);\r\n } else {\r\n console.log(\"Got request to execute from XHR: \" + this.responseText);\r\n parseRequest(JSON.parse(this.responseText));\r\n }\r\n }\r\n }\r\n}", "function HttpProgressEvent() {}", "function HttpProgressEvent() {}", "function loadData3(){\n //THIS FUNCTION WILL NOT USE onload function we will use onreadystatechange\n const xhr = new XMLHttpRequest();\n xhr.open(\"GET\",\"data3.txt\",true);\n xhr.onprogress = function(){\n console.log('do something during loading');\n }\n xhr.send();\n xhr.onreadystatechange = function (){\n //the readystate determines at what state is the response\n console.log(this.readyState);\n if (xhr.readyState == 4) {\n let content = xhr.responseText;\n loadDataToDOM(content);\n }\n }\n}", "done(callback) {\n var self = this;\n this.xhr.onreadystatechange = function () {\n if (self.xhr.readyState == 4) {\n callback(self.xhr);\n }\n }\n return this;\n }", "function jsonrequest(url,cFunction){\t\n\tlet request = new XMLHttpRequest();\n\trequest.responseType = \"json\";\n\trequest.onreadystatechange = function() {\n\t if (this.readyState == 4 && this.status == 200) {\n\t cFunction(this); //send xhr object to callback function\n\t }\n\t};\n\trequest.open(\"GET\", url, true); \n\trequest.send();\n}", "function callbackXHR() {\n \"use strict;\"\n\n if (g_polling_xhr.readyState == 4 && g_polling_xhr.status == 200) {\n // parse the response.\n var data = JSON.parse(g_polling_xhr.responseText);\n var errorCode = (undefined != data.error && 0 != data.error.length) ? data.error[0] : 0;\n var eventName = \"\";\n var newseq = 0;\n if (undefined != data.result && 0 != data.result.length) {\n newseq = data.result[0].seqNum;\n eventName = data.result[0].eventName;\n }\n\n // invoke event handler\n if (g_seqnum < newseq) {\n g_seqnum = newseq;\n MonitoringEventHandler(data);\n }\n\n g_polling_xhr.abort();\n\n // do XHR again\n // - 7 ... service not avalibable.\n if (eventName == \"terminated\") {\n // don't send XHR.\n // disable long press -> no save as photo when PartyShareApp was teminated.\n disable();\n } else if (errorCode == 7) {\n UITerminatePopUp(translationlist['64543'].replace(\"[%1]\", translationlist['80409']));\n } else {\n /* fix bug DM15GN1-2486, on Ipad/Phone, terminate popup doesnot display when close PhotoShare App by remote control */\n setTimeout(doXHR, 500);\n }\n }\n}", "sendGETRequest(url){\n let requestContainer = new XMLHttpRequest();\n requestContainer.open('GET',url,true);\n requestContainer.onreadystatechange = this.processGETRequest.bind(this,requestContainer);\n requestContainer.send();\n }", "function callback(){\n // alert(obj.readyState+\" \"+obj.status)\n if(obj.readyState==4 && obj.status==200){\n alert(obj.responseText)\n }\n}", "function callback(success, response, error, xhr) {\n if (success) {\n httpSuccess(response, xhr);\n } else {\n httpError(response, error, xhr);\n }\n return;\n }", "function ajaxGet(path, callback) {\n let xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function () {\n if (xmlhttp.readyState === XMLHttpRequest.DONE) {\n if (xmlhttp.status > 299) {\n console.log(xmlhttp.status);\n console.log(xmlhttp);\n }\n callback(xmlhttp.responseText);\n }\n };\n xmlhttp.open(\"GET\", path, true);\n xmlhttp.send();\n}", "function loadData(){\n const xhr = new XMLHttpRequest();\n\n// Open - It is basically where we're going to specify the type of request we want to make.\n xhr.open('GET','data.txt',true);\n \n xhr.onprogress = function(){\n console.log('READYSTATE',xhr.readyState)\n }\n xhr.onload = function(){ // You can use it instead of onreadychange method, it will include tghe \n console.log('READYSTATE',xhr.readyState); \n if (this.status === 200){\n console.log(this.responseText);\n // this will done without refresh the page\n document.querySelector('#output').innerHTML=`<h1>${this.responseText}</h1>`\n }\n };\n\n // xhr.onreadystatechange = function(){\n // console.log('READYSTATE',xhr.readyState); \n // if (this.status === 200 && this.readystate===4){\n // console.log(this.responseText);\n // } \n // }; \n xhr.onerror = function(){\n console.error(\"Request Error....\");\n }\n xhr.send();\n\n}", "function makeRequest(url, receiver_function) \n{\n http_request = false;\n if (window.XMLHttpRequest) \n { \n http_request = new XMLHttpRequest();\n if (http_request.overrideMimeType)\n {\n http_request.overrideMimeType('text/xml');\n }\n }\n if (!http_request) \n {\n alert('Giving up :( Cannot create an XMLHTTP instance');\n }\n http_request.onreadystatechange = receiver_function;\n http_request.open('GET', url, true);\n http_request.send(null);\n\n return;\n}", "function MockXMLHttpRequest() {\n }", "function ajaxRequest(objContent, callback) {\n var xmlhttp = new XMLHttpRequest();\n var type = objContent['type'];\n\n xmlhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 0) {\n alert(\"unable to reach the server. Probably shut down\");\n } else if (this.readyState == 4 && this.status == 200) {\n if (this.responseText.length > 0) {\n objContent['content'] = JSON.parse(this.responseText);\n if (objContent['cascadeCallback'] == true) {\n objContent['callback'].call(this, objContent['callbackParams']);\n }\n } else {\n objContent['content'] = '';\n }\n callback(objContent);\n } else if (this.readyState == 4 && this.status >= 500) {\n alert('Impossible to establish a connection with the server');\n } else if (this.readyState == 4 && this.status == 404) {\n alert('The route of the request does not exist.');\n } else if (this.readyState == 4 && this.status == 400) {\n alert(this.responseText);\n }\n };\n xmlhttp.open(objContent['type'], objContent['url'], true);\n if (type == \"POST\" || type == \"DELETE\" || type == \"PUT\") {\n xmlhttp.setRequestHeader(\"Content-type\", \"application/json\");\n xmlhttp.send(JSON.stringify(objContent['toSend']));\n } else {\n xmlhttp.send();\n }\n}", "function xhrInterceptor() {\n var originalXHR = window.XMLHttpRequest;\n var xhrSend = XMLHttpRequest.prototype.send;\n var xhrOpen = XMLHttpRequest.prototype.open;\n originalXHR.getRequestConfig = [];\n function ajaxEventTrigger(event) {\n var ajaxEvent = new CustomEvent(event, { detail: this });\n window.dispatchEvent(ajaxEvent);\n }\n function customizedXHR() {\n var liveXHR = new originalXHR();\n liveXHR.addEventListener('readystatechange', function () {\n ajaxEventTrigger.call(this, 'xhrReadyStateChange');\n }, false);\n liveXHR.open = function (method, url, async, username, password) {\n this.getRequestConfig = arguments;\n return xhrOpen.apply(this, arguments);\n };\n liveXHR.send = function (body) {\n return xhrSend.apply(this, arguments);\n };\n return liveXHR;\n }\n window.XMLHttpRequest = customizedXHR;\n }", "function calbackWrapper() {\r\n if (http_request.readyState == 4) {\r\n if (http_request.status == 200)\r\n callback(http_request);\r\n else\r\n alert(\"您所请求的页面有异常。\");\r\n }\r\n }", "function calbackWrapper() {\r\n if (http_request.readyState == 4) {\r\n if (http_request.status == 200)\r\n callback(http_request);\r\n else\r\n alert(\"您所请求的页面有异常。\");\r\n }\r\n }", "function xhr(url,param,handler,handle_id) {\n var ro=window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject(\"Microsoft.XMLHTTP\");\n ro.open('POST',url,true);\n ro.setRequestHeader('Content-Type','application/x-www-form-urlencoded');\n ro.onreadystatechange=function(){if(ro.readyState==4) handler(ro.responseText,handle_id)};\n ro.send(param);\n}", "function request(){\n\n var xhr = GethttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'json';\n xhr.onload = function() {\n var status = xhr.status;\n if (status == 200) {\n callback(status, xhr.response);\n } else {\n callback(status);\n }\n };\n xhr.send();\n }", "function xhr(method, url, params, callback) {\r\n let http = new XMLHttpRequest();\r\n if (method == \"POST\" || params == \"\") http.open(method, url, true);\r\n else http.open(method, url + \"?\" + params, true);\r\n\r\n http.onload = function() {\r\n if(this.status != 200)\r\n console.warn(\"Attention, status code \"+this.status+\" when loading via xhr url \"+url);\r\n callback(this.responseText, this.status);\r\n };\r\n if (method == \"POST\") {\r\n http.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\r\n http.send(params);\r\n } else {\r\n http.send();\r\n }\r\n}", "function processRequest(e){\n //fires 5 times bc fires everytime state changes, but only want when state is done so provide conditions\n // status provides it is okay too.\n if (xhr.readyState == 4 && xhr.status == 200){\n //parse json string for readable response.\n var response = JSON.parse(xhr.responseText);\n \n //print response in popup by sending message to popup with response(term) info.\n chrome.runtime.sendMessage(response);\n }\n }", "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}", "function reqListener () {\n console.log(this.responseText);\n M2 = JSON.parse(this.responseText);\n }", "function loadData(){\n //console.log(\"clicked\");\n // create XHR (XML Http Response) object \n \n let xhr = new XMLHttpRequest()\n //console.log(xhr);\n xhr.open('GET','data.txt',true)\n\n /*\n status -->\n 200: \"OK\"\n 403: \"Forbidden\"\n 404: \"Page not found\"\n For a complete list go to the Http Messages Reference\n\n\n statusText -->\tReturns the status-text (e.g. \"OK\" or \"Not Found\")\n */\n\n xhr.onprogress = function(){\n // In this section we can use loader spinner..\n console.log(this.readyState);\n }\n\n // // old tachnique\n // xhr.onreadystatechange = function(){\n // /*\n // onreadystatechange ---->Defines a function to be called when the readyState property changes.\n // readyState ----> Holds the status of the XMLHttpRequest.\n // 0: request not initialized\n // 1: server connection established\n // 2: request received\n // 3: processing request\n // 4: request finished and response is ready\n // */\n // //console.log(this.readyState);\n // if(this.status === 200 && this.readyState ===4){\n // console.log(this.responseText);\n // }\n // }\n\n // update tachnique :\n xhr.onload = function(){\n if(this.status == 200 ){\n document.getElementById('output').innerHTML = `<h3>${this.responseText}</h3>`\n }\n }\n\n\n xhr.send()\n\n\n\n}", "function ajaxResult(address, search) {\n//alert(\"ready to lauch...\");\n var request = getRequestObject();\n request.onreadystatechange = \n function() { showResponseText(request, search); };\n request.open(\"GET\", address, true);\n request.send(null);\n//alert(\"lauched...\");\n}", "function calbackWrapper() {\r\n if (http_request.readyState == 4) {\r\n if (http_request.status == 200)\r\n if(callback)\r\n callback(http_request);\r\n else\r\n alert(\"您所请求的页面有异常。\");\r\n }\r\n }", "function loadXhr() {\n var status = getStatusCode()\n var error = errorFromStatusCode(status)\n\n xhr.status = xhr.statusCode = status;\n xhr.body = getBody();\n\n callback(error, xhr, xhr.body);\n }", "function xhrEventListenerFactory() {\n return function (e) {\n // send message to extension the background script\n runtime.sendMessage({\n type: e.type,\n detail: e.detail\n });\n };\n}", "function processReqChange() {\n\t\t// only if req shows \"loaded\"\n\t\tif (req.readyState == 4) {\n\t\t\t// only if \"OK\"\n\t\t\tif (req.status == 200) {\n\t\t\t\trunfunc(element, req.responseXML.getElementsByTagName(element));\n\t\t\t} else {\n\t\t\t\talert(\"There was a problem retrieving the XML data:\\n\"\n\t\t\t\t\t\t+ req.statusText);\n\t\t\t}\n\t\t}\n\t}", "function ajaxRequest(){\n\t\t\n\t\t/**\n\t\t * Once the connections transaction is complete\n\t\t */\n\t\tif(ajaxCon.readyState==XMLHttpRequest.DONE){\n\t\t\t/**\n\t\t\t * Send the correct result based on the responses status\n\t\t\t */\n\t\t\tif (ajaxCon.status==\"OK\"||ajaxCon.status==200){\n\t\t\t\tcallback(ajaxCon.responseText); // <=== Send back the JSON Object\n\t\t\t} else {\n\t\t\t\tcallback(null); // <=== Send back null so nothing gets broken\n\t\t\t}\n\t\t}\n\t}", "function loadXhr() {\n var status = getStatusCode()\n var error = errorFromStatusCode(status)\n\n xhr.status = xhr.statusCode = status\n xhr.body = getBody()\n xhr.headers = parseHeaders(xhr.getAllResponseHeaders())\n\n callback(error, xhr, xhr.body)\n }", "function reqListener() {\n console.log(JSON.parse(this.responseText));\n}" ]
[ "0.73812973", "0.7177435", "0.7151438", "0.71057534", "0.71017927", "0.70793766", "0.70532584", "0.7049591", "0.67537177", "0.67445207", "0.66872513", "0.6678534", "0.66558105", "0.6643317", "0.6614074", "0.65930516", "0.65823305", "0.6543701", "0.65184844", "0.6509528", "0.6492326", "0.64920074", "0.64746433", "0.64705634", "0.64490825", "0.6448622", "0.6447301", "0.6440625", "0.6425457", "0.6425457", "0.6422703", "0.6417929", "0.64114493", "0.640828", "0.64067346", "0.63921356", "0.63921356", "0.63910276", "0.6373586", "0.63622546", "0.63622546", "0.63591325", "0.63580334", "0.63524216", "0.63524216", "0.63524216", "0.63440967", "0.6338396", "0.6338396", "0.6338396", "0.633705", "0.6336264", "0.6328616", "0.63218516", "0.6305093", "0.6299709", "0.62919456", "0.6285778", "0.6277433", "0.6266622", "0.62592864", "0.62589383", "0.6257583", "0.6257583", "0.6257583", "0.62541723", "0.6219507", "0.6214292", "0.620412", "0.620412", "0.6203489", "0.6200079", "0.6195336", "0.61916316", "0.6190892", "0.6189283", "0.61876106", "0.618713", "0.6186311", "0.6185781", "0.6185276", "0.6183616", "0.61794984", "0.61780226", "0.61780226", "0.61648375", "0.61629385", "0.61535835", "0.6150175", "0.61487573", "0.6145638", "0.6143411", "0.61416274", "0.61388814", "0.6138256", "0.61260957", "0.61229825", "0.611919", "0.6116229", "0.61162275" ]
0.6996655
8
Object representing a creative within the ad
function VastCreative(node, parent){ var me = this; var par = parent; this.sequence = node.getAttribute('sequence'); this.adId = node.getAttribute('adid'); this.id = node.getAttribute('id'); this.apiFramework = node.getAttribute('apiFramework'); /** * @function * Retrieve companion ads associated with this ad or null */ this.getCompanionAds = function(){ var i, comp = null, c, len, seq = me.sequence; if(!parent || (me.adType != 'linear' && me.adType != 'nonlinear') || par.creative_companions.length == 0){ return null; } len = par.creative_companions.length; for(i=0; i < len; i++){ c = par.creative_companions[i]; if(c.adType == COMPANION_ADS){ if(c.sequence == null){ comp = c; } else if(c.sequence == seq){ return c; } } } return comp; } function parseTrackingEvents(detObj, trackingNode){ var i, tn, evt, tracks = childElements(trackingNode), tevts = detObj.trackingEvents || {}; for(i=0; i < tracks.length; i++){ tn = tracks[i]; if(tn.tagName.toUpperCase() != 'TRACKING'){ continue; } evt = tn.getAttribute('event'); tevts[evt] = { event: evt, url: nodeText(tn) }; } // insure reassignment detObj.trackingEvents = tevts; } function parseCreative(node){ var i, n, kids, tname; kids = childElements(node); if(kids.length == 0){ return; } else{ tname = kids[0].tagName.toLowerCase(); me.adType = tname; if(tname == 'linear'){ parseLinear(kids[0]); } else if(tname == COMPANION_ADS){ parseCompanionAds(kids[0]); } else if(tname == 'nonlinear'){ parseNonLinear(kids[0]); } } } /** * @function * Parse a linear ad node */ function parseLinear(lnode){ var l, tn, k, mfiles, mf, mfAttribs, mObj, i, m, kids = childElements(lnode); mfAttribs = ['delivery', 'type', 'width', 'height', 'codec', 'id', 'bitrate', 'minBitrate', 'maxBitrate', 'scalable', 'maintainAspectRatio', 'apiFramework' ]; me.linear = { duration : null, mediaFiles: [] }; l = me.linear; for(i=0; i < kids.length; i++){ k = kids[i]; tn = k.tagName.toUpperCase(); switch(tn){ case 'DURATION': l.duration = nodeText(k); break; case 'MEDIAFILES': mfiles = childElements(k); for(m=0; m < mfiles.length; m++){ mf = mfiles[m]; mObj = objFromAttributes(mf, mfAttribs); mObj.url = nodeText(mf); l.mediaFiles.push(mObj); } case 'TRACKINGEVENTS': parseTrackingEvents(l, k); break; case 'ADPARAMETERS': case 'VIDEOCLICKS': case 'ICONS': break; } } } function parseCompanionAds(cnode){ var k, i, kids = childElements(cnode); me.companions = []; for(i=0; i < kids.length; i++){ me.companions.push(new CompanionAd(kids[i])); } } function parseNonLinear(nlnode){ } // Begin parsing parseCreative(node); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function VastAd(node){\n\t\tvar me = this;\n\t\t// required elements - section 2.2.4.1\n\t\tthis.id = node.getAttribute('id');\n\t\tthis.sequence = node.getAttribute('sequence');\n\t\tthis.impressions = [];\n\t\tthis.creatives = [];\n\t\tthis.creative_companions = [];\n\t\t\n\t\t// optional elements - - section 2.2.4.2\n\t\tthis.description = NULL;\n\t\tthis.advertiser = NULL;\n\t\tthis.error = NULL;\n\t\tthis.pricing = NULL;\n\t\tthis.extensions = NULL;\n\t\t\n\t\t\n\t\tfunction parseAd(node){\n\t\t\tvar kid = childElements(node)[0],\n\t\t\t\ttagName = kid.tagName.toUpperCase();\n\t\t\t\n\t\t\tif(tagName == 'WRAPPER'){\n\t\t\t\tme.isWrapper = true;\n\t\t\t\tme.wrapperUrl = 'http://example/org';\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if(tagName == 'INLINE'){\n\t\t\t\tparseInlineAd(kid);\t\t\t\t\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t/**\n\t\t* @function\n\t\t* Parsing routine for the INLINE tag element and children\n\t\t*/\n\t\tfunction parseInlineAd(ilnode){\n\t\t\tvar i, m, n, key, kidNode, adSys, url, adname, vnum, sysname;\n\t\t\tvar cr, crar, allcr;\n\t\t\tvar kids = childElements(ilnode);\n\t\t\tme.isWrapper = false;\n\t\t\tme.isInline = true;\n\t\t\t\n\t\t\tfor(i=0; i < kids.length; i++){\n\t\t\t\tkidNode = kids[i];\n\t\t\t\tswitch(kidNode.tagName.toUpperCase()){\n\t\t\t\t\tcase 'ADSYSTEM':\n\t\t\t\t\t\tvnum = kidNode.getAttribute('version');\n\t\t\t\t\t\tsysname = kidNode.innerHTML;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(vnum == null){\n\t\t\t\t\t\t\tvnum = parseFloat(sysname);\n\t\t\t\t\t\t\tif(isNaN(vnum)){\n\t\t\t\t\t\t\t\tvnum = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\tsysname = null;\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\tadSys = {\n\t\t\t\t\t\t\tversion: vnum,\n\t\t\t\t\t\t\tname: sysname\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tme.adSystem = new function(){\n\t\t\t\t\t\t\tthis.version = adSys.version;\n\t\t\t\t\t\t\tthis.name = adSys.sysname;\n\t\t\t\t\t\t\tthis.toString = function(){\n\t\t\t\t\t\t\t\tvar s = (this.name || 'Unknown') + ', version ' + (this.version || '0');\n\t\t\t\t\t\t\t\treturn s;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'ADTITLE':\n\t\t\t\t\t\tadname = nodeText(kidNode);\n\t\t\t\t\t\tme.adName = adname;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'IMPRESSION':\n\t\t\t\t\t\turl = nodeText(kidNode);\n\t\t\t\t\t\tme.impressions.push({id: kidNode.getAttribute('id'), url: url});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 'CREATIVES':\n\t\t\t\t\t\tallcr = childElements(kidNode);\n\t\t\t\t\t\tfor(m=0; m < allcr.length; m++){\n\t\t\t\t\t\t\tcr = new VastCreative(allcr[m], me);\n\t\t\t\t\t\t\tif(cr.adType == COMPANION_ADS){\n\t\t\t\t\t\t\t\tme.creative_companions.push(cr);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\tme.creatives.push(cr);\n\t\t\t\t\t\t\t}\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\t// Optional Inline Elements - 2.2.4.2\n\t\t\t\t\tcase 'DESCRIPTION':\n\t\t\t\t\t\tme.description = nodeText(kidNode);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'ADVERTISER':\n\t\t\t\t\t\tme.advertiser = nodeText(kidNode);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 'SURVEY':\n\t\t\t\t\t\tif(me.survey === undefined){\n\t\t\t\t\t\t\tme.survey = [];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// open for interpretation\n\t\t\t\t\t\tme.survey.push({\n\t\t\t\t\t\t\tattributes: {},\n\t\t\t\t\t\t\tcontent: kidNode.innerHTML\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfor(m=0; m < kidNode.attributes; m++){\n\t\t\t\t\t\t\tme.survey.attributes[kidNode.attributes.name] = kidNode.attributes.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'PRICING':\n\t\t\t\t\t\tme.pricing = {\n\t\t\t\t\t\t\tmodel : kidNode.getAttribute('model'),\n\t\t\t\t\t\t\tcurrency: kidNode.getAttribute('currency'),\n\t\t\t\t\t\t\tvalue: nodeText(kidNode)\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'EXTENSIONS':\n\t\t\t\t\t\tme.extensions = kidNode.innerHTML;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// TODO - SORT CREATIVES BY Sequence\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\tparseAd(node);\n\t}", "createAd(adImage, adURL, adPosition, imageWidth, imageHeight){\n return {\n image: this.props.createAd.image, \n url: this.props.createAd.url,\n position: this.props.createAd.position,\n width: this.props.createAd.width,\n height: this.props.createAd.height\n };\n }", "function AIE_Card(card_object) {\n\n this._created = 0; // if displayed on screen: > 0, if not: 0\n this._current_eg_id = 0; // value range: 0, 1, 2\n\n this._card_id = card_object[\"card_id\"] || 0;\n this._card_title = card_object[\"card_title\"] || \"Design Space\";\n\n this._NI_tag_id = card_object[\"NI_tag_id\"] || 0;\n this._NI_tag = card_object[\"NI_tag\"] || \"Narrative Intent Tag\";\n this._NI_id_arr = card_object[\"NI_id_arr\"];\n this._how = card_object[\"how\"] || \"\";\n this._why = card_object[\"why\"] || \"\";\n\n this._OT_tag = card_object[\"OT_tag\"] || \"Object type tag\";\n // this.DP_code = this._DP_abr(DP_sub_tag);\n\n // this._eg_arr = card_object.eg_arr || [{\"eg_id\":\"1000\", \"eg_source\":\"Video.com\", \"eg_year\":\"2020\", \"eg_designer\":\"Mr. Designer\", \"eg_url\":\"https://www.dribbble.com\"},{\"eg_id\":\"1001\", \"eg_source\":\"Video.com\", \"eg_year\":\"2020\", \"eg_designer\":\"Miss Designer\", \"eg_url\":\"https://www.dribbble.com\"},{\"eg_id\":\"1002\", \"eg_source\":\"Video.com\", \"eg_year\":\"2020\", \"eg_designer\":\"Ms. Designer\", \"eg_url\":\"https://www.dribbble.com\"}];\n this._eg_id = card_object[\"eg_id\"];\n this._eg_designer = card_object[\"eg_designer\"];\n this._eg_year = card_object[\"eg_year\"];\n this._eg_source = card_object[\"eg_source\"];\n this._eg_url = card_object[\"eg_url\"];\n\n this._color_hash = NI_Nav.ColorHash.init();\n this._card_color_arr = this._color_hash.get_color(this._NI_tag_id);\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n test = props.test,\n unit = props.unit;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', unit, Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(centered, 'centered'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(test, 'test'), 'ad', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getUnhandledProps */])(Advertisement, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getElementType */])(Advertisement, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes, 'data-text': test }),\n children\n );\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n test = props.test,\n unit = props.unit;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', unit, Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"A\" /* useKeyOnly */])(centered, 'centered'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"A\" /* useKeyOnly */])(test, 'test'), 'ad', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(Advertisement, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(Advertisement, props);\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes,\n \"data-text\": test\n }), __WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* childrenUtils */].isNil(children) ? content : children);\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n test = props.test,\n unit = props.unit;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()('ui', unit, Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(centered, 'centered'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(test, 'test'), 'ad', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(Advertisement, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(Advertisement, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes,\n \"data-text\": test\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n test = props.test,\n unit = props.unit;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()('ui', unit, Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(centered, 'centered'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(test, 'test'), 'ad', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(Advertisement, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(Advertisement, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes,\n \"data-text\": test\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n test = props.test,\n unit = props.unit;\n var classes = Object(clsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"])('ui', unit, Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(centered, 'centered'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(test, 'test'), 'ad', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(Advertisement, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(Advertisement, props);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n className: classes,\n \"data-text\": test\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n test = props.test,\n unit = props.unit;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', unit, Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"B\" /* useKeyOnly */])(centered, 'centered'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"B\" /* useKeyOnly */])(test, 'test'), 'ad', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(Advertisement, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(Advertisement, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes, 'data-text': test }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n test = props.test,\n unit = props.unit;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', unit, Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"B\" /* useKeyOnly */])(centered, 'centered'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"B\" /* useKeyOnly */])(test, 'test'), 'ad', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(Advertisement, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(Advertisement, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes, 'data-text': test }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n test = props.test,\n unit = props.unit;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', unit, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(centered, 'centered'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(test, 'test'), 'ad', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(Advertisement, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(Advertisement, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes, 'data-text': test }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "function Arm(name,damage,type,price,imageURL,desc,equiped){\n this.name = name;\n this.damage = damage;\n this.type = type;\n this.price = price;\n this.image = imageURL;\n this.desc = desc;\n this.equiped = equiped;\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n test = props.test,\n unit = props.unit;\n\n var classes = (0, _classnames2.default)('ui', unit, (0, _lib.useKeyOnly)(centered, 'centered'), (0, _lib.useKeyOnly)(test, 'test'), 'ad', className);\n var rest = (0, _lib.getUnhandledProps)(Advertisement, props);\n var ElementType = (0, _lib.getElementType)(Advertisement, props);\n\n return _react2.default.createElement(ElementType, (0, _extends3.default)({}, rest, { className: classes, 'data-text': test }), children);\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n test = props.test,\n unit = props.unit;\n\n var classes = (0, _classnames2.default)('ui', unit, (0, _lib.useKeyOnly)(centered, 'centered'), (0, _lib.useKeyOnly)(test, 'test'), 'ad', className);\n var rest = (0, _lib.getUnhandledProps)(Advertisement, props);\n var ElementType = (0, _lib.getElementType)(Advertisement, props);\n\n return _react2.default.createElement(ElementType, (0, _extends3.default)({}, rest, { className: classes, 'data-text': test }), _lib.childrenUtils.isNil(children) ? content : children);\n}", "function getAd()\n{\n}", "function PCreditImage()\r\n{\r\n\tthis.pCredit = window.document.createElement('p');\r\n\tthis.aCredit = window.document.createElement('a');\r\n\tthis.aCredit.setAttribute('href', 'https://sh3ff1e.wordpress.com/tag/banniere/');\r\n\tthis.aCredit.appendChild(window.document.createTextNode('BANNIERE ET IMAGES :https://sh3ff1e.wordpress.com/tag/banniere/')); \r\n\tthis.pCredit.appendChild(this.aCredit);\r\n\r\n\t//getter\r\n\tthis.getElement = function () { return this.pCredit; };\r\n}", "function Deal(dealName, location, district, day, img, num) {\n\tthis.dealName = dealName;\n\tthis.location = location;\n\tthis.district = district;\n\tthis.day = day;\n\tthis.img = img;\n\tthis.num = num;\n}", "function Acre() {\r\n\r\n this.terrain = \"\";\r\n this.features = new Collection();\r\n this.npcs = new Collection();\r\n this.pcs = new Collection();\r\n \r\n this.localLight = {};\r\n this.localSound = {};\r\n this.topSound = \"\";\r\n\r\n this.x;\r\n this.y;\r\n}", "function CardInfo(image,sellerInfo,heading,pricing,general,description,resaleURL,propertyId){\n this.image = image;\n this.sellerInfo = sellerInfo;\n this.heading = heading;\n this.pricing = pricing;\n this.general = general;\n this.description = description;\n this.resaleURL = resaleURL;\n this.propertyId = propertyId;\n}", "function CatalogItem(name, src, alt) {\n this.name = name;\n this.src = src;\n this.alt = alt;\n this.appearances = 0;\n this.votes = 0;\n}", "function extractCard(elementInsideArticle) {\n\tvar article = $(elementInsideArticle).closest('article');\n\tvar title = $('.idea-title', article).text();\n\tvar idea = $('.idea-body', article).text();\n\tvar id = article.data('id');\n\tvar quality = $('.quality-span', article).data('quality');\n\tvar ideaCard = new IdeaCard(title, idea, id, quality);\n\treturn ideaCard;\n}", "function PaymentCard() {\n this.id = 0;\n \n // the collection of language specific descriptors \n this.descriptors = [];\n \n // a language specific text name of the card\n this.name = '';\n \n // the status of the payment card\n this.status = new Status();\n \n this.created = null;\n this.modified = null;\n}", "renderAd() {\n const ad = false;\n let result;\n if (ad) {\n result = (\n <div className={styles.brandSide}>\n <div className={styles.attribution}>\n <a href=\"https://www.flickr.com/photos/navfac/8552567928/in/photolist-e2L9tJ-8fhTPf-8feBND-fm1EQk-AteTuX-bF1aiH-9Y8iiJ-qj49Lk-qWY1Z7-9Y8iVS-druR2i-9Y5ioz-bs6gKY-bs6iej-ccMAmC-uRDUpy-c7jWZG-9Y8f1N-9rqEiF-oT1A2h-fAzQJw-6fSQGQ-do5auk-jXtiMZ-akpHie-akpGmD-aksypG-aCbn8v-6fSHrC-2k98Vw-cHNwBy-chzs61-fvQ8Xw-akpL2r-fvHfFN-6fNEVF-8AAtwc-8zuqcz-dcCvwY-chzhiC-chzuow-chzybA-8JDAtm-aksujo-6fND18-akpKkX-akswSy-fvHnsE-akpFpr-chyX2S\">\n Image by NAVFAC\n </a>\n </div>\n </div>\n );\n } else {\n result = null;\n }\n return result;\n }", "function setupDom() {\n creative.dom = {};\n creative.dom.mainContainer = document.getElementById('main-container');\n creative.dom.expandedExit = document.getElementById('expanded-exit');\n creative.dom.expandedContent = document.getElementById('expanded-state');\n\n creative.dom.video1 = {};\n creative.dom.video1.vidContainer = document.getElementById('video-container-1');\n creative.dom.video1.vid = document.getElementById('video-1');\n\n creative.dom.video1.vidReplayBtn = document.getElementById('replay-btn-1');\n creative.dom.video1.vidUnmuteBtn = document.getElementById('unmute-btn-1');\n creative.dom.video1.vidMuteBtn = document.getElementById('mute-btn-1');\n\n creative.dom.expandedClientLogo = document.getElementById('expanded_clientlogo');\n creative.dom.expandedCta = document.getElementById('expanded_cta');\n creative.dom.expandedBgr = document.getElementById('expanded_bgr');\n creative.dom.expandedHeading = document.getElementById('expanded_heading');\n creative.dom.expandedCopy = document.getElementById('expanded_copy');\n\n creative.dom.featureExpanded = document.getElementById('feature-expanded');\n creative.dom.ExpndedBRG = document.getElementById('expanded_bgr_container');\n}", "function make_dcard(card) {\n\n\tvar new_dcard = new Object();\n\tnew_dcard.cardName = card.getAttribute('cardName');\n\tnew_dcard.count = 1;\n\tnew_dcard.rarity = card.getAttribute('rarity');\n\tnew_dcard.cardId = card.getAttribute('cardId');\n\tnew_dcard.imgurl = card.getAttribute('imgurl');\n\tnew_dcard.cardSet = card.getAttribute('cardSet');\n\tnew_dcard.mana = card.getAttribute('cost');\n\n\treturn new_dcard;\n}", "function Banner(id, endtime, hsobj, clickHandler, parent) {\n this.id = id; \n this.endtime = endtime;\n\n function BannerGetAnchor(dir) { return (dir == 'left2right' || dir == 'top2bottom');}\n function BannerIsVert(dir) { return (dir == 'top2bottom' || dir == 'bottom2top');}\n function BannerIsT2B(dir) { return (dir == 'top2bottom'); }\n function BannerIsB2T(dir) { return (dir == 'bottom2top'); }\n function BannerIsL2R(dir) { return (dir == 'left2right'); }\n function BannerIsR2L(dir) { return (dir == 'right2left'); }\n\n var box = hsobj.rect.split(\",\");\n \n var holderDiv = _createElm({\n type: 'div',\n id: 'ivs-banner-holder-' + id, //<-- really necessary?\n classes: 'ivs-banner-holder',\n styles: {\n 'top': box[0] + '%',\n 'left': box[1] + '%',\n 'width': box[2] + '%',\n 'height': box[3] + '%'\n }\n });\n _append(parent, [holderDiv]);\n _setElmClickHandler(holderDiv, clickHandler );\n \n var overlayImage = _createElm({\n type: 'img',\n id: 'ivs-banner-image-' + id, //<--- is this really necessary??\n //styles: {\n // 'opacity': 0.7\n //}\n });\n _append(holderDiv, [overlayImage]);\n //dirty or not.\n\n var dir = hsobj.direction;\n var image_url = (hsobj.image_url ? hsobj.image_url : hsobj.creativeInfo.image_url);\n\n \n //dirty means e.g. banner means to show 20thsec - 30thsec\n //user seek from 0 to 25th second.\n //Then the banner will just be drawn. No start with animation.\n this.start = function(dirty) {\n if (dirty != 'undefined' && dirty) {\n _setElmStyles(overlayImage, {\n 'width': '100%',\n 'height': '100%',\n });\n loadImage(image_url, overlayImage, function() {});\n return;\n }\n animateBanner(holderDiv, overlayImage, dir, image_url);\n }\n this.stop = function(dirty) {\n \n if (dirty != 'undefined' && dirty) {\n //remove from DOM without animation effects\n if (holderDiv) {\n _removeElm(holderDiv);\n holderDiv = null;\n }\n return;\n }\n Animate(overlayImage, -5, BannerIsVert(dir), BannerGetAnchor(dir), 100,\n function() {\n _fadeOut(overlayImage);\n _removeElm(holderDiv); \n holderDiv = null;\n });\n }\n var animateBanner = function(outerDiv, innerDiv, dir, image_url) {\n var start_attr;\n if (BannerIsVert(dir)) {\n _setElmStyles(innerDiv, {\n 'width': '100%'\n });\n } else {\n _setElmStyles(innerDiv, {\n 'height': '100%'\n });\n }\n _fadeIn(outerDiv);\n loadImage(image_url, innerDiv, function() {\n var end = (BannerIsVert(dir) ? Math.round(_getElmHeight(outerDiv)) :\n Math.round(_getElmWidth(outerDiv)));\n if (BannerIsL2R(dir)) { \n start_attr = {\n width: '0px'\n };\n } else if (BannerIsR2L(dir)) { \n start_attr = {\n left: end + 'px',\n width: '0px'\n };\n } else if (BannerIsT2B(dir)) { \n start_attr = {\n height: '0px'\n };\n } else if (BannerIsB2T(dir)) { \n start_attr = {\n top: end + 'px',\n height: '0px'\n };\n }\n _setElmStyles(innerDiv, start_attr);\n _fadeIn(innerDiv);\n var step = 5; //each time 5%\n var LOrTAnchored = (BannerGetAnchor(dir));\n Animate(innerDiv, step, BannerIsVert(dir), LOrTAnchored, 0, function() {});\n }); //end of load image\n }; //end of animate banner}\n}", "function getAdCreative(creative_id){\n\tvar access_token = gets('code');\n\tvar act = gets('act');\n\tjQuery.ajax({\n\n\t\t\t\t'url' \t: 'AjaxFile.php',\n\t\t\t\t'method'\t: 'GET',\t\t\t\t\n\t\t\t\t'data' : {\n\t\t\t\t\t'get_ad_creative_content':'true',\n\t\t\t\t\t'creative_id':creative_id,\n\t\t\t\t\t'code':access_token,\n\t\t\t\t\t'act':act\n\t\t\t\t},\n\t\t\t\t'dataType':'json',\n\t\t\t\tsuccess: function (data) {\n\t\t\t\t\t\n\t\t\t\t\t$('.two-tabs-second-radio').html(data.opt2);\n\t\t\t\t\t$('.selectpicker').selectpicker('refresh');\t\n\t\t\t\t}\n\t\t\t});\n}", "function asCard (item) {\n var role = item.author.data.role\n var email = item.author.data.email ? html`<a href=\"mailto:${item.author.data.email}\">${item.author.data.email}</a>` : null\n var body = role || email\n\n if (role && email) {\n body = html`<p>${role}<br /> ${email}</p>`\n }\n\n var props = {\n title: asText(item.author.data.title),\n body: body,\n link: {\n href: resolve(item.author)\n }\n }\n\n var image = item.author.data.featured_image\n if (!image) image = item.author.data.image\n if (image.url) {\n let sources = srcset(\n image.url,\n [400, 600, [800, 'q_70'], [1600, 'q_50']],\n { transforms: 'c_thumb,g_north', aspect: 9 / 14 }\n )\n\n props.image = Object.assign({\n sizes: '(min-width: 1000px) 33vw, (min-width: 600px) 50vw, 100vw',\n srcset: sources,\n src: sources.split(' ')[0],\n alt: item.author.data.image_caption || ''\n }, image.dimensions)\n }\n\n return card(props)\n}", "function AdjournObj()\n{\n\tvar Adjourn = INTERFACE_CreateAdminCenterAdjourn();\n\n\t// Attributes\n\tthis.AdjournDiv = Adjourn.Center;\n\tthis.AdjournUl = Adjourn.AdjournList;\n\tthis.NoAdjourn = Adjourn.NoAdjourn;\n\tthis.AdjournVisible = false;\n\tthis.AdjournList = new Array();\n\n\tthis.add = INTERFACE_AddAdjourn;\n\tthis.remove = INTERFACE_RemoveAdjourn;\n\n\tthis.showNoAdjourn = INTERFACE_ShowNoAdjourn;\n\tthis.hideNoAdjourn = INTERFACE_HideNoAdjourn;\n\tthis.show = INTERFACE_ShowAdjournCenter;\n\tthis.hide = INTERFACE_HideAdjournCenter;\n\n}", "function createCreativeTable(item) {\n publish(`paidpal_ppc_creatives_${item.name}`).query(\n createCreativesFileQuery(\n item.schemas,\n item.site)\n );\n}", "get banner() {\n return this._data.banner;\n }", "function newBid(serverBid, creativeBid, bidderRequest) {\n var bid = {\n requestId: serverBid.slotId,\n creativeId: creativeBid.adId,\n network: serverBid.network,\n adType: creativeBid.creativeDetails.type,\n dealId: 99999999,\n currency: 'USD',\n netRevenue: true,\n ttl: 300\n };\n\n if (creativeBid.creativeDetails.type === 'VAST') {\n _extends(bid, {\n width: creativeBid.width,\n height: creativeBid.height,\n vastXml: creativeBid.creativeDetails.adContent,\n cpm: parseInt(creativeBid.cpm) * 0.65 / 1000000,\n ttl: 3600\n });\n\n var rendererOptions = __WEBPACK_IMPORTED_MODULE_0__src_utils__[\"deepAccess\"](bidderRequest, 'renderer.options');\n var rendererUrl = __WEBPACK_IMPORTED_MODULE_0__src_utils__[\"getTopWindowLocation\"]().protocol === 'http:' ? 'http://c14.zedo.com/gecko/beta/fmpbgt.min.js' : 'https://ss3.zedo.com/gecko/beta/fmpbgt.min.js';\n\n _extends(bid, {\n adResponse: serverBid,\n renderer: getRenderer(bid.adUnitCode, serverBid.slotId, rendererUrl, rendererOptions)\n });\n } else {\n _extends(bid, {\n width: creativeBid.width,\n height: creativeBid.height,\n cpm: parseInt(creativeBid.cpm) * 0.6 / 1000000,\n ad: creativeBid.creativeDetails.adContent\n });\n }\n\n return bid;\n}", "_createPlayer() {\n this.adContainer = document.createElement('div');\n this.adContainer.id = this.options.prefix + 'advertisement';\n this.adContainer.style.display = 'none';\n this.adContainer.style.position = 'relative';\n this.adContainer.style.height = '0';\n this.adContainer.style.margin = '0';\n this.adContainer.style.padding = '0';\n this.adContainer.style.opacity = '0';\n this.adContainer.style.overflow = 'hidden';\n this.adContainer.style.backgroundColor = '#000';\n this.adContainer.style.borderRadius = '2px';\n this.adContainer.style.transition = `\n padding ${this.containerTransitionSpeed}ms cubic-bezier(0.55, 0, 0.1, 1),\n opacity ${this.containerTransitionSpeed / 2}ms cubic-bezier(0.55, 0, 0.1, 1)\n `;\n\n // This is the container where the actual ad will be embedded in.\n this.adContainerInner = document.createElement('div');\n this.adContainerInner.id = this.options.prefix + 'advertisement_slot';\n this.adContainerInner.style.position = 'absolute';\n this.adContainerInner.style.top = '0';\n this.adContainerInner.style.right = '0';\n this.adContainerInner.style.bottom = '0';\n this.adContainerInner.style.left = '0';\n this.adContainerInner.style.backgroundColor = '#000';\n this.adContainerInner.style.borderRadius = '2px';\n\n this.adContainer.appendChild(this.adContainerInner);\n this.container.appendChild(this.adContainer);\n }", "function renderBanner(data){\n new BannerView({\n model: data\n });\n}", "constructor(data) {\n this._id = data._id\n this.imgUrl = data.imgUrl\n this.price = data.price\n this.year = data.year\n this.levels = data.levels\n this.bedrooms = data.bedrooms\n this.bathrooms = data.bathrooms\n this.description = data.description\n }", "function advert(adRefNum, adName, adCampaign, adURL, adWidth, adHeight, adWeight)\n{\n}", "function Asset(id, src) {\n this.id = id;\n this.src = src;\n }", "function Opportunity(obj) {\n\tthis.extractedInfo = obj;\n}", "function parse_custom_aid( record ) {\n let data = record.match(custom_aid_re);\n return {\n \"custom_aid_id\": data[1] ,\n \"class\" : data[2] ,\n \"name\" : parse_free_text(data[3]),\n };\n }", "function Item(code, title, price, desc, cat, rating, image ){\n this.code= code;\n this.title = title;\n this.price = price;\n this.description = desc;\n this.category = cat;\n this.rating = rating;\n this.image = image;\n this.user = \"Oliver\";\n\n}", "function CardConstructor (title, description, img, likes){\n\tthis.title = title;\n\tthis.description = description;\n\tthis.img = img;\n\tthis.likes = likes;\n}", "function Goat(goatName, goatAge, goatLocation, serviceNeeded, contact, src) {\n this.goatName = goatName;\n this.goatAge = goatAge;\n this.goatLocation = goatLocation;\n this.serviceNeeded = serviceNeeded;\n this.contact = contact;\n this.goatImage = src;\n}", "function createItem(name,img,shortDescription,price,longDescription){\n this.name=name;\n this.img=img;\n this.shortDescription=shortDescription;\n this.price=price;\n this.longDescription=longDescription;\n}", "function Advertiser(accessoryInfo) {\n this.accessoryInfo = accessoryInfo;\n this._advertisement = null;\n}", "static createFromJson(jsonObj)\n\t{\n\t\treturn new PublicationCard(jsonObj[\"name\"],\n\t\tjsonObj[\"description\"],\n\t\tActionButton.createListFromJson(jsonObj[\"fileLinks\"]),\n\t\tjsonObj[\"authors\"],\n\t\tjsonObj[\"year\"],\n\t\tjsonObj[\"topic\"],\n\t\tjsonObj[\"type\"],\n\t\tjsonObj[\"publisher\"],\n\t\tjsonObj[\"publicationStatus\"]);\n\t}", "function Item(code, title, category, price, image){\r\n this.code = code;\r\n this.title = title;\r\n this.category = category;\r\n this.price = price;\r\n this.image = image;\r\n this.user = \"Brit\";\r\n\r\n}", "function Item(type, name, durability, src){\n\tthis.type = type;\n\tthis.name = name;\n\tthis.durability = durability;\n\tthis.maxDurability = durability;\n\tthis.damageLevel = 0;\n\tthis.src = src\n\tthis.disabled = false;\n}", "function Description(obj) { this.obj = obj; }", "assetID(id) {\n this.query['asset-id'] = id;\n return this;\n }", "function setupDom() {\n creative.dom = {};\n creative.dom.mainContainer = document.getElementById('main-container');\n creative.dom.exit = document.getElementById('exit');\n creative.dom.iphone = document.getElementById('iphone');\n creative.dom.photoStory = document.getElementById('photo-story');\n creative.dom.fanfold = document.getElementById('fanfold');\n creative.dom.fanfoldPages = document.getElementById('fanfold-pages');\n \n creative.dom.texture0 = document.getElementById('texture-bg-img-0');\n creative.dom.greyOverlay0 = document.getElementById(\"grey-overlay\");\n creative.dom.quotes0 = document.getElementById(\"quotes\");\n creative.dom.endQuote0 = document.getElementById(\"end-quote\");\n creative.dom.endImg0 = document.getElementById(\"end-img-0\");\n\n creative.dom.imageFly0 = document.getElementById(\"photo-story-img-4\");\n creative.dom.imageFly1 = document.getElementById(\"photo-story-img-5\");\n creative.dom.imageFly2 = document.getElementById(\"photo-story-img-6\");\n creative.dom.imageFly3 = document.getElementById(\"photo-story-img-7\");\n\n creative.dom.dropImg0 = document.getElementById(\"fanfold-drop-img-0\");\n creative.dom.dropImg1 = document.getElementById(\"fanfold-drop-img-1\");\n creative.dom.dropImg2 = document.getElementById(\"fanfold-drop-img-2\");\n creative.dom.dropImg3 = document.getElementById(\"fanfold-drop-img-3\");\n\n creative.dom.photoStoryQuote0 = document.getElementById('photo-story-quote-0');\n}", "function createCard(title, text, link, image = \"\", position = \"left\") {\n\tlet card = new Card(title, text, link, image, position);\n\tcard.add();\n\treturn card;\n}", "function Item(code, desc, price, image, category, stock, deliveryDays){\r\n this.code = code;\r\n this.description = desc;\r\n this.price = price;\r\n this.image = image;\r\n this.category = category;\r\n this.stock = stock;\r\n this.deliveryDays = deliveryDays;\r\n this.user = \"Leo\"; \r\n}", "function Get_Intent_Card(){\n\tvar div = document.createElement(\"div\");\n \tdiv.id =\"GeneralIntentCard\";\n\tvar divHtml = \"<div class='card col-md-12 text-center'><div class='header'><h4 class='title'><strong>Intent ID :</strong>\"+MIntents.Intent_ID+\"</h4></div><div class='row'><div class='col-md-12'><div class='row'><div class='col-md-10 text-center'><div class='form-group'><label><strong>Pregunta General: </strong></label><input type='text' class='form-control' placeholder='Insertar pregunta general' value='\"+MIntents.General_Question+\"' id='generalquestion' name='GeneralQuestion' required></div></div></div><div id='Variations'></div><div id='Tags'></div></div></div></div>\";\n \tdocument.getElementById(\"Intents_Collection\").appendChild(div).outerHTML = divHtml;\n \t// llamada a las funciones de crear tag y variantes\n \tGet_Tags();\n \tGet_Variations();\n}", "function handleCreativeChanged(cxt) {\n if (currObj) {\n console.log('handleCreativeChanged (currObj valid, ' + cxt + \", ad_type=\" + currObj.infoWindow.ad_type);\n if (currObj.infoWindow.ad_type != 1)\n return;\n }\n else {\n console.log('handleCreativeChanged (currObj NULL, ' + cxt);\n return;\n }\n currObj.infoWindow.ad_subtype = parseInt($(\"#hse_bannersubtypeCombo\" ).val());\n console.log(' banner subtype=' + currObj.infoWindow.ad_subtype);\n\n //var img = $( \"#\" + getCreativesTabPrefix() + \"previewImage\"); \n var img = $(\"#hse_previewImage\");\n var elmnt = img[0];\n var ar = 1.5;\n if (elmnt && elmnt.naturalWidth > 0 && elmnt.naturalHeight > 0)\n ar = elmnt.naturalWidth/elmnt.naturalHeight;\n if (!currObj.keeprect) {\n //the rect info for banner positioning must have been from the database\n //just use it then\n editHSObjPresetPositioningRect(ar);\n }\n editHSObjDrawPositioningRect(img.attr('src'), ar);\n currObj.keeprect = false;\n}", "function descriptionAvenger(name, description, city){\r\n\tthis.name = name;\r\n\tthis.description = description;\r\n\tthis.city = city;\r\n}", "function AuctionData(element)\n{\n // store the html element holding this auction data (should be jquery set)\n this.element = element;\n}", "function removeCurrentCreative(creative){\n\t\t var index =$scope.creatives.indexOf(creative); \n\t\t $scope.creatives.splice(index,1);\n\t}", "toObj() {\n var obj = {\n \"image\": this.image,\n \"link\": this.link,\n \"description\": this.description\n };\n \n return obj;\n }", "function HSWrapper(frame, hsobj0) {\n var hsobj = hsobj0;\n var adtype = hsobj.ad_type;\n var ClickHandler;\n\n var endtime = hsobj.start + hsobj.duration;\n this.intro = (hsobj.intro ? hsobj.intro : \"\"); //this is just for demo\n this.end = endtime;\n this.start = frame;\n this.id = hsobj0.id;\n this.hsobj = hsobj;\n var that = this;\n\n\n if (hsobj.creativeInfo) {\n //useful redundancy\n hsobj.creativeInfo.id = hsobj.id;\n }\n\n if (adtype == 'banner') { \n //After all the changes of ideas, looks like now only have redirect!\n //No more infoCard as level-2 object for banner!\n ClickHandler = (true || hsobj.l2_type == 'redirect') ? \n function () { \n player.doPause(); \n //Acc to DB: clicking on the banner etc will not open the thing\n //in editor. So commenting htis out.\n //notifyHSEMaybe('adClicked', hsobj);\n _openURL(hsobj.creativeInfo.url);\n } :\n function () { \n //notifyHSEMaybe('adClicked', hsobj);\n _infoCardModal.showModal(hsobj.creativeInfo); \n };\n this.createOverlay = function(container) {\n return new Banner( hsobj.id, endtime, hsobj, ClickHandler, container );\n }\n }\n else if (adtype == 'hotspot-legacy') { \n hsobj.creativeInfo.thumbnail_url = relResourcePath + \"ad_indicator.png\"; \n ClickHandler = \n function () { \n //notifyHSEMaybe('adClicked', hsobj);\n _hotspotModal.showModal(hsobj.creativeInfo); \n }; \n this.createOverlay = function(container) {\n return new Hotspot( hsobj.id, endtime, hsobj, ClickHandler, container );\n }\n }\n else if (adtype == 'hotspot') { \n if (!hsobj.creativeInfo.thumbnail_url) \n hsobj.creativeInfo.thumbnail_url = relResourcePath + \"small_qmark.png\";\n\n ClickHandler = \n function () { \n _infoCardModal.showModal(hsobj.creativeInfo); \n //notifyHSEMaybe('adClicked', hsobj);\n };\n this.createOverlay = function(container) {\n return new Hotspot(hsobj.id, endtime, hsobj, ClickHandler, container);\n }\n }\n /***\n Management decided not to include these features for now.\n else if (adtype == 'leaderboard') { \n ClickHandler = hsobj.l2_type == 'redirect' ? \n function () { player.doPause(); _openURL(hsobj.creativeInfo.url);\n notifyHSEMaybe('adClicked', hsobj);\n } :\n function () { _infoCardModal.showModal(hsobj.creativeInfo); \n notifyHSEMaybe('adClicked', hsobj);\n };\n this.createOverlay = function(container) {\n return new Leaderboard(hsobj.id, endtime, hsobj.creativeInfo, ClickHandler, container);\n }\n }\n else if (hsobj.ad_type == 'adtag') { \n this.createOverlay = function(container) {\n _adNetwkOverlay.settag(endtime, hsobj.url);\n return _adNetwkOverlay;\n }\n }***/\n \n}", "function myCreativeInit () {\n\n // Code away!!!\n}", "function buildAds(){\n\t jQuery(\".gallery-ad\").attr(\"id\",\"GalleryAd\");\n\t\t jQuery(\".gallery-ad img\").hide();\n\t overlayAd(\"GalleryAd\", __GEEK.currentAds[1].adUnit, __GEEK.currentAds[1].adZdid);\n\t\t refreshAd();\n}", "_createPart(){return new AttributePart(this)}", "_createPart(){return new AttributePart(this)}", "function cloneAssetCategory(catName) {\n let temp = document.getElementById(\"temp_asset_cat\");\n let clone = document.importNode(temp.content, true);\n catTitle = clone.querySelector('h3')\n catTitle.innerHTML = catName\n catTitle.addEventListener('click', e => {\n console.log(e.target.childNodes)\n })\n catContainer = clone.querySelector('div')\n catContainer.id = `ac_${catName}`\n if(catName == \"Texture\") {\n catContainer.dataset.atype = 'texture'\n } else {\n catContainer.dataset.atype = 'stamp'\n } \n return clone\n }", "function Item(){\n\t\n\tthis.type = '';\n\tthis.id;\n\tthis.opinions = Array();\n\tthis.setTrustPercent = function(val){\n\t\tif(val != null)\n\t\tthis.trust = val;\n\t\telse\n\t\tthis.trust = 0;\n\t}\n\t\n\tthis.setReviewScore = function(val){\n\t\tif(val != null)\n\t\tthis.reviewScore = val;\n\t\telse\n\t\tthis.reviewScore = 0;\n\t}\n\t\n\tthis.Meta = function (name,category,location,image){\n\t\tif(name != null)\n\t\tthis.name = name;\n\t\telse\n\t\tthis.name = '';\n\t\t\n\t\tif(category != null)\n\t\tthis.category = category;\n\t\telse\n\t\tthis.category = '';\n\t\t\n\t\tif(location != null){\n\t\t\tthis.lat = location['lat'];\n\t\t\tthis.lon = location['lon'];\t\n\t\t}\n\t\n\t\tif(image != null)\n\t\tthis.image = image;\n\t\telse\n\t\tthis.image = this.type+ imgType;\n\t\t\n\t}\n\t\n\t\n\tfunction MakeOpinion(author,image,rating,opinion){\n\t\t\n\t\tif(author != null)\n\t\tthis.author = author;\n\t\t\n\t\tif(image != null)\n\t\tthis.image = image;\n\t\telse\n\t\tthis.image = 'noImage.jpg';\n\t\t\n\t\tif(rating != null)\n\t\tthis.rating = rating;\n\t\t\n\t\tif(opinion != null)\n\t\tthis.opinion = opinion;\n\t\t\n\t\treturn this;\n\t}\n\t\n\tthis.setMeta = function(val){\n\t\tif(val != null)\n\t\tthis.Meta(val['name'],val['category'],val['location'],val['image']);\n\t}\n\t\t\n\tthis.setOpinions = function (val,count){\n\t\t/* Set Opinions*/\n\t\tfor(var i = 0 ; i < val.length ; i++){\n\t\t\tthis.opinions.push( new MakeOpinion(val[i]['author'],val[i]['image'],val[i]['rating'],val[i]['opinion']));\n\t\t}\n\t\tconsole.log(this.opinions);\n\t}\n\t\n\tthis.setOpinion = function(val){\n\t\tif(val != null){\n\t\t\tthis.opinionCount = val['count']; \n\t\t\tif(val['list'] != null){\n\t\t\t\t//this.setOpinions(val['list'],this.opinionCount);\n\t\t\t\tlist = val['list']\n\t\t\t\tthis.opinions = Array();\n\t\t\t\tfor(var i = 0 ; i < list.length ; i++){\n\t\t\t\t\tthis.opinions[i] = new MakeOpinion(list[i]['author'],list[i]['image'],list[i]['rating'],list[i]['opinion']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} \n\t\n\tthis.print = function(i){\n\t\t\n\t\t\n\t\theader = $('<h2>').html(this.name);\n\t\timg = $('<img>').attr('src',this.image).addClass('img');\n\t\timg.attr('draggable','false');\n\t\tdiv = $('<div>').addClass('item').attr('itemId',this.id).append(img).append(header);\n\t\t\n\t\tn = this.trust;\n\t\tconsole.log(n);\n\t\tg=Math.round((255*n)/100)\n\t\tr=Math.round((255*(100-n))/100); \n\t\tb=0\n\t\tcolor = rgbToHex(r,g,b);\n\t\tconsole.log(color);\n\t\t//if(this.trust > 90){\n\t\t\tdiv.append($('<div>').addClass('star').attr('title',\"Trust: \" + this.trust).css('background-color',color));\n\t\t//}\n\t\t\n\t\tif(this.lat != null && this.lon != null){\n\t\t\tdiv.attr('lat',this.lat).attr('lon',this.lon);\n\t\t\tlat = this.lat;\n\t\t\tlon = this.lon\n\t\t\tdiv.append($('<div>').addClass('map').attr('title','Location on Map').click(function (e){\n\t\t\t\te.stopPropagation();\n\t\t\t\tfetchMap(lat,lon,this);\n\t\t\t})); //attr('onClick','fetchMap(this)')\n\t\t}\n\t\t\n\t\tif(this.reviewScore != null){\n\t\t\tprogress = $('<progress>');\n\t\t\tprogress.attr('value',this.reviewScore);\n\t\t\tprogress.attr('max',100);\n\t\t\tprogress.attr('class','progBar');\n\t\t\tprogress.attr('title',\"Review Score: \" + this.reviewScore);\n\t\t\tdiv.append(progress);\n\t\t\t//div.append($('<progress>') value=\"' + (this.reviewScore) +'\" max=\"100\" id=\"progBar\">').html);\n\t\t}\n\t\t\n\t\tif(this.opinions.length > 0){\n\t\t\topinionsDiv = $('<div>').addClass('opinion').css('display','none');\n\t\t\topinionsDiv.append($('<h1>').html('Reviews').addClass('review'));\n\t\t\tfor(o = 0;o < this.opinions.length;o++){\n\t\t\t\timg = $('<img>');\n\t\t\t\timg.attr('src',this.opinions[o].image);\n\t\t\t\timg.attr('width','32px');\n\t\t\t\timg.css('width','32px');\n\t\t\t\timg.css('margin-left','4px');\n\t\t\t\tif(o > 0)\n\t\t\t\topinionsDiv.append($('<hr>'));\n\n\t\t\t\tleft = $('<div>').append(img).css({'float':'left','width':'32px'});\n\t\t\t\tright = $('<div>').append($('<h3>').html(this.opinions[o].author)).addClass('author');\n\t\t\t\tright.append(this.opinions[o].opinion);\n\t\t\t\tmainDiv = $('<div>').append(left);\n\t\t\t\tmainDiv.append(right);\n\t\t\t\topinionsDiv.append(\n\t\t\t\t\tmainDiv\n\t\t\t\t\t/*$('<p>').append(\n\t\t\t\t\t\timg\n\t\t\t\t\t).append(this.opinions[o].opinion)*/\n\t\t\t\t);\n\t\t\t\t\n\t\t\t}\n\t\t\tdiv.append(opinionsDiv);\n\t\t}else{\n\t\t\tdiv.append($('<div>').addClass('opinion').css('display','none'));\n\t\t}\n\t\t\n\t\tdiv.click(function (e){\n\t\t\tmoveMe(this,true);\n\t\t\te.stopPropagation();\n\t\t});\n\t\t\n\t\tdiv.attr('ondragstart','drag(event)');\n\t\tdiv.attr('draggable','true');\n\t\treturn div;\n\t}\n}", "function _getCreativeGroupMarkup(crg){\n var markup;\n // if creativeGroup is Native, just return URL, otherwise render whole tag\n if (crg.type === 'native'){\n markup = url.format({ crgid: crg.id, type: 'native'}, true);\n } else {\n markup = tag.render(crg);\n }\n return markup;\n }", "get graphic() { return this._graphic; }", "function AdoptedMicroformat(id,name,microformatsManager) {\n\tthis.id = id;\n\tthis.name = name;\n\tthis.type = 'adopted';\n this.microformatGroups = [];\n\tthis.microformatsManager = microformatsManager;\n\tthis.pluginContext = microformatsManager.getPluginContext();\n this.webPageDomContext = microformatsManager.getWebPageDomContext();\n this.webPageJsContext = microformatsManager.getWebPageJsContext();\n this.interfaceTool = microformatsManager.getInterfaceTool();\n\tthis.utilityTool = microformatsManager.getUtilityTool();\n}", "function displayAdjs() {\n // Select all of them in the array\n for (let i = 0; i < images[currentImage].adjectives.length; i++) {\n // Create divs for them\n let $adjContainer = $('<div class=\"adjs\"></div>');\n // Put them in the container\n $adjContainer.appendTo(\".adjPool\");\n // Apply the text\n $adjContainer.text(images[currentImage].adjectives[i]);\n }\n}", "function item (name, consumable, type, armor, potion){\n this.name = name;\n this.consumable = consumable;\n this.type = type;\n this.armor = armor;\n this.potion = potion;\n}", "_createPart(){return new AttributePart(this);}", "function createAssets(config) {\n if(!config.type) {\n console.error(\"You have to specify a type of element to create.\");\n return 0;\n }\n // merge config with assetProps\n var assetProps = {\n \"type\": config[\"type\"],\n \"asset-type\": config[\"asset-type\"],\n \"editable\": config.editable,\n \"id\": config.id || \"asset\" + Math.floor(Math.random() * 1000),\n \"left\": config.left || Math.floor(Math.random() * 500),\n \"top\": config.top || Math.floor(Math.random() * 200),\n \"class\": config.class || \"asset \" + config[\"asset-type\"],\n \"text\": config.text || \"\"\n };\n\n // create the asset with assigned properties\n var asset = $(\"<div>\", {\n id: assetProps['id'],\n class: assetProps['class'],\n \"data-type\": assetProps['type'],\n \"data-asset-type\": assetProps['asset-type'],\n \"data-editable\": assetProps['editable']\n }).offset({\n \"left\": assetProps['left'],\n \"top\": assetProps['top']\n });\n\n var action_btns = $(\"<div>\", {\n class: \"btn_action_container\",\n }).hide();\n\n var btn_close = $(\"<div>\", {\n class: \"btn_close btn_action\"\n }).on(\"click\", function() {\n var asset = $(this).closest(\".asset\");\n asset.remove();\n ComicCache.remove(asset.attr(\"id\"));\n }).appendTo(action_btns);\n\n if(config.editable) {\n assetProps['editable'] = true;\n asset.append($(\"<p>\")\n .on(\"blur\", function() {\n // update the cache with the content\n var currAssetID = $(this).closest(\".asset\").attr(\"id\");\n var currAssetProp = ComicCache.get(currAssetID);\n currAssetProp.text = $(this).text();\n ComicCache.update(currAssetID, currAssetProp);\n })\n .text(assetProps[\"text\"])\n .attr(\"contenteditable\", \"true\")\n .addClass(\"asset_txt\"));\n var btn_edit = $(\"<div>\", {\n class: \"btn_edit btn_action\"\n }).appendTo(action_btns);\n }\n\n asset.append(action_btns);\n asset.appendTo($(\"section#content\"));\n asset.draggable({\n containment: \"section#content\",\n scroll: false,\n stop: function(evt) {\n // update cache\n var currElem = $(this);\n var updatedAssetProps = {\n \"id\": currElem.attr('id'),\n \"left\": currElem.offset()['left'],\n \"top\": currElem.offset()['top'],\n \"class\": currElem.attr('class'),\n \"type\": currElem.data('type'),\n \"asset-type\": currElem.data('asset-type'),\n \"editable\": (currElem.data('editable')) ? true : false,\n \"text\": currElem.text()\n };\n // update cache after element is moved around\n ComicCache.update(currElem.attr(\"id\"), updatedAssetProps);\n }\n });\n asset.hover(function() {\n action_btns.toggle();\n });\n\n // update cache after element is loaded\n ComicCache.update(assetProps.id, assetProps);\n }", "function cardData(b) {\n var card = b.parentElement.parentElement.parentElement;\n\n return {\n card: card,\n id: card['id'],\n img: card.children[0].children[0].currentSrc,\n productUrl: card.children[0].href,\n title: card.children[0].children[1].children[0].innerHTML,\n subtitle: card.children[0].children[1].children[1].innerHTML,\n description: card.children[0].children[2].children[0].innerHTML,\n oldCard: card.innerHTML\n };\n}", "function componentCreditTag () {\n\n /* Default Properties */\n var text = \"d3-ez.net\";\n var href = \"http://d3-ez.net\";\n\n /**\n * Constructor\n *\n * @constructor\n * @alias creditTag\n * @param {d3.selection} selection - The chart holder D3 selection.\n */\n function my(selection) {\n var creditTag = selection.selectAll(\"#creditTag\").data([0]).enter().append(\"g\").attr(\"id\", \"creditTag\");\n\n var creditText = creditTag.append(\"text\").text(text).style(\"text-anchor\", \"end\").attr(\"baseline\", \"middle\").attr(\"xlink:href\", href).on(\"click\", function () {\n window.open(href);\n });\n }\n\n /**\n * Text Getter / Setter\n *\n * @param {string} _v - Credit tag text.\n * @returns {*}\n */\n my.text = function (_v) {\n if (!arguments.length) return text;\n text = _v;\n return this;\n };\n\n /**\n * Link Getter / Setter\n *\n * @param {string} _v - Credit tag link.\n * @returns {*}\n */\n my.href = function (_v) {\n if (!arguments.length) return href;\n href = _v;\n return this;\n };\n\n return my;\n }", "function Card() {\n this.element = $(\"<div class='card'></div>\")[0];\n }", "transmogrifyFrom( asset ){\n\n\t\tif( !(asset instanceof Asset) )\n\t\t\tthrow 'Invalid asset passed to transmog';\n\n\t\t\n\t\tthis.icon = asset.icon;\n\t\tthis.name = asset.name;\n\t\tthis.shortname = asset.shortname;\n\t\tthis.snpre = asset.snpre;\n\t\tthis.description = asset.description;\n\t\tthis.tags = asset.tags.slice();\t\t\t\t\t// Prefixed with AS_, use getTags\n\t\tthis.colorable = asset.colorable;\t\t\t// Can be recolored (Todo)\n\t\tthis.color_tag = asset.color_tag;\n\t\tthis.color_tag_base = asset.color_tag_base;\t\t// Base color name\n\t\tthis.color = asset.color;\t\t// Currently dyed color\n\t\tthis.color_base = asset.color_base;\t\t// Base color of the item\n\t\tthis.hit_sound = asset.hit_sound;\t\t\t// Hit sound from punch etc attacks. You can use commas to pick one at random\n\t\tthis.loot_sound = asset.loot_sound;\t\t\t\t// Also equip and unequip sound. audioKit ID\n\t\tthis._icon = null;\n\n\t}", "function Comic(name,description,rate,image,genre,edition,characters,lend,videos, news,position,load){\n\tthis.Name=name;\n\tthis.Description=description;\n\tthis.Rate=rate;\n\tthis.Image=image;\n\tthis.Genre=genre;\n\tthis.Edition=edition;\n\tthis.Characters=characters;\n\tthis.Lend= lend;\n\tthis.Videos= videos;\n\tthis.News=news;\n\tthis.Position= position;\n\tthis.paint= function(){\n\t\tpaintComic(this);\n\t};\n\tif(load){\n\t\tthis.paint();\n\t}\n\treturn this;\n}", "function generateRecepieCard(recepie) {\n \n var divCard0i = $(\"<div>\");\n divCard0i.addClass(\"media searchresults\");\n var img0i = $(\"<img>\");\n //img0i.add\n img0i.attr(\"src\", recepie.image);\n img0i.addClass(\"align-self-start mr-3 recipeimage\");\n img0i.attr(\"imgId\", recepie.id);\n divCard0i.append(img0i);\n\n var divMedia0i = $(\"<div>\");\n divMedia0i.addClass(\"media-body\");\n var h5RecepieTitle0i = $(\"<h5>\");\n h5RecepieTitle0i.addClass(\"mt-0\");\n h5RecepieTitle0i.attr(\"id\", \"recipetitle3\");\n h5RecepieTitle0i.text(recepie.title);\n divMedia0i.append(h5RecepieTitle0i);\n\n var para0i = $(\"<p>\");\n var ingredients = recepie.usedIngredients[0].original;\n para0i.text(ingredients);\n divMedia0i.append(para0i);\n\n var aTag0i = $(\"<a>\");\n aTag0i.attr(\"href\", \"./viewrecepiepage.html?recepie-id=\"+recepie.id);\n aTag0i.attr(\"recepie-id\", recepie.id);\n\n var spanOfATag0i = $(\"<span>\");\n spanOfATag0i.addClass(\"divlink\");\n aTag0i.append(spanOfATag0i);\n divMedia0i.append(aTag0i);\n\n divCard0i.append(divMedia0i);\n return divCard0i;\n}", "get adverseEventAttribution() {\n return this._adverseEvent.adverseEventAttribution;\n }", "function Asset(name, imgPath) {\n this.name = name;\n this.imgPath = imgPath;\n this.votes = 0;\n this.timesShown = 0;\n\n // you might not see this in production code depending on where you work but it is a handy way of getting every goat into the allGoat array every time you make one\n Asset.allAssets.push(this)\n}", "function populateCard(ideaCard) {\n\tvar newTitle = ideaCard.title;\n\tvar newIdea = ideaCard.idea;\n\tvar newId = ideaCard.id;\n\tvar newQuality = ideaCard.qualityString();\n\treturn (`<article data-id=\"${newId}\" class=\"idea-card\"> \n\t\t\t\t<div class=\"h2-wrapper\">\n\t\t\t\t\t<h2 class=\"idea-title\">${newTitle}</h2>\n\t\t\t\t\t<button class=\"delete-button\">\n\t\t\t\t\t\t<div class=\"delete-front\">\n\t\t\t\t\t\t\t<img src=\"assets/delete.svg\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t\t<p class=\"idea-body\">${newIdea}</p>\n\t\t\t\t<div class=\"quality-wrapper\">\n\t\t\t\t\t<button class=\"upvote-button\">\n\t\t\t\t\t\t<div class=\"upvote-front\">\n\t\t\t\t\t\t\t<img src=\"assets/upvote.svg\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</button>\n\t\t\t\t\t<button class=\"downvote-button\">\n\t\t\t\t\t\t<div class=\"downvote-front\">\n\t\t\t\t\t\t\t<img src=\"assets/downvote.svg\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</button>\n\t\t\t\t\t<h5 class=\"quality\">quality: <span data-quality=\"${ideaCard.quality}\" class=\"quality-span\">${newQuality}</span></h5>\n\t\t\t\t</div>\n\t\t\t\t<hr>\n\t\t\t</article>`);\n}", "function createBid(response, bidRequests) {\n if (!response || (!response.Ad && !response.Native && !response.Vast)) {\n return;\n }\n\n const request = bidRequests && bidRequests[response.BidID];\n\n // In case we don't retreive the size from the adserver, use the given one.\n if (request) {\n if (!response.Width || response.Width === '0') {\n response.Width = request.Width;\n }\n\n if (!response.Height || response.Height === '0') {\n response.Height = request.Height;\n }\n }\n\n const bid = {\n requestId: response.BidID,\n ttl: 3600,\n creativeId: response.CreativeID,\n cpm: response.Price,\n netRevenue: true,\n currency: CURRENCY,\n meta: response.Meta || { advertiserDomains: [] }\n };\n\n // retreive video response if present\n const vast64 = response.Vast;\n if (vast64) {\n bid.width = response.Width;\n bid.height = response.Height;\n bid.vastXml = window.atob(vast64);\n bid.mediaType = 'video';\n } else if (request.Native) {\n // format Native response if Native was requested\n bid.native = getNativeAssets(response, request.Native);\n bid.mediaType = 'native';\n } else {\n bid.width = response.Width;\n bid.height = response.Height;\n bid.ad = response.Ad;\n }\n\n return bid;\n}", "function VMAPAdSource(xml) {\n\t var i = void 0;\n\t var len = void 0;\n\t var node = void 0;\n\t this.id = xml.getAttribute('id');\n\t this.allowMultipleAds = xml.getAttribute('allowMultipleAds');\n\t this.followRedirects = xml.getAttribute('followRedirects');\n\t this.vastAdData = null;\n\t this.adTagURI = null;\n\t this.customData = null;\n\t var ref = xml.childNodes;\n\t for (i = 0, len = ref.length; i < len; i += 1) {\n\t node = ref[i];\n\t switch (node.localName) {\n\t case 'AdTagURI':\n\t this.adTagURI = {\n\t templateType: node.getAttribute('templateType'),\n\t uri: (node.textContent || node.text || '').trim()\n\t };\n\t break;\n\t case 'VASTAdData':\n\t this.vastAdData = node.firstChild;\n\t while (this.vastAdData && this.vastAdData.nodeType !== 1) {\n\t this.vastAdData = this.vastAdData.nextSibling;\n\t }\n\t break;\n\t case 'CustomAdData':\n\t this.customData = node;\n\t break;\n\t default:\n\t break;\n\t }\n\t }\n\t}", "function itemObject(code, category, simpleName, fullName, desc, uses, effect, what, val) {\r\n\tthis.code = code; //code used for quickly finding in items array\r\n\tthis.category = category; //category (item, weapon, armor, potion)\r\n\tthis.simpleName = simpleName; //simple name \r\n\tthis.fullName = fullName; //full name \r\n\tthis.desc = desc; //description of item\r\n\tthis.uses = uses; //# of uses before the item is gone. on hover, check if uses == num, display certain text (full, half full, etc, nearly empty, etc)\r\n\tthis.effect = effect; //desc of effect for tooltip / item menu\r\n\tthis.what = what; //pass into function to clarify what it effects.\r\n\tthis.val = val; // \r\n}", "function Img(img) {\r\n this.image_url = img.image_url;\r\n this.title = img.title;\r\n this.description = img.description;\r\n this.keyword = img.keyword;\r\n this.horns = img.horns;\r\n}", "function getAsset(model) {\n\n var asset = {};\n\n var idField = model.getField('*.id');\n\n if (idField) {\n asset['id'] = idField.value;\n }\n\n var nameField = model.getField('overview.name');\n\n if (nameField) {\n asset['name'] = nameField.value;\n }\n\n\n // asset['lifeCycle']=model.getField('*.lifeCycle').value;\n // asset['lifeCycleState']=model.getField('*.lifeCycleState').value;\n\n return asset;\n }", "function Card() {\n return _super.call(this) || this;\n // this.skinName = CardSkin;\n }", "function newBid(serverBid, rtbBid, bidderRequest) {\n var bid = {\n requestId: serverBid.uuid,\n cpm: 0.00,\n creativeId: rtbBid.creative_id,\n dealId: 99999999,\n currency: 'USD',\n netRevenue: true,\n ttl: 300,\n appnexus: {\n buyerMemberId: rtbBid.buyer_member_id\n }\n };\n\n if (rtbBid.rtb.video) {\n _extends(bid, {\n width: rtbBid.rtb.video.player_width,\n height: rtbBid.rtb.video.player_height,\n vastUrl: rtbBid.rtb.video.asset_url,\n vastImpUrl: rtbBid.notify_url,\n ttl: 3600\n }); // This supports Outstream Video\n\n\n if (rtbBid.renderer_url) {\n var rendererOptions = __WEBPACK_IMPORTED_MODULE_1__src_utils__[\"deepAccess\"](bidderRequest.bids[0], 'renderer.options');\n\n _extends(bid, {\n adResponse: serverBid,\n renderer: newRenderer(bid.adUnitCode, rtbBid, rendererOptions)\n });\n\n bid.adResponse.ad = bid.adResponse.ads[0];\n bid.adResponse.ad.video = bid.adResponse.ad.rtb.video;\n }\n } else if (rtbBid.rtb[__WEBPACK_IMPORTED_MODULE_3__src_mediaTypes__[\"c\" /* NATIVE */]]) {\n var nativeAd = rtbBid.rtb[__WEBPACK_IMPORTED_MODULE_3__src_mediaTypes__[\"c\" /* NATIVE */]];\n bid[__WEBPACK_IMPORTED_MODULE_3__src_mediaTypes__[\"c\" /* NATIVE */]] = {\n title: nativeAd.title,\n body: nativeAd.desc,\n cta: nativeAd.ctatext,\n sponsoredBy: nativeAd.sponsored,\n clickUrl: nativeAd.link.url,\n clickTrackers: nativeAd.link.click_trackers,\n impressionTrackers: nativeAd.impression_trackers,\n javascriptTrackers: nativeAd.javascript_trackers\n };\n\n if (nativeAd.main_img) {\n bid['native'].image = {\n url: nativeAd.main_img.url,\n height: nativeAd.main_img.height,\n width: nativeAd.main_img.width\n };\n }\n\n if (nativeAd.icon) {\n bid['native'].icon = {\n url: nativeAd.icon.url,\n height: nativeAd.icon.height,\n width: nativeAd.icon.width\n };\n }\n } else {\n _extends(bid, {\n width: rtbBid.rtb.banner.width,\n height: rtbBid.rtb.banner.height,\n ad: rtbBid.rtb.banner.content\n });\n\n try {\n var url = rtbBid.rtb.trackers[0].impression_urls[0];\n var tracker = __WEBPACK_IMPORTED_MODULE_1__src_utils__[\"createTrackPixelHtml\"](url);\n bid.ad += tracker;\n } catch (error) {\n __WEBPACK_IMPORTED_MODULE_1__src_utils__[\"logError\"]('Error appending tracking pixel', error);\n }\n }\n\n return bid;\n}", "function caseCard(text, status, id, subject, blurb, labels, ts, customer, company, customerGrav, assigned) {\n if (company) {\n company = \"(\"+company+\")\"\n }\n if (!assigned) {\n assigned = \"Nobody\"\n }\n let attachement = {\n \"pretext\": status + \" case from \" + customer + \" \" + company,\n \"fallback\": status + \" case from \" + customer + \" \" + company + \"- #\" + id + \": \"+ subject,\n \"author_icon\": customerGrav,\n \"author_name\": customer + \" \" + company,\n \"title\": \"#\" + id + \": \"+ subject,\n \"title_link\": \"https://help.disqus.com/agent/case/\"+id,\n \"text\": blurb,\n \"fields\": [\n {\n \"title\": \"Assigned\",\n \"value\": assigned,\n \"short\": true\n },\n {\n \"title\": \"Labels\",\n \"value\": labels,\n \"short\": true\n }\n ],\n \"color\": \"#7CD197\",\n \"ts\": ts\n }\n return attachement\n }", "function pfCraft(){\n\tthis.inheritFrom = pfSkill;\n this.inheritFrom();\n this.setName(\"craft\");\n this.stat\t\t\t= \"int\";\n}", "function init(){\n //new main.js file edited -- 04.10.2017\n var stage = new Stage(300,600,'Test Ad'); // our 'stage' instance\n var bg = new BG(); //bg class instance\n var logo = new Square({id:'logo',image:'logo.png'});\n var outline = new Outline(); // ad 'outline' overlay -- click area\n stage.add(bg);\n var imgs = stage.generateSquares(['road','van','cta','legal'], true, 'object');\n imgs.road.visible = true;\n var frame1 = stage.generateSquares(3, true, 'array', '.png', true);\n var frame2 = stage.generateSquares([4,5,6], true, 'array', '', true);\n stage.add(logo);\n stage.add(outline);\n \n var bubble = new Bubble();\n var ctahov = new CTAhover(imgs.cta);\n // var tmp = stage.template(['tmp0000','tmp0001','tmp0002','tmp0003'], '.jpg');\n \n imgs.van.attachedImage.width = 400;\n imgs.van.visible = true;\n imgs.van.x = -140;\n imgs.van.y = 330;\n \n // show template image\n //tmp.goto(3);\n //tmp.opacity = 0.25;\n \n /* ANIMATION */\n adstage.stage.animate = function (){\n var tl = stage.tl_from(frame1);\n imgs.van.from(8, {x:-500});\n \n U.d(3, function(){\n tl = stage.tl_to(frame1);\n });\n \n U.d(4, function(){\n tl = stage.tl_from(frame2);\n });\n \n U.d(5, function(){\n function ctaPop(){\n imgs.cta.from(0.75, {scale:0, transformOrigin:U.torg(300,528), ease:Back.easeOut, onComplete:function(){\n stage.add(bubble);\n stage.add(ctahov);\n stage.end();\n }});\n }\n imgs.legal.from(1, {alpha:0, onComplete:ctaPop});\n });\n \n };\n}", "function AiBlock()\r\n{\r\n this.objectName = \"Ai\";\r\n\tthis.divHeight=16;\r\n\tthis.divWidth=120;\r\n\tthis.text=819;\r\n\tthis.rawValue=819;\r\n}", "function readCompoent(element)\r\n{\r\n var component = new Object();\r\n \r\n component.uniqueName = element.name;\r\n component.linkClassName = element.libraryItem.linkageClassName;\r\n component.posX = element.x;\r\n component.posY = element.y;\r\n component.width = element.width;\r\n component.height = element.height;\r\n component.rotation = element.rotation;\r\n component.alpha = element.colorAlphaPercent * 0.01;\r\n \r\n return component;\r\n}", "function createIngredJS(id,name,category){\n var obj = new Object();\n obj.id = id;\n obj.name = name;\n obj.category = category;\n return obj;\n }", "function cardMovieGenerator(movie) {\n const card = document.createElement(\"article\");\n card.classList.add(\"carousel-item\");\n setAttributes(card, {\n onclick: `showModal(${movie.id})`,\n \"data-id\": `${movie.id}`,\n });\n\n card.innerHTML = `\n <img class=\"carousel-item-img\" src=\"${movie.medium_cover_image}\" alt=\"Poster de ${movie.title}\" />\n <div class=\"carousel-details\">\n <div class=\"buttons-contact\">\n <a href=\"${movie.torrents[0].url}\">\n <img src=\"./src/img/icons8-play-64.png\" alt=\"Ver pelicula\" srcset=\"\">\n </a>\n <img src=\"./src/img/icons8-plus-64.png\" alt=\"Agregar\" srcset=\"\">\n </div>\n <p class=\"carousel-item-title ellipsis\">${movie.title}</p>\n <p class=\"carousel-item-subtitle\">${movie.year} ${movie.language} ${movie.runtime} min</p>\n </div>`;\n\n return card;\n}", "function createAd() {\n\n let form = $('#formCreateAd');\n\n let title = escHtml(form.find($('input[name=\"title\"]')).val());\n let description = escHtml(form.find($('textarea[name=\"description\"]')).val());\n let publisher = escHtml(storage.username());\n let datePublished = escHtml(form.find($('input[name=\"datePublished\"]')).val());\n let price = escHtml(parseFloat(form.find($('input[name=\"price\"]')).val().toString()).toFixed(2));\n let imageUrl = escHtml(form.find($('input[name=\"imageUrl\"]')).val());\n\n if (!title || !description || !publisher || !datePublished || !price) return;\n form.trigger('reset');\n\n ajax.postToCollection('ads',\n {\n title,\n description,\n publisher,\n datePublished,\n price: helper.pad(price),\n imageUrl,\n viewCount: helper.pad(0),\n }\n )\n .then(function (res) {\n listAds();\n views.showInfo('Ad created.')\n })\n .catch(ajax.handleAjaxError);\n }", "constructor(title, imagURL,price,description){\n this.title=title;\n this.imagURL=imagURL;\n this.price=price;\n this.description=description;\n }", "function AssetList(settings) {\n\tthis.settings = $.extend({}, settings);\n\tthis.container = this.settings.container;\n\tthis.assets = this.settings.assets;\n\tthis.assestContainer = this.settings.assestContainer;\n\tthis.onSelection = this.settings.onSelection;\n\tthis.onDelete = this.settings.onDelete;\n\tthis.container.find('#category').show();\n\tthis.onCompleteRender = this.settings.onCompleteRender;\n}", "function Card(title, url) {\n this.title = title;\n this.url = url;\n this.isRead = false;\n}", "function renderAmenities(doc) {\n let amanities = document.createElement('div');\n amanities.setAttribute(\"class\", \"col-md-3 preview-prices\")\n amanities.setAttribute(\"id\", doc.id);\n let amanitiesCard = document.createElement('div')\n amanitiesCard.setAttribute(\"class\", \"card d-flex align-items-center p-1\")\n let amenityTitle = document.createElement('h5');\n amenityTitle.textContent = doc.data().title\n let amanityDescription = document.createElement('p');\n amanityDescription.textContent = doc.data().description\n\n let editBtn = document.createElement('button');\n editBtn.setAttribute('class', 'btn btn-outline-primary btn-md')\n editBtn.innerHTML = 'Edit'\n\n amanitiesCard.appendChild(amenityTitle)\n amanitiesCard.appendChild(amanityDescription)\n amanitiesCard.appendChild(editBtn)\n amanities.appendChild(amanitiesCard)\n\n previewAmenity.appendChild(amanities)\n\n}" ]
[ "0.60025346", "0.5495766", "0.53622514", "0.52953815", "0.52795583", "0.52789277", "0.52789277", "0.52601653", "0.52579063", "0.52579063", "0.52127767", "0.51980555", "0.51979446", "0.5164931", "0.5115585", "0.5055893", "0.50306714", "0.5011333", "0.49710134", "0.4966907", "0.49666804", "0.49450427", "0.494398", "0.49420634", "0.49299616", "0.49222833", "0.4915355", "0.49104428", "0.49088585", "0.49073812", "0.49067038", "0.4904164", "0.48931795", "0.48689073", "0.48569903", "0.48372483", "0.48291352", "0.47860283", "0.47734585", "0.47681472", "0.47642788", "0.47628418", "0.4762679", "0.47568038", "0.47519487", "0.47513187", "0.47505248", "0.4734861", "0.47302845", "0.47251323", "0.46922186", "0.4686649", "0.46785015", "0.46780422", "0.46640757", "0.4663524", "0.4638229", "0.46321565", "0.46320102", "0.46315724", "0.46285167", "0.46263397", "0.46263397", "0.46251622", "0.46137553", "0.46019685", "0.45999852", "0.45945472", "0.45898333", "0.45859447", "0.45773047", "0.45735228", "0.45702386", "0.45668796", "0.4551255", "0.45491925", "0.45471337", "0.45385498", "0.45343035", "0.45322388", "0.45160225", "0.45128566", "0.45117322", "0.45114762", "0.45114046", "0.45048878", "0.45034233", "0.45014173", "0.44985372", "0.44949982", "0.4493438", "0.44926834", "0.44917133", "0.4488376", "0.4486403", "0.4486261", "0.4485935", "0.4482563", "0.44823647", "0.44727775" ]
0.6614021
0
Object representing an AD element in a VAST template
function VastAd(node){ var me = this; // required elements - section 2.2.4.1 this.id = node.getAttribute('id'); this.sequence = node.getAttribute('sequence'); this.impressions = []; this.creatives = []; this.creative_companions = []; // optional elements - - section 2.2.4.2 this.description = NULL; this.advertiser = NULL; this.error = NULL; this.pricing = NULL; this.extensions = NULL; function parseAd(node){ var kid = childElements(node)[0], tagName = kid.tagName.toUpperCase(); if(tagName == 'WRAPPER'){ me.isWrapper = true; me.wrapperUrl = 'http://example/org'; return; } else if(tagName == 'INLINE'){ parseInlineAd(kid); } } /** * @function * Parsing routine for the INLINE tag element and children */ function parseInlineAd(ilnode){ var i, m, n, key, kidNode, adSys, url, adname, vnum, sysname; var cr, crar, allcr; var kids = childElements(ilnode); me.isWrapper = false; me.isInline = true; for(i=0; i < kids.length; i++){ kidNode = kids[i]; switch(kidNode.tagName.toUpperCase()){ case 'ADSYSTEM': vnum = kidNode.getAttribute('version'); sysname = kidNode.innerHTML; if(vnum == null){ vnum = parseFloat(sysname); if(isNaN(vnum)){ vnum = null; } else{ sysname = null; } } adSys = { version: vnum, name: sysname } me.adSystem = new function(){ this.version = adSys.version; this.name = adSys.sysname; this.toString = function(){ var s = (this.name || 'Unknown') + ', version ' + (this.version || '0'); return s; } } break; case 'ADTITLE': adname = nodeText(kidNode); me.adName = adname; break; case 'IMPRESSION': url = nodeText(kidNode); me.impressions.push({id: kidNode.getAttribute('id'), url: url}); break; case 'CREATIVES': allcr = childElements(kidNode); for(m=0; m < allcr.length; m++){ cr = new VastCreative(allcr[m], me); if(cr.adType == COMPANION_ADS){ me.creative_companions.push(cr); } else{ me.creatives.push(cr); } } break; // Optional Inline Elements - 2.2.4.2 case 'DESCRIPTION': me.description = nodeText(kidNode); break; case 'ADVERTISER': me.advertiser = nodeText(kidNode); break; case 'SURVEY': if(me.survey === undefined){ me.survey = []; } // open for interpretation me.survey.push({ attributes: {}, content: kidNode.innerHTML }); for(m=0; m < kidNode.attributes; m++){ me.survey.attributes[kidNode.attributes.name] = kidNode.attributes.value; } break; case 'PRICING': me.pricing = { model : kidNode.getAttribute('model'), currency: kidNode.getAttribute('currency'), value: nodeText(kidNode) }; break; case 'EXTENSIONS': me.extensions = kidNode.innerHTML; break; } // TODO - SORT CREATIVES BY Sequence } } parseAd(node); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function VMAPAdSource(xml) {\n\t var i = void 0;\n\t var len = void 0;\n\t var node = void 0;\n\t this.id = xml.getAttribute('id');\n\t this.allowMultipleAds = xml.getAttribute('allowMultipleAds');\n\t this.followRedirects = xml.getAttribute('followRedirects');\n\t this.vastAdData = null;\n\t this.adTagURI = null;\n\t this.customData = null;\n\t var ref = xml.childNodes;\n\t for (i = 0, len = ref.length; i < len; i += 1) {\n\t node = ref[i];\n\t switch (node.localName) {\n\t case 'AdTagURI':\n\t this.adTagURI = {\n\t templateType: node.getAttribute('templateType'),\n\t uri: (node.textContent || node.text || '').trim()\n\t };\n\t break;\n\t case 'VASTAdData':\n\t this.vastAdData = node.firstChild;\n\t while (this.vastAdData && this.vastAdData.nodeType !== 1) {\n\t this.vastAdData = this.vastAdData.nextSibling;\n\t }\n\t break;\n\t case 'CustomAdData':\n\t this.customData = node;\n\t break;\n\t default:\n\t break;\n\t }\n\t }\n\t}", "function anonymousTemplate (element) {\n this.domElement = element;\n }", "function TemplateElement(node) {\n\t this._push(node.value.raw);\n\t}", "function TemplateElement(node) {\n\t this._push(node.value.raw);\n\t}", "function TemplateElement(node) {\n this._push(node.value.raw);\n}", "function VastDoc(xdoc){\n\t\tvar me = this;\n\t\tthis.xml = xdoc;\n\t\tthis.ads = [];\n\t\tthis.isAdPod = false;\n\t\t\n\t\tfunction parseStructure(xml){\n\t\t\tvar ads, i;\n\t\t\tvar root = xml.documentElement;\n\t\t\t// version 2.0 forward should use VAST as the root node\n\t\t\tif(root.tagName.toUpperCase() !== 'VAST'){\n\t\t\t\tthrow {message: 'Invalid VAST document'};\n\t\t\t}\n\t\t\tme.vast_version = root.getAttribute('version');\n\t\t\t\n\t\t\tads = childElements(root);\n\t\t\tfor(i=0; i < ads.length; i++){\n\t\t\t\tif(ads[i].tagName.toUpperCase() === 'AD'){\n\t\t\t\t\tme.ads.push(new VastAd(ads[i]));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(me.ads.length > 1){\n\t\t\t\tme.isAdPod = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tparseStructure(xdoc);\n\t}", "function ElementData(){}", "function htElement(fieldName, fieldValue, fieldType){\r\n\tthis.fieldName = fieldName;\r\n\tthis.fieldValue = fieldValue;\r\n\tthis.fieldType = fieldType;\r\n}", "function ElementData() {}", "function ElementData() {}", "function ElementData() {}", "function testInstantiateTemplate_nameValues() {\r\n var template = ShadowTemplates[\"MainT\"];\r\n var dictionaryContext =\r\n [{\"Main\": {\"id\":\"1234\",\r\n \"caption\":\"<b>Caption</b>\",\r\n \"src\":\"http://images/simple.jpg\"}\r\n }];\r\n var instance = template.instantiateDom(dictionaryContext, '');\r\n document.body.insertBefore(instance, document.body.childNodes[0]);\r\n var anchorElement = document.getElementById(\"anchor\");\r\n assertEquals(\"http://servlet/#id=1234\", anchorElement.href);\r\n assertEquals(\"this is the <b>Caption</b>\", anchorElement.innerHTML);\r\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n test = props.test,\n unit = props.unit;\n\n var classes = (0, _classnames2.default)('ui', unit, (0, _lib.useKeyOnly)(centered, 'centered'), (0, _lib.useKeyOnly)(test, 'test'), 'ad', className);\n var rest = (0, _lib.getUnhandledProps)(Advertisement, props);\n var ElementType = (0, _lib.getElementType)(Advertisement, props);\n\n return _react2.default.createElement(ElementType, (0, _extends3.default)({}, rest, { className: classes, 'data-text': test }), children);\n}", "parseProps(element, astElement, code, options) {\n // assign a unique `oid` to the element\n const { fragment } = options;\n if (fragment) {\n element.oid = fragment.getUniqueOid();\n fragment.oids[element.oid] = element;\n }\n return super.parseProps(element, astElement, code, options) || {};\n }", "function imprimirEdad(persona)\n{\n // var edad = persona.edad\n var { edad } = persona\n console.log(edad)\n}", "function createElm(tag, attobj) {\n const elm = document.createElement(tag);\n for (const key of Object.keys(attobj)) {\n elm[key] = attobj[key];\n }\n return elm;\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n test = props.test,\n unit = props.unit;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()('ui', unit, Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(centered, 'centered'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(test, 'test'), 'ad', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(Advertisement, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(Advertisement, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes,\n \"data-text\": test\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n test = props.test,\n unit = props.unit;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()('ui', unit, Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(centered, 'centered'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(test, 'test'), 'ad', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(Advertisement, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(Advertisement, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes,\n \"data-text\": test\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "function readCompoent(element)\r\n{\r\n var component = new Object();\r\n \r\n component.uniqueName = element.name;\r\n component.linkClassName = element.libraryItem.linkageClassName;\r\n component.posX = element.x;\r\n component.posY = element.y;\r\n component.width = element.width;\r\n component.height = element.height;\r\n component.rotation = element.rotation;\r\n component.alpha = element.colorAlphaPercent * 0.01;\r\n \r\n return component;\r\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n test = props.test,\n unit = props.unit;\n\n var classes = (0, _classnames2.default)('ui', unit, (0, _lib.useKeyOnly)(centered, 'centered'), (0, _lib.useKeyOnly)(test, 'test'), 'ad', className);\n var rest = (0, _lib.getUnhandledProps)(Advertisement, props);\n var ElementType = (0, _lib.getElementType)(Advertisement, props);\n\n return _react2.default.createElement(ElementType, (0, _extends3.default)({}, rest, { className: classes, 'data-text': test }), _lib.childrenUtils.isNil(children) ? content : children);\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n test = props.test,\n unit = props.unit;\n var classes = Object(clsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"])('ui', unit, Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(centered, 'centered'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(test, 'test'), 'ad', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(Advertisement, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(Advertisement, props);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n className: classes,\n \"data-text\": test\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n test = props.test,\n unit = props.unit;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', unit, Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(centered, 'centered'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(test, 'test'), 'ad', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getUnhandledProps */])(Advertisement, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getElementType */])(Advertisement, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes, 'data-text': test }),\n children\n );\n}", "function element(anArray){ \n this.num = anArray[0];\n this.abrev = anArray[1];\n this.name = anArray[2];\n this.displayInfo = this.abrev + \" - \" + this.name\n}", "function ElementNode(domElement){\n\t\n\tthis.id = domElement.id;\n\tthis.length = domElement.getAttribute(\"length\");\n\tthis.volume = domElement.getAttribute(\"volume\");\n\t\n\t// indicates whether note is regular, legato, staccato, or glide \n\tthis.style = domElement.getAttribute(\"type\");\n}", "function defineCandidate(d, givenElement){\n\t\tcandidate = {element: givenElement, \n\t\t\tname: d.name, \n\t\t\tparty: d.party, \n\t\t\tsegment: d.segment,\n\t\t\tdistrict: d.district,\n\t\t\tage: d.age,\n\t\t\teducation: d.education,\n\t\t\turl: d.www,\n\t\t\txCoordinate: +getXValue(d), \n\t\t\tyCoordinate: +getYValue(d)};\n\t\t\treturn candidate;\n\t}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n test = props.test,\n unit = props.unit;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', unit, Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"B\" /* useKeyOnly */])(centered, 'centered'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"B\" /* useKeyOnly */])(test, 'test'), 'ad', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(Advertisement, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(Advertisement, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes, 'data-text': test }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n test = props.test,\n unit = props.unit;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', unit, Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"B\" /* useKeyOnly */])(centered, 'centered'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"B\" /* useKeyOnly */])(test, 'test'), 'ad', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(Advertisement, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(Advertisement, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes, 'data-text': test }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n test = props.test,\n unit = props.unit;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', unit, Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"A\" /* useKeyOnly */])(centered, 'centered'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"A\" /* useKeyOnly */])(test, 'test'), 'ad', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(Advertisement, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(Advertisement, props);\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes,\n \"data-text\": test\n }), __WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* childrenUtils */].isNil(children) ? content : children);\n}", "function VMAPAdBreak(xml) {\n\t var j = void 0;\n\t var k = void 0;\n\t var len = void 0;\n\t var len1 = void 0;\n\t var node = void 0;\n\t var ref1 = void 0;\n\t var subnode = void 0;\n\t var pseudoVast = {};\n\t this.timeOffset = xml.getAttribute('timeOffset');\n\t this.breakType = xml.getAttribute('breakType');\n\t pseudoVast.breakType = this.breakType;\n\t this.breakId = xml.getAttribute('breakId');\n\t this.repeatAfter = xml.getAttribute('repeatAfter');\n\t this.adSource = null;\n\t this.trackingEvents = [];\n\t var ref = xml.childNodes;\n\t for (j = 0, len = ref.length; j < len; j += 1) {\n\t node = ref[j];\n\t switch (node.localName) {\n\t case 'AdSource':\n\t this.adSource = new VMAPAdSource(node);\n\t break;\n\t case 'TrackingEvents':\n\t ref1 = node.childNodes;\n\t for (k = 0, len1 = ref1.length; k < len1; k += 1) {\n\t subnode = ref1[k];\n\t if (subnode.localName === 'Tracking') {\n\t this.trackingEvents.push({\n\t event: subnode.getAttribute('event'),\n\t uri: (subnode.textContent || subnode.text || '').trim()\n\t });\n\t }\n\t }\n\t break;\n\t case 'Extensions':\n\t if (node.childNodes[1].tagName === 'vmap:Extension') {\n\t this.extensions = {};\n\t this.extensions.type = node.childNodes[1].getAttribute('type');\n\t this.extensions.supress_bumper = node.childNodes[1].getAttribute('suppress_bumper') === 'true';\n\t } else {\n\t this.extensions = null;\n\t }\n\t break;\n\t default:\n\t break;\n\t }\n\t }\n\t if (typeof this.extensions !== 'undefined' && this.extensions.type === 'bumper') {\n\t pseudoVast.bumper = true;\n\t }\n\t if (this.adSource.adTagURI.templateType === 'vast3' && this.adSource.adTagURI.uri) {\n\t pseudoVast.url = this.adSource.adTagURI.uri;\n\t }\n\t switch (this.timeOffset) {\n\t case 'start':\n\t {\n\t pseudoVast.time = 0;\n\t Vast.vastArray.push(pseudoVast); // eslint-disable-line no-use-before-define\n\t break;\n\t }\n\t case 'end':\n\t {\n\t pseudoVast.time = 'end';\n\t Vast.vastArray.push(pseudoVast); // eslint-disable-line no-use-before-define\n\t break;\n\t }\n\t default:\n\t {\n\t var arrTime = this.timeOffset.split(':');\n\t var msTime = 0;\n\t msTime = arrTime[0] * 60 * 60 + arrTime[1] * 60 + Math.floor(arrTime[2]);\n\t pseudoVast.time = msTime;\n\t Vast.vastArray.push(pseudoVast); // eslint-disable-line no-use-before-define\n\t break;\n\t }\n\t }\n\t}", "function testInstantiateTemplate_variable() {\r\n var dictionaryContext =\r\n [{\"image\": [{\"src\":\"http://images/complex.jpg\", \"alt\":\"ALT0\", \"width\": 20}]\r\n }];\r\n\r\n var element = document.createElement('div');\r\n element.appendChild(ShadowTemplates['imageT'].\r\n instantiateDom(dictionaryContext, ''));\r\n assertEquals(\r\n '<XBL2:TEMPLATE id=\"imageT.0\" style=\"\" template-id=\"imageT\"> ' + // NOLINT\r\n '<img id=\"image.0\" alt=\"ALT0\" xbl2:src=\"http://images/complex.jpg\" width=\"20\">' + // NOLINT\r\n ' </XBL2:TEMPLATE>',\r\n compressWhiteSpace(element.innerHTML));\r\n var imgElement = element.getElementsByTagName('img')[0];\r\n assertEquals(\"http://images/complex.jpg\", imgElement.getAttribute('xbl2:src'));\r\n assertNull(imgElement.getAttribute('src'));\r\n assertEquals(\"20\", imgElement.getAttribute('width'));\r\n assertNull(imgElement.getAttribute('xbl2:width'));\r\n}", "function ElementData() { }", "function ElementData() { }", "buildAstElement(element)\r\n {\r\n var html = '<div class=\"' + element[\"data\"][\"roleInParent\"] + '\"><span>' + element[\"data\"][\"properties\"] + '</span>'\r\n\r\n element[\"children\"].forEach(child => {\r\n html += this.buildAstElement(child);\r\n });\r\n\r\n return html + '</div>';\r\n }", "function testInstantiateTemplate_nameValueScope() {\r\n var template = ShadowTemplates[\"MainT\"];\r\n var dictionaryContext =\r\n [{\"Main\": {\"maindiv\":[{\"text\": \"Correct\"}],\r\n \"text\":\"Wrong\"}\r\n }];\r\n var instance = template.instantiateDom(dictionaryContext, '');\r\n document.body.insertBefore(instance, document.body.childNodes[0]);\r\n var maindivElement = document.getElementById(\"maindiv.0\");\r\n assertEquals(\"<b>example</b><XBL2:SPAN id=\\\"$id_1.0\\\">Correct</XBL2:SPAN>\",\r\n maindivElement.innerHTML);\r\n}", "function Advertisement(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n test = props.test,\n unit = props.unit;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', unit, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(centered, 'centered'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(test, 'test'), 'ad', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(Advertisement, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(Advertisement, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes, 'data-text': test }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "function Template (arrDOM,parentHead,vars) {\n\tDOM.apply(this,arguments);\n\tthis.mods = {\n\t\tdom: new DOM(this)\n\t\t,html: new fdom.html(this)\n\t\t,md: new fdom.md(this)\n\t\t,emmet: new fdom.emmet(this)\n\t\t,jsonml: new fdom.jsonml(this)\n\t\t,'3390': this\n\t};\n\tthis.mods.markdown = this.mods.md;\n\tthis.mods.json = this.mods.templar;\n\tthis.mods.zen = this.mods.emmet;\n\tthis.vars = vars || {};\n}", "function getElemental() {\n if (elemental) return;\n\n // Initialize the elemental\n elemental = settings.elemental(name.el, settings.elementalOptions);\n\n if (!elemental || elemental instanceof HTMLElement) {\n elemental = Storage.get(name.el, `elementals.${settings.elementalName}`);\n }\n\n if (elemental) {\n elemental.id = settings.id;\n } else {\n console.debug(`Expected instance of ${settings.elementalName} is not available.`);\n }\n }", "static createTemplateDOM() {\n DataItemComponent.templateDOM = {};\n DataItemComponent.templateDOM.root = document.createElement('tr');\n\n DataItemComponent.templateDOM.root.innerHTML = '<tr>' +\n '<td class=\"col-md-1\">{{id}}</td>' +\n '<td class=\"col-md-4\"><a class=\"lbl\">-</a></td>' +\n '<td class=\"col-md-4\"><a class=\"remove\"><span class=\"glyphicon glyphicon-remove remove\" aria-hidden=\"true\"></span></a></td>' +\n '<td class=\"col-md-6\"></td>' +\n '</tr>'\n\n DataItemComponent.templateDOM.idText = DataItemComponent.templateDOM.root.firstChild.firstChild;\n DataItemComponent.templateDOM.labelText = DataItemComponent.templateDOM.root.firstChild.nextSibling.firstChild.firstChild;\n }", "function renderAdvert(data) {\n return `\n <article data-advertid=${data.id}>\n <h2>${data.title}</h2>\n <div>${data.price}</div>\n <p>${data.description}</p>\n </article>\n `;\n}", "deserialize(el, next) {\n if (el.tagName.toLowerCase() === 'a') {\n return {\n object: 'inline',\n type: 'link',\n nodes: next(el.childNodes),\n data: {\n href: el.getAttribute('href'),\n },\n }\n }\n }", "function AdjournObj()\n{\n\tvar Adjourn = INTERFACE_CreateAdminCenterAdjourn();\n\n\t// Attributes\n\tthis.AdjournDiv = Adjourn.Center;\n\tthis.AdjournUl = Adjourn.AdjournList;\n\tthis.NoAdjourn = Adjourn.NoAdjourn;\n\tthis.AdjournVisible = false;\n\tthis.AdjournList = new Array();\n\n\tthis.add = INTERFACE_AddAdjourn;\n\tthis.remove = INTERFACE_RemoveAdjourn;\n\n\tthis.showNoAdjourn = INTERFACE_ShowNoAdjourn;\n\tthis.hideNoAdjourn = INTERFACE_HideNoAdjourn;\n\tthis.show = INTERFACE_ShowAdjournCenter;\n\tthis.hide = INTERFACE_HideAdjournCenter;\n\n}", "function hdElAccSpec() {\n this.ruleID = 'hdElAccSpec';\n}", "function Template(element) {\n this.wrapper = $(document.createElement(element));\n }", "deserialize(el, next) {\n if (el.tagName.toLowerCase() == 'a') {\n return {\n object: 'inline',\n type: 'link',\n nodes: next(el.childNodes),\n data: {\n href: el.getAttribute('href'),\n },\n }\n }\n }", "function parse_custom_aid( record ) {\n let data = record.match(custom_aid_re);\n return {\n \"custom_aid_id\": data[1] ,\n \"class\" : data[2] ,\n \"name\" : parse_free_text(data[3]),\n };\n }", "function prepareElement(element) {\n var tableTemplateElement;\n var HUDTemplateElement;\n var strHTML;\n var recordElement;\n var insertTemplateElement;\n var arrParts;\n var headerRecordElement;\n var i;\n var len;\n var arrElements;\n var arrHeaderElements;\n var tempTemplateElement;\n\n // default pk and lock\n if (!element.hasAttribute('pk')) {\n element.setAttribute('pk', 'id');\n }\n if (!element.hasAttribute('lock')) {\n element.setAttribute('lock', 'change_stamp');\n }\n\n // harvest the templates, error if problems\n tableTemplateElement = xtag.query(element, 'template[for=\"table\"]')[0];\n HUDTemplateElement = xtag.query(element, 'template[for=\"hud\"]')[0];\n insertTemplateElement = xtag.query(element, 'template[for=\"insert\"]')[0];\n\n if (\n HUDTemplateElement &&\n (\n HUDTemplateElement.innerHTML.indexOf('&gt;') > -1 ||\n HUDTemplateElement.innerHTML.indexOf('&lt;') > -1\n )\n ) {\n console.warn('GS-DATASHEET WARNING: &gt; or &lt; detected in HUD template, this can have undesired effects on doT.js. Please use gt(x,y), gte(x,y), lt(x,y), or lte(x,y) to silence this warning.');\n }\n if (\n tableTemplateElement &&\n (\n tableTemplateElement.innerHTML.indexOf('&gt;') > -1 ||\n tableTemplateElement.innerHTML.indexOf('&lt;') > -1\n )\n ) {\n console.warn('GS-DATASHEET WARNING: &gt; or &lt; detected in table template, this can have undesired effects on doT.js. Please use gt(x,y), gte(x,y), lt(x,y), or lte(x,y) to silence this warning.');\n }\n if (\n insertTemplateElement &&\n (\n insertTemplateElement.innerHTML.indexOf('&gt;') > -1 ||\n insertTemplateElement.innerHTML.indexOf('&lt;') > -1\n )\n ) {\n console.warn('GS-DATASHEET WARNING: &gt; or &lt; detected in insert template, this can have undesired effects on doT.js. Please use gt(x,y), gte(x,y), lt(x,y), or lte(x,y) to silence this warning.');\n }\n\n if (!tableTemplateElement || tableTemplateElement.nodeName !== 'TEMPLATE') {\n throw 'gs-datasheet error: No table template provided.';\n }\n\n // V----- cannot do .children on template.content\n //if (tableTemplateElement.content.children[0].nodeName !== 'TABLE') {\n // throw 'gs-datasheet error: Table is not the first element in the provided table template.';\n //}\n\n // make header template\n headerRecordElement = xtag.query(tableTemplateElement.content, 'thead tr')[0];\n if (headerRecordElement) {\n\n arrHeaderElements = xtag.query(headerRecordElement, 'td, th');\n arrElements = xtag.query(tableTemplateElement.content, 'tbody td, tbody th');\n\n headerRecordElement.setAttribute('role', 'row');\n\n i = 0;\n len = arrHeaderElements.length;\n while (i < len) {\n arrHeaderElements[i].setAttribute('role', 'columnheader');\n arrHeaderElements[i].setAttribute('scope', 'col');\n i += 1;\n }\n\n i = 0;\n len = arrHeaderElements.length;\n while (i < len) {\n if (!arrElements[i].hasAttribute('role')) {\n if (i === 0) {\n arrElements[i].setAttribute('role', 'rowheader');\n arrElements[i].setAttribute('scope', 'row');\n } else {\n arrElements[i].setAttribute('role', 'gridcell');\n }\n }\n if (!arrElements[i].hasAttribute('heading')) {\n arrElements[i].setAttribute('heading', arrHeaderElements[i].textContent);\n }\n i += 1;\n }\n\n element.headerTemplateRecord = headerRecordElement.outerHTML;\n }\n\n // make table template\n recordElement = xtag.query(tableTemplateElement.content, 'tbody tr')[0];\n recordElement.setAttribute('role', 'row');\n recordElement.setAttribute('data-index', '{{= i }}');\n\n\n var arrCells = xtag.toArray(recordElement.children);\n\n i = 0;\n len = arrCells.length;\n while (i < len) {\n if (!arrCells[i].hasAttribute('role')) {\n if (i === 0) {\n arrCells[i].setAttribute('role', 'rowheader');\n arrCells[i].setAttribute('scope', 'row');\n } else {\n arrCells[i].setAttribute('role', 'gridcell');\n }\n }\n i += 1;\n }\n\n\n strHTML = GS.templateColumnToValue(tableTemplateElement.innerHTML);\n tempTemplateElement = document.createElement('template');\n tempTemplateElement.innerHTML = strHTML;\n recordElement = xtag.query(tempTemplateElement.content, 'tbody tr')[0];\n\n\n\n element.tableTemplate = GS.templateHideSubTemplates(recordElement.outerHTML, true);\n element.tableTemplateRecord = recordElement;\n\n if (insertTemplateElement && insertTemplateElement.innerHTML) {\n element.insertTemplate = insertTemplateElement.innerHTML;\n }\n\n // split schema and object\n arrParts = GS.templateWithQuerystring(element.getAttribute('src')).split('.');\n\n element.setAttribute('schema', arrParts[0]);\n element.setAttribute('object', arrParts[1]);\n\n // replace element inner html and create element variables\n strHTML = ml(function () {/*\n <div class=\"root\" flex-vertical flex-fill>\n <div class=\"hud-container\">\n <gs-button icon=\"refresh\" aria-label=\"Refresh Data.\" remove-right icononly no-focus title=\"Refresh Data.\" class=\"refresh-button\"></gs-button>\n <gs-button icon=\"times\" aria-label=\"Delete Selected Records.\" remove-left icononly no-focus title=\"Delete Selected Records.\" class=\"delete-button\"></gs-button>\n\n <gs-button icon=\"plus\" aria-label=\"Create Record.\" icononly no-focus title=\"Create Record.\" class=\"insert-button\"></gs-button>\n\n <gs-button icon=\"backward\" aria-label=\"Go to previous page.\" remove-right icononly no-focus title=\"Go to previous page.\" class=\"paginate-left\"></gs-button>\n <gs-button icon=\"forward\" aria-label=\"Go to next page.\" remove-left icononly no-focus title=\"Go to next page.\" class=\"paginate-right\"></gs-button>\n\n {{HUDHTML}}\n\n <gs-button icon=\"filter\" icononly no-focus title=\"Edit Filters.\" class=\"filter-button\" hidden></gs-button>\n <textarea title=\"Hidden control\" class=\"hidden-focus-control\">Focus Control</textarea>\n </div>\n <div class=\"data-container\" flex>\n <div class=\"data-flex-reset\">\n <div class=\"scroll-container\"></div>\n <div class=\"header-container\"></div>\n <div class=\"insert-container\"></div>\n </div>\n </div>\n </div>*/\n });\n\n if (HUDTemplateElement) {\n strHTML = strHTML.replace(/\\{\\{HUDHTML\\}\\}/gi, HUDTemplateElement.innerHTML);\n } else {\n strHTML = strHTML.replace(/\\{\\{HUDHTML\\}\\}/gi, '');\n }\n\n element.innerHTML = strHTML;\n\n element.root = element.children[0];\n\n element.hudContainer = element.root.children[0];\n element.dataContainer = element.root.children[1];\n\n element.dataFlexReset = element.dataContainer.children[0];\n\n element.scrollContainer = element.dataFlexReset.children[0];\n element.headerContainer = element.dataFlexReset.children[1];\n element.insertContainer = element.dataFlexReset.children[2];\n\n element.refreshButton = xtag.queryChildren(element.hudContainer, '.refresh-button')[0];\n element.deleteButton = xtag.queryChildren(element.hudContainer, '.delete-button')[0];\n element.insertButton = xtag.queryChildren(element.hudContainer, '.insert-button')[0];\n element.pageLeftButton = xtag.queryChildren(element.hudContainer, '.paginate-left')[0];\n element.pageRightButton = xtag.queryChildren(element.hudContainer, '.paginate-right')[0];\n element.copyControl = xtag.queryChildren(element.hudContainer, '.hidden-focus-control')[0];\n element.filterButton = xtag.queryChildren(element.hudContainer, '.filter-button')[0];\n\n if (element.hasAttribute('no-huddelete') && element.hasAttribute('no-hudrefresh')) {\n element.hudContainer.removeChild(element.refreshButton);//.setAttribute('hidden', '');\n element.hudContainer.removeChild(element.deleteButton);//.setAttribute('hidden', '');\n\n } else if (element.hasAttribute('no-huddelete')) {\n element.hudContainer.removeChild(element.deleteButton);//.setAttribute('hidden', '');\n element.refreshButton.removeAttribute('remove-right');\n\n } else if (element.hasAttribute('no-hudrefresh')) {\n element.hudContainer.removeChild(element.refreshButton);//.setAttribute('hidden', '');\n element.deleteButton.removeAttribute('remove-left');\n }\n\n if (element.hasAttribute('no-hudpaginate')) {\n element.hudContainer.removeChild(element.pageLeftButton);//.setAttribute('hidden', '');\n element.hudContainer.removeChild(element.pageRightButton);//.setAttribute('hidden', '');\n }\n\n if (!element.insertTemplate) {\n element.insertButton.setAttribute('hidden', '');\n }\n }", "function objElAtr(element, atrObj, parentAtr) {\n Object.keys(atrObj).forEach((atr) => {\n if (typeof atrObj[atr] === 'object') {\n objElAtr(element, atrObj[atr], atr);\n } else if (parentAtr) {\n element[parentAtr][atr] = atrObj[atr];\n } else {\n element[atr] = atrObj[atr];\n }\n });\n }", "mount(element){\n\t\tlet root = document.querySelector(element);\n\t\tif(root){\n\t\t\tlet rootContents = root.innerHTML;\n\t\t\tlet regex = /\\%{(.+?)}\\%/ig;\n\t\t\trootContents = rootContents.replace(regex, (match) => {\n\t\t\t\tlet prop = match.slice(2, -2);\n\t\t\t\treturn eval('this.templateInfo.' + prop);\n\t\t\t});\n\t\t\troot.innerHTML = rootContents;\n\t\t}\n\t}", "function Element(parent) {\n\tthis.parent = parent;\n\tthis.value = null;\n\tthis.dollared = false;\n\tthis.quoted = false;\n\tthis.code = false;\n\tthis.length = -1; // A length of 0 means an empty list, -1 is no list at all.\n}", "function ur(b,c){X.call(this,b,c);var d=this;this.b=W(\"div\");this.b.classList.add(\"shaka-ad-position\");Y(this.b,!1);this.parent.appendChild(this.b);this.f=W(\"span\");this.b.appendChild(this.f);this.eventManager.l(this.localization,\"locale-updated\",function(){d.a&&vr(d)});this.eventManager.l(this.localization,\"locale-changed\",function(){d.a&&vr(d)});this.eventManager.l(this.c,\"ad-started\",function(){vr(d)});this.eventManager.l(this.c,\"ad-stopped\",function(){d.f.textContent=\"\";Y(d.b,!1)})}", "link() {\n this._template = this._sbolDocument.lookupURI(this._template);\n this._variableComponents = this._sbolDocument.lookupURIs(this._variableComponents);\n }", "function VastCreative(node, parent){\n\t\tvar me = this;\n\t\tvar par = parent;\n\t\t\n\t\tthis.sequence = node.getAttribute('sequence');\n\t\tthis.adId = node.getAttribute('adid');\n\t\tthis.id = node.getAttribute('id');\n\t\tthis.apiFramework = node.getAttribute('apiFramework');\n\t\t\n\t\t/**\n\t\t* @function\n\t\t* Retrieve companion ads associated with this ad or null\n\t\t*/\n\t\tthis.getCompanionAds = function(){\n\t\t\tvar i, comp = null, c,\n\t\t\t\tlen,\n\t\t\t\tseq = me.sequence;\n\t\t\t\n\t\t\tif(!parent || (me.adType != 'linear' && me.adType != 'nonlinear') || par.creative_companions.length == 0){\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tlen = par.creative_companions.length;\n\t\t\tfor(i=0; i < len; i++){\n\t\t\t\tc = par.creative_companions[i];\n\t\t\t\tif(c.adType == COMPANION_ADS){\n\t\t\t\t\tif(c.sequence == null){\n\t\t\t\t\t\tcomp = c;\n\t\t\t\t\t}\n\t\t\t\t\telse if(c.sequence == seq){\n\t\t\t\t\t\treturn c;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn comp;\n\t\t}\n\t\t\n\t\tfunction parseTrackingEvents(detObj, trackingNode){\n\t\t\tvar i, tn, evt,\n\t\t\t\ttracks = childElements(trackingNode),\n\t\t\t\ttevts = detObj.trackingEvents || {};\n\t\t\t\n\t\t\tfor(i=0; i < tracks.length; i++){\n\t\t\t\ttn = tracks[i];\n\t\t\t\tif(tn.tagName.toUpperCase() != 'TRACKING'){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tevt = tn.getAttribute('event');\n\t\t\t\ttevts[evt] = {\n\t\t\t\t\tevent: evt,\n\t\t\t\t\turl: nodeText(tn)\n\t\t\t\t};\n\t\t\t}\n\t\t\t\n\t\t\t// insure reassignment\n\t\t\tdetObj.trackingEvents = tevts;\n\t\t}\n\t\t\n\t\tfunction parseCreative(node){\n\t\t\tvar i, n, kids, tname;\n\t\t\t\n\t\t\tkids = childElements(node);\n\t\t\tif(kids.length == 0){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\ttname = kids[0].tagName.toLowerCase();\n\t\t\t\tme.adType = tname;\n\t\t\t\tif(tname == 'linear'){\n\t\t\t\t\tparseLinear(kids[0]);\n\t\t\t\t}\n\t\t\t\telse if(tname == COMPANION_ADS){\n\t\t\t\t\tparseCompanionAds(kids[0]);\n\t\t\t\t}\n\t\t\t\telse if(tname == 'nonlinear'){\n\t\t\t\t\tparseNonLinear(kids[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t* @function\n\t\t* Parse a linear ad node\n\t\t*/\n\t\tfunction parseLinear(lnode){\n\t\t\tvar l, tn, k, mfiles, mf,\n\t\t\t\tmfAttribs, mObj,\n\t\t\t\ti, m, kids = childElements(lnode);\n\t\t\t\n\t\t\tmfAttribs = ['delivery', 'type', 'width', 'height',\n\t\t\t\t'codec', 'id', \n\t\t\t\t'bitrate', 'minBitrate', 'maxBitrate',\n\t\t\t\t'scalable', 'maintainAspectRatio', 'apiFramework' ];\n\t\t\t\n\t\t\tme.linear = {\n\t\t\t\tduration : null,\n\t\t\t\tmediaFiles: []\n\t\t\t};\n\t\t\t\n\t\t\tl = me.linear;\n\t\t\t\n\t\t\tfor(i=0; i < kids.length; i++){\n\t\t\t\tk = kids[i];\n\t\t\t\ttn = k.tagName.toUpperCase();\n\t\t\t\tswitch(tn){\n\t\t\t\t\tcase 'DURATION':\n\t\t\t\t\t\tl.duration = nodeText(k);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'MEDIAFILES':\n\t\t\t\t\t\tmfiles = childElements(k);\n\t\t\t\t\t\tfor(m=0; m < mfiles.length; m++){\n\t\t\t\t\t\t\tmf = mfiles[m];\n\t\t\t\t\t\t\tmObj = objFromAttributes(mf, mfAttribs);\n\t\t\t\t\t\t\tmObj.url = nodeText(mf);\n\t\t\t\t\t\t\tl.mediaFiles.push(mObj); \n\t\t\t\t\t\t}\n\t\t\t\t\tcase 'TRACKINGEVENTS':\n\t\t\t\t\t\tparseTrackingEvents(l, k);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'ADPARAMETERS':\n\t\t\t\t\tcase 'VIDEOCLICKS':\n\t\t\t\t\tcase 'ICONS':\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\tfunction parseCompanionAds(cnode){\n\t\t\tvar k,\n\t\t\t\ti, kids = childElements(cnode);\n\t\t\t\n\t\t\tme.companions = [];\n\t\t\t\n\t\t\tfor(i=0; i < kids.length; i++){\n\t\t\t\tme.companions.push(new CompanionAd(kids[i]));\n\t\t\t}\t\t\n\t\t}\n\t\tfunction parseNonLinear(nlnode){\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\t// Begin parsing\n\t\tparseCreative(node);\n\t}", "function Tag(label,id,created) {\n this.label = label;\n this.id = id;\n this.created = created;\n}", "function fullTag(tag) {\n\tlabel = tag.text;\n\tif (tag.namespace !== \"\")\n\t\tlabel = tag.namespace+\":\"+tag.text;\n\t\n\treturn { label: label, value: tag.weight };\n}", "function htmlRelation (relation) {\n var string = '<p';\n string += ' name=' + relation.label;\n string += ' id=' + relation.uuid;\n string += ' class=\"relation\">';\n string += 'Label: ' + relation.label;\n string += '<br>';\n string += 'Uuid: ' + relation.uuid;\n string += '<br>';\n var temp = Object.keys(relation.arcs);\n for (var key in temp) {\n string += key + \" : \" + relation.arcs[key].label;\n string += '<br>';\n }\n string += '</p>';\n string += relation.html; //which creates the form\n return string;\n}", "function AuctionData(element)\n{\n // store the html element holding this auction data (should be jquery set)\n this.element = element;\n}", "function TElementNode(){}", "constructor(parser) { super(JXONObj.TAG, parser, JXONAttribute.TAG, '{', '}', ',') }", "function makeAwardElement(obj) {\n var cloneClone = awardEventClone.clone(true);\n var text = cloneClone.find(awardEventTextElement);\n var price = cloneClone.find(awardEventPriceElement);\n var date = cloneClone.find(awardEventDateElement);\n\n // if current person is interpreter\n if (currentRole === 1) {\n // we again insert proper text to it\n text.html(window.__(\"You have been awarded the assignment at the price of:\"));\n price.html(obj.price);\n date.html(obj.formated_date);\n // if current person is business\n } else {\n // we create text block with link in it for interpreter's name\n if (Number(obj.initiator_id) === Number(currentPersonId)) {\n text.html(window.__(\"You have awarded <a class='skiwo-link skiwo-link--green-bg' href=''></a> the assignment at the price of:\"));\n } else {\n text.html(window.__(obj.initiator_name + \" has awarded <a class='skiwo-link skiwo-link--green-bg' href=''></a> the assignment at the price of:\"));\n }\n text.find(\"a\").html(obj.name);\n text.find(\"a\").attr(\"href\", obj.link);\n price.html(obj.business_price);\n date.html(obj.formated_date);\n }\n\n\n // TODO: remove this line!!!\n if (obj.past) {\n // cloneClone.addClass(\"is-past-event\");\n }\n\n return cloneClone;\n } // end of creating award event function", "get tag() {}", "get tag() {}", "get tag() {}", "get tag() {}", "function element ( div, h1, section, aside ) {\n this.div_class = div;\n this.h1_class = h1;\n this.section_class = section;\n this.aside_class = aside;\n}", "function renderTempElement(type,data) {\n var visibleFields=VisibleFields(type,'single',vm.notFields.split(','));\n vm.current = data;\n vm.fields = visibleFields.map(function(field) {\n return {\n value: field,\n label: content.labelOf(field)\n };\n });\n vm.rdf_source = rdfSource(vm.current.id);\n \n }", "function createDomElement(element) {\n var div = document.createElement('div');\n div.id = element.name;\n div.style = 'left: ' + element.left + 'px; top: ' + element.top + 'px;';\n appendContentIn(div, 'level');\n var elementTemp = JSON.parse(JSON.stringify(element))\n if (element.interact) {\n elementsInteract.push(elementTemp);\n elementsInteractWithEnemy.push(elementTemp);\n }\n if(element.paper) {\n enemysArePresent.push(elementTemp);\n }\n if(element === 'enemy'){\n enemysInStage.push(elementTemp);\n }\n if(element.hide != undefined) {\n objetsToHide.push(elementTemp)\n elementsInteractWithEnemy.push(elementTemp);\n }\n}", "function dataCompiler(element) {\n var output;\n var attributes = getAttributes(element);\n var content = getContent(element);\n var aggregate = attributes.concat(content);\n aggregate = dataIndexer(aggregate);\n var selectorPath = getSelectorPath(element);\n\n return {\n selector: selectorPath.selector,\n selectorIndex: selectorPath.selectorIndex,\n elements: aggregate,\n repeats: selectorPath.repeating\n };\n }", "buildElement() {\n const templateString = fs.readFileSync(this.__template, {encoding: 'utf-8'});\n const parser = new DOMParser();\n const doc = parser.parseFromString(templateString, 'text/html');\n return doc.querySelector('.pio-template-root').cloneNode(true);\n }", "function frameGenericFBTemplateFromElements(elements) {\n let generic_template = {\n speech: \"Description\",\n source: \"chappie_middleware\",\n displayText: \"Course Details\",\n data: {\n facebook: {\n attachment: {\n type: \"template\",\n payload: {\n template_type: \"generic\",\n elements: elements\n }\n }\n }\n }\n };\n\n return generic_template;\n}", "function publicDoctype()\n{\n this.ruleID = 'publicDoctype';\n}", "rawTag (name, attributes) {\n let endTag = getRawEndTag(name)\n let content = this.match(endTag)\n\n if (content) {\n content = content[1]\n } else {\n content = this.str\n this.str = ''\n }\n\n let item = {\n type: 'rawTag',\n name,\n attributes,\n textContent: content\n }\n\n this.doms.push(item)\n }", "set element(element) {}", "set element(element) {}", "function simpleDE(namespace, name, isEntry=true) {\n return new models.DataElement(id(namespace, name), isEntry)\n .withValue(new models.IdentifiableValue(pid('string')).withMinMax(1, 1));\n}", "function ABoxJSONLD() {\n\n // a little template for the graph (see below)\n this._typeId = {\"@type\": \"@id\"};\n\n // the actual A-Box\n this._jsonLD = {\n // define the ontology's namespace which will remain just like this\n \"@context\": {\n \"rdf\": \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\",\n \"rdfs\": \"http://www.w3.org/2000/01/rdf-schema#\",\n \"xsd\": \"http://www.w3.org/2001/XMLSchema#\",\n \"owl\": \"http://www.w3.org/2002/07/owl#\",\n \"kno\": \"http://motivate-project.de/ontology/knowledge.owl#\",\n \"abox\": \"http://motivate-project.de/ontology/abox.owl#\",\n \"rdf:first\": this._typeId,\n \"rdf:type\": this._typeId,\n \"rdf:rest\": this._typeId,\n \"rdf:subject\": this._typeId,\n \"rdf:value\": this._typeId,\n \"rdf:predicate\": this._typeId,\n \"rdf:object\": this._typeId,\n \"rdfs:subClassOf\": this._typeId,\n \"rdfs:domain\": this._typeId,\n \"rdfs:subPropertyOf\": this._typeId,\n \"rdfs:seeAlso\": this._typeId,\n \"rdfs:range\": this._typeId,\n \"rdfs:member\": this._typeId,\n \"owl:minCardinality\": {\n \"@type\": \"xsd:nonNegativeInteger\"\n },\n \"owl:qualifiedCardinality\": {\n \"@type\": \"xsd:nonNegativeInteger\"\n },\n \"owl:annotatedTarget\": this._typeId,\n \"owl:seeAlso\": this._typeId,\n \"owl:cardinality\": {\n \"@type\": \"xsd:nonNegativeInteger\"\n },\n \"owl:hasSelf\": this._typeId,\n \"owl:onDatatype\": this._typeId,\n \"owl:onDataRange\": this._typeId,\n \"owl:differentFrom\": this._typeId,\n \"owl:someValuesFrom\": this._typeId,\n \"owl:disjointUnionOf\": {\n \"@type\": \"@id\",\n \"@container\": \"@list\"\n },\n \"owl:versionIRI\": this._typeId,\n \"owl:allValuesFrom\": this._typeId,\n \"owl:inverseOf\": this._typeId,\n \"owl:onProperty\": this._typeId,\n \"owl:priorVersion\": this._typeId,\n \"owl:complementOf\": this._typeId,\n \"owl:disjointWith\": this._typeId,\n \"owl:unionOf\": {\n \"@type\": \"@id\",\n \"@container\": \"@list\"\n },\n \"owl:maxCardinality\": {\n \"@type\": \"xsd:nonNegativeInteger\"\n },\n \"owl:withRestrictions\": {\n \"@type\": \"@id\",\n \"@container\": \"@list\"\n },\n \"owl:bottomDataProperty\": {\n \"@type\": \"rdfs:Literal\"\n },\n \"owl:propertyChainAxiom\": {\n \"@type\": \"@id\",\n \"@container\": \"@list\"\n },\n \"owl:sameAs\": this._typeId,\n \"owl:equivalentClass\": this._typeId,\n \"owl:equivalentProperty\": this._typeId,\n \"owl:members\": {\n \"@type\": \"@id\",\n \"@container\": \"@list\"\n },\n \"owl:incompatibleWith\": this._typeId,\n \"owl:intersectionOf\": {\n \"@type\": \"@id\",\n \"@container\": \"@list\"\n },\n \"owl:distinctMembers\": {\n \"@type\": \"@id\",\n \"@container\": \"@list\"\n },\n \"owl:sourceIndividual\": this._typeId,\n \"owl:bottomObjectProperty\": this._typeId,\n \"owl:topObjectProperty\": this._typeId,\n \"owl:hasKey\": {\n \"@type\": \"@id\",\n \"@container\": \"@list\"\n },\n \"owl:annotatedSource\": this._typeId,\n \"owl:onClass\": this._typeId,\n \"owl:onProperties\": {\n \"@type\": \"@id\",\n \"@container\": \"@list\"\n },\n \"owl:targetIndividual\": this._typeId,\n \"owl:assertionProperty\": this._typeId,\n \"owl:maxQualifiedCardinality\": {\n \"@type\": \"xsd:nonNegativeInteger\"\n },\n \"owl:datatypeComplementOf\": this._typeId,\n \"owl:backwardCompatibleWith\": this._typeId,\n \"owl:oneOf\": {\n \"@type\": \"@id\",\n \"@container\": \"@list\"\n },\n \"owl:targetValue\": {\n \"@type\": \"rdfs:Literal\"\n },\n \"owl:propertyDisjointWith\": this._typeId,\n \"owl:imports\": this._typeId,\n \"owl:annotatedProperty\": this._typeId,\n \"owl:minQualifiedCardinality\": {\n \"@type\": \"xsd:nonNegativeInteger\"\n },\n \"owl:topDataProperty\": {\n \"@type\": \"rdfs:Literal\"\n }\n },\n // and the actual content (a list of all JSON-LD individuals)\n \"@graph\": [\n {\n \"@id\": \"http://motivate-project.de/ontology/abox.owl\",\n \"@type\": \"owl:Ontology\",\n \"owl:imports\": \"http://motivate-project.de/ontology/knowledge.owl\"\n }\n ]\n };\n\n return this;\n}", "function getAd()\n{\n}", "function createElement(el, attribute_object, parent) {\n el = document.createElement(el);\n parent.appendChild(el);\n for (let attribute in attribute_object) {\n el.setAttribute(attribute, attribute_object[attribute]);\n }\n return el;\n}", "function vi(a,b,c,d){this.type=a;this.name=b;this.A=c;this.qa=d;this.xb=[];this.align=-1;this.$a=!0}", "static initialize(obj, name, templateType, tokenizerType) { \n obj['name'] = name;\n obj['template-type'] = templateType;\n obj['tokenizer-type'] = tokenizerType;\n }", "get template () {\n return DutyTemplateProxy.createFromFirestoreObject(this.object[dutyKeys.template])\n }", "constructor(el) {\n this.el = el || {};\n }", "function mkForeignObj(elt) {\n \n let foreigner = document.createElementNS(xmlns, \"foreignObject\");\n foreigner.setAttribute(\"x\", elt.x);\n foreigner.setAttribute(\"y\", elt.y);\n if (elt.w) foreigner.setAttribute(\"width\", elt.w);\n if (elt.h) foreigner.setAttribute(\"height\", elt.h);\n foreigner.setAttribute(\"class\", elt.cls);\n if (elt.desc) foreigner.setAttribute(\"desc\", elt.desc);\n \n let txt = document.createElement(elt.tg);\n// txt.className = elt.cls;\n if (elt.tg === \"input\") {\n txt.value = elt.txt;\n } else {\n txt.textContent = elt.txt.replaceAll(\"&gt;\",\">\").replaceAll(\"&lt;\",\"<\").replaceAll(\"&leq;\",\"<=\").replaceAll(\"&geq;\",\">=\");\n }\n foreigner.appendChild(txt);\n \n //the xml div is for IE\n// let inDiv = document.createElement(\"div\");\n// inDiv.setAttribute(\"xmlns\", \"http://www.w3.org/1999/xhtml\");\n// inDiv.appendChild(txt);\n\n return foreigner;\n}", "constructor() {\n super();\n\n // Create Shadow DOM\n this.attachShadow({ mode: 'open'});\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n\n // Access the attributes here\n this.shadowRoot.querySelector('h3').innerText = this.getAttribute('name');\n this.shadowRoot.querySelector('img').src = this.getAttribute('avatar');\n }", "function ac(t){if(t instanceof no[\"default\"])return t.id;if(t instanceof oc)return t.get(\"id\");throw new Error(\"Illegal layer argument\")}", "function el(a){this.$f=a;this.Pg=\"\";this.lm=new RegExp(this.Ca,\"g\")}", "getEdad () {\n return this.edad;\n }", "function ai(a,b,c,d){this.type=a;this.name=b;this.Y=c;this.ba=d;this.hb=[];this.align=-1;this.Ga=!0}", "function createElemAttributes() {\n var a = {\n href: href,\n title: target.name,\n target: target.target ? target.target : null,\n rel: target.rel ? target.rel : null\n };\n if (hasUdi) {\n a['data-udi'] = target.udi;\n } else if (target.id) {\n a['data-id'] = target.id;\n }\n return a;\n }", "function make_elements(obj){\n return [\n base.make_text_element('h3',obj.title),\n base.make_text_element('p', obj.description),\n base.make_text_element('p', obj.publishedAt),\n base.make_image(obj.urlToImage)\n ]\n }", "function treeHTML(element, object) {\n\t\t\tobject[\"type\"] = element.nodeName;\n\t\t\tvar nodeList = element.childNodes;\n\t\t\tif (nodeList != null) {\n\t\t\t\tif (nodeList.length) {\n\t\t\t\t\tobject[\"content\"] = [];\n\t\t\t\t\tfor (var i = 0; i < nodeList.length; i++) {\n\t\t\t\t\t\tif (nodeList[i].nodeType == 3) {\n\t\t\t\t\t\t\tobject[\"content\"].push(nodeList[i].nodeValue);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tobject[\"content\"].push({});\n\t\t\t\t\t\t\ttreeHTML(nodeList[i], object[\"content\"][object[\"content\"].length -1]);\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\tif (element.attributes != null) {\n\t\t\t\tif (element.attributes.length) {\n\t\t\t\t\tobject[\"attributes\"] = {};\n\t\t\t\t\tfor (var i = 0; i < element.attributes.length; i++) {\n\t\t\t\t\t\tobject[\"attributes\"][element.attributes[i].nodeName] = element.attributes[i].nodeValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function elem(tag, content, idt, idv, class){\r\n\t\tvar ret = document.createElement(tag);\r\n//\t\tret.innerHTML = content;\r\n\r\n\t\tif(content) ret.innerHTML=content;\r\n\t\tif(idt) ret.setAttribute(idt, idv);\r\n\t\tif(class) ret.className=class;\r\n\r\n\t\treturn ret;\r\n\t}", "function makeWithTemplateDetails(withTemplate) {\n\n // Create the details object\n var details = { first: undefined, last: undefined, nth: [] };\n\n // Loop over the elements\n for (var i = 0; i < withTemplate.dom.children.length; i++) {\n\n // Access the child\n var child = withTemplate.dom.children[i];\n\n // Access the child node name\n var name = getNodeName(child);\n\n // Detarmine if the element is a collection item target\n if (name == \"FIRST\") {\n\n // Set the \"first\"\n details.first = child;\n\n }\n else if (name == \"LAST\") {\n\n // Set the \"last\"\n details.last = child;\n\n }\n else if (name == \"NTH\") {\n\n // Add the \"nth\"\n details.nth.push({ template: child, at: undefined });\n\n // Access the root NTH\n var rootNTH = details.nth[details.nth.length - 1];\n\n // Set the NTH properties\n rootNTH.at = child.getAttribute('at');\n\n // Process the \"at\" attrbiute further if its 0,1,2\n if ((rootNTH.at != undefined) && (rootNTH.at.indexOf(',') > -1)) {\n\n // Split the indicies\n var indicies = rootNTH.at.split(',');\n\n // Set the first nth item\n rootNTH.at = indicies[0];\n\n // Loop over the other indicies pushing more NTH items\n for (var iidx = 1; iidx < indicies.length; iidx++)\n details.nth.push({ template: child, at: indicies[iidx] });\n\n }\n\n }\n\n }\n\n // Return\n return details;\n\n }", "function displayTempInInspectorAttrs() {\r\n const zoneAttributes = [\"zone:id\", \"zone:type\", \"zone:min\", \"zone:max\", \"zone:parent\", \"zone:relation\"];\r\n addTemplateAttr(zoneAttributes, \"zoneAttr\");\r\n}", "function TElementNode() {}", "function TElementNode() {}", "function TElementNode() {}", "function vlerDasDocumentToVPR(document, fullHtml, vlerDocType, requestStampTime, compressed) {\n var vprVlerDocument = {};\n vprVlerDocument.kind = vlerDocType;\n vprVlerDocument.name = _.get(document, 'resource.description');\n vprVlerDocument.uid = document.uid;\n vprVlerDocument.summary = _.get(document, 'resource.description');\n vprVlerDocument.pid = document.pid;\n vprVlerDocument.documentUniqueId = _.get(document, 'resource.masterIdentifier.Value');\n vprVlerDocument.homeCommunityId = _.get(document, 'resource.masterIdentifier.system');\n vprVlerDocument.stampTime = requestStampTime;\n vprVlerDocument.fullHtml = fullHtml;\n if (compressed) {\n vprVlerDocument.compressed = compressed;\n }\n\n //Drop timezone offset from creationTime\n let creationTimeWithOffset = _.get(document, 'resource.created', '');\n vprVlerDocument.creationTime = moment(creationTimeWithOffset, 'YYYYMMDDHHmmss[ZZ]').format('YYYYMMDDHHmmss');\n\n vprVlerDocument.authorList = getAuthorListFromFHIRContainedResources(document);\n\n return vprVlerDocument;\n}", "function printAST(a)\n{\n\n\n\t//\t<outer> ::= (OUTERTEXT |<templateinvocation>|<templatedef>)*\n\n\t// case for \"OUTER object\"\n\tif(a.name == \"outer\") // We go in the inverse way by checking all the fields of an \"outer\" object\n\t{\n\t\tif(a.OUTERTEXT) //Check if it has an outertext VALUE\n\t\t{\n\t\t\tif(a.templateinvocation) // then a tepmlete invoaction \n\t\t\t{\n\t\t\t\tif(a.next) // next is the recursive part if it is also present , format print outer Text then in TSTART and TEND\n\t\t\t\t{ \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\treturn a.OUTERTEXT + \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next) // we make recursive call to printAST to go back\n\t\t\t\t}\n\t\t\telse // if no next value : \n\t\t\t\treturn a.OUTERTEXT + \"{{\" + printAST(a.templateinvocation) + \"}}\"\n\t\t\t}\n\n\t\t if(a.templatedef) // now if template definition has a vlaue \n\t\t\t{\n\t\t\t\tif(a.next)\n {\n return a.OUTERTEXT + \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next)\n }\n else // if no next value\n return a.OUTERTEXT +\"{:\" + printAST(a.templatedef) + \":}\"\n\t\t\t}\n\n\t\t if(a.next) // if only a a.next in an object having an outer text value \n\t\t\t{\n\t\t\t\treturn a.OUTERTEXT + printAST(a.next)\n\t\t\t}\n\t\t\telse\n\t\t\t return a.OUTERTEXT // ultimate case, only return OUTERTEXT\n\t\t} // End of if outertext has a value \n\n\t\t// --------------\n\n\t\telse if(a.templateinvocation){ // NOW CASE when the outer has null in a.OUTERTEXT and has a value in template invocaiton\n\n\t\t\tif(a.next) // check if there is a next value\n \t\treturn \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next) \n \t\telse \n \t\t\treturn \"{{\" + printAST(a.templateinvocation) + \"}}\"\n\t\t}\n\n\t if(a.templatedef) //NOW CASE when the outer has null in a.OUTERTEXT and has a value in Template definition\n {\n if(a.next)\n return \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next)\n else \n \treturn \"{:\" + printAST(a.templatedef) + \":}\"\n }\n\n\tif(a.next) // LAST CASW WHERE all the object fields are empty except a.next \n \treturn printAST(a.next) // go to a.next \n\t\telse\n\t\t return \"\" // if there is no a.next it's an empty object so return empty string\n\t} // \n\n\n\t/* \n\n\t\t\tobject grammar type : template invocation \n\t\t\t<templateinvocation> ::= TSTART <itext> <targs> TEND\n\t\t\t--> We follow the logic used in the previous example to go over each object fields\n\n\t*/\n\nif(a.name == \"templateinvocation\") // if the object field is template invocation\n\t{\n\t\t\n\t\t// IF THE OBJECT has an ITEXT value\n\t\tif(a.itext)\n\t\t{\n\t\t\tif(a.targs) // if it also has a targs value\n\t\t\t return printAST(a.itext) + printAST(a.targs) // print both of just print ITEXT\n\n\t\t\telse \n\t\t\t return printAST(a.itext) // else just return to print AST\n\t\t}\n\t\telse \n\t\t\treturn \"\" // else this is an empty object \n\t}\n\n\n\n\t/* FOR OBJECT name Itex----------------------------\n\t<itext> ::= (INNERTEXT |<templateinvocation>|<templatedef>|<tparam>)*\n\n\t*/\n\n\n\n\t if(a.name == \"itext\") // check if theo oject has an Itext value\n\t{\n\t\tif(a.innerText) // check if itext has an INNERTEXT value\n\t\t{\n\t\t\tif(a.templateinvocation) // AND template invocation vlaue\n\t\t\t{\n\t\t\t\tif(a.next) // AND next \n\t\t\t\t\treturn a.innerText + \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next) \n\t\t\t\telse \n\t\t\t\t\treturn a.innerText+ \"{{\" + printAST(a.templateinvocation) + \"}}\" \n\t\t\t}\n\n\n\t\tif(a.templatedef) // if has template definition value \n\t\t\t{\n\t\t\t\tif(a.next) // ANd a next field\n {\n return a.innerText + \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next) \n }\n else \n \treturn a.innerText +\"{:\" + printAST(a.templatedef)\n\t\t\t}\n\n\n\t\tif(a.tparam) // If tparam has a value \n\t\t\t{\n\t\t\t\tif(a.next) // AND next value\n {\n return a.innerText + \"{{{\" + printAST(a.tparam) + \"}}}\" + printAST(a.next) \n }\n else // else juste return tparam value and go back to print AST\n return a.innerText +\"{{{\" + printAST(a.tparam) + \"}}}\"\n\t\t\t}\n\n\t\tif(a.next) // if a next has a relue simply return to printAST with it's value\n\t\t\t{\n\t\t\t\treturn a.innerText + printAST(a.next) \n\t\t\t}\t\t\t\n\t\t\telse // else just return \n\t\t\t\treturn a.innerText\n\t\t}\n\n\n\t\tif(a.templateinvocation) // now it just a template invocation \n {\n if(a.next) // AND a.next ?\n return \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next)\n else // just return to parstAT \n \treturn \"{{\" + printAST(a.templateinvocation) + \"}}\"\n }\n\n if(a.templatedef) // if template def\n {\n if(a.next)\n return \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next)\n else return \"{:\" + printAST(a.templatedef) + \":}\"\n }\n\n\tif(a.tparam) // if tparam has a vaue\n\t\t{\n\t\t\tif(a.next)\n return \"{{{\" + printAST(a.tparam) + \"}}}\" + printAST(a.next)\n else \n return \"{{{\" + printAST(a.tparam) + \"}}}\"\n\t\t}\n\n else return \"\"\n\t} //----- END onf ITEXT---- \n\n\n\t/*\n\t\tObject type of grammar used : TEMPLATE DEF\n\t\t<templatedef> ::= DSTART <dtext> (PIPE <dtext>)+ DEND\n\t*/\n\n if(a.name == \"templatedef\") // for template definition we gotta chekc for dtext value and pipe values\n\t{\n\n\t\t\n\t\tif(a.dtext) // if the object has a dtext value\n\t\t{\n\t\t\tif(a.dargs) // AND if it has a dargs value as well\n\t\t\t\treturn printAST(a.dtext) + printAST(a.dargs) \n\t\t\telse // Else just return dtext\n\t\t\t\treturn printAST(a.dtext)\n\t\t}\n\t\telse return \"\" // just return empty string\n\t}\n\t\n/*\n\nObject of type DTEXT \n\n============> This is basically the same thing as Itext but with Dtext and InnerDtext\n\ndtext> ::= (INNERDTEXT |<templateinvocation>|<templatedef>|<tparam>)*\n\n*/\n\n\nif(a.name == \"dtext\") \n\t{\n\n\n\t\tif(a.innerDtext)\n {\n if(a.templateinvocation)\n {\n if(a.next)\n return a.innerDtext + \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next)\n else\n return a.innerDtext+ \"{{\" + printAST(a.templateinvocation) + \"}}\"\n }\n\n if(a.templatedef)\n {\n if(a.next)\n {\n return a.innerDtext + \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next)\n }\n else\n return a.innerDtext+\"{:\" + printAST(a.templatedef) + \":}\"\n }\n\n if(a.tparam)\n {\n if(a.next)\n {\n return a.innerDtext + \"{{{\" + printAST(a.tparam) + \"}}}\" + printAST(a.next)\n }\n else \n return a.innerDtext +\"{{{\" + printAST(a.tparam) + \"}}}\"\n }\n\n\t\t\t \tif(a.next) \n\t\t\t \t\treturn a.innerDtext + printAST(a.next)\n else \n \treturn a.innerDtext\n\n }\n\n\n\n if(a.templateinvocation)\n {\n \t\tif(a.next)\n return \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next)\n else \n \treturn \"{{\" + printAST(a.templateinvocation) + \"}}\"\n }\n if(a.templatedef)\n {\n if(a.next)\n \treturn \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next)\n else \n \treturn \"{:\" + printAST(a.templatedef) + \":}\"\n }\n if(a.tparam)\n {\n if(a.next)\n return \"{{{\" + printAST(a.tparam) + \"}}}\" + printAST(a.next)\n else \n \t\treturn \"{{{\" + printAST(a.tparam) + \"}}}\"\n }\n else return \"\" // just return empty string \n\n\t}\n\n\n/*\n \t\tParse AST for targs objects \n \t\t<targs> ::= (PIPE <itext>)*\n*/\n\n\nif(a.name == \"targs\") // check if the name is targs\n\t{\n\t\tif(a.itext) // if it has an Itext value\n\t\t{\n\t\t\tif(a.next) // AND A NEXT so return both\n\t\t\t\treturn \"|\" + printAST(a.itext) + printAST(a.next)\n\t\t\telse // or else return only the pipe\n\t\t\t\treturn \"|\" + printAST(a.itext)\n\t\t}\n\t}\n\n\n/*\n Check if the object type is pipeDtext : \n This is a non terminale element that I defined to simplify the work in template def for \" (PIPE <dtext>)+\"\n\tI asked the prof he said it's allowed\n\n\tPARSEPIPEDTEXT(s)\n\n*/\n\nif(a.name == \"pipeDtext\") // check the name of the element\n {\n if(a.dtext) // check if dtext has a value \n {\n if(a.next) //AND next \n return \"|\" + printAST(a.dtext) + printAST(a.next)\n else // If not return the pipe and recursively call print AST9 a.ditext)\n \treturn \"|\" + printAST(a.dtext)\n }\n }\n\n\n/*\n\t\tObject of kind of \"tparam\"\n*/\n\n if(a.name == \"tparam\") // check the name toaram\n\t{\n\t\treturn \"{{{\" + a.name + \"}}}\" // directly return the value of pname\n\t}\n\n}", "function createElementFromAst(node, key) {\n switch (node.type) {\n case 'element':\n var component = components[node.tagName] || node.tagName;\n var componentProps = {};\n Object.keys(node.properties).forEach(function (propKey) {\n if (propKey.indexOf('js:') === 0) {\n componentProps[propKey.slice(3)] =\n unsafe ? unsafeEvalWithProps(node.properties[propKey], props) :\n node.properties[propKey];\n } else {\n componentProps[propKey] = node.properties[propKey];\n }\n });\n componentProps.key = String(key);\n var children = node.children.map(createElementFromAst);\n return createElement(component, componentProps, children.length ? children : undefined);\n case 'text':\n return node.value;\n default:\n return createElement('div', {}, node.children.map(createElementFromAst));\n }\n }", "function AIE_Card(card_object) {\n\n this._created = 0; // if displayed on screen: > 0, if not: 0\n this._current_eg_id = 0; // value range: 0, 1, 2\n\n this._card_id = card_object[\"card_id\"] || 0;\n this._card_title = card_object[\"card_title\"] || \"Design Space\";\n\n this._NI_tag_id = card_object[\"NI_tag_id\"] || 0;\n this._NI_tag = card_object[\"NI_tag\"] || \"Narrative Intent Tag\";\n this._NI_id_arr = card_object[\"NI_id_arr\"];\n this._how = card_object[\"how\"] || \"\";\n this._why = card_object[\"why\"] || \"\";\n\n this._OT_tag = card_object[\"OT_tag\"] || \"Object type tag\";\n // this.DP_code = this._DP_abr(DP_sub_tag);\n\n // this._eg_arr = card_object.eg_arr || [{\"eg_id\":\"1000\", \"eg_source\":\"Video.com\", \"eg_year\":\"2020\", \"eg_designer\":\"Mr. Designer\", \"eg_url\":\"https://www.dribbble.com\"},{\"eg_id\":\"1001\", \"eg_source\":\"Video.com\", \"eg_year\":\"2020\", \"eg_designer\":\"Miss Designer\", \"eg_url\":\"https://www.dribbble.com\"},{\"eg_id\":\"1002\", \"eg_source\":\"Video.com\", \"eg_year\":\"2020\", \"eg_designer\":\"Ms. Designer\", \"eg_url\":\"https://www.dribbble.com\"}];\n this._eg_id = card_object[\"eg_id\"];\n this._eg_designer = card_object[\"eg_designer\"];\n this._eg_year = card_object[\"eg_year\"];\n this._eg_source = card_object[\"eg_source\"];\n this._eg_url = card_object[\"eg_url\"];\n\n this._color_hash = NI_Nav.ColorHash.init();\n this._card_color_arr = this._color_hash.get_color(this._NI_tag_id);\n}" ]
[ "0.57194495", "0.5322524", "0.519831", "0.519831", "0.51490253", "0.5091709", "0.50292176", "0.5024515", "0.5021083", "0.5021083", "0.5021083", "0.49836984", "0.4962434", "0.4951648", "0.49125886", "0.48921937", "0.48880607", "0.48880607", "0.4880534", "0.48552525", "0.4846329", "0.48414707", "0.4812278", "0.47834086", "0.4781708", "0.4775081", "0.4775081", "0.47711924", "0.47685748", "0.47565988", "0.47534052", "0.47534052", "0.47404706", "0.4734256", "0.4727273", "0.46929246", "0.4691709", "0.46841854", "0.46784964", "0.46775743", "0.467023", "0.4642189", "0.46388686", "0.46387774", "0.4634622", "0.4620888", "0.4620706", "0.46092203", "0.45893902", "0.45718592", "0.4550112", "0.45363596", "0.4527734", "0.4506841", "0.45058152", "0.45055813", "0.44987446", "0.44970348", "0.4495779", "0.44915733", "0.44915733", "0.44915733", "0.44915733", "0.44874695", "0.44858992", "0.44840705", "0.44813037", "0.44788474", "0.44723132", "0.44688362", "0.44671172", "0.4465461", "0.4465461", "0.4460751", "0.44602188", "0.44600227", "0.4454253", "0.4451615", "0.44469127", "0.44455916", "0.44432253", "0.44382372", "0.44292393", "0.4421266", "0.44206583", "0.44079044", "0.43988293", "0.439252", "0.43839887", "0.43824953", "0.43800017", "0.4370823", "0.43691424", "0.43685025", "0.43685025", "0.43685025", "0.4357811", "0.4354005", "0.43498108", "0.4347592" ]
0.5845063
0
Instance object of a VAST document
function VastDoc(xdoc){ var me = this; this.xml = xdoc; this.ads = []; this.isAdPod = false; function parseStructure(xml){ var ads, i; var root = xml.documentElement; // version 2.0 forward should use VAST as the root node if(root.tagName.toUpperCase() !== 'VAST'){ throw {message: 'Invalid VAST document'}; } me.vast_version = root.getAttribute('version'); ads = childElements(root); for(i=0; i < ads.length; i++){ if(ads[i].tagName.toUpperCase() === 'AD'){ me.ads.push(new VastAd(ads[i])); } } if(me.ads.length > 1){ me.isAdPod = true; } } parseStructure(xdoc); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(doc) {\n super(doc);\n }", "constructor(doc) {\n super(doc);\n }", "constructor(doc) {\n super(doc);\n }", "constructor(doc) {\n super(doc);\n }", "constructor(doc) {\n super(doc);\n }", "constructor(doc) {\n super(doc);\n }", "function Document () {\n /**\n * @since Flash MX 2004\n * @type String\n */\n this.accName = null;\n /**\n * @since Flash CS3\n * @type Boolean\n */\n this.as3AutoDeclare = false;\n /**\n * @since Flash CS3\n * @type String\n */\n this.as3Dialect = null;\n /**\n * @since Flash CS3\n * @type Number\n */\n this.as3ExportFrame = 0;\n /**\n * @since Flash CS3\n * @type Boolean\n */\n this.as3StrictMode = false;\n /**\n * @since Flash CS3\n * @type Boolean\n */\n this.as3WarningsMode = false;\n /**\n * @since Flash CS3\n * @type Number\n */\n this.asVersion = 0;\n /**\n * @since Flash MX 2004\n * @type Boolean\n */\n this.autoLabel = false;\n /**\n * @since Flash MX 2004\n * @type Object\n */\n this.backgroundColor = null;\n /**\n * @since Flash MX 2004\n * @type String\n */\n this.currentPublishProfile = null;\n /**\n * @since Flash MX 2004\n * @type Number\n */\n this.currentTimeline = 0;\n /**\n * @since Flash MX 2004\n * @type String\n */\n this.description = null;\n /**\n * @since Flash CS3\n * @type String\n */\n this.docClass = null;\n /**\n * @since Flash CS4\n * @type String\n */\n this.externalLibraryPath = null;\n /**\n * @since Flash MX 2004\n * @type Boolean\n */\n this.forceSimple = false;\n /**\n * @since Flash MX 2004\n * @type Number\n */\n this.frameRate = 0;\n /**\n * @since Flash MX 2004\n * @type Number\n */\n this.height = 0;\n /**\n * @since Flash CS3\n * @type Number\n * @const\n */\n this.id = 0;\n /**\n * @since Flash MX 2004\n * @type library\n * @const\n */\n this.library = null;\n /**\n * @since Flash CS4\n * @type String\n */\n this.libraryPath = null;\n /**\n * @since Flash MX 2004\n * @type Boolean\n */\n this.livePreview = false;\n /**\n * @since Flash MX 2004\n * @type String\n * @const\n */\n this.name = null;\n /**\n * @since Flash MX 2004\n * @type String\n * @const\n */\n this.path = null;\n /**\n * @since Flash CS4\n * @type String\n * @const\n */\n this.pathURI = null;\n /**\n * @since Flash MX 2004\n * @type Array\n * @const\n */\n this.publishProfiles = null;\n /**\n * @since Flash MX 2004\n * @type ScreenOutline\n * @const\n */\n this.screenOutline = null;\n /**\n * @since Flash MX 2004\n * @type Array\n */\n this.selection = null;\n /**\n * @since Flash MX 2004\n * @type Boolean\n */\n this.silent = false;\n /**\n * @since Flash CS4\n * @type String\n */\n this.sourcePath = null;\n /**\n * @since Flash CS6\n * @type Number\n */\n this.swfJPEGQuality = null;\n /**\n * @since Flash MX 2004\n * @type Array\n * @const\n */\n this.timelines = null;\n /**\n * @since Flash MX 2004\n * @type Matrix\n * @const\n */\n this.viewMatrix = null;\n /**\n * @since Flash MX 2004\n * @type Number\n */\n this.width = 0;\n /**\n * @since Flash 8\n * @type Number\n */\n this.zoomFactor = 0;\n /**\n * @since Flash MX 2004\n * @param {String} name\n * @param {String} type\n * @param {Object} data\n */\n this.addDataToDocument = function (name, type, data) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} name\n * @param {String} type\n * @param {Object} data\n */\n this.addDataToSelection = function (name, type, data) {\n };\n /**\n * @since Flash 8\n * @param {String} filterName\n */\n this.addFilter = function (filterName) {\n };\n /**\n * @since Flash MX 2004\n * @param {Object} position\n * @param {Item} item\n * @return Boolean\n */\n this.addItem = function (position, item) {\n };\n /**\n * @since Flash MX 2004\n * @param {Object} startPoint\n * @param {Object} endpoint\n */\n this.addNewLine = function (startPoint, endpoint) {\n };\n /**\n * @since Flash MX 2004\n * @param {Object} boundingRectangle\n * @param {Boolean} [bSuppressFill]\n * @param {Boolean} [bSuppressStroke]\n */\n this.addNewOval = function (boundingRectangle, bSuppressFill, bSuppressStroke) {\n };\n /**\n * @since Flash CS4\n * @param {Object} boundingRectangle\n * @param {Boolean} [bSuppressFill]\n * @param {Boolean} [bSuppressStroke]\n */\n this.addNewPrimitiveOval = function (boundingRectangle, bSuppressFill, bSuppressStroke) {\n };\n /**\n * @since Flash CS4\n * @param {Object} boundingRectangle\n * @param {Number} roundness\n * @param {Boolean} [bSuppressFill]\n * @param {Boolean} [bSuppressStroke]\n */\n this.addNewPrimitiveRectangle = function (boundingRectangle, roundness, bSuppressFill, bSuppressStroke) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} profileName\n * @return Number\n */\n this.addNewPublishProfile = function (profileName) {\n };\n /**\n * @since Flash MX 2004\n * @param {Object} boundingRectangle\n * @param {Number} roundness\n * @param {Boolean} [bSuppressFill]\n * @param {Boolean} [bSuppressStroke]\n */\n this.addNewRectangle = function (boundingRectangle, roundness, bSuppressFill, bSuppressStroke) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} [name]\n * @return Boolean\n */\n this.addNewScene = function (name) {\n };\n /**\n * @since Flash MX 2004\n * @param {Object} boundingRectangle\n * @param {String} [text]\n */\n this.addNewText = function (boundingRectangle, text) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} alignMode\n * @param {Boolean} [bUseDocumentBounds]\n */\n this.align = function (alignMode, bUseDocumentBounds) {\n };\n /**\n * @since Flash MX 2004\n * @return Boolean\n */\n this.allowScreens = function () {\n };\n /**\n * @since Flash MX 2004\n * @param {String} arrangeMode\n */\n this.arrange = function (arrangeMode) {\n };\n /**\n * @since Flash MX 2004\n */\n this.breakApart = function () {\n };\n /**\n * @since Flash MX 2004\n * @return Boolean\n */\n this.canEditSymbol = function () {\n };\n /**\n * @since Flash MX 2004\n * @return Boolean\n */\n this.canRevert = function () {\n };\n /**\n * @since Flash MX 2004\n * @return Boolean\n */\n this.canTestMovie = function () {\n };\n /**\n * @since Flash MX 2004\n * @return Boolean\n */\n this.canTestScene = function () {\n };\n /**\n * @since Flash 8\n * @param {Number} oldIndex\n * @param {Number} newIndex\n */\n this.changeFilterOrder = function (oldIndex, newIndex) {\n };\n /**\n * @since Flash MX 2004\n */\n this.clipCopy = function () {\n };\n /**\n * @since Flash MX 2004\n */\n this.clipCut = function () {\n };\n /**\n * @since Flash MX 2004\n * @param {Boolean} [bInPlace]\n */\n this.clipPaste = function (bInPlace) {\n };\n /**\n * @since Flash MX 2004\n * @param {Boolean} [bPromptToSaveChanges]\n */\n this.close = function (bPromptToSaveChanges) {\n };\n /**\n * @since Flash MX 2004\n */\n this.convertLinesToFills = function () {\n };\n /**\n * @since Flash MX 2004\n * @param {String} type\n * @param {String} name\n * @param {String} registrationPoint\n * @return SymbolItem\n */\n this.convertToSymbol = function (type, name, registrationPoint) {\n };\n /**\n * @since Flash 8\n * @return Boolean\n */\n this.crop = function () {\n };\n /**\n * @since Flash CS5\n * @param {Boolean} [abortIfErrorsExist]\n */\n this.debugMovie = function (abortIfErrorsExist) {\n };\n /**\n * @since Flash 8\n * @return Boolean\n */\n this.deleteEnvelope = function () {\n };\n /**\n * @since Flash MX 2004\n * @return Number\n */\n this.deletePublishProfile = function () {\n };\n /**\n * @since Flash MX 2004\n * @return Boolean\n */\n this.deleteScene = function () {\n };\n /**\n * @since Flash MX 2004\n */\n this.deleteSelection = function () {\n };\n /**\n * @since Flash 8\n */\n this.disableAllFilters = function () {\n };\n /**\n * @since Flash 8\n * @param {Number} filterIndex\n */\n this.disableFilter = function (filterIndex) {\n };\n /**\n * @since Flash 8\n * @param {Number} enabledFilterIndex\n */\n this.disableOtherFilters = function (enabledFilterIndex) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} distributeMode\n * @param {Boolean} [bUseDocumentBounds]\n */\n this.distribute = function (distributeMode, bUseDocumentBounds) {\n };\n /**\n * @since Flash MX 2004\n */\n this.distributeToLayers = function () {\n };\n /**\n * @since Flash MX 2004\n * @param {String} name\n * @return Boolean\n */\n this.documentHasData = function (name) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} [profileName]\n * @return Number\n */\n this.duplicatePublishProfile = function (profileName) {\n };\n /**\n * @since Flash MX 2004\n * @return Boolean\n */\n this.duplicateScene = function () {\n };\n /**\n * @since Flash MX 2004\n */\n this.duplicateSelection = function () {\n };\n /**\n * @since Flash MX 2004\n * @param {Number} index\n */\n this.editScene = function (index) {\n };\n /**\n * @since Flash 8\n */\n this.enableAllFilters = function () {\n };\n /**\n * @since Flash 8\n * @param {Number} filterIndex\n */\n this.enableFilter = function (filterIndex) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} [editMode]\n */\n this.enterEditMode = function (editMode) {\n };\n /**\n * @since Flash MX 2004\n */\n this.exitEditMode = function () {\n };\n /**\n * @since Flash CS6\n * @param {Number} frameNumber\n * @param {String} bitmapName\n */\n this.exportInstanceToLibrary = function (frameNumber, bitmapName) {\n };\n /**\n * @since Flash CS6\n * @param {String} outputURI\n * @param {Number} [startFrameNum]\n * @param {Number} [endFrameNum]\n * @param {Matrix} [matrix]\n */\n this.exportInstanceToPNGSequence = function (outputURI, startFrameNum, endFrameNum, matrix) {\n };\n /**\n * @since Flash 8\n * @param {String} fileURI\n * @param {Boolean} [bCurrentPNGSettings]\n * @param {Boolean} [bCurrentFrame]\n * @return Boolean\n */\n this.exportPNG = function (fileURI, bCurrentPNGSettings, bCurrentFrame) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} fileURI\n */\n this.exportPublishProfile = function (fileURI) {\n };\n /**\n * @since Flash CS4\n * @param {String} [profileName]\n * @return String\n */\n this.exportPublishProfileString = function (profileName) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} [fileURI]\n * @param {Boolean} [bCurrentSettings]\n */\n this.exportSWF = function (fileURI, bCurrentSettings) {\n };\n /**\n * @since Flash MX 2004\n * @return Boolean\n */\n this.getAlignToDocument = function () {\n };\n /**\n * @since Flash 8\n * @return String\n */\n this.getBlendMode = function () {\n };\n /**\n * @since Flash MX 2004\n * @param {String} [objectToFill]\n * @return Fill\n */\n this.getCustomFill = function (objectToFill) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} [locationOfStroke]\n * @return Stroke\n */\n this.getCustomStroke = function (locationOfStroke) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} name\n * @return Object\n */\n this.getDataFromDocument = function (name) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} propertyName\n * @return Object\n */\n this.getElementProperty = function (propertyName) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} attrName\n * @param {Number} [startIndex]\n * @param {Number} [endIndex]\n * @return Object\n */\n this.getElementTextAttr = function (attrName, startIndex, endIndex) {\n };\n /**\n * @since Flash 8\n * @return Array\n */\n this.getFilters = function () {\n };\n /**\n * @since Flash 8\n * @return String\n */\n this.getMetadata = function () {\n };\n /**\n * @since Flash CS3\n * @return String\n */\n this.getMobileSettings = function () {\n };\n /**\n * @since Flash CS3\n * @return String\n */\n this.getPlayerVersion = function () {\n };\n /**\n * @since Flash MX 2004\n * @return Object\n */\n this.getSelectionRect = function () {\n };\n /**\n * @since Flash CS6\n * @return String\n */\n this.getSWFPathFromProfile = function () {\n };\n /**\n * @since Flash MX 2004\n * @param {Number} [startIndex]\n * @param {Number} [endIndex]\n * @return String\n */\n this.getTextString = function (startIndex, endIndex) {\n };\n /**\n * @since Flash MX 2004\n * @return Timeline\n */\n this.getTimeline = function () {\n };\n /**\n * @since Flash MX 2004\n * @return Object\n */\n this.getTransformationPoint = function () {\n };\n /**\n * @since Flash MX 2004\n */\n this.group = function () {\n };\n /**\n * @since Flash 8\n * @param {String} fileURI\n * @param {Boolean} [importToLibrary]\n * @return Boolean\n */\n this.importFile = function (fileURI, importToLibrary) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} fileURI\n * @return Number\n */\n this.importPublishProfile = function (fileURI) {\n };\n /**\n * @since Flash CS4\n * @param {String} xmlString\n * @return Boolean\n */\n this.importPublishProfileString = function (xmlString) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} fileURI\n */\n this.importSWF = function (fileURI) {\n };\n /**\n * @since Flash 8\n * @return Boolean\n */\n this.intersect = function () {\n };\n /**\n * @since Flash CS5\n * @param {String} URI\n */\n this.loadCuepointXML = function (URI) {\n };\n /**\n * @since Flash MX 2004\n * @param {Boolean} bWidth\n * @param {Boolean} bHeight\n * @param {Boolean} [bUseDocumentBounds]\n */\n this.match = function (bWidth, bHeight, bUseDocumentBounds) {\n };\n /**\n * @since Flash MX 2004\n * @param {Object} position\n * @param {Boolean} bToggleSel\n * @param {Boolean} bShiftSel\n */\n this.mouseClick = function (position, bToggleSel, bShiftSel) {\n };\n /**\n * @since Flash MX 2004\n * @param {Object} position\n * @param {Boolean} bAltDown\n * @param {Boolean} bShiftDown\n * @param {Boolean} bShiftSelect\n */\n this.mouseDblClk = function (position, bAltDown, bShiftDown, bShiftSelect) {\n };\n /**\n * @since Flash MX 2004\n * @param {Object} delta\n */\n this.moveSelectedBezierPointsBy = function (delta) {\n };\n /**\n * @since Flash MX 2004\n * @param {Object} distanceToMove\n */\n this.moveSelectionBy = function (distanceToMove) {\n };\n /**\n * @since Flash MX 2004\n * @param {Number} smoothing\n * @param {Boolean} bUseMultiplePasses\n */\n this.optimizeCurves = function (smoothing, bUseMultiplePasses) {\n };\n /**\n * @since Flash MX 2004\n */\n this.publish = function () {\n };\n /**\n * @since Flash 8\n * @return Boolean\n */\n this.punch = function () {\n };\n /**\n * @since Flash 8\n */\n this.removeAllFilters = function () {\n };\n /**\n * @since Flash MX 2004\n * @param {String} name\n */\n this.removeDataFromDocument = function (name) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} name\n */\n this.removeDataFromSelection = function (name) {\n };\n /**\n * @since Flash 8\n * @param {Number} filterIndex\n */\n this.removeFilter = function (filterIndex) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} [profileNewName]\n * @return Boolean\n */\n this.renamePublishProfile = function (profileNewName) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} name\n * @return Boolean\n */\n this.renameScene = function (name) {\n };\n /**\n * @since Flash MX 2004\n * @param {Number} sceneToMove\n * @param {Number} sceneToPutItBefore\n */\n this.reorderScene = function (sceneToMove, sceneToPutItBefore) {\n };\n /**\n * @since Flash CS3\n */\n this.resetOvalObject = function () {\n };\n /**\n * @since Flash CS3\n */\n this.resetRectangleObject = function () {\n };\n /**\n * @since Flash MX 2004\n */\n this.resetTransformation = function () {\n };\n /**\n * @since Flash MX 2004\n */\n this.revert = function () {\n };\n /**\n * @since Flash CS4\n * @param {Object} xyzCoordinate\n * @param {Boolean} bGlobalTransform\n */\n this.rotate3DSelection = function (xyzCoordinate, bGlobalTransform) {\n };\n /**\n * @since Flash MX 2004\n * @param {Number} angle\n * @param {String} [rotationPoint]\n */\n this.rotateSelection = function (angle, rotationPoint) {\n };\n /**\n * @since Flash MX 2004\n * @param {Boolean} [bOkToSaveAs]\n * @return Boolean\n */\n this.save = function (bOkToSaveAs) {\n };\n /**\n * @since Flash CS6\n * @param {String} URI\n * @param {Boolean} [selectionOnly]\n * @return Boolean\n */\n this.saveAsCopy = function (URI, selectionOnly) {\n };\n /**\n * @since Flash MX 2004\n * @param {Boolean} [bOkToSaveAs]\n * @return Boolean\n */\n this.saveAndCompact = function (bOkToSaveAs) {\n };\n /**\n * @since Flash MX 2004\n * @param {Number} xScale\n * @param {Number} yScale\n * @param {String} whichCorner\n */\n this.scaleSelection = function (xScale, yScale, whichCorner) {\n };\n /**\n * @since Flash MX 2004\n */\n this.selectAll = function () {\n };\n /**\n * @since Flash MX 2004\n */\n this.selectNone = function () {\n };\n /**\n * @since Flash MX 2004\n * @param {Boolean} bToStage\n */\n this.setAlignToDocument = function (bToStage) {\n };\n /**\n * @since Flash 8\n * @param {String} mode\n */\n this.setBlendMode = function (mode) {\n };\n /**\n * @since Flash MX 2004\n * @param {Fill} fill\n */\n this.setCustomFill = function (fill) {\n };\n /**\n * @since Flash MX 2004\n * @param {Stroke} stroke\n */\n this.setCustomStroke = function (stroke) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} property\n * @param {Object} value\n */\n this.setElementProperty = function (property, value) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} attrName\n * @param {Object} attrValue\n * @param {Number} [startIndex]\n * @param {Number} [endIndex]\n * @return Boolean\n */\n this.setElementTextAttr = function (attrName, attrValue, startIndex, endIndex) {\n };\n /**\n * @since Flash MX 2004\n * @param {Object} color\n */\n this.setFillColor = function (color) {\n };\n /**\n * @since Flash 8\n * @param {String} property\n * @param {Number} filterIndex\n * @param {Object} value\n */\n this.setFilterProperty = function (property, filterIndex, value) {\n };\n /**\n * @since Flash 8\n * @param {Array} filterArray\n */\n this.setFilters = function (filterArray) {\n };\n /**\n * @since Flash MX 2004\n * @param {Number} opacity\n */\n this.setInstanceAlpha = function (opacity) {\n };\n /**\n * @since Flash MX 2004\n * @param {Number} brightness\n */\n this.setInstanceBrightness = function (brightness) {\n };\n /**\n * @since Flash MX 2004\n * @param {Object} color\n * @param {Number} strength\n */\n this.setInstanceTint = function (color, strength) {\n };\n /**\n * @since Flash 8\n * @param {String} strMetadata\n * @return Boolean\n */\n this.setMetadata = function (strMetadata) {\n };\n /**\n * @since Flash CS3\n * @param {String} xmlString\n * @return Boolean\n */\n this.setMobileSettings = function (xmlString) {\n };\n /**\n * @since Flash CS3\n * @param {String} propertyName\n * @param {Object} value\n */\n this.setOvalObjectProperty = function (propertyName, value) {\n };\n /**\n * @since Flash CS3\n * @param {String} version\n * @return Boolean\n */\n this.setPlayerVersion = function (version) {\n };\n /**\n * @since Flash CS3\n * @param {String} propertyName\n * @param {Object} value\n */\n this.setRectangleObjectProperty = function (propertyName, value) {\n };\n /**\n * @since Flash MX 2004\n * @param {Object} boundingRectangle\n * @param {Boolean} [bContactSensitiveSelection]\n */\n this.setSelectionBounds = function (boundingRectangle, bContactSensitiveSelection) {\n };\n /**\n * @since Flash MX 2004\n * @param {Object} rect\n * @param {Boolean} [bReplaceCurrentSelection]\n * @param {Boolean} [bContactSensitiveSelection]\n */\n this.setSelectionRect = function (rect, bReplaceCurrentSelection, bContactSensitiveSelection) {\n };\n /**\n * @since Flash CS4\n * @param {Object} point\n */\n this.setStageVanishingPoint = function (point) {\n };\n /**\n * @since Flash CS4\n * @param {Number} angle\n */\n this.setStageViewAngle = function (angle) {\n };\n /**\n * @since Flash MX 2004\n * @param {Object} color\n * @param {Number} size\n * @param {String} strokeType\n */\n this.setStroke = function (color, size, strokeType) {\n };\n /**\n * @since Flash MX 2004\n * @param {Object} color\n */\n this.setStrokeColor = function (color) {\n };\n /**\n * @since Flash MX 2004\n * @param {Number} size\n */\n this.setStrokeSize = function (size) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} strokeType\n */\n this.setStrokeStyle = function (strokeType) {\n };\n /**\n * @since Flash MX 2004\n * @param {Object} boundingRectangle\n * @return Boolean\n */\n this.setTextRectangle = function (boundingRectangle) {\n };\n /**\n * @since Flash MX 2004\n * @param {Number} startIndex\n * @param {Number} endIndex\n * @return Boolean\n */\n this.setTextSelection = function (startIndex, endIndex) {\n };\n /**\n * @since Flash MX 2004\n * @param {String} text\n * @param {Number} [startIndex]\n * @param {Number} [endIndex]\n * @return Boolean\n */\n this.setTextString = function (text, startIndex, endIndex) {\n };\n /**\n * @since Flash MX 2004\n * @param {Object} transformationPoint\n */\n this.setTransformationPoint = function (transformationPoint) {\n };\n /**\n * @since Flash MX 2004\n * @param {Number} xSkew\n * @param {Number} ySkew\n * @param {String} whichEdge\n */\n this.skewSelection = function (xSkew, ySkew, whichEdge) {\n };\n /**\n * @since Flash MX 2004\n */\n this.smoothSelection = function () {\n };\n /**\n * @since Flash MX 2004\n * @param {String} direction\n * @param {Boolean} [bUseDocumentBounds]\n */\n this.space = function (direction, bUseDocumentBounds) {\n };\n /**\n * @since Flash MX 2004\n */\n this.straightenSelection = function () {\n };\n /**\n * @since Flash MX 2004\n * @param {String} name\n */\n this.swapElement = function (name) {\n };\n /**\n * @since Flash 8\n */\n this.swapStrokeAndFill = function () {\n };\n /**\n * @since Flash MX 2004\n * @param {Boolean} [abortIfErrorsExist]\n */\n this.testMovie = function (abortIfErrorsExist) {\n };\n /**\n * @since Flash MX 2004\n */\n this.testScene = function () {\n };\n /**\n * @since Flash MX 2004\n * @param {Number} threshold\n * @param {Number} minimumArea\n * @param {String} curveFit\n * @param {String} cornerThreshold\n */\n this.traceBitmap = function (threshold, minimumArea, curveFit, cornerThreshold) {\n };\n /**\n * @since Flash MX 2004\n * @param {Number} a\n * @param {Number} b\n * @param {Number} c\n * @param {Number} d\n */\n this.transformSelection = function (a, b, c, d) {\n };\n /**\n * @since Flash CS4\n * @param {Object} xyzCoordinate\n */\n this.translate3DCenter = function (xyzCoordinate) {\n };\n /**\n * @since Flash CS4\n * @param {Object} xyzCoordinate\n * @param {Boolean} bGlobalTransform\n */\n this.translate3DSelection = function (xyzCoordinate, bGlobalTransform) {\n };\n /**\n * @since Flash MX 2004\n */\n this.unGroup = function () {\n };\n /**\n * @since Flash 8\n * @return Boolean\n */\n this.union = function () {\n };\n /**\n * @since Flash MX 2004\n */\n this.unlockAllElements = function () {\n };\n /**\n * @since Flash MX 2004\n * @param {String} fileURI\n * @return Object\n */\n this.xmlPanel = function (fileURI) {\n };\n}", "function VNode() {}", "function Visitor(doc) {\n\tthis.stack = [];\n\tthis.parent = doc; //always a list item\n\tthis.node = doc.head();\n\tthis.index = 0;\n\tthis.point = 1;\n\tthis.retained = 0;\n\tthis.ops = []; //to get to the doc\n}", "document (source) {\n this.documentation = new Documentation(source, this);\n return this;\n }", "onparserinit(){\n this.document = new XNode('document', { format: this.options.format })\n this._tagStack = [this.document]\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function Document() {\n this.content = [];\n}", "static getInstanceFromDoc(doc) {\n return {\n id: doc.id,\n name: doc.data().name,\n description: doc.data().description,\n channels: doc.data().channels,\n categories: doc.data().categories,\n logo: doc.data().logo,\n rank: doc.data().rank,\n schedules: doc.data().schedules,\n year: doc.data().year\n }\n }", "function parse(doc) {\n var file = vfile(doc);\n var Parser;\n\n freeze();\n Parser = processor.Parser;\n assertParser('parse', Parser);\n\n if (newable(Parser)) {\n return new Parser(String(file), file).parse();\n }\n\n return Parser(String(file), file); // eslint-disable-line new-cap\n }", "function TViewNode() {}", "function TViewNode() {}", "function TViewNode() {}", "function Document(Animal)\n{\n this.Animal=Animal;\n}", "function parse(doc) {\n var file = vfile(doc);\n var Parser;\n\n freeze();\n Parser = processor.Parser;\n assertParser('parse', Parser);\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "atDocument() {\n const res = new Directives(this.yaml, this.tags);\n switch (this.yaml.version) {\n case '1.1':\n this.atNextDocument = true;\n break;\n case '1.2':\n this.atNextDocument = false;\n this.yaml = {\n explicit: Directives.defaultYaml.explicit,\n version: '1.2'\n };\n this.tags = Object.assign({}, Directives.defaultTags);\n break;\n }\n return res;\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }", "function parseVastSource(source){\n\t\tvar xdoc, parser;\n\t\t\n\t\tparser = new DOMParser();\n\t\txdoc = parser.parseFromString(source, 'text/xml');\n\t\t\n\t\treturn new VastDoc(xdoc);\n\t\n\t}", "function TViewNode(){}", "atDocument() {\n const res = new Directives(this.yaml, this.tags);\n switch (this.yaml.version) {\n case '1.1':\n this.atNextDocument = true;\n break;\n case '1.2':\n this.atNextDocument = false;\n this.yaml = {\n explicit: Directives.defaultYaml.explicit,\n version: '1.2'\n };\n this.tags = Object.assign({}, Directives.defaultTags);\n break;\n }\n return res;\n }", "function Doc(xml, json, conf) {\n this.xml = xml;\n this.json = json;\n this.conf = conf;\n }", "function TView() {}", "function TView() {}", "function TView() {}", "get doc() {\n return this.node(0);\n }", "static deserialize(obj, params) {\n // TODO add properties here?\n const result = new Document(params);\n result.tagIndex = obj.tag;\n result.register = obj.reg;\n result.store = obj.store;\n result.field = obj.field;\n Object.entries(obj.index).forEach(([key, exportedIndex]) => {\n result.index[key] = Index.deserialize(exportedIndex);\n result.index[key].register = obj.reg;\n });\n return result;\n }", "constructor(doc) {\n _defineProperty(this, \"mutations\", void 0);\n\n _defineProperty(this, \"document\", void 0);\n\n _defineProperty(this, \"LOCAL\", void 0);\n\n _defineProperty(this, \"commits\", void 0);\n\n _defineProperty(this, \"buffer\", void 0);\n\n _defineProperty(this, \"onMutation\", void 0);\n\n _defineProperty(this, \"onRebase\", void 0);\n\n _defineProperty(this, \"onDelete\", void 0);\n\n _defineProperty(this, \"commitHandler\", void 0);\n\n _defineProperty(this, \"committerRunning\", void 0);\n\n _defineProperty(this, \"onConsistencyChanged\", void 0);\n\n this.buffer = new _SquashingBuffer.default(doc);\n this.document = new _Document.default(doc);\n\n this.document.onMutation = msg => this.handleDocMutation(msg);\n\n this.document.onRebase = (msg, remoteMutations, localMutations) => this.handleDocRebase(msg, remoteMutations, localMutations);\n\n this.document.onConsistencyChanged = msg => this.handleDocConsistencyChanged(msg);\n\n this.LOCAL = doc;\n this.mutations = [];\n this.commits = [];\n }", "function TViewNode() { }", "function TViewNode() { }", "function DocumentNode(body, loc) {\n this.type = \"Document\";\n this.body = body;\n this.loc = loc;\n}", "clone() {\n const copy = Object.create(Document.prototype, {\n [NODE_TYPE]: { value: DOC }\n });\n copy.commentBefore = this.commentBefore;\n copy.comment = this.comment;\n copy.errors = this.errors.slice();\n copy.warnings = this.warnings.slice();\n copy.options = Object.assign({}, this.options);\n if (this.directives)\n copy.directives = this.directives.clone();\n copy.schema = this.schema.clone();\n copy.contents = isNode(this.contents)\n ? this.contents.clone(copy.schema)\n : this.contents;\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "constructor(doc) {\n this.doc = doc;\n this.cursorPos = 0;\n this.string = \"\";\n this.cursor = doc.iter();\n }", "clone() {\n const copy = Object.create(Document.prototype, {\n [identity.NODE_TYPE]: { value: identity.DOC }\n });\n copy.commentBefore = this.commentBefore;\n copy.comment = this.comment;\n copy.errors = this.errors.slice();\n copy.warnings = this.warnings.slice();\n copy.options = Object.assign({}, this.options);\n if (this.directives)\n copy.directives = this.directives.clone();\n copy.schema = this.schema.clone();\n // @ts-expect-error We can't really know that this matches Contents.\n copy.contents = identity.isNode(this.contents)\n ? this.contents.clone(copy.schema)\n : this.contents;\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "parseDocument() {\n return this.node(this._lexer.token, {\n kind: Kind.DOCUMENT,\n definitions: this.many(\n TokenKind.SOF,\n this.parseDefinition,\n TokenKind.EOF,\n ),\n });\n }", "constructor(document = {}) {\n if (!document.sketchObject) {\n const app = NSDocumentController.sharedDocumentController()\n app.newDocument(Document)\n // eslint-disable-next-line no-param-reassign\n document.sketchObject = app.currentDocument()\n }\n\n super(document)\n }", "constructor(doc2) {\n this.doc = doc2;\n this.steps = [];\n this.docs = [];\n this.mapping = new Mapping();\n }", "getDoc () { return this.doc }", "getDoc () { return this.doc }", "getDoc () { return this.doc }", "newDocument() {\n var app = NSDocumentController.sharedDocumentController()\n app.newDocument_(this)\n return new Document(app.currentDocument(), this)\n\n }", "function DOMObject(){}", "static create(doc2, anchor, head = anchor) {\n let $anchor = doc2.resolve(anchor);\n return new this($anchor, head == anchor ? $anchor : doc2.resolve(head));\n }", "createView() {\n const doc2 = createDocument(this.options.content, this.schema, this.options.parseOptions);\n const selection = resolveFocusPosition(doc2, this.options.autofocus);\n this.view = new EditorView(this.options.element, {\n ...this.options.editorProps,\n dispatchTransaction: this.dispatchTransaction.bind(this),\n state: EditorState.create({\n doc: doc2,\n selection: selection || void 0\n })\n });\n const newState = this.state.reconfigure({\n plugins: this.extensionManager.plugins\n });\n this.view.updateState(newState);\n this.createNodeViews();\n const dom = this.view.dom;\n dom.editor = this;\n }", "function Visitor() {}", "function Visitor() {}", "function Visitor() {}", "get doc() {\n return sketch.fromNative(context.document);\n }", "function TView() { }", "function TView() { }", "function create(textDocument, edits) {\n return {\n textDocument: textDocument,\n edits: edits\n };\n }", "function create(textDocument, edits) {\n return {\n textDocument: textDocument,\n edits: edits\n };\n }", "function create(textDocument, edits) {\n return {\n textDocument: textDocument,\n edits: edits\n };\n }", "function create(uri, languageId, version, content) {\n return new FullTextDocument(uri, languageId, version, content);\n }", "function create(uri, languageId, version, content) {\n return new FullTextDocument(uri, languageId, version, content);\n }", "function create(uri, languageId, version, content) {\n return new FullTextDocument(uri, languageId, version, content);\n }", "constructor() {\n\t\t/**\n\t\t * Selection done on this document.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/view/documentselection~DocumentSelection} module:engine/view/document~Document#selection\n\t\t */\n\t\tthis.selection = new DocumentSelection();\n\n\t\t/**\n\t\t * Roots of the view tree. Collection of the {@link module:engine/view/element~Element view elements}.\n\t\t *\n\t\t * View roots are created as a result of binding between {@link module:engine/view/document~Document#roots} and\n\t\t * {@link module:engine/model/document~Document#roots} and this is handled by\n\t\t * {@link module:engine/controller/editingcontroller~EditingController}, so to create view root we need to create\n\t\t * model root using {@link module:engine/model/document~Document#createRoot}.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:utils/collection~Collection} module:engine/view/document~Document#roots\n\t\t */\n\t\tthis.roots = new Collection( { idProperty: 'rootName' } );\n\n\t\t/**\n\t\t * Defines whether document is in read-only mode.\n\t\t *\n\t\t * When document is read-ony then all roots are read-only as well and caret placed inside this root is hidden.\n\t\t *\n\t\t * @observable\n\t\t * @member {Boolean} #isReadOnly\n\t\t */\n\t\tthis.set( 'isReadOnly', false );\n\n\t\t/**\n\t\t * True if document is focused.\n\t\t *\n\t\t * This property is updated by the {@link module:engine/view/observer/focusobserver~FocusObserver}.\n\t\t * If the {@link module:engine/view/observer/focusobserver~FocusObserver} is disabled this property will not change.\n\t\t *\n\t\t * @readonly\n\t\t * @observable\n\t\t * @member {Boolean} module:engine/view/document~Document#isFocused\n\t\t */\n\t\tthis.set( 'isFocused', false );\n\n\t\t/**\n\t\t * True if composition is in progress inside the document.\n\t\t *\n\t\t * This property is updated by the {@link module:engine/view/observer/compositionobserver~CompositionObserver}.\n\t\t * If the {@link module:engine/view/observer/compositionobserver~CompositionObserver} is disabled this property will not change.\n\t\t *\n\t\t * @readonly\n\t\t * @observable\n\t\t * @member {Boolean} module:engine/view/document~Document#isComposing\n\t\t */\n\t\tthis.set( 'isComposing', false );\n\n\t\t/**\n\t\t * Post-fixer callbacks registered to the view document.\n\t\t *\n\t\t * @private\n\t\t * @member {Set}\n\t\t */\n\t\tthis._postFixers = new Set();\n\t}", "function TView(){}", "function create(textDocument, edits) {\r\n return { textDocument: textDocument, edits: edits };\r\n }", "function create(textDocument, edits) {\r\n return { textDocument: textDocument, edits: edits };\r\n }", "constructor(document, settings) {\n this.document = document\n this.settings = settings\n this.pages = []\n }", "function create(textDocument, edits) {\r\n return { textDocument: textDocument, edits: edits };\r\n }", "function create(textDocument, edits) {\r\n return { textDocument: textDocument, edits: edits };\r\n }", "function create(textDocument, edits) {\r\n return { textDocument: textDocument, edits: edits };\r\n }", "function create(textDocument, edits) {\r\n return { textDocument: textDocument, edits: edits };\r\n }", "function create(uri, languageId, version, content) {\r\n return new FullTextDocument(uri, languageId, version, content);\r\n }", "function create(uri, languageId, version, content) {\r\n return new FullTextDocument(uri, languageId, version, content);\r\n }", "function DocumentNode(body, loc) {\n this.type = \"Document\";\n this.body = body;\n this.loc = loc;\n }", "function Parser(doc, file) {\n this.file = file;\n this.offset = {};\n this.options = xtend(this.options);\n this.setOptions({});\n\n this.inList = false;\n this.inBlock = false;\n this.inLink = false;\n this.atStart = true;\n\n this.toOffset = vfileLocation(file).toOffset;\n this.unescape = unescape(this, 'escape');\n this.decode = decode(this);\n}", "function create(uri, languageId, version, content) {\r\n return new FullTextDocument(uri, languageId, version, content);\r\n }", "function create(uri, languageId, version, content) {\r\n return new FullTextDocument(uri, languageId, version, content);\r\n }", "function create(uri, languageId, version, content) {\r\n return new FullTextDocument(uri, languageId, version, content);\r\n }", "function create(uri, languageId, version, content) {\r\n return new FullTextDocument(uri, languageId, version, content);\r\n }", "constructor() { \n \n DocumentWithoutSegments.initialize(this);\n }", "function create(uri, languageId, version, content) {\n return new FullTextDocument(uri, languageId, version, content);\n }", "_cloneDocument() {\n const copy = documents.createImpl(\n this._globalObject,\n {\n contentType: this.contentType,\n encoding: this._encoding,\n parsingMode: this._parsingMode\n }\n );\n\n copy._URL = this._URL;\n copy._origin = this._origin;\n return copy;\n }", "function mainImpl(doc) {\n\n}", "constructor() {\n this.rootNode = {};\n }", "createDocument(content, a2) {\n let options = {};\n\n errors.assertArgCount(arguments, 1, 2);\n errors.assertParamValue(Buffer.isBuffer(content) ||\n typeof content === 'string' || nodbUtil.isObject(content), 1);\n if (arguments.length > 1) {\n errors.assertParamValue(nodbUtil.isObject(a2), 2);\n options = a2;\n errors.assertParamPropString(options, 2, \"key\");\n errors.assertParamPropString(options, 2, \"mediaType\");\n }\n\n if (typeof content === 'string') {\n content = Buffer.from(content);\n } else if (nodbUtil.isObject(content)) {\n content = Buffer.from(JSON.stringify(content));\n }\n\n const doc = new SodaDocument();\n doc._impl = this._impl.createDocument(content, options);\n return doc;\n }", "createObject(xmlNode){\n\t\treturn this.parser.createObject(xmlNode);\n\t}", "createObject(xmlNode){\n\t\treturn this.parser.createObject(xmlNode);\n\t}", "function Document() {\n\n}", "function create(uri, languageId, version, content) {\n return new FullTextDocument(uri, languageId, version, content);\n }", "function create(uri, languageId, version, content) {\n return new FullTextDocument(uri, languageId, version, content);\n }", "function Doc(filename,abspath, grunt) {\n this.grunt = grunt;\n this.filename = filename;\n this.abspath = abspath;\n this.base = undefined;\n this.baseDoc = undefined;\n this.folder = abspath.substring(0,abspath.length - filename.length).replace(\"apidoc/\",\"api/\");\n this.schemefolder = abspath.substring(0,abspath.length - filename.length).replace(\"apidoc/\",\"database/schemes/\");\n this.testfolder = this.folder.replace(\"api/\",\"test/\");\n this.generatedDocsFolder = this.folder.replace(\"api/\",\"generated/\");\n this.version = undefined;\n this.filetitle = undefined;\n this.model = undefined;\n this.json = {};\n this.supportedMethods = [];\n this.readFile(grunt);\n}", "function Visitor() {\r\n}", "function create(textDocument, edits) {\n return { textDocument: textDocument, edits: edits };\n }", "function Obj() {}", "constructor(doc2) {\n super(doc2.resolve(0), doc2.resolve(doc2.content.size));\n }", "constructur() {}" ]
[ "0.64372015", "0.629957", "0.629957", "0.629957", "0.629957", "0.629957", "0.6142987", "0.59593993", "0.5926811", "0.58568805", "0.5801582", "0.5785759", "0.5785759", "0.5785759", "0.5785759", "0.5785759", "0.5781909", "0.57804894", "0.57797796", "0.5776937", "0.5776937", "0.5776937", "0.57585186", "0.57366204", "0.57361436", "0.5735583", "0.5735583", "0.5735583", "0.5703906", "0.56909853", "0.5682974", "0.56787735", "0.56603754", "0.56603754", "0.56603754", "0.5651012", "0.5601889", "0.55900764", "0.55391914", "0.55391914", "0.5529934", "0.5503541", "0.5499482", "0.5498796", "0.549412", "0.5482086", "0.54781055", "0.54655343", "0.54655343", "0.54655343", "0.5463357", "0.5452323", "0.5436499", "0.54357636", "0.5433449", "0.5433449", "0.5433449", "0.5427956", "0.5413431", "0.5413431", "0.54132", "0.54132", "0.54132", "0.54071605", "0.54071605", "0.54071605", "0.54071575", "0.53970563", "0.539656", "0.539656", "0.539384", "0.53849673", "0.53849673", "0.53849673", "0.53849673", "0.5384625", "0.5384625", "0.5370258", "0.53534824", "0.5346967", "0.5346967", "0.5346967", "0.5346967", "0.53461725", "0.53452927", "0.53440976", "0.53284883", "0.5316871", "0.53122246", "0.53110397", "0.53110397", "0.53070074", "0.5304063", "0.5304063", "0.53036493", "0.5300822", "0.5294046", "0.5292955", "0.529006", "0.5280928" ]
0.6895495
0
Actual VAST parsing code
function parseVastSource(source){ var xdoc, parser; parser = new DOMParser(); xdoc = parser.parseFromString(source, 'text/xml'); return new VastDoc(xdoc); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function VNode() {}", "function parseStatement() {}", "analyze(lexer){ return null }", "function Parser() {\n\n}", "visitNode(node) { }", "function parse(p,src){\n var st = new ParserState(src),\n r = p.runParser(st);\n return r.getAst();\n }", "function traverseAST(astNode){\n\t // .. recursively expand them.\n if(astNode.name!='block'){\n \t//????? cry????\n }else if(astNode.name=='block'){\n \tanalyzeBlock(astNode);\n\n \t}//eo if else\n }//eo traverseCST", "function Parser() {\n}", "function Parser() {\n}", "analyze(lexer, current=lexer.next()){}", "function handleSegment(segment) {\n if (segment[1].text == 'null') {\n return { intertype: 'value', ident: '0', type: 'i32' };\n } else if (segment[1].text == 'zeroinitializer') {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'emptystruct', type: segment[0].text };\n } else if (segment[1].text in PARSABLE_LLVM_FUNCTIONS) {\n return parseLLVMFunctionCall(segment);\n } else if (segment[1].type && segment[1].type == '{') {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'struct', type: segment[0].text, contents: handleSegments(segment[1].tokens) };\n } else if (segment[1].type && segment[1].type == '<') {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'struct', type: segment[0].text, contents: handleSegments(segment[1].item.tokens[0].tokens) };\n } else if (segment[1].type && segment[1].type == '[') {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'list', type: segment[0].text, contents: handleSegments(segment[1].item.tokens) };\n } else if (segment.length == 2) {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'value', type: segment[0].text, ident: toNiceIdent(segment[1].text) };\n } else if (segment[1].text === 'c') {\n // string\n var text = segment[2].text;\n text = text.substr(1, text.length-2);\n return { intertype: 'string', text: text, type: 'i8*' };\n } else if (segment[1].text === 'blockaddress') {\n return parseBlockAddress(segment);\n } else {\n throw 'Invalid segment: ' + dump(segment);\n }\n }", "function Parser() {\n\n\tvar VISIBILITY_TOKENS = [ 'Show', 'Hide' ];\n var CONTINUE_TOKEN = 'Continue';\n\tvar FILTER_TOKENS = [\n 'ItemLevel', 'DropLevel', 'Quality', 'Rarity', 'Class', 'BaseType', 'Sockets', 'LinkedSockets', 'SocketGroup',\n 'Width', 'Height', 'Identified', 'Corrupted', 'ElderItem', 'ShaperItem', 'ShapedMap', 'HasExplicitMod', 'MapTier',\n 'GemLevel', 'StackSize', 'ElderMap', 'Prophecy', 'FracturedItem', 'SynthesisedItem', 'AnyEnchantment', 'HasEnchantment',\n 'BlightedMap', 'HasInfluence',\n 'Mirrored', 'CorruptedMods', 'AreaLevel',\n 'EnchantmentPassiveNode',\n 'AlternateQuality', 'Replica', 'GemQualityType',\n 'EnchantmentPassiveNum',\n ];\n\tvar MODIFIER_TOKENS = [\n\t 'SetBackgroundColor', 'SetBorderColor', 'SetTextColor', 'PlayAlertSound', 'PlayAlertSoundPositional',\n\t 'SetFontSize', 'DisableDropSound', 'CustomAlertSound', 'MinimapIcon', 'PlayEffect' ];\n\tvar RARITY_TOKENS = [ 'Normal', 'Magic', 'Rare', 'Unique' ];\n var INFLUENCE_TOKENS = [ 'shaper', 'elder', 'crusader', 'redeemer', 'hunter', 'warlord' ];\n\tvar SOUND_TOKENS = [ 'ShAlchemy', 'ShBlessed', 'ShChaos', 'ShDivine', 'ShExalted', 'ShFusing', 'ShGeneral', 'ShMirror', 'ShRegal', 'ShVaal' ];\n var COLOR_TOKENS = [ 'Red', 'Green', 'Blue', 'Brown', 'White', 'Yellow', 'Grey', 'Pink', 'Cyan', 'Purple', 'Orange' ]\n var ICON_SHAPE_TOKENS = [ 'Circle', 'Diamond', 'Hexagon', 'Square', 'Star', 'Triangle', 'Kite', 'Cross', 'Pentagon', 'Moon', 'UpsideDownHouse' ]\n\n\tthis.currentLineNr = 0;\n\tthis.currentRule = null;\n\n\tthis.ruleSet = [];\n\tthis.errors = [];\n\tthis.warnings = [];\n\tthis.lineTypes = [];\n \n // clear last stored area level when getting new parser\n currentAreaLevel = null;\n this.setAreaLevel = function(level) {\n currentAreaLevel = level;\n } \n\n\tthis.parse = function (lines) {\n\t\tthis.currentRule = null;\n\t\tthis.ruleSet = [];\n\t\tthis.errors = [];\n\t\tthis.warnings = [];\n\t\tthis.lineTypes = [];\n\n\t\tfor (var i = 0; i < lines.length; i++) {\n \n if(this.errors.length > 100) {\n // too many errors, this probably isn't a valid filter - stop now\n break;\n }\n \n\t\t\tthis.currentLineNr = i;\n\t\t\tvar line = lines[i];\n\n\t\t\tif (line.trim() === '') {\n\t\t\t\tthis.lineTypes[i] = 'Empty';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (line.trim()[0] === '#') {\n\t\t\t\tthis.lineTypes[i] = 'Comment';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tline = removeComment( line );\n\n\t\t\tif (VISIBILITY_TOKENS.indexOf( line.trim() ) >= 0) {\n\t\t\t\tif (this.currentRule !== null) {\n\t\t\t\t\tparseEndOfRule( this );\n\t\t\t\t}\n\t\t\t\tparseVisibility( this, line );\n\t\t\t}\n\t\t\telse if (CONTINUE_TOKEN === line.trim()) {\n\t\t\t\tif (this.currentRule !== null) {\n this.currentRule.continue = true;\n\t\t\t\t\tparseEndOfRule( this );\n\t\t\t\t} else {\n reportParseError( this, line.trim(), 'Continue without current rule' );\n }\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (this.currentRule === null) {\n\t\t\t\t\treportTokenError( this, line.trim(), 'Show or Hide' );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tparseFilterOrModifier( this, line );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.currentRule !== null) {\n\t\t\t\tthis.currentRule.codeLines.push( i );\n\t\t\t}\n\t\t}\n\t\tparseEndOfRule( this );\n\t};\n\n\tfunction removeComment (line) {\n\t\tvar commentStart = line.indexOf(\"#\");\n\t\tif (commentStart < 0) {\n\t\t\treturn line;\n\t\t}\n\t\treturn line.substring( 0, commentStart );\n\t}\n\n\tfunction parseVisibility (self, line) {\n\t\tvar token = line.trim();\n\t\tif (VISIBILITY_TOKENS.indexOf( token ) < 0) {\n\t\t\treportTokenError( self, token, 'Show or Hide' );\n\t\t\treturn;\n\t\t}\n\n\t\tself.lineTypes[self.currentLineNr] = 'Visibility';\n\t\tself.currentRule = new Rule();\n\t}\n\n\tfunction parseEndOfRule (self) {\n\t\tif (self.currentRule !== null) {\n\t\t\tself.ruleSet.push( self.currentRule );\n\t\t\tself.currentRule = null;\n\t\t}\n\t}\n\n\tfunction parseFilterOrModifier (self, line) {\n\t\tvar tokens = line.trim().split(' ', 1);\n\n\t\tif (tokens.length == 0) {\n\t\t\treportTokenError( self, '', 'filter or modifier' );\n\t\t\treturn;\n\t\t}\n\n\t\tvar token = tokens[0].trim();\n\t\tvar arguments = line.trim().substring( token.length, line.length );\n\n\t\tif (FILTER_TOKENS.indexOf( token ) >= 0) {\n\t\t\tparseFilter( self, token, arguments );\n\t\t}\n\t\telse if (MODIFIER_TOKENS.indexOf( token ) >= 0) {\n\t\t\tparseModifier( self, token, arguments );\n\t\t}\n\t\telse {\n\t\t\treportTokenError( self, token, 'filter or modifier' );\n\t\t}\n\t}\n\n\t// ----------- FILTERS ---------------------------------------------------\n\n\tfunction parseFilter (self, token, arguments) {\n\t\tself.lineTypes[self.currentLineNr] = 'Filter';\n\n\t\tvar filters = {\n\t\t\t'ItemLevel': ItemLevelFilter,\n\t\t\t'DropLevel': DropLevelFilter,\n\t\t\t'Quality': QualityFilter,\n\t\t\t'Rarity': RarityFilter,\n\t\t\t'Class': ClassFilter,\n\t\t\t'BaseType': BaseTypeFilter,\n\t\t\t'LinkedSockets': LinkedSocketsFilter,\n \n // this is intentional - with 3.9 filter type update,\n // much of the logic for between two filters is shared\n\t\t\t'Sockets': SocketGroupFilter,\n\t\t\t'SocketGroup': SocketGroupFilter,\n \n\t\t\t'Width': WidthFilter,\n\t\t\t'Height': HeightFilter,\n\t\t\t'Identified': IdentifiedFilter,\n\t\t\t'Corrupted': CorruptedFilter,\n\t\t\t'ElderItem': ElderItemFilter,\n\t\t\t'ShaperItem': ShaperItemFilter,\n\t\t\t'ShapedMap': ShapedMapFilter,\n\t\t\t'ElderMap': ElderMapFilter,\n\t\t\t'HasExplicitMod': HasExplicitModFilter,\n\t\t\t'MapTier': MapTierFilter,\n\t\t\t'GemLevel': GemLevelFilter,\n\t\t\t'StackSize': StackSizeFilter,\n 'Prophecy': ProphecyFilter,\n 'FracturedItem': FracturedItemFilter,\n 'SynthesisedItem': SynthesisedItemFilter,\n 'AnyEnchantment': AnyEnchantmentFilter,\n 'HasEnchantment': HasEnchantmentFilter,\n 'BlightedMap': BlightedMapFilter,\n 'HasInfluence' : HasInfluenceFilter,\n 'Mirrored' : MirroredFilter,\n 'CorruptedMods' : CorruptedModsFilter,\n 'AreaLevel' : AreaLevelFilter,\n 'EnchantmentPassiveNode' : HasEnchantmentFilter,\n 'AlternateQuality' : AlternateQualityFilter,\n 'Replica' : ReplicaFilter,\n 'GemQualityType' : GemQualityTypeFilter,\n 'EnchantmentPassiveNum' : EnchantmentPassiveNumFilter\n\t\t};\n\n\t\tswitch (token) {\n\t\t\tcase 'ItemLevel':\n\t\t\tcase 'DropLevel':\n\t\t\tcase 'Quality':\n\t\t\tcase 'LinkedSockets':\n\t\t\tcase 'Width':\n\t\t\tcase 'Height':\n\t\t\tcase 'MapTier':\n\t\t\tcase 'GemLevel':\n\t\t\tcase 'StackSize':\n case 'CorruptedMods':\n case 'AreaLevel':\n\t\t\tcase 'EnchantmentPassiveNum':\n\t\t\t\tparseNumericFilter( self, filters[token], arguments );\n\t\t\t\treturn;\n\n\t\t\tcase 'Rarity':\n\t\t\t\tparseRarityFilter( self, filters[token], arguments );\n\t\t\t\treturn;\n\n\t\t\tcase 'Class':\n\t\t\tcase 'BaseType':\n\t\t\tcase 'HasExplicitMod':\n case 'Prophecy':\n\t\t\tcase 'HasEnchantment':\n case 'EnchantmentPassiveNode':\n case 'GemQualityType':\n\t\t\t\tparseMultiStringFilter( self, filters[token], arguments );\n\t\t\t\treturn;\n\n\t\t\tcase 'Sockets':\n\t\t\t\tparseSocketGroupFilter( self, filters[token], arguments, \"unlinked\" );\n\t\t\t\treturn;\n\t\t\tcase 'SocketGroup':\n\t\t\t\tparseSocketGroupFilter( self, filters[token], arguments, \"linked\" );\n\t\t\t\treturn;\n\n\t\t\tcase 'Identified':\n\t\t\tcase 'Corrupted':\n\t\t\tcase 'ElderItem':\n\t\t\tcase 'ShaperItem':\n\t\t\tcase 'ShapedMap':\n case 'ElderMap':\n\t\t\tcase 'FracturedItem':\n\t\t\tcase 'SynthesisedItem':\n case 'AnyEnchantment':\n case 'BlightedMap':\n case 'Mirrored':\n case 'AlternateQuality':\n case 'Replica':\n\t\t\t\tparseBoolFilter( self, filters[token], arguments );\n\t\t\t\treturn;\n \n\t\t\tcase 'HasInfluence':\n\t\t\t\tparseInfluenceFilter( self, filters[token], arguments );\n\t\t\t\treturn;\n\n\t\t\tdefault:\n\t\t\t\t// We can only get to this function if token is valid\n\t\t\t\treportTokenError( self, token, 'this should never happen' );\n\t\t}\n\t}\n\n\tfunction parseNumericFilter (self, filter, arguments) {\n\t\tvar args = parseOperatorAndValue( self, arguments );\n\t\tif (args !== null) {\n\t\t\tif (isNaN( args.value )) {\n\t\t\t\treportTokenError( self, args.value, 'number' );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tself.currentRule.filters.push( new filter( args.comparer, parseInt( args.value ) ) );\n\t\t}\n\t}\n\n\tfunction parseMultiStringFilter (self, filter, arguments) {\n\t\tvar args = parseStringArguments( self, arguments );\n\t\tif (args === null) return;\n\t\tif (args.length === 0) {\n\t\t\treportUnexpectedEndOfLine( self, 'one or more strings' );\n\t\t\treturn;\n\t\t}\n\n\t\tself.currentRule.filters.push( new filter( args ) );\n\t}\n\n\tfunction parseRarityFilter (self, filter, arguments) {\n\t var tokens = getArgumentTokens(arguments);\n\t if (tokens.length == 0) {\n\t reportTokenError( self, arguments, 'rarity')\n\t return;\n\t }\n\n\t // If the first argument is an operator, we can use the parseOperatorAndValue function\n\t if (OPERATOR_TOKENS.includes( tokens[0] )) {\n\t args = parseOperatorAndValue( self, arguments );\n if (args != null) {\n if (RARITY_TOKENS.indexOf( args.value ) < 0) {\n reportTokenError( self, args.value, 'operator or rarity' );\n return;\n }\n self.currentRule.filters.push( new filter( args.comparer, Rarity[args.value] ) );\n return;\n }\n }\n\n // Otherwise, the arguments must be a list of rarities.\n var rarities = [];\n for (var i=0; i < tokens.length; i++) {\n if (!RARITY_TOKENS.includes(tokens[i])) {\n reportTokenError( self, tokens[i], 'rarity')\n return;\n }\n rarities.push( Rarity[tokens[i]] );\n }\n\n // In that case, we create a custom comparer that checks if a rarity is in that list\n var comparer = function(a,b) { return b.includes(a); }\n self.currentRule.filters.push( new filter( comparer, rarities ) );\n\t}\n \n\tfunction parseInfluenceFilter (self, filter, arguments) {\n\t var tokens = getArgumentTokens(arguments);\n\t if (tokens.length == 0) {\n\t reportTokenError( self, arguments, 'influence')\n\t return;\n\t }\n \n var comparer; \n \n if(tokens[0] === \"==\") {\n tokens.shift(); // remove operator\n comparer = function(a,b) {\n // strict equality - must contain all influences specified to match\n for(var i = 0; i < b.length; i++) {\n if(!a.includes(b[i])) return false;\n }\n return true;\n }\n } else {\n comparer = function(a,b) { \n // match if any of the specified influences are found\n for(var i = 0; i < a.length; i++) {\n if(b.includes(a[i])) return true;\n }\n return false;\n }\n }\n\n // the arguments must be a list of influences\n var influences = [];\n for (var i = 0; i < tokens.length; i++) {\n var inf = tokens[i].toLowerCase().replace(/\"/g, '');\n if(inf === \"none\") {\n influences = \"none\";\n break;\n }\n if (!INFLUENCE_TOKENS.includes(inf)) {\n reportTokenError( self, tokens[i], 'influence')\n return;\n }\n influences.push(inf);\n }\n\n self.currentRule.filters.push( new filter( comparer, influences ) );\n\t}\n \n\tfunction parseSocketGroupFilter (self, filter, arguments, mode) {\n \n\t var tokens = getArgumentTokens(arguments);\n\t if (tokens.length == 0) {\n\t reportTokenError( self, arguments, 'influence')\n\t return;\n\t }\n \n var operator = null;\n \n\t\t\tif (OPERATOR_TOKENS.includes(tokens[0])) {\n operator = tokens.shift();\n // single equals: no operator needed, match any of the arguments\n if(operator === \"=\") {\n operator = null;\n }\n }\n \n var groups = tokens.map( tok => { return StrUtils.replaceAll(tok.toUpperCase(), '\"', \"\"); } );\n \n var isInvalid = groups.some( function(socketGroup) {\n if (!StrUtils.consistsOf( socketGroup, '0123456RGBWDA' )) {\n reportInvalidSocketGroup( self, socketGroup );\n return true;\n }\n return false;\n } );\n \n if (!isInvalid) { \n groups = groups.map( group => {\n var sorted = StrUtils.sortChars(group);\n return {\n count: sorted.replace(/[RGBWDA]/g, \"\"),\n sockets: sorted.replace(/[0123456]/g, \"\")\n };\n });\n self.currentRule.filters.push( new filter( operator, groups, mode ) );\n }\n \n\t} \n\n\tfunction parseBoolFilter (self, filter, arguments) {\n\t\tvar args = parseStringArguments( self, arguments );\n\t\tif (args === null) return;\n\t\tif (args.length === 0) {\n\t\t\treportUnexpectedEndOfLine( self, 'expected True or False' );\n\t\t\treturn;\n\t\t}\n\n\t\targs = args.map( function(a) { return a.toUpperCase(); } );\n\n\t\tif (args[0] !== 'TRUE' && args[0] !== 'FALSE') {\n\t\t\treportTokenError( self, arguments, 'True or False' );\n\t\t\treturn;\n\t\t}\n\n\t\tself.currentRule.filters.push( new filter( args[0] === 'TRUE' ) );\n\t}\n\n\t// ----------- MODIFIERS ---------------------------------------------------\n\n\tfunction parseModifier (self, token, arguments) {\n\t\tself.lineTypes[self.currentLineNr] = 'Modifier';\n\n\t\tvar modifiers = {\n\t\t\t'SetBackgroundColor': SetBackgroundColorModifier,\n\t\t\t'SetBorderColor': SetBorderColorModifier,\n\t\t\t'SetTextColor': SetTextColorModifier,\n\t\t\t'SetFontSize': SetFontSizeModifier\n\t\t};\n\n\t\tswitch (token) {\n\t\t\tcase 'SetBackgroundColor':\n\t\t\tcase 'SetBorderColor':\n\t\t\tcase 'SetTextColor':\n\t\t\t\tparseColorModifier( self, modifiers[token], arguments );\n\t\t\t\tbreak;\n\n\t\t\tcase 'SetFontSize':\n\t\t\t\tparseNumericModifier( self, modifiers[token], arguments );\n\t\t\t\tbreak;\n\n case 'MinimapIcon':\n case 'PlayEffect':\n\t\t\tcase 'PlayAlertSound':\n\t\t\tcase 'PlayAlertSoundPositional':\n\t\t\tcase 'DisableDropSound':\n case 'CustomAlertSound':\n case 'CustomAlertSoundOptional':\n case 'DisableDropSoundIfAlertSound':\n case 'EnableDropSoundIfAlertSound':\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t// We can only get to this function if token is valid\n\t\t\t\treportTokenError( self, token, 'this should never happen' );\n\t\t}\n\t}\n\n\tfunction parseColorModifier (self, modifier, arguments) {\n\t\tvar numbers = parseNumbers( self, arguments );\n\t\tif (numbers === null) return;\n\t\tif (numbers.length < 3 || numbers.length > 4) {\n\t\t\treportTokenError( self, arguments, 'three or four numbers' );\n\t\t\treturn;\n\t\t}\n\n\t\tif (numbers.some( function(c) { return c < 0 || c > 255; } )) {\n\t\t\treportParseError( self, arguments, 'color values must be between 0 and 255' );\n\t\t\treturn;\n\t\t}\n\n\t\tvar color = { r:numbers[0], g:numbers[1], b:numbers[2], a:255 };\n\t\tif (numbers.length === 4) {\n\t\t\tcolor['a'] = numbers[3];\n\t\t}\n\n\t\tself.currentRule.modifiers.push( new modifier( color ) );\n\t}\n\n function parsePlayEffectModifier (self, modifier, arguments) {\n var tokens = arguments.trim().split(' ');\n if (tokens.length > 2) {\n reportTokenError( self, arguments, 'COLOR Temp' );\n return;\n }\n\n var color = tokens[0].trim();\n if (!COLOR_TOKENS.includes(color)) {\n reportTokenError( self, color, 'Color name');\n return;\n }\n\n var temp = false;\n if (tokens.length > 1) {\n if (tokens[1] !== 'Temp') {\n reportTokenError( self, tokens[1], 'Temp');\n return;\n }\n temp = true;\n }\n\n self.currentRule.modifiers.push( new modifier( color, temp ));\n }\n\n\tfunction parseMinimapIconModifier (self, modifier, arguments) {\n\t var tokens = arguments.trim().split(' ');\n\t if (tokens.length !== 3) {\n\t reportTokenError( self, arguments, 'SIZE COLOR SHAPE' );\n\t return;\n\t }\n\n\t var size = tokens[0];\n\t if (size !== '0' && size !== '1' && size !== '2') {\n\t reportParseError( self, size, 'SIZE must be 0, 1 or 2' );\n\t return;\n\t }\n\n\t var color = tokens[1];\n\t if (!COLOR_TOKENS.includes(color)) {\n\t reportParseError( self, color, 'COLOR must be one of: ' + COLOR_TOKENS.join(', '));\n\t return;\n\t }\n\n\t var shape = tokens[2];\n\t if (!ICON_SHAPE_TOKENS.includes(shape)) {\n\t reportParseError( self, shape, 'SHAPE must be one of: ' + ICON_SHAPE_TOKENS.join(', '));\n\t return;\n\t }\n\n\t self.currentRule.modifiers.push( new modifier( parseInt(size), color, shape ) );\n\t}\n\n\tfunction parseAlertSoundModifier (self, modifier, arguments) {\n\t var tokens = getArgumentTokens( arguments );\n\t if (tokens.length < 1 || tokens.length > 2) {\n\t reportTokenError( self, arguments, 'sound id + optional volume' );\n\t return;\n\t }\n\n\t var soundId = parseSoundId( self, tokens[0] );\n\t if (soundId === null) return;\n\n\t var volume = 100;\n\t if (tokens.length === 2) {\n\t if (isNaN(tokens[1])) {\n\t reportParseError( self, arguments, 'volume must be a number' );\n\t return;\n\t }\n\n\t volume = parseInt(tokens[1]);\n\t if (volume < 0 || volume > 300) {\n\t reportParseError( self, arguments, 'volume must be between 0 and 300' );\n\t return;\n\t }\n\t }\n\n\t\tself.currentRule.modifiers.push( new modifier( soundId, volume ) );\n\t}\n\n function parseSoundId (self, token) {\n if (SOUND_TOKENS.indexOf( token ) >= 0) {\n return token;\n }\n\n if (isNaN(token)) {\n reportParseError( self, token, 'Sound ID must be a number between 1 and 16, or a valid Sound ID name' );\n return;\n }\n return parseInt( token );\n }\n\n\tfunction parseNumericModifier (self, modifier, arguments) {\n\t\tvar numbers = parseNumbers( self, arguments );\n\t\tif (numbers === null) return;\n\t\tif (numbers.length != 1) {\n\t\t\treportTokenError( self, arguments, 'one number' );\n\t\t\treturn;\n\t\t}\n\n\t\tself.currentRule.modifiers.push( new modifier( numbers[0] ) );\n\t}\n\n\tfunction parseKeywordModifier (self, modifier, arguments) {\n\t\tif (arguments.trim().length > 0) {\n\t\t\treportTokenError( self, arguments, 'Unexpected argument' );\n\t\t\treturn;\n\t\t}\n\n\t\tself.currentRule.modifiers.push( new modifier() );\n\t}\n\n\tfunction parseFilenameModifier (self, modifier, arguments) {\n\t var argumentTokens = parseStringArguments( self, arguments );\n\t if (argumentTokens.length == 0) {\n\t reportUnexpectedEndOfLine( self, arguments, 'Path or Filename' );\n\t return;\n\t }\n\t if (argumentTokens.length > 1) {\n\t reportParseError( self, arguments, 'Unexpected argument: \"' + argumentTokens[1] + '\"' );\n\t return;\n\t }\n\n\t self.currentRule.modifiers.push( new modifier(argumentTokens[0]) );\n\t}\n\n\t// ------------------------ GENERIC PARSING ---------------------------------\n\n function getArgumentTokens (arguments) {\n return arguments\n\t\t\t.trim()\n\t\t\t.split(' ')\n\t\t\t.filter( function (element, index, array) { return element.trim().length > 0; } );\n }\n\n\tfunction parseOperatorAndValue (self, arguments) {\n\t\tvar tokens = getArgumentTokens( arguments );\n\t\tvar operator, value;\n\n\t\tif (tokens.length == 1) {\n\t\t\t// Special case: For equality checks, you specify only the value\n\t\t\toperator = '=';\n\t\t\tvalue = tokens[0];\n\t\t}\n\t\telse if (tokens.length == 2) {\n\t\t\toperator = tokens[0];\n\t\t\tvalue = tokens[1];\n\t\t}\n\t\telse {\n\t\t\treportTokenError( self, arguments, 'operator and value' );\n\t\t\treturn null;\n\t\t}\n\n\t\tif (OPERATOR_TOKENS.indexOf( operator ) < 0) {\n\t\t\treportTokenError( self, operator, 'operator' );\n\t\t\treturn null;\n\t\t}\n\n\t\treturn { comparer : COMPARERS[operator], value : value };\n \n\t}\n\n\tfunction parseNumbers (self, arguments) {\n\t\tvar tokens = getArgumentTokens( arguments );\n\n\t\tif (tokens.some( isNaN )) {\n\t\t\treportTokenError( self, arguments, 'numbers' );\n\t\t\treturn null;\n\t\t}\n\n\t\treturn tokens.map( function(n) { return parseInt( n ); } );\n\t}\n\n\tfunction parseStringArguments (self, arguments) {\n\t\tvar tokens = arguments\n\t\t\t.trim()\n\t\t\t.split(' ');\n\t\t\t// Don't remove empty tokens because they might represent multiple spaces inside quoted strings\n\n\t\tvar actualTokens = [];\n\t\tvar numQuotes = 0;\n\t\tvar currentToken = '';\n\t\tfor (var i=0; i < tokens.length; i++) {\n\t\t\tnumQuotes += StrUtils.countChar( '\"', tokens[i] );\n\t\t\tvar withoutQuotes = StrUtils.replaceAll( tokens[i], '\"', '' );\n\n\t\t\tif (currentToken.length > 0) {\n\t\t\t\tcurrentToken += ' ' + withoutQuotes;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcurrentToken = withoutQuotes;\n\t\t\t}\n\n\t\t\tif (numQuotes % 2 == 0) {\n\t\t\t\tactualTokens.push( currentToken );\n\t\t\t\tcurrentToken = '';\n\t\t\t}\n\t\t}\n\n\t\tif (numQuotes % 2 != 0) {\n\t\t\treportParseError( self, arguments, 'no matching quote' );\n\t\t\tactualTokens.push( currentToken );\n\t\t}\n\n\t\t// Remove any empty or pure whitespace tokens.\n\t\t// These may happen with certain unicode characters.\n\t\tactualTokens = actualTokens.filter( function(token) { return token.trim().length > 0; } );\n\n\t\treturn actualTokens;\n\t}\n\n\t// ------------------- ERROR MESSAGES --------------------------------------\n\n\tfunction reportTokenError (self, token, expected) {\n\t\tself.errors.push( 'Invalid token \"' + token + '\" at line ' + self.currentLineNr.toString() + ' (expected ' + expected + ')' );\n\t\tself.lineTypes[self.currentLineNr] = 'Error';\n\t}\n\n\tfunction reportUnexpectedEndOfLine (self, expected) {\n\t\tself.errors.push( 'Unexpected end of line (expected ' + expected + ' in line ' + self.currentLineNr.toString() + ')');\n\t\tself.lineTypes[self.currentLineNr] = 'Error';\n\t}\n\n\tfunction reportInvalidSocketGroup (self, socketGroup) {\n\t\tself.errors.push( 'Invalid socket group \"' + socketGroup + '\" + at line ' + self.currentLineNr.toString() + ' (allowed characters are R,G,B)' );\n\t\tself.lineTypes[self.currentLineNr] = 'Error';\n\t}\n\n\tfunction reportParseError (self, text, reason) {\n\t\tself.errors.push( 'Cannot parse \"' + text + '\" (' + reason + ')' );\n\t\tself.lineTypes[self.currentLineNr] = 'Error';\n\t}\n\n\tfunction reportWarning (self, text) {\n\t\tself.warnings.push( text );\n\t}\n}", "parse(superBlock, tokenizer) {\n throw new Error(\"parse function not implemented!\");\n }", "function ast_walker(){function e(e){return[this[0],MAP(e,function(e){var t=[e[0]\n];return e.length>1&&(t[1]=s(e[1])),t})]}function t(e){var t=[this[0]];return e!=\nnull&&t.push(MAP(e,s)),t}function s(e){if(e==null)return null;try{i.push(e);var t=\ne[0],s=r[t];if(s){var o=s.apply(e,e.slice(1));if(o!=null)return o}return s=n[t],\ns.apply(e,e.slice(1))}finally{i.pop()}}function o(e){if(e==null)return null;try{\nreturn i.push(e),n[e[0]].apply(e,e.slice(1))}finally{i.pop()}}function u(e,t){var n=\n{},i;for(i in e)HOP(e,i)&&(n[i]=r[i],r[i]=e[i]);var s=t();for(i in n)HOP(n,i)&&(\nn[i]?r[i]=n[i]:delete r[i]);return s}var n={string:function(e){return[this[0],e]\n},num:function(e){return[this[0],e]},name:function(e){return[this[0],e]},toplevel\n:function(e){return[this[0],MAP(e,s)]},block:t,splice:t,\"var\":e,\"const\":e,\"try\":\nfunction(e,t,n){return[this[0],MAP(e,s),t!=null?[t[0],MAP(t[1],s)]:null,n!=null?\nMAP(n,s):null]},\"throw\":function(e){return[this[0],s(e)]},\"new\":function(e,t){return[\nthis[0],s(e),MAP(t,s)]},\"switch\":function(e,t){return[this[0],s(e),MAP(t,function(\ne){return[e[0]?s(e[0]):null,MAP(e[1],s)]})]},\"break\":function(e){return[this[0],\ne]},\"continue\":function(e){return[this[0],e]},conditional:function(e,t,n){return[\nthis[0],s(e),s(t),s(n)]},assign:function(e,t,n){return[this[0],e,s(t),s(n)]},dot\n:function(e){return[this[0],s(e)].concat(slice(arguments,1))},call:function(e,t)\n{return[this[0],s(e),MAP(t,s)]},\"function\":function(e,t,n){return[this[0],e,t.slice\n(),MAP(n,s)]},\"debugger\":function(){return[this[0]]},defun:function(e,t,n){return[\nthis[0],e,t.slice(),MAP(n,s)]},\"if\":function(e,t,n){return[this[0],s(e),s(t),s(n\n)]},\"for\":function(e,t,n,r){return[this[0],s(e),s(t),s(n),s(r)]},\"for-in\":function(\ne,t,n,r){return[this[0],s(e),s(t),s(n),s(r)]},\"while\":function(e,t){return[this[0\n],s(e),s(t)]},\"do\":function(e,t){return[this[0],s(e),s(t)]},\"return\":function(e)\n{return[this[0],s(e)]},binary:function(e,t,n){return[this[0],e,s(t),s(n)]},\"unary-prefix\"\n:function(e,t){return[this[0],e,s(t)]},\"unary-postfix\":function(e,t){return[this\n[0],e,s(t)]},sub:function(e,t){return[this[0],s(e),s(t)]},object:function(e){return[\nthis[0],MAP(e,function(e){return e.length==2?[e[0],s(e[1])]:[e[0],s(e[1]),e[2]]}\n)]},regexp:function(e,t){return[this[0],e,t]},array:function(e){return[this[0],MAP\n(e,s)]},stat:function(e){return[this[0],s(e)]},seq:function(){return[this[0]].concat\n(MAP(slice(arguments),s))},label:function(e,t){return[this[0],e,s(t)]},\"with\":function(\ne,t){return[this[0],s(e),s(t)]},atom:function(e){return[this[0],e]},directive:function(\ne){return[this[0],e]}},r={},i=[];return{walk:s,dive:o,with_walkers:u,parent:function(\n){return i[i.length-2]},stack:function(){return i}}}", "compileToAST(grammar, semantics, source) {\n\t var result = grammar.match(source);\n\n\t if (result.succeeded()) {\n\t var ast = semantics(result).eval();\n\t return {\n\t \"ast\": ast\n\t }\n\t } else {\n\t \t// console.error(result);\n\t var expected = result.getExpectedText();\n\t var position = result.getRightmostFailurePosition();\n\t return {\n\t \"expected\": expected,\n\t \"position\": position\n\t }\n\t }\n\t}", "function o(e){switch(e.type){case V.BlockStatement:case V.BreakStatement:case V.CatchClause:case V.ContinueStatement:case V.ClassDeclaration:case V.ClassBody:case V.DirectiveStatement:case V.DoWhileStatement:case V.DebuggerStatement:case V.EmptyStatement:case V.ExpressionStatement:case V.ForStatement:case V.ForInStatement:case V.ForOfStatement:case V.FunctionDeclaration:case V.IfStatement:case V.LabeledStatement:case V.ModuleDeclaration:case V.Program:case V.ReturnStatement:case V.SwitchStatement:case V.SwitchCase:case V.ThrowStatement:case V.TryStatement:case V.VariableDeclaration:case V.VariableDeclarator:case V.WhileStatement:case V.WithStatement:return!0}return!1}", "parse() {\n while (this.shouldContinue()) {\n const c = this.buffer.charCodeAt(this.index - this.offset);\n switch (this.state) {\n case Tokenizer_State.Text: {\n this.stateText(c);\n break;\n }\n case Tokenizer_State.SpecialStartSequence: {\n this.stateSpecialStartSequence(c);\n break;\n }\n case Tokenizer_State.InSpecialTag: {\n this.stateInSpecialTag(c);\n break;\n }\n case Tokenizer_State.CDATASequence: {\n this.stateCDATASequence(c);\n break;\n }\n case Tokenizer_State.InAttributeValueDq: {\n this.stateInAttributeValueDoubleQuotes(c);\n break;\n }\n case Tokenizer_State.InAttributeName: {\n this.stateInAttributeName(c);\n break;\n }\n case Tokenizer_State.InCommentLike: {\n this.stateInCommentLike(c);\n break;\n }\n case Tokenizer_State.InSpecialComment: {\n this.stateInSpecialComment(c);\n break;\n }\n case Tokenizer_State.BeforeAttributeName: {\n this.stateBeforeAttributeName(c);\n break;\n }\n case Tokenizer_State.InTagName: {\n this.stateInTagName(c);\n break;\n }\n case Tokenizer_State.InClosingTagName: {\n this.stateInClosingTagName(c);\n break;\n }\n case Tokenizer_State.BeforeTagName: {\n this.stateBeforeTagName(c);\n break;\n }\n case Tokenizer_State.AfterAttributeName: {\n this.stateAfterAttributeName(c);\n break;\n }\n case Tokenizer_State.InAttributeValueSq: {\n this.stateInAttributeValueSingleQuotes(c);\n break;\n }\n case Tokenizer_State.BeforeAttributeValue: {\n this.stateBeforeAttributeValue(c);\n break;\n }\n case Tokenizer_State.BeforeClosingTagName: {\n this.stateBeforeClosingTagName(c);\n break;\n }\n case Tokenizer_State.AfterClosingTagName: {\n this.stateAfterClosingTagName(c);\n break;\n }\n case Tokenizer_State.BeforeSpecialS: {\n this.stateBeforeSpecialS(c);\n break;\n }\n case Tokenizer_State.InAttributeValueNq: {\n this.stateInAttributeValueNoQuotes(c);\n break;\n }\n case Tokenizer_State.InSelfClosingTag: {\n this.stateInSelfClosingTag(c);\n break;\n }\n case Tokenizer_State.InDeclaration: {\n this.stateInDeclaration(c);\n break;\n }\n case Tokenizer_State.BeforeDeclaration: {\n this.stateBeforeDeclaration(c);\n break;\n }\n case Tokenizer_State.BeforeComment: {\n this.stateBeforeComment(c);\n break;\n }\n case Tokenizer_State.InProcessingInstruction: {\n this.stateInProcessingInstruction(c);\n break;\n }\n case Tokenizer_State.InNamedEntity: {\n this.stateInNamedEntity(c);\n break;\n }\n case Tokenizer_State.BeforeEntity: {\n this.stateBeforeEntity(c);\n break;\n }\n case Tokenizer_State.InHexEntity: {\n this.stateInHexEntity(c);\n break;\n }\n case Tokenizer_State.InNumericEntity: {\n this.stateInNumericEntity(c);\n break;\n }\n default: {\n // `this._state === State.BeforeNumericEntity`\n this.stateBeforeNumericEntity(c);\n }\n }\n this.index++;\n }\n this.cleanup();\n }", "ast(code) {\n const tokens = splitIntoTokens(code)\n return buildAstFromTokens(tokens)\n }", "function caml_set_parser_trace() { return 0; }", "parse(toParse, options) {\n var _a;\n let tokens;\n if (typeof toParse === 'string') {\n tokens = Lexer_1.Lexer.scan(toParse).tokens;\n }\n else {\n tokens = toParse;\n }\n this.logger = (_a = options === null || options === void 0 ? void 0 : options.logger) !== null && _a !== void 0 ? _a : new Logger_1.Logger();\n this.tokens = tokens;\n this.options = this.sanitizeParseOptions(options);\n this.allowedLocalIdentifiers = [\n ...TokenKind_1.AllowedLocalIdentifiers,\n //when in plain brightscript mode, the BrighterScript source literals can be used as regular variables\n ...(this.options.mode === ParseMode.BrightScript ? TokenKind_1.BrighterScriptSourceLiterals : [])\n ];\n this.current = 0;\n this.diagnostics = [];\n this.namespaceAndFunctionDepth = 0;\n this.pendingAnnotations = [];\n this.ast = this.body();\n //now that we've built the AST, link every node to its parent\n this.ast.link();\n return this;\n }", "function parse(source) {\n var ast = parser.parse(source);\n return ast;\n}", "function normal(source, setState) {\n if (source.eatWhile(whiteCharRE)) {\n return null;\n }\n \n var ch = source.next();\n if (specialRE.test(ch)) {\n if (ch == '{' && source.eat('-')) {\n var t = \"comment\";\n if (source.eat('#')) {\n t = \"meta\";\n }\n return switchState(source, setState, ncomment(t, 1));\n }\n if (ch == '[' &&\n source.eat('m') && source.eat('a') && source.eat('r') && source.eat('k') && \n source.eat('d') && source.eat('o') && source.eat('w') && source.eat('n') &&\n source.eat('|')) {\n setState(nmarkdown);\n return null;\n }\n return null;\n }\n \n if (ch == '\\'') {\n if (source.eat('\\\\')) {\n source.next(); // should handle other escapes here\n }\n else {\n source.next();\n }\n if (source.eat('\\'')) {\n return \"string\";\n }\n return \"error\";\n }\n \n if (ch == '\"') {\n return switchState(source, setState, stringLiteral);\n }\n \n if (largeRE.test(ch)) {\n source.eatWhile(idRE);\n if (source.eat('.')) {\n return \"qualifier\";\n }\n return \"variable-2\";\n }\n \n if (smallRE.test(ch)) {\n var isDef = source.pos === 1;\n source.eatWhile(idRE);\n return isDef ? \"variable-3\" : \"variable\";\n }\n \n if (digitRE.test(ch)) {\n if (ch == '0') {\n if (source.eat(/[xX]/)) {\n source.eatWhile(hexitRE); // should require at least 1\n return \"integer\";\n }\n if (source.eat(/[oO]/)) {\n source.eatWhile(octitRE); // should require at least 1\n return \"number\";\n }\n }\n source.eatWhile(digitRE);\n var t = \"number\";\n if (source.eat('.')) {\n t = \"number\";\n source.eatWhile(digitRE); // should require at least 1\n }\n if (source.eat(/[eE]/)) {\n t = \"number\";\n source.eat(/[-+]/);\n source.eatWhile(digitRE); // should require at least 1\n }\n return t;\n }\n \n if (symbolRE.test(ch)) {\n if (ch == '-' && source.eat(/-/)) {\n source.eatWhile(/-/);\n if (!source.eat(symbolRE)) {\n source.skipToEnd();\n return \"comment\";\n }\n }\n var t = \"variable\";\n if (ch == ':') {\n t = \"variable-2\";\n }\n source.eatWhile(symbolRE);\n return t; \n }\n \n return \"error\";\n }", "static parseVarDecl(parseTokens) {\n _Functions.log(\"PARSER - parseVarDecl()\");\n CSTTree.addNode(\"VarDecl\", \"branch\");\n ASTTree.addNode(\"VarDecl\", \"branch\");\n this.parseType(parseTokens);\n this.parseId(parseTokens);\n CSTTree.climbTree();\n ASTTree.climbTree();\n }", "compileNode(o) {\r\n\t\t\t\t\tvar body, bodyFragments, compare, compareDown, declare, declareDown, defPart, down, forClose, forCode, forPartFragments, fragments, guardPart, idt1, increment, index, ivar, kvar, kvarAssign, last, lvar, name, namePart, ref, ref1, resultPart, returnResult, rvar, scope, source, step, stepNum, stepVar, svar, varPart;\r\n\t\t\t\t\tbody = Block.wrap([this.body]);\r\n\t\t\t\t\tref1 = body.expressions, [last] = slice1.call(ref1, -1);\r\n\t\t\t\t\tif ((last != null ? last.jumps() : void 0) instanceof Return) {\r\n\t\t\t\t\t\tthis.returns = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsource = this.range ? this.source.base : this.source;\r\n\t\t\t\t\tscope = o.scope;\r\n\t\t\t\t\tif (!this.pattern) {\r\n\t\t\t\t\t\tname = this.name && (this.name.compile(o, LEVEL_LIST));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tindex = this.index && (this.index.compile(o, LEVEL_LIST));\r\n\t\t\t\t\tif (name && !this.pattern) {\r\n\t\t\t\t\t\tscope.find(name);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (index && !(this.index instanceof Value)) {\r\n\t\t\t\t\t\tscope.find(index);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.returns) {\r\n\t\t\t\t\t\trvar = scope.freeVariable('results');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.from) {\r\n\t\t\t\t\t\tif (this.pattern) {\r\n\t\t\t\t\t\t\tivar = scope.freeVariable('x', {\r\n\t\t\t\t\t\t\t\tsingle: true\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tivar = (this.object && index) || scope.freeVariable('i', {\r\n\t\t\t\t\t\t\tsingle: true\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\tkvar = ((this.range || this.from) && name) || index || ivar;\r\n\t\t\t\t\tkvarAssign = kvar !== ivar ? `${kvar} = ` : \"\";\r\n\t\t\t\t\tif (this.step && !this.range) {\r\n\t\t\t\t\t\t[step, stepVar] = this.cacheToCodeFragments(this.step.cache(o, LEVEL_LIST, shouldCacheOrIsAssignable));\r\n\t\t\t\t\t\tif (this.step.isNumber()) {\r\n\t\t\t\t\t\t\tstepNum = parseNumber(stepVar);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.pattern) {\r\n\t\t\t\t\t\tname = ivar;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvarPart = '';\r\n\t\t\t\t\tguardPart = '';\r\n\t\t\t\t\tdefPart = '';\r\n\t\t\t\t\tidt1 = this.tab + TAB;\r\n\t\t\t\t\tif (this.range) {\r\n\t\t\t\t\t\tforPartFragments = source.compileToFragments(merge(o, {\r\n\t\t\t\t\t\t\tindex: ivar,\r\n\t\t\t\t\t\t\tname,\r\n\t\t\t\t\t\t\tstep: this.step,\r\n\t\t\t\t\t\t\tshouldCache: shouldCacheOrIsAssignable\r\n\t\t\t\t\t\t}));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tsvar = this.source.compile(o, LEVEL_LIST);\r\n\t\t\t\t\t\tif ((name || this.own) && !(this.source.unwrap() instanceof IdentifierLiteral)) {\r\n\t\t\t\t\t\t\tdefPart += `${this.tab}${ref = scope.freeVariable('ref')} = ${svar};\\n`;\r\n\t\t\t\t\t\t\tsvar = ref;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (name && !this.pattern && !this.from) {\r\n\t\t\t\t\t\t\tnamePart = `${name} = ${svar}[${kvar}]`;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!this.object && !this.from) {\r\n\t\t\t\t\t\t\tif (step !== stepVar) {\r\n\t\t\t\t\t\t\t\tdefPart += `${this.tab}${step};\\n`;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tdown = stepNum < 0;\r\n\t\t\t\t\t\t\tif (!(this.step && (stepNum != null) && down)) {\r\n\t\t\t\t\t\t\t\tlvar = scope.freeVariable('len');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tdeclare = `${kvarAssign}${ivar} = 0, ${lvar} = ${svar}.length`;\r\n\t\t\t\t\t\t\tdeclareDown = `${kvarAssign}${ivar} = ${svar}.length - 1`;\r\n\t\t\t\t\t\t\tcompare = `${ivar} < ${lvar}`;\r\n\t\t\t\t\t\t\tcompareDown = `${ivar} >= 0`;\r\n\t\t\t\t\t\t\tif (this.step) {\r\n\t\t\t\t\t\t\t\tif (stepNum != null) {\r\n\t\t\t\t\t\t\t\t\tif (down) {\r\n\t\t\t\t\t\t\t\t\t\tcompare = compareDown;\r\n\t\t\t\t\t\t\t\t\t\tdeclare = declareDown;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tcompare = `${stepVar} > 0 ? ${compare} : ${compareDown}`;\r\n\t\t\t\t\t\t\t\t\tdeclare = `(${stepVar} > 0 ? (${declare}) : ${declareDown})`;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tincrement = `${ivar} += ${stepVar}`;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tincrement = `${kvar !== ivar ? `++${ivar}` : `${ivar}++`}`;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tforPartFragments = [this.makeCode(`${declare}; ${compare}; ${kvarAssign}${increment}`)];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.returns) {\r\n\t\t\t\t\t\tresultPart = `${this.tab}${rvar} = [];\\n`;\r\n\t\t\t\t\t\treturnResult = `\\n${this.tab}return ${rvar};`;\r\n\t\t\t\t\t\tbody.makeReturn(rvar);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.guard) {\r\n\t\t\t\t\t\tif (body.expressions.length > 1) {\r\n\t\t\t\t\t\t\tbody.expressions.unshift(new If((new Parens(this.guard)).invert(), new StatementLiteral(\"continue\")));\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif (this.guard) {\r\n\t\t\t\t\t\t\t\tbody = Block.wrap([new If(this.guard, body)]);\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\tif (this.pattern) {\r\n\t\t\t\t\t\tbody.expressions.unshift(new Assign(this.name, this.from ? new IdentifierLiteral(kvar) : new Literal(`${svar}[${kvar}]`)));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (namePart) {\r\n\t\t\t\t\t\tvarPart = `\\n${idt1}${namePart};`;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.object) {\r\n\t\t\t\t\t\tforPartFragments = [this.makeCode(`${kvar} in ${svar}`)];\r\n\t\t\t\t\t\tif (this.own) {\r\n\t\t\t\t\t\t\tguardPart = `\\n${idt1}if (!${utility('hasProp', o)}.call(${svar}, ${kvar})) continue;`;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (this.from) {\r\n\t\t\t\t\t\tif (this.await) {\r\n\t\t\t\t\t\t\tforPartFragments = new Op('await', new Parens(new Literal(`${kvar} of ${svar}`)));\r\n\t\t\t\t\t\t\tforPartFragments = forPartFragments.compileToFragments(o, LEVEL_TOP);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tforPartFragments = [this.makeCode(`${kvar} of ${svar}`)];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbodyFragments = body.compileToFragments(merge(o, {\r\n\t\t\t\t\t\tindent: idt1\r\n\t\t\t\t\t}), LEVEL_TOP);\r\n\t\t\t\t\tif (bodyFragments && bodyFragments.length > 0) {\r\n\t\t\t\t\t\tbodyFragments = [].concat(this.makeCode('\\n'), bodyFragments, this.makeCode('\\n'));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfragments = [this.makeCode(defPart)];\r\n\t\t\t\t\tif (resultPart) {\r\n\t\t\t\t\t\tfragments.push(this.makeCode(resultPart));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tforCode = this.await ? 'for ' : 'for (';\r\n\t\t\t\t\tforClose = this.await ? '' : ')';\r\n\t\t\t\t\tfragments = fragments.concat(this.makeCode(this.tab), this.makeCode(forCode), forPartFragments, this.makeCode(`${forClose} {${guardPart}${varPart}`), bodyFragments, this.makeCode(this.tab), this.makeCode('}'));\r\n\t\t\t\t\tif (returnResult) {\r\n\t\t\t\t\t\tfragments.push(this.makeCode(returnResult));\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn fragments;\r\n\t\t\t\t}", "visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\n else {\n node.visit(this);\n }\n }", "visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\n else {\n node.visit(this);\n }\n }", "compileNode(o) {\r\n\t\t\t\t\tvar answer, compiledName, isValue, name, properties, prototype, ref1, ref2, ref3, ref4, val;\r\n\t\t\t\t\tisValue = this.variable instanceof Value;\r\n\t\t\t\t\tif (isValue) {\r\n\t\t\t\t\t\t// If `@variable` is an array or an object, we’re destructuring;\r\n\t\t\t\t\t\t// if it’s also `isAssignable()`, the destructuring syntax is supported\r\n\t\t\t\t\t\t// in ES and we can output it as is; otherwise we `@compileDestructuring`\r\n\t\t\t\t\t\t// and convert this ES-unsupported destructuring into acceptable output.\r\n\t\t\t\t\t\tif (this.variable.isArray() || this.variable.isObject()) {\r\n\t\t\t\t\t\t\tif (!this.variable.isAssignable()) {\r\n\t\t\t\t\t\t\t\tif (this.variable.isObject() && this.variable.base.hasSplat()) {\r\n\t\t\t\t\t\t\t\t\treturn this.compileObjectDestruct(o);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\treturn this.compileDestructuring(o);\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\tif (this.variable.isSplice()) {\r\n\t\t\t\t\t\t\treturn this.compileSplice(o);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (this.isConditional()) {\r\n\t\t\t\t\t\t\treturn this.compileConditional(o);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ((ref1 = this.context) === '//=' || ref1 === '%%=') {\r\n\t\t\t\t\t\t\treturn this.compileSpecialMath(o);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.addScopeVariables(o);\r\n\t\t\t\t\tif (this.value instanceof Code) {\r\n\t\t\t\t\t\tif (this.value.isStatic) {\r\n\t\t\t\t\t\t\tthis.value.name = this.variable.properties[0];\r\n\t\t\t\t\t\t} else if (((ref2 = this.variable.properties) != null ? ref2.length : void 0) >= 2) {\r\n\t\t\t\t\t\t\tref3 = this.variable.properties, [...properties] = ref3, [prototype, name] = splice.call(properties, -2);\r\n\t\t\t\t\t\t\tif (((ref4 = prototype.name) != null ? ref4.value : void 0) === 'prototype') {\r\n\t\t\t\t\t\t\t\tthis.value.name = name;\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\tval = this.value.compileToFragments(o, LEVEL_LIST);\r\n\t\t\t\t\tcompiledName = this.variable.compileToFragments(o, LEVEL_LIST);\r\n\t\t\t\t\tif (this.context === 'object') {\r\n\t\t\t\t\t\tif (this.variable.shouldCache()) {\r\n\t\t\t\t\t\t\tcompiledName.unshift(this.makeCode('['));\r\n\t\t\t\t\t\t\tcompiledName.push(this.makeCode(']'));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn compiledName.concat(this.makeCode(': '), val);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tanswer = compiledName.concat(this.makeCode(` ${this.context || '='} `), val);\r\n\t\t\t\t\t// Per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Assignment_without_declaration,\r\n\t\t\t\t\t// if we’re destructuring without declaring, the destructuring assignment must be wrapped in parentheses.\r\n\t\t\t\t\t// The assignment is wrapped in parentheses if 'o.level' has lower precedence than LEVEL_LIST (3)\r\n\t\t\t\t\t// (i.e. LEVEL_COND (4), LEVEL_OP (5) or LEVEL_ACCESS (6)), or if we're destructuring object, e.g. {a,b} = obj.\r\n\t\t\t\t\tif (o.level > LEVEL_LIST || isValue && this.variable.base instanceof Obj && !this.nestedLhs && !(this.param === true)) {\r\n\t\t\t\t\t\treturn this.wrapInParentheses(answer);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn answer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function verboseParse () {\r\n\t\tx = \"input_string:\" + this.input_string + \"\\n\";\r\n\t\tx = x + \"err: \" + this.err_string + \"\\n\";\r\n\t\tx = x + \"token-len:\" + this.tokens.length + \"\\n\";\r\n\t\tx = x + \"cql:\" + this.cql() + \"\\n\";\r\n\t x = x + \"nodes:\\n\";\r\n\t x = x + formatNode(this.nodes[this.nodes.length -1]);\r\n\t return x;\r\n}", "tokenize(AST, sourceCodeString) {\n this.tokensBytePos = {};\n this.lastLo = -1;\n // Attributes on the top-level don't exist in the 'tokens' array in the AST\n // and must be extracted from 'attrs' instead.\n // Keep track of the byte positons for seen idents and attribs,\n // and add tokens for attribs that don't exist in idents.\n this.idents = {};\n this.attribs = {};\n this.mods = {};\n this.sourceCodeBuffer = Buffer.from(sourceCodeString);\n\n // Some token types cannot be derived since they don't exist in the ast_json-data\n // and therefore need to be hard-coded manually:\n this.tokenTypes = {\n Pound: '#',\n Not: '!',\n LBrace: '{',\n RBrace: '}',\n LParen: '(',\n RParen: ')',\n LBracket: '[',\n RBracket: ']',\n };\n // Detect if there is a magic byte-order-mark sequence in the beginning of the file:\n let BOM = null;\n if (this.sourceCodeBuffer[0] == 239\n && this.sourceCodeBuffer[1] == 187\n && this.sourceCodeBuffer[2] == 191\n ) {\n // Remove byte order mark\n BOM = this.sourceCodeBuffer.slice(0,3);\n this.sourceCodeBuffer = this.sourceCodeBuffer.slice(3, this.sourceCodeBuffer.length);\n }\n this.traverse(AST);\n for (let identPos in this.attribs) {\n if (!this.idents.hasOwnProperty(identPos)) {\n if (this.attribs[identPos].style == 'Inner') {\n // InnerAttribute\n this._newToken('Pound', this.attribs[identPos].lo);\n this._newToken('Not', this.attribs[identPos].lo+1);\n this._newToken('LBracket', this.attribs[identPos].lo+2);\n } else if (this.attribs[identPos].style == 'Outer') {\n // OuterAttribute\n this._newToken('Pound', this.attribs[identPos].lo);\n this._newToken('LBracket', this.attribs[identPos].lo+1);\n } else {\n throw new Error('Unknown attribute style: ' + this.attribs[identPos].style);\n }\n this._newToken('RBracket', this.attribs[identPos].hi-1);\n }\n }\n for (let modPos in this.mods) {\n if (!this.idents.hasOwnProperty(modPos)) {\n let modPosOffset = parseInt(modPos);\n if (this.mods[modPos].pub) {\n this.tokensBytePos[modPosOffset] = ['Ident', 'pub']; modPosOffset += 3+1;\n }\n this.tokensBytePos[modPosOffset] = ['Ident', 'mod']; modPosOffset += 3+1;\n this.tokensBytePos[modPosOffset] = ['Ident', this.mods[modPos].ident]; modPosOffset += this.mods[modPos].ident.length + 1;\n this.tokensBytePos[modPosOffset] = ['LBrace', '{']; modPosOffset += 1;\n this.tokensBytePos[this.mods[modPos].hi*1-1] = ['RBrace', '}'];\n }\n }\n let sortedTokens = [];\n let tokenId = 0;\n for(let lo of Object.keys(this.tokensBytePos).sort(function(a, b){return a - b})) {\n this.identToKeyword(this.tokensBytePos[lo]);\n this.tokensBytePos[lo][3] = tokenId++;\n sortedTokens.push(this.tokensBytePos[lo]);\n }\n return sortedTokens;\n }", "function parse_Program() {\n tree.addNode('Program', 'branch');\n parse_Block();\n match('$', parseCounter);\n document.getElementById('parse').value += tree.toString() + \"\\n\"\n astRun();\n\n // console.log(\"got an identifier\")\n // console.log(tree.toString());\n //do we need a counter here still?\n parseCounter++;\n}", "function GenTokenParser(){}", "function handleSegments(tokens) {\n // Handle a single segment (after comma separation)\n function handleSegment(segment) {\n if (segment[1].text == 'null') {\n return { intertype: 'value', ident: '0', type: 'i32' };\n } else if (segment[1].text == 'zeroinitializer') {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'emptystruct', type: segment[0].text };\n } else if (segment[1].text in PARSABLE_LLVM_FUNCTIONS) {\n return parseLLVMFunctionCall(segment);\n } else if (segment[1].type && segment[1].type == '{') {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'struct', type: segment[0].text, contents: handleSegments(segment[1].tokens) };\n } else if (segment[1].type && segment[1].type == '<') {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'struct', type: segment[0].text, contents: handleSegments(segment[1].item.tokens[0].tokens) };\n } else if (segment[1].type && segment[1].type == '[') {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'list', type: segment[0].text, contents: handleSegments(segment[1].item.tokens) };\n } else if (segment.length == 2) {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'value', type: segment[0].text, ident: toNiceIdent(segment[1].text) };\n } else if (segment[1].text === 'c') {\n // string\n var text = segment[2].text;\n text = text.substr(1, text.length-2);\n return { intertype: 'string', text: text, type: 'i8*' };\n } else if (segment[1].text === 'blockaddress') {\n return parseBlockAddress(segment);\n } else {\n throw 'Invalid segment: ' + dump(segment);\n }\n };\n return splitTokenList(tokens).map(handleSegment);\n }", "function t(e){switch(e.type){case V.AssignmentExpression:case V.ArrayExpression:case V.ArrayPattern:case V.BinaryExpression:case V.CallExpression:case V.ConditionalExpression:case V.ClassExpression:case V.ExportBatchSpecifier:case V.ExportSpecifier:case V.FunctionExpression:case V.Identifier:case V.ImportSpecifier:case V.Literal:case V.LogicalExpression:case V.MemberExpression:case V.MethodDefinition:case V.NewExpression:case V.ObjectExpression:case V.ObjectPattern:case V.Property:case V.SequenceExpression:case V.ThisExpression:case V.UnaryExpression:case V.UpdateExpression:case V.YieldExpression:return!0}return!1}// Generation is done by generateStatement.", "function parse(array,tree){\n\tvar currentToken = 0;\n\tvar parseString = \"\";\n var cstString = \"\";\n var astString = \"\";\n\tvar errors = false;\n var cstDepth = 0;\n var astDepth = 0;\n\n //Boolean assist\n var boolDepth = 0;\n\n //Add assist\n var addDepth = 0;\n\n //Tree Object Vars\n var asTree = new Tree();\n var scope = -1;\n var blockList = [];\n var string = \"\";\n\n //Symbol Table Helpers\n var symbolArray = []; //array of declared symbols\n\n var returnArr;\n \n parseString += \"PARSER: parse()\\n\";\n\n parseProgram();\n\n returnArr = [errors, parseString, cstString, astString, asTree, symbolArray];\n return returnArr;\n\n\tfunction treeMaker(e){\n\t\tvar treeBranch = \"\";\n\t\tif(e > 0){\n\t\t\tfor(l = 0; l < e; l++){\n\t\t\t\ttreeBranch+=\"-\";\n\t\t\t}\n\t\t}\n\t\treturn treeBranch;\n }\n\n\tfunction match(t){\n\t\tif(array[currentToken][0] != t && errors == false){\n\t\t\tparseString+= \"PARSER: ERROR: Expected \" + t + \" got \" + \n\t\t\tarray[currentToken][0] + \" with value '\" + \n\t\t\tarray[currentToken][1] + \"' on line \" + array[currentToken][2] + \"\\n\";\n\t\t\terrors = true;\n\t\t} else if(array[currentToken][0] != t){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t} else {\n\t\t\tcstString+= treeMaker(cstDepth)+\"[\" + array[currentToken][1] + \"]\\n\";\n\t\t\tcurrentToken++;\n\t\t}\n\t}\n\n\tfunction parseProgram(){\n\t\tparseString+= \"PARSER: parseProgram()\\n\";\n\t\tcstString+= \"<Program>\\n\";\n\t\tparseBlock([0]);\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n\t\tmatch(\"T_EOP\");\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n\t}\n\n\tfunction parseBlock(arr){\n\t\tparseString+= \"PARSER: parseBlock()\\n\";\n \n //CST\n cstDepth++;\n\t\tcstString+= treeMaker(cstDepth)+\"<Block>\\n\";\n cstDepth++;\n //AST\n astString+= treeMaker(astDepth)+\"< BLOCK >\\n\";\n astDepth++;\n\n //Tree\n scope++;\n blockList.push([\"BLOCK\", array[currentToken][2], scope]); //add block to blocklist\n\n if (arr.length == 1){\n if (scope > 0){\n asTree.add(blockList[scope],blockList[scope-1]); //parent will be previous scope's block node\n } else {\n asTree.add(blockList[scope]);\n }\n } else {\n asTree.add(blockList[scope], arr); //parent will be if or while\n }\n\n\t\tmatch(\"T_LBRACE\");\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n }\n parseStatementList();\n \n scope--;\n\n\t\tmatch(\"T_RBRACE\");\n \n cstDepth--;\n astDepth--;\n \n if(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n\t}\n\n\tfunction parseStatementList(){\n parseString+= \"PARSER: parseStatementList()\\n\";\n //CST\n cstString+= treeMaker(cstDepth)+\"<Statement List>\\n\";\n \n\t\tif(array[currentToken][0]==\"T_PRINT\" || array[currentToken][0]==\"T_ID\" || \n\t\t array[currentToken][0]==\"T_VAR_TYPE_INT\" || array[currentToken][0]==\"T_VAR_TYPE_STRING\" ||\n\t\t array[currentToken][0]==\"T_VAR_TYPE_BOOLEAN\" || array[currentToken][0]==\"T_WHILE\" ||\n\t\t array[currentToken][0]==\"T_IF\" || array[currentToken][0]==\"T_LBRACE\"){\n\t\t\tcstDepth++;\n\t\t\tparseStatement();\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t\tcstDepth-=2;\n\t\t\tparseStatementList();\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t} else {\n\t\t\t//empty set\n\t\t}\n\t}\n\n\tfunction parseStatement(){\n parseString+= \"PARSER: parseStatement()\\n\";\n //CST\n cstString+= treeMaker(cstDepth)+\"<Statement>\\n\";\n \n\t\tif(array[currentToken][0]==\"T_PRINT\"){\n\t\t\tparsePrintStatement();\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t}\n\t\telse if(array[currentToken][0]==\"T_ID\"){\n\t\t\tparseAssignmentStatement();\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t}\n\t\telse if(array[currentToken][0]==\"T_VAR_TYPE_INT\" || \n\t\t\t\tarray[currentToken][0]==\"T_VAR_TYPE_STRING\" || \n\t\t\t\tarray[currentToken][0]==\"T_VAR_TYPE_BOOLEAN\"){\n\t\t\tparseVarDecl();\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t}\n\t\telse if(array[currentToken][0]==\"T_WHILE\"){\n\t\t\tparseWhileStatement();\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t}\n\t\telse if(array[currentToken][0]==\"T_IF\"){\n\t\t\tparseIfStatement();\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t}\n\t\telse if(array[currentToken][0]==\"T_LBRACE\"){\n\t\t\tparseBlock([0]);\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t} else {\n\t\t\tparseString+= \"PARSER: ERROR: Expected print/id/int/string/boolean/while/if/lbrace got \" + \n\t\t\tarray[currentToken][0] + \" with value '\" + \n\t\t\tarray[currentToken][1] + \"' on line \" + array[currentToken][2] + \"\\n\";\n\t\t\terrors = true;\n\t\t}\n\t}\n\n\tfunction parsePrintStatement(){\n parseString+= \"PARSER: parsePrintStatement()\\n\";\n \n //CST\n cstDepth++;\n cstString+= treeMaker(cstDepth)+\"<Print Statement>\\n\";\n //AST\n astString+= treeMaker(astDepth) + \"< Print Statement >\\n\";\n\n //Tree\n var printNode = [\"Print Statement\", array[currentToken][2], scope];\n asTree.add(printNode,blockList[scope]); //add [print node, parent block]\n \n\t\tmatch(\"T_PRINT\");\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n\t\tmatch(\"T_LPAREN\");\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n }\n \n astDepth++;\n\n\t\tparseExpr(printNode);\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n match(\"T_RPAREN\");\n \n astDepth--;\n\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n\t}\n\n\tfunction parseAssignmentStatement(){\n\t\tparseString+= \"PARSER: parseAssignmentStatement()\\n\";\n \n //CST\n cstDepth++;\n cstString+= treeMaker(cstDepth)+\"<Assignment Statement>\\n\";\n //AST\n astString += treeMaker(astDepth) + \"< Assignment Statement >\\n\";\n astDepth++;\n \n //Tree\n var assignmentNode = [\"Assignment Statement\", array[currentToken][2],scope];\n\n asTree.add(assignmentNode, blockList[scope]); //add [assignment node, parent block]\n\n parseId(assignmentNode);\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n\t\tmatch(\"T_ASSIGN\");\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n parseExpr(assignmentNode);\n \n astDepth--;\n\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n\t}\n\n\tfunction parseVarDecl(){\n\t\tparseString+= \"PARSER: parseVarDecl()\\n\";\n \n //CST\n cstDepth++;\n cstString+= treeMaker(cstDepth)+\"<Variable Declaration Statement>\\n\";\n //AST\n astString += treeMaker(astDepth) + \"< Variable Declaration >\\n\";\n astDepth++;\n\n //Tree\n var declarationNode = [\"Variable Declaration\", array[currentToken][2], scope];\n\n asTree.add(declarationNode, blockList[scope]); //add [variable decl node, parent block]\n\n //Symbol Table Helper\n\n symbolArray.push([array[currentToken + 1][1], array[currentToken][1], scope, array[currentToken][2]]);\n\n\t\tparseType(declarationNode);\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n parseId(declarationNode);\n \n astDepth--;\n\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n\t}\n\n\tfunction parseWhileStatement(){\n\t\tparseString+= \"PARSER: parseWhileStatement()\\n\";\n //CST\n cstDepth++;\n cstString+= treeMaker(cstDepth)+\"<While Statement>\\n\";\n //AST\n astString += treeMaker(astDepth) + \"< While Statement >\\n\";\n astDepth++;\n\n //Tree\n var whileNode = [\"While Statement\", array[currentToken][2], scope];\n\n asTree.add(whileNode, blockList[scope]); //add [while node, parent block]\n\n\t\tmatch(\"T_WHILE\");\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n\t\tparseBooleanExpr(whileNode);\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n parseBlock(whileNode);\n \n astDepth--;\n\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n\t}\n\n\tfunction parseIfStatement(){\n\t\tparseString+= \"PARSER: parseIfStatement()\\n\";\n //CST\n cstDepth++;\n cstString+= treeMaker(cstDepth)+\"<If Statement>\\n\";\n //AST\n astString += treeMaker(astDepth) + \"< If Statement >\\n\";\n astDepth++;\n\n //Tree\n var ifNode = [\"If Statement\", array[currentToken][2], scope];\n\n asTree.add(ifNode, blockList[scope]); //add [if node, parent block]\n\n\t\tmatch(\"T_IF\");\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n\t\tparseBooleanExpr(ifNode);\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n parseBlock(ifNode);\n \n astDepth--;\n\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n\t}\n\n\tfunction parseExpr(arr){\n\t\tparseString+= \"PARSER: parseExpr()\\n\";\n cstString+= treeMaker(cstDepth)+\"<Expression>\\n\";\n\n\t\tif(array[currentToken][0]==\"T_DIGIT\"){\n\t\t\tparseIntExpr(arr);\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t}\n\t\telse if(array[currentToken][0]==\"T_QUOTE\"){\n\t\t\tparseStringExpr(arr);\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t}\n else if (array[currentToken][0] == \"T_LPAREN\"){\n parseBooleanExpr(arr);\n if (errors) {\n returnArr = [errors, parseString, cstString];\n return returnArr;\n }\n }\n else if (array[currentToken][0] == \"T_FALSE\" ||\n array[currentToken][0] == \"T_TRUE\"){\n parseBoolVal(arr);\n if (errors) {\n returnArr = [errors, parseString, cstString];\n return returnArr;\n }\n\t\t}\n\t\telse if(array[currentToken][0]==\"T_ID\"){\n\t\t\tparseId(arr);\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t} else {\n\t\t\tparseString+= \"PARSER: ERROR: Expected T_DIGIT or T_QUOTE or T_LPAREN or T_ID or T_TRUE or T_FALSE got \" + \n\t\t\tarray[currentToken][0] + \" with value '\" + \n\t\t\tarray[currentToken][1] + \"' on line \" + array[currentToken][2] + \"\\n\";\n\t\t\terrors = true;\n\t\t}\n }\n\n\tfunction parseIntExpr(arr){\n parseString+= \"PARSER: parseIntExpr()\\n\";\n //CST\n cstString+= treeMaker(cstDepth)+\"<Integer Expression>\\n\";\n\t\tif(array[currentToken][0]==\"T_DIGIT\" && array[currentToken+1][0]==\"T_ADD\"){\n //AST\n astString += treeMaker(astDepth) + \"< Add >\\n\";\n astDepth++;\n addDepth++;\n\n //Tree\n var addNode = [\"Add\", array[currentToken][2], scope, addDepth];\n\n asTree.add(addNode, arr); //add [add node, parent]\n\n\t\t\tparseDigit(addNode);\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t\tparseIntOp();\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t\tparseExpr(addNode);\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n }\n astDepth--;\n\t\t}\n\t\telse if(array[currentToken][0]==\"T_DIGIT\"){\n\t\t\tparseDigit(arr);\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t} else {\n\t\t\tparseString+= \"PARSER: ERROR: Expected T_DIGIT got \" + \n\t\t\tarray[currentToken][0] + \" with value '\" + \n\t\t\tarray[currentToken][1] + \"' on line \" + array[currentToken][2] + \"\\n\";\n\t\t\terrors = true;\n }\n //astDepth--;\n\t}\n\n\tfunction parseStringExpr(arr){\n\t\tparseString+= \"PARSER: parseStringExpr()\\n\";\n cstString+= treeMaker(cstDepth)+\"<String Expression>\\n\";\n //AST\n astString += treeMaker(astDepth) + \"[ \";\n\n string = \"\"; //reset variable\n var stringLine = array[currentToken][2];\n\n\t\tmatch(\"T_QUOTE\");\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n\t\tparseCharList();\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n\t\tmatch(\"T_QUOTE\");\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n }\n //AST\n astString += \" ]\\n\";\n //ADD THE RIGHT STRING NODE TO THE AST\n //Tree\n var stringNode = [\"T_STRING\", string, stringLine,scope];\n asTree.add(stringNode, arr); //add [string node, parent]\n string = \"\"; //reset variable\n\n\t}\n\n\tfunction parseBooleanExpr(arr){\n\t\tparseString+= \"PARSER: parseBooleanExpr()\\n\";\n\t\tcstString+= treeMaker(cstDepth)+\"<Boolean Expression>\\n\";\n\t\tif(array[currentToken][0]==\"T_LPAREN\"){\n //AST\n astString += treeMaker(astDepth) + \"< Boolean Expression >\\n\";\n astDepth++;\n boolDepth++;\n //Tree\n var boolExpNode = [\"Boolean Expression\", array[currentToken][2], scope, boolDepth];\n asTree.add(boolExpNode, arr); //add [bool exp node, parent block]\n\t\t\tmatch(\"T_LPAREN\");\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t\tparseExpr(boolExpNode);\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t\tparseBoolOp(boolExpNode);\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t\tparseExpr(boolExpNode);\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n match(\"T_RPAREN\");\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n }\n astDepth--;\n } else if (array[currentToken][0] == \"T_TRUE\" || array[currentToken][0] == \"T_FALSE\"){\n parseBoolVal(arr);\n if(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n } else {\n\t\t\tparseString+= \"PARSER: ERROR: Expected T_LPAREN or T_TRUE or T_FALSE got \" + \n\t\t\tarray[currentToken][0] + \" with value '\" + \n\t\t\tarray[currentToken][1] + \"' on line \" + array[currentToken][2] + \"\\n\";\n\t\t\terrors = true;\n\t\t}\n\t}\n\n\tfunction parseId(arr){\n\t\tparseString+= \"PARSER: parseId()\\n\";\n cstString+= treeMaker(cstDepth)+\"<ID>\\n\";\n //AST\n astString += treeMaker(astDepth) + \"[ \" + array[currentToken][1] + \" ]\\n\";\n \n //Tree\n array[currentToken].push(scope);\n asTree.add(array[currentToken], arr); //add [id node, parent]\n \n match(\"T_ID\");\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\t\t\n\t}\n\n\tfunction parseCharList(){\n\t\tparseString+= \"PARSER: parseCharList()\\n\";\n\t\tcstString+= treeMaker(cstDepth)+\"<Character List>\\n\";\n if (array[currentToken][0] == \"T_CHAR\" && array[currentToken][1] == \" \") {\n parseSpace();\n if (errors) {\n returnArr = [errors, parseString, cstString];\n return returnArr;\n }\n parseCharList();\n if (errors) {\n returnArr = [errors, parseString, cstString];\n return returnArr;\n }\n }\n else if(array[currentToken][0]==\"T_CHAR\"){\n\t\t\tparseChar();\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t\tparseCharList();\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t} else {\n\t\t\t//empty set\n\t\t}\n\t}\n\n\tfunction parseType(arr){\n\t\tparseString+= \"PARSER: parseType()\\n\";\n cstString+= treeMaker(cstDepth)+\"<Type>\\n\";\n //AST\n astString += treeMaker(astDepth) + \"[ \" + array[currentToken][1] + \" ]\\n\";\n //Tree\n array[currentToken].push(scope);\n asTree.add(array[currentToken], arr); //add [type node, parent]\n\t\tif(array[currentToken][0]==\"T_VAR_TYPE_INT\"){\n\t\t\tmatch(\"T_VAR_TYPE_INT\");\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t}\n\t\telse if(array[currentToken][0]==\"T_VAR_TYPE_STRING\"){\n\t\t\tmatch(\"T_VAR_TYPE_STRING\");\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t}\n\t\telse if(array[currentToken][0]==\"T_VAR_TYPE_BOOLEAN\"){\n\t\t\tmatch(\"T_VAR_TYPE_BOOLEAN\");\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t} else {\n\t\t\tparseString+= \"PARSER: ERROR: Expected T_VAR_TYPE_INT/STRING/BOOLEAN got \" + \n\t\t\tarray[currentToken][0] + \" with value '\" + \n\t\t\tarray[currentToken][1] + \"' on line \" + array[currentToken][2] + \"\\n\";\n\t\t\terrors=true;\n\t\t}\n\t}\n\n\tfunction parseChar(){\n\t\tparseString+= \"PARSER: parseChar()\\n\";\n cstString+= treeMaker(cstDepth)+\"<Character>\\n\";\n //AST\n astString += array[currentToken][1];\n string += array[currentToken][1];\n\t\tmatch(\"T_CHAR\");\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n }\n\t}\n\n\tfunction parseSpace(){\n\t\tparseString+= \"PARSER: parseSpace()\\n\";\n cstString+= treeMaker(cstDepth)+\"<Space Character>\\n\";\n //AST\n astString += array[currentToken][1];\n string += array[currentToken][1];\n\t\tif(array[currentToken][1] != \" \"){\n\t\t\tparseString+= \"PARSER: ERROR: Expected ' ' got \" + \n\t\t\tarray[currentToken][0] + \" with value '\" + \n\t\t\tarray[currentToken][1] + \"' on line \" + array[currentToken][2] + \"\\n\";\n\t\t\terrors=true;\n\t\t} else {\n cstString += treeMaker(cstDepth) +\"[\" + array[currentToken][1] + \"]\\n\";\n\t\t\tcurrentToken++;\n\t\t}\n\t}\n\n\tfunction parseDigit(arr){\n\t\tparseString+= \"PARSER: parseDigit()\\n\";\n cstString+= treeMaker(cstDepth)+\"<Digit>\\n\";\n //AST\n astString += treeMaker(astDepth) + \"[ \" + array[currentToken][1] + \" ]\\n\";\n //Tree\n array[currentToken].push(scope);\n asTree.add(array[currentToken], arr); //add [type node, parent]\n\t\tmatch(\"T_DIGIT\");\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n\t}\n\n\tfunction parseBoolOp(arr){\n\t\tparseString+= \"PARSER: parseBoolOp()\\n\";\n cstString+= treeMaker(cstDepth)+\"<Boolean Operator>\\n\";\n //AST\n astString += treeMaker(astDepth) + \"[ \" + array[currentToken][1] + \" ]\\n\";\n //Tree\n array[currentToken].push(scope);\n asTree.add(array[currentToken], arr); //add [bool op node, parent]\n\t\tif(array[currentToken][0]==\"T_EQ\"){\n\t\t\tmatch(\"T_EQ\");\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t}\n\t\telse if(array[currentToken][0]==\"T_INEQ\"){\n\t\t\tmatch(\"T_INEQ\");\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t} else {\n\t\t\tparseString+= \"PARSER: ERROR: Expected T_EQ or T_INEQ got \" + \n\t\t\tarray[currentToken][0] + \" with value '\" + \n\t\t\tarray[currentToken][1] + \"' on line \" + array[currentToken][2] + \"\\n\";\n\t\t\terrors=true;\n\t\t}\n\t}\n\n\tfunction parseBoolVal(arr){\n\t\tparseString+= \"PARSER: parseBoolVal()\\n\";\n cstString+= treeMaker(cstDepth)+\"<Boolean Value>\\n\";\n //AST\n astString += treeMaker(astDepth) + \"[ \" + array[currentToken][1] + \" ]\\n\";\n //Tree\n array[currentToken].push(scope);\n asTree.add(array[currentToken], arr); //add [bool val node, parent]\n\t\tif(array[currentToken][0]==\"T_FALSE\"){\n\t\t\tmatch(\"T_FALSE\");\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t}\n\t\telse if(array[currentToken][0]==\"T_TRUE\"){\n\t\t\tmatch(\"T_TRUE\");\n\t\t\tif(errors){\n\t\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\t\treturn returnArr;\n\t\t\t}\n\t\t} else {\n\t\t\tparseString+= \"PARSER: ERROR: Expected T_TRUE or T_FALSE got \" + \n\t\t\tarray[currentToken][0] + \" with value '\" + \n\t\t\tarray[currentToken][1] + \"' on line \" + array[currentToken][2] + \"\\n\";\n\t\t\terrors = true;\n\t\t}\n\t}\n\n\tfunction parseIntOp(){\n\t\tparseString+= \"PARSER: parseIntOp()\\n\";\n\t\tcstString+= treeMaker(cstDepth)+\"<Addition>\\n\";\n\t\tmatch(\"T_ADD\");\n\t\tif(errors){\n\t\t\treturnArr = [errors,parseString,cstString];\n\t\t\treturn returnArr;\n\t\t}\n\t}\n}", "getAst() {\n\n return {\n type: 'string',\n val: this.value\n };\n }", "parse() {\n\t\tlet mainFunctionBlock = [];\n\n\t\twhile (this.peek() !== undefined) {\n\t\t\tlet expr = this.parseExpression();\n\t\t\tif(expr) mainFunctionBlock.push(expr);\n\n\t\t\tif (this.peek() !== undefined) {\n\t\t\t\tthis.optionalSkip('punctuation', ';');\n\t\t\t}\n\t\t}\n\n\t\tthis.main.setBlock({\n\t\t\texpressions: mainFunctionBlock\n\t\t});\n\n\t\tlet fObj = this.main;\n\t\tfObj.isEntry = true;\n\n\t\tthis.functions.unshift(fObj);\n\n\t\treturn {\n\t\t\ttype: 'script',\n\t\t\tfunctions: this.functions\n\t\t};\n\t}", "function walk_tree(ast) {\n var walker = {\n \"assign\" : function() {\n var assign_expr = new assign_expression();\n assign_expr.type = \"assign_expr\";\n assign_expr.left_expr = walk_tree(ast[2]);\n assign_expr.right_expr = walk_tree(ast[3]);\n assign_expr.name = assign_expr.left_expr.name;\n \n return assign_expr;\n },\n \n \"var\" : function() {\n var assign_expr = new assign_expression();\n assign_expr.type = \"assign_expr\";\n \n assign_expr.left_expr = new type_object();\n assign_expr.left_expr.name = ast[1][0][0];\n assign_expr.right_expr = walk_tree(ast[1][0][1]);\n assign_expr.name = assign_expr.left_expr.name;\n \n return assign_expr; \n },\n \n \"stat\" : function() {\n return walk_tree(ast[1]);\n },\n \n \"dot\" : function() {\n var dot_obj = walk_tree(ast[1]);\n dot_obj.child = new type_object();\n dot_obj.child.name = ast[2];\n dot_obj.child.parent = dot_obj;\n return dot_obj;\n },\n \n \"name\" : function() {\n var new_obj = new type_object();\n new_obj.type = \"name\";\n new_obj.name = ast[1];\n return new_obj;\n },\n \n \"new\" : function() {\n var expr = walk_tree(ast[1]);\n expr.type = \"composition\";\n return expr;\n },\n \n \"function\" : function() {\n var func = new type_function(\"function\", ast[1], [\"toplevel\", [ast]], ast[2]);\n return func;\n },\n \n \"defun\" : function() { \n var func = new type_function(\"defun\", ast[1], [\"toplevel\", [ast]], ast[2]);\n return func;\n },\n \n \"return\" : function() {\n var return_expr = new type_expression();\n return_expr.type = \"return_expr\";\n return_expr.expr = walk_tree(ast[1]);\n return return_expr;\n },\n \n \"string\" : function() {\n var obj = new type_object();\n obj.type = \"string\";\n obj.value = ast[1];\n return obj;\n },\n \n \"num\" : function() {\n var obj = new type_object();\n obj.type = \"num\";\n obj.value = ast[1];\n return obj;\n },\n \n \"binary\" : function() {\n var binary_expr = new binary_expression();\n binary_expr.type = \"binary_expr\";\n binary_expr.binary_lhs = walk_tree(ast[2]);\n binary_expr.binary_rhs = walk_tree(ast[3]);\n },\n }\n \n var parent = ast[0];\n \n var func = walker[parent];\n \n return func(ast);\n}", "function Visitor() {}", "function Visitor() {}", "function Visitor() {}", "function statVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function normal() {\n return function (source, setState) {\n if (source.eatWhile(whiteCharRE)) {\n return null;\n }\n\n var ch = source.next();\n if (specialRE.test(ch)) {\n if (ch == '{' && source.eat('-')) {\n var t = \"comment\";\n if (source.eat('#')) t = \"meta\";\n return switchState(source, setState, ncomment(t, 1));\n }\n return null;\n }\n\n if (ch == '\\'') {\n if (source.eat('\\\\'))\n source.next(); // should handle other escapes here\n else\n source.next();\n\n if (source.eat('\\''))\n return \"string\";\n return \"error\";\n }\n\n if (ch == '\"') {\n return switchState(source, setState, stringLiteral);\n }\n\n if (largeRE.test(ch)) {\n source.eatWhile(idRE);\n if (source.eat('.'))\n return \"qualifier\";\n return \"variable-2\";\n }\n\n if (smallRE.test(ch)) {\n var isDef = source.pos === 1;\n source.eatWhile(idRE);\n return isDef ? \"type\" : \"variable\";\n }\n\n if (digitRE.test(ch)) {\n if (ch == '0') {\n if (source.eat(/[xX]/)) {\n source.eatWhile(hexitRE); // should require at least 1\n return \"integer\";\n }\n if (source.eat(/[oO]/)) {\n source.eatWhile(octitRE); // should require at least 1\n return \"number\";\n }\n }\n source.eatWhile(digitRE);\n var t = \"number\";\n if (source.eat('.')) {\n t = \"number\";\n source.eatWhile(digitRE); // should require at least 1\n }\n if (source.eat(/[eE]/)) {\n t = \"number\";\n source.eat(/[-+]/);\n source.eatWhile(digitRE); // should require at least 1\n }\n return t;\n }\n\n if (symbolRE.test(ch)) {\n if (ch == '-' && source.eat(/-/)) {\n source.eatWhile(/-/);\n if (!source.eat(symbolRE)) {\n source.skipToEnd();\n return \"comment\";\n }\n }\n source.eatWhile(symbolRE);\n return \"builtin\";\n }\n\n return \"error\";\n }\n }", "function parse_VarDecl() {\n tree.addNode('VarDecl', 'branch');\n parse_type();\n //tree.endChildren();\n\n parse_ID();\n //tree.endChildren();\n tree.endChildren();\n}", "function parse_Statement() {\n tree.addNode('Statement', 'branch');\n console.log('got to here');\n if (foundTokensCopy[parseCounter][0] == 'print') {\n console.log('found print');\n parse_PrintStatement();\n //tree.endChildren();\n //tree.endChildren();\n\n }\n // extends to here for the identifier question\n else if (foundTokensCopy[parseCounter][1] == 'identifier') {\n parse_AssignmentStatement();\n //tree.endChildren();\n\n console.log(\"got to identifier 2\");\n\n } else if (foundTokensCopy[parseCounter][0] == 'int') {\n parse_VarDecl();\n //tree.endChildren();\n\n\n } else if (foundTokensCopy[parseCounter][0] == 'string') {\n parse_VarDecl();\n //tree.endChildren();\n\n\n } else if (foundTokensCopy[parseCounter][0] == 'boolean') {\n parse_VarDecl();\n //tree.endChildren();\n\n\n } else if (foundTokensCopy[parseCounter][0] == 'while') {\n parse_WhileStatement();\n //tree.endChildren();\n\n\n } else if (foundTokensCopy[parseCounter][0] == 'if') {\n parse_IfStatement();\n //tree.endChildren();\n\n\n } else if (foundTokensCopy[parseCounter][0] == '{') {\n parse_Block();\n //tree.endChildren();\n\n\n\n\n } else {\n console.log('error');\n }\n\n\n\n tree.endChildren();\n\n\n\n}", "cleanParser() {\n this.bnodes = {}\n this.why = null\n }", "next() {\n while(this.pos < this.src.length) {\n let c = this.src.charAt(this.pos);\n switch(c) {\n case \" \": case \"\\r\": case \"\\b\": case \"\\t\":\n ++this.pos;\n ++this.posCount;\n break;\n case \"\\n\":\n ++this.pos;\n ++this.posLine;\n this.posCount = 1;\n break;\n case \"#\":\n this._lexComment(); break;\n case \"=\": return this._yield(Token.tkAssign,1,1);\n case \"+\": return this._yield(Token.tkAdd,1,1);\n case \"-\": return this._yield(Token.tkSub,1,1);\n case \"*\": return this._yield(Token.tkMul,1,1);\n case \"(\": return this._yield(Token.tkLPar,1,1);\n case \")\": return this._yield(Token.tkRPar,1,1);\n case \"{\": return this._yield(Token.tkLBra,1,1);\n case \"}\": return this._yield(Token.tkRBra,1,1);\n case \"[\": return this._yield(Token.tkLSqr,1,1);\n case \"]\": return this._yield(Token.tkRSqr,1,1);\n case \";\": return this._yield(Token.tkSemicolon,1,1);\n case \",\": return this._yield(Token.tkComma,1,1);\n case \"0\": case \"1\": case \"2\": case \"3\": case \"4\":\n case \"5\": case \"6\": case \"7\": case \"8\": case \"9\":\n return this._lexNumber(c);\n default:\n return this._lexVar(c);\n }\n }\n\n return this._yield(Token.tkEof,0,0);\n }", "function normal(source, setState) {\n if (source.eatWhile(whiteCharRE)) {\n return null;\n }\n\n var ch = source.next();\n if (specialRE.test(ch)) {\n if (ch == '{' && source.eat('-')) {\n var t = \"comment\";\n if (source.eat('#')) {\n t = \"meta\";\n }\n return switchState(source, setState, ncomment(t, 1));\n }\n return null;\n }\n\n if (ch == '\\'') {\n if (source.eat('\\\\')) {\n source.next(); // should handle other escapes here\n }\n else {\n source.next();\n }\n if (source.eat('\\'')) {\n return \"string\";\n }\n return \"string error\";\n }\n\n if (ch == '\"') {\n return switchState(source, setState, stringLiteral);\n }\n\n if (largeRE.test(ch)) {\n source.eatWhile(idRE);\n if (source.eat('.')) {\n return \"qualifier\";\n }\n return \"variable-2\";\n }\n\n if (smallRE.test(ch)) {\n source.eatWhile(idRE);\n return \"variable\";\n }\n\n if (digitRE.test(ch)) {\n if (ch == '0') {\n if (source.eat(/[xX]/)) {\n source.eatWhile(hexitRE); // should require at least 1\n return \"integer\";\n }\n if (source.eat(/[oO]/)) {\n source.eatWhile(octitRE); // should require at least 1\n return \"number\";\n }\n }\n source.eatWhile(digitRE);\n var t = \"number\";\n if (source.match(/^\\.\\d+/)) {\n t = \"number\";\n }\n if (source.eat(/[eE]/)) {\n t = \"number\";\n source.eat(/[-+]/);\n source.eatWhile(digitRE); // should require at least 1\n }\n return t;\n }\n\n if (ch == \".\" && source.eat(\".\"))\n return \"keyword\";\n\n if (symbolRE.test(ch)) {\n if (ch == '-' && source.eat(/-/)) {\n source.eatWhile(/-/);\n if (!source.eat(symbolRE)) {\n source.skipToEnd();\n return \"comment\";\n }\n }\n var t = \"variable\";\n if (ch == ':') {\n t = \"variable-2\";\n }\n source.eatWhile(symbolRE);\n return t;\n }\n\n return \"error\";\n }", "function normal(source, setState) {\n if (source.eatWhile(whiteCharRE)) {\n return null;\n }\n\n var ch = source.next();\n if (specialRE.test(ch)) {\n if (ch == '{' && source.eat('-')) {\n var t = \"comment\";\n if (source.eat('#')) {\n t = \"meta\";\n }\n return switchState(source, setState, ncomment(t, 1));\n }\n return null;\n }\n\n if (ch == '\\'') {\n if (source.eat('\\\\')) {\n source.next(); // should handle other escapes here\n }\n else {\n source.next();\n }\n if (source.eat('\\'')) {\n return \"string\";\n }\n return \"error\";\n }\n\n if (ch == '\"') {\n return switchState(source, setState, stringLiteral);\n }\n\n if (largeRE.test(ch)) {\n source.eatWhile(idRE);\n if (source.eat('.')) {\n return \"qualifier\";\n }\n return \"variable-2\";\n }\n\n if (smallRE.test(ch)) {\n source.eatWhile(idRE);\n return \"variable\";\n }\n\n if (digitRE.test(ch)) {\n if (ch == '0') {\n if (source.eat(/[xX]/)) {\n source.eatWhile(hexitRE); // should require at least 1\n return \"integer\";\n }\n if (source.eat(/[oO]/)) {\n source.eatWhile(octitRE); // should require at least 1\n return \"number\";\n }\n }\n source.eatWhile(digitRE);\n var t = \"number\";\n if (source.eat('.')) {\n t = \"number\";\n source.eatWhile(digitRE); // should require at least 1\n }\n if (source.eat(/[eE]/)) {\n t = \"number\";\n source.eat(/[-+]/);\n source.eatWhile(digitRE); // should require at least 1\n }\n return t;\n }\n\n if (symbolRE.test(ch)) {\n if (ch == '-' && source.eat(/-/)) {\n source.eatWhile(/-/);\n if (!source.eat(symbolRE)) {\n source.skipToEnd();\n return \"comment\";\n }\n }\n var t = \"variable\";\n if (ch == ':') {\n t = \"variable-2\";\n }\n source.eatWhile(symbolRE);\n return t;\n }\n\n return \"error\";\n }", "parse() {\n // Parse line number.\n this.lineNumber = this.readNumber();\n if (this.lineNumber === undefined) {\n return \"Missing line number: \" + this.line;\n }\n this.result.push(z80_base_1.lo(this.lineNumber));\n this.result.push(z80_base_1.hi(this.lineNumber));\n // We only trim at the start, so there could be only spaces here, but that's not allowed.\n if (this.line.substr(this.pos).trim() === \"\") {\n return \"Empty line \" + this.lineNumber;\n }\n // Skip single optional whitespace\n if (this.pos < this.line.length && BasicParser.isWhitespace(this.line.charCodeAt(this.pos))) {\n this.pos++;\n }\n while (this.pos < this.line.length) {\n let ch = this.line.charCodeAt(this.pos);\n // Lower case anything outside of strings.\n if (ch >= 0x61 && ch < 0x61 + 26) {\n ch -= 0x20;\n }\n // Handle single-quote comment.\n if (ch === SINGLE_QUOTE) {\n // Single quote is the start of a comment, but it's encoded in a backward-compatible\n // way with several tokens.\n this.result.push(COLON, REM, REMQUOT);\n this.pos++;\n // We're done, copy the rest of the line.\n break;\n }\n // Handle string.\n if (ch === DOUBLE_QUOTE) {\n this.result.push(ch);\n this.pos++;\n while (this.pos < this.line.length) {\n ch = this.line.charCodeAt(this.pos++);\n this.result.push(ch);\n if (ch === DOUBLE_QUOTE) {\n break;\n }\n }\n }\n else {\n // See if it should be a token.\n const token = this.readToken();\n if (token === undefined) {\n // Just a regular letter.\n this.result.push(ch);\n this.pos++;\n }\n else {\n // Prefix ELSE with colon for backward compatibility.\n if (token === ELSE && this.result[this.result.length - 1] !== COLON) {\n this.result.push(COLON);\n }\n this.result.push(token);\n this.pos += TOKENS[token - FIRST_TOKEN].length;\n if (token === REM) {\n // We're done, copy the rest of the line.\n break;\n }\n if (token === DATA) {\n // Copy to end of statement.\n let inString = false;\n while (this.pos < this.line.length) {\n ch = this.line.charCodeAt(this.pos);\n if (ch === DOUBLE_QUOTE) {\n inString = !inString;\n }\n else if (ch === COLON && !inString) {\n break;\n }\n this.result.push(ch);\n this.pos++;\n }\n }\n }\n }\n }\n // Copy rest of line (for comments).\n while (this.pos < this.line.length) {\n this.result.push(this.line.charCodeAt(this.pos++));\n }\n // End-of-line marker.\n this.result.push(0);\n return new Uint8Array(this.result);\n }", "preprocess() {\n\t\tlet s = []; // pointer stack\n\t\tthis.s = {}; // pointer cache\n\t\tthis.c = 0; // code pointer\n\t\t\n\t\tthis.log('Validating syntax...');\n\t\twhile (this.c < this.code.length) {\n\t\t\tif (OPCODES.includes(this.C)) {\n\t\t\t\tif (this.C == '[') {\n\t\t\t\t\ts.push(this.c);\n\t\t\t\t} else if (this.C == ']') {\n\t\t\t\t\tlet p = s.pop();\n\t\t\t\t\tif (p === undefined) {\n\t\t\t\t\t\tthrow new SyntaxError(`Unexpected ${this.C} at ${this.c}.`);\n\t\t\t\t\t}\n\t\t\t\t\tthis.s[this.c] = p;\n\t\t\t\t\tthis.s[p] = this.c;\n\t\t\t\t}\n\t\t\t} else if (this.options.strict) {\n\t\t\t\tthrow new SyntaxError(`${this.C} at ${this.c} is not a valid opcode.`);\n\t\t\t}\n\t\t\tthis.c++;\n\t\t}\n\t\tif (s.length) {\n\t\t\tthrow new SyntaxError(`Missing ] for bracket(s) at ${s.join(', ')}`);\n\t\t}\n\t\t// valid syntax!\n\t\treturn true;\n\t}", "function massageAstNode(ast, newObj) {\n // Handling ApexDoc\n if (\n ast[\"@class\"] &&\n ast[\"@class\"] === apexTypes.BLOCK_COMMENT &&\n isApexDocComment(ast)\n ) {\n newObj.value = ast.value.replace(/\\s/g, \"\");\n }\n if (ast.scope && typeof ast.scope === \"string\") {\n // Apex is case insensitivity, but in sone case we're forcing the strings\n // to be uppercase for consistency so the ASTs may be different between\n // the original and parsed strings.\n newObj.scope = ast.scope.toUpperCase();\n } else if (\n ast.dottedExpr &&\n ast.dottedExpr.value &&\n ast.dottedExpr.value.names &&\n ast.dottedExpr.value[\"@class\"] === apexTypes.VARIABLE_EXPRESSION &&\n ast.names\n ) {\n // This is a workaround for #38 - jorje sometimes groups names with\n // spaces as dottedExpr, so we can't compare AST effectively.\n // In those cases we will bring the dottedExpr out into the names.\n newObj.names = newObj.dottedExpr.value.names.concat(newObj.names);\n newObj.dottedExpr = newObj.dottedExpr.value.dottedExpr;\n } else if (\n ast[\"@class\"] &&\n ast[\"@class\"] === apexTypes.WHERE_COMPOUND_EXPRESSION\n ) {\n // This flattens the SOQL/SOSL Compound Expression, e.g.:\n // SELECT Id FROM Account WHERE Name = 'Name' AND (Status = 'Active' AND City = 'Boston')\n // is equivalent to:\n // SELECT Id FROM Account WHERE Name = 'Name' AND Status = 'Active' AND City = 'Boston'\n for (let i = newObj.expr.length - 1; i >= 0; i -= 1) {\n if (\n newObj.expr[i][\"@class\"] === apexTypes.WHERE_COMPOUND_EXPRESSION &&\n newObj.expr[i].op[\"@class\"] === newObj.op[\"@class\"]\n ) {\n newObj.expr.splice(i, 1, ...newObj.expr[i].expr);\n }\n }\n }\n METADATA_TO_IGNORE.forEach(name => delete newObj[name]);\n}", "function getAst(code, sourceFileName) {\n // A utility class for handling nodes of an AST.\n function NodeUtils() {\n var self = this;\n // Performs deep copy of the given node.\n this.deepCopy = function(node) {\n return JSON.parse(JSON.stringify(node));\n };\n\n // Deletes a node from the body.\n this.deleteNode = function(parentBody, nodeToDel) {\n var deleteIndex = parentBody.indexOf(nodeToDel);\n parentBody.splice(deleteIndex, 1);\n };\n\n // Replaces source node with the target node and returns a reference to the new node.\n this.replaceNode = function(source, target, context) {\n var sourceCopy = self.deepCopy(source);\n\n Object.keys(source).forEach(function(key) {\n delete source[key];\n });\n Object.keys(target).forEach(function(key) {\n source[key] = target[key];\n });\n\n // Using this check temporarily.\n // if (!self.hasLocNode(sourceCopy)) {\n // \treturn source;\n // }\n\n // Attach the loc nodes based on the context.\n switch (context) {\n // Mapping of loc nodes for N1qlQuery happens during the substitution of variables in the N1QL query string.\n /*\n \tBefore:\n \tvar res1 = new N1qlQuery(`select * from :bucket LIMIT 10;`);\n \tAfter:\n \tvar res1 = new N1qlQuery('select * from ' + bucket + ' LIMIT 10;');\n */\n case Context.N1qlQuery:\n source.loc = self.deepCopy(sourceCopy.loc);\n source.callee.loc = self.deepCopy(sourceCopy.callee.loc);\n source.arguments[0].loc = self.deepCopy(sourceCopy.arguments[\n 0].quasis[0].loc);\n break;\n\n // Mapping of if-else block to for-of loop.\n /*\n \tBefore:\n \tfor (var r of res1){...}\n \tAfter:\n \tif (res1.isInstance) {\n \t\tres1.iter(function (r) {...}\n \t} else {...}\n */\n case Context.IterTypeCheck:\n source.loc = self.deepCopy(sourceCopy.loc);\n source.consequent.loc = self.deepCopy(sourceCopy.body.loc);\n source.test.loc = self.deepCopy(sourceCopy.right.loc);\n source.test.object.loc = self.deepCopy(sourceCopy.right\n .loc);\n source.test.property.loc = self.deepCopy(sourceCopy.right\n .loc);\n\n // TODO: Currently, after breaking out from labeled break statement, it goes to the beginning of the for-of loop.\n //\t\tIdeally, it should go to the end of the labeled block. This looks quite ideal to show the iteration behaviour -\n //\t\tIt stops at the enclosing for-of loops (iterators) before coming out and thus, demonstrating the stopping\n //\t\tof iteration. Need to ask whether this is ok or if the default behaviour is needed.\n if (source.consequent.body.length > 1 &&\n /SwitchStatement/.test(source.consequent.body[1].type)\n ) {\n self.forceSetLocForAllNodes(sourceCopy.loc, source.consequent\n .body[1]);\n }\n break;\n\n // The following case handles two-way mapping of loc nodes between continue and return statements.\n case Context.ContinueStatement:\n source.loc = self.deepCopy(sourceCopy.loc);\n switch (source.type) {\n // Return to continue statement mapping - source: return, target: continue\n case 'ContinueStatement':\n if (source.label) {\n source.label.loc = self.deepCopy(sourceCopy\n .loc);\n }\n break;\n\n // Continue to return statement mapping - source: continue, target: return\n case 'ReturnStatement':\n if (source.argument && sourceCopy.label.loc) {\n source.argument = self.setLocForAllNodes(\n sourceCopy.label.loc, source.argument\n );\n }\n break;\n\n default:\n throw 'Not yet handled for ' + source.type;\n }\n break;\n\n // The following case handles two-way mapping of loc nodes between break and return statements.\n case Context.BreakStatement:\n source.loc = self.deepCopy(sourceCopy.loc);\n switch (source.type) {\n // Return to break statement mapping - source: return, target: break\n case 'BreakStatement':\n source.label.loc = self.deepCopy(sourceCopy.argument\n .loc);\n break;\n\n // Break to return statement mapping - source: break, target: return\n case 'ReturnStatement':\n source.argument = self.setLocForAllNodes(\n sourceCopy.loc, source.argument);\n break;\n\n default:\n throw 'Not yet handled for ' + source.type;\n }\n break;\n\n // The following case handles mapping of loc nodes between two different 'stopIter' calls.\n /*\n \tBefore:\n \treturn res2.stopIter({\n \t\t'code': 'labeled_break',\n \t\t'args': 'x'\n \t});\n \tAfter:\n \treturn res1.stopIter({\n \t\t'code': 'labeled_break',\n \t\t'args': 'x'\n \t});\n */\n case Context.BreakAltInterrupt:\n self.setLocMatchingNodes(sourceCopy, source);\n break;\n\n // The following case handles the mapping of loc nodes between stopIter and\n // return statement or between two stopIter statements as the above case.\n /*\n \tBefore:\n \treturn res2.stopIter({\n \t\t\t'code': 'labeled_continue',\n \t\t\t'args': 'x'\n \t\t});\n \tAfter:\n \treturn;\n */\n case Context.ContinueAltInterrupt:\n if (source.argument) {\n self.setLocMatchingNodes(sourceCopy, source);\n } else {\n source.loc = sourceCopy.loc;\n }\n break;\n }\n\n return source;\n };\n\n // Checks if atleast one loc node is present in the AST.\n this.hasLocNode = function(ast) {\n var hasLoc = false;\n estraverse.traverse(ast, {\n enter: function(node) {\n if (hasLoc) {\n return;\n }\n\n hasLoc = node.loc;\n }\n });\n\n return hasLoc;\n };\n\n // Adds loc node for all the nodes in the AST.\n // Thus, all the nodes of AST might end up having unnecessary loc nodes.\n // Though this method wouldn't modify the parsing behaviour, it must be used as a last resort.\n this.forceSetLocForAllNodes = function(loc, ast) {\n estraverse.traverse(ast, {\n enter: function(node) {\n if (!node.loc) {\n node.loc = self.deepCopy(loc);\n }\n }\n });\n };\n\n // This is a safe method for adding loc nodes for a given AST.\n // The disadvantage is that it can not be used with all the AST.\n this.setLocForAllNodes = function(loc, ast) {\n // Generate the code snippet for the given AST.\n var codeSnippet = escodegen.generate(ast);\n // Parse with loc enabled to determine the nodes to which we can attach loc node.\n var astWithLoc = esprima.parse(codeSnippet, {\n loc: true\n });\n\n // We new traverse astWithLoc and replace all the loc nodes.\n estraverse.traverse(astWithLoc, {\n enter: function(node) {\n node.loc = node.loc ? nodeUtils.deepCopy(\n loc) : null;\n }\n });\n\n return astWithLoc.body[0].expression;\n };\n\n // This is a safe method for performing a one-to-one copy of the loc nodes from AST1 to AST2.\n // The two ASTs must have the same structure.\n this.setLocMatchingNodes = function(source, target) {\n var sourceNodeStack = new Stack(),\n targetNodeStack = new Stack();\n\n // Linearizes the given AST into a stack.\n function convertTreeToStack(ast, stack) {\n estraverse.traverse(ast, {\n enter: function(node) {\n stack.push(node);\n }\n });\n }\n\n convertTreeToStack(source, sourceNodeStack);\n convertTreeToStack(target, targetNodeStack);\n\n // Pop all nodes from the sourceNodeStack and if an element contains loc node,\n // copy it to the corresponding element in the targetNodeStack.\n while (!sourceNodeStack.isEmpty()) {\n var sourceNode = sourceNodeStack.pop();\n var targetNode = targetNodeStack.pop();\n if (sourceNode.loc) {\n targetNode.loc = self.deepCopy(sourceNode.loc);\n }\n }\n };\n\n // Inserts the given node to the given parentBody at the specified index.\n this.insertNode = function(parentBody, refNode, nodeToInsert,\n insertAfter) {\n var insertIndex = insertAfter ? parentBody.indexOf(refNode) + 1 :\n parentBody.indexOf(refNode);\n parentBody.splice(insertIndex, 0, nodeToInsert);\n };\n\n // A N1QL node is a statement of the form new N1qlQuery('...');\n this.isN1qlNode = function(node) {\n return /NewExpression/.test(node.type) && /N1qlQuery/.test(node\n .callee.name);\n };\n\n this.convertToBlockStmt = function(node) {\n switch (node.type) {\n case 'ForOfStatement':\n // Transform the previous single-line statement into a block.\n node.body.body = [nodeUtils.deepCopy(node.body)];\n node.body.type = 'BlockStatement';\n break;\n case 'IfStatement':\n node.consequent.body = [nodeUtils.deepCopy(node.consequent)];\n node.consequent.type = 'BlockStatement';\n // If the 'else' part exists, convert it to a block statement.\n if (node.alternate) {\n node.alternate.body = [nodeUtils.deepCopy(node.alternate)];\n node.alternate.type = 'BlockStatement';\n }\n break;\n default:\n throw 'unhandled case for: ' + node.type;\n }\n };\n\n // Inserts an array of AST nodes into parentBody at the specified index.\n this.insertNodeArray = function(parentBody, insAfterNode, arrayToInsert) {\n var insertIndex = parentBody.indexOf(insAfterNode) + 1;\n parentBody.splice.apply(parentBody, [insertIndex, 0].concat(\n arrayToInsert));\n };\n\n // Build an ast node for N1QL function call from the query.\n this.getQueryAst = function(query) {\n // Identifier regex.\n var re = /:([a-zA-Z_$][a-zA-Z_$0-9]*)/g;\n\n // Replace the :<var> with proper substitution.\n query = query.replace(re, '\" + $1 + \"');\n query = 'new N1qlQuery(\"' + query + '\");';\n\n return esprima.parse(query).body[0].expression;\n };\n\n // Checks if the global scope contains only function declarations.\n this.checkGlobals = function(ast) {\n for (var node of ast.body) {\n if (!/FunctionDeclaration/.test(node.type)) {\n throw 'Only function declaration are allowed in global scope';\n }\n }\n }\n }\n\n // A general purpose stack.\n function Stack() {\n var stack = [];\n\n this.stackCopy = stack;\n\n this.push = function(item) {\n stack.push(item);\n };\n\n this.pop = function() {\n if (stack.length === 0) {\n throw 'Stack underflow exception';\n }\n return stack.pop();\n };\n\n this.peek = function() {\n var size = this.getSize();\n if (size >= 0) {\n return stack[size - 1];\n }\n };\n\n this.getSize = function() {\n return stack.length;\n };\n\n this.cloneStack = function() {\n var clone = new Stack();\n\n for (var item of stack) {\n clone.push(nodeUtils.deepCopy(item));\n }\n\n return clone;\n };\n\n this.reverseElements = function() {\n stack.reverse();\n };\n\n this.isEmpty = function() {\n return stack.length === 0;\n };\n\n // debug.\n this.printAll = function() {\n for (var item of stack) {\n console.log(item);\n console.log();\n }\n }\n }\n\n // A sub-class of Stack. Its purpose it to maintain the ancestral information\n // of nodes : node-parent relationship.\n function AncestorStack() {\n Stack.call(this);\n\n // Returns or pops a node that satisfies the comparator.\n function getOrPopAncestor(_this, comparator, pop) {\n var tempStack = new Stack();\n var found = false;\n\n // Run through all the elements in the stack against the comparator and break out once the element is found.\n while (_this.getSize() > 0 && !found) {\n var node = _this.pop();\n tempStack.push(node);\n found = comparator(nodeUtils.deepCopy(node));\n }\n\n if (pop) {\n tempStack.pop();\n }\n\n // Restore everything back to the stack.\n while (tempStack.getSize() > 0) {\n _this.push(tempStack.pop());\n }\n\n return found ? node : null;\n }\n\n this.getAncestor = function(comparator) {\n return getOrPopAncestor(this, comparator, false);\n };\n\n this.popNode = function(comparator) {\n return getOrPopAncestor(this, comparator, true);\n };\n\n // Returns the topmost node of the given type. Need not necessarily be the top of stack.\n this.getTopNodeOfType = function(nodeType) {\n return this.getAncestor(function(node) {\n return nodeType === node.type;\n });\n };\n\n this.popTopNodeOfType = function(nodeType) {\n return this.popNode(function(node) {\n return nodeType === node.type;\n });\n };\n\n this.cloneAncestorStack = function() {\n var clone = new AncestorStack();\n // Clone the stack.\n var stackClone = this.cloneStack();\n\n while (stackClone.getSize() > 0) {\n clone.push(stackClone.pop());\n }\n\n // Reverse the stack elements.\n clone.reverseElements();\n\n return clone;\n };\n }\n\n // Class to maintain the association of loop modifiers - break, continue, return etc. with JavaScript loops.\n function LoopModifier(modifier) {\n var ancestorStack = new AncestorStack();\n this.modType = modifier;\n this.stackIndex = -1;\n\n // debug.\n this.stackCopy = ancestorStack.stackCopy;\n\n // Initializing association information.\n // Obtained from JavaScript reference - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference\n var associations = new Set();\n switch (this.modType) {\n case LoopModifier.CONST.BREAK:\n associations.add('DoWhileStatement');\n associations.add('ForStatement');\n associations.add('ForInStatement');\n associations.add('ForOfStatement');\n associations.add('SwitchStatement');\n associations.add('WhileStatement');\n associations.add('LabeledStatement');\n break;\n\n case LoopModifier.CONST.CONTINUE:\n associations.add('DoWhileStatement');\n associations.add('ForStatement');\n associations.add('ForInStatement');\n associations.add('ForOfStatement');\n associations.add('SwitchStatement');\n associations.add('WhileStatement');\n break;\n\n case LoopModifier.CONST.LABELED_CONTINUE:\n case LoopModifier.CONST.LABELED_BREAK:\n associations.add('LabeledStatement');\n break;\n\n case LoopModifier.CONST.RETURN:\n associations.add('FunctionDeclaration');\n associations.add('FunctionExpression');\n break;\n\n default:\n throw 'Invalid modifier';\n }\n\n this.checkAssoc = function(nodeType) {\n return associations.has(nodeType);\n };\n\n // Push the node if it associates with the loop modifier instance.\n this.pushIfAssoc = function(node) {\n if (this.checkAssoc(node.type)) {\n switch (this.modType) {\n case LoopModifier.CONST.BREAK:\n node.breakStackIndex = this.stackIndex;\n break;\n\n case LoopModifier.CONST.CONTINUE:\n node.continueStackIndex = this.stackIndex;\n break;\n\n case LoopModifier.CONST.LABELED_BREAK:\n node.lblBreakStackIndex = this.stackIndex;\n break;\n\n case LoopModifier.CONST.RETURN:\n node.returnStackIndex = this.stackIndex;\n break;\n\n case LoopModifier.CONST.LABELED_CONTINUE:\n node.lblContinueStackIndex = this.stackIndex;\n break;\n\n default:\n throw 'Invalid modifier type';\n }\n\n ancestorStack.push(node);\n }\n };\n\n this.popIfAssoc = function() {\n if (ancestorStack.getSize() > 0) {\n switch (this.modType) {\n case LoopModifier.CONST.BREAK:\n if (this.stackIndex === ancestorStack.peek().breakStackIndex) {\n return ancestorStack.pop();\n }\n break;\n\n case LoopModifier.CONST.CONTINUE:\n if (this.stackIndex === ancestorStack.peek().continueStackIndex) {\n return ancestorStack.pop();\n }\n break;\n\n case LoopModifier.CONST.LABELED_BREAK:\n if (this.stackIndex === ancestorStack.peek().lblBreakStackIndex) {\n return ancestorStack.pop();\n }\n break;\n\n case LoopModifier.CONST.RETURN:\n if (this.stackIndex === ancestorStack.peek().returnStackIndex) {\n return ancestorStack.pop();\n }\n break;\n\n case LoopModifier.CONST.LABELED_CONTINUE:\n if (this.stackIndex === ancestorStack.peek().lblContinueStackIndex) {\n return ancestorStack.pop();\n }\n break;\n\n default:\n throw 'Invalid modifier type';\n }\n }\n };\n\n\n this.getSize = function() {\n return ancestorStack.getSize();\n };\n\n // Returns a boolean suggesting whether the loop modifier needs to be replaced.\n this.isReplaceReq = function(args) {\n switch (this.modType) {\n // For break and continue, the replacement criteria is the for-of node being the parent on TOS.\n case LoopModifier.CONST.CONTINUE:\n case LoopModifier.CONST.BREAK:\n return ancestorStack.getSize() > 0 && /ForOfStatement/.test(\n ancestorStack.peek().type);\n\n case LoopModifier.CONST.LABELED_CONTINUE:\n // For labelled break, the replacement criteria is the absence of the label which the break is\n // associated with.\n case LoopModifier.CONST.LABELED_BREAK:\n return !ancestorStack.getAncestor(function(node) {\n if (/LabeledStatement/.test(node.type)) {\n return args === node.label.name;\n }\n });\n\n // For return statement, the replacement criteria is the absence of a function on TOS.\n case LoopModifier.CONST.RETURN:\n if (ancestorStack.getSize() === 0) {\n return true;\n }\n return !(/FunctionDeclaration/.test(ancestorStack.peek()\n .type) ||\n /FunctionExpression/.test(ancestorStack.peek().type)\n );\n\n default:\n throw 'Invalid modifier type';\n }\n };\n\n // debug.\n this.printAll = function() {\n ancestorStack.printAll();\n }\n }\n\n // LoopModifier types.\n LoopModifier.CONST = {\n BREAK: 'break',\n CONTINUE: 'continue',\n LABELED_BREAK: 'labeled_break',\n RETURN: 'return',\n LABELED_CONTINUE: 'labeled_continue'\n };\n\n Context = {\n N1qlQuery: 'n1ql_query',\n IterTypeCheck: 'iter_type_check',\n BreakStatement: 'break_statement',\n BreakAltInterrupt: 'break_alt_interrupt',\n ContinueStatement: 'continue_statement',\n ContinueAltInterrupt: 'continue_alt_interrupt',\n ReturnStatement: 'return_statement',\n ReturnAltFound: 'return_alt_found',\n ReturnAltInterrupt: 'return_alt_interrupt',\n IterConsequent: 'iter_consequent'\n };\n\n // Utilities for AncestorStack\n function StackHelper(ancestorStack) {\n this.ancestorStack = ancestorStack.cloneAncestorStack();\n\n this.getTopForOfNode = function() {\n return this.ancestorStack.getTopNodeOfType('ForOfStatement');\n };\n\n this.popTopForOfNode = function() {\n return this.ancestorStack.popTopNodeOfType('ForOfStatement');\n };\n\n // Targeted search - search the stack for the target, but stop and return if the stop-condition is met.\n // Comparator must define targetComparator and stopComparator and each of them should return a boolean.\n // Setting searchAll to true will return all the stopNodes till the targetNode is encountered.\n function search(_this, comparator, searchAll) {\n var tempStack = new Stack(),\n stopNodes = [],\n returnArgs = {\n targetFound: false\n };\n\n while (_this.ancestorStack.getSize() > 0) {\n var node = _this.ancestorStack.pop();\n tempStack.push(node);\n\n if (comparator.targetComparator(nodeUtils.deepCopy(node))) {\n returnArgs = {\n targetFound: true,\n stopNode: nodeUtils.deepCopy(node),\n searchInterrupted: false\n };\n break;\n } else if (comparator.stopComparator(nodeUtils.deepCopy(node))) {\n returnArgs = {\n targetFound: false,\n stopNode: nodeUtils.deepCopy(node),\n searchInterrupted: true\n };\n if (searchAll) {\n stopNodes.push(returnArgs.stopNode);\n } else {\n break;\n }\n }\n }\n\n // Restore the elements back to the stack.\n while (tempStack.getSize() > 0) {\n _this.ancestorStack.push(tempStack.pop());\n }\n\n // A check to validate that targetFound and searchInterrupted are mutually exclusive.\n if (returnArgs.targetFound && returnArgs.searchInterrupted) {\n throw 'Invalid case: targetFound=' + returnArgs.targetFound +\n '\\tsearchInterrupted=' + returnArgs.searchInterrupted;\n }\n\n if (searchAll && stopNodes.length > 0) {\n returnArgs = {\n targetFound: false,\n stopNodes: stopNodes,\n searchInterrupted: true\n };\n }\n\n return returnArgs;\n }\n\n this.searchStack = function(comparator) {\n return search(this, comparator);\n };\n\n this.searchAllStopNodes = function(comparator) {\n return search(this, comparator, true);\n }\n }\n\n // Data types JavaScript AST nodes - http://esprima.readthedocs.io/en/latest/syntax-tree-format.html\n function Ast(type) {\n this.type = type;\n }\n\n function SwitchAst(discriminantAst) {\n Ast.call(this, 'SwitchStatement');\n this.discriminant = discriminantAst;\n this.cases = [];\n }\n\n function CaseAst(testStr) {\n Ast.call(this, 'SwitchCase');\n this.test = {\n \"type\": \"Literal\",\n \"value\": testStr,\n \"raw\": String.raw `${testStr}`\n };\n this.consequent = [];\n }\n\n function BreakAst() {\n Ast.call(this, 'BreakStatement');\n this.label = null;\n }\n\n function LabeledStmtAst(label, body) {\n Ast.call(this, 'LabeledStatement');\n this.label = {\n \"type\": \"Identifier\",\n \"name\": label\n };\n this.body = body;\n }\n\n function LabeledBreakAst(label) {\n BreakAst.call(this);\n this.label = {\n \"type\": \"Identifier\",\n \"name\": label\n };\n }\n\n function ContinueAst() {\n Ast.call(this, 'ContinueStatement');\n this.label = null;\n }\n\n function LabeledContinueAst(label) {\n ContinueAst.call(this);\n this.label = {\n \"type\": \"Identifier\",\n \"name\": label\n };\n }\n\n function ReturnAst(argument) {\n Ast.call(this, 'ReturnStatement');\n this.argument = argument;\n }\n\n function StopIterAst(inst) {\n Ast.call(this, 'CallExpression');\n this.callee = {\n \"type\": \"MemberExpression\",\n \"computed\": false,\n \"object\": {\n \"type\": \"Identifier\",\n \"name\": inst\n },\n \"property\": {\n \"type\": \"Identifier\",\n \"name\": \"stopIter\"\n }\n };\n this.arguments = [];\n }\n\n function MemExprAst(objName) {\n Ast.call(this, 'MemberExpression');\n this.computed = false;\n this.object = {\n \"type\": \"Identifier\",\n \"name\": objName\n };\n this.property = {\n \"type\": \"Identifier\",\n \"name\": \"isInstance\"\n };\n }\n\n function IfElseAst(memExprAst) {\n Ast.call(this, 'IfStatement');\n this.test = memExprAst;\n this.consequent = {\n \"type\": \"BlockStatement\",\n \"body\": []\n };\n this.alternate = {\n \"type\": \"BlockStatement\",\n \"body\": []\n };\n }\n\n // Returns AST of the form 'iterVar'.'prop()'.data\n function ReturnDataAst(iterVar, prop) {\n Ast.call(this, 'ExpressionStatement');\n this.expression = {\n \"type\": \"MemberExpression\",\n \"computed\": false,\n \"object\": {\n \"type\": \"CallExpression\",\n \"callee\": {\n \"type\": \"MemberExpression\",\n \"computed\": false,\n \"object\": {\n \"type\": \"Identifier\",\n \"name\": iterVar\n },\n \"property\": {\n \"type\": \"Identifier\",\n \"name\": prop\n }\n },\n \"arguments\": []\n },\n \"property\": {\n \"type\": \"Identifier\",\n \"name\": \"data\"\n }\n };\n }\n\n // Returns AST of the form -\n /*\n \tres.iter(function(row){...});\n */\n function IteratorSkeletonAst(iterVar, arg) {\n Ast.call(this, 'ExpressionStatement');\n this.expression = {\n \"type\": \"CallExpression\",\n \"callee\": {\n \"type\": \"MemberExpression\",\n \"computed\": false,\n \"object\": {\n \"type\": \"Identifier\",\n \"name\": iterVar\n },\n \"property\": {\n \"type\": \"Identifier\",\n \"name\": \"iter\"\n }\n },\n \"arguments\": [{\n \"type\": \"FunctionExpression\",\n \"id\": null,\n \"params\": [{\n \"type\": \"Identifier\",\n \"name\": arg\n }],\n \"body\": {\n \"type\": \"BlockStatement\",\n \"body\": []\n },\n \"generator\": false,\n \"expression\": false,\n \"async\": false\n }]\n }\n }\n\n function BlockStatementAst(body) {\n Ast.call(this, 'BlockStatement');\n this.body = [body];\n }\n\n // Class for maintaining the object that will be passed to 'stopIter'.\n function Arg(arg) {\n this.code = arg.code;\n this.args = arg.args;\n\n this.getAst = function() {\n // Need to wrap 'arg' inside '()' to turn it into a statement - it becomes a JSON object otherwise.\n var argsAst = esprima.parse('(' + this.toString() + ')').body[0]\n .expression;\n\n // Setting appendData to 'true' will generate the AST for 'args' and append it to 'argsAst'.\n if (arg.appendData) {\n var dataAst = {\n \"type\": \"Property\",\n \"key\": {\n \"type\": \"Literal\",\n \"value\": \"data\",\n \"raw\": \"'data'\"\n },\n \"computed\": false,\n \"value\": this.getDataAst(),\n \"kind\": \"init\",\n \"method\": false,\n \"shorthand\": false\n };\n\n argsAst.properties.push(dataAst);\n }\n\n return argsAst;\n };\n\n // Returns the AST for 'args'.\n this.getDataAst = function() {\n if (!this.args) {\n throw '\"args\" field is needed to add \"data\" field';\n }\n\n return esprima.parse(this.args).body[0].expression;\n };\n\n // Stringify only the attributes of this class.\n this.toString = function() {\n var obj = {};\n for (var key of Object.keys(this)) {\n if (this.hasOwnProperty(key)) {\n obj[key] = this[key];\n }\n }\n\n return JSON.stringify(obj);\n }\n }\n\n // Class to generate post iteration steps - switch-case block.\n function PostIter(iterProp, returnBubbleFunc) {\n var stmts = [];\n\n this.iterProp = iterProp;\n this.returnBubbleFunc = returnBubbleFunc;\n\n this.push = function(arg) {\n // Avoid duplicates while insertion.\n // TODO : replace the list with a set in the final version - for faster lookup.\n if (stmts.indexOf(arg) === -1) {\n stmts.push(arg);\n }\n };\n\n // Returns a switch-case block to perform post-iteration steps.\n this.getAst = function(iterVar, stackHelper) {\n var discriminantAst = esprima.parse(iterVar + '.' + this.iterProp)\n .body[0].expression,\n switchAst = new SwitchAst(discriminantAst),\n postIter, caseAst, lookup, stopIterAst, arg, returnStmtAst,\n pushCase;\n\n // Loop over all the stmts and generate the corresponding 'case' block.\n for (var postIterStmt of stmts) {\n pushCase = true;\n // TODO : Changing 'var postIter' to 'const postIter' causes a unit test to fail. Investigate this issue.\n postIter = JSON.parse(postIterStmt);\n caseAst = new CaseAst(postIter.code + postIter.args);\n\n switch (postIter.code) {\n case LoopModifier.CONST.BREAK:\n case LoopModifier.CONST.CONTINUE:\n break;\n case LoopModifier.CONST.LABELED_BREAK:\n // Search the ancestor stack for the label. Interrupt the search if a for-of node is found.\n lookup = stackHelper.searchStack({\n targetComparator: function(node) {\n return /LabeledStatement/.test(\n node.type) && node.label\n .name === postIter.args;\n },\n stopComparator: function(node) {\n return /ForOfStatement/.test(\n node.type);\n }\n });\n // If the label is found and doesn't point to the for-of node, then add a break <label>.\n if (lookup.targetFound) {\n if (/ForOfStatement/.test(lookup.stopNode.body.type)) {\n pushCase = false;\n } else {\n caseAst.consequent.push(new LabeledBreakAst(\n postIter.args));\n }\n }\n // If the search was interrupted, then it means that it encountered a for-of node. So, add a\n // 'return stopIter' node.\n if (lookup.searchInterrupted) {\n stopIterAst = new StopIterAst(lookup.stopNode.right\n .name);\n arg = new Arg({\n code: LoopModifier.CONST.LABELED_BREAK,\n args: postIter.args\n });\n returnStmtAst = new ReturnAst(stopIterAst);\n stopIterAst.arguments.push(arg.getAst());\n\n // Annotate the node as it is subjected to change in the next iteration.\n returnStmtAst.isAnnotated = true;\n returnStmtAst.metaData = postIter;\n\n caseAst.consequent.push(returnStmtAst);\n }\n break;\n case LoopModifier.CONST.LABELED_CONTINUE:\n // This is very similar to Labeled break case.\n lookup = stackHelper.searchStack({\n targetComparator: function(node) {\n return /LabeledStatement/.test(\n node.type) && node.label\n .name === postIter.args;\n },\n stopComparator: function(node) {\n return /ForOfStatement/.test(\n node.type);\n }\n });\n if (lookup.targetFound) {\n if (/ForOfStatement/.test(lookup.stopNode.body.type)) {\n pushCase = false;\n } else {\n caseAst.consequent.push(new LabeledContinueAst(\n postIter.args));\n }\n }\n if (lookup.searchInterrupted) {\n if (lookup.stopNode.parentLabel === postIter.args) {\n returnStmtAst = new ReturnAst(null);\n } else {\n stopIterAst = new StopIterAst(lookup.stopNode\n .right.name);\n arg = new Arg({\n code: LoopModifier.CONST.LABELED_CONTINUE,\n args: postIter.args\n });\n returnStmtAst = new ReturnAst(stopIterAst);\n stopIterAst.arguments.push(arg.getAst());\n }\n\n returnStmtAst.isAnnotated = true;\n returnStmtAst.metaData = postIter;\n\n caseAst.consequent.push(returnStmtAst);\n }\n break;\n case LoopModifier.CONST.RETURN:\n // Target is to find the function name that binds to the 'return' node. Search is interrupted by\n // a for-of node.\n lookup = stackHelper.searchStack({\n targetComparator: function(item) {\n return (/FunctionDeclaration/.test(\n item.type) ||\n /FunctionExpression/.test(\n item.type)) &&\n (item.id ? item.id.name :\n null) === postIter.targetFunction;\n },\n stopComparator: function(item) {\n return /ForOfStatement/.test(\n item.type);\n }\n });\n if (lookup.targetFound) {\n returnStmtAst = new ReturnAst(new ReturnDataAst(\n postIter.iterVar, this.returnBubbleFunc\n ));\n }\n if (lookup.searchInterrupted) {\n stopIterAst = new StopIterAst(lookup.stopNode.right\n .name);\n arg = new Arg({\n code: LoopModifier.CONST.RETURN,\n args: postIter.iterVar + '.' + this\n .returnBubbleFunc + '().data',\n appendData: true\n });\n stopIterAst.arguments.push(arg.getAst());\n returnStmtAst = new ReturnAst(stopIterAst);\n\n returnStmtAst.isAnnotated = true;\n postIter.args = arg.args;\n returnStmtAst.metaData = postIter;\n }\n caseAst.consequent.push(returnStmtAst);\n break;\n }\n\n if (pushCase) {\n switchAst.cases.push(caseAst);\n }\n }\n\n return switchAst.cases.length > 0 ? switchAst : null;\n }\n }\n\n function Iter(forOfNode) {\n var _this = this;\n var breakMod = new LoopModifier(LoopModifier.CONST.BREAK);\n var continueMod = new LoopModifier(LoopModifier.CONST.CONTINUE);\n var lblBreakMod = new LoopModifier(LoopModifier.CONST.LABELED_BREAK);\n var returnMod = new LoopModifier(LoopModifier.CONST.RETURN);\n var lblContinueMod = new LoopModifier(LoopModifier.CONST.LABELED_CONTINUE);\n\n this.nodeCopy = nodeUtils.deepCopy(forOfNode);\n\n this.incrAndPush = function(node) {\n ++breakMod.stackIndex;\n ++continueMod.stackIndex;\n ++lblBreakMod.stackIndex;\n ++returnMod.stackIndex;\n ++lblContinueMod.stackIndex;\n\n breakMod.pushIfAssoc(node);\n continueMod.pushIfAssoc(node);\n lblBreakMod.pushIfAssoc(node);\n returnMod.pushIfAssoc(node);\n lblContinueMod.pushIfAssoc(node);\n };\n\n this.decrAndPop = function() {\n breakMod.popIfAssoc();\n continueMod.popIfAssoc();\n lblBreakMod.popIfAssoc();\n returnMod.popIfAssoc();\n lblContinueMod.popIfAssoc();\n\n --breakMod.stackIndex;\n --continueMod.stackIndex;\n --lblBreakMod.stackIndex;\n --returnMod.stackIndex;\n --lblContinueMod.stackIndex;\n };\n\n this.traverse = function(traversal) {\n estraverse.traverse(_this.nodeCopy, {\n enter: function(node) {\n traversal(node, _this.nodeCopy, breakMod,\n continueMod, lblBreakMod,\n lblContinueMod, returnMod);\n },\n leave: function(node) {\n _this.decrAndPop();\n }\n });\n };\n\n // debug.\n this.assertEmpty = function() {}\n }\n\n // Returns if-else AST having iterator in consequent and for-of in alternate (dynamic type checking).\n function IterCompatible(forOfNode) {\n var self = this;\n var stackHelper = new StackHelper(globalAncestorStack);\n\n // Returns an iterator construct for a given for-of loop ast.\n this.getIterConsequentAst = function() {\n var iterator = new Iter(forOfNode);\n\n // This is the property that will be set on the N1qlQuery instance - contains return value of iterator.\n var iterProp = 'getReturnValue(true)';\n var returnBubbleFunc = 'getReturnValue';\n\n // List to store post iteration exit statements.\n var postIter = new PostIter(iterProp, returnBubbleFunc);\n\n iterator.traverse(function(node, nodeCopy, breakMod,\n continueMod, lblBreakMod, lblContinueMod, returnMod\n ) {\n iterator.incrAndPush(node);\n\n var arg,\n stopIterAst,\n returnStmtAst;\n\n // Annotated nodes are those nodes that have been marked to be changed by the previous iteration.\n if (node.isAnnotated) {\n switch (node.metaData.code) {\n case LoopModifier.CONST.RETURN:\n // For 'return', the 'iterVar' must be set to the current for-of loop's source.\n node.metaData.iterVar = nodeCopy.right.name;\n arg = JSON.stringify(node.metaData);\n break;\n\n case LoopModifier.CONST.LABELED_BREAK:\n case LoopModifier.CONST.LABELED_CONTINUE:\n arg = new Arg({\n code: node.metaData.code,\n args: node.metaData.args\n });\n break;\n\n default:\n throw 'Unhandled case: ' + node.metaData\n .code;\n }\n\n postIter.push(arg.toString());\n\n // Remove the annotation if it's already present.\n // This is needed to prevent the else-block from replacing the already annotated node.\n delete node.isAnnotated;\n delete node.metaData;\n }\n\n if (node.isGen) {\n return;\n }\n\n // If any of the exit criteria is encountered, then that statement may be replaced.\n switch (node.type) {\n case 'BreakStatement':\n stopIterAst = arg = null;\n // Labeled break statement.\n /*\n\t\t\t\t\t\t\tBefore:\n\t\t\t\t\t\t\tbreak x;\n\t\t\t\t\t\t\tAfter:\n\t\t\t\t\t\t\treturn res.stopIter({\n\t\t\t\t\t\t\t\t'code': 'labeled_break',\n\t\t\t\t\t\t\t\t'args': 'x'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t \t*/\n if (node.label && lblBreakMod.isReplaceReq(\n node.label.name)) {\n stopIterAst = new StopIterAst(nodeCopy.right\n .name);\n arg = new Arg({\n code: LoopModifier.CONST.LABELED_BREAK,\n args: node.label.name\n });\n postIter.push(arg.toString());\n } else if (!node.label && breakMod.isReplaceReq()) {\n // Unlabeled break statement.\n /*\n \tBefore:\n \tbreak;\n \tAfter:\n \treturn res.stopIter({ 'code': 'break' });\n */\n stopIterAst = new StopIterAst(nodeCopy.right\n .name);\n arg = new Arg({\n code: LoopModifier.CONST.BREAK\n });\n }\n\n if (stopIterAst && arg) {\n returnStmtAst = new ReturnAst(\n stopIterAst);\n // Add 'arg' as the argument to 'stopIter()'.\n stopIterAst.arguments.push(arg.getAst());\n nodeUtils.replaceNode(node,\n returnStmtAst, Context.BreakStatement\n );\n }\n break;\n\n case 'ContinueStatement':\n // Labeled continue statement.\n /*\n \tBefore:\n \tcontinue x;\n \tAfter:\n \treturn res.stopIter({\n \t\t'code': 'labeled_continue',\n \t\t'args': 'x'\n \t});\n */\n if (node.label && lblContinueMod.isReplaceReq(\n node.label.name)) {\n if (nodeCopy.parentLabel === node.label\n .name) {\n // If the target of labeled continue is its immediate parent, then just 'return'.\n returnStmtAst = new ReturnAst(null);\n } else {\n arg = new Arg({\n code: LoopModifier.CONST\n .LABELED_CONTINUE,\n args: node.label.name\n });\n stopIterAst = new StopIterAst(\n nodeCopy.right.name);\n returnStmtAst = new ReturnAst(\n stopIterAst);\n stopIterAst.arguments.push(arg.getAst());\n\n postIter.push(arg.toString());\n }\n\n nodeUtils.replaceNode(node,\n returnStmtAst, Context.ContinueStatement\n );\n } else if (continueMod.isReplaceReq()) {\n // Unlabeled continue statement.\n /*\n \tBefore:\n \tcontinue;\n \tAfter:\n \treturn;\n */\n nodeUtils.replaceNode(node, new ReturnAst(\n null), Context.ContinueStatement);\n }\n break;\n\n case 'ReturnStatement':\n /*\n \tBefore:\n \treturn a + b;\n \tAfter:\n \treturn res.stopIter({\n \t\t'code': 'return',\n \t\t'args': '(a + b)',\n \t\t'data': a + b\n \t});\n */\n if (returnMod.isReplaceReq(node)) {\n // Return statement may or may not have arguments.\n // In case there's no argument, we populate it with null.\n var argStr = node.argument ? escodegen.generate(\n node.argument) : null;\n // Must enclose the return statement's argument within an expression '()'.\n // Otherwise, it causes an error when returning anonymous function.\n arg = new Arg({\n code: LoopModifier.CONST.RETURN,\n args: '(' + argStr + ')',\n appendData: true\n });\n stopIterAst = new StopIterAst(nodeCopy.right\n .name);\n stopIterAst.arguments.push(arg.getAst());\n returnStmtAst = new ReturnAst(\n stopIterAst);\n self.mapSourceNode(node, returnStmtAst,\n Context.ReturnStatement);\n\n var postIterArgs = JSON.stringify({\n code: LoopModifier.CONST.RETURN,\n args: arg.args,\n iterVar: nodeCopy.right.name,\n targetFunction: node.targetFunction\n });\n\n postIter.push(postIterArgs);\n nodeUtils.replaceNode(node,\n returnStmtAst);\n }\n break;\n\n case 'IfStatement':\n if (!/BlockStatement/.test(node.consequent.type)) {\n nodeUtils.convertToBlockStmt(node);\n }\n break;\n }\n });\n\n var iter = new IteratorSkeletonAst(forOfNode.right.name, (\n forOfNode.left.name ? forOfNode.left.name :\n forOfNode.left.declarations[0].id.name));\n iter.expression.arguments[0].body = iterator.nodeCopy.body;\n self.mapSourceNode(forOfNode, iter, Context.IterConsequent);\n\n var iterBlockAst = new BlockStatementAst(iter);\n\n // Pop the top for-of node.\n stackHelper.popTopForOfNode();\n\n var postIterAst = postIter.getAst(forOfNode.right.name,\n stackHelper);\n if (postIterAst) {\n iterBlockAst.body.push(postIterAst);\n }\n\n iterator.assertEmpty();\n\n return iterBlockAst;\n };\n\n // Maps loc nodes of source to target according to the context.\n this.mapSourceNode = function(source, target, context) {\n switch (context) {\n // Maps the source to target loc during the following kind of transformation -\n /*\n \tBefore:\n \tfor (var r of res3){...}\n \tAfter:\n \tres.iter(function (r) {...}\n */\n case Context.IterConsequent:\n target.loc = nodeUtils.deepCopy(source.loc);\n target.expression.loc = nodeUtils.deepCopy(source.loc);\n target.expression.callee.loc = nodeUtils.deepCopy(\n source.loc);\n target.expression.callee.object.loc = nodeUtils.deepCopy(\n source.right.loc);\n target.expression.callee.property.loc = nodeUtils.deepCopy(\n source.right.loc);\n target.expression.arguments[0].loc = nodeUtils.deepCopy(\n source.right.loc);\n target.expression.arguments[0].params[0].loc =\n nodeUtils.deepCopy(source.left.declarations[0].id.loc);\n break;\n\n // Maps the source to target loc during the following kind of transformation -\n /*\n \tsource: return function () {\n \t\treturn inner;\n \t};\n \ttarget: return res1.stopIter({\n \t\t'code': 'return',\n \t\t'args': '(function () {\\n return inner;\\n})',\n \t\t'data': function () {\n \t\t\treturn inner;\n \t\t}\n \t});\n */\n case Context.ReturnStatement:\n target.loc = source.loc;\n nodeUtils.forceSetLocForAllNodes(source.loc, target.argument);\n if (source.argument) {\n for (var prop of target.argument.arguments[0].properties) {\n if (prop.key.value === 'data') {\n prop.value = nodeUtils.deepCopy(source.argument);\n break;\n }\n }\n }\n break;\n\n // Maps the source to target loc during the following kind of transformation -\n /*\n \tsource: return res.stopIter({\n \t\t'code': 'return',\n \t\t'args': 'res.getReturnValue().data',\n \t\t'data': res.getReturnValue().data\n \t});\n \ttarget: return res.getReturnValue().data;\n */\n case Context.ReturnAltFound:\n target.loc = source.loc;\n for (var prop of source.argument.arguments[0].properties) {\n if (prop.key.value === 'data') {\n target.argument = nodeUtils.deepCopy(prop.value);\n break;\n }\n }\n break;\n\n // Maps the source to target loc during the following kind of transformation -\n /*\n \tsource: return res1.stopIter({\n \t\t'code': 'return',\n \t\t'args': 'res.getReturnValue().data',\n \t\t'data': res.getReturnValue().data\n \t});\n \ttarget: return res2.stopIter({\n \t\t'code': 'return',\n \t\t'args': 'res.getReturnValue().data',\n \t\t'data': res.getReturnValue().data\n \t});\n */\n case Context.ReturnAltInterrupt:\n nodeUtils.setLocMatchingNodes(source, target);\n break;\n default:\n throw 'Unhandled case: ' + context;\n }\n };\n\n // Returns AST for 'else' block.\n this.getIterAlternateAst = function() {\n var iterator = new Iter(forOfNode);\n iterator.traverse(function(node, nodeCopy, breakMod,\n continueMod, lblBreakMod, lblContinueMod, returnMod\n ) {\n var lookup, stopIterAst, arg, returnStmtAst,\n stopNode = null,\n context;\n\n if (node.isAnnotated) {\n // Targeted lookup for annotated nodes.\n lookup = stackHelper.searchStack({\n targetComparator: function(item) {\n switch (node.metaData.code) {\n case LoopModifier.CONST\n .RETURN:\n // For a 'return' statement, the target is to find the function that the 'return'\n // statement was associated with, before transpilation.\n return (\n /FunctionDeclaration/\n .test(item.type) ||\n /FunctionExpression/\n .test(item.type)\n ) &&\n item.id.name ===\n node.metaData.targetFunction;\n case LoopModifier.CONST\n .LABELED_CONTINUE:\n case LoopModifier.CONST\n .LABELED_BREAK:\n return /LabeledStatement/\n .test(item.type) &&\n item.label.name ===\n node.metaData.args;\n default:\n throw 'Unhandled case: ' +\n node.metaData.code;\n }\n },\n stopComparator: function(item) {\n return /ForOfStatement/.test(\n item.type);\n }\n });\n if (lookup.targetFound) {\n switch (node.metaData.code) {\n case LoopModifier.CONST.LABELED_BREAK:\n nodeUtils.replaceNode(node, new LabeledBreakAst(\n node.metaData.args),\n Context.BreakStatement);\n break;\n case LoopModifier.CONST.LABELED_CONTINUE:\n nodeUtils.replaceNode(node, new LabeledContinueAst(\n node.metaData.args),\n Context.ContinueStatement);\n break;\n case LoopModifier.CONST.RETURN:\n arg = new Arg({\n code: LoopModifier.CONST\n .RETURN,\n args: node.metaData.args,\n appendData: true\n });\n returnStmtAst = new ReturnAst(arg.getDataAst());\n self.mapSourceNode(node,\n returnStmtAst, Context.ReturnAltFound\n );\n nodeUtils.replaceNode(node,\n returnStmtAst);\n break;\n }\n }\n if (lookup.searchInterrupted) {\n switch (node.metaData.code) {\n case LoopModifier.CONST.LABELED_BREAK:\n stopIterAst = new StopIterAst(\n lookup.stopNode.right.name);\n arg = new Arg({\n code: node.metaData.code,\n args: node.metaData.args\n });\n stopIterAst.arguments.push(arg.getAst());\n returnStmtAst = new ReturnAst(\n stopIterAst);\n context = Context.BreakAltInterrupt;\n break;\n\n case LoopModifier.CONST.LABELED_CONTINUE:\n if (lookup.stopNode.parentLabel ===\n node.metaData.args) {\n returnStmtAst = new ReturnAst(\n null);\n } else {\n stopIterAst = new StopIterAst(\n lookup.stopNode.right.name\n );\n arg = new Arg({\n code: node.metaData\n .code,\n args: node.metaData\n .args\n });\n stopIterAst.arguments.push(arg.getAst());\n returnStmtAst = new ReturnAst(\n stopIterAst);\n }\n context = Context.ContinueAltInterrupt;\n break;\n\n case LoopModifier.CONST.RETURN:\n arg = new Arg({\n code: LoopModifier.CONST\n .RETURN,\n args: node.metaData.args,\n appendData: true\n });\n stopIterAst = new StopIterAst(\n lookup.stopNode.right.name);\n stopIterAst.arguments.push(arg.getAst());\n returnStmtAst = new ReturnAst(\n stopIterAst);\n self.mapSourceNode(node,\n returnStmtAst, Context.ReturnAltInterrupt\n );\n break;\n }\n\n returnStmtAst.isAnnotated = true;\n returnStmtAst.metaData = node.metaData;\n\n nodeUtils.replaceNode(node, returnStmtAst,\n context);\n\n }\n\n return;\n }\n\n iterator.incrAndPush(node);\n\n switch (node.type) {\n case 'BreakStatement':\n if (node.label && lblBreakMod.isReplaceReq(\n node.label.name)) {\n lookup = stackHelper.searchStack({\n targetComparator: function(\n item) {\n return /LabeledStatement/\n .test(item.type) &&\n item.label.name ===\n node.label.name;\n },\n stopComparator: function(\n item) {\n return /ForOfStatement/\n .test(item.type);\n }\n });\n if (lookup.searchInterrupted) {\n stopIterAst = new StopIterAst(\n lookup.stopNode.right.name);\n arg = new Arg({\n code: LoopModifier.CONST\n .LABELED_BREAK,\n args: node.label.name\n });\n returnStmtAst = new ReturnAst(\n stopIterAst);\n stopIterAst.arguments.push(arg.getAst());\n\n returnStmtAst.isAnnotated = true;\n returnStmtAst.metaData = {\n code: LoopModifier.CONST.LABELED_BREAK,\n args: node.label.name\n };\n nodeUtils.replaceNode(node,\n returnStmtAst, Context.BreakStatement\n );\n }\n }\n break;\n case 'ContinueStatement':\n if (node.label && lblContinueMod.isReplaceReq(\n node.label.name)) {\n lookup = stackHelper.searchStack({\n targetComparator: function(\n item) {\n return /LabeledStatement/\n .test(item.type) &&\n item.label.name ===\n node.label.name;\n },\n stopComparator: function(\n item) {\n return /ForOfStatement/\n .test(item.type);\n }\n });\n if (lookup.searchInterrupted) {\n if (lookup.stopNode.parentLabel ===\n node.label.name) {\n returnStmtAst = new ReturnAst(\n null);\n } else {\n stopIterAst = new StopIterAst(\n lookup.stopNode.right.name\n );\n arg = new Arg({\n code: LoopModifier.CONST\n .LABELED_CONTINUE,\n args: node.label.name\n });\n returnStmtAst = new ReturnAst(\n stopIterAst);\n stopIterAst.arguments.push(arg.getAst());\n }\n\n returnStmtAst.isAnnotated = true;\n returnStmtAst.metaData = {\n code: LoopModifier.CONST.LABELED_CONTINUE,\n args: node.label.name\n };\n nodeUtils.replaceNode(node,\n returnStmtAst, Context.ContinueStatement\n );\n }\n }\n break;\n case 'ReturnStatement':\n if (node.targetFunction) {\n lookup = stackHelper.searchStack({\n targetComparator: function(\n item) {\n return (\n /FunctionDeclaration/\n .test(item.type) ||\n /FunctionExpression/\n .test(item.type)\n ) &&\n item.id.name ===\n node.targetFunction;\n },\n stopComparator: function(\n item) {\n return /ForOfStatement/\n .test(item.type);\n }\n });\n if (lookup.searchInterrupted) {\n var argStr = node.argument ?\n escodegen.generate(node.argument) :\n null;\n\n arg = new Arg({\n code: LoopModifier.CONST\n .RETURN,\n args: '(' + argStr +\n ')',\n appendData: true\n });\n stopIterAst = new StopIterAst(\n lookup.stopNode.right.name);\n stopIterAst.arguments.push(arg.getAst());\n returnStmtAst = new ReturnAst(\n stopIterAst);\n self.mapSourceNode(node,\n returnStmtAst, Context.ReturnStatement\n );\n\n returnStmtAst.isAnnotated = true;\n returnStmtAst.metaData = {\n code: LoopModifier.CONST.RETURN,\n args: arg.args,\n iterVar: nodeCopy.right.name,\n targetFunction: node.targetFunction\n };\n\n nodeUtils.replaceNode(node,\n returnStmtAst);\n }\n }\n break;\n }\n });\n\n iterator.assertEmpty();\n\n return iterator.nodeCopy.parentLabel ? new LabeledStmtAst(\n iterator.nodeCopy.parentLabel, iterator.nodeCopy) :\n iterator.nodeCopy;\n };\n\n this.getAst = function() {\n // if-else block which perform dynamic type checking.\n var ifElseAst = new IfElseAst(new MemExprAst(forOfNode.right.name));\n\n // Iterator AST.\n var iterConsequentAst = this.getIterConsequentAst();\n // Push the iterator AST into 'if' block.\n ifElseAst.consequent.body = iterConsequentAst.body;\n // Push the user-written 'for ... of ...' loop into 'else' block.\n ifElseAst.alternate.body.push(this.getIterAlternateAst());\n\n estraverse.traverse(ifElseAst, {\n enter: function(node) {\n // Mark all the nodes of 'ifElseAst' to avoid repeated operations.\n node.isGen = true;\n\n // Traverse all the for-of loops in the 'else' block and mark them as visited - so that we don't\n // recursively convert these into iterator constructs.\n if (/ForOfStatement/.test(node.type))\n node.isVisited = true;\n }\n });\n\n return ifElseAst;\n };\n }\n\n var nodeUtils = new NodeUtils();\n var globalAncestorStack = new AncestorStack();\n\n // Get the Abstract Syntax Tree (ast) of the input code.\n var ast = esprima.parse(code, {\n attachComment: true,\n sourceType: 'script',\n loc: true,\n source: sourceFileName\n });\n\n nodeUtils.checkGlobals(ast);\n\n estraverse.traverse(ast, {\n enter: function(node, parent) {\n globalAncestorStack.push(node);\n\n // Grab the for-of statement's label and mark the label for deletion.\n if (/ForOfStatement/.test(node.type) && !node.isVisited &&\n /LabeledStatement/.test(parent.type)) {\n node.parentLabel = parent.label.name;\n parent.remLabel = true;\n }\n\n // Find the function that the 'return' statement associates with.\n if (/ReturnStatement/.test(node.type)) {\n var stackHelper = new StackHelper(\n globalAncestorStack);\n var lookup = stackHelper.searchStack({\n targetComparator: function(item) {\n return /FunctionDeclaration/.test(\n item.type) ||\n /FunctionExpression/.test(\n item.type);\n },\n stopComparator: function(item) {\n return false;\n }\n });\n if (lookup.targetFound) {\n // TODO : Anonymous function might require some attention because comparing null doesn't make sense.\n node.targetFunction = lookup.stopNode.id ?\n lookup.stopNode.id.name : null;\n }\n }\n },\n leave: function(node) {\n // Perform variable substitution in query constructor.\n if (nodeUtils.isN1qlNode(node) && node.arguments.length >\n 0) {\n var queryAst = nodeUtils.getQueryAst(node.arguments[\n 0].quasis[0].value.raw);\n nodeUtils.replaceNode(node, nodeUtils.deepCopy(\n queryAst), Context.N1qlQuery);\n }\n\n // TODO : Handle the case when the source of for-of loop is of type x.y\n // Modifies all the for-of statements to support iteration.\n // Takes care to see to it that it visits the node only once.\n if (/ForOfStatement/.test(node.type) && !node.isVisited) {\n if (!/BlockStatement/.test(node.body.type)) {\n nodeUtils.convertToBlockStmt(node);\n }\n\n var iterator = new IterCompatible(node);\n var iterAst = iterator.getAst();\n nodeUtils.replaceNode(node, nodeUtils.deepCopy(\n iterAst), Context.IterTypeCheck);\n } else if (/LabeledStatement/.test(node.type) && node.remLabel) {\n // Delete the label.\n nodeUtils.replaceNode(node, node.body);\n }\n\n globalAncestorStack.pop();\n }\n });\n\n return ast;\n}", "parse() {\n return this.parseSection (this.pos);\n}", "constructor() { super([Space.TAG], JXONLexer.lexemes) }", "function Visitor(doc) {\n\tthis.stack = [];\n\tthis.parent = doc; //always a list item\n\tthis.node = doc.head();\n\tthis.index = 0;\n\tthis.point = 1;\n\tthis.retained = 0;\n\tthis.ops = []; //to get to the doc\n}", "function VillanelleGrammarVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function VarBlock(){ return ListNode.apply(this,arguments) }", "constructor(){ super(JXONParser.rules(), JXONObj.TAG) }", "visit(){\n\t\tif(!this.parent || this.parent.content)\n\t\t\treturn this.convert(...arguments)\n\t}", "function CodiVisitor() {\r\n\tantlr4.tree.ParseTreeVisitor.call(this);\r\n\treturn this;\r\n}", "parseFunction () {\n this.pushScope(IVProgParser.FUNCTION);\n let formalParams = [];\n const token = this.getToken();\n if(token.type !== this.lexerClass.RK_FUNCTION) {\n //throw SyntaxError.createError(this.lexer.literalNames[this.lexerClass.PR_FUNCAO], token);\n return null;\n }\n this.pos++;\n const funType = this.parseType();\n let dimensions = 0;\n if(this.checkOpenBrace(true)) {\n this.pos++;\n this.checkCloseBrace();\n this.pos++;\n dimensions++;\n if(this.checkOpenBrace(true)) {\n this.pos++;\n this.checkCloseBrace();\n this.pos++;\n dimensions++;\n }\n }\n const funcIDToken = this.getToken();\n const functionID = this.parseID();\n this.checkFunctionDuplicate(functionID, funcIDToken);\n this.checkOpenParenthesis();\n this.pos++;\n this.consumeNewLines();\n if (!this.checkCloseParenthesis(true)) {\n formalParams = this.parseFormalParameters(); // formal parameters \n this.consumeNewLines();\n this.checkCloseParenthesis();\n this.pos++;\n } else {\n this.pos++;\n }\n this.consumeNewLines();\n const commandsBlock = this.parseCommandBlock();\n let returnType = funType;\n if(dimensions > 0) {\n returnType = new CompoundType(funType, dimensions);\n }\n const func = new Commands.Function(functionID, returnType, formalParams, commandsBlock);\n if (functionID === null && !func.isMain) {\n throw SyntaxErrorFactory.invalid_main_return(LanguageDefinedFunction.getMainFunctionName(),\n this.lexer.literalNames[this.lexerClass.RK_VOID],\n token.line);\n } else if (func.isMain && formalParams.length !== 0) {\n throw SyntaxErrorFactory.main_parameters();\n }\n this.popScope();\n return func;\n }", "function walkAST(node, parent) {\n\t\t\t\tif (!node)\n\t\t\t\t\treturn;\n\t\t\t\tvar type = node.type,\n\t\t\t\t\tloc = node.loc;\n\t\t\t\t// if (node.range) {\n\t\t\t\t// \tvar part = getCode(node);\n\t\t\t\t// \tif (part && part.length > 20)\n\t\t\t\t// \t\tpart = part.substr(0, 10) + '...' + part.substr(-10);\n\t\t\t\t// \tconsole.log(type, part);\n\t\t\t\t// }\n\n\t\t\t\t// The easiest way to walk through the whole AST is to simply loop\n\t\t\t\t// over each property of the node and filter out fields we don't\n\t\t\t\t// need to consider...\n\t\t\t\tfor (var key in node) {\n\t\t\t\t\tif (key === 'range' || key === 'loc')\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar value = node[key];\n\t\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\t\tfor (var i = 0, l = value.length; i < l; i++)\n\t\t\t\t\t\t\twalkAST(value[i], node);\n\t\t\t\t\t} else if (value && typeof value === 'object') {\n\t\t\t\t\t\t// We cannot use Base.isPlainObject() for these since\n\t\t\t\t\t\t// Acorn.js uses its own internal prototypes now.\n\t\t\t\t\t\twalkAST(value, node);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// See if a breakpoint is to be placed in the range of this\n\t\t\t\t// node, and if the node type supports it.\n\t\t\t\tif (breakpoints.length > 0 && loc\n\t\t\t\t\t\t// Filter the type of nodes that support setting breakpoints.\n\t\t\t\t\t\t&& /^(ForStatement|VariableDeclaration|ExpressionStatement|ReturnStatement)$/.test(type)\n\t\t\t\t\t\t// Filter out variable definitions inside ForStatement.\n\t\t\t\t\t\t&& parent.type !== 'ForStatement') {\n\t\t\t\t\tvar start = loc.start.line - 1,\n\t\t\t\t\t\tend = loc.end.line - 1;\n\t\t\t\t\tfor (var i = 0, l = breakpoints.length; i < l; i++) {\n\t\t\t\t\t\tvar line = breakpoints[i];\n\t\t\t\t\t\tif (line >= start && line <= end) {\n\t\t\t\t\t\t\treplaceCode(node, 'debugger; ' + getCode(node));\n\t\t\t\t\t\t\tbreakpoints.splice(i, 1);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "_parseInvoke(){\n switch (this.lazyParsing) {\n case VirtualActions.LAZY_BODY_ACCEPT:\n this.parse(VirtualActions.PARSE_HEAD);\n break;\n case VirtualActions.LAZY_REJECT:\n this.parse(VirtualActions.PARSE_ALL);\n break;\n }\n }", "function parse_Expr() {\n tree.addNode('Expr', 'branch');\n if (foundTokensCopy[parseCounter][1] == \"digit\") {\n console.log('its a gooda digit');\n parse_IntExpr();\n //tree.endChildren();\n\n\n } else if (foundTokensCopy[parseCounter][0] == '\"') {\n parse_StringExpr();\n //tree.endChildren();\n\n } else if (foundTokensCopy[parseCounter][0] == '(' || foundTokensCopy[parseCounter][0] == 'false' || foundTokensCopy[parseCounter][0] == 'true') {\n parse_BooleanExpr();\n //tree.endChildren();\n\n\n } else if (foundTokensCopy[parseCounter][1] == 'identifier') {\n parse_ID();\n //tree.endChildren();\n\n\n }\n else {\n document.getElementById('parse').value += \"PARSE ERROR: KILLING PARSER\"\n throw new Error(\"Something went badly wrong!\");\n }\n tree.endChildren();\n\n}", "function parse(){\n var syntax = esprima.parse(editor.getValue());\n codeArray = [];\n expand(syntax.body, codeArray, 0);\n}", "function readStatement(){\r\n\t\tnext();\r\n\t\tif(type!=\"comment\" && ifThisLine && type!=\"linebreak\")\r\n\t\t\tcodeAfterThen=true;\r\n\t\tswitch(type){\r\n\t\t\t//keywords with no arguments\r\n\t\t\tcase \"BREAK\":\r\n\t\t\t\tcurrent.type=\"BREAK\";\r\n\t\t\t\tcurrent.levels=readExpression();\r\n\t\t\tbreak;case \"CONTINUE\":\r\n\t\t\t\tcurrent.type=\"CONTINUE\";\r\n\t\t\t\tcurrent.levels=readExpression();\r\n\t\t\tbreak;case \"ELSE\":\r\n\t\t\t\tvar currentType=currentBlock().type\r\n\t\t\t\tif(currentType===\"CASE\"){\r\n\t\t\t\t\tendBlock();\r\n\t\t\t\t\tcurrent.type=\"CASE\";\r\n\t\t\t\t\tstartBlock();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tassert(currentBlock().type===\"IF\"||currentBlock().type===\"ELSEIF\",\"ELSE without IF\");\r\n\t\t\t\t\tendBlock();\r\n\t\t\t\t\tcurrent.type=\"ELSE\";\r\n\t\t\t\t\tstartBlock();\r\n\t\t\t\t}\r\n\t\t\tbreak;case \"ENDSWITCH\":\r\n\t\t\t\tvar currentType=currentBlock().type\r\n\t\t\t\tif(currentType===\"CASE\")\r\n\t\t\t\t\tendBlock();\r\n\t\t\t\telse\r\n\t\t\t\t\tassert(currentType===\"SWITCH\",\"ENDSW without SWITCH\");\r\n\t\t\t\tendBlock();\r\n\t\t\tbreak;case \"ENDIF\":\r\n\t\t\t\tvar currentType=currentBlock().type\r\n\t\t\t\tassert(currentType===\"IF\" || currentType===\"ELSE\" || currentType===\"ELSEIF\",\"ENDIF without IF\");\r\n\t\t\t\tendBlock();\r\n\t\t\t\tifThisLine=false;\r\n\t\t\tbreak;case \"SWITCH\":\r\n\t\t\t\tcurrent.type=\"SWITCH\"\r\n\t\t\t\tassert(current.condition=readExpression(),\"Missing argument to keyword\");\r\n\t\t\t\tstartBlock();\r\n\t\t\tbreak;case \"CASE\":\r\n\t\t\t\tvar currentType=currentBlock().type\r\n\t\t\t\tif(currentType===\"CASE\")\r\n\t\t\t\t\tendBlock();\r\n\t\t\t\telse\r\n\t\t\t\t\tassert(currentType===\"SWITCH\",\"invalid CASE\");\r\n\t\t\t\tcurrent.type=\"CASE\"\r\n\t\t\t\tassert(current.conditions=readList(readExpression),\"Missing argument to keyword\");\r\n\t\t\t\tstartBlock();\r\n\t\t\tbreak;case \"STOP\":\r\n\t\t\t\tcurrent.type=\"STOP\";\r\n\t\t\tbreak;case \"REPEAT\":\r\n\t\t\t\tcurrent.type=\"REPEAT\";\r\n\t\t\t\tstartBlock();\r\n\t\t\t//SWAP\r\n\t\t\tbreak;case \"SWAP\":\r\n\t\t\t\tcurrent.type=\"SWAP\";\r\n\t\t\t\tassert(current.variable=readVariable(),\"Missing variable in SWAP\");\r\n\t\t\t\tassert(readToken(\",\"),\"Missing comma in SWAP\");\r\n\t\t\t\tassert(current.variable2=readVariable(),\"Missing variable in SWAP\");\r\n\t\t\t//IF, ELSEIF\r\n\t\t\tbreak;case \"ELSEIF\":\r\n\t\t\t\tassert(currentBlock().type==\"IF\"||currentBlock().type==\"ELSEIF\",\"ELSEIF without IF\");\r\n\t\t\t\tendBlock();\r\n\t\t\t\tcurrent.type=\"ELSEIF\"\r\n\t\t\t\tcurrent.condition=readExpression();\r\n\t\t\t\tassert(readToken(\"THEN\"),\"ELSEIF without THEN\");\r\n\t\t\t\tstartBlock();\r\n\t\t\tbreak;case \"IF\":\r\n\t\t\t\tcurrent.type=\"IF\"\r\n\t\t\t\tassert(current.condition=readExpression(),\"Missing IF condition\");\r\n\t\t\t\tassert(readToken(\"THEN\"),\"IF without THEN\");\r\n\t\t\t\tstartBlock();\r\n\t\t\t\tifThisLine=true;\r\n\t\t\t\tcodeAfterThen=false;\r\n\t\t\t//FOR\r\n\t\t\tbreak;case \"FOR\":\r\n\t\t\t\tcurrent.type=\"FOR\";\r\n\t\t\t\tassert(current.variable=readVariable(),\"Missing FOR variable\");\r\n\t\t\t\tassert(readToken(\"=\"),\"Missing = in FOR\");\r\n\t\t\t\tcurrent.start=readExpression();\r\n\t\t\t\tassert(readToken(\"word\") && word===\"TO\",\"Missing TO in FOR\");\r\n\t\t\t\tcurrent.end=readExpression();\r\n\t\t\t\tif(readToken(\"word\") && word===\"STEP\")\r\n\t\t\t\t\tcurrent.step=readExpression();\r\n\t\t\t\telse\r\n\t\t\t\t\treadNext=0; //heck\r\n\t\t\t\tstartBlock();\r\n\t\t\t//WHILE <condition>\r\n\t\t\tbreak;case \"WHILE\":\r\n\t\t\t\tcurrent.type=\"WHILE\"\r\n\t\t\t\tassert(current.condition=readExpression(),\"Missing argument to keyword\");\r\n\t\t\t\tstartBlock();\r\n\t\t\tbreak;case \"WEND\":\r\n\t\t\t\tassert(currentBlock().type==\"WHILE\",\"WEND without WHILE\");\r\n\t\t\t\tendBlock();\r\n\t\t\t//do/LOOP\r\n\t\t\tbreak;case \"DO\":\r\n\t\t\t\tcurrent.type=\"DO\"\r\n\t\t\t\tstartBlock();\r\n\t\t\tbreak;case \"LOOP\":\r\n\t\t\t\tassert(currentBlock().type==\"DO\",\"LOOP without DO\");\r\n\t\t\t\tendBlock();\r\n\t\t\t//UNTIL <condition>\r\n\t\t\tbreak;case \"UNTIL\":\r\n\t\t\t\tassert(currentBlock().type==\"REPEAT\",\"UNTIL without REPEAT\");\r\n\t\t\t\tassert(currentBlock().condition=readExpression(),\"Missing UNTIL condition\");\r\n\t\t\t\tendBlock();\r\n\t\t\t//NEXT\r\n\t\t\tbreak;case \"NEXT\":\r\n\t\t\t\tassert(currentBlock().type==\"FOR\",\"NEXT without FOR\");\r\n\t\t\t\treadExpression();\r\n\t\t\t\tendBlock();\r\n\t\t\t//OUT/THEN\r\n\t\t\tbreak;case \"OUT\":case \"THEN\":\r\n\t\t\t\tassert(false,\"Illegal OUT/THEN\");\r\n\t\t\t//other words\r\n\t\t\tbreak;case \"word\":\r\n\t\t\t\t//var name=text;\r\n\t\t\t\treadNext=readNext-1;\r\n\t\t\t\tvar x=readVariable(true);\r\n\t\t\t\tif(readToken(\"=\")){\r\n\t\t\t\t\tcurrent.type=\"assignment\";\r\n\t\t\t\t\tcurrent.variable=x;\r\n\t\t\t\t\tassert(current.value=readExpression(),\"Missing value in assignment\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcurrent.type=\"function\";\r\n\t\t\t\t\tcurrent.name=x.name;\r\n\t\t\t\t\tcurrent.inputs=readList(readExpression);\r\n\t\t\t\t\tif(readToken(\"OUT\"))\r\n\t\t\t\t\t\tcurrent.outputs=readList(readVariable);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurrent.outputs=[];\r\n\t\t\t\t}\r\n\t\t\t//comment\r\n\t\t\tbreak;case \"comment\":\r\n\t\t\t//colon NOP\r\n\t\t\tbreak;case \":\":\r\n\t\t\t//line break, end\r\n\t\t\tbreak;case \"eof\":\r\n\t\t\tcase \"linebreak\":\r\n\t\t\t\tif(ifThisLine){\r\n\t\t\t\t\tifThisLine=false;\r\n\t\t\t\t\tif(codeAfterThen){\r\n\t\t\t\t\t\tendBlock();\r\n\t\t\t\t\t\tconsole.log(\"ended single line IF\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\tbreak;default:\r\n\t\t\t\tassert(false,\"Expected statement, got \"+type+\" '\"+word+\"'\");\r\n\t\t}\r\n\t\tif(current.type){\r\n\t\t\tcurrent.line=lineNumber;\r\n\t\t\tcurrentBlocks[currentBlocks.length-1].code.push(current)//push to current block!\r\n\t\t\tcurrent={}\r\n\t\t}\r\n\t}", "parse(text) {\n return {\n text,\n type: 'Program',\n start: 0,\n end: 0,\n loc: {\n start: { line: 1, column: 0 },\n end: { line: 1, column: 0 }\n },\n range: [0, 0],\n body: [],\n sourceType: 'module',\n comments: [],\n tokens: []\n }\n }", "function PlaygroundVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function parse_StatementList() {\n tree.addNode('StatementList', 'branch');\n // Assign operator = here i think is wrong... need to find an identifier?\n console.log(\"got to statementlist \");\n if (foundTokensCopy[parseCounter][0] == 'print') {\n parse_Statement();\n //tree.endChildren();\n //tree.endChildren();\n parse_StatementList();\n //tree.endChildren();\n //tree.endChildren();\n console.log('got past the if');\n\n }\n // extends to here for the identifier question\n else if (foundTokensCopy[parseCounter][1] == 'identifier') {\n parse_Statement();\n //tree.endChildren();\n //tree.endChildren();\n parse_StatementList();\n //tree.endChildren();\n //tree.endChildren();\n\n } else if (foundTokensCopy[parseCounter][0] == 'int') {\n console.log('got past the if type');\n parse_Statement();\n //tree.endChildren();\n //tree.endChildren();\n parse_StatementList();\n //tree.endChildren();\n //tree.endChildren();\n } else if (foundTokensCopy[parseCounter][0] == 'string') {\n parse_Statement();\n //tree.endChildren();\n //tree.endChildren();\n parse_StatementList();\n //tree.endChildren();\n //tree.endChildren();\n } else if (foundTokensCopy[parseCounter][0] == 'boolean') {\n parse_Statement();\n //tree.endChildren();\n //tree.endChildren();\n parse_StatementList();\n //tree.endChildren();\n //tree.endChildren();\n } else if (foundTokensCopy[parseCounter][1] == 'while') {\n parse_Statement();\n //tree.endChildren();\n //tree.endChildren();\n parse_StatementList();\n //tree.endChildren();\n //tree.endChildren();\n } else if (foundTokensCopy[parseCounter][1] == 'if') {\n parse_Statement();\n //tree.endChildren();\n //tree.endChildren();\n parse_StatementList();\n //tree.endChildren();\n //tree.endChildren();\n\n } else if (foundTokensCopy[parseCounter][0] == '{') {\n parse_Statement();\n //tree.endChildren();\n //tree.endChildren();\n parse_StatementList();\n //tree.endChildren();\n //tree.endChildren();\n } else {\n console.log(\"epsilon\");\n //epsilon production\n }\n tree.endChildren();\n\n}", "function parseProgram() {\n\n if (!running) {\n return;\n }\n\n // call parseBlock\n cst.addNode(\"Block\", \"Block\", \"branch\");\n\n // Add Block to astTokens\n newToken = asToken.build(asToken.Kind.Block, \"Block\", depth, tokens[iter].line);\n astTokens.push(newToken);\n\n depth++;\n\n parseBlock();\n cst.endChildren();\n\n if (match(tokens[iter], Token.Kind.EOP)) {\n\n cst.addNode(tokens[iter].value, tokens[iter].value, \"leaf\"); iter++;\n\n } else {\n\n /**********\n * ERROR Expected EOP\n ***********/\n parseProgramError = /*\"PARSER: ERROR: */\"Expected EOP, Found [\" + tokens[iter].value + \"] on line \" + tokens[iter].line;\n document.getElementById(\"parseOutput\").value += parseProgramError;\n parseError(parseProgramError);\n\n }\n }", "parseTopLevel() {\n const prog = [];\n while (!this.input.eof()) {\n const expr = this.parseExpression();\n this.currentNode = expr;\n if (expr) {\n prog.push(expr);\n }\n }\n\n return { type: \"prog\", prog: prog };\n }", "function PEGtoAST(node) {\n switch (type(node)) {\n case \"null\":\n return undefined;\n case \"string\":\n return new StringNode(node);\n case \"array\":\n return new ASTNodeList(...node.map(PEGtoAST));\n case \"object\":\n switch (node.TYPE) {\n case \"whitespace\":\n return new Whitespace();\n case \"parbreak\":\n return new Parbreak();\n case \"subscript\":\n return new Subscript(PEGtoAST(node.content));\n case \"superscript\":\n return new Superscript(PEGtoAST(node.content));\n case \"inlinemath\":\n return new InlineMath(PEGtoAST(node.content));\n case \"displaymath\":\n return new DisplayMath(PEGtoAST(node.content));\n case \"mathenv\":\n return new MathEnv(node.env, PEGtoAST(node.content));\n case \"group\":\n return new Group(PEGtoAST(node.content));\n case \"macro\":\n return new Macro(node.content, PEGtoAST(node.args));\n case \"environment\":\n return new Environment(\n PEGtoAST(node.env),\n PEGtoAST(node.args),\n PEGtoAST(node.content)\n );\n case \"verbatim\":\n return new Verbatim(PEGtoAST(node.content));\n case \"verb\":\n return new Verb(node[\"escape\"], PEGtoAST(node.content));\n case \"commentenv\":\n return new CommentEnv(PEGtoAST([node.content]));\n case \"comment\":\n return new CommentNode(\n node.sameline,\n PEGtoAST(node.content)\n );\n case \"arglist\":\n return new ArgList(PEGtoAST(node.content));\n }\n }\n}", "getAst() {\n\n return {\n type: 'procedure',\n params: this.params,\n body: this.body ? this.body.getAst() : null,\n isService: this.isService\n };\n }", "function parseplan (planstring) {\n //Map for implicit links\n var implicitSrcMap = {};\n var g = new dagreD3.Digraph();\n //Produce 2D array (3 x M): [[0:majorMinor] [1:] [2:opName]] / [[<major>-<minor>, \"<indent>\", opName]]\n let opPlanArray = planstring.trim().split(\"\\n\");\n var operatorRegex = new RegExp(\"^([0-9-]+)( *)([a-zA-Z]*)\");\n //Regex to capture source operator \n var srcOpRegex = new RegExp(\"srcOp=[0-9-]+\");\n var opTuple = $.map(opPlanArray, \n function (lineStr) { \n //Tokenize via Regex\n let opToken = operatorRegex.exec(lineStr).slice(1);\n //Extract Implicit Source via Regex\n let implicitSrc = srcOpRegex.exec(lineStr);\n let srcOp = null;\n let tgtOp = opToken[0];\n if (implicitSrc != null) {\n srcOp = implicitSrc.toString().split(\"=\")[1];\n implicitSrcMap[tgtOp]=srcOp;\n }\n return [opToken];\n });\n\n\n // parse, build & inject nodes\n for (var i = 0; i < opTuple.length; i++) {\n let majorMinor = opTuple[i][0];\n let majorId = parseInt(majorMinor.split(\"-\")[0]);\n let opName = opTuple[i][2];\n g.addNode(majorMinor, {\n label: opName + \" \" + majorMinor,\n fragment: majorId\n });\n }\n\n // Define edges by traversing graph from root node (Screen)\n //NOTE: The indentation value in opTuple which is opTuple[1] represents the relative level of each operator in tree w.r.t root operator\n var nodeStack = [opTuple[0]]; //Add Root\n for (var i = 1; i < opTuple.length; i++) {\n let top = nodeStack.pop();\n let currItem = opTuple[i];\n let stackTopIndent = top[1].length;\n let currItemIndent = currItem[1].length; //Since tokenizing gives indent size at index 1\n //Compare top-of-stack indent with current iterItem indent\n while (stackTopIndent >= currItemIndent) {\n top = nodeStack.pop();\n stackTopIndent = top[1].length;\n }\n\n //Found parent\n //Add edge if Implicit src exists\n //Refer: https://dagrejs.github.io/project/dagre-d3/latest/demo/style-attrs.html / https://github.com/d3/d3-shape#curves\n if (implicitSrcMap[currItem[0]] != null) {\n //Note: Order matters because it affects layout (currently: BT)\n //Ref: //https://github.com/dagrejs/dagre/issues/116\n g.addEdge(null, currItem[0], implicitSrcMap[currItem[0]], {\n style: \"fill:none; stroke:gray; stroke-width:3px; stroke-dasharray: 5,5;marker-end:none\"\n });\n \n }\n //Adding edge\n g.addEdge(null, currItem[0], top[0]);\n\n if (currItemIndent != stackTopIndent)\n nodeStack.push(top);\n if (currItemIndent >= stackTopIndent)\n nodeStack.push(currItem);\n }\n\n return g;\n }", "function parse(nextToken){\r\n\t//current token\r\n\tvar type,word; //NOTE: word is only update right after next()ing. don't rely on it laaaaater\r\n\t//stored tokens\r\n\tvar newType,newWord;\r\n\t//keep track of stored tokens\r\n\tvar readNext=1;\r\n\t//false=not, 1=no paren, 2=()\r\n\tvar defType=false,nextDefCommon=false,defs={};\r\n\t\r\n\tvar blocks=[];\r\n\tvar current={};\r\n\tvar currentBlocks=[];\r\n\t\r\n\tfunction startBlock(){\r\n\t\tcurrent.code=[];\r\n\t\tcurrent.line=lineNumber;\r\n\t\tcurrentBlocks.push(current);\r\n\t\tcurrent={};\r\n\t}\r\n\tfunction endBlock(){\r\n\t\tvar block=currentBlocks.pop();\r\n\t\tcurrentBlocks[currentBlocks.length-1].code.push(block);\r\n\t}\r\n\tfunction endDef(){\r\n\t\tvar block=currentBlocks.pop();\r\n\t\tdefs[block.name]=block;\r\n\t}\r\n\t\r\n\tvar ifThisLine=false,codeAfterThen;\r\n\t//var nextFunctionGetsOneMore=0;\r\n\tvar expr=[];\r\n\t\r\n\tcurrent.type=\"main\";\r\n\tstartBlock();\r\n\t\r\n\tdo{\r\n\t\ttry{\r\n\t\t\treadStatement();\r\n\t\t}catch(error){\r\n\t\t\tif(error.name===\"ParseError\"){\r\n\t\t\t\treturn error.message+\" on line \"+lineNumber;\r\n\t\t\t//bad error!!!\r\n\t\t\t}else{\r\n\t\t\t\tthrow error;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t}while(type!==\"eof\");;;\r\n\t\r\n\t//read a \"line\" of code\r\n\tfunction readStatement(){\r\n\t\tnext();\r\n\t\tif(type!=\"comment\" && ifThisLine && type!=\"linebreak\")\r\n\t\t\tcodeAfterThen=true;\r\n\t\tswitch(type){\r\n\t\t\t//keywords with no arguments\r\n\t\t\tcase \"BREAK\":\r\n\t\t\t\tcurrent.type=\"BREAK\";\r\n\t\t\t\tcurrent.levels=readExpression();\r\n\t\t\tbreak;case \"CONTINUE\":\r\n\t\t\t\tcurrent.type=\"CONTINUE\";\r\n\t\t\t\tcurrent.levels=readExpression();\r\n\t\t\tbreak;case \"ELSE\":\r\n\t\t\t\tvar currentType=currentBlock().type\r\n\t\t\t\tif(currentType===\"CASE\"){\r\n\t\t\t\t\tendBlock();\r\n\t\t\t\t\tcurrent.type=\"CASE\";\r\n\t\t\t\t\tstartBlock();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tassert(currentBlock().type===\"IF\"||currentBlock().type===\"ELSEIF\",\"ELSE without IF\");\r\n\t\t\t\t\tendBlock();\r\n\t\t\t\t\tcurrent.type=\"ELSE\";\r\n\t\t\t\t\tstartBlock();\r\n\t\t\t\t}\r\n\t\t\tbreak;case \"ENDSWITCH\":\r\n\t\t\t\tvar currentType=currentBlock().type\r\n\t\t\t\tif(currentType===\"CASE\")\r\n\t\t\t\t\tendBlock();\r\n\t\t\t\telse\r\n\t\t\t\t\tassert(currentType===\"SWITCH\",\"ENDSW without SWITCH\");\r\n\t\t\t\tendBlock();\r\n\t\t\tbreak;case \"ENDIF\":\r\n\t\t\t\tvar currentType=currentBlock().type\r\n\t\t\t\tassert(currentType===\"IF\" || currentType===\"ELSE\" || currentType===\"ELSEIF\",\"ENDIF without IF\");\r\n\t\t\t\tendBlock();\r\n\t\t\t\tifThisLine=false;\r\n\t\t\tbreak;case \"SWITCH\":\r\n\t\t\t\tcurrent.type=\"SWITCH\"\r\n\t\t\t\tassert(current.condition=readExpression(),\"Missing argument to keyword\");\r\n\t\t\t\tstartBlock();\r\n\t\t\tbreak;case \"CASE\":\r\n\t\t\t\tvar currentType=currentBlock().type\r\n\t\t\t\tif(currentType===\"CASE\")\r\n\t\t\t\t\tendBlock();\r\n\t\t\t\telse\r\n\t\t\t\t\tassert(currentType===\"SWITCH\",\"invalid CASE\");\r\n\t\t\t\tcurrent.type=\"CASE\"\r\n\t\t\t\tassert(current.conditions=readList(readExpression),\"Missing argument to keyword\");\r\n\t\t\t\tstartBlock();\r\n\t\t\tbreak;case \"STOP\":\r\n\t\t\t\tcurrent.type=\"STOP\";\r\n\t\t\tbreak;case \"REPEAT\":\r\n\t\t\t\tcurrent.type=\"REPEAT\";\r\n\t\t\t\tstartBlock();\r\n\t\t\t//SWAP\r\n\t\t\tbreak;case \"SWAP\":\r\n\t\t\t\tcurrent.type=\"SWAP\";\r\n\t\t\t\tassert(current.variable=readVariable(),\"Missing variable in SWAP\");\r\n\t\t\t\tassert(readToken(\",\"),\"Missing comma in SWAP\");\r\n\t\t\t\tassert(current.variable2=readVariable(),\"Missing variable in SWAP\");\r\n\t\t\t//IF, ELSEIF\r\n\t\t\tbreak;case \"ELSEIF\":\r\n\t\t\t\tassert(currentBlock().type==\"IF\"||currentBlock().type==\"ELSEIF\",\"ELSEIF without IF\");\r\n\t\t\t\tendBlock();\r\n\t\t\t\tcurrent.type=\"ELSEIF\"\r\n\t\t\t\tcurrent.condition=readExpression();\r\n\t\t\t\tassert(readToken(\"THEN\"),\"ELSEIF without THEN\");\r\n\t\t\t\tstartBlock();\r\n\t\t\tbreak;case \"IF\":\r\n\t\t\t\tcurrent.type=\"IF\"\r\n\t\t\t\tassert(current.condition=readExpression(),\"Missing IF condition\");\r\n\t\t\t\tassert(readToken(\"THEN\"),\"IF without THEN\");\r\n\t\t\t\tstartBlock();\r\n\t\t\t\tifThisLine=true;\r\n\t\t\t\tcodeAfterThen=false;\r\n\t\t\t//FOR\r\n\t\t\tbreak;case \"FOR\":\r\n\t\t\t\tcurrent.type=\"FOR\";\r\n\t\t\t\tassert(current.variable=readVariable(),\"Missing FOR variable\");\r\n\t\t\t\tassert(readToken(\"=\"),\"Missing = in FOR\");\r\n\t\t\t\tcurrent.start=readExpression();\r\n\t\t\t\tassert(readToken(\"word\") && word===\"TO\",\"Missing TO in FOR\");\r\n\t\t\t\tcurrent.end=readExpression();\r\n\t\t\t\tif(readToken(\"word\") && word===\"STEP\")\r\n\t\t\t\t\tcurrent.step=readExpression();\r\n\t\t\t\telse\r\n\t\t\t\t\treadNext=0; //heck\r\n\t\t\t\tstartBlock();\r\n\t\t\t//WHILE <condition>\r\n\t\t\tbreak;case \"WHILE\":\r\n\t\t\t\tcurrent.type=\"WHILE\"\r\n\t\t\t\tassert(current.condition=readExpression(),\"Missing argument to keyword\");\r\n\t\t\t\tstartBlock();\r\n\t\t\tbreak;case \"WEND\":\r\n\t\t\t\tassert(currentBlock().type==\"WHILE\",\"WEND without WHILE\");\r\n\t\t\t\tendBlock();\r\n\t\t\t//do/LOOP\r\n\t\t\tbreak;case \"DO\":\r\n\t\t\t\tcurrent.type=\"DO\"\r\n\t\t\t\tstartBlock();\r\n\t\t\tbreak;case \"LOOP\":\r\n\t\t\t\tassert(currentBlock().type==\"DO\",\"LOOP without DO\");\r\n\t\t\t\tendBlock();\r\n\t\t\t//UNTIL <condition>\r\n\t\t\tbreak;case \"UNTIL\":\r\n\t\t\t\tassert(currentBlock().type==\"REPEAT\",\"UNTIL without REPEAT\");\r\n\t\t\t\tassert(currentBlock().condition=readExpression(),\"Missing UNTIL condition\");\r\n\t\t\t\tendBlock();\r\n\t\t\t//NEXT\r\n\t\t\tbreak;case \"NEXT\":\r\n\t\t\t\tassert(currentBlock().type==\"FOR\",\"NEXT without FOR\");\r\n\t\t\t\treadExpression();\r\n\t\t\t\tendBlock();\r\n\t\t\t//OUT/THEN\r\n\t\t\tbreak;case \"OUT\":case \"THEN\":\r\n\t\t\t\tassert(false,\"Illegal OUT/THEN\");\r\n\t\t\t//other words\r\n\t\t\tbreak;case \"word\":\r\n\t\t\t\t//var name=text;\r\n\t\t\t\treadNext=readNext-1;\r\n\t\t\t\tvar x=readVariable(true);\r\n\t\t\t\tif(readToken(\"=\")){\r\n\t\t\t\t\tcurrent.type=\"assignment\";\r\n\t\t\t\t\tcurrent.variable=x;\r\n\t\t\t\t\tassert(current.value=readExpression(),\"Missing value in assignment\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcurrent.type=\"function\";\r\n\t\t\t\t\tcurrent.name=x.name;\r\n\t\t\t\t\tcurrent.inputs=readList(readExpression);\r\n\t\t\t\t\tif(readToken(\"OUT\"))\r\n\t\t\t\t\t\tcurrent.outputs=readList(readVariable);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurrent.outputs=[];\r\n\t\t\t\t}\r\n\t\t\t//comment\r\n\t\t\tbreak;case \"comment\":\r\n\t\t\t//colon NOP\r\n\t\t\tbreak;case \":\":\r\n\t\t\t//line break, end\r\n\t\t\tbreak;case \"eof\":\r\n\t\t\tcase \"linebreak\":\r\n\t\t\t\tif(ifThisLine){\r\n\t\t\t\t\tifThisLine=false;\r\n\t\t\t\t\tif(codeAfterThen){\r\n\t\t\t\t\t\tendBlock();\r\n\t\t\t\t\t\tconsole.log(\"ended single line IF\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\tbreak;default:\r\n\t\t\t\tassert(false,\"Expected statement, got \"+type+\" '\"+word+\"'\");\r\n\t\t}\r\n\t\tif(current.type){\r\n\t\t\tcurrent.line=lineNumber;\r\n\t\t\tcurrentBlocks[currentBlocks.length-1].code.push(current)//push to current block!\r\n\t\t\tcurrent={}\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction currentBlock(){\r\n\t\treturn currentBlocks[currentBlocks.length-1]\r\n\t}\r\n\t\r\n\t//check if next token is of a specific type\r\n\tfunction peekToken(wantedType){\r\n\t\tvar prevType=type,prevWord=word;\r\n\t\tnext();\r\n\t\treadNext=-1;\r\n\t\tnewType=type;\r\n\t\tnewWord=word;\r\n\t\ttype=prevType;\r\n\t\tword=prevWord;\r\n\t\treturn newType===wantedType;\r\n\t}\r\n\t//check if next token is of a specific type\r\n\tfunction peekWord(wantedWord){\r\n\t\tvar prevType=type,prevWord=word;\r\n\t\tnext();\r\n\t\treadNext=-1;\r\n\t\tnewType=type;\r\n\t\tnewWord=word;\r\n\t\ttype=prevType;\r\n\t\tword=prevWord;\r\n\t\treturn newType===\"word\" && newWord.trimLeft().toUpperCase()===wantedWord;\r\n\t}\r\n\t\r\n\t//Try to read a specific token\r\n\tfunction readToken(wantedType){\r\n\t\tnext();\r\n\t\tif(type===wantedType){\r\n\t\t\treadNext=1;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treadNext=0;\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//Read list\r\n\t//reader: function to read item (readExpression etc.)\r\n\t//noNull: throw an error if a null value is found\r\n\tfunction readList(reader){\r\n\t\tvar ret=[];\r\n\t\tvar x=reader();\r\n\t\tif(x)\r\n\t\t\tret.push(x);\r\n\t\tif(readToken(\",\",\"\")){\r\n\t\t\tassert(x,\"Null value not allowed\");\r\n\t\t\tdo\r\n\t\t\t\tassert(ret.push(reader()),\"Null value not allowed\");\r\n\t\t\twhile(readToken(\",\"));;;\r\n\t\t}\r\n\t\treturn ret;\r\n\t}\r\n\t\r\n\tfunction readList2(reader){\r\n\t\tvar ret=[];\r\n\t\tvar x=reader();\r\n\t\tif(x)\r\n\t\t\tret.push(x);\r\n\t\tif(readToken(\",\",\"\")&&expr.push({type:\"comma\"})){\r\n\t\t\tassert(x,\"Null value not allowed\");\r\n\t\t\tdo\r\n\t\t\t\tassert(ret.push(reader()),\"Null value not allowed\");\r\n\t\t\twhile(readToken(\",\")&&expr.push({type:\"comma\"}));;;\r\n\t\t}\r\n\t\treturn ret;\r\n\t}\r\n\t\r\n\t//read normal expression\r\n\t//SHould return RPN list\r\n\tfunction readExpression(){\r\n\t\texpr=[];\r\n\t\t//var rpn=[],stack=[];\r\n\t\t//rpn parse tokens as they are read?\r\n\t\tif(readExpression2())\r\n\t\t\treturn rpnFromExpr(expr);\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tfunction prec(token){\r\n\t\tif(token.type===\"unary\" || token.type===\"comma\")\r\n\t\t\treturn Infinity;\r\n\t\telse\r\n\t\t\tswitch(token.name){\r\n\t\t\t\tcase \"^\":\r\n\t\t\t\t\treturn 11;\r\n\t\t\t\tcase \"*\":case \"/\": case \"\\\\\": case \"%\":\r\n\t\t\t\t\treturn 10;\r\n\t\t\t\tcase \"+\":case \"-\":\r\n\t\t\t\t\treturn 9;\r\n\t\t\t\tcase \"<<\":case \">>\":\r\n\t\t\t\t\treturn 8;\r\n\t\t\t\tcase \"<\":case \"<=\":case \">\":case \">=\":\r\n\t\t\t\t\treturn 7;\r\n\t\t\t\tcase \"==\":case \"!=\":\r\n\t\t\t\t\treturn 6;\r\n\t\t\t\tcase \"&\":\r\n\t\t\t\t\treturn 5;\r\n\t\t\t\tcase \"~\":\r\n\t\t\t\t\treturn 4;\r\n\t\t\t\tcase \"|\":\r\n\t\t\t\t\treturn 3;\r\n\t\t\t\tcase \"AND\":\r\n\t\t\t\t\treturn 2;\r\n\t\t\t\tcase \"OR\":\r\n\t\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\tconsole.log(token);\r\n\t\tassert(false,\"error prec \"+token.name);\r\n\t}\r\n\tfunction left(token){\r\n\t\treturn 0\r\n\t}\r\n\t\r\n\tfunction rpnFromExpr(expr){\r\n\t\tconsole.log({...expr},\"expr\");\r\n\t\tvar rpn=[],stack=[];\r\n\t\tfor(var i=0;i<expr.length;i++){\r\n\t\t\tvar token=expr[i];\r\n\t\t\tswitch(token.type){\r\n\t\t\t\tcase \"number\":case \"string\":case \"variable\":case \"function\":case \"array\": //see, functions are actually pushed AFTER their arguments, so we can just send them directly to the output! :D\r\n\t\t\t\t\trpn.push(token);\r\n\t\t\t\tbreak;case \"operator\":case \"unary\":\r\n\t\t\t\t\twhile(stack.length){\r\n\t\t\t\t\t\tvar top=stack[stack.length-1]\r\n\t\t\t\t\t\t//console.log(top)\r\n\t\t\t\t\t\tif(top.type!=\"(\"&&(prec(top)>=prec(token) || (prec(top)==prec(token) && left(token)))){\r\n\t\t\t\t\t\t\trpn.push(stack.pop());\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstack.push(token);\r\n\t\t\t\tbreak;case \"comma\":\r\n\t\t\t\t\twhile(stack.length){\r\n\t\t\t\t\t\tvar top=stack[stack.length-1]\r\n\t\t\t\t\t\t//console.log(top)\r\n\t\t\t\t\t\tif(top.type!=\"(\"){\r\n\t\t\t\t\t\t\trpn.push(stack.pop());\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;case \"(\":\r\n\t\t\t\t\tstack.push(token);\r\n\t\t\t\tbreak;case \")\":\r\n\t\t\t\t\twhile(1){\r\n\t\t\t\t\t\tvar top=stack[stack.length-1]\r\n\t\t\t\t\t\tif(top.type!=\"(\")\r\n\t\t\t\t\t\t\trpn.push(stack.pop());\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstack.pop();\r\n\t\t\t\tbreak;default:\r\n\t\t\t\tassert(false,\"error typ \"+token.type)\r\n\t\t\t}\r\n\t\t}\r\n\t\twhile(stack.length)\r\n\t\t\trpn.push(stack.pop());\r\n\t\treturn rpn;\r\n\t}\r\n\t\r\n\tfunction readExpression2(){\r\n\t\tvar ret=false;\r\n\t\tnext();\r\n\t\tswitch(type){\r\n\t\t\t//function or variable\r\n\t\t\tcase \"word\":\r\n\t\t\t\tvar name=word;\r\n\t\t\t\tif(readToken(\"(\")){\r\n\t\t\t\t\texpr.push({type:\"(\"}); //all we needed!\r\n\t\t\t\t\tvar x=readList2(readExpression2);\r\n\t\t\t\t\tassert(readToken(\")\"),\"Missing \\\")\\\" in function call\");\r\n\t\t\t\t\texpr.push({type:\")\"});\r\n\t\t\t\t\texpr.push({type:\"function\",name:name,args:x.length});\r\n\t\t\t\t}else\r\n\t\t\t\t\texpr.push({type:\"variable\",name:name});\r\n\t\t\t//number literals\r\n\t\t\tbreak;case \"number\":\r\n\t\t\t\texpr.push({type:\"number\",value:word});\r\n\t\t\t//string/label\r\n\t\t\tbreak;case \"string\":\r\n\t\t\t\texpr.push({type:\"string\",value:word});\r\n\t\t\t//operator (unary)\r\n\t\t\tbreak;case \"unary\":case \"minus\":case \"xor\":\r\n\t\t\t\t//unary op\r\n\t\t\t\texpr.push({type:\"unary\",name:word,args:1});\r\n\t\t\t\t//expr.push({type:\"(\"}); //actual fear\r\n\t\t\t\tassert(readExpression2(),\"Missing operator argument\");\r\n\t\t\t\t//expr.push({type:\")\"});\r\n\t\t\t\t\r\n\t\t\t//open parenthesis\r\n\t\t\tbreak;case \"(\":\r\n\t\t\t\texpr.push({type:\"(\"});\r\n\t\t\t\treadExpression2();\r\n\t\t\t\tassert(readToken(\")\"),\"Missing \\\")\\\"\");\r\n\t\t\t\texpr.push({type:\")\"});\r\n\t\t\tbreak;case \"[\":\r\n\t\t\t\texpr.push({type:\"(\"});\r\n\t\t\t\tvar x=readList2(readExpression2);\r\n\t\t\t\texpr.push({type:\"array\",args:x.length});\r\n\t\t\t\tassert(readToken(\"]\"),\"Missing \\\"]\\\"\");\r\n\t\t\t\texpr.push({type:\")\"});\r\n\t\t\t\t\r\n\t\t\t//other crap\r\n\t\t\tbreak;default:\r\n\t\t\t\treadNext=0;\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\twhile(readToken(\"dot\")){\r\n\t\t\tassert(readToken(\"word\"),\"Dot missing function\");\r\n\t\t\tvar name=word;\r\n\t\t\tassert(readToken(\"(\"),\"Dot missing function\");\r\n\t\t\texpr.push({type:\"(\"}); //all we needed!\r\n\t\t\tvar x=readList2(readExpression2);\r\n\t\t\tassert(readToken(\")\"),\"Missing \\\")\\\" in function call\");\r\n\t\t\texpr.push({type:\")\"});\r\n\t\t\texpr.push({type:\"function\",name:name,args:x.length+1});\r\n\t\t}\r\n\t\t//read infix operators\r\n\t\t//this might have to be WHILE not IF\r\n\t\tif(readToken(\"operator\")||readToken(\"minus\")||readToken(\"xor\")){\r\n\t\t\texpr.push({type:\"operator\",name:word,args:2});\r\n\t\t\tassert(readExpression2(),\"Operator missing second argument\");\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t//read function definition argument\r\n\tfunction readArgument(){\r\n\t\tif(readToken(\"word\"))\r\n\t\t\treturn word;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}\r\n\t\r\n\t//read variable declaration\r\n\tfunction readDeclaration(){\r\n\t\tvar ret={};\r\n\t\tif(readToken(\"word\")){\r\n\t\t\tret.name=word;\r\n\t\t\tif(readToken(\"=\"))\r\n\t\t\t\tret.value=readExpression();\r\n\t\t\treturn ret;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//keys:\r\n\t//name: [variable name expr token list]\r\n\t//indexes: [index list]\r\n\tfunction readVariable(){\r\n\t\tvar ret={name:\"\"};\r\n\t\tnext();\r\n\t\treturn {name:word}\r\n\t\tswitch(type){\r\n\t\t\tcase \"word\":\r\n\t\t\t\tret.name=word;\r\n\t\t\tbreak;default:\r\n\t\t\t\treadNext=0;\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn ret;\r\n\t}\r\n\t\r\n\t//throw error with message if condition is false\r\n\tfunction assert(condition,message){\r\n\t\tif(!condition){\r\n\t\t\t//message//+=\" on line \"+lineNumber;\r\n\t\t\tconsole.log(message);\r\n\t\t\tvar error=new Error(message);\r\n\t\t\terror.name=\"ParseError\";\r\n\t\t\tthrow error;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//I forgot how this works...\r\n\tfunction next(){\r\n\t\tif(readNext===1){\r\n\t\t\tvar items=nextToken();\r\n\t\t\ttype=items.type;\r\n\t\t\tword=items.word;\r\n\t\t}else if(readNext===-1){\r\n\t\t\ttype=newType;\r\n\t\t\tword=newWord;\r\n\t\t\treadNext=1;\r\n\t\t//I don't think this ever happens?\r\n\t\t}else if(readNext===-2)\r\n\t\t\treadNext=-1;\r\n\t\telse\r\n\t\t\treadNext=1;\r\n\t}\r\n\t\r\n\t//handle single line IF blocks at the end of the program (temporary fix)\r\n\tif(ifThisLine){\r\n\t\tifThisLine=false;\r\n\t\tif(codeAfterThen){\r\n\t\t\tendBlock();\r\n\t\t\tconsole.log(\"ended single line IF\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(currentBlocks.length>=2)\r\n\t\treturn \"Unclosed \"+currentBlocks[1].type;\r\n\t//currentBlocks[1]=defs;\r\n\treturn currentBlocks;\r\n}", "function DomParser() {\n\n /**\n * Parses items from tico-v text nodes.\n */\n let textParser = new TextParser();\n let attributeRegexes = [\"tv-foreach\", \"tv-true\", \"tv-not-true\", \"(tv-value)-([a-z0-9_\\-]+)\", \"(tv-).*\"].map(regex => new RegExp(regex, 'i'));\n let parentId = Math.random();\n\n /**\n * Add a variable extracted from a node to the variables object\n * \n * @param {Map} variables \n * @param {string} variable \n * @param {object} nodeDetails \n */\n function addNodeToVariable(variables, variable, nodeDetails) {\n if (!variables.has(variable)) {\n variables.set(variable, []);\n }\n variables.get(variable).push(nodeDetails);\n }\n\n /**\n * Merge one set of variables into another\n * \n * @param {Map} variables \n * @param {Map} mergedVariables \n */\n function mergeVariables(variables, mergedVariables) {\n mergedVariables.forEach((details, variable) => {\n if(variables.has(variable)) {\n variables.get(variable).concat(details);\n } else {\n variables.set(variable, details)\n }\n });\n }\n\n /**\n * Parse a given node for variables in its attributes.\n * Extract these nodes for later use\n * \n * @param {Node} node \n * @param {Map} variables \n */\n function parseAttributes(node, variables, bindingDetails, path) {\n let parentDetected = false;\n let attributeVariables = new Map();\n\n for (let i in node.attributes) {\n let attribute = node.attributes[i];\n for (let regex of attributeRegexes) {\n let match = regex.exec(attribute.name);\n if (!match) continue;\n if (match[1] === 'tv-value') {\n parsed = textParser.parse(attribute.value);\n attributeNode = document.createAttribute(match[2]);\n node.setAttributeNode(attributeNode);\n parsed.variables.forEach(variable => {\n addNodeToVariable(attributeVariables, variable, { node: attributeNode, type: 'attribute', name: match[2], structure: parsed.structure, path: path })\n })\n } else if (match[0] === 'tv-true') {\n addNodeToVariable(attributeVariables, attribute.value, { node: node, type: 'truth', name: attribute.value, display: node.style.display, path: path })\n } else if (match[0] === 'tv-not-true') {\n addNodeToVariable(attributeVariables, attribute.value, { node: node, type: 'not-truth', name: attribute.value, display: node.style.display, path: path })\n } else if (match[0] == 'tv-foreach') {\n parentDetected = { \n template: node, \n type: 'foreach', \n parent: node.parentNode, \n name: attribute.value, \n variables: attributeVariables, \n callback: bindingDetails.onCreate && typeof bindingDetails.onCreate[attribute.value] === 'function' ? \n bindingDetails.onCreate[attribute.value] : false\n };\n \n addNodeToVariable(variables, attribute.value, parentDetected)\n }\n break;\n }\n }\n\n if(!parentDetected) {\n mergeVariables(variables, attributeVariables);\n }\n\n return parentDetected;\n }\n\n /**\n * Parse an element node and its children to find any text nodes or attributes that contain variables.\n * \n * @param {Node} node \n * @param {Map} variables \n */\n function parseNode(node, variables, bindingDetails, path) {\n let parentDetected = parseAttributes(node, variables, bindingDetails, path);\n \n if (parentDetected) {\n variables = parentDetected.variables;\n }\n\n let n = 1;\n node.childNodes.forEach((child, index) => {\n let parsed = [];\n\n if (child.nodeType == Node.TEXT_NODE) {\n parsed = textParser.parse(child.textContent);\n parsed.variables.forEach(variable => {\n addNodeToVariable(variables, variable, \n { \n node: child, \n type: 'text', \n structure: parsed.structure,\n path: path,\n index: index\n });\n });\n } else if (child.nodeType == Node.ELEMENT_NODE) {\n parseNode(child, variables, bindingDetails, `${path}${path == \"\" ? \"\" : \">\"}${child.nodeName}:nth-child(${n})`);\n n++;\n }\n });\n }\n\n /**\n * Parse a dom node and return a collection of variables their associated list of observers\n * and related dom manipulators.\n * @param {Node} node \n */\n this.parse = function (bindingDetails) {\n let variables = new Map();\n parseNode(bindingDetails.templateNode, variables, bindingDetails, \"\");\n return variables;\n }\n}", "function token1(r) {\n\t\tfor (var j = 0; j < r.length; j++) {\n\t\t\t//if (r[j].match(srr[0], \"g\")) {\n\t\t\tvar re = new RegExp(srr[0],\"g\");\n\t\t\tif (r[j].match(re)) {\n\t\t\t\t$('<p>').html(r[j]).appendTo(\"#demo-1\");\n\t\t\t\tscnt++;\t\n\t\t\t} \n\t\t} \n\t\tsearchql = true;\n\t\thlsSyntax(srr[0]);\n\t\tresultCall();\n\t}", "function t(e){switch(e.type){case V.AssignmentExpression:case V.ArrayExpression:case V.ArrayPattern:case V.BinaryExpression:case V.CallExpression:case V.ConditionalExpression:case V.ClassExpression:case V.ExportBatchSpecifier:case V.ExportSpecifier:case V.FunctionExpression:case V.Identifier:case V.ImportSpecifier:case V.Literal:case V.LogicalExpression:case V.MemberExpression:case V.MethodDefinition:case V.NewExpression:case V.ObjectExpression:case V.ObjectPattern:case V.Property:case V.SequenceExpression:case V.ThisExpression:case V.UnaryExpression:case V.UpdateExpression:case V.YieldExpression:return!0}return!1}", "function k(a,b,c){\n// Set the tag opening and closing delimiters and 'link' character. Default is \"{{\", \"}}\" and \"^\"\n// openChars, closeChars: opening and closing strings, each with two characters\n// Set the tag opening and closing delimiters and 'link' character. Default is \"{{\", \"}}\" and \"^\"\n// openChars, closeChars: opening and closing strings, each with two characters\n// Escape the characters - since they could be regex special characters\n// Default is \"{^{\"\n// Default is \"}}\"\n// Build regex with new delimiters\n// [tag (followed by / space or }) or cvtr+colon or html or code] followed by space+params then convertBack?\n// make rTag available to JsViews (or other components) for parsing binding expressions\n// { ^? { tag+params slash? or closingTag or comment\n// Default: bind tagName cvt cln html code params slash bind2 closeBlk comment\n// /(?:{(\\^)?{(?:(\\w+(?=[\\/\\s}]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^}]|}(?!}))*?)(\\/)?|{(\\^)?{(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))}}\nreturn a?(ea.delimiters=[a,b,la=c?c.charAt(0):la],ha=a.charAt(0),ia=a.charAt(1),ja=b.charAt(0),ka=b.charAt(1),a=\"\\\\\"+ha+\"(\\\\\"+la+\")?\\\\\"+ia,b=\"\\\\\"+ja+\"\\\\\"+ka,V=\"(?:(\\\\w+(?=[\\\\/\\\\s\\\\\"+ja+\"]))|(\\\\w+)?(:)|(>)|(\\\\*))\\\\s*((?:[^\\\\\"+ja+\"]|\\\\\"+ja+\"(?!\\\\\"+ka+\"))*?)\",da.rTag=\"(?:\"+V+\")\",V=new RegExp(\"(?:\"+a+V+\"(\\\\/)?|\\\\\"+ha+\"(\\\\\"+la+\")?\\\\\"+ia+\"(?:(?:\\\\/(\\\\w+))\\\\s*|!--[\\\\s\\\\S]*?--))\"+b,\"g\"),W=new RegExp(\"<.*>|([^\\\\\\\\]|^)[{}]|\"+a+\".*\"+b),ga):ea.delimiters}", "function parse (_source, _name) {\r\n openTokenDepth = 0;\r\n curDynamicImport = null;\r\n templateDepth = -1;\r\n lastTokenPos = -1;\r\n lastSlashWasDivision = false;\r\n templateStack = Array(1024);\r\n templateStackDepth = 0;\r\n openTokenPosStack = Array(1024);\r\n openClassPosStack = Array(1024);\r\n nextBraceIsClass = false;\r\n facade = true;\r\n name = _name || '@';\r\n\r\n imports = [];\r\n exports$1 = new Set();\r\n\r\n source = _source;\r\n pos = -1;\r\n end = source.length - 1;\r\n let ch = 0;\r\n\r\n // start with a pure \"module-only\" parser\r\n m: while (pos++ < end) {\r\n ch = source.charCodeAt(pos);\r\n\r\n if (ch === 32 || ch < 14 && ch > 8)\r\n continue;\r\n\r\n switch (ch) {\r\n case 101/*e*/:\r\n if (openTokenDepth === 0 && keywordStart(pos) && source.startsWith('xport', pos + 1)) {\r\n tryParseExportStatement();\r\n // export might have been a non-pure declaration\r\n if (!facade) {\r\n lastTokenPos = pos;\r\n break m;\r\n }\r\n }\r\n break;\r\n case 105/*i*/:\r\n if (keywordStart(pos) && source.startsWith('mport', pos + 1))\r\n tryParseImportStatement();\r\n break;\r\n case 59/*;*/:\r\n break;\r\n case 47/*/*/: {\r\n const next_ch = source.charCodeAt(pos + 1);\r\n if (next_ch === 47/*/*/) {\r\n lineComment();\r\n // dont update lastToken\r\n continue;\r\n }\r\n else if (next_ch === 42/***/) {\r\n blockComment(true);\r\n // dont update lastToken\r\n continue;\r\n }\r\n // fallthrough\r\n }\r\n default:\r\n // as soon as we hit a non-module token, we go to main parser\r\n facade = false;\r\n pos--;\r\n break m;\r\n }\r\n lastTokenPos = pos;\r\n }\r\n\r\n while (pos++ < end) {\r\n ch = source.charCodeAt(pos);\r\n\r\n if (ch === 32 || ch < 14 && ch > 8)\r\n continue;\r\n\r\n switch (ch) {\r\n case 101/*e*/:\r\n if (openTokenDepth === 0 && keywordStart(pos) && source.startsWith('xport', pos + 1))\r\n tryParseExportStatement();\r\n break;\r\n case 105/*i*/:\r\n if (keywordStart(pos) && source.startsWith('mport', pos + 1))\r\n tryParseImportStatement();\r\n break;\r\n case 99/*c*/:\r\n if (keywordStart(pos) && source.startsWith('lass', pos + 1) && isBrOrWs(source.charCodeAt(pos + 5)))\r\n nextBraceIsClass = true;\r\n break;\r\n case 40/*(*/:\r\n openTokenPosStack[openTokenDepth++] = lastTokenPos;\r\n break;\r\n case 41/*)*/:\r\n if (openTokenDepth === 0)\r\n syntaxError();\r\n openTokenDepth--;\r\n if (curDynamicImport && curDynamicImport.d === openTokenPosStack[openTokenDepth]) {\r\n if (curDynamicImport.e === 0)\r\n curDynamicImport.e = pos;\r\n curDynamicImport.se = pos;\r\n curDynamicImport = null;\r\n }\r\n break;\r\n case 123/*{*/:\r\n // dynamic import followed by { is not a dynamic import (so remove)\r\n // this is a sneaky way to get around { import () {} } v { import () }\r\n // block / object ambiguity without a parser (assuming source is valid)\r\n if (source.charCodeAt(lastTokenPos) === 41/*)*/ && imports.length && imports[imports.length - 1].e === lastTokenPos) {\r\n imports.pop();\r\n }\r\n openClassPosStack[openTokenDepth] = nextBraceIsClass;\r\n nextBraceIsClass = false;\r\n openTokenPosStack[openTokenDepth++] = lastTokenPos;\r\n break;\r\n case 125/*}*/:\r\n if (openTokenDepth === 0)\r\n syntaxError();\r\n if (openTokenDepth-- === templateDepth) {\r\n templateDepth = templateStack[--templateStackDepth];\r\n templateString();\r\n }\r\n else {\r\n if (templateDepth !== -1 && openTokenDepth < templateDepth)\r\n syntaxError();\r\n }\r\n break;\r\n case 39/*'*/:\r\n case 34/*\"*/:\r\n stringLiteral(ch);\r\n break;\r\n case 47/*/*/: {\r\n const next_ch = source.charCodeAt(pos + 1);\r\n if (next_ch === 47/*/*/) {\r\n lineComment();\r\n // dont update lastToken\r\n continue;\r\n }\r\n else if (next_ch === 42/***/) {\r\n blockComment(true);\r\n // dont update lastToken\r\n continue;\r\n }\r\n else {\r\n // Division / regex ambiguity handling based on checking backtrack analysis of:\r\n // - what token came previously (lastToken)\r\n // - if a closing brace or paren, what token came before the corresponding\r\n // opening brace or paren (lastOpenTokenIndex)\r\n const lastToken = source.charCodeAt(lastTokenPos);\r\n if (isExpressionPunctuator(lastToken) &&\r\n !(lastToken === 46/*.*/ && (source.charCodeAt(lastTokenPos - 1) >= 48/*0*/ && source.charCodeAt(lastTokenPos - 1) <= 57/*9*/)) &&\r\n !(lastToken === 43/*+*/ && source.charCodeAt(lastTokenPos - 1) === 43/*+*/) && !(lastToken === 45/*-*/ && source.charCodeAt(lastTokenPos - 1) === 45/*-*/) ||\r\n lastToken === 41/*)*/ && isParenKeyword(openTokenPosStack[openTokenDepth]) ||\r\n lastToken === 125/*}*/ && (isExpressionTerminator(openTokenPosStack[openTokenDepth]) || openClassPosStack[openTokenDepth]) ||\r\n lastToken === 47/*/*/ && lastSlashWasDivision ||\r\n isExpressionKeyword(lastTokenPos) ||\r\n !lastToken) {\r\n regularExpression();\r\n lastSlashWasDivision = false;\r\n }\r\n else {\r\n lastSlashWasDivision = true;\r\n }\r\n }\r\n break;\r\n }\r\n case 96/*`*/:\r\n templateString();\r\n break;\r\n }\r\n lastTokenPos = pos;\r\n }\r\n\r\n if (templateDepth !== -1 || openTokenDepth)\r\n syntaxError();\r\n\r\n return [imports, [...exports$1], facade];\r\n }", "function L() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (Parser.DEBUG) _vex__WEBPACK_IMPORTED_MODULE_0__[\"Vex\"].L('Vex.Flow.Parser', args);\n}", "function TextParser() {}", "function TextParser() {}", "analyze(lexer, current=lexer.next()) {\n if(current.type==Symbol.TAG) {\n switch(current.value) {\n case '[': return this.parser.rule(JXONList.TAG).analyze(lexer, current)\n case '{': return this.parser.rule(JXONObj.TAG).analyze(lexer, current)\n default: return current.toError();\n }\n }\n return current\n }", "function parseCodes()\n{\n\tvar codes=document.getElementsByTagName(\"code\");\n\tparseActual(codes, 0);\n }", "function c(e,t,n){switch(e.type){case\"VariableDeclaration\":e.declarations.forEach(function(e,t){c(e.init,t,n)});break;case\"BinaryExpression\":case\"LogicalExpression\":e.operator&&m[e.operator]?(e.type=\"CallExpression\",e.callee={type:\"MemberExpression\",computed:!1,object:e.right,property:{type:\"Identifier\",name:m[e.operator]}},c(e.left,t,n),c(e.right,t,n),e.arguments=[e.left]):(c(e.left,t,n),c(e.right,t,n));break;case\"ExpressionStatement\":c(e.expression,t,n);break;case\"CallExpression\":e.arguments.forEach(function(e,t){c(e,t,n)});break;case\"AssignmentExpression\":if(e.operator&&m[e.operator]){var r=e.right;e.right={type:\"BinaryExpression\",operator:e.operator.replace(/=/,\"\").trim(),left:e.left,right:r},e.operator=\"=\",c(e.left,t,n),c(e.right,t,n)}else c(e.right,t,n);break;case\"UnaryExpression\":e.operator&&m[e.operator]?(e.type=\"CallExpression\",e.callee={type:\"MemberExpression\",computed:!1,object:e.argument,property:{type:\"Identifier\",name:\"+\"===e.operator||\"-\"===e.operator?m[\"u\"+e.operator]:m[e.operator]}},c(e.argument,t,n),e.arguments=[]):c(e.argument,t,n);break;case\"UpdateExpression\":e.operator&&m[e.operator]&&(e.type=\"CallExpression\",e.callee={type:\"MemberExpression\",computed:!1,object:e.argument,property:{type:\"Identifier\",name:m[e.operator]}},c(e.argument,t,n),e.arguments=[]);break;\n//We don't ned to transform following nodes! Phew!\ncase\"Literal\":case\"Identifier\":case\"BlockStatement\":case\"FunctionExpression\":}}", "function token2(r) {\n\t\tfor (var j = 0; j < r.length; j++) {\n\t\t\tif (r[j].match(srr[0], \"g\") && r[j].match(srr[1], \"g\")) {\n\t\t\t\t$('<p>').html(r[j]).appendTo(\"#demo-1\");\n\t\t\t\tscnt++;\n\t\t\t}\n\t\t}\n\t\tsearchql = true;\n\t\thlsSyntax(srr[0]);hlsSyntax(srr[1]);\n\t\tresultCall();\n\t}", "parseAST(AST) {\n // initialize prototype as empty object\n const prototype = {};\n let isQuellable = true;\n\n let operationType;\n\n // initialiaze arguments as null\n let protoArgs = null; //{ country: { id: '2' } }\n \n // initialize stack to keep track of depth first parsing\n const stack = [];\n\n /**\n * visit is a utility provided in the graphql-JS library. It performs a\n * depth-first traversal of the abstract syntax tree, invoking a callback\n * when each SelectionSet node is entered. That function builds the prototype.\n * Invokes a callback when entering and leaving Field node to keep track of nodes with stack\n *\n * Find documentation at:\n * https://graphql.org/graphql-js/language/#visit\n */\n visit(AST, {\n enter(node) {\n if (node.directives) {\n if (node.directives.length > 0) {\n isQuellable = false;\n return BREAK;\n }\n }\n },\n OperationDefinition(node) {\n if (node.operation === \"subscription\") {\n isQuellable = false;\n return BREAK;\n }\n if(node.operation === 'mutation') {\n console.log('we got mutation', node);\n }\n\n },\n Field: {\n enter(node) {\n if (node.alias) {\n isQuellable = false;\n return BREAK; \n }\n if(node.arguments && node.arguments.length > 0) {\n \n protoArgs = protoArgs || {};\n protoArgs[node.name.value] = {};\n \n // collect arguments if arguments contain id, otherwise make query unquellable\n // hint: can check for graphQl type ID instead of string 'id'\n for (let i = 0; i < node.arguments.length; i++) {\n const key = node.arguments[i].name.value;\n const value = node.arguments[i].value.value;\n \n if(!key.includes('id')) {\n isQuellable = false;\n return BREAK;\n }\n protoArgs[node.name.value][key] = value;\n }\n }\n // add value to stack\n stack.push(node.name.value);\n },\n leave(node) {\n // remove value from stack\n stack.pop();\n },\n },\n SelectionSet(node, key, parent, path, ancestors) {\n /* Exclude SelectionSet nodes whose parents' are not of the kind\n * 'Field' to exclude nodes that do not contain information about\n * queried fields.\n */\n if (parent.kind === \"Field\") {\n // loop through selections to collect fields\n const tempObject = {};\n for (let field of node.selections) {\n tempObject[field.name.value] = true;\n }\n\n // loop through stack to get correct path in proto for temp object;\n // mutates original prototype object;\n const protoObj = stack.reduce((prev, curr, index) => {\n return index + 1 === stack.length // if last item in path\n ? (prev[curr] = tempObject) // set value\n : (prev[curr] = prev[curr]); // otherwise, if index exists, keep value\n }, prototype);\n }\n },\n });\n const proto = isQuellable ? prototype : \"unQuellable\";\n //const proto = \"unQuellable\";\n return {proto, protoArgs};\n }", "function TextParser() { }", "function xmlFlow( ast){\n\tvisit( ast, unflowedTest, function( node, parents){\n\n\t\tconsole.log(\"WALK\", node)\n\t\tconst closeTest= closeTests[ lastTag]\n\n\t\tlet values= []\n\t\tfor( let w of walkUntil( node, parents, closeTest)) {\n\t\t\tconsole.log({w})\n\t\t\tvalues.push( w.value)\n\t\t}\n\n\t\tnode.value= values.join(\"\")\n\t\tconsole.log(\"walk over\", node.value)\n\t}, true) // deleteing stuff so start from bottom\n}", "function ast_walker() {\n\tfunction _vardefs( defs ) {\n\t\treturn [ this[0], MAP( defs, function ( def ) {\n\t\t\tvar a = [ def[0] ];\n\t\t\tif ( def.length > 1 ) {\n\t\t\t\ta[1] = walk( def[1] );\n\t\t\t}\n\t\t\treturn a;\n\t\t} ) ];\n\t}\n\n\t;\n\tfunction _block( statements ) {\n\t\tvar out = [ this[0] ];\n\t\tif ( statements != null ) {\n\t\t\tout.push( MAP( statements, walk ) );\n\t\t}\n\t\treturn out;\n\t}\n\n\t;\n\tvar walkers = {\n\t\t\"string\" : function ( str ) {\n\t\t\treturn [ this[0], str ];\n\t\t},\n\t\t\"num\" : function ( num ) {\n\t\t\treturn [ this[0], num ];\n\t\t},\n\t\t\"name\" : function ( name ) {\n\t\t\treturn [ this[0], name ];\n\t\t},\n\t\t\"toplevel\" : function ( statements ) {\n\t\t\treturn [ this[0], MAP( statements, walk ) ];\n\t\t},\n\t\t\"block\" : _block,\n\t\t\"splice\" : _block,\n\t\t\"var\" : _vardefs,\n\t\t\"const\" : _vardefs,\n\t\t\"try\" : function ( t, c, f ) {\n\t\t\treturn [\n\t\t\t\tthis[0],\n\t\t\t\tMAP( t, walk ),\n\t\t\t\tc != null ? [ c[0], MAP( c[1], walk ) ] : null,\n\t\t\t\tf != null ? MAP( f, walk ) : null\n\t\t\t];\n\t\t},\n\t\t\"throw\" : function ( expr ) {\n\t\t\treturn [ this[0], walk( expr ) ];\n\t\t},\n\t\t\"new\" : function ( ctor, args ) {\n\t\t\treturn [ this[0], walk( ctor ), MAP( args, walk ) ];\n\t\t},\n\t\t\"switch\" : function ( expr, body ) {\n\t\t\treturn [ this[0], walk( expr ), MAP( body, function ( branch ) {\n\t\t\t\treturn [ branch[0] ? walk( branch[0] ) : null,\n\t\t\t\t MAP( branch[1], walk ) ];\n\t\t\t} ) ];\n\t\t},\n\t\t\"break\" : function ( label ) {\n\t\t\treturn [ this[0], label ];\n\t\t},\n\t\t\"continue\" : function ( label ) {\n\t\t\treturn [ this[0], label ];\n\t\t},\n\t\t\"conditional\" : function ( cond, t, e ) {\n\t\t\treturn [ this[0], walk( cond ), walk( t ), walk( e ) ];\n\t\t},\n\t\t\"assign\" : function ( op, lvalue, rvalue ) {\n\t\t\treturn [ this[0], op, walk( lvalue ), walk( rvalue ) ];\n\t\t},\n\t\t\"dot\" : function ( expr ) {\n\t\t\treturn [ this[0], walk( expr ) ].concat( slice( arguments, 1 ) );\n\t\t},\n\t\t\"call\" : function ( expr, args ) {\n\t\t\treturn [ this[0], walk( expr ), MAP( args, walk ) ];\n\t\t},\n\t\t\"function\" : function ( name, args, body ) {\n\t\t\treturn [ this[0], name, args.slice(), MAP( body, walk ) ];\n\t\t},\n\t\t\"debugger\" : function () {\n\t\t\treturn [ this[0] ];\n\t\t},\n\t\t\"defun\" : function ( name, args, body ) {\n\t\t\treturn [ this[0], name, args.slice(), MAP( body, walk ) ];\n\t\t},\n\t\t\"if\" : function ( conditional, t, e ) {\n\t\t\treturn [ this[0], walk( conditional ), walk( t ), walk( e ) ];\n\t\t},\n\t\t\"for\" : function ( init, cond, step, block ) {\n\t\t\treturn [ this[0], walk( init ), walk( cond ), walk( step ), walk( block ) ];\n\t\t},\n\t\t\"for-in\" : function ( vvar, key, hash, block ) {\n\t\t\treturn [ this[0], walk( vvar ), walk( key ), walk( hash ), walk( block ) ];\n\t\t},\n\t\t\"while\" : function ( cond, block ) {\n\t\t\treturn [ this[0], walk( cond ), walk( block ) ];\n\t\t},\n\t\t\"do\" : function ( cond, block ) {\n\t\t\treturn [ this[0], walk( cond ), walk( block ) ];\n\t\t},\n\t\t\"return\" : function ( expr ) {\n\t\t\treturn [ this[0], walk( expr ) ];\n\t\t},\n\t\t\"binary\" : function ( op, left, right ) {\n\t\t\treturn [ this[0], op, walk( left ), walk( right ) ];\n\t\t},\n\t\t\"unary-prefix\" : function ( op, expr ) {\n\t\t\treturn [ this[0], op, walk( expr ) ];\n\t\t},\n\t\t\"unary-postfix\" : function ( op, expr ) {\n\t\t\treturn [ this[0], op, walk( expr ) ];\n\t\t},\n\t\t\"sub\" : function ( expr, subscript ) {\n\t\t\treturn [ this[0], walk( expr ), walk( subscript ) ];\n\t\t},\n\t\t\"object\" : function ( props ) {\n\t\t\treturn [ this[0], MAP( props, function ( p ) {\n\t\t\t\treturn p.length == 2\n\t\t\t\t\t? [ p[0], walk( p[1] ) ]\n\t\t\t\t\t: [ p[0], walk( p[1] ), p[2] ]; // get/set-ter\n\t\t\t} ) ];\n\t\t},\n\t\t\"regexp\" : function ( rx, mods ) {\n\t\t\treturn [ this[0], rx, mods ];\n\t\t},\n\t\t\"array\" : function ( elements ) {\n\t\t\treturn [ this[0], MAP( elements, walk ) ];\n\t\t},\n\t\t\"stat\" : function ( stat ) {\n\t\t\treturn [ this[0], walk( stat ) ];\n\t\t},\n\t\t\"seq\" : function () {\n\t\t\treturn [ this[0] ].concat( MAP( slice( arguments ), walk ) );\n\t\t},\n\t\t\"label\" : function ( name, block ) {\n\t\t\treturn [ this[0], name, walk( block ) ];\n\t\t},\n\t\t\"with\" : function ( expr, block ) {\n\t\t\treturn [ this[0], walk( expr ), walk( block ) ];\n\t\t},\n\t\t\"atom\" : function ( name ) {\n\t\t\treturn [ this[0], name ];\n\t\t}\n\t};\n\n\tvar user = {};\n\tvar stack = [];\n\n\tfunction walk( ast ) {\n\t\tif ( ast == null ) {\n\t\t\treturn null;\n\t\t}\n\t\ttry {\n\t\t\tstack.push( ast );\n\t\t\tvar type = ast[0];\n\t\t\tvar gen = user[type];\n\t\t\tif ( gen ) {\n\t\t\t\tvar ret = gen.apply( ast, ast.slice( 1 ) );\n\t\t\t\tif ( ret != null ) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\t\t\t}\n\t\t\tgen = walkers[type];\n\t\t\treturn gen.apply( ast, ast.slice( 1 ) );\n\t\t} finally {\n\t\t\tstack.pop();\n\t\t}\n\t}\n\n\t;\n\n\tfunction dive( ast ) {\n\t\tif ( ast == null ) {\n\t\t\treturn null;\n\t\t}\n\t\ttry {\n\t\t\tstack.push( ast );\n\t\t\treturn walkers[ast[0]].apply( ast, ast.slice( 1 ) );\n\t\t} finally {\n\t\t\tstack.pop();\n\t\t}\n\t}\n\n\t;\n\n\tfunction with_walkers( walkers, cont ) {\n\t\tvar save = {}, i;\n\t\tfor ( i in walkers ) {\n\t\t\tif ( HOP( walkers, i ) ) {\n\t\t\t\tsave[i] = user[i];\n\t\t\t\tuser[i] = walkers[i];\n\t\t\t}\n\t\t}\n\t\tvar ret = cont();\n\t\tfor ( i in save ) {\n\t\t\tif ( HOP( save, i ) ) {\n\t\t\t\tif ( !save[i] ) {\n\t\t\t\t\tdelete user[i];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tuser[i] = save[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}\n\n\t;\n\n\treturn {\n\t\twalk : walk,\n\t\tdive : dive,\n\t\twith_walkers : with_walkers,\n\t\tparent : function () {\n\t\t\treturn stack[stack.length - 2]; // last one is current node\n\t\t},\n\t\tstack : function () {\n\t\t\treturn stack;\n\t\t}\n\t};\n}", "function $96cf0e47cff3d109$var$parser3(hljs) {\n const CURLY_SUBCOMMENT = hljs.COMMENT(/\\{/, /\\}/, {\n contains: [\n \"self\"\n ]\n });\n return {\n name: \"Parser3\",\n subLanguage: \"xml\",\n relevance: 0,\n contains: [\n hljs.COMMENT(\"^#\", \"$\"),\n hljs.COMMENT(/\\^rem\\{/, /\\}/, {\n relevance: 10,\n contains: [\n CURLY_SUBCOMMENT\n ]\n }),\n {\n className: \"meta\",\n begin: \"^@(?:BASE|USE|CLASS|OPTIONS)$\",\n relevance: 10\n },\n {\n className: \"title\",\n begin: \"@[\\\\w\\\\-]+\\\\[[\\\\w^;\\\\-]*\\\\](?:\\\\[[\\\\w^;\\\\-]*\\\\])?(?:.*)$\"\n },\n {\n className: \"variable\",\n begin: /\\$\\{?[\\w\\-.:]+\\}?/\n },\n {\n className: \"keyword\",\n begin: /\\^[\\w\\-.:]+/\n },\n {\n className: \"number\",\n begin: \"\\\\^#[0-9a-fA-F]+\"\n },\n hljs.C_NUMBER_MODE\n ]\n };\n}", "transform(program) {\n var options = AsxFormatter.options(this.file.ast);\n //DefaultFormatter.prototype.transform.apply(this, arguments);\n\n var locals = [];\n var definitions = [];\n var body = [];\n program.body.forEach(item=>{\n switch(item.type){\n case 'ExpressionStatement':\n var exp = item.expression;\n if(exp.type=='Literal' && exp.value.toLowerCase()=='use strict'){\n return;\n }\n break;\n case 'VariableDeclaration':\n item.declarations.forEach(d=>{\n locals.push(d.id);\n });\n break;\n case 'FunctionDeclaration':\n if(item.id.name=='module'){\n item.body.body.forEach(s=>{\n body.push(s);\n })\n return;\n }else\n if(item._class){\n item.id =t.identifier('c$'+item._class);\n body.push(t.expressionStatement(t.callExpression(\n t.memberExpression(\n t.identifier('asx'),\n t.identifier('c$')\n ),[item])));\n return;\n }else{\n locals.push(item.id);\n }\n break;\n }\n body.push(item);\n });\n\n var definer = [];\n\n\n\n if(Object.keys(this.imports).length){\n\n Object.keys(this.imports).forEach(key=>{\n var items = this.imports[key];\n if(items['*'] && typeof items['*']=='string'){\n this.imports[key]=items['*'];\n }\n });\n definer.push(t.property('init',\n t.identifier('imports'),\n t.valueToNode(this.imports)\n ))\n }\n var exports;\n if(this.exports['*']){\n exports = this.exports['*'];\n delete this.exports['*'];\n }\n if(Object.keys(this.exports).length){\n definer.push(t.property('init',\n t.identifier('exports'),\n t.valueToNode(this.exports)\n ))\n }\n if(body.length){\n if(exports){\n var ret = [];\n Object.keys(exports).forEach(key=>{\n var val = exports[key];\n if(typeof val=='string') {\n ret.push(t.property('init',\n t.literal(key), t.identifier(val == '*' ? key : val)\n ))\n }else{\n ret.push(t.property('init',\n t.literal(key), val\n ))\n }\n });\n body.push(t.returnStatement(\n t.objectExpression(ret)\n ));\n }\n var initializer = t.functionExpression(null, [t.identifier('asx')], t.blockStatement(body));\n definer.push(t.property('init',\n t.identifier('execute'),\n initializer\n ))\n }\n definitions.forEach(item=>{\n\n if(item._class){\n definer.push(t.property('init',\n t.literal('.'+item._class),\n item\n ))\n }else{\n definer.push(t.property('init',\n t.literal(':'+item.id.name),\n item\n ))\n }\n\n })\n definer = t.objectExpression(definer);\n\n\n\n /*\n var definer = t.functionExpression(null, [t.identifier(\"module\")], t.blockStatement(body));\n if(options.bind){\n definer = t.callExpression(\n t.memberExpression(\n definer,\n t.identifier(\"bind\")\n ),[\n t.callExpression(t.identifier(\"eval\"),[t.literal(\"this.global=this\")])\n ]\n );\n }*/\n var body = [];\n var definer = util.template(\"asx-module\",{\n MODULE_NAME: t.literal(this.getModuleName()),\n MODULE_BODY: definer\n });\n if(options.runtime){\n var rt = util.template(\"asx-runtime\")\n //rt._compact = true;\n body.push(t.expressionStatement(rt));\n }\n body.push(t.expressionStatement(definer))\n program.body = body;\n }", "function Snippet(e, c, v) {\r\n this.exprType = e || null;\r\n this.content = c || '';\r\n this.iv = null; // introduced variable\r\n this.tail = null; // null or snippet or snippets\r\n this.verbatims = v || []; // acts as source map (not necessarily sorted according to src or target)\r\n this.isSorted = false; // verbatims according to increasing value of 'lo'\r\n this.context = null;\r\n}", "function t(e,n,r){switch(e.type){case\"VariableDeclaration\":e.declarations.forEach(function(e,n){t(e.init,n,r)});break;case\"BinaryExpression\":case\"LogicalExpression\":e.operator&&i[e.operator]?(e.type=\"CallExpression\",e.callee={type:\"MemberExpression\",computed:!1,object:e.right,property:{type:\"Identifier\",name:i[e.operator]}},t(e.left,n,r),t(e.right,n,r),e.arguments=[e.left]):(t(e.left,n,r),t(e.right,n,r));break;case\"ExpressionStatement\":t(e.expression,n,r);break;case\"CallExpression\":e.arguments.forEach(function(e,n){t(e,n,r)});break;case\"AssignmentExpression\":if(e.operator&&i[e.operator]){var o=e.right;e.right={type:\"BinaryExpression\",operator:e.operator.replace(/=/,\"\").trim(),left:e.left,right:o},e.operator=\"=\",t(e.left,n,r),t(e.right,n,r)}else t(e.right,n,r);break;case\"UnaryExpression\":e.operator&&i[e.operator]?(e.type=\"CallExpression\",e.callee={type:\"MemberExpression\",computed:!1,object:e.argument,property:{type:\"Identifier\",name:\"+\"===e.operator||\"-\"===e.operator?i[\"u\"+e.operator]:i[e.operator]}},t(e.argument,n,r),e.arguments=[]):t(e.argument,n,r);break;case\"UpdateExpression\":e.operator&&i[e.operator]&&(e.type=\"CallExpression\",e.callee={type:\"MemberExpression\",computed:!1,object:e.argument,property:{type:\"Identifier\",name:i[e.operator]}},t(e.argument,n,r),e.arguments=[]);break;//We don't ned to transform following nodes! Phew!\ncase\"Literal\":case\"Identifier\":case\"BlockStatement\":case\"FunctionExpression\":}}", "function JavapVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function PythonLikeVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "parseU() {\n\t\tif (this.tid === Parser.OP_ADD) {\n\t\t\tthis.lex();\n\t\t\treturn this.parseV();\n\t\t}\n\t\telse if (this.tid === Parser.OP_SUB) {\n\t\t\tthis.lex();\n\t\t\treturn -this.parseV();\n\t\t}\n\t\telse {\n\t\t\treturn this.parseV();\n\t\t}\n\t}", "parse() {\n if (this.exit) {\n return;\n }\n\n // Looks for a goto in the value statement\n if (Util.isString(this._value)\n && this._value.includes(\" goto \")) {\n const gotoRegex = /(.*) goto (.*)/i;\n const matchArray = this._value.match(gotoRegex);\n if (matchArray.length === 2) {\n throw ParserError.interactionError(this.interaction,\n \"Invalid goto - does not have label: \" + this._value,\n this.lineNumber);\n } else if (matchArray.length === 3) {\n this._value = matchArray[1];\n this._goto = matchArray[2];\n }\n }\n }", "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new ast[\"b\" /* Token */](TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = body.charCodeAt(pos); // SourceCharacter\n\n switch (code) {\n // !\n case 33:\n return new ast[\"b\" /* Token */](TokenKind.BANG, pos, pos + 1, line, col, prev);\n // #\n\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n\n case 36:\n return new ast[\"b\" /* Token */](TokenKind.DOLLAR, pos, pos + 1, line, col, prev);\n // &\n\n case 38:\n return new ast[\"b\" /* Token */](TokenKind.AMP, pos, pos + 1, line, col, prev);\n // (\n\n case 40:\n return new ast[\"b\" /* Token */](TokenKind.PAREN_L, pos, pos + 1, line, col, prev);\n // )\n\n case 41:\n return new ast[\"b\" /* Token */](TokenKind.PAREN_R, pos, pos + 1, line, col, prev);\n // .\n\n case 46:\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new ast[\"b\" /* Token */](TokenKind.SPREAD, pos, pos + 3, line, col, prev);\n }\n\n break;\n // :\n\n case 58:\n return new ast[\"b\" /* Token */](TokenKind.COLON, pos, pos + 1, line, col, prev);\n // =\n\n case 61:\n return new ast[\"b\" /* Token */](TokenKind.EQUALS, pos, pos + 1, line, col, prev);\n // @\n\n case 64:\n return new ast[\"b\" /* Token */](TokenKind.AT, pos, pos + 1, line, col, prev);\n // [\n\n case 91:\n return new ast[\"b\" /* Token */](TokenKind.BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n\n case 93:\n return new ast[\"b\" /* Token */](TokenKind.BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n\n case 123:\n return new ast[\"b\" /* Token */](TokenKind.BRACE_L, pos, pos + 1, line, col, prev);\n // |\n\n case 124:\n return new ast[\"b\" /* Token */](TokenKind.PIPE, pos, pos + 1, line, col, prev);\n // }\n\n case 125:\n return new ast[\"b\" /* Token */](TokenKind.BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n\n case 34:\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev, lexer);\n }\n\n return readString(source, pos, line, col, prev);\n }\n\n throw syntaxError(source, pos, unexpectedCharacterMessage(code));\n}" ]
[ "0.64005315", "0.6324929", "0.61906564", "0.61600363", "0.6058125", "0.6037482", "0.59242666", "0.5916055", "0.5916055", "0.5899561", "0.5895922", "0.585676", "0.5844705", "0.58376455", "0.57688576", "0.57358545", "0.56623256", "0.5647107", "0.5641289", "0.5636529", "0.5611772", "0.5604846", "0.55969125", "0.55817366", "0.557902", "0.557902", "0.5577983", "0.5567733", "0.5567134", "0.55645996", "0.55529296", "0.5550347", "0.5541258", "0.55327773", "0.5532508", "0.55281997", "0.55250394", "0.552238", "0.552238", "0.552238", "0.55044013", "0.5490355", "0.54874223", "0.5487064", "0.54856163", "0.5482623", "0.54596895", "0.54541963", "0.5446715", "0.5438974", "0.5432062", "0.5400204", "0.5397692", "0.53968304", "0.53918684", "0.53898895", "0.53825897", "0.53760546", "0.5373178", "0.5367117", "0.5364815", "0.5354954", "0.5349325", "0.5347317", "0.53448373", "0.53421855", "0.5330296", "0.53253675", "0.5324156", "0.53238547", "0.5322045", "0.5319627", "0.5306607", "0.5295014", "0.52839494", "0.5272989", "0.5271007", "0.52655095", "0.52639663", "0.5262594", "0.5261637", "0.5257827", "0.5257827", "0.5249473", "0.5243838", "0.5236097", "0.5231066", "0.5221082", "0.5217485", "0.52168804", "0.52154636", "0.5210972", "0.52071536", "0.5206465", "0.5202477", "0.51993626", "0.51975083", "0.5181528", "0.5179225", "0.5178691" ]
0.62212044
2
Thanks to Stack overflow
function isOneChecked(radioname) { // All <input> tags... var chx = document.getElementsByName(radioname); for (var i=0; i<chx.length; i++) { // If you have more than one radio group, also check the name attribute // for the one you want as in && chx[i].name == 'choose' // Return true from the function on first match of a checked item if (chx[i].type == 'radio'&& chx[i].checked) { return true; } } // End of the loop, return false return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "static private internal function m121() {}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "transient private internal function m185() {}", "static final private internal function m106() {}", "transient final protected internal function m174() {}", "transient final private internal function m170() {}", "static transient final private internal function m43() {}", "static private protected internal function m118() {}", "static transient private protected internal function m55() {}", "static transient final protected internal function m47() {}", "transient private protected public internal function m181() {}", "function Hx(a){return a&&a.ic?a.Mb():a}", "static transient private internal function m58() {}", "transient final private protected internal function m167() {}", "static transient final private protected internal function m40() {}", "static transient final protected public internal function m46() {}", "static private protected public internal function m117() {}", "obtain(){}", "static transient private public function m56() {}", "static transient private protected public internal function m54() {}", "__previnit(){}", "transient private public function m183() {}", "static private public function m119() {}", "static protected internal function m125() {}", "function o0(stdlib,o1,buffer) {\n try {\nthis.o559 = this.o560;\n}catch(e){}\n var o2 = o254 = [].fround;\n //views\n var charCodeAt =new Map.prototype.keys.call(buffer);\n\n function o4(){\n var o5 = 0.5\n var o35 = { writable: false, value: 1, configurable: false, enumerable: false };\n try {\no849 = o6;\n}catch(e){}\n try {\nreturn +(o0[o1])\n}catch(e){}\n }\n try {\nreturn o4;\n}catch(e){}\n}", "static final private protected internal function m103() {}", "transient final private protected public internal function m166() {}", "function e(){return [0,0,0,1]}", "function findCanonicalReferences() {\n\n }", "function _____SHARED_functions_____(){}", "static transient final private protected public internal function m39() {}", "function y(e){let t=R,n=D,r=j,s=v,i=M,o=B,a=_,u=new Uint8Array(x.slice(0,R)),d=E,c=E.slice(0,E.length),g=F,l=Y,p=e();return R=t,D=n,j=r,v=s,M=i,B=o,_=a,x=u,Y=l,E=d,E.splice(0,E.length,...c),F=g,P=new DataView(x.buffer,x.byteOffset,x.byteLength),p}", "function _0x329edd(_0x38ef9f){return function(){return _0x38ef9f;};}", "lowX() {return this.stringX()}", "static transient final protected function m44() {}", "stat() {\n var atts = [];\n var char = activeCharacter2();\n for (var key in char) {\n var obj = char[key];\n for (var prop in obj) {\n atts.push({key : prop, prop: obj[prop]});\n };\n };\n return atts;\n }", "static transient final private public function m41() {}", "_firstRendered() { }", "get Alpha1() {}", "function o1109()\n{\n var o1 = {};\n var o2 = \"aabccddeeffaaggaabbaabaabaab\".e(/((aa))/);\n try {\nfor(var o3 in e)\n { \n try {\nif(o4.o11([7,8,9,10], o109, \"slice(-4) returns the last 4 elements - [7,8,9,10]\"))\n { \n try {\no4.o5(\"propertyFound\");\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n try {\nreturn o2;\n}catch(e){}\n}", "function l(e){var n={};return me.each(e.match(Ae)||[],function(e,t){n[t]=!0}),n}", "function ze(a){return a&&a.ae?a.ed():a}", "static final private public function m104() {}", "lastUsed() { }", "function Transform$7() {}", "static transient protected internal function m62() {}", "get Alpha0() {}", "function undici () {}", "function a(e){return void 0===e&&(e=null),Object(r[\"p\"])(null!==e?e:i)}", "static get END() { return 6; }", "function o0(stdlib,o1,buffer) {\n try {\no8[4294967294];\n}catch(e){}\n function o104(o49, o50, o73) {\n try {\no95(o49, o50, o73, this);\n}catch(e){}\n\n try {\no489.o767++;\n}catch(e){}\n\n try {\nif (o97 === o49) {\n try {\nreturn true;\n}catch(e){}\n }\n}catch(e){}\n\n try {\nreturn false;\n}catch(e){}\n };\n //views\n var o3 =this;\n\n function o4(){\n var o30\n var o6 = o2(1.5);\n try {\no3[1] = o6;\n}catch(e){}\n try {\nreturn +(o3[1])\n}catch(e){}\n }\n try {\nreturn o4;\n}catch(e){}\n}", "function TMP(){return;}", "function TMP(){return;}", "static final private protected public internal function m102() {}", "function nd(){}", "get Alpha7() {}", "get _physicalEnd(){return(this._physicalStart+this._physicalCount-1)%this._physicalCount;}", "static final protected internal function m110() {}", "transient final private public function m168() {}", "get_index_bin() {\n // the name, the id.\n // make xas2 capable of storing a string and showing how long it is?\n // incrementors themselves - global prefix of 0 (MAGIC NUMBER)\n // the incrementors index will have a global prefix of 1. (MAGIC NUMBER)\n // returns an array containing pairs (nested array)\n // Need to get the key as a buffer.\n\n // prefix space 1, index number 0 within incrementor indexes, name, incrementor id\n\n //var arr_idx_key = [1, 0, this.name, this.id];\n var arr_idx_key = [this.name, this.id];\n var buf_key = encode_to_buffer(arr_idx_key, 1, 0);\n //console.log('buf_key', buf_key);\n var res = [\n [buf_key, null]\n ];\n //console.log('res', res);\n //throw 'stop';\n return res;\n\n }", "static get elvl_info() {return 0;}", "function l(){t={},u=\"\",w=\"\"}", "function re(a,b){this.O=[];this.za=a;this.la=b||null;this.J=this.D=!1;this.H=void 0;this.ha=this.Fa=this.S=!1;this.R=0;this.Ef=null;this.N=0}", "getBone4cc(b) {\nreturn this.bone4cc[b];\n}", "function Zc(a){a=a.Xb();for(var b=[],c=[],d=0;d<a.length;d++){var e=a[d].Zg;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort($c);b.sort($c);return[c,b]}", "function yd(a){var b;q&&(b=a.bh());var c=u(\"xml\");a=xc(a,!0);for(var d=0,e;e=a[d];d++){var h=zd(e);e=e.fb();h.setAttribute(\"x\",q?b-e.x:e.x);h.setAttribute(\"y\",e.y);c.appendChild(h)}return c}", "function miFuncion (){}", "function comportement (){\n\t }", "function wR(a,b){this.Fb=[];this.HF=a;this.YE=b||null;this.Pq=this.un=!1;this.ai=void 0;this.Gz=this.AK=this.ez=!1;this.uu=0;this.cb=null;this.az=0}", "static transient final private protected public function m38() {}", "apply () {}", "function ed(a){a=a.tc();for(var b=[],c=[],d=0;d<a.length;d++){var e=a[d].cA;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort(fd);b.sort(fd);return[c,b]}", "function bc(){for(var a=B.Za(),b=[],c=[],d=0;d<a.length;d++){var e=a[d].Hf;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort(cc);b.sort(cc);return[c,b]}", "get _physicalEnd(){return(this._physicalStart+this._physicalCount-1)%this._physicalCount}", "function t(e,n){return{start:e.start,end:e.end,index:n}}", "get Alpha9() {}", "getBoneIndex(fourcc) {\nreturn this.boneIndicesBy4CC[fourcc];\n}", "function t(e,a){return{start:e.start,end:e.end,index:a}}", "function grabEBI(id){ return tf_Id(id); }", "function dd(a){a=a.ob();for(var b=[],c=[],d=0;d<a.length;d++){var e=a[d].Lf;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort(ed);b.sort(ed);return[c,b]}", "size() { return 1; }", "function o1084(o1)\n{\n try {\nfor (var o2 in o1)\n {\n try {\no3.o4(o2 + \" = \" + o1[o2]);\n}catch(e){}\n }\n}catch(e){}\n}", "getBoneBy4CC(fourcc) {\nreturn this.bones[this.boneIndicesBy4CC[fourcc]];\n}", "get Alpha2() {}", "function Zt(e,t,a,n,r){t.before&&(a=-1);var f,o=a+(n||\"\");return t.cache.hasOwnProperty(o)?f=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(jt(e,t.view,t.rect),t.hasHeights=!0),f=Yt(e,t,a,n),f.bogus||(t.cache[o]=f)),{left:f.left,right:f.right,top:r?f.rtop:f.top,bottom:r?f.rbottom:f.bottom}}", "size(){ return this.end-this.start }", "function i(e,t){return t}", "value() {return 0}", "function boyer_moore_horspool(raw, templ) {\n\tvar indexes = [];\n\tvar stop_table = {};\n\tvar t_len = templ.length;\n\tvar start_offset = 0;\n\tvar curr_substr = '';\n\tfor(var i = 0; i < t_len - 1; i++) {\n\t\tstop_table[templ[i]] = t_len - i - 1;\n\t}\n\t//console.log(stop_table);\n\twhile(true) {\n\t\tcurr_substr = raw.substr(start_offset, t_len);\n\t\t//console.log(curr_substr, start_offset, t_len);\n\t\tif(curr_substr === templ)\n\t\t\tindexes.push(start_offset)\n\t\tif(start_offset + t_len > raw.length)\n\t\t\tbreak\n\t\tlsymb = curr_substr[curr_substr.length-1]\n\t\tstart_offset += stop_table[lsymb]? stop_table[lsymb] : t_len;\n\t}\n\treturn indexes\n}", "function oi(a){this.Of=a;this.rg=\"\"}", "function l$1(e,t,r,s){s[r]=[t.length,t.length+e.length],e.forEach((e=>{t.push(e.geometry);}));}", "function o0(o1)\n{\n var o2 = -1;\n try {\nfor (var o259 = 0; o3 < o1.length; function (o502, name, o38, o781, o782, o837, o585, o838, o549) {\n try {\no839.o468();\n}catch(e){}\n // TODO we should allow people to just pass in a complete filename instead\n // of parent and name being that we just join them anyways\n var o840 = name ? o591.resolve(o591.o592(o502, name)) : o502;\n\n function o841(o842) {\n function o843(o842) {\n try {\nif (!o838) {\n try {\no474.o800(o502, name, o842, o781, o782, o549);\n}catch(e){}\n }\n}catch(e){}\n try {\nif (o837) try {\no837();\n}catch(e){}\n}catch(e){}\n try {\no334('cp ' + o840);\n}catch(e){}\n }\n var o844 = false;\n try {\nModule['preloadPlugins'].forEach(function (o845) {\n try {\nif (o844) try {\nreturn;\n}catch(e){}\n}catch(e){}\n try {\nif (o845['canHandle'](o840)) {\n try {\no845['handle'](o842, o840, o843, function () {\n try {\nif (o585) try {\no585();\n}catch(e){}\n}catch(e){}\n try {\no334('cp ' + o840);\n}catch(e){}\n });\n}catch(e){}\n try {\no844 = true;\n}catch(e){}\n }\n}catch(e){}\n });\n}catch(e){}\n try {\nif (!o844) try {\no843(o842);\n}catch(e){}\n}catch(e){}\n }\n try {\no332('cp ' + o840);\n}catch(e){}\n try {\nif (typeof o38 == 'string') {\n try {\no839.o846(o38, function (o842) {\n try {\no841(o842);\n}catch(e){}\n }, o585);\n}catch(e){}\n } else {\n try {\no841(o38);\n}catch(e){}\n }\n}catch(e){}\n })\n {\n try {\nif (o1[o3] == undefined)\n {\n try {\nif (o2 == -1)\n {\n try {\no2 = o3;\n}catch(e){}\n }\n}catch(e){}\n }\n else\n {\n try {\nif (o2 != -1)\n {\n try {\no4.o5(o2 + \"-\" + (o3-1) + \" = undefined\");\n}catch(e){}\n try {\no2 = -1;\n}catch(e){}\n }\n}catch(e){}\n try {\no4.o5(o3 + \" = \" + o1[o3]);\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n}", "function TMP() {\n return;\n }", "function gatherStrings(obj) {\n\n}", "extractSlice(requestedOrientation,index){\n\n }", "function e$1(){return [1,0,0,0,1,0,0,0,1]}", "function X(){!function(t){$[W++]^=255&t,$[W++]^=t>>8&255,$[W++]^=t>>16&255,$[W++]^=t>>24&255,W>=J&&(W-=J)}((new Date).getTime())}" ]
[ "0.6451393", "0.6211462", "0.6123348", "0.5964502", "0.5797353", "0.56459343", "0.5625277", "0.5573363", "0.5535185", "0.5443656", "0.5442566", "0.5416472", "0.5379307", "0.52987903", "0.5296901", "0.52901995", "0.52729225", "0.5242841", "0.51962465", "0.5149347", "0.5148757", "0.504919", "0.503036", "0.5022774", "0.49790213", "0.496861", "0.49598646", "0.4940904", "0.49143133", "0.49030226", "0.4892984", "0.4884572", "0.48632872", "0.48549756", "0.48543534", "0.48462474", "0.4836547", "0.48315316", "0.48287156", "0.48203215", "0.48130396", "0.4812507", "0.48096627", "0.47959056", "0.47909704", "0.47888854", "0.478406", "0.47821483", "0.47768366", "0.47700974", "0.47645414", "0.47538614", "0.47524405", "0.47495717", "0.47464177", "0.47438613", "0.47438613", "0.47368816", "0.47365266", "0.473419", "0.47279084", "0.47260883", "0.47203258", "0.4718953", "0.4717295", "0.47164583", "0.4687634", "0.46831286", "0.4678943", "0.4677055", "0.46750376", "0.4666735", "0.46663305", "0.4665679", "0.4644698", "0.46442428", "0.4631964", "0.46302342", "0.46291038", "0.4627624", "0.4616978", "0.4616925", "0.4612146", "0.4611516", "0.45995265", "0.45942625", "0.459148", "0.45905644", "0.45895958", "0.4585062", "0.4585061", "0.45829388", "0.45742467", "0.4569342", "0.45685512", "0.45610756", "0.45596203", "0.4555176", "0.45548704", "0.455409", "0.45523584" ]
0.0
-1
var reverseEntireSentence = reverseBySeparator(string, ""); // var reverseEachWord = reverseBySeparator(reverseEntireSentence, " ");
function reverseBySeparator(string, separator) { return string .split(separator) .reverse() .join(separator) .replace(/[^A-Za-z 0-9]/gi, ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reverseEachWord(str, separator){\n\n return str.split(separator).reverse().join(separator);\n\n}", "function reverseSentence(string) {\n return console.log(string.split(' ').reverse().join(''));\n}", "function wordReverse(string) {\n var split = string.split(\" \");\n return split.reverse();\n}", "function reverseInPlace(str){\n ///split by space, reverse words, join back together with a space, split reversed words again, reverse words back to their original position, rejoin to make strings\n return str.split(' ').reverse().join(' ').split('').reverse().join('')\n}", "function reverse(string){\n return string.split(\"\").reverse().join(\"\");\n}", "function reverseWords_V2(str){\n return str.split(' ').reverse().join(' ');\n}", "function reverse(s){\r\n return s.split(\"\").reverse().join(\"\");\r\n}", "function wordReverse(stringofwords){\n\n var str = stringofwords;\n\nvar splitted1 = (str.split(\" \").reverse().join(\" \"));\n\n return (splitted1);\n\n}", "function reverse(s){\n return s.split(\"\").reverse().join(\"\");\n}", "function reverseWordsInPlace(str){\nreturn str.split(' ').reverse('').join(' ').split('').reverse('').join('');\n}", "function reverse(word) {\n var splitReverse = word.split(\"\");\n var wordReverse = splitReverse.reverse();\n result = wordReverse.join('');\n console.log(result);\n\n\n}", "function reverseSentence (sent) {\n return sent.split(' ').reverse().join(' ');\n}", "function reverseString(stringofwords){\n\n var str = stringofwords;\n\nvar splitted1 = (str.split(\"\").reverse().join(\"\"));\n\n console.log (splitted1);\n\n}", "function reverse(string){\n return string.split('').reverse().join('')\n}", "function reverseWords(str) {\nreturn str\n.split('')\n.reverse()\n.join('')\n.split(' ')\n.reverse()\n.join(' ');\n\n}", "function reversedString(string){\n \n console.log('Entered Word: ', string);\n\n var splitString = string.split(\" \")\n \n var reverseArray = splitString.reverse(); \n \n var joinArray = reverseArray.join(\" \"); \n \n document.querySelector('#display-string').innerText = joinArray;\n}", "function reverse(s){\n return s.split('').reverse().join('');\n}", "function f(str) {\n\n let splitStr = str.split(\"\");\n splitStr.reverse();\n return splitStr.join(\"\")\n\n\n}", "function reverseWords(str){\n return str.split(' ').reverse().join(' ');\n}", "function reverseWords(str){\n return str.split(' ').reverse().join(' ');\n}", "function reverseWords(string){\n\treturn string.split(\" \").reverse().join(\" \")\n}", "function reverseSentence(string){\n try {\n string.split(\" \");\n }\n catch(err) {\n throw \"The correct object was not passed\";\n }\n let split = string.split(\" \");\n let reverse = [];\n let reverseStr = \"\";\n for(let i = 0; i < split.length; i++){\n reverse[(split.length-1)-i] = split[i];\n }\n reverseStr = reverse.join(\" \");\n reverseStr.trim();\n return reverseStr;\n}", "function reverse(str){\r\n return str.split(\"\").reverse().join(\"\");\r\n}", "function reverse(sen) {\nreturn sen.split(\"\").reverse().join(\"\");\n}", "function reverseWords2(str) {\n return str.split(' ').reverse().join(' ');\n}", "function reversal(str) {\n\n// create variables to name split, reverse and join\n let splitString = str.split(\"\");\n let reverseArr = splitString.reverse();\n let joinArr = reverseArr.join(\"\");\n\n document.getElementById(\"output\").innerHTML = str.split(\"\").reverse().join(\"\");\n\n}", "function reverse(str){\n return str.split(\"\").reverse().join(\"\");\n}", "function reverse(string) {\n return string.split(\"\").reverse().join(\"\")\n}", "function reverse(string){\n \"use strict\";\n return string.split(\"\").reverse().join(\"\")\n}", "function reverseString(string){\n \n return string.split(\"\").reverse().join(\"\")\n \n}", "function reverse(string) {\n let splitString = string.split('');\n let reverseArray = splitString.reverse();\n let joinArray = reverseArray.join('');\n\n console.log(joinArray);\n}", "function reverse(str){\n //TODO\n var arr = str.split(' ');\n return arr.reverse().join(' ');\n}", "function reverseWords(str) {\n return str.split(\" \").reverse();\n}", "function reverseWords(s) {\n //to array\n s = s.split(' ');\n\n //return flipped array as a string\n return flip(s);\n\n //recursive flip-flop\n function flip(arr) {\n return arr.length == 1 ? arr[0] : arr[arr.length -1] + ' ' + flip(arr.slice(0,arr.length-1));\n }\n}", "function reverseWords(str){\n let reversed = str.split(' ').reverse().join(' ');\n return reversed\n}", "function reverseInPlace(str) {\n return str\n .split(\" \")\n .reverse()\n .join(\" \")\n .split(\"\")\n .reverse()\n .join(\"\");\n}", "function reverse(string){\n var words = string.split(' ')\n var result = ''\n for (var i=words.length-1; i>=0; i--) {\n result += words[i]\n if (i>0) {\n result += ' '\n }\n }\n return result\n}", "function reverser(sentence){\n return sentence.split(' ').map(word => word.split('').reverse()).join(' ').replace(/,/g,'')\n}", "function reverse(str){\n return str.split(' ').map((a, i) => i % 2 ? a.split('').reverse().join('') : a).join(' ').trim();\n}", "function reverseWords(s){\n const words = s.split(' ')\n for(let i=0; i<words.length/2; i++){\n const temp = words[i]\n words[i] = words[words.length-i-1]\n words[words.length-i-1] = temp\n }\n return words.join(' ')\n}", "function reverseString(s){\r\n return s.split(\"\").reverse().join(\"\");\r\n}", "function reverse2(str) {\n return str.split('').reverse().join('')\n}", "function reverse(string) {\n return string.split(\"\").reverse().join(\"\");\n}", "function reverseWords(str) {\n return str.split(\"\").reverse().join(\"\").split(\" \").reverse().join(\" \");\n}", "function reverse(phrase){\n \"use strict\";\n\n return phrase.split('').reverse().join('');\n}", "function reverse(string) {\n let split = \"\"\n split = string.split('').reverse().join('')\n return split\n}", "function reverse(string) {\n return string.split('').reverse().join('')\n}", "function reverseString(str) {\n let splitedArr = str.split(\"\");\n //console.log(splitedArr);\n let reversed = splitedArr.reverse();\n let joined = reversed.join(\"\");\n\n return joined;\n}", "function reverseWords(str) {\r\n\r\n var stringArray = str.split('');\r\n console.log(stringArray);\r\n var newStringArray = stringArray.reverse();\r\n console.log(newStringArray);\r\n var revString = newStringArray.join(\"\");\r\n\r\n return revString;\r\n}", "function reverseWord(string){\n\n}", "function reverse (word) {\n return word.split('').reverse().join('')\n}", "function FirstReverse(str) { \n\n // code goes here \n var splitString = str.split(\"\");\n var reverseArray = splitString.reverse();\n var joinArray = reverseArray.join(\"\");\n console.log(joinArray); \n}", "function reverseWords(str){\n var newstring = str.split(\" \")\n return newstring.reverse().join(\" \")\n // return str; // reverse those words\n \n }", "function reverse(input) {\n var reversed = input.split(\"\").reverse().join(\"\");\n return reversed;\n}", "function reverse(string) {\r\n\treturn string.split('').reverse().join('');\r\n}", "function reverseWord(s) {\n let t = s.split('').reverse().join('');\n return t.split(' ').reverse().join(' ');\n}", "function reverse(str) {\n return str.split(\"\").reverse().join(\"\")\n}", "function FirstReverse(str) { \nvar splitMe = str.split(\"\"); //split individual string characters into array\nvar reverseMe = splitMe.reverse(); //reverse the array\nvar joinMe = reverseMe.join(\"\"); //join the array back into one string\nreturn joinMe; \n}", "function reverse(s) {\n \"use strict\";\n return (s).split(\"\").reverse().join(\"\");\n\n //...\n}", "function reverseWord(str) {\n return str.split(\"\").reverse().join(\"\");\n}", "function reverseMethod(string) {\r\n return [...string].reverse().join('');\r\n}", "function reverseString(input) {\n // split at each index, create array, reverse array, join at each index\n let revesredInput = input.split(\"\").reverse().join(\"\");\n}", "function reverseString() {\n \n let sentence = prompt(\"Enter your sentence: \");\n let arr = sentence.split('');\n arr = arr.reverse();\n arr = arr.join('');\n console.log(arr);\n}", "function reverseWord(sentence) {\n return sentence\n .split(\" \")\n .map(function (word) {\n return word.split(\"\").reverse().join(\"\");\n })\n .join(\" \");\n}", "function reverseWords(str) {\n return str.split(\" \").map(x=>x.split(\"\").reverse().join(\"\")).join(\" \");\n}", "function reverse(str) {\n return str.split(\"\").reverse().join(\"\");\n}", "function reverse(s) {\n \"use strict\";\n return s.split('').reverse().join('');\n}", "function f(str) {\n for(var i = 0; i<=str.length;i++){\n return str.split(\"\").reverse().join(\"\");\n }\n}", "function reverseString(string){\n let splitString = string.split(\" \");\n let reverseArray = splitString.reverse();\n let joinArray = reverseArray.join(' ');\n splitString = joinArray.split(\"\");\n reverseArray = splitString.reverse();\n joinArray = reverseArray.join('');\n return joinArray;\n}", "function reverseWord(word) {\n return word.split(\"\").reverse().join(\"\");\n}", "function reverse(x){\n return x.split('').reverse().join('')\n}", "function reverseSentence(string) {\n var inputSentence = process.argv[2] // NOTE: Sentence argument must be in quotes. \n inputSentenceArray = inputSentence.split(\" \");\n console.log(inputSentenceArray);\n reversedSentenceArray = inputSentenceArray.reverse();\n console.log(reversedSentenceArray);\n reversedSentenceResult = reversedSentenceArray.join(\" \");\n return console.log(reversedSentenceResult);\n }", "function reverseSentence(string) {\n var inputSentence = process.argv[2] // NOTE: Sentence argument must be in quotes. \n inputSentenceArray = inputSentence.split(\" \");\n console.log(inputSentenceArray);\n reversedSentenceArray = inputSentenceArray.reverse();\n console.log(reversedSentenceArray);\n reversedSentenceResult = reversedSentenceArray.join(\" \");\n return console.log(reversedSentenceResult);\n }", "function reverseSentence(string) {\n var inputSentence = process.argv[2] // NOTE: Sentence argument must be in quotes. \n inputSentenceArray = inputSentence.split(\" \");\n console.log(inputSentenceArray);\n reversedSentenceArray = inputSentenceArray.reverse();\n console.log(reversedSentenceArray);\n reversedSentenceResult = reversedSentenceArray.join(\" \");\n return console.log(reversedSentenceResult);\n }", "function reverse(string) {\n\treturn string.split(\"\").reverse().join(\"\");\n}", "function reverse(phrase){\n \"use strict\";\n\n return phrase.split('').reverse().join('');\n }", "function reverseEachWord(str) {\n return str.split(' ').map(function (word) {\n return word.split('').reverse().join('');\n }).join(' ');\n}", "function FirstReverse(str) {\n\n let splitString = str.split(\"\");\n\n let reverseArray = splitString.reverse();\n\n let joinArray = reverseArray.join();\n\n let str = joinArray;\n // code goes here \n return str;\n\n}", "function reverse(str) {\n return str\n .split('')\n .reverse()\n .join('');\n}", "function reverseString(s) {\n try {\n s = s.split(\"\").reverse();\n console.log(s.join(\"\"));\n } catch (err){\n console.log(\"s.split is not a function\\n\" + s);\n }\n}", "function reverse(str) {\n return str.split(\"\").reverse().join(\"\");\n}", "function reverse(str) {\n return str.split(\"\").reverse().join(\"\");\n}", "function reverse(str) {\n return str.split(\"\").reverse().join(\"\");\n}", "function reverseWords(string) {\n var newString = string.split(' ');\n return newString.map(reverse).join(' ');\n}", "function reverseWords(str){\n let sentence=''\n for(let i=0;i<str.length;i++){\n sentence = sentence + str[(str.length-1)-i]\n }\n return sentence\n}", "function reverseString(s) {\n try{\n s.split(\"\");\n }\n catch(err){\n console.log(err.message);\n console.log(s); \n }\n s=s.split(\"\");\n s=s.reverse(); \n s=s.join(\"\");\n console.log(s); \n}", "function flipWords(backwardCase){\n\n let sentence = \"\";\n let separate = backwardCase.split(\"\");\n \n for (let i = separate.length - 1; i >= 0; i--){\n if (separate[i].length >= 1){\n sentence += separate[i].split(\"\").reverse(\"\").join(\"\");\n }\n\n else {\n sentence += \"\" + separate[i];\n }\n }\n return sentence;\n }", "function reverse(string){\n //split string\n var splitstring = string.split('');\n console.log(splitstring)\n //initialize versedstring\n var reversed = [];\n //loop through the string\n for(var i = splitstring.length - 1; i >= 0; i--){\n //reverse each char\n reversed.push(splitstring[i])\n }\n //return reversedstring\n return reversed.join('');\n}", "function reverseFun(str) {\n const reverseArray = str.split('');\n console.log(reverseArray);\n reverseArray.reverse();\n return reverseArray.join('');\n}", "function reverseString(S){\n return S.split(\"\").reverse().join(\"\");\n}", "function reverseWords(str) {\n return str.split(' ').map((e)=>{\n return e.split('').reverse().join('');\n }).join(' ')\n}", "function reverseEach(str) {\n let arr = str.split(\" \");\n console.log(arr);\n let newStr = \"\";\n for (let i = 0; i < arr.length; i++) {\n newStr +=\n i === arr.length - 1\n ? `${arr[i].split(\"\").reverse().join(\"\")}`\n : `${arr[i].split(\"\").reverse().join(\"\")} `;\n }\n return newStr;\n}", "function reverseWords(string) {\n //split string into each word\n var newstring = string.split(' '); \n console.log(newstring);\n //create variable to store reversed words\n var reversedWords = [];\n //loop through each word\n for(var i = 0; i < newstring.length; i++){\n //add reversed word to reversedWords variable\n reversedWords.push(reverse(newstring[i]));\n }\n //return reversed words.join()\n return reversedWords.join(' ');\n}", "function reverse(str) {\r\n return str.split('').reverse().join('');\r\n}", "function reverseWordOrder(str) {\n let newStr = str.split(\" \").reverse().join(\" \");\n return newStr;\n}", "function reverseWords(str){\n let result = \"\";\n //let words = str.split();\n let arrayString = str.split(\" \");\n \n for (let i = arrayString.length - 1; i >= 0; i--) {\n result = result + arrayString[i] + \" \";\n }\n\n return result.trim();\n}", "function reverseWords(x){\n return x.toString().split(\" \").reverse().join(\" \");\n }", "function reverseEachWord(str) {\n // YOUR CODE HERE\n \n str = str.split(\"\").reverse().join(\"\");\n return str;\n // reverseStr = \"\";\n // for (i = 0; i <= str.length - 1; i++) {\n // reverseStr += \" \";\n // let world = str[i].reverse();\n // reverseStr += str[i].split(\"\").reverse() + \" \";\n // for (j = world.length - 1; j >= 0; j--) {\n // // console.log('world ',world[j]);\n // reverseStr = reverseStr + world[j];\n // }\n // }\n // return reverseStr;\n}", "function reverseString(s) {\n try {\n var splitString = s.split('');\n\n var reverseArray = splitString.reverse();\n\n var joinArray = reverseArray.join('');\n\n return joinArray;\n } catch (e) {\n console.log(e.message);\n console.log(s);\n }\n}", "function reverse(x){\n y = x.split(\"\")\n console.log(y.reverse().join(\"\"))\n}" ]
[ "0.8212599", "0.8085617", "0.7956091", "0.7836381", "0.7783865", "0.7766943", "0.7732637", "0.76943046", "0.76894647", "0.76846766", "0.76825017", "0.7667559", "0.765865", "0.76264715", "0.76060116", "0.75921994", "0.7589852", "0.75869846", "0.7585202", "0.7585202", "0.75781244", "0.756077", "0.75475925", "0.7543385", "0.7537806", "0.7532732", "0.74898386", "0.7471632", "0.7469579", "0.7457119", "0.74455273", "0.74437386", "0.74394804", "0.7439205", "0.7438417", "0.743743", "0.7425488", "0.7415119", "0.7408856", "0.7405943", "0.73905087", "0.73812455", "0.7361186", "0.7350608", "0.7349562", "0.734396", "0.7339856", "0.73355544", "0.73271817", "0.732279", "0.73203206", "0.7317801", "0.7317614", "0.73123884", "0.7304973", "0.73036104", "0.73033726", "0.72955966", "0.7290006", "0.7288766", "0.7279701", "0.727071", "0.72637314", "0.72587335", "0.725801", "0.72548884", "0.72485733", "0.7233484", "0.7232553", "0.7231969", "0.72283983", "0.7220333", "0.7220333", "0.7220333", "0.7211293", "0.72073156", "0.72055984", "0.7203971", "0.719988", "0.71974194", "0.71956396", "0.71956396", "0.71956396", "0.7190094", "0.71840036", "0.7173916", "0.71703666", "0.716403", "0.71579367", "0.7157236", "0.7153755", "0.7153754", "0.71518475", "0.7147904", "0.71475077", "0.7130371", "0.7124602", "0.7123244", "0.7123105", "0.7120905" ]
0.7505236
26
the function below randomizes a line according to the number of syllables allowed
function randomizeLine(num){ var result = ""; while (num > 0){ var j = Math.round(Math.random() * (num - 1) + 1); var randomWord = getRandomWord(j); result += randomWord + " "; num -= j; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomizeSentence(sentence) {\n\n}", "randomLine(nbEmpty) {\n // Use default value if no param provided\n nbEmpty = nbEmpty || ((this.width / 3) | 0);\n let result = Array(this.width).fill(this.EMPTY);\n for(let count = this.width; count > nbEmpty; ) {\n let idx = Math.floor(Math.random() * this.width);\n if (result[idx] === this.EMPTY) {\n result[idx] = Shape.randomId;\n count -= 1;\n }\n\n }\n return result.join(''); \n }", "function randLineWidth(size, min) {\n return Math.floor(Math.random() * size) + min;\n}", "function random_font_size(){ return parseInt( ( Math.random() * 3 + 1 ) * 10 ) / 10 + 'em' }", "function random_word(){\n var n = 4 + Math.floor(Math.random() * 6);\n return random_text(n);\n }", "function distribucionLineal(rango) {\n return Math.floor(Math.random() * rango);\n }", "function generateSentence() {\nvar randomIndex = Math.floor(Math.random() * sentences.length);\ncurrentSentence = sentences[randomIndex];\nprompt.innerHTML = currentSentence;\n}", "function emojifyLine(text, len_probabilities = [1, 1, 1, 1, 2, 2, 3]) {\n let emojified = \"\";\n for (let word of text.split(/ /g)) {\n if (edb[stripWord(word)]) {\n let emoji_string = \"\";\n for (let i of _.range(_.sample(len_probabilities))) {\n emoji_string += _.sample(edb[stripWord(word)]);\n }\n emojified += word + emoji_string + \" \";\n } else {\n emojified += word + \" \";\n }\n }\n\n return emojified;\n}", "function randomStartingPhrase() {\n if (Math.random() < 0.33) {\n return phrases[Math.floor(Math.random() * phrases.length)]\n }\n return ''\n}", "function randomize (){\n\tvar random = Math.floor(Math.random()*4);\n\treturn ligth(random);\n}", "makeText(numWords = 100) {\n const startWordIndex = Math.floor(Math.random() * Object.keys(this.startChains).length);\n let prevWord = Object.keys(this.startChains)[startWordIndex];\n let randomText = prevWord;\n\n for (let i = 1; i < numWords; i++) {\n const nextRandom = Math.floor(Math.random() * this.chains[prevWord].length);\n const nextWord = this.chains[prevWord][nextRandom];\n randomText += ' ';\n if (nextWord) {\n randomText += nextWord.toLowerCase();\n prevWord = nextWord;\n } else {\n randomText += this.makeText(numWords - i);\n break;\n }\n }\n if (prevWord.charAt(prevWord.length - 1) === ',') {\n randomText = randomText.slice(0, randomText.length - 1)\n }\n if (!END_PUNCTUATION.includes(prevWord.charAt(prevWord.length - 1))) {\n randomText += '.'\n }\n return randomText.trim()\n }", "function RandomName(minsyl, maxsyl, number) {\n var data = \"\";\n var genname = \"\"; // this accumulates the generated name.\n var leng = rolldie(minsyl, maxsyl, number); // Compute number of syllables in the name\n var isvowel = rolldie(0, 1, number); // randomly start with vowel or consonant\n for (var i = 1; i <= leng; i++) { // syllable #. Start is 1 (not 0)\n do {\n if (isvowel) {\n data = vowels[rolldie(0, vowels.length - 1, number)];\n } else {\n data = consonants[rolldie(0, consonants.length - 1, number)];\n }\n if (i == 1) { // first syllable.\n if (data[1] & 2) {\n break;\n }\n } else if (i == leng) { // last syllable.\n if (data[1] & 1) {\n break;\n }\n } else { // middle syllable.\n if (data[1] & 4) {\n break;\n }\n }\n } while (1)\n genname += data[0];\n isvowel = 1 - isvowel; // Alternate between vowels and consonants.\n }\n// Initial caps:\n genname = (genname.slice(0, 1)).toUpperCase() + genname.slice(1);\n return genname;\n}", "text(nChars){\n let text = \"\";\n while(text.length < nChars){\n let index = Math.floor((Math.random() * words.length));\n text += words[index] + \" \";\n }\n\n //If the text is longer cut it \n if(text.length > nChars){\n let difference = text.length - nChars;//lorem 3 \n text = text.substring(0,text.length - difference);\n }\n\n return text + \".\";\n }", "function randWord(){\n var a = 'abtchyplwwah'; \n var b = 'aeyuioee';\n var c = 'eetleouiynmcc'\n var d = 'mnbceeytplttk';\n var w = [a,b,c,d];\n var str = '';\n for(var i=0; i++; i<4)\n {\n var n = (w[i][Math.floor(Math.random() * w[i].length)]);\n n = n || 'e';\n str += n;\n }\n\n }", "makeText(numWords = 100) {\n // TODO\n const keys = Object.keys(this.chains)\n let text = ''\n let prevWord;\n for(let i = 0; i <= numWords; i++){\n if(prevWord === undefined){\n let ranKey = keys[Math.floor(Math.random() * keys.length)]\n let ranWord = this.chains[ranKey][Math.floor(Math.random() * this.chains[ranKey].length)]\n if(ranWord !== undefined){\n text = text+ranWord+' '\n prevWord = ranWord\n }\n }else{\n let ranWord = this.chains[prevWord][Math.floor(Math.random() * this.chains[prevWord].length)]\n if(ranWord !== undefined){\n text = text+ranWord+' '\n prevWord = ranWord;\n }else{\n break\n }\n }\n }\n return text.trim();\n }", "function add_console()\n{\n if(Math.random()*0.8>Math.random())\n {\n return;\n }\n var cmd=document.createElement(\"FONT\");\n var txt=document.createTextNode(\"#\"+Math.floor(Math.random()*20000+10000).toString(10)+\">> \"+phrases[Math.floor(Math.random()*phrases.length)]);\n \n cmd.appendChild(txt)\n con_txt.appendChild(document.createElement(\"BR\"));\n con_txt.appendChild(cmd);\n \n if(con_txt.children.length>line_limit*2)\n {\n con_txt.children[0].remove();\n con_txt.children[0].remove();\n }\n}", "function drawChar() {\n const lines = round(random(2, 4));\n\n for (let l = 0; l < lines; l++) {\n const charDetail = round(random(3, 6));\n beginShape();\n for (let i = 0; i < charDetail; i++) {\n const pos = floor(random(rez * rez));\n const y = (floor(pos / rez)) / rez;\n const x = (pos % rez) / rez;\n curveVertex(x * charScale, y * charScale);\n }\n endShape();\n }\n}", "function pickLineX(){\n yourFriendlyNeighborhoodVariable = random(width);\n return yourFriendlyNeighborhoodVariable;\n}", "randomText(positive) {\n const posPhrases = [\n 'Goed gedaan!',\n 'Netjes!',\n 'Je doet het súper!',\n 'Helemaal goed!',\n 'Je bent een topper!'\n ]\n const negPhrases = [\n 'Ik weet dat je het kunt!',\n 'Jammer, probeer het nog eens!',\n 'Bijna goed!',\n 'Helaas pindakaas'\n ]\n\n const phrases = positive ? posPhrases : negPhrases\n const maximumNumber = phrases.length\n const randomNumber = Math.floor(Math.random() * maximumNumber)\n \n return phrases[randomNumber]\n }", "function random_text(n) {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n for( var i=0; i < n; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n }", "set_random_lines() {\n let lista = [];\n let lineas = [];\n for (let index = 0; index < 16; index++) {\n let width = Math.random() * (this.canvas.width - 50) + 20;\n let height = Math.random() * (this.canvas.height - 50) + 20;\n let line = new Object();\n line.x = width;\n line.y = height;\n lista.push(line);\n }\n for (let index = 1; index < lista.length; index += 2) {\n let linea = new Object();\n linea.a = lista[index - 1];\n linea.b = lista[index];\n lineas.push(linea);\n }\n this.set_lines(lineas);\n }", "function randomizer (word) {\n\t\treturn Math.floor((Math.random() * 800) + word.length*55); //used to be +200\n\t}", "function generateRandomParagraph(){\n index= Math.floor(Math.random()*sizeOfArray);\n txt= paragraphs[index];\n len= txt.length;\n $('.randomParagraphGenerated').html('');\n const singleLetter= txt.split('');\n singleLetter.forEach(character=>{\n const charSpan= document.createElement('span');\n charSpan.innerText= character;\n displayUnit.appendChild(charSpan);\n })\n}", "function randColor() {\n\n // Set random word\n\n\n // Set random word color\n\n\n }", "function getRandomPositions() {\n\tlet longStr = '';\n\tfor(let i = 0; i < 30; i++) {\n\t\tconst x = getRandomInt(); const y = getRandomInt();\n\t\tif(longStr.match(new RegExp(`\\/${y}-${x}\\/`)) !== null) {\n\t\t\ti = i - 1;\n\t\t} else {\n\t\t\tlongStr += `/${y}-${x}/`\n\t\t}\n\t}\n\treturn longStr;\n}", "function rndtxt()\n{\n var rnd=Math.floor(Math.random()*asclog_elments.length);\n if(asclog_elments[rnd].getAttribute(\"color\")==\"#221f1f\")\n {\n asclog_elments[rnd].setAttribute(\"color\",\"#101010\");\n setTimeout(function(){asclog_elments[rnd].setAttribute(\"color\",\"#221f1f\");},Math.floor(Math.random()*1000)+500);\n //return;\n }\n var txt=asclog_elments[rnd].textContent.substring(0,asclog_elments[rnd].textContent.length);\n var char=hexstr[Math.floor(Math.random()*hexstr.length)];\n txt=txt.replace(txt.charAt(Math.floor(Math.random()*txt.length)),char); \n asclog_elments[rnd].textContent=txt;\n \n \n}", "makeText(numWords = 100) {\n let randNum = Math.floor(Math.random() * this.words.length)\n let word = this.words[randNum]\n let str = ''\n\n for (let i = 0; i < numWords; i++) {\n str += `${word} `\n let randIdx = Math.floor(Math.random() * this.wordsObj[word].length)\n const nextWord = this.wordsObj[word][randIdx]\n if (nextWord === null) {\n // Remove the trailing space at the end of the sentence.\n str.replace(/\\s+$/, '')\n break\n }\n word = nextWord\n }\n\n return str\n }", "function panjang (str) {\n let hasil = ''\n //let b = options.length;\n for(let i=0; i< b; i++) {\n hasil += randomStr(str)[i]\n }\n return hasil;\n }", "function randomBlocText(k){\n result=\"\";\n for(var i=0;i<k;i++){\n var newWord=randomWord();\n if(i==0){\n newWord=capitalizeFirstLetter(newWord);\n }\n result+=randomPhrase();\n }\n return result;\n}", "getRandomPhrase() {\n const index1 = Math.floor(Math.random() * this.phrases.length);\n function index2(index1) {\n return Math.floor(Math.random() * game.phrases[index1].length);\n }\n if (index1 === 0) {\n this.clue = 'Video Games';\n return this.phrases[index1][index2(index1)];\n } else if (index1 === 1) {\n this.clue = 'Literature';\n return this.phrases[index1][index2(index1)];\n } else if (index1 === 2) {\n this.clue = 'Golden Girls Quotes';\n return this.phrases[index1][index2(index1)];\n } else {\n this.clue = 'Crafts';\n return this.phrases[index1][index2(index1)];\n }\n }", "function calcParagraphLength() {\n\treturn Math.ceil(Math.random() * 2);\n}", "function generateRandomQuote()\n{\n let startCount = Math.floor(Math.random() * beginning.length);\n let middleCount = Math.floor(Math.random() * middle.length);\n let endCount = Math.floor(Math.random() * ending.length);\n\n return `${beginning[startCount]} ${middle[middleCount]} ${ending[endCount]}.\\n`;\n}", "makeText(numWords = 100) {\n let keys = Object.keys(this.chains);\n let key = keys[Math.floor(Math.random() * Math.floor(keys.length))];\n let textArray = [];\n\n while (textArray.length < numWords && key !== null) {\n textArray.push(key);\n key = this.chains[key][\n Math.floor(Math.random() * Math.floor(this.chains[key].length))\n ];\n }\n return textArray.join(\" \");\n }", "function getRandomWord() {\n // array taken from https://gist.github.com/borlaym/585e2e09dd6abd9b0d0a\n wordList = [\n \"Aardvark\",\n \"Albatross\",\n \"Alligator\",\n \"Alpaca\",\n \"Ant\",\n \"Anteater\",\n \"Antelope\",\n \"Ape\",\n \"Armadillo\",\n \"Donkey\",\n \"Baboon\",\n \"Badger\",\n \"Barracuda\",\n \"Bat\",\n \"Bear\",\n \"Beaver\",\n \"Bee\",\n \"Bison\",\n \"Boar\",\n \"Buffalo\",\n \"Butterfly\",\n \"Camel\",\n \"Capybara\",\n \"Caribou\",\n \"Cassowary\",\n \"Cat\",\n \"Caterpillar\",\n \"Cattle\",\n \"Chamois\",\n \"Cheetah\",\n \"Chicken\",\n \"Chimpanzee\",\n \"Chinchilla\",\n \"Chough\",\n \"Clam\",\n \"Cobra\",\n \"Cockroach\",\n \"Cod\",\n \"Cormorant\",\n \"Coyote\",\n \"Crab\",\n \"Crane\",\n \"Crocodile\",\n \"Crow\",\n \"Curlew\",\n \"Deer\",\n \"Dinosaur\",\n \"Dog\",\n \"Dogfish\",\n \"Dolphin\",\n \"Dotterel\",\n \"Dove\",\n \"Dragonfly\",\n \"Duck\",\n \"Dugong\",\n \"Dunlin\",\n \"Eagle\",\n \"Echidna\",\n \"Eel\",\n \"Eland\",\n \"Elephant\",\n \"Elk\",\n \"Emu\",\n \"Falcon\",\n \"Ferret\",\n \"Finch\",\n \"Fish\",\n \"Flamingo\",\n \"Fly\",\n \"Fox\",\n \"Frog\",\n \"Gaur\",\n \"Gazelle\",\n \"Gerbil\",\n \"Giraffe\",\n \"Gnat\",\n \"Gnu\",\n \"Goat\",\n \"Goldfinch\",\n \"Goldfish\",\n \"Goose\",\n \"Gorilla\",\n \"Goshawk\",\n \"Grasshopper\",\n \"Grouse\",\n \"Guanaco\",\n \"Gull\",\n \"Hamster\",\n \"Hare\",\n \"Hawk\",\n \"Hedgehog\",\n \"Heron\",\n \"Herring\",\n \"Hippopotamus\",\n \"Hornet\",\n \"Horse\",\n \"Human\",\n \"Hummingbird\",\n \"Hyena\",\n \"Ibex\",\n \"Ibis\",\n \"Jackal\",\n \"Jaguar\",\n \"Jay\",\n \"Jellyfish\",\n \"Kangaroo\",\n \"Kingfisher\",\n \"Koala\",\n \"Kookabura\",\n \"Kouprey\",\n \"Kudu\",\n \"Lapwing\",\n \"Lark\",\n \"Lemur\",\n \"Leopard\",\n \"Lion\",\n \"Llama\",\n \"Lobster\",\n \"Locust\",\n \"Loris\",\n \"Louse\",\n \"Lyrebird\",\n \"Magpie\",\n \"Mallard\",\n \"Manatee\",\n \"Mandrill\",\n \"Mantis\",\n \"Marten\",\n \"Meerkat\",\n \"Mink\",\n \"Mole\",\n \"Mongoose\",\n \"Monkey\",\n \"Moose\",\n \"Mosquito\",\n \"Mouse\",\n \"Mule\",\n \"Narwhal\",\n \"Newt\",\n \"Nightingale\",\n \"Octopus\",\n \"Okapi\",\n \"Opossum\",\n \"Oryx\",\n \"Ostrich\",\n \"Otter\",\n \"Owl\",\n \"Oyster\",\n \"Panther\",\n \"Parrot\",\n \"Partridge\",\n \"Peafowl\",\n \"Pelican\",\n \"Penguin\",\n \"Pheasant\",\n \"Pig\",\n \"Pigeon\",\n \"Pony\",\n \"Porcupine\",\n \"Porpoise\",\n \"Quail\",\n \"Quelea\",\n \"Quetzal\",\n \"Rabbit\",\n \"Raccoon\",\n \"Rail\",\n \"Ram\",\n \"Rat\",\n \"Raven\",\n \"Red deer\",\n \"Red panda\",\n \"Reindeer\",\n \"Rhinoceros\",\n \"Rook\",\n \"Salamander\",\n \"Salmon\",\n \"Sand Dollar\",\n \"Sandpiper\",\n \"Sardine\",\n \"Scorpion\",\n \"Seahorse\",\n \"Seal\",\n \"Shark\",\n \"Sheep\",\n \"Shrew\",\n \"Skunk\",\n \"Snail\",\n \"Snake\",\n \"Sparrow\",\n \"Spider\",\n \"Spoonbill\",\n \"Squid\",\n \"Squirrel\",\n \"Starling\",\n \"Stingray\",\n \"Stinkbug\",\n \"Stork\",\n \"Swallow\",\n \"Swan\",\n \"Tapir\",\n \"Tarsier\",\n \"Termite\",\n \"Tiger\",\n \"Toad\",\n \"Trout\",\n \"Turkey\",\n \"Turtle\",\n \"Viper\",\n \"Vulture\",\n \"Wallaby\",\n \"Walrus\",\n \"Wasp\",\n \"Weasel\",\n \"Whale\",\n \"Wildcat\",\n \"Wolf\",\n \"Wolverine\",\n \"Wombat\",\n \"Woodcock\",\n \"Woodpecker\",\n \"Worm\",\n \"Wren\",\n \"Yak\",\n \"Zebra\"\n ];\n\n var x = Math.floor((Math.random() * wordList.length));\n return wordList[x].toUpperCase();\n }", "function randomWordCount() {\n return Math.floor(Math.random() * (10 - 5 + 1)) + 5;\n}", "function changeQuote() {\n document.getElementById(\"quoteText\").innerHTML = \"&#8220;\" + twainSet[Math.floor(Math.random() * 25)] + \"&#8221;\";\n}", "makeText(numWords = 50) {\n let newText = \"\";\n // initially word will be a random word from words arr\n let word = this.words[Math.floor(Math.random() * this.words.length)]\n newText = newText + word + \" \";\n for (let i=0; i<numWords; i++) {\n if (this.chains[word][0] == null) {\n return newText;\n } else {\n word = this.chains[word][Math.floor(Math.random() * this.chains[word].length)]\n newText = newText + word + \" \";\n }\n }\n\n return newText;\n }", "static readRandomSentence(theme) {\r\n console.log(Main.firstPartlistImpl.readRandomThemedPart(theme) + Main.secondPartListImpl.readRandomPart() + Main.thirdPartListImpl.readRandomPart()); \r\n }", "function randomize() {\r\n\r\n\tlet characterPos = Math.floor((Math.random() * characters.length));\r\n\tlet character = characters[characterPos];\r\n\r\n\tlet bgSize = Math.floor((Math.random() * 25) + 25);\r\n\r\n\tlet color = Math.floor((Math.random() * colors.length));\r\n\tlet bgColor = colors[color];\r\n\r\n\tlet fontSize = Math.floor((Math.random() * 15) + 10);\r\n\r\n\tlet speed = Math.floor((Math.random() * 5) + 2);\r\n\r\n\tlet position = Math.floor((Math.random() * 440) + 10);\r\n\r\n\tletters.push(new Letter(character, bgSize, bgColor, fontSize, speed, position));\r\n\r\n\r\n\t\r\n}", "update() { \n this.text = this._parent.getRandomWord(); \n\n //csantos: randomize and update font size\n let scale = (window.innerWidth < 1280) ? window.innerWidth / 1280 : 1;\n this.style.fontSize = (16 + Math.random() * (50 - 16)) * scale; //min: 16, max: 50 \n }", "function drawLines(n){\n\t\t/** Traverses the text's length */\n\t\tfor (var i = 0; i < n.length; i++){\n\t\t\t/** Creates a space for each letter in the argument */\n\t\t\tlines.push(\"_\");\n\t\t}\n\t\t/** This is the product */\n\t\t\n\t\treturn lines.join(\"\");\n\t}", "function Randomize() {\n\t\tfor (i=0; i < crystal.length; i++) {\n\t\t\tcrystal[i]=[Math.floor(Math.random() * (13 - 1)+ 1)];\n\t\t}\n\t}", "function randstr()\n{\n\tvar output = \"\";\n\tfor (var i=0; i < config.msglen; i++\t)\n\t{\n\t\toutput += alpha[rand(0,squares.length)];\n\t}\n\tconsole.log(output);\n\treturn output;\n}", "function code() {\n var code = \"\";\n var str = \"123456789\";\n for (var i = 0; i < 3; i++) {\n code += str.charAt(Math.floor(Math.random() * str.length));\n }\n return 'Tu Codigo: Lab' + code;\n}", "function rAiNbOw(str) {\n let retStr = ``;\n for (let i = 0; i < str.length; i++) {\n let check = Math.floor(Math.random()*6);\n switch(check) {\n case 0:\n retStr += `${chalk.red(str[i])}`;\n break;\n case 1:\n retStr += `${chalk.green(str[i])}`;\n break;\n case 2:\n retStr += `${chalk.yellow(str[i])}`;\n break;\n case 3:\n retStr += `${chalk.blue(str[i])}`;\n break;\n case 4:\n retStr += `${chalk.magenta(str[i])}`;\n break;\n case 5:\n retStr += `${chalk.cyan(str[i])}`;\n break;\n default:\n retStr += str[i];\n break; \n }\n }\n return retStr;\n }", "create_random_phrase(N) {\n let phrase = \"\";\n\n for (let n = 0; n < N; n++) {\n // Selects a random number in range [0, 128)\n // and converts to a string character\n let char = String.fromCharCode(random(32, 128));\n\n phrase += char;\n }\n\n return phrase;\n }", "function simpleText()\n {\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 }", "static generateRandomText() {\n return Math.random().toString(36).substr(2); // remove `0.`\n }", "function randomCidDim(){\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for( var i=0; i < 7; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n}", "function randomSoundwave(){\n \n config.items = Array(config.max_distance - config.min_distance + 1).fill().map((_, idx) => 7 + idx);\n \n document.getElementById('svg').innerHTML = '';\n \n var svgns = \"http://www.w3.org/2000/svg\";\n for (var i = 1; i < config.number_of_lines; i++) {\n var y1 = config.items[Math.floor(Math.random() * config.items.length)];\n var y2 = config.line_height - y1;\n var line = document.createElementNS(svgns, 'line');\n var x = i * config.line_spacing;\n \n line.setAttributeNS(null, 'x1', x);\n line.setAttributeNS(null, 'y1', y1);\n line.setAttributeNS(null, 'x2', x);\n line.setAttributeNS(null, 'y2', y2);\n line.setAttributeNS(null, 'stroke-width', config.line_width);\n line.setAttributeNS(null, 'stroke', config.line_color); \n \n document.getElementById('svg').appendChild(line);\n }\n \n }", "function pickAWord() \n{\n\t\tcurrentWord = words[Math.floor(Math.random() * words.length)];\n\tfor(var i = 0; i < currentWord.length; i++)\n\t{\n\t\tanswer[i] = \"_\";\n\t\tdocument.getElementById(\"blanks\").innerHTML = answer;\n\n\t\t// removing the commas from in between the lines.\n\t\tvar remove = document.getElementById(\"blanks\");\n\t\tremove.innerHTML = answer.join(\" \");\n\t\t\n\t}\n}", "getRandomPhrase() {\n const randNum = Math.floor(Math.random() * Math.floor(5));\n const randomPhrase = this.phrases[randNum];\n return randomPhrase;\n }", "function wordRandomizer() {\r\n\treturn randomWords[Math.floor(Math.random()*randomWords.length)];\r\n}", "function rand(length) {\n var str = '';\n while (str.length < length) {\n str += S4();\n }\n return str.slice(0, length);\n }", "makeText(numWords = 100) {\n let numWordsArr = []\n if (this.chain === undefined) {\n return \"\"\n }\n const Keys = Object.keys(this.chain)\n while (numWordsArr.length < numWords) {\n let randomKey = Keys[Math.floor(Math.random() * Keys.length)]\n let randomWord = this.chain[randomKey][Math.floor(Math.random() * this.chain[randomKey].length)]\n if (randomWord !== null) {\n numWordsArr.push(randomWord)\n }\n }\n return numWordsArr.join(' ')\n }", "randomSentence () {\n let sentenceArray = []\n let sentence1 = this.randomSentenceHelper();\n //sentence Array tracks each relative clause generated\n sentenceArray.push(sentence1);\n let num = Math.random();\n //loop continues to generate relative clauses until it fails to meet\n //the random check.\n while(num < Math.min(.85, this.complexity)) {\n let conj = this.randomWord(this.conjunctions);\n sentenceArray.push(conj);\n tempSentence = this.randomSentenceHelper();\n sentenceArray.push(tempSentence);\n num = Math.random();\n }\n joinedSentence = sentenceArray.join(' ');\n //change the first letter to uppercase and replace the last ',' with a '.'\n fullSentence = joinedSentence[0].toUpperCase() + joinedSentence.slice(1, joinedSentence.length -1) + '.';\n return fullSentence;\n }", "makeText(numWords = 100) {\n // TODO\n\n let chainObj = this.makeChains();\n let randomStarIdx = Math.floor(Math.random() * this.words.length);\n let randomStartWord = this.words[randomStarIdx];\n let text = [randomStartWord];\n\n for (let i = 0; i < numWords - 1; i++) {\n let value = chainObj[text[i]]\n\n if (value[0] === null) {\n return text.join(' ');\n }\n if (value.length === 1) {\n text.push(value);\n } else {\n let randomIdx = Math.floor(Math.random() * value.length);\n let randomWord = value[randomIdx];\n text.push(randomWord);\n }\n }\n\n return text.join(' ');\n }", "function randStr(len) {\n let s = '';\n while (len--) { s += String.fromCodePoint(Math.floor(Math.random() * (126 - 33) + 33)); }\n return s;\n}", "makeText(numWords = 100) {\n const numWordsAv = Object.keys(this.chains).length;\n let randNum, text;\n do {\n randNum = Math.floor(Math.random() * numWordsAv);\n text = [Object.keys(this.chains)[randNum]];\n } while (text[0] === text[0].toLowerCase())\n\n if (text[0].slice(-1) === '.') {\n return text.toString();\n }\n \n for (let i = 0; i < numWords - 1; i++) {\n let randNum = Math.floor(Math.random() * this.chains[text[i]].length);\n if (this.chains[text[i]][randNum] === null ) {\n break;\n } else {\n text.push(this.chains[text[i]][randNum])\n if (this.chains[text[i]][randNum].slice(-1) ==='.') break;\n }\n }\n return text.join(\" \")\n }", "function getRandom() {\n return Math.floor(Math.random() * words.length);\n}", "function thoughts() {\n const thoughts = [\n '\"make your each day masterpiece\"',\n '\"Mind your digital wellbeing\"',\n '\"Javascript is nibbrish language\"',\n '\"You dont get everything in your life you wish for.\"'\n ];\n const randomThought = Math.floor(Math.random(thoughts) * 4);\n\n thought.innerHTML = thoughts[randomThought];\n}", "getRandomPhrase() {\r\n let randomNumber = Math.floor(Math.random() * this.phrase.length);\r\n //console.log(randomNumber); \r\n return this.phrase[randomNumber];\r\n}", "function randomize(text){\n var textArray=[];\n\n //first turn the string into an array\n for(var i=0;i<text.length;i++){\n textArray[i]=text.charAt(i);\n }\n \n var aux;\n var random;\n\n //For the lenght of the array, every element is randomly switched \n for(var i=0;i<text.length;i++){\n random=Math.floor(Math.random()*textArray.length);\n aux=textArray[random];\n textArray[random]=textArray[i];\n textArray[i]=aux;\n }\n\n var resp=\"\";\n\n //turn the array into a string\n for(var i=0;i<text.length;i++){\n resp=resp.concat(textArray[i]);\n }\n\n //return the mixed string\n return resp;\n}", "draw() {\n for (let i = 0; i < this.sentence.length; i++) {\n let current = this.sentence.charAt(i);\n\n if (current === \"F\" || current === \"f\") {\n if (p.random() < 0.9) {\n // All the designing happens here!\n let lineColor = p.lerpColor(\n p.color(this.colors[0]),\n p.color(this.colors[1]),\n i / this.sentence.length\n );\n lineColor.setAlpha(150);\n p.stroke(lineColor);\n //strokeWeight(3 + abs((sin((i+timer)/this.sentence.length*PI) * 15)))\n p.strokeWeight(this.branchValue + 1);\n p.line(0, 0, 0, -this.len);\n p.translate(0, -this.len);\n if (i / this.sentence.length > 0.95) {\n if (p.random() > 0.92) {\n flower();\n }\n } else if (this.branchValue < 3) {\n if (p.random() > 0.97) {\n flower();\n } else if (p.random() > 0.9) {\n spot();\n } else if (p.random() > 0.8) {\n p.circle(0, 0, 6, 6);\n }\n }\n }\n } else if (current === \"+\") {\n p.rotate(this.angle * parseInt(this.sentence.charAt(i + 1)));\n i++;\n } else if (current === \"-\") {\n p.rotate(-this.angle * parseInt(this.sentence.charAt(i + 1)));\n i++;\n } else if (current === \"[\") {\n this.branchValue -= 1;\n p.push();\n } else if (current === \"]\") {\n this.branchValue += 1;\n p.pop();\n }\n }\n }", "function scramble(msg) {\n\tvar s = \"\";\n\tvar msgLength = msg.length\n\tfor (var i = 0; i < msgLength; i++) {\n\t\tvar randIndex = Math.round(Math.random() * msg.length);\n\t\tconsole.log(\"index of\" + randIndex);\n\t\ts += msg.substring(randIndex, randIndex + 1);\n\t\tmsg = spliceSlice(msg, randIndex, 1);\n\t}\n\treturn s;\n}", "function getLine(rhyme) {\n\t// don't rhyme a word with itself!\n\tlet lastWords = lines.map(lastWord);\n\n\t// sprinkle in some shakespeare\n\tlet shakespeare = false;\n\tif (Math.random() < 0.2) {\n\t\tshakespeare = true;\n\t}\n\n\n\treturn getRandomTweet({\n\t\t\"sound\": rhyme,\n\t\t\"word\": { \"$nin\": lastWords },\n\t\t\"shakespeare\": shakespeare\n\n\t}).then((tweetObject) => {\n\t\t// don't delete the shakespeare lines -- we want to keep those\n\t\tif (!tweetObject[\"shakespeare\"]) {\n\t\t\t// otherwise, add the tweet to the list to delete later\n\t\t\ttweetsUsed.push(tweetObject._id);\n\t\t}\n\n\t\treturn tweetObject[\"tweet\"];\n\t});\n}", "function randomString(len) {\n var charSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n var s = '';\n for (var i = 0; i < len; i++) {\n var randomPoz = Math.floor(Math.random() * charSet.length);\n s += charSet.substring(randomPoz,randomPoz+1);\n }\n return 'mg-chart-' + s;\n }", "getRandomPhrase() {\n let randomNumber = Math.floor(Math.random() * 5);\n return this.phrases[randomNumber];\n }", "function generateRandomString(size) {\n var possible = 'abcdefghijklmnopqrstuvwxyz';\n var text = '';\n for (var i = 0; i < size; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n }", "getRandomPhrase() {\n let randomOneToFive = Math.floor(Math.random() * 5);\n return this.phrases[randomOneToFive];\n }", "function generate(size = 25, w0, w1) {\n if (size == 0) {\n return w0 || '';\n } else if (isUndefined(w0) || isUndefined(w1)) {\n let r = random(wordList.length - 3);\n return generate(size, wordList[r], wordList[r+1]);\n } else {\n let w2 = sample(lookup[[w0, w1]]);\n return w0 + ' ' + generate(size-1, w1, w2);\n }\n }", "function randomSentence() {\n var sentenceIndex = Math.floor(Math.random()*self.sentences.length)\n\n if (self.currentSentence !== sentenceIndex) {\n self.currentSentence = sentenceIndex\n } else {\n randomSentence()\n }\n }", "function drawRandomSignal() {\n\tcurrentRule = Math.floor(Math.random() * signalArray.length);\n\tcurrentSignal = Math.floor(Math.random() * signalArray[currentRule].length);\n\n\tdrawSignal(signalArray[currentRule][currentSignal], ruleArray[currentRule]);\n}", "function eightBall(){\n console.log (words[Math.floor((Math.random() * (words.length)))]);\n}", "function generate() {\n // With every new sentence we want to make tree branches smaller\n leng = 0.5*leng;\n // We also want to randomize angle a bit\n angle += random(-PI/9, PI/9);\n var newSentence = \"\";\n // Every character in sentence we need to change according to recursion rules and\n // write it dow to a new sentence\n for (var c in sentence) {\n let current = sentence.charAt(c);\n var found = false;\n for (var r in rules) {\n if (current == rules[r].a) {\n newSentence += rules[r].b;\n found = true;\n break;\n }\n }\n if (!found) {\n newSentence += current;\n }\n }\n sentence = newSentence;\n drawSentence();\n}", "function allowedCharLength(words){\n\n var base = 8 + 40*smoothstep(1, 100, words.length);\n\n var rando = random(0.8, 1.2);\n\n return abs(round(base*rando)) + 1; // absolute value of 80-120% of the baseline value (+1 so that it's never 0)\n}", "function rndWord() {\n counter ++;\n if (correctCount == words.length) {\n showDone();\n return;\n }\n word = undefined;\n while (!word || word.learned) {\n word = words[Math.floor(Math.random() * words.length)];\n }\n showWord();\n}", "function randomTagline() {\n setInterval(function() {\n $(\"#page-tagline p\").fadeOut(\"slow\", function() {\n $(\"#page-tagline p\").text( taglinePhrases[ran(0, taglinePhrases.length)] );\n $(\"#page-tagline p\").fadeIn(\"slow\");\n });\n }, 7000);\n}", "function emojiLoop(max) {\r\n return (i = Math.floor(Math.random() * Math.floor(max)));\r\n }", "function createRandomLettersHE(len){\n var text = \"\";\n var possible = \"אבגדהוזחטיכלמנסעפצקרשת0123456789\";\n for( var i=0; i < len; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n}", "generateRandomSentence() {\n if (this.state.loaded) {\n var name = this.state.wubbynames[getRandomInt(0, this.state.wubbynames.length-1)].content;\n var action = this.state.sentenceActions[getRandomInt(0, this.state.sentenceActions.length-1)].content;\n var obj = this.state.sentenceObjects[getRandomInt(0, this.state.sentenceObjects.length-1)].content;\n\n var sentence = 'I want ' + name + ' to ' + action + ' with ' + obj;\n this.setState({ currentSentence: sentence });\n }\n\n }", "function randomWhitespace() {\n var randomMax = AVERAGE_WHITESPACE * (1 + Math.random() - 0.5);\n\n str = '';\n for (var i = 0; i < randomMax; i += 1) {\n str += ' ';\n }\n return str;\n }", "function randomizeCharacters(word) {\n var charArray = word.split(\"\");\n var n = charArray.length;\n for(var i = n - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var tmp = charArray[i];\n charArray[i] = charArray[j];\n charArray[j] = tmp;\n }\n $(\".letters\").text(charArray.join(\"\"));\n}", "function genRegular(x) {\n var regularchar = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n var text = \"\";\n\n for (var i = 0; i < x; i++)\n text += regularchar.charAt(Math.floor(Math.random() * regularchar.length));\n return text;\n}", "function tick() {\n if (index < 0 || index >= words.length) return;\n var item = words[index++];\n var x = 5 + Math.random() * 900;\n var y = 110 + Math.random() * 640;\n var brush = canvas.getContext(\"2d\");\n brush.fillText(item, x, y);\n if (index >= words.length) clearInterval(timer);\n }", "function randSkin(dataf, laYo){\nif(s != null) return s;\nvar indice = 0; //todo mettere una meglio fatta funzione random\nvar rl = df[dataf].layout[laYo][indice];\nif(rl) return rl;\nreturn false;\n}", "getRandomPhrase() {\r\n let randomPhrase = this.phrases[Math.floor(Math\r\n .random() * this.phrases.length)];\r\n return randomPhrase;\r\n }", "function r(l) {\n let randomChars = 'ABCDF0123456789';\n let result = '';\n for ( var i = 0; i < l; i++ ) {\n result += randomChars.charAt(Math.floor(Math.random() * randomChars.length));\n }\n return result;\n}", "getRandomPhrase() {\n var randomNumber = Math.floor(Math.random() * 5);\n return this.phrases[randomNumber]\n }", "getRandomPhrase(){\r\n let randomNumber = Math.floor((Math.random() * 5))\r\n return this.phrases[randomNumber];\r\n }", "function generate() {\n\tvar word = \"\";\n\tfor(var i = 0; i < Math.random() * 15; i++) {\n\t\tword += String.fromCharCode(Math.round(Math.random() * 60) + 65);\n\t}\n\tdata.push({\n\t\tn : Math.random(),\n\t\ttitle : word\n\t})\n}", "function createTableCode() {\n let _lText = '';\n let _lPossible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n for (let _i = 0; _i < 5; _i++) {\n _lText += _lPossible.charAt(Math.floor(Math.random() * _lPossible.length));\n }\n return _lText;\n}", "function generateEasy(easyWords) {\n temp = \"\"\n $.getJSON(easyWords, function(data) {\n let wordVal = Math.floor(Math.random() * data.length)\n actual = data[wordVal].word.toUpperCase()\n for (let i = 0; i < actual.length; i++) {\n if (actual.substring(i, i + 1) == \" \") {\n temp += \" \"\n } \n else {\n temp += \"_\"\n }\n }\n $(\".easy\").text(temp)\n })\n}", "function random_str() {\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\n return text;\n }", "function nthName() {\n return \"The \" + randomChoice(data.lineage)\n}", "function randomQuote(len) {\n const rand = parseInt(Math.random() * len);\n return rand;\n}", "makeText(numWords = 100) {\n let words = Object.keys(this.chains);\n\n let capWords = words.filter(word => word[0] === word[0].toUpperCase());\n let text = this.randomPick(capWords);\n let firstWord = text;\n let nextWord = this.singleChain(firstWord);\n\n for (let i=1; i < numWords - 1; i++) {\n text += \" \";\n let bigram = `${firstWord} ${nextWord}`;\n firstWord = nextWord;\n if (this.bigrams[bigram]) {\n let pick = this.randomPick(this.bigrams[bigram]);\n nextWord = pick ? pick : this.randomPick(words);\n } else {\n nextWord = this.singleChain(firstWord);\n }\n text += nextWord;\n }\n return text;\n }", "generateRandomCode(length) {\n let code = '';\n\n const table = {\n type: ['lowercase', 'uppercase', 'number'],\n lowercase: ['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 uppercase: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'W', 'V', 'X', 'Y', 'Z'],\n number: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']\n };\n\n let type, typeIndex, typeKey, char, charIndex;\n for (var i = 0; i < length; i++) {\n typeIndex = this.getRandomInt(0, table.type.length - 1);\n typeKey = table.type[typeIndex];\n type = table[typeKey];\n charIndex = this.getRandomInt(0, type.length - 1);\n char = type[charIndex];\n\n code += char;\n }\n\n return code;\n }", "function randomWord(){\n\tsecretWord = words[Math.floor(Math.random()*words.length)].split(\"\");\n\twordSize = secretWord.length;\n}", "function setQuote(){\n var min = 0;\n var max = 3;\n var random = Math.floor(Math.random() * (+max - +min)) + +min;\n\n document.getElementById(\"quote\").innerHTML = quote[random];\n}" ]
[ "0.68040866", "0.67376137", "0.6534846", "0.63994604", "0.62451684", "0.6196211", "0.61307245", "0.61227655", "0.61095613", "0.6109424", "0.6045315", "0.6028608", "0.602666", "0.60029006", "0.60025156", "0.60022855", "0.5994358", "0.59785444", "0.5970096", "0.5946891", "0.593679", "0.59319985", "0.59242487", "0.5909825", "0.5869203", "0.5865087", "0.58509797", "0.58460325", "0.58418506", "0.5828823", "0.58130836", "0.5800634", "0.5799376", "0.5791177", "0.57821375", "0.5765663", "0.57645637", "0.5756768", "0.5752418", "0.5751742", "0.5751447", "0.57469606", "0.573963", "0.57251394", "0.57247144", "0.57198864", "0.5718208", "0.5713298", "0.5712527", "0.57112586", "0.5710211", "0.5702585", "0.5700366", "0.56981957", "0.56902313", "0.5681081", "0.5675667", "0.5669937", "0.56681585", "0.5662602", "0.5654574", "0.56543565", "0.56508785", "0.56483084", "0.5643286", "0.5642943", "0.5638235", "0.5630389", "0.5622317", "0.56206185", "0.5620517", "0.5619841", "0.5613168", "0.56037045", "0.56028146", "0.56005096", "0.5600271", "0.5599399", "0.55989486", "0.55946463", "0.55922264", "0.55890304", "0.55867773", "0.55785054", "0.55779535", "0.5577527", "0.5576818", "0.55756736", "0.557134", "0.55689055", "0.5565991", "0.55541193", "0.55539805", "0.55512404", "0.55508256", "0.5544979", "0.55448556", "0.5544465", "0.5543894", "0.5543221" ]
0.75583625
0
Configuring the Users module
function menuConfig(menuService) { menuService.addMenuItem('topbar',{ title: 'Pacientes', state: 'paciente', type: 'dropdown', roles: ['admin', 'eli', 'gio', 'user'] }); menuService.addSubMenuItem('topbar', 'paciente', { title: 'Listar Pacientes', state: 'paciente.list', roles: ['admin', 'eli', 'gio', 'user'] }); menuService.addSubMenuItem('topbar', 'paciente', { title: 'Registrar Paciente', state: 'paciente.create', roles: ['admin', 'eli', 'gio', 'user'] }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initUsers() {\n this.user = new _models_user__WEBPACK_IMPORTED_MODULE_2__[\"User\"]('', // \"_id\"\n null, // \"cuenta\"\n null, // \"contrase\"\n null, // \"correo\"\n '', // \"nombre\"\n '', // \"image\"\n '', // \"apellido\"\n '', // \"cedula\"\n '', // \"direccion\"\n '', // \"telefono\"\n '', // \"fecha_nacimiento\"\n '', // \"sexo\"\n 'Simple', // \"role_user\"\n true, // \"activa\"\n '');\n }", "async setupUsers() {\n const findUser = async username => {\n const user = await this.getUser(username);\n\n if (_.isEmpty(user)) {\n throw new Error(`User ${username} not found.`);\n }\n return user;\n };\n\n this.user = await findUser(this.settings.name);\n this.authorised_user = await findUser(\n this.settings.authorised_username\n );\n }", "function Users(){}", "constructor(){\n // in order to know which ConfigGen.js version we're using\n this.easysambaVersion = \"1.5\";\n\n // internal variables used by an instance of ConfigGen\n this[\"$domain\"] = undefined;\n this[\"$guest\"] = undefined;\n this[\"$version\"] = undefined;\n this[\"$global\"] = undefined;\n this[\"$users\"] = [];\n this[\"$groups\"] = [];\n this[\"$shares\"] = [];\n\n // \"users\" namespace\n // where functions like \"config.users.add(...)\" are located\n this.users = {\n // users.add()\n add: (username, password) => {\n if (fnIsString(username) !== true || fnIsString(password) !== true){\n throw \"ERROR: USERNAME AND PASSWORD MUST BE STRINGS\";\n }\n\n if (this.users.get().includes(username)){\n throw \"ERROR: USER ALREADY EXISTS\";\n }\n\n this[\"$users\"].push({ \"name\": username, \"password\": password });\n return this;\n },\n\n // users.addArray()\n addArray: (input) => {\n if (fnIsArray(input) !== true){\n throw \"ERROR: INPUT MUST BE AN ARRAY\";\n }\n\n input.forEach((elem) => {\n if (fnHas(elem, [\"name\", \"password\"]) !== true){\n throw \"ERROR: INPUT IS NOT VALID\";\n }\n this.users.add(elem[\"name\"], elem[\"password\"]);\n });\n\n return this;\n },\n\n // users.remove()\n remove: (username = undefined) => {\n if (fnIsArray(username)){\n username.forEach((e) => {\n this.users.remove(e);\n });\n return this;\n }\n\n let index = undefined;\n this[\"$users\"].forEach((user, i) => {\n if (user[\"name\"] === username){\n index = i;\n }\n });\n\n if (index !== undefined && index >= 0){\n this[\"$users\"].splice(index, 1);\n }\n\n return this;\n },\n\n // users.get()\n get: (username = undefined) => {\n if (username === undefined){\n const result = [];\n this[\"$users\"].forEach((user) => {\n result.push(user[\"name\"]);\n });\n return result;\n }\n\n let index = undefined;\n this[\"$users\"].forEach((user, i) => {\n if (user[\"name\"] === username){\n index = i;\n }\n });\n\n if (index === undefined){\n throw \"ERROR: USER NOT FOUND\";\n }\n\n return JSON.parse(JSON.stringify(this[\"$users\"][index]));\n },\n\n // users.getAll()\n getAll: () => {\n const result = [];\n const elems = this.users.get();\n elems.forEach((elem) => {\n result.push(this.users.get(elem));\n });\n return result;\n },\n\n // users.setPassword()\n setPassword: (username, password) => {\n if (fnIsString(password) !== true){\n throw \"ERROR: PASSWORD MUST BE A STRING\";\n }\n\n let index = undefined;\n this[\"$users\"].forEach((user, i) => {\n if (user[\"name\"] === username){\n index = i;\n }\n });\n\n if (index === undefined){\n throw \"ERROR: USER NOT FOUND\";\n }\n\n this[\"$users\"][index][\"password\"] = password;\n\n return this;\n }\n };\n\n // \"groups\" namespace\n // where functions like \"config.groups.add(...)\" are located\n this.groups = {\n // groups.add()\n add: (groupname, members) => {\n if (fnIsString(groupname) !== true){\n throw \"ERROR: GROUP NAME MUST BE A STRING\";\n }\n\n if (fnIsArray(members) !== true){\n throw \"ERROR: MEMBERS MUST BE AN ARRAY\";\n }\n\n const members_safe = [];\n members.forEach((member) => {\n if (fnIsString(member) !== true){\n throw \"ERROR: MEMBERS MUST BE AN ARRAY OF STRINGS\";\n }\n members_safe.push(member);\n });\n\n if (this.groups.get().includes(groupname)){\n throw \"ERROR: GROUP ALREADY EXISTS\";\n }\n\n this[\"$groups\"].push({ \"name\": groupname, \"members\": members_safe });\n return this;\n },\n\n // groups.addArray()\n addArray: (input) => {\n if (fnIsArray(input) !== true){\n throw \"ERROR: INPUT MUST BE AN ARRAY\";\n }\n\n input.forEach((elem) => {\n if (fnHas(elem, \"name\") !== true || (fnHas(elem, \"members\") !== true && fnHas(elem, \"users\") !== true)){\n throw \"ERROR: INPUT IS NOT VALID\";\n }\n if (fnHas(elem, \"users\")){\n console.log(`[WARNING] 'users' property of a group is deprecated, rename it to 'members' instead`);\n this.groups.add(elem[\"name\"], elem[\"users\"]);\n }\n else {\n this.groups.add(elem[\"name\"], elem[\"members\"]);\n }\n });\n\n return this;\n },\n\n // groups.remove()\n remove: (groupname = undefined) => {\n if (fnIsArray(groupname)){\n groupname.forEach((e) => {\n this.groups.remove(e);\n });\n return this;\n }\n\n let index = undefined;\n this[\"$groups\"].forEach((group, i) => {\n if (group[\"name\"] === groupname){\n index = i;\n }\n });\n\n if (index !== undefined && index >= 0){\n this[\"$groups\"].splice(index, 1);\n }\n\n return this;\n },\n\n // groups.get()\n get: (groupname = undefined) => {\n if (groupname === undefined){\n const result = [];\n this[\"$groups\"].forEach((group) => {\n result.push(group[\"name\"]);\n });\n return result;\n }\n\n let index = undefined;\n this[\"$groups\"].forEach((group, i) => {\n if (group[\"name\"] === groupname){\n index = i;\n }\n });\n\n if (index === undefined){\n throw \"ERROR: GROUP NOT FOUND\";\n }\n\n return JSON.parse(JSON.stringify(this[\"$groups\"][index]));\n },\n\n // groups.getAll()\n getAll: () => {\n const result = [];\n const elems = this.groups.get();\n elems.forEach((elem) => {\n result.push(this.groups.get(elem));\n });\n return result;\n },\n\n // groups.addMembers()\n addMembers: (groupname, members) => {\n const addMember = (groupname, member) => {\n if (fnIsString(member) !== true){\n throw \"ERROR: MEMBER MUST BE A STRING\";\n }\n\n let index = undefined;\n this[\"$groups\"].forEach((group, i) => {\n if (group[\"name\"] === groupname){\n index = i;\n }\n });\n\n if (index === undefined){\n throw \"ERROR: GROUP NOT FOUND\";\n }\n\n if (this[\"$groups\"][index][\"members\"].includes(member) !== true){\n this[\"$groups\"][index][\"members\"].push(member);\n }\n };\n\n if (fnIsArray(members) !== true){\n throw \"ERROR: MEMBERS MUST BE AN ARRAY\";\n }\n\n members.forEach((member) => {\n addMember(groupname, member);\n });\n\n return this;\n },\n\n // groups.removeMembers()\n removeMembers: (groupname, members) => {\n const removeMember = (groupname, member) => {\n if (fnIsString(member) !== true){\n throw \"ERROR: MEMBER MUST BE A STRING\";\n }\n\n let index = undefined;\n this[\"$groups\"].forEach((group, i) => {\n if (group[\"name\"] === groupname){\n index = i;\n }\n });\n\n if (index === undefined){\n throw \"ERROR: GROUP NOT FOUND\";\n }\n\n const temp = this[\"$groups\"][index][\"members\"];\n if (temp.includes(member) === true){\n temp.splice(temp.indexOf(member), 1);\n }\n };\n\n if (fnIsArray(members) !== true){\n throw \"ERROR: MEMBERS MUST BE AN ARRAY\";\n }\n\n members.forEach((member) => {\n removeMember(groupname, member);\n });\n\n return this;\n }\n };\n\n // \"shares\" namespace\n // where functions like \"config.shares.add(...)\" are located\n this.shares = {\n // shares.add()\n add: (sharename, path, rules) => {\n if (fnIsString(sharename) !== true){\n throw \"ERROR: SHARE NAME MUST BE A STRING\";\n }\n\n if (fnIsString(path) !== true){\n throw \"ERROR: SHARE PATH MUST BE A STRING\";\n }\n\n if (fnIsArray(rules) !== true){\n throw \"ERROR: SHARE RULES MUST BE AN ARRAY\";\n }\n\n const rules_safe = [];\n rules.forEach((rule) => {\n if (fnIsString(rule) !== true){\n throw \"ERROR: SHARE RULES MUST BE AN ARRAY OF STRINGS\";\n }\n rules_safe.push(rule);\n });\n\n if (this.shares.get().includes(sharename)){\n throw \"ERROR: SHARE ALREADY EXISTS\";\n }\n\n this[\"$shares\"].push({ \"name\": sharename, \"path\": path, \"access\": rules_safe });\n return this;\n },\n\n // shares.addArray()\n addArray: (input) => {\n if (fnIsArray(input) !== true){\n throw \"ERROR: INPUT MUST BE AN ARRAY\";\n }\n\n input.forEach((elem) => {\n if (fnHas(elem, [\"name\", \"path\", \"access\"]) !== true){\n throw \"ERROR: INPUT IS NOT VALID\";\n }\n this.shares.add(elem[\"name\"], elem[\"path\"], elem[\"access\"]);\n });\n\n return this;\n },\n\n // shares.remove()\n remove: (sharename = undefined) => {\n if (fnIsArray(sharename)){\n sharename.forEach((e) => {\n this.shares.remove(e);\n });\n return this;\n }\n\n let index = undefined;\n this[\"$shares\"].forEach((share, i) => {\n if (share[\"name\"] === sharename){\n index = i;\n }\n });\n\n if (index !== undefined && index >= 0){\n this[\"$share\"].splice(index, 1);\n }\n\n return this;\n },\n\n // shares.get()\n get: (sharename = undefined) => {\n if (sharename === undefined){\n const result = [];\n this[\"$shares\"].forEach((share) => {\n result.push(share[\"name\"]);\n });\n return result;\n }\n\n let index = undefined;\n this[\"$shares\"].forEach((share, i) => {\n if (share[\"name\"] === sharename){\n index = i;\n }\n });\n\n if (index === undefined){\n throw \"ERROR: SHARE NOT FOUND\";\n }\n\n return JSON.parse(JSON.stringify(this[\"$shares\"][index]));\n },\n\n // shares.getAll()\n getAll: () => {\n const result = [];\n const elems = this.shares.get();\n elems.forEach((elem) => {\n result.push(this.shares.get(elem));\n });\n return result;\n },\n\n // shares.addRules()\n addRules: (sharename, rules) => {\n const addRule = (sharename, rule) => {\n if (fnIsString(rule) !== true){\n throw \"ERROR: RULE MUST BE A STRING\";\n }\n\n let index = undefined;\n this[\"$shares\"].forEach((share, i) => {\n if (share[\"name\"] === sharename){\n index = i;\n }\n });\n\n if (index === undefined){\n throw \"ERROR: SHARE NOT FOUND\";\n }\n\n this[\"$shares\"][index][\"access\"].push(rule);\n };\n\n if (fnIsArray(rules) !== true){\n throw \"ERROR: RULES MUST BE AN ARRAY\";\n }\n\n rules.forEach((rule) => {\n addRule(sharename, rule);\n });\n\n return this;\n },\n\n // shares.removeRules()\n removeRules: (sharename, rules) => {\n const removeRule = (sharename, rule) => {\n if (fnIsString(rule) !== true){\n throw \"ERROR: RULE MUST BE A STRING\";\n }\n\n let index = undefined;\n this[\"$shares\"].forEach((share, i) => {\n if (share[\"name\"] === sharename){\n index = i;\n }\n });\n\n if (index === undefined){\n throw \"ERROR: SHARE NOT FOUND\";\n }\n\n const temp = this[\"$shares\"][index][\"access\"];\n if (temp.includes(rule) === true){\n temp.splice(temp.indexOf(rule), 1);\n }\n };\n\n if (fnIsArray(rules) !== true){\n throw \"ERROR: RULES MUST BE AN ARRAY\";\n }\n\n rules.forEach((rule) => {\n removeRule(sharename, rule);\n });\n\n return this;\n },\n\n // shares.removeAllRules()\n removeAllRules: (sharename, rules = undefined) => {\n if (this.shares.get().includes(sharename) !== true){\n throw \"ERROR: SHARE NOT FOUND\";\n }\n\n let rulesToDelete = undefined;\n\n if (fnIsArray(rules) !== true){\n rulesToDelete = this.shares.get(sharename)[\"access\"];\n }\n else {\n rulesToDelete = rules;\n }\n\n rulesToDelete.forEach((ruleToDelete) => {\n while (this.shares.get(sharename)[\"access\"].includes(ruleToDelete) === true){\n this.shares.removeRules(sharename, [ruleToDelete]);\n }\n });\n\n return this;\n },\n\n // shares.removeRuleAt()\n removeRuleAt: (sharename, ruleIndex) => {\n if (fnIsInteger(ruleIndex) !== true || ruleIndex < 0){\n throw \"ERROR: RULE INDEX MUST BE A POSITIVE INTEGER\";\n }\n\n let index = undefined;\n this[\"$shares\"].forEach((share, i) => {\n if (share[\"name\"] === sharename){\n index = i;\n }\n });\n\n if (index === undefined){\n throw \"ERROR: SHARE NOT FOUND\";\n }\n\n if (this[\"$shares\"][index][\"access\"].length > ruleIndex){\n this[\"$shares\"][index][\"access\"].splice(ruleIndex, 1);\n }\n\n return this;\n },\n\n // shares.setPath()\n setPath: (sharename, path) => {\n if (fnIsString(path) !== true){\n throw \"ERROR: PATH MUST BE A STRING\";\n }\n\n let index = undefined;\n this[\"$shares\"].forEach((share, i) => {\n if (share[\"name\"] === sharename){\n index = i;\n }\n });\n\n if (index === undefined){\n throw \"ERROR: SHARE NOT FOUND\";\n }\n\n this[\"$shares\"][index][\"path\"] = path;\n\n return this;\n }\n };\n\n return this;\n }", "async function initializeUsers() {\n try {\n await createUser({\n username: 'guest',\n password: 'password',\n admin: false\n });\n\n await createUser({\n username: 'admin',\n password: 'adminpassword',\n admin: true\n });\n\n await createUser({\n username: 'updateMe',\n password: 'password',\n admin: true\n });\n\n await createUser({\n username: 'brody',\n password: 'password',\n admin: true\n });\n\n await createUser({\n username: 'sam',\n password: 'password',\n admin: true\n });\n\n await createUser({\n username: 'tyler',\n password: 'password',\n admin: true\n });\n\n await createUser({\n username: 'deleteMe',\n password: 'password'\n });\n } catch (error) {\n throw error;\n }\n}", "loadUsers() {\n this.users = this.store.getValue('user-settings');\n }", "constructor() { \n \n OrgApacheJackrabbitOakSecurityUserUserConfigurationImplProperties.initialize(this);\n }", "function users() {\n return {\n Seppe: {\n username: 'Seppe',\n password: 'valid',\n },\n Ludwig: {\n username: 'Ludiewieg',\n password: 'AlsoValid',\n },\n Admin: {\n username: 'admin',\n password: 'secret',\n },\n };\n }", "function init() {\n \n newUser()\n\n}", "function init(){\r\n getConfig(function(config){\r\n loadUserData(config.username, 5);\r\n });\r\n}", "function User(config) {\n var params = config || {};\n this.userid = params.userid;\n this.username = params.username;\n this.email = params.email;\n this.hashedPassword = params.hashedPassword;\n this.registered = params.registered;\n this.updated = params.updated;\n this.active = params.active;\n}", "function UserController() {}", "function _createUsers() {\r\n var users = loadFromStorage(STORAGE_KEY);\r\n if (!users || !users.length) {\r\n users = [\r\n { name: 'Tesla', pass: 'secret', isAdmin: false },\r\n { name: 'Morph', pass: 'morphmorph', isAdmin: false },\r\n { name: 'Leaf', pass: 'admin', isAdmin: true }\r\n ].map(_createUser);\r\n }\r\n gUsers = users;\r\n _saveUsersToStorage();\r\n}", "function setUsers(users) {\n return {\n type: \"SET_USERS\",\n users\n }\n}", "function configure(opts) {\n var port = opts && typeof opts.port !== 'undefined' ? opts.port : 8000;\n var editOn = opts && typeof opts.editOn !== 'undefined' ? opts.editOn : 'edit';\n var editOff = opts && typeof opts.editOff !== 'undefined' ? opts.editOff : 'edit_off';\n var config = {\n adminTitle: 'Log in | Django site admin',\n // TODO:\n // - configure languages with djangocms-helper\n // - remove hardcoded host, port, language values\n baseUrl: 'http://localhost:' + port + '/en/',\n editUrl: 'http://localhost:' + port + '/en/?' + editOn,\n editOffUrl: 'http://localhost:' + port + '/en/?edit_off',\n adminUrl: 'http://localhost:' + port + '/en/admin/login/',\n adminLogoutUrl: 'http://localhost:' + port + '/en/admin/logout/',\n adminPagesUrl: 'http://localhost:' + port + '/en/admin/cms/page/',\n adminUsersUrl: 'http://localhost:' + port + '/en/admin/auth/user/',\n credentials: {\n username: 'admin',\n password: 'admin'\n },\n content: {\n page: {\n title: 'First page',\n text: 'First page content'\n }\n },\n user: {\n firstName: 'test-first-name',\n lastName: 'test-last-name',\n userEmail: 'test@email.com',\n username: 'test-add-user',\n password: 'test'\n }\n };\n\n return config;\n}", "function adminUserInit()\n\t{\n\t\tnavigationInit(\"adminUser\", \"web_admin_user\");\n\t}", "function useDummy() {\n //put dummy user to be loaded in here.\n }", "function _usersServices() {\n\tlet baseUrl = 'http://localhost:5050/users'\n\n\tthis.get = function($http) {\n\t\treturn $http.get(baseUrl)\n\t}\n}", "function initUsers (){\n UserService.getAllUsers()\n .success(function(data){\n $scope.users = data;\n })\n .error(function(data) {\n console.log('Error '+data);\n });\n }", "function loadUsers(callback) {\n\t\tloadDir([ dir, 'users' ].join('/'), function(filename, contents) {\n\t\t\tvar user = yaml.safeLoad(contents);\n\t\t\tuser.cn = user.uid = fileUid(filename);\n\t\t\tif ( !user.publicKeys ) user.publicKeys = [];\n\t\t\treturn user;\n\t\t}, callback)\n\t}", "function buildUsers() {\n return [\"users\"];\n}", "constructor() {\n this.datastore = require('../data/Datastore');\n if (this.datastore.users.length === 0) {\n this.createDefaultUsers();\n }\n }", "_define_user() {\n if ( GenericStore.defaultUserId ) {\n this.definedProps[ 'uid' ] = GenericStore.defaultUserId;\n }\n }", "async storeUserSettings() {\n const c = await ConfigUtils.loadConfigFile(this.configFilePath);\n if(!c) {\n return;\n }\n Object.entries(c).forEach(([name, config]) => {\n Object.entries(config).forEach(([key, val]) => {\n this.set(`${name}.${key}`, val);\n });\n });\n }", "function user()\n {\n\n }", "function registerUser() {\n addUser()\n }", "function setUserData() {\n //TODO: for non-social logins - userService is handling this - not a current issue b/c there is no data for these right after reg, but needs to be consistent!\n authService.setUserCUGDetails();\n authService.setUserLocation();\n authService.setUserPreferences();\n authService.setUserBio();\n authService.setUserBookings();\n authService.setUserFavorites();\n authService.setUserReviews();\n authService.setSentryUserContext();\n authService.setSessionStackUserContext();\n\n //was a noop copied from register controller: vm.syncProfile();\n }", "function init() {\n AdminService\n .adminFindAllUsers()\n .then(handleSuccess, handleError);\n }", "constructor() { \n \n BaseUserMeAllOf.initialize(this);\n }", "constructor() {\n this.idUser;\n this.emailUser;\n this.nameUser;\n this.passwordUser;\n }", "function Admin(name){\n User.apply(this, arguments);\n}", "createDefaultUsers() {\n this.datastore.users.push(new UserDTO(1, 'stina', null));\n this.datastore.users.push(new UserDTO(2, 'nisse', null));\n }", "getAllUsers() {\n return Api.get(\"/admin/user-list\");\n }", "function initUserRegistration(){\n return authorizedCall('api/v4/admin/user/init-user-registration', { }); // we need to make this a post\n}", "function Users(){\n\tthis.baseURL = options.ws_url;\n\tprocess.env.NODE_TLS_REJECT_UNAUTHORIZED = \"0\";\n}", "function createUser() {}", "function UsersService(http) {\n this.http = http;\n // private instance variable to hold base url\n this.usersUrl = app_settings_1.AppSettings.API_ENDPOINT + '/members';\n console.log('in user service');\n }", "function SiteUsers(baseUrl, path) {\n if (path === void 0) { path = \"siteusers\"; }\n return _super.call(this, baseUrl, path) || this;\n }", "function SiteUsers(baseUrl, path) {\n if (path === void 0) { path = \"siteusers\"; }\n return _super.call(this, baseUrl, path) || this;\n }", "constructor() { \n UserBase.initialize(this);UserAllOf.initialize(this);\n User.initialize(this);\n }", "function user(){\r\n uProfile(req, res);\r\n }", "function initUserPools(cb) {\n\tlogger.info('initUserPools');\n\n\tif (Conf.samlDelegation) {\n\t\tConf.samlDelegation.log = logger[Conf.samlDelegation.loglevel];\n\t\twssclient = new WSS.client(Conf.samlDelegation);\n\t}\n\n\tuserPools = {};\n\tsetInterval(cleanupUserPools, Conf.userpool.CLEANUP_INTERVAL * 1000);\t// setup periodic cleanup routine\n\n\t// user pools are initialized on-demand\n\tif (cb) return cb();\n}", "function initialize_shit(){\n\tif(!user_exists('default')){\n\t\tadd_user('default', '', patients_default);\n\t}\n}", "function addUser() {\n }", "users(parent, args, ctx, info) {\n return USERS_DATA;\n }", "function setup(){\n\t// Admin User\n\tconst url = '/newUser';\n\tconst admin = {\n\t\tfullName: 'Master',\n\t\tusername: 'root',\n\t\tpassword: 'csc309',\n\t\trole: 'admin'\n\t}\n\tconst request = new Request (url, {\n\t\t\tmethod: 'post',\n\t\t\tbody: JSON.stringify(admin),\n\t\t\theaders: {\n\t\t\t\t'Accept': 'application/json, text/plain, */*',\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t},\n\t});\n\taddRequest(request);\n\n\t// Landlord\n\tconst landlord = {\n\t\tfullName: 'Monica Geller',\n\t\tusername: 'monicaG',\n\t\tpassword: 'test1',\n\t\trole: 'landlord',\n\t\temail: 'monicaG@gmail.com',\n\t\tclaims: [],\n\t\tproperty: []\n\t}\n\tconst request2 = new Request (url, {\n\t\t\tmethod: 'post',\n\t\t\tbody: JSON.stringify(landlord),\n\t\t\theaders: {\n\t\t\t\t'Accept': 'application/json, text/plain, */*',\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t},\n\t});\n\taddRequest(request2);\n\n\t//Tenant\n\tconst tenant = {\n\t\tfullName: 'Rachel Green',\n\t\tusername: 'rachelG',\n\t\tpassword: 'test2',\n\t\trole: 'tenant',\n\t\temail: 'rachelG@gmail.com',\n\t\tclaims: [],\n\t\tproperty: []\n\t}\n\tconst request3 = new Request (url, {\n\t\t\tmethod: 'post',\n\t\t\tbody: JSON.stringify(tenant),\n\t\t\theaders: {\n\t\t\t\t'Accept': 'application/json, text/plain, */*',\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t},\n\t});\n\taddRequest(request3);\n}", "SET_USERS( state, data ){\n state.users = data;\n }", "function initializeUsers() {\n username = localStorage.getItem('staySignedInAs')\n if (username !== null) {\n useDefaults = localStorage.getItem('Defaults Used?' + username + 'Kixley@65810')\n useDefaults = parseBool(useDefaults)\n if (useDefaults === false) {\n useDefaultDiff = localStorage.getItem('Default Diff Used?' + username + 'Kixley@65810')\n useDefaultDiff = parseBool(useDefaultDiff)\n useDefaultClass = localStorage.getItem('Default Class Used?' + username + 'Kixley@65810')\n useDefaultClass = parseBool(useDefaultClass)\n }\n }\n}", "function addUser() {\n var user = {\n primaryEmail: 'liz@example.com',\n name: {\n givenName: 'Elizabeth',\n familyName: 'Smith'\n },\n // Generate a random password string.\n password: Math.random().toString(36)\n };\n user = AdminDirectory.Users.insert(user);\n Logger.log('User %s created with ID %s.', user.primaryEmail, user.id);\n}", "async createDefaultUsers() {\n /* Get the array of the default users */\n const { defaultUsers } = config;\n\n /* Loop through the array of default users and create each one */\n defaultUsers.forEach( async user => {\n /* Check whether the user already exists */\n const existing = await User.findOne({ email: user.email }).exec();\n\n if ( !existing ) {\n /* The user doesn't exist create a new one */\n const newUser = new User( user );\n await newUser.save();\n\n Logger.info( `Created default user with email ${user.email}` );\n } else {\n Logger.info( `Default user with email ${user.email} already exists` );\n }\n });\n }", "function setupUserView()\r\n {\r\n // Fill all text boxes with data for user role\r\n\t$('.firstName').val(ISOC_TECH_FIRST_NAME);\r\n\t$('.lastName').val(ISOC_TECH_LAST_NAME);\r\n\t$('.email').val(ISOC_TECH_EMAIL);\r\n\t$('.secretWord').val(ISOC_TECH_SECRET_WORD);\r\n\t$('.role-text').val(ISOC_TECH_ROLE);\r\n\t$('.shift').val(ISOC_TECH_SHIFT);\r\n\t$('.id').val(ISOC_TECH_EMPLOYEE_ID);\r\n\t\t\t\t\t\r\n\t//Hide drop downs for Admin\r\n\t$('.role-select').hide();\r\n\t$('.adminUserPicker').hide();\r\n\t\t\t\t\t\r\n\t//show textboxes for users\r\n\t$('.role-text').show();\r\n\t\t\t\t\t\r\n\t// modify textboxes to be read only\r\n\t$('.role-text').attr('readonly', true);\r\n }", "async setUserData() {\n\t\tvar userinfo;\n\t\tawait AppX.fetch('User', 'self').then(async result => {\n\t\t\tvar info = result.data;\n\t\t\tglobal.userLogin = info.login;\n\n\t\t\tawait AppX.fetch('OrganizationDetail', info.organizationUid).then(result => {\n\t\t\t\tglobal.userOrgName = result.data.name;\n\t\t\t});\n\n\t\t});\n\t}", "function setup() {\n User.sync({ force: true }) // Using 'force: true' for demo purposes. It drops the table users if it already exists and then creates a new one.\n .then(function() {\n // Add default users to the database\n for (var i = 0; i < users.length; i++) {\n // loop through all users\n User.create({ name: users[i] }); // create a new entry in the users table\n }\n });\n}", "function configure() {\n\n\t\n}", "static getUsers() {\n return API.fetcher(\"/user\");\n }", "function configure_first_start()\n{\n check_first_start((is_first_start) => {\n console.log(\"IS FIRST START: \" + is_first_start)\n const ADMINMAIL = process.env.ADMIN_EMAIL\n const ADMIN_PW = process.env.INITIAL_ADMIN_PASSWORD\n if (is_first_start)\n {\n if (ADMINMAIL && ADMIN_PW)\n register_user(\"admin\", ADMINMAIL, ADMIN_PW)\n else\n console.log(\"Please configure admin user in env file accordingly to the example.\")\n }\n })\n}", "function listAdminUsers(arg) {\n\n\tif ('undefined' !== typeof arg && ('-h' === arg || '--help' === arg || 'help' === arg)) {\n\t\n\t\tactionHelp(\"adminUser list\", 'View a list of all admin users.', '');\n\t\treturn process.exit();\n\t\n\t}\n\telse if ('undefined' !== typeof arg) {\n\t\n\t\tconsole.log('\"adminUser list\" does not accept any arguments.');\n\t\treturn process.exit();\n\t\n\t}\n// \tvar users = new UserModel();\n\tglobal.Uwot.Users.listUsers(function(error, userList) {\n\t\n\t\tif (error) {\n\t\t\n\t\t\tconsole.log(error.message);\n\t\t\treturn process.exit();\n\t\t\n\t\t}\n\t\tif (!userList || userList.length < 1) {\n\t\t\n\t\t\tconsole.log('No admin users. Use \"adminUser add\" to create an admin user.');\n\t\t\treturn process.exit();\n\t\t\n\t\t}\n\t\ttitleBlock('Available Admin Users:');\n\t\tconsole.log(' id username name sudoer');\n\t\tconsole.log(' --------------------------------------------------------------------------------------------');\n\n\t\tfor (let i = 0; i < userList.length; i++) {\n\t\t\n\t\t\tvar logLine = ' ' + userList[i]._id;\n\t\t\tfor (let sp = 23 - userList[i]._id.toString().length; sp > 0; sp--) {\n\t\t\t\n\t\t\t\tlogLine += ' ';\n\t\t\t\n\t\t\t}\n\t\t\tlogLine += userList[i].uName;\n\t\t\tfor (let sp = 21 - userList[i].uName.toString().length; sp > 0; sp--) {\n\t\t\t\n\t\t\t\tlogLine += ' ';\n\t\t\t\n\t\t\t}\n\t\t\tvar fullName;\n\t\t\tif (null === userList[i].fName && null === userList[i].lName) {\n\t\t\t\n\t\t\t\tfullName = \"*NONE*\";\n\t\t\t\n\t\t\t}\n\t\t\telse if (null === userList[i].lName) {\n\t\t\t\n\t\t\t\tfullName = userList[i].fName;\n\t\t\t\n\t\t\t}\n\t\t\telse if (null === userList[i].fName) {\n\t\t\t\n\t\t\t\tfullName = userList[i].lName;\n\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\n\t\t\t\tfullName = userList[i].lName + ', ' + userList[i].fName;\n\t\t\t\n\t\t\t}\n\t\t\tlogLine += fullName;\n\t\t\tfor (let sp = 41 - fullName.length; sp > 0; sp--) {\n\t\t\t\n\t\t\t\tlogLine += ' ';\n\t\t\t\n\t\t\t}\n\t\t\tlogLine += userList[i].sudoer;\n\t\t\tconsole.log(logLine);\n\t\t\n\t\t}\n\t\treturn process.exit();\n\t\t\n\n\t});\n\n}", "constructor() {\n this.rutasUser = new user_controller_1.ControllerUser();\n this.app = express_1.default();\n this.app.use(express_1.default.json());\n this.app.use(morgan_1.default('dev'));\n // inicio routes\n this.rutasUser.routes(this.app);\n }", "async initAdminUser () {\n // TODO : Combine try / catch\n\n // Check if admin user already exists\n const adminUser = this.authConfigs.local.admin.username\n const adminUserDoc = await model.auth.get(adminUser)\n\n const passwordPath = this.authConfigs.local.admin.passwordPath\n if (!_.isEmpty(adminUserDoc) && !(await fs.pathExists(passwordPath))) {\n logger.info({\n message: 'Admin password has been deleted. Recreating an admin user'\n })\n await model.auth.remove(adminUserDoc._id)\n } else if (!_.isEmpty(adminUserDoc)) {\n logger.info({ message: 'Admin user is already configured' })\n return\n } else {\n logger.info({\n message: 'Admin user is not configured. Starting configuration'\n })\n }\n\n // Read or generate password for admin\n let password\n try {\n await fs.ensureFile(passwordPath)\n password = (await fs.readFile(passwordPath)).toString()\n // NOTE: never use special characters. when $ is included in a password,\n // it can cause a HUGE trouble when used it as a Gitlab CI variable.\n password = passGenerator.generate({\n length: 20,\n uppercase: true,\n symbols: false,\n numbers: true\n })\n await fs.writeFile(passwordPath, password)\n logger.info({\n message: `Generated password file for admin user at ${passwordPath}`\n })\n } catch (err) {\n const error = new Error(\n `Failed to generate password file at ${passwordPath}`\n )\n error.extra = err\n throw error\n }\n\n // Confirm password file\n const passwordWritten = (await fs.readFile(passwordPath)).toString()\n if (passwordWritten != password) {\n throw new Error(\n `Password written at ${passwordPath} doesn't match with original password`\n )\n }\n\n // Generate password has using bcrypt\n let passwordHash\n try {\n const saltRounds = this.authConfigs.local.saltRounds\n passwordHash = await bcrypt.hash(password, saltRounds)\n logger.info({\n message: `Generated password hash for admin user using bcrypt`\n })\n } catch (err) {\n const error = new Error(\n `Failed to generate password hash for \"${adminUser}\"`\n )\n error.extra = err\n throw error\n }\n\n // Create a new user object for admin\n try {\n const newUser = {\n _id: adminUser,\n admin: true,\n username: adminUser,\n name: 'Administrator',\n email: `${adminUser}@${this.authConfigs.local.domain}`,\n local: true,\n localPasswordHash: passwordHash\n }\n const adminUserObj = await model.auth.create(newUser)\n logger.info({ message: `Created admin user \"${adminUser}\"` })\n } catch (err) {\n const error = new Error(`Failed to create admin user \"${adminUser}\"`)\n error.extra = err\n throw error\n }\n }", "constructor(){\n // in order to know which ConfigGen.js version we're using\n this.easysambaVersion = \"1.12\";\n\n // internal variables used by an instance of ConfigGen\n this[\"$domain\"] = \"WORKGROUP\";\n this[\"$version\"] = undefined;\n this[\"$global\"] = undefined;\n this[\"$users\"] = [];\n this[\"$groups\"] = [];\n this[\"$shares\"] = [];\n\n // events\n this[\"$on-user-add\"] = [];\n this[\"$on-user-remove\"] = [];\n this[\"$on-user-change\"] = [];\n this[\"$on-user-change-password\"] = [];\n this[\"$on-group-add\"] = [];\n this[\"$on-group-remove\"] = [];\n this[\"$on-group-change\"] = [];\n this[\"$on-group-change-members\"] = [];\n this[\"$on-share-add\"] = [];\n this[\"$on-share-remove\"] = [];\n this[\"$on-share-change\"] = [];\n this[\"$on-share-change-access\"] = [];\n this[\"$on-share-change-path\"] = [];\n this[\"$on-share-change-guest\"] = [];\n\n // internal trigger function for events\n this[\"$trigger\"] = (event, current, previous = undefined) => {\n if (fnHas(this, `$on-${event}`) !== true){\n return;\n }\n\n const cbs = this[`$on-${event}`];\n cbs.forEach((cb) => {\n if (previous !== undefined){\n cb(current, previous);\n }\n else {\n cb(current);\n }\n });\n };\n\n // internal variable for config.shares.setFixedRules() function\n this[\"$fixedrules\"] = { \"shares\": undefined, \"rules\": [] };\n\n // \"users\" namespace\n // where functions like \"config.users.add(...)\" are located\n this.users = {\n // config.users.add()\n add: (...args) => {\n let username = undefined;\n let password = undefined;\n\n if (args.length === 1){\n username = args[0];\n }\n else if (args.length === 2){\n username = args[0];\n password = args[1];\n }\n else {\n throw new Error(\"ERROR: INVALID ARGUMENTS\");\n }\n\n if (password === undefined || fnIsInteger(password)){\n const len = (password === undefined || password < 4) ? 12 : password;\n password = this.constructor.genRandomPassword(len);\n }\n\n if (fnIsString(username) !== true || fnIsString(password) !== true){\n throw new Error(\"ERROR: USERNAME AND PASSWORD MUST BE STRINGS\");\n }\n\n if (this.users.get().includes(username)){\n throw new Error(\"ERROR: USER ALREADY EXISTS\");\n }\n\n this[\"$users\"].push({ \"name\": username, \"password\": password });\n\n // trigger event \"user-add\"\n this[\"$trigger\"](\"user-add\", this.users.get(username));\n\n return this;\n },\n\n // config.users.addArray()\n addArray: (input) => {\n if (fnIsArray(input) !== true){\n throw new Error(\"ERROR: INPUT MUST BE AN ARRAY\");\n }\n\n input.forEach((elem) => {\n if (fnHas(elem, \"name\") !== true){\n throw new Error(\"ERROR: INPUT IS NOT VALID\");\n }\n this.users.add(elem[\"name\"], (fnHas(elem, \"password\")) ? elem[\"password\"] : undefined);\n });\n\n return this;\n },\n\n // config.users.remove()\n remove: (username) => {\n if (fnIsArray(username)){\n username.forEach((e) => {\n this.users.remove(e);\n });\n return this;\n }\n\n if (fnIsString(username) !== true){\n throw new Error(\"ERROR: USERNAME MUST BE A STRING\");\n }\n\n const index = this.users.get().indexOf(username);\n\n let removedUser = undefined;\n if (index >= 0){\n removedUser = this.users.get(username);\n this[\"$users\"].splice(index, 1);\n }\n\n // trigger event \"user-remove\"\n if (removedUser !== undefined){\n this[\"$trigger\"](\"user-remove\", removedUser);\n }\n\n return this;\n },\n\n // config.users.get()\n get: (...args) => {\n if (args.length < 1){\n return this[\"$users\"].map((e) => { return e[\"name\"]; });\n }\n\n const username = args[0];\n if (fnIsString(username) !== true){\n throw new Error(\"ERROR: USERNAME MUST BE A STRING\");\n }\n\n const index = this.users.get().indexOf(username);\n\n if (index < 0){\n throw new Error(\"ERROR: USER NOT FOUND\");\n }\n\n return fnCopy(this[\"$users\"][index]);\n },\n\n // config.users.getAll()\n getAll: () => {\n return fnCopy(this[\"$users\"]);\n },\n\n // config.users.setPassword()\n setPassword: (username, password) => {\n if (fnIsString(username) !== true || fnIsString(password) !== true){\n throw new Error(\"ERROR: USERNAME AND PASSWORD MUST BE STRINGS\");\n }\n\n const index = this.users.get().indexOf(username);\n\n if (index < 0){\n throw new Error(\"ERROR: USER NOT FOUND\");\n }\n\n const previous = this.users.get(username);\n this[\"$users\"][index][\"password\"] = password;\n\n // trigger event \"user-change\" and \"user-change-password\"\n const current = this.users.get(username);\n if (current[\"password\"] !== previous[\"password\"]){\n this[\"$trigger\"](\"user-change\", current, previous);\n this[\"$trigger\"](\"user-change-password\", current, previous);\n }\n\n return this;\n }\n };\n\n // \"groups\" namespace\n // where functions like \"config.groups.add(...)\" are located\n this.groups = {\n // config.groups.add()\n add: (groupname, members) => {\n if (fnIsString(groupname) !== true){\n throw new Error(\"ERROR: GROUP NAME MUST BE A STRING\");\n }\n\n if (fnIsArray(members) !== true || members.every(fnIsString) !== true){\n throw new Error(\"ERROR: MEMBERS MUST BE AN ARRAY OF STRINGS\");\n }\n\n if (this.groups.get().includes(groupname)){\n throw new Error(\"ERROR: GROUP ALREADY EXISTS\");\n }\n\n const members_unique = members.filter((e) => { return (members.indexOf(e) === members.lastIndexOf(e)); });\n\n this[\"$groups\"].push({ \"name\": groupname, \"members\": members_unique });\n\n // trigger event \"group-add\"\n this[\"$trigger\"](\"group-add\", this.groups.get(groupname));\n\n return this;\n },\n\n // config.groups.addArray()\n addArray: (input) => {\n if (fnIsArray(input) !== true){\n throw new Error(\"ERROR: INPUT MUST BE AN ARRAY\");\n }\n\n input.forEach((elem) => {\n if (fnHas(elem, [\"name\", \"members\"]) !== true){\n throw new Error(\"ERROR: INPUT IS NOT VALID\");\n }\n this.groups.add(elem[\"name\"], elem[\"members\"]);\n });\n\n return this;\n },\n\n // config.groups.remove()\n remove: (groupname) => {\n if (fnIsArray(groupname)){\n groupname.forEach((e) => {\n this.groups.remove(e);\n });\n return this;\n }\n\n if (fnIsString(groupname) !== true){\n throw new Error(\"ERROR: GROUP NAME MUST BE A STRING\");\n }\n\n const index = this.groups.get().indexOf(groupname);\n\n let removedGroup = undefined;\n if (index >= 0){\n removedGroup = this.groups.get(groupname);\n this[\"$groups\"].splice(index, 1);\n }\n\n // trigger event \"group-remove\"\n if (removedGroup !== undefined){\n this[\"$trigger\"](\"group-remove\", removedGroup);\n }\n\n return this;\n },\n\n // config.groups.get()\n get: (...args) => {\n if (args.length < 1){\n return this[\"$groups\"].map((e) => { return e[\"name\"]; });\n }\n\n const groupname = args[0];\n\n if (fnIsString(groupname) !== true){\n throw new Error(\"ERROR: GROUP NAME MUST BE A STRING\");\n }\n\n const index = this.groups.get().indexOf(groupname);\n\n if (index < 0){\n throw new Error(\"ERROR: GROUP NOT FOUND\");\n }\n\n return fnCopy(this[\"$groups\"][index]);\n },\n\n // config.groups.getAll()\n getAll: () => {\n return fnCopy(this[\"$groups\"]);\n },\n\n // config.groups.addMembers()\n addMembers: (groupname, members) => {\n const addMember = (groupname, member) => {\n if (this[\"$groups\"][index][\"members\"].includes(member) !== true){\n this[\"$groups\"][index][\"members\"].push(member);\n }\n };\n\n if (fnIsString(groupname) !== true){\n throw new Error(\"ERROR: GROUP NAME MUST BE A STRING\");\n }\n\n if (fnIsArray(members) !== true || members.every(fnIsString) !== true){\n throw new Error(\"ERROR: MEMBERS MUST BE AN ARRAY OF STRINGS\");\n }\n\n const index = this.groups.get().indexOf(groupname);\n\n if (index < 0){\n throw new Error(\"ERROR: GROUP NOT FOUND\");\n }\n\n const previous = this.groups.get(groupname);\n members.forEach((member) => {\n if (this[\"$groups\"][index][\"members\"].includes(member) !== true){\n this[\"$groups\"][index][\"members\"].push(member);\n }\n });\n\n // trigger event \"group-change\" and \"group-change-members\"\n const current = this.groups.get(groupname);\n if (fnEqualArrays(current[\"members\"], previous[\"members\"]) !== true){\n this[\"$trigger\"](\"group-change\", current, previous);\n this[\"$trigger\"](\"group-change-members\", current, previous);\n }\n\n return this;\n },\n\n // config.groups.removeMembers()\n removeMembers: (groupname, members) => {\n if (fnIsString(groupname) !== true){\n throw new Error(\"ERROR: GROUP NAME MUST BE A STRING\");\n }\n\n if (fnIsArray(members) !== true || members.every(fnIsString) !== true){\n throw new Error(\"ERROR: MEMBERS MUST BE AN ARRAY OF STRINGS\");\n }\n\n const index = this.groups.get().indexOf(groupname);\n\n if (index < 0){\n throw new Error(\"ERROR: GROUP NOT FOUND\");\n }\n\n const previous = this.groups.get(groupname);\n members.forEach((member) => {\n const memberIndex = this[\"$groups\"][index][\"members\"].indexOf(member);\n if (memberIndex >= 0){\n this[\"$groups\"][index][\"members\"].splice(memberIndex, 1);\n }\n });\n\n // trigger event \"group-change\" and \"group-change-members\"\n const current = this.groups.get(groupname);\n if (fnEqualArrays(current[\"members\"], previous[\"members\"]) !== true){\n this[\"$trigger\"](\"group-change\", current, previous);\n this[\"$trigger\"](\"group-change-members\", current, previous);\n }\n\n return this;\n }\n };\n\n // \"shares\" namespace\n // where functions like \"config.shares.add(...)\" are located\n this.shares = {\n // config.shares.add()\n add: (...args) => {\n let sharename = undefined;\n let path = undefined;\n let access = undefined;\n let guest = \"no\";\n\n if (args.length === 3){\n sharename = args[0];\n path = args[1];\n access = (fnIsArray(args[2])) ? args[2] : [];\n guest = (fnIsString(args[2])) ? args[2] : \"no\";\n }\n else if (args.length === 4){\n sharename = args[0];\n path = args[1];\n access = args[2];\n guest = args[3];\n }\n else {\n throw new Error(\"ERROR: INPUT IS NOT VALID\");\n }\n\n if (fnIsString(sharename) !== true){\n throw new Error(\"ERROR: SHARE NAME MUST BE A STRING\");\n }\n\n if (fnIsString(path) !== true){\n throw new Error(\"ERROR: SHARE PATH MUST BE A STRING\");\n }\n\n if (this.shares.get().includes(sharename)){\n throw new Error(\"ERROR: SHARE ALREADY EXISTS\");\n }\n\n if (fnIsArray(access) !== true || access.every(fnIsString) !== true){\n throw new Error(\"ERROR: SHARE ACCESS RULES MUST BE AN ARRAY OF STRINGS\");\n }\n\n if (guest !== \"rw\" && guest !== \"ro\" && guest !== \"no\") {\n throw new Error(\"ERROR: SHARE GUEST PROPERTY MUST BE EQUAL TO 'rw', 'ro' OR 'no'\");\n }\n\n const share = { \"name\": sharename, \"path\": path, \"access\": fnCopy(access) };\n if (guest !== \"no\"){\n share[\"guest\"] = guest;\n }\n this[\"$shares\"].push(share);\n\n // trigger event \"share-add\"\n this[\"$trigger\"](\"share-add\", this.shares.get(sharename));\n\n return this;\n },\n\n // config.shares.addArray()\n addArray: (input) => {\n if (fnIsArray(input) !== true){\n throw new Error(\"ERROR: INPUT MUST BE AN ARRAY\");\n }\n\n input.forEach((elem) => {\n if (fnHas(elem, [\"name\", \"path\"]) !== true){\n throw new Error(\"ERROR: INPUT IS NOT VALID\");\n }\n if (fnHas(elem, \"access\") !== true && fnHas(elem, \"guest\") !== true){\n throw new Error(\"ERROR: INPUT IS NOT VALID\");\n }\n this.shares.add(elem[\"name\"], elem[\"path\"], (fnHas(elem, \"access\")) ? elem[\"access\"] : [], (fnHas(elem, \"guest\")) ? elem[\"guest\"] : \"no\");\n });\n\n return this;\n },\n\n // config.shares.remove()\n remove: (sharename) => {\n if (fnIsArray(sharename)){\n sharename.forEach((e) => {\n this.shares.remove(e);\n });\n return this;\n }\n\n if (fnIsString(sharename) !== true){\n throw new Error(\"ERROR: SHARE NAME MUST BE A STRING\");\n }\n\n const index = this.shares.get().indexOf(sharename);\n\n let removedShare = undefined;\n if (index >= 0){\n removedShare = this.shares.get(sharename);\n this[\"$shares\"].splice(index, 1);\n }\n\n // trigger event \"share-remove\"\n if (removedShare !== undefined){\n this[\"$trigger\"](\"share-remove\", removedShare);\n }\n\n return this;\n },\n\n // config.shares.get()\n get: (...args) => {\n if (args.length < 1){\n return this[\"$shares\"].map((e) => { return e[\"name\"]; });\n }\n\n const sharename = args[0];\n\n if (fnIsString(sharename) !== true){\n throw new Error(\"ERROR: SHARE NAME MUST BE A STRING\");\n }\n\n const index = this.shares.get().indexOf(sharename);\n\n if (index < 0){\n throw new Error(\"ERROR: SHARE NOT FOUND\");\n }\n\n return fnCopy(this[\"$shares\"][index]);\n },\n\n // config.shares.getAll()\n getAll: () => {\n return fnCopy(this[\"$shares\"]);\n },\n\n // config.shares.addRules()\n addRules: (sharename, rules) => {\n if (fnIsString(sharename) !== true){\n throw new Error(\"ERROR: SHARE NAME MUST BE A STRING\");\n }\n\n if (fnIsArray(rules) !== true || rules.every(fnIsString) !== true){\n throw new Error(\"ERROR: RULES MUST BE AN ARRAY OF STRINGS\");\n }\n\n const index = this.shares.get().indexOf(sharename);\n if (index < 0){\n throw new Error(\"ERROR: SHARE NOT FOUND\");\n }\n\n this.shares.addRuleAt(sharename, rules, this.shares.get(sharename)[\"access\"].length);\n\n return this;\n },\n\n // config.shares.addRuleAt()\n addRuleAt: (sharename, rule, ruleIndex) => {\n // check parameters\n if (fnIsString(sharename) !== true){\n throw new Error(\"ERROR: SHARE NAME MUST BE A STRING\");\n }\n\n if (fnIsString(rule) !== true && (fnIsArray(rule) !== true || rule.every(fnIsString) !== true)){\n throw new Error(\"ERROR: RULE MUST BE A STRING OR AN ARRAY OF STRINGS\");\n }\n\n if (fnIsInteger(ruleIndex) !== true || ruleIndex < 0){\n throw new Error(\"ERROR: INDEX MUST BE A POSITIVE INTEGER\");\n }\n\n // find share's index\n const index = this.shares.get().indexOf(sharename);\n if (index < 0){\n throw new Error(\"ERROR: SHARE NOT FOUND\");\n }\n\n // check ruleIndex range\n if (ruleIndex > this.shares.get(sharename)[\"access\"].length){\n throw new Error(\"ERROR: INDEX OUT OF RANGE\");\n }\n\n const rules = (fnIsString(rule)) ? [rule] : rule;\n\n // add the rules at the specified ruleIndex\n const previous = this.shares.get(sharename);\n rules.forEach((e, i) => {\n this[\"$shares\"][index][\"access\"].splice(ruleIndex + i, 0, e);\n });\n\n // trigger event \"share-change\" and \"share-change-access\"\n const current = this.shares.get(sharename);\n if (fnEqualArrays(current[\"access\"], previous[\"access\"]) !== true){\n this[\"$trigger\"](\"share-change\", current, previous);\n this[\"$trigger\"](\"share-change-access\", current, previous);\n }\n\n return this;\n },\n\n // config.shares.removeRules()\n removeRules: (sharename, rules) => {\n if (fnIsString(sharename) !== true){\n throw new Error(\"ERROR: SHARE NAME MUST BE A STRING\");\n }\n\n if (fnIsArray(rules) !== true || rules.every(fnIsString) !== true){\n throw new Error(\"ERROR: RULES MUST BE AN ARRAY OF STRINGS\");\n }\n\n const index = this.shares.get().indexOf(sharename);\n if (index < 0){\n throw new Error(\"ERROR: SHARE NOT FOUND\");\n }\n\n const indices = rules.map((e) => {\n const i = this.shares.get(sharename)[\"access\"].indexOf(e);\n return (i < 0) ? undefined : i;\n }).filter((e, i, arr) => {\n return (arr.indexOf(e) === arr.lastIndexOf(e) && e !== undefined);\n });\n\n this.shares.removeRuleAt(sharename, indices);\n\n return this;\n },\n\n // config.shares.removeAllRules()\n removeAllRules: (...args) => {\n let sharename = undefined;\n let rulesToDelete = undefined;\n\n if (args.length === 1 && fnIsString(args[0])){\n sharename = args[0];\n rulesToDelete = this.shares.get(sharename)[\"access\"];\n }\n else if (args.length === 2 && fnIsString(args[0]) && fnIsArray(args[1]) && args[1].every(fnIsString)) {\n sharename = args[0];\n rulesToDelete = args[1];\n }\n else {\n throw new Error(\"ERROR: INPUT IS NOT VALID\");\n }\n\n if (this.shares.get().includes(sharename) !== true){\n throw new Error(\"ERROR: SHARE NOT FOUND\");\n }\n\n const indices = this.shares.get(sharename)[\"access\"].filter((e) => {\n return rulesToDelete.includes(e);\n }).map((e, i) => {\n return i;\n });\n\n this.shares.removeRuleAt(sharename, indices);\n\n return this;\n },\n\n // config.shares.removeRuleAt()\n removeRuleAt: (sharename, ruleIndices) => {\n if (fnIsString(sharename) !== true){\n throw new Error(\"ERROR: SHARE NAME MUST BE A STRING\");\n }\n\n if (fnIsInteger(ruleIndices) !== true && (fnIsArray(ruleIndices) !== true || ruleIndices.every(fnIsInteger) !== true)){\n throw new Error(\"ERROR: RULE INDEX MUST BE A POSITIVE INTEGER OR AN ARRAY OF POSITIVE INTEGERS\");\n }\n\n const index = this.shares.get().indexOf(sharename);\n\n if (index < 0){\n throw new Error(\"ERROR: SHARE NOT FOUND\");\n }\n\n const previous = this.shares.get(sharename);\n const indices = (fnIsInteger(ruleIndices)) ? [ruleIndices] : ruleIndices;\n this[\"$shares\"][index][\"access\"] = this[\"$shares\"][index][\"access\"].map((e, i) => {\n return (indices.includes(i)) ? undefined : e;\n });\n while (this[\"$shares\"][index][\"access\"].includes(undefined)){\n this[\"$shares\"][index][\"access\"].splice(this[\"$shares\"][index][\"access\"].indexOf(undefined), 1);\n }\n\n // trigger event \"share-change\" and \"share-change-access\"\n const current = this.shares.get(sharename);\n if (fnEqualArrays(current[\"access\"], previous[\"access\"]) !== true){\n this[\"$trigger\"](\"share-change\", current, previous);\n this[\"$trigger\"](\"share-change-access\", current, previous);\n }\n\n return this;\n },\n\n // config.shares.setPath()\n setPath: (sharename, path) => {\n if (fnIsString(sharename) !== true){\n throw new Error(\"ERROR: SHARE NAME MUST BE A STRING\");\n }\n\n if (fnIsString(path) !== true){\n throw new Error(\"ERROR: PATH MUST BE A STRING\");\n }\n\n const index = this.shares.get().indexOf(sharename);\n\n if (index < 0){\n throw new Error(\"ERROR: SHARE NOT FOUND\");\n }\n\n const previous = this.shares.get(sharename);\n this[\"$shares\"][index][\"path\"] = path;\n\n // trigger event \"share-change\" and \"share-change-path\"\n const current = this.shares.get(sharename);\n if (current[\"path\"] !== previous[\"path\"]){\n this[\"$trigger\"](\"share-change\", current, previous);\n this[\"$trigger\"](\"share-change-path\", current, previous);\n }\n\n return this;\n },\n\n // config.shares.setGuest()\n setGuest: (sharename, permission) => {\n if (fnIsString(sharename) !== true){\n throw new Error(\"ERROR: SHARE NAME MUST BE A STRING\");\n }\n\n if (fnIsString(permission) !== true){\n throw new Error(\"ERROR: PERMISSION MUST BE A STRING\");\n }\n\n if (permission !== \"rw\" && permission !== \"ro\" && permission !== \"no\"){\n throw new Error(\"ERROR: PERMISSION MUST BE EQUAL TO 'rw', 'ro' OR 'no'\");\n }\n\n const index = this.shares.get().indexOf(sharename);\n\n if (index < 0){\n throw new Error(\"ERROR: SHARE NOT FOUND\");\n }\n\n const previous = this.shares.get(sharename);\n if (permission === \"no\" && fnHas(this[\"$shares\"][index], \"guest\")){\n delete this[\"$shares\"][index][\"guest\"];\n }\n else if (permission === \"rw\" || permission === \"ro\") {\n this[\"$shares\"][index][\"guest\"] = permission;\n }\n\n // trigger event \"share-change\" and \"share-change-guest\"\n const current = this.shares.get(sharename);\n if (fnHas(current, \"guest\") !== fnHas(previous, \"guest\") || current[\"guest\"] !== previous[\"guest\"]){\n this[\"$trigger\"](\"share-change\", current, previous);\n this[\"$trigger\"](\"share-change-guest\", current, previous);\n }\n\n return this;\n },\n\n // config.shares.setFixedRules()\n setFixedRules: (...args) => {\n let shares = undefined;\n let rules = undefined;\n\n if (args.length === 1 && fnIsArray(args[0]) && args[0].every(fnIsString)){\n rules = args[0];\n }\n else if (args.length === 2 && fnIsArray(args[0]) && args[0].every(fnIsString) && fnIsArray(args[1]) && args[1].every(fnIsString)){\n shares = args[0];\n rules = args[1];\n }\n else {\n throw new Error(\"ERROR: INVALID INPUT\");\n }\n\n this[\"$fixedrules\"][\"shares\"] = (shares === undefined) ? undefined : fnCopy(shares);\n this[\"$fixedrules\"][\"rules\"] = fnCopy(rules);\n\n return this;\n },\n\n // config.shares.unsetFixedRules()\n unsetFixedRules: () => {\n console.log(`[WARNING] 'config.shares.unsetFixedRules()' is deprecated. Use 'config.shares.setFixedRules([])'.`);\n this.shares.setFixedRules([]);\n return this;\n }\n };\n\n return this;\n }", "function makeUsers() {\n return [\n {\n id: 1,\n username: 'test-user-1',\n password: '$2a$04$ZDFG22FviMhbES4JEcf8Eunwq41NosgRXcW6UxDF4XVMqXqfmaMPS'\n },\n {\n id: 2,\n username: 'test-user-2',\n password: '$2a$04$ivrtYG/o7QMPJg2sm/OiBONlyOHdtkoDdnuthNCWRqtdlxNPWqVNi'\n },\n {\n id: 3,\n username: 'test-user-3',\n password: '$2a$04$pdVG5dylbTSopL7kp7dafexLhfQsvcHwRYR96PBoEoYFEuMDcIlXC'\n },\n {\n id: 4,\n username: 'test-user-4',\n password: '$2a$04$0i1ElGjuUVMiYkrIx.bmeeqt4FfKskzajpZeynPw493CgQHtnC4sK'\n },\n ];\n}", "constructor() { \n \n User.initialize(this);\n }", "function setUserCredentails(username, password){\n this.username = username;\n this.password = password;\n}", "function Admin(username, email){\n User.call(this,username,email);\n}", "_registerUser(id){\n\t\tthis.idUser = id;\n\t}", "setup(UserModel, loginUser, registerUser) {\n passport_.use(new LocalStrategy(function(request, username, password, done) {\n loginUser(request, username, password, done);\n }));\n\n passport_.use('signup', new LocalStrategy({ passReqToCallback: true, failureRedirect: '/register', successRedirect: '/home' }, function(req, username, password, done) {\n let nextTicketRegisterUser = function () {\n registerUser(req, username, password, done);\n };\n \n // Delay the execution of findOrCreateUser and execute \n // the method in the next tick of the event loop\n process.nextTick(nextTicketRegisterUser);\n }));\n }", "function initData(){\n if (_users){\n return;\n }\n _users = [];\n _users['user1'] = {\n username: 'user1',\n password: 'password', \n };\n _users['user2'] = {\n username: 'user2',\n password: 'password',\n };\n}", "get users() {\r\n return new SiteUsers(this, \"users\");\r\n }", "function init() {\n\t\t\tUser.all().success(function(data) {\n\t\t\t\t$rootScope.processing = false;\n\t\t\t\t$scope.users = data;\n\t\t\t});\n\t\t}", "function User(name){\n this.name = name;\n this.isAdmin = false;\n}", "SET_USERS(state, users){\n state.users = users;\n\n }", "setUsers(state, users) { // set user value in state\n state.users = users;\n }", "constructor(\n user = config.user,\n password = config.password,\n host = config.host\n ) {\n this.user = user;\n this.password = password;\n this.host = host;\n }", "function addAdminUser(uname, password, canSudo, fname, lname) {\n\n\tif ('undefined' === typeof uname || 'string' !== typeof uname || !uname || '' === uname) {\n\t\n\t\treturn console.log('Cannot add user; username is invalid.');\n\t\n\t}\n\t\n\tif ('-h' === uname || '--help' === uname || 'help' === uname) {\n\t\n\t\tactionHelp('adminUser add', 'Add an admin user.', '[username] [password] [canSudo] [first name] [last name]');\n\t\treturn process.exit();\n\t\n\t}\n\t\n\tif ('undefined' === typeof fname || 'string' !== typeof fname || !fname || '' === fname) {\n\t\n\t\tfname = null;\n\t\n\t}\n\t\n\tif ('undefined' === typeof lname || 'string' !== typeof lname || !lname || '' === lname) {\n\t\n\t\tlname = null;\n\t\n\t}\n\t\n\tif ('undefined' === typeof password || 'string' !== typeof password || !password || '' === password) {\n\t\n\t\tconsole.log('Cannot add user; password is invalid.');\n\t\treturn process.exit();\n\t\n\t}\n\tif ('undefined' === typeof canSudo || 'string' !== typeof canSudo || !canSudo || '' === canSudo) {\n\t\n\t\tcanSudo = false;\n\t\n\t}\n\tvar rules = require('password-rules');\n\tvar pwInvalid = rules(password, {maximumLength: 255});\n\tif (pwInvalid) {\n\t\n\t\tconsole.log(pwInvalid.sentence);\n\t\treturn process.exit();\n\t\n\t}\n// \tvar users = new UserModel();\n\tvar now = new Date();\n\tvar newUserObj = {\n\t\t'fName': fname,\n\t\t'lName': lname,\n\t\t'uName': uname,\n\t\t'createdAt': now,\n\t\t'updatedAt': now,\n\t\tpassword,\n\t\t'sudoer': ('string' === typeof canSudo && 'true' === canSudo.toLowerCase()) ? true : false\n\t};\n\tglobal.Uwot.Users.createNew(newUserObj, function(error, user) {\n\t\n\t\tif (error) {\n\t\t\n\t\t\tconsole.log(error.message);\n\t\t\treturn process.exit();\n\t\t\n\t\t}\n\t\tconsole.log('User \"' + uname + '\" has been created (id ' + user._id + ').');\n\t\treturn process.exit();\n\t\n\t});\n\n}", "setupUserSchema() {\n let userSchema = new mongoose.Schema({\n userId: {type: String, required: true},\n firstName: {type: String, required: true},\n lastName: {type: String, required: true},\n emailId: {type: String, required: true},\n password: {type: String, required: true},\n authToken: {type: String, required: true},\n });\n\n this.User = mongoose.model('User', userSchema);\n }", "all() {\n return users;\n }", "bind(app) {\n // users api\n app.post(this.path, this.authEngine.hasSuperAccess.bind(this.authEngine), this._createUser.bind(this))\n app.get(this.path, this.authEngine.hasSuperAccess.bind(this.authEngine), this._listUsers.bind(this))\n app.get(this.path + '/reset/:id', this.authEngine.hasSuperAccess.bind(this.authEngine), this._resetUserPassword.bind(this))\n app.put(this.path + '/:id', this.authEngine.hasSuperAccess.bind(this.authEngine), this._updateUser.bind(this))\n }", "function Users(me)\n\t{\n\t\tthis.me = me;\n\t\tthis.usrs = [];\n\t\tif( arguments[1] !== undefined )\n\t\t\tthis.update( arguments[1] );\n\t}", "function createUsers(req, res) {\n\n}", "function GetUsers() {\n UserApi.getUser().then(function (response) {\n $scope.user = response.data;\n }), function () {\n aler(\"Unable to load users info\");\n }\n }", "function registerNewUser() {\n USER_NAME = buildNewName();\n USER_PWD = buildNewPassword();\n register(USER_NAME, USER_PWD);\n}", "function users_create(users, defproj) {\n // Send evertually to: POST /v1/user\n var newusers = users.map((u) => {\n // Note (in existing): accountType: \"LDAP\"\n var newuser = {accountRole: \"USER\", defaultProject: defproj,\nemail: u[3], fullName: u[\"001\"], login: u[0], password: null, // 001 vs \"001\"\nprojectrole: memrole}; // \"CUSTOMER\"\n return newuser;\n });\n}", "configure(app) {\n // Main config\n app.use(passport.initialize());\n\n // Config strategies\n configureBasicAuth();\n }", "function registerUser(application, settings) {\r\n var manager = new UserResourceManager(settings);\r\n var controller = new userController.UserController(manager);\r\n application.get('/', controller.index);\r\n application.get('/user', controller.index);\r\n application.post('/user/:id/details', controller.getDetails);\r\n application.get('/user/:id/remove', controller.remove);\r\n application.del('/user', controller.removePost);\r\n application.get('/user/create', controller.create);\r\n application.post('/user', controller.createPost);\r\n application.get('/user/:id/edit', controller.edit);\r\n application.put('/user', controller.editPost);\r\n}", "function loadUserConfiguration(base, callback) {\n var rootFile = \"/user.json\";\n config = superExtend(base, minimumConfiguration);\n expandedConfiguration = _.extend({}, config);\n // Expand with extension configs\n var extensionConfigs = bgPage.getBackgroundPage().getAllConfigs();\n _.each(extensionConfigs, function(cfg) {\n config = superExtend(config, cfg);\n });\n // Continue\n clearWatchers();\n watchFile(configfs, rootFile, loadConfiguration);\n configfs.readFile(rootFile, function(err, config_) {\n try {\n var json = JSON.parse(config_);\n userConfig = json;\n config = superExtend(config, json);\n expandConfiguration(config, function() {\n eventbus.emit(\"configchanged\", exports);\n _.isFunction(callback) && callback(null, exports);\n });\n } catch (e) {\n console.error(e);\n }\n });\n }", "initUser() {\n this.app.use(function (req, res, next) {\n res.locals.user = req.user || null;\n next();\n });\n }", "allUsers() {\r\n this.log(`Getting list of users...`);\r\n return this.context\r\n .retrieve(`\r\n SELECT emailAddress, password\r\n FROM Users\r\n `\r\n )\r\n }", "function createAdminUser_es6(user = new User_es6(generateID_es6())){\n user.admin = true;\n return user;\n}", "allUser() {\n return ['member', 'teamlead', 'admin', 'supervisor', 'manager']\n }", "function readUsers() {\n\tvar userhead = [\n\t\t'username', null, 'beruf','gender', null, 'partei',\n\t 'location', 'description', 'url', null, null,\n\t\tnull, null, 'followers', null, 'following', 'listed', null ];\n\tvar userdefaults = [null, null, null, 0 , null, 0];\n\tvar userlist = readData('Users', 'UserList.txt', '\\t', userhead, userdefaults);\n\tvar a, aZ;\n\n\tfor(a = 0, aZ = userlist.length; a < aZ; a++) {\n\t\tvar ua = userlist[a];\n\t\tif (ua.beruf === '9') throw new Error('Beruf 9 :-(');\n\t\tuserlist[a] = initUser(\n\t\t\tua.username.toLowerCase(),\n\t\t\tua.username,\n\t\t\tua.beruf,\n\t\t\tua.gender,\n\t\t\tua.partei,\n\t\t\tua.followers,\n\t\t\tua.following\n\t\t);\n\t}\n\n\t// transforms list to a hashtable\n\tfor(a = 0; a < aZ; a++) {\n\t\tusers[userlist[a].username] = userlist[a];\n\t}\n\t//console.log(util.inspect(users));\n}", "function addUsers() {\n let index = 0;\n let numAdminUsers;\n\n const debug = (argv.debug === true);\n const limit = (argv.limit === true);\n const max = argv.numberOfUsers;\n const adminUsers = argv.userNames;\n\n if (adminUsers === null || adminUsers === undefined) {\n numAdminUsers = 0;\n } else {\n numAdminUsers = adminUsers.length;\n }\n\n const printWarning = function printWarning() {\n console.log('Generating ' + max + ' users...');\n if (max > 2000) {\n console.log('...this might really take a while... go grab some coffee!');\n }\n };\n\n if (numAdminUsers === 0) {\n printWarning();\n }\n\n // Override debug mode to use the option set by the user\n config.db.debug = debug;\n\n // Bootstrap db connection\n mongooseService.connect(() => {\n mongooseService.loadModels(async () => {\n const Tribe = mongoose.model('Tribe');\n const User = mongoose.model('User');\n\n let userCount = 0;\n let tribes = null;\n\n /**\n * Gets the users and tribes from the database and saves them into the\n * global variables\n *\n * @returns {Promise} Promise that completes when user and tribe data\n * have successfully loaded into global variables.\n */\n function getUserCountAndTribes() {\n const getUserCount = User.countDocuments();\n const getTribes = Tribe.find();\n\n return Promise.all([getUserCount, getTribes]).then((results) => {\n [userCount, tribes] = results;\n }).catch(function (err) {\n console.log(err);\n });\n } // getUsersAndTribes()\n\n\n /**\n * Adds the number of users using the options specified by the user\n *\n * @returns {Promise} Promise that completes when all users have\n * successfully been added.\n */\n function addAllUsers() {\n return new Promise((resolve) => {\n if (limit) {\n index = userCount;\n }\n\n if (index >= max) {\n console.log(chalk.green(userCount + ' users already exist. No users created!'));\n console.log(chalk.white('')); // Reset to white\n resolve();\n return;\n }\n\n console.log(chalk.white('--'));\n console.log(chalk.green('Trustroots test user data'));\n console.log(chalk.white('--'));\n\n while (index < max) {\n (function addNextUser(){\n let user = new User();\n let admin;\n\n // Check if this is an admin user\n if (numAdminUsers > 0) {\n admin = adminUsers[adminUsers.length - numAdminUsers];\n }\n\n // Add mock data\n user.firstName = faker.name.firstName();\n user.lastName = faker.name.lastName();\n user.displayName = user.firstName + ' ' + user.lastName;\n user.provider = 'local';\n user.public = true;\n user.avatarUploaded = false;\n user.avatarSource = 'none';\n user.welcomeSequenceStep = 3;\n user.seen = moment()\n .subtract(Math.random() * 365, 'd')\n .subtract(Math.random() * 24, 'h')\n .subtract(Math.random() * 3600, 's');\n\n if (admin !== undefined) {\n // admin user\n user.email = 'admin+' + admin + '@example.com';\n user.password = 'password123';\n user.username = admin;\n }\n else {\n // non admin user\n user.email = index + faker.internet.email();\n user.password = faker.internet.password();\n user.username = index + user.displayName.toLowerCase().replace(/\\'/g, '').replace(/\\s/g, '');\n }\n\n // Add the user to tribes\n if (tribes.length > 0) {\n const userNumTribes = random(tribes.length);\n\n // Randomize indecies\n let randomTribes = [];\n for (let i = 0; i < tribes.length; i++) {\n randomTribes[i] = i;\n }\n randomTribes = _.shuffle(randomTribes);\n\n // Add the tribes using the random indecies\n for (let j = 0; j < userNumTribes; j++) {\n let rand = randomTribes[j];\n user.member.push({ tribe: tribes[rand]._id, since: Date.now() });\n tribes[rand].count += 1;\n }\n }\n\n // Save the user\n user.save(function (err) {\n savedUsers++;\n process.stdout.write('.');\n\n if (!err && admin!== undefined) {\n console.log('Created admin user. Login with: ' + admin + ' / password');\n } else if (err && admin !== undefined) {\n console.log(chalk.red('Could not add admin user ' + admin));\n console.log(err);\n } else if (err) {\n console.log(err);\n }\n\n addOffer(user._id, max, userCount, limit, resolve);\n });\n\n\n // No more admin users\n if (numAdminUsers === 1) {\n printWarning();\n }\n\n if (admin !== undefined) {\n numAdminUsers--;\n }\n }());\n\n index++;\n }\n });\n } // addAllUsers()\n\n\n /**\n * Update tribes with the new tribe counts once all users have been added\n *\n * @returns {Promise} Promise that completes when all the tribes have\n * successfully been updated.\n */\n function updateTribes() {\n return new Promise((resolve) => {\n let numTribesUpdated = 0;\n\n // If we didn't add any users, tribes do not need to be updated\n if (savedUsers === 0 || tribes.length === 0) {\n resolve();\n } else {\n // Update tribes\n for (let j = 0; j < tribes.length; j++) {\n Tribe.findByIdAndUpdate(tribes[j]._id, tribes[j], (err) => {\n if (err) {\n console.error(err);\n }\n\n numTribesUpdated += 1;\n if (tribes.length === numTribesUpdated) {\n resolve();\n }\n });\n }\n }\n });\n } // updateTribes()\n\n\n // This is the main sequence to add all the users.\n // * First get the current number of users and tribe data\n // * Then seed all the new users\n // * Lastly update the number of users that were added to each tribe\n try {\n await getUserCountAndTribes();\n await addAllUsers();\n await updateTribes();\n\n // Disconnect from the database\n mongooseService.disconnect();\n\n } catch (err) {\n console.log(err);\n }\n });\n });\n}", "function main() {\n tbody = $('tbody');\n template = $('.template');\n userService = new UserServiceClient();\n currentUserID = 0;\n $('.wbdv-create').click(createUser);\n $('.wbdv-update').click(updateUser);\n\n findAllUsers();\n\n }", "static setup({settings, user: {email, password, username}}) {\n\n // Validate the settings first.\n return SetupService\n .validate({settings, user: {email, password, username}})\n .then(() => {\n return SettingsService.update(settings);\n })\n .then((settings) => {\n\n // Settings are created! Create the user.\n\n // Create the user.\n return UsersService\n .createLocalUser(email, password, username)\n\n // Grant them administrative privileges and confirm the email account.\n .then((user) => {\n\n return Promise.all([\n UsersService.addRoleToUser(user.id, 'ADMIN'),\n UsersService.confirmEmail(user.id, email)\n ])\n .then(() => ({\n settings,\n user\n }));\n });\n });\n }", "function UsersFactory(){\n var _this = this;\n this.login = function(user, callback){\n $http.post('/users', user).then(function(data){\n callback(data.data);\n })\n }\n this.index = function(callback){\n $http.get('/users').then(function(data){\n callback(data.data);\n })\n }\n this.getUser = function(user, callback){\n $http.get(`/user/${user.user}`, user).then(function(data){\n callback(data);\n });\n }\n this.updateUser = function(user, list, callback){\n $http.post(`/user/${user.user}`, list).then(function(data){\n callback(data);\n });\n }\n this.updateCompletion = function(change, list, callback){\n $http.post(`/completion/${list}`, change).then(function(data){\n callback(data);\n });\n }\n }", "async list() {\n\t\treturn this.store.User.findAll()\n\t}", "function createDefaultUsers() {\n User.find({}).exec(function(err, collection) {\n if (collection.length === 0) {\n var salt, hash;\n salt = encrypt.createSalt();\n hash = encrypt.hashPwd(salt, 'joe');\n User.create({firstName: 'Joe', lastName: 'Eames', username: 'joe', salt: salt, hashed_pwd: hash, roles: ['admin']});//joe is given the 'admin' role\n salt = encrypt.createSalt();\n hash = encrypt.hashPwd(salt, 'john');\n User.create({firstName: 'John', lastName: 'Papa', username: 'john', salt: salt, hashed_pwd: hash, roles: []});\n salt = encrypt.createSalt();\n hash = encrypt.hashPwd(salt, 'kb');\n User.create({firstName: 'Kyle', lastName: 'Bas', username: 'kb', salt: salt, hashed_pwd: hash});\n }\n });\n}", "function UserConstructor() {\n\t\tvar users = [\n\t\t\t{name: \"mike\"}\n\t\t];\n\n\t\t// INDEX\n\t\tthis.index = function(callback) {\n\t\t\tif (typeof(callback) === 'function') {\n\t\t\t\tcallback(users);\n\t\t\t}\n\t\t};\n\n\t\t// CREATE\n\t\tthis.create = function(newUser) {\n\t\t\tif (typeof(newUser) === 'object') {\n\t\t\t\tusers.push(newUser)\n\t\t\t}\n\t\t};\n\n\t\t// UPDATE\n\t\tthis.update = function(updateUser, idx, callback) {\n\t\t\tif (users[idx]) {\n\t\t\t\tfor (var key in updateUser) {\n\t\t\t\t\tusers[idx][key] = updateUser[key];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof(callback) === 'function') {\n\t\t\t\tcallback(users[idx]);\n\t\t\t}\n\t\t}\n\n\t\t// SHOW\n\t\tthis.show = function(idx, callback) {\n\t\t\tif (typeof(callback) === 'function') {\n\t\t\t\tcallback(users[idx]);\n\t\t\t}\n\t\t}\n\n\t\t// DELETE\n\t\tthis.delete = function(idx, callback) {\n\t\t\tif (users[idx]) {\n\t\t\t\tusers.splice(idx, 1);\n\t\t\t}\n\t\t\tif (typeof(callback) === 'function') {\n\t\t\t\tcallback(users);\n\t\t\t}\n\t\t}\n\t}", "function initializeSuperusers(db) {\r\n tx = db.transaction(USERS_DB_NAME, \"readwrite\");\r\n store = tx.objectStore(USERS_DB_NAME);\r\n\r\n for (let i = 0; i < SUPERUSERS.length; i++){\r\n store.put({\r\n email: SUPERUSERS[i][0],\r\n username: SUPERUSERS[i][1],\r\n password: SUPERUSERS[i][2],\r\n permission: SUPERUSERS[i][3],\r\n balance: SUPERUSERS[i][4],\r\n rewards: SUPERUSERS[i][5],\r\n warning: SUPERUSERS[i][6]\r\n });\r\n }\r\n}", "function setup() {\n return; // no setup\n User.sync({ force: true }) // Using 'force: true' for demo purposes. It drops the table users if it already exists and then creates a new one.\n .then(function () {\n // Add default users to the database\n for (var i = 0; i < users.length; i++) {\n // loop through all users\n User.create({ name: users[i] }); // create a new entry in the users table\n }\n });\n}", "function loadUserConfigContent(){\n\tloadContent(SERVICES.getUserConfigData, {}, TEMPLATES.userConfig, $content, loadUserConfigContentCallback);\n}", "static initAdminUser() {\n return new Promise((resolve, reject) => {\n // check if its first user\n User.count({'username': 'ESNAdmin'})\n .then((result) => {\n if (result == 0) {\n const user = new User();\n user.setRegistrationData('ESNAdmin', 'admin');\n user.role = 'administrator';\n user.status = 'OK';\n return user.registerUser();\n } else {\n return resolve(true);\n }\n })\n .then((result) => {\n return resolve(true);\n })\n .catch((err) => {\n return reject(false);\n });\n });\n }" ]
[ "0.67340666", "0.6712787", "0.66848457", "0.65620315", "0.62629145", "0.6150309", "0.613553", "0.6118517", "0.60889965", "0.6056425", "0.605201", "0.6002881", "0.5958288", "0.59133583", "0.5902473", "0.5887292", "0.5832695", "0.5821733", "0.5798553", "0.5783456", "0.5782437", "0.57635826", "0.5748228", "0.574738", "0.57379967", "0.569186", "0.56666595", "0.5665737", "0.56647587", "0.5663501", "0.5650481", "0.56160676", "0.56065744", "0.55898535", "0.5569703", "0.5569293", "0.5533811", "0.55335504", "0.55335504", "0.55286425", "0.55157447", "0.55152327", "0.5513606", "0.5511826", "0.5511129", "0.55060446", "0.5505887", "0.55017084", "0.5497927", "0.549513", "0.546675", "0.5454838", "0.54546314", "0.5450835", "0.5449859", "0.544039", "0.5440124", "0.5436137", "0.54325616", "0.54253495", "0.5424757", "0.5419414", "0.54159135", "0.5410882", "0.53870517", "0.5384333", "0.53750616", "0.53750485", "0.537371", "0.5364811", "0.5359841", "0.5352415", "0.5352003", "0.53514916", "0.5351239", "0.5348587", "0.53421783", "0.5340015", "0.53360015", "0.53312856", "0.5331159", "0.5324804", "0.5324295", "0.5321666", "0.53174174", "0.5315978", "0.5315233", "0.5312737", "0.53117156", "0.5306302", "0.5299054", "0.5297226", "0.52952754", "0.528284", "0.5282796", "0.5278785", "0.52779037", "0.5267074", "0.5263736", "0.5256417", "0.5249604" ]
0.0
-1
Write password to the password input
function writePassword() { var password = generatePassword(); var passwordText = document.querySelector("#password"); passwordText.value = password; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writePassword() {}", "function writePassword() {\n var password = getPasswordOptions();\n var passwordText = document.querySelector('#password');\n \n passwordText.value = password;\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n generatePassword()\n }", "function writePassword() {\n var password = buildPassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n \n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var passwordLen = getpasswordLength();\n var options = getPasswordOptionSet();\n\n\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = makePassword(passwordLen, options);\n\n\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n }", "function writePassword() {\n let password = generatePassword(passwordlength).join(\"\");\n let passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n getUserInputs();\n\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n // Reset variables\n passwordLength = 0;\n selectedCharacters = \"\";\n includeLowercase = false;\n includeUppercase = false;\n includeNumbers = false;\n includeSpecialChar = false;\n}", "function writePassword() {\n\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var length = getPasswordLength();\n length = parseInt(length);\n ensureCharacterType();\n var password = generatePassword(length);\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "function writePassword() {\n var password = generatePassword()\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n\n }", "function writePassword() {\n var passwordReqs = {};\n passwordReqs = passReqs(passwordReqs);\n var password = generatePassword(passwordReqs);\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n // Only set the new password if one was actually generated. Otherwise, keep the previous password on the screen.\n if (passwordText !== \"\") {\n passwordText.value = password;\n }\n}", "function writePassword() {\n let newOptions = { ...options };\n setOptions(newOptions);\n var password = generatePassword(newOptions);\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n\tvar passwordText = document.querySelector('#password');\n\n\tpasswordText.value = finalPassword;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n //prompt(password)\n }", "function _3writePassword(password) {\n console.log(\"writing password\")\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n \n}", "function writePassword() {\n const password = generatePassword();\n const passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n const password = generatePassword();\n const passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var criteria = passwordCriteria();\n var password = generatePassword(criteria);\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n // If password is empty string, return without printing\n if (!password) {\n return;\n }\n var passwordText = document.querySelector('#password');\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n if (password !== undefined) {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n }\n}", "function writePassword() {\n var password = generatePassword();\n if (password) {\n var passwordText = document.querySelector('#password');\n\n passwordText.value = password;\n }\n}", "function writePassword () {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\")\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword().join(\"\");\n // console.log(password);\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = pwCriteria();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword(password) {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var userPassword = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = userPassword;\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n return;\n}", "function writePassword() {\n var password = createPassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\r\n\r\n var password = generatePassword(),\r\n passwordText = document.querySelector(\"#password\");\r\n\r\n passwordText.value = password;\r\n \r\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n if(password) {\n passwordText.value = password;\n }\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector('#password');\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n passwordText.value = password;\n passwordEngine.reset();\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n\n // clears password variables in case user doesn't click clear button before generating a new password\n passCreate = \"\";\n password = \"\";\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}" ]
[ "0.88605946", "0.85434437", "0.8511256", "0.8500835", "0.84896296", "0.84846", "0.84719414", "0.84686357", "0.8454292", "0.8443738", "0.8431387", "0.8419759", "0.8418786", "0.8406216", "0.8403772", "0.8400314", "0.8392802", "0.83758265", "0.8370068", "0.83642554", "0.836013", "0.8358564", "0.8357296", "0.8355442", "0.8354251", "0.83408403", "0.83408403", "0.8301905", "0.8292826", "0.8292826", "0.8292826", "0.8292826", "0.828747", "0.8274406", "0.8269479", "0.82615584", "0.8256443", "0.82556236", "0.82519406", "0.8250689", "0.82503533", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.82437736", "0.82437736", "0.82437736", "0.8240616", "0.8238806", "0.8238588", "0.8236282", "0.82324123", "0.82302624", "0.82299846", "0.8229535", "0.8229535", "0.82283163", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293" ]
0.0
-1
Sets the status of a specific schedule. id id of the specific schedule which should be set up
setScheduleStatus(id) { let statusToSet = this.state.scheduleIsOn ? 'enabled' : 'disabled'; /** * REST call to change the status of a schedule to enabled/disabled. */ fetch('http://192.168.0.21/api/CeyiFspaKI7cxGvtu9uOLJmQgOmAZuoUyMaxwETp/schedules/' + id, { method: 'PUT', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ 'status': statusToSet }) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setScheduleTime(id) {\n\n let minutes = this.state.WakeUpTimeMinutes;\n let hours = this.state.WakeUpTimeHours;\n\n if(minutes > this.state.sunriseDurationBeforeWakeUp) {\n minutes = minutes - this.state.sunriseDurationBeforeWakeUp;\n }\n else {\n minutes = 60 + minutes - this.state.sunriseDurationBeforeWakeUp;\n hours == 0 ? hours = 23 : hours -= 1;\n }\n\n let time = \"W124/T\" + (hours < 10 ? \"0\" + hours : hours) + \":\" + (minutes < 10 ? \"0\" + minutes : minutes) + \":00\";\n /**\n * REST call to change the status of a schedule to enabled/disabled.\n */\n fetch('http://192.168.0.21/api/CeyiFspaKI7cxGvtu9uOLJmQgOmAZuoUyMaxwETp/schedules/' + id, {\n method: 'PUT',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n 'localtime': time\n })\n });\n }", "function updateStatusSCHEDULE(now, board, status, done) {\n db.getSchedules(function(err, schedules) {\n\n var selected = null;\n for(var i in schedules) {\n selected = checkSingleSchedule(now, status, schedules[i]);\n if (selected) break;\n }\n\n status.schedule = selected;\n if (selected) {\n status.temp_desired = selected.temp_desired;\n\n if (status.temp_desired <= status.temp_indoor) {\n //hay que apagar la calefaccion\n powerOff(status, board);\n } else {\n //hay que encender\n powerOn(status, board)\n }\n } else {\n //ninguno encaja\n //hay que apagar la calefaccion\n powerOff(status, board);\n }\n\n return done();\n });\n \n }", "function markTask(id, status){\r\n let dataSend = \"updateTask=exec&method=2&id=\" + id + \"&complete=\" + status;\r\n return apiReq(dataSend, 3);\r\n}", "async function updateActivityStatusById(req, res) {\n try {\n const id = req.params.id;\n const activity = await Activity.findOne({ where: { id } })\n\n if (!activity)\n return notFoundMsg(res, id, 'Actividad');\n\n activity.status === 1 ? activity.set({ status: 0 }) : activity.set({ status: 1 });\n\n await activity.save();\n\n successMsg(res, 200, 'actualización exitosa', activity);\n\n } catch (error) {\n errorMsg(res, 500, `lo sentimos hemos cometido un error!`, error);\n }\n}", "async function updateDestinationStatusById(req, res) {\n try {\n const id = req.params.id;\n const destination = await Destination.findOne({ where: { id } })\n\n if (!destination)\n return notFoundMsg(res, id, 'Destino');\n\n destination.status === 1 ? destination.set({ status: 0 }) : destination.set({ status: 1 });\n\n await destination.save();\n\n successMsg(res, 200, 'actualización exitosa', destination);\n\n } catch (error) {\n errorMsg(res, 500, `lo sentimos hemos cometido un error!`, error);\n }\n}", "updateWorkLogStatus(id, status) {\n const index = dataModel.worklogs.findIndex((logs) => logs._id === id);\n try {\n dataModel.worklogs[index].status = status;\n } catch (err) {\n console.log('couldn\\'t find the object');\n }\n\n }", "changeMainTaskStatusWithId(taskId, status) {\n let realm = new Realm({schema: [TaskSchema, SubTaskSchema, NotesSchema]});\n const file = realm.objects('TASK').filtered('id == $0', taskId);\n realm.write(() => {\n file[0].isDone = status;\n });\n this.changeAllSubTaskStatusWithId(taskId, status);\n }", "getScheduleById(id) {\n const schedule = mysql_1.default('schedule').where('id', id);\n return schedule;\n }", "async updateCourseStatus(id, status) {\n const res = await fetch(`/courses/${id}`, {\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ status }),\n });\n if (res.ok) return;\n else throw new Error(\"Something went wrong\");\n }", "changeSchedulecourse(req, res) {\n const _id = req.params._id;\n const schedule = req.body.schedule;\n CourseModel.findOne({ _id: _id, isCheck: 0 })\n .then((data) => {\n data.schedule = schedule;\n data.save();\n res.status(200).json({\n status: 200,\n success: true,\n message: \"Successfully changed course time\",\n });\n })\n .catch((err) =>\n res.status(402).json({\n status: 402,\n success: true,\n message: \"No valid courses found\",\n })\n );\n }", "function setStatus($id){\n\tif($id==\"\"){\n\t\talert(\"Please select a row to change the status\");\n\t\treturn false;\n\t}else {\n\t $.ajax({\n type: \"POST\",\n url: \"../ajax_common.php\",\n data: {\n\t\t\t\t\t'id': $id,\n\t\t\t\t\t'codeBlock': 'set_requistie_status',\n\t\t\t\t},\n success: function($succ){\n\t\t\t\t\tvar imageId='#status-user'+$id;\n\t\t\t\t\tif($succ==1){\n\t\t\t\t\t\t//$(imageId).css('background-image','url(./images/bar-circle.gif)');\n \t$(imageId).attr({src: '../images/status-active.png'});\n\t\t\t\t\t\t$(imageId).attr({title: 'Desable'});\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$(imageId).attr({src: '../images/status-deactive.png'});\n\t\t\t\t\t\t$(imageId).attr({title: 'Enable'});\n\t\t\t\t\t}\n }\n });\n }\n }", "updateSchedule() {\n this.view.eventBlocks.setSchedule(this.model.getSchedule());\n }", "function updateStatus(jobId, stageName, callback) {\n retrieveStage(jobId, stageName,function(err,res){\n if (err) {\n console.log(err);\n }\n else {\n console.log(res);\n var stages = JSON.parse(res[0]);\n var comand = stages.type;\n var status = stages.status;\n var input = stages.input;\n if (status == \"Initialized\") {\n stages.status = \"Scheduled\";\n //updating status and ts_scheduled in redis\n stages.ts_scheduled = new Date();\n console.log(\"changed status\");\n updateStage(jobId, stageName, JSON.stringify(stages),function(err,res){\n if (err) {\n console.log(err);\n }\n else {\n console.log(\"update stage\");\n schedule(jobId, stageName, input, comand, callback);\n }\n });\n }\n }\n });\n}", "function changeCompletionStatus(bool, id){\n const task = {\n completionStatus:bool\n };\n API.updateTask(task, id)\n .then(()=>{\n getTasks();\n }).catch();\n }", "function set_status(id, status) {\n\t\t$(\"#\" + id + \" span.status\").text(status);\n\t\tif ((status == \"ON\") || (status == \"AUTOMATIC\")) {\n\t\t\t$(\"#\" + id).removeClass(\"btn-danger\").removeClass(\"btn-light\")\n\t\t\t\t\t.addClass(\"btn-warning\");\n\t\t} else if ((status == \"OFF\") || (status == \"MANUAL\")) {\n\t\t\t$(\"#\" + id).removeClass(\"btn-danger\").removeClass(\"btn-warning\")\n\t\t\t\t\t.addClass(\"btn-light\");\n\t\t} else {\n\t\t\t$(\"#\" + id).removeClass(\"btn-warning\").removeClass(\"btn-light\")\n\t\t\t\t\t.addClass(\"btn-danger\");\n\t\t}\n\t}", "edit() {\n\t\tthis.mode = \"Edit Schedule\";\n\t\tthis.transaction = this.schedule;\n\t}", "function checkSingleSchedule(now, status, schedule) {\n if (now >= schedule.start && now <= schedule.end) {\n log.log(\"now is perfect for this schedule\");\n return schedule;\n } else if (schedule.repeat.indexOf(now.getDay()) > -1) {\n //comprobamos solo la hora porque estamos en un patron de repetición\n //y hoy es uno de los dias en los que deberia saltar este programa\n var time = new Date(now).setFullYear(2000,0,1);\n var start = new Date(schedule.start).setFullYear(2000,0,1);\n var end = new Date(schedule.end).setFullYear(2000,0,1);\n\n //ahora podemos comparar solo los tiempos\n if (time >= start && time <= end) {\n //encaja\n log.log(\"now is enought for this schedule, today \" + now.getDay() + \" start \" + (new Date(schedule.start)).getDay());\n return schedule;\n }\n }\n\n //ninguno encajaba\n return null;\n }", "function handleScheduleEdit() {\n var currentSchedule = $(this)\n .parent()\n .parent()\n .data(\"schedule\");\n window.location.href = \"/cms?schedule_id=\" + currentSchedule.id;\n }", "updateExchangeRunningState(exchangeId, isRunning) {\n this.findExchangeById(exchangeId)\n .then((exchange) => {\n exchange.running = isRunning;\n })\n .catch((err) => console.log(err))\n }", "function setStatusClosed(id){\n\tvar issues = JSON.parse(localStorage.getItem('issues'));\n\n\tfor(var i = 0; i < issues.length; i++){\n\t\tif(issues[i].id === id){\n\t\t\tissues[i].status = 'Closed';\n\t\t}\n\t}\n\n\tlocalStorage.setItem('issues', JSON.stringify(issues));\n\n\tdisplayIssues();\n}", "function schedule (id) {\n jQuery.ajax({\n url:'php/course/get-course-shedule.php',\n type:'post',\n data:{id:id},\n success:function(data){\n console.log(data);\n try{\n data=JSON.parse(data);\n }\n catch(e){\n alert(\"error loading schedule for this course\");\n }\n $(\"#schedule-form\")[0].reset();\n $(\"#schcousename\").html(data['name']);\n $(\"#schedule-courseid\").val(data['courseid']);\n if(data['error']==1){\n var a=$('input.schgroup');\n for (var i = 0; i < a.length; i++) {\n a[i].removeAttribute('checked');\n };\n $('#schedulecourse').modal('show');\n }\n else{\n $(\"#course-date\").val(data['date']);\n $(\"#course-time\").val(data['time']);\n var a=$('input.schgroup');\n var groups=JSON.parse(data['groups']);\n for (var i = 0; i < a.length; i++) {\n if(groups.indexOf(a[i].name)==-1)\n a[i].removeAttribute('checked');\n else{\n var att=document.createAttribute('checked');\n att.value=\"'checked'\";\n a[i].setAttributeNode(att);\n }\n };\n \n $('#schedulecourse').modal('show');\n }\n },\n error:function(){\n alert('Network error');\n }\n })\n }", "async function editMilestoneStatusHandler(id, status) {\n const response = await fetch(`/api/milestones/${id}`, {\n method: 'PUT',\n body: JSON.stringify({\n status\n }),\n headers: {\n 'Content-Type': 'application/json'\n }\n });\n if (response.ok) {\n location.reload();\n } else {\n alert(response.statusText);\n }\n}", "async function changeDoing(_id) {\n await axios.put('http://localhost:3000/task', { _id });\n print();\n}", "function setStatusClosed(id) {\n let issues = JSON.parse(localStorage.getItem('issues'));\n\n for (i=0;i<issues.length;i++) {\n //checks eachs \"issue\"'s id to see if it's the id that was passed through\n if (issues[i].id == id) {\n issues[i].status = 'closed';\n }\n }\n\n //updates the current \"issues\" storage\n localStorage.setItem('issues', JSON.stringify(issues));\n\n //shows the current/updated issues\n fetchIssues();\n}", "function setStatusClosed(id){\r\n\tvar issues = JSON.parse(localStorage.getItem('issues'));\r\n\r\n\tfor ( var i = 0; i < issues.length; i++){\r\n\t\tif (issues[i].id == id) {\r\n\t\t\tissues[i].status = 'Closed';\r\n\t\t}\r\n\t}\r\n\r\n\tlocalStorage.setItem('issues', JSON.stringify(issues));\r\n\r\n\tfetchIssues();\r\n}", "function schedule(event) {\n let targetElementId = event.target.id;\n let targetElement = document.getElementById(targetElementId);\n let parentElement = targetElement.parentElement;\n let newElement = targetElement.cloneNode(true);\n newElement.classList.toggle('button-schedule-active');\n if (targetElement.innerHTML === 'schedule') {\n newElement.innerText = 'scheduled';\n } else {\n newElement.innerText = 'schedule';\n }\n newElement.addEventListener('click', schedule);\n parentElement.removeChild(targetElement);\n parentElement.appendChild(newElement);\n}", "function deleteSchedule(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/schedules/\" + id\n })\n .done(function() {\n getSchedules(scheduleCategorySelect.val());\n });\n }", "schedule() {\n this.state = 'schedule'\n if (this.pause || !this.count) return\n this.downloadSchedule()\n }", "setReminderStatusIfNotError(id, status) {\n debug('setReminderStatusIfNotError(id=%d, status=%s)', id, status);\n return database.ready.then(db =>\n db.update(\n 'reminders SET status = ? WHERE id = ? AND status != \"error\"',\n status, id\n )\n );\n }", "changeStatus(params) {\n var index = this.list.map(i => i.id).indexOf(params.id);\n this.list[index].open = params.status;\n ls.updateItem({id : params.id}, {open : params.status});\n this.filterByStatus(this.stats);\n }", "changeAllSubTaskStatusWithId(subTaskId, status) {\n let realm = new Realm({schema: [TaskSchema, SubTaskSchema, NotesSchema]});\n const file = realm.objects('SUBTASK').filtered('taskId == $0', subTaskId);\n realm.write(() => {\n for (let i = 0; i < file.length; i++) {\n file[i].isDone = status;\n }\n });\n }", "function setBreakfast (i_day, id) {br_id[i_day] = id;}", "function updateSchedule(scheduleId, updatedSchedule){\n var deferred = q.defer();\n\n ScheduleModel.update(\n {_id: scheduleId},\n { date: updatedSchedule.date,\n time: updatedSchedule.time,\n location: updatedSchedule.location,\n adminId: updatedSchedule.adminId,\n players: updatedSchedule.players},\n\n function(err, doc){\n if (err){\n deferred.reject(err);\n } else {\n deferred.resolve(doc);\n }\n }\n );\n\n return deferred.promise;\n }", "function update(row, status) {\r\n let errorId = parseInt(row.errorId)\r\n client.query(\r\n `UPDATE schedule_error SET status = '${status}' WHERE \"errorId\"= '${errorId}'`,\r\n (err, res) => {\r\n console.log(`UPDATE schedule_error SET status = '${status}' WHERE \"errorId\"= '${errorId}'`);\r\n if (err) {\r\n\r\n errorLog(err, 'rescheduling updation failed', 'Failed')\r\n }else {\r\n console.log('successfully updated');\r\n }\r\n }\r\n );\r\n}", "function markTodoAs(id, status) {\n if (DB[id] !== undefined) {\n DB[id].status = status\n saveToLocalStorage()\n }\n}", "function changeStatus(id,obj,status){\n\t \n addOverLay();\n\t $(obj).addClass(\"btn-primary\").siblings().removeClass(\"btn-primary\");\n\t $.ajax({\n\t\t\ttype : \"POST\",\n\t\t\turl : HOST_PATH+\"admin/user/userstatus\",\n\t\t\tdata : \"id=\"+id+\"&status=\"+status\n\t\t}).done(function(msg) {\n\t\t\tremoveOverLay();\t\n\t}); \n\n}", "function updateStatus(id, status){\n return db('tickets')\n .where({id})\n .first()\n .update(status, 'id')\n .then(count => {\n return findById(id)\n })\n}", "function onScheduleChange(){\n\tvar selected = scheduleSelection();\n\tvar schedule = booleanToSchedule(selected);\n\t\n\tchrome.runtime.getBackgroundPage(function(page){\n\t\tpage.updateSchedule(schedule);\n\t\tpage.updateScheduleInStorage(schedule);\n\t});\n}", "activate(params) {\n return this.getSchedule(params.id);\n }", "function saveScheduled(scheduled) {\n const urlParams = new URLSearchParams(window.location.search);\n const idParam = urlParams.get(\"id\");\n\n dbPromised\n .then(function (db) {\n const tx = db.transaction(\"scheduled\", \"readwrite\");\n const store = tx.objectStore(\"scheduled\");\n console.log(scheduled.matches[idParam]);\n store.put(scheduled.matches[idParam]);\n return tx.complete;\n })\n .then(function () {\n M.toast({\n html: \"Jadwal berhasil di simpan.\",\n classes: \"blue darken-1\",\n });\n });\n}", "function changeStatus(id,status){\n\tif(status=='On'){\n\t\tvar sts='PAUSED';\n\t}else{\n\t\tvar sts='ACTIVE';\n\t}\n\tvar access_token = gets('code');\n\tjQuery.ajax({\n\t\t\t\t'url' \t: 'https://graph.facebook.com/v2.11/'+id,\n\t\t\t\t'method'\t: 'POST',\n\t\t\t\t'data'\t\t: 'status='+sts+'&access_token='+access_token,\n\t\t\t\tsuccess : function(data){\n\t\t\t\t\tconsole.log('data after', data);\n\t\t\t\t\tif(data.success == true) {\n\t\t\t\t\t\t//window.location.reload();\n\t\t\t\t\t}else{\n\t\t\t\t\t\tswal(\"\",data.error.error_user_msg);\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: function (xhr,request, error) {\t\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t\tswal(\"\",xhr.responseJSON.error.error_user_msg);\t\t\t\t\t\t \n\t\t\t\t}\n\t\t\t});\n\n}", "changeIsDone(id) {\n\t\tlet tasks = this.getAndParse('tasks');\n\t\tconst idx = tasks.findIndex(task => task.id === id);\n\t\ttasks[idx].isDone = !tasks[idx].isDone;\n\t\tthis.stringifyAndSet(tasks, 'tasks');\n\t\tconsole.log(tasks[idx].isDone);\n\t}", "function performSchedule() {\n if (schedule.scheduleActionType !== 'schedule-cancel') {\n var formValid = validateForm();\n } else {\n var formValid = true;\n }\n\n if (formValid) {\n config.isScheduling = true;\n if (schedule.scheduleActionType === 'future-schedule') {\n schedule.articleId = $('#schedule-id', '#schedule-modal').val();\n }\n\n if (schedule.scheduleActionType !== 'schedule-cancel') {\n schedule.scheduleData = {\n article: {\n 'article-identifier': schedule.articleId,\n scheduled: moment(schedule.scheduleDateTime).format('X')\n },\n };\n } else {\n schedule.scheduleData = {article: {'article-identifier': schedule.articleId, scheduled: false}};\n }\n\n\n // log.info(schedule.scheduleData);\n $('#schedule-modal #schedule-action').hide();\n $('#schedule-modal #schedule-cancel-btn').hide();\n scheduleArticlePublication(schedule.scheduleData, scheduleArticlePublicationSuccess, scheduleArticlePublicationError);\n }\n\n }", "function updateTaskStatus(src, status) {\n\n // console.log(src.id)\n // console.log(status)\n // console.log(taskid)\n var urlString = window.location.search\n var projectId = window.location.search.slice(1, urlString.length).split('&')[0].split('=')[1]\n\n \n if(!src) {\n console.log(\"Src taskbox not set correctly\")\n return\n }\n \n if(!status) {\n console.log(\"Status was not set correctly\")\n return \n }\n \n var taskid = src.id.split(\"-\")[1]\n\n if(!projectId) {\n console.log(\"ID was not set correctly\")\n return \n }\n\n $.ajax({\n type: 'POST', \n data: {\n 'projectid': projectId, \n 'taskStatus': status,\n 'taskID': taskid\n }, \n url: '../includes/update-task.php' \n })\n .done(function(data) {\n console.log(data)\n })\n .fail(function(data) {\n console.log(data)\n })\n}", "function changeStatus(){\r\n\t\t\t\tvar button_id= $(this).attr(\"id\"); \r\n\t\t\t\t\r\n\t\t\t\t console.log(button_id);\r\n\t\t\t\t\r\n\t\t\t\t $.ajax({\r\n\t\t\t\t\t url:\"/SurveyProjectMVC/rest/admin/changeSurveyStatus?surveyId=\"+button_id,\r\n\t\t\t\t\t\r\n\t\t\t\t\t type : \"GET\",\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tsuccess : function(response, status) {\r\n\t\t\t\t\t\t\tconsole.log(response);\r\n\t\t\t\t\t\t\tif(response==\"ACTIVE\")\r\n\t\t\t\t\t\t\t$(\"#\"+button_id).html(response).css(\"background-color\", \"#4CAF50\");\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$(\"#\"+button_id).html(response).css(\"background-color\", \"#f44336\");\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\t \r\n\t\t\t\t \r\n\t\t\t }", "function setStatus(syllabusId, status) {\n //if changeTo is 1\n if (status == 0) {\n $(\"#course-status-div-\" + syllabusId).html('<div id=\"course-status-div-' + syllabusId + '\"><section>'\n + '<img src=\"../page_files/icons/success-icon.png\" height=\"22\" alt=\"checked\"></section></div>');\n } else {\n //if changeTo is 0\n $(\"#course-status-div-\" + syllabusId).html('<div id=\"course-status-div-' + syllabusId + '\"><section>'\n + '<img src=\"../page_files/icons/circle-icon.png\" height=\"22\" alt=\"checked\"></section></div>');\n\n }\n}", "function setStatus(id,status, position) {\n\n// clear all status lights of block\n\t$(\"[block_id='\"+id+\"'].light\").addClass(\"off\");\n\n// set status light with direction definition\n\tif (position != undefined) {\n\n\t\t$(\"[light_id='status\"+status+\"'][pos='\"+position+\"'][block_id='\"+id+\"'].light\").removeClass(\"off\");\n\t}\n\n// set status light\n\telse {\n\t\t$(\"[light_id='status\"+status+\"'][block_id='\"+id+\"'].light\").removeClass(\"off\");\n\t}\n}", "function changeStatus(status, id){\n \tif (status) {\n \t\treturn false;\n \t}\n \treturn true;\n }", "function cardToggleObject(id) {\n tasks.forEach(card => {\n if (card.id === id) {\n if (card.state === 'pending') {\n card.state = 'done';\n } else {\n card.state = 'pending';\n }\n }\n });\n}", "function schedule(event) {\n // local constants\n const scheduleText = 'schedule';\n const scheduledText = 'scheduled';\n\n const targetElementId = event.target.id;\n const targetElement = document.getElementById(targetElementId);\n const parentElement = targetElement.parentElement;\n const newElement = targetElement.cloneNode(true);\n newElement.classList.toggle('button-schedule-active');\n if (targetElement.innerHTML === scheduleText) {\n newElement.innerText = scheduledText;\n } else {\n newElement.innerText = scheduleText;\n }\n newElement.addEventListener('click', schedule);\n parentElement.removeChild(targetElement);\n parentElement.appendChild(newElement);\n }", "activeInactiveState(evt, status, id) {\n if (status == 1) {\n status = 0;\n } else {\n status = 1;\n }\n const r = window.confirm(\"Do you want to change status ?\");\n if (r == true) {\n const postData = {\n status: status,\n };\n axios\n .put(Url + `api/state/update/${id}`, postData)\n .then((res) => {\n toast.success(res.data.message);\n window.location.reload();\n })\n .catch((err) => {\n //console.log(\"err\",err)\n toast.error(\"Error occured at API end (\" + err.message + \")\");\n });\n }\n }", "function updateSchedule() {\n //update schedules of all arenas ! \n Arena.find(function (err, arenaArr) {\n \n if (!err) {\n async.each(arenaArr,function(arena){\n arena.schedule.shift();\n arena.schedule.push(arena.default_weekly_schedule);\n arena.markModified('schedule');\n arena.save(function(arenaSaveErr){\n console.log(\"Arena Save Error \" + arenaSaveErr);\n })\n },function(asyncErr){\n console.log(\"Async has encountered an error \"+ asyncErr);\n })\n }\n else {\n console.log(err + \"Error accessing arenas from database\");\n\n }\n })\n}", "updateStartedWorkLog(id, beginTime) {\n const index = dataModel.worklogs.findIndex((logs) => logs._id === id);\n try {\n dataModel.worklogs[index].startTime = beginTime;\n } catch (err) {\n console.log('couldn\\'t find the object');\n }\n\n }", "function change_status(id, color){\n\t// Ensure a valid color is chosen\n\tswitch(color){\n\t\tcase 'red':\n\t\tcase 'yellow':\n\t\tcase 'green':\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log(\"invalid status color chosen; defaulting to yellow\");\n\t\t\tcolor = 'yellow';\n\t}\n\n\tvar patients = get_ls_patients();\n\t\n\tpatients[id]['color_status'] = color;\n\t\n\tdocument.getElementById(\"status_image_\" + id).src = \"img/dot_big_\" + color + \".png\";\n\n\n}", "function changeBookingStatus(booking){\n console.log('Booking status of ' + booking.id + ' changed to: ' + booking.status);\n }", "function updateBookingStatus() {\n\n }", "function editStatus(docid) {\n\t\t\tdailyMailScanDataService.changeStatus(docid, self.editUploadedStatus[docid].newstatus)\n\t\t\t\t.then(function (response) {\n\t\t\t\t\tself.display.uploaded.uploadedfiltered = false;\n\n\t\t\t\t\tvar docIndex = _.findIndex(self.uploadedList.data, { id: docid });\n\t\t\t\t\tif (docIndex != -1) {\n\t\t\t\t\t\tself.uploadedList.data[docIndex].status = self.editUploadedStatus[docid].newstatus;\n\t\t\t\t\t\tself.uploadedList.data[docIndex].editable = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tnotificationService.success('Status Updated successfully');\n\t\t\t\t\t$timeout(function () {\n\t\t\t\t\t\tself.display.uploaded.uploadedfiltered = true;\n\t\t\t\t\t}, 200);\n\t\t\t\t}, function (error) {\n\t\t\t\t\tself.uploadedList.data[index].newstatus = self.uploadedList.data[index].status;\n\t\t\t\t\tnotificationService.error('Status not updated please try again');\n\t\t\t\t});\n\t\t}", "function setStatus() {\n hour = moment().hours();\n timeBlock.each(function () {\n let thisHour = parseInt($(this).attr(\"id\"));\n if (thisHour > hour) {\n $((this).children[1]).addClass(\"future\")\n }\n else if (thisHour === hour) {\n $((this).children[1]).addClass(\"present\");\n }\n else {\n $((this).children[1]).addClass(\"past\");\n }\n })\n}", "async function endMeeting(id) {\r\n try {\r\n return response = await axios.put(`https://api.zoom.us/v2/meetings/${id}/status`,{\r\n headers: {\r\n 'content-type': 'application/json',\r\n authorization: 'Bearer '+token \r\n },\r\n data: JSON.stringify({action: 'end'})\r\n }).catch(err => console.log('Error en endMeeting', err.data));\r\n } catch (error) {\r\n //console.error(error);\r\n }; \r\n}", "function toggleReminder(id) {\n setTasks(tasksArray.map((task) => task.id === id ? {\n ...task, reminder: !task.reminder } : task\n \n ) \n )\n }", "function changeStaffStatus(seconds, availableStaff, status) {\n setTimeout(async function () {\n await staffService.changeMyStatus(availableStaff, status)\n }, seconds * 1000);\n\n}", "function setStatus (element, status) {\n console.log(\"id: \" + element.getAttribute(\"id\"));\n // TODO: the time it takes to trigger a change should be variable\n setTimeout(function () {element.setAttribute(\"class\", \"status-\" + status);}, 1000);\n runAnim(element, status);\n }", "function updateIssueStatusInJira(TCID, Id){\n\tgetAjaxSetupConnection('POST');\n\n\tvar jsonData = {\n\t\t\"transition\": {\n\t \"id\": Id \n\t }\n\t}\n\n $.ajax({\n\t\turl: base_url + '/rest/api/latest/issue/' + TCID + '/transitions?expand=transitions.fields',\n\t\tdata: JSON.stringify(jsonData),\n\t\tsuccess: function (data, status, xhr) { \n\t\t\tconsole.log(xhr);\n\t\t},\n\t\tasync: false,\n\t\ttype: 'POST',\n\t\terror: function (error) { console.log(error.responseText);}\n\t});\t\t\t\n}", "function changeProjectStatus() {\n console.log('project selected: ' + this.id)\n\n\n if (this.classList.contains(\"new-status-active\")){\n updateStatus(this.id, \"active\")\n console.log(\"new status: active\")\n } else if (this.classList.contains(\"new-status-inactive\")) {\n updateStatus(this.id, \"inactive\")\n console.log(\"new status: inactive\")\n } else if (this.classList.contains(\"new-status-finished\")) {\n updateStatus(this.id, \"finished\")\n console.log(\"new status: finished\")\n } else if (this.classList.contains(\"new-status-private_active\")) {\n updateStatus(this.id, \"private_active\")\n console.log(\"new status: private_active\")\n } else if (this.classList.contains(\"new-status-private_inactive\")) {\n updateStatus(this.id, \"private_inactive\")\n console.log(\"new status: private_inactive\")\n } else if (this.classList.contains(\"new-status-private_finished\")) {\n updateStatus(this.id, \"private_finished\")\n console.log(\"new status: private_finished\")\n }\n // after updating the status we reload all tables\n updateTableView()\n}", "function chooseSchedule(key) {\n _schedule = key;\n \n // load and display resources for this particular schedule\n loadResources();\n updateUI();\n setupCanvas();\n }", "function editdefaultschedule(req, res, nxt) {\n var arenaid = req.params.arenaid;\n Arena.findOne({ _id: arenaid }, function (err, arena) {\n if (err) {\n return res.status(500).json({ error: err.message });\n }\n if (!arena) {\n return res.status(400).json({ error: 'the arena is not found' });\n }\n if (req.user && arena.service_provider == req.user._id) {\n var new_sch = new Array(7);\n for (var i = 0; i < 7; i++)\n new_sch[i] = new Array(48).fill(0);\n if (req.body.schedule) {\n var ds = req.body.schedule;\n for (var i = 0; i < ds.length; i++) {\n var sa = ds[i].split(\",\");\n var x = parseInt(sa[0]);\n var y = parseInt(sa[1]);\n new_sch[x][y] = -1;\n }\n }\n arena.default_weekly_schedule = new_sch;\n arena.save(function (err) {\n if (err) {\n return res.status(500).json({ error: err.message });\n }\n });\n return res.json(arena);\n } else {\n return res.status(400).json({ error: 'you are not autherized to view this page' });;\n }\n });\n}", "function schedule() {\n\n\n\t$(\"#sections\").change(function () {\n\t\t$.ajax({\n\t\t\turl: base_url + \"Welcome/fetchSchedule\",\n\t\t\ttype: 'post',\n\t\t\tdataType: 'json',\n\t\t\tdata: { id: $(this).val() },\n\t\t\tsuccess: function (data) {\n\t\t\t\tif (data == false) {\n\t\t\t\t\t$(\"#schedule_section\").html(\"<div class='col s4'></div><div class='col s4'><h4>No Attendance Encoded Yet</h4></div><div class='col s4'></div>\");\n\t\t\t\t} else {\n\t\t\t\t\tvar calendar = new Timetable();\n\t\t\t\t\tcalendar.setScope(7, 21);\n\t\t\t\t\tcalendar.addLocations(['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']);\n\t\t\t\t\tfor (var i = 0; i < data.length; i++) {\n\n\t\t\t\t\t\t// console.log(data[i]);\t\n\t\t\t\t\t\tcalendar.addEvent(data[i].schedule_venue, data[i].day, new Date(2015, 7, data[i].s_d, data[i].s_h, data[i].s_min), new Date(2015, 7, data[i].e_d, data[i].e_h, data[i].e_min));\n\t\t\t\t\t\tvar renderer = new Timetable.Renderer(calendar);\n\t\t\t\t\t\trenderer.draw('.timetable');\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\n\n\t});\n}", "function setActive(id)\n{\n\tactive = id;\n\n// selected button => send action\n\tif ($(\"#\"+active).attr(\"select\")) {\n\t\tvar type = $(\"#\"+active).attr(\"select\");\n\t\tvar type_id = $(\"#\"+active).attr(type+\"_id\");\n\t\tvar start = $(\"#\"+active).attr(\"start\");\n\n\n// get route\n//TODO send action to api\n\t\tvar route = getRoute(start,type_id);\n\n\t\tclearActive();\n\t}\n\telse {\n\n// button pushed\n\t\tif ($(\"#\"+active).attr(\"active\")) {\n\t\t// stop timeout\n\t\t\tclearActive();\n\t\t}\n\t\telse {\n\t\t// set block active\n\t\t\tclearActive();\n\t\t\tactive = id;\n\t\t\t$(\"#id-input\").val(id);\n\n\t\t\t$(\"#\"+active).attr(\"active\",id)\n\t\t\t\t.css(\"background-color\",activeColor);\n\n\t\t// start/restart timeout\n\t\t\tif (timeout) {\n\t\t\t\tclearInterval(counter);\n\t\t\t\tcounter = setInterval (clearActive,timeout);\n\t\t\t}\n\t\t}\n\t}\n}", "function updateJobStatusToActive(req,res,next){\n db.none(`update Jobs set status = $1 where id = $2`,\n ['active', req.params.job_id])\n .then(() => {\n console.log('Updated Job Status to Active');\n next()\n })\n .catch((err) => {\n console.error('error updating job status: ', err);\n })\n}", "function setPlayStatus(key, newStatus) {\n let status = playStatus.findOne()\n status[key] = newStatus\n return playStatus.update(status)\n }", "function switchStatus() {\n var values = {};\n values.id = $(this).data('id');\n\n if ($(this).is(':checked')) {\n values.complete = true;\n } else {\n values.complete = false;\n }\n\n $.ajax({\n type: 'POST',\n url: 'task/switch',\n data: values,\n success: function(){\n updateTaskList();\n }\n });\n}", "function ScheduleChange_ChangeScheduleButtonCheck(e) {\n\tvar scheduleIdSelected = document.getElementById('sel_scheduleId').value;\n\tconsole.log('scheduleIdSelected='+scheduleIdSelected);\n\tif ( scheduleIdSelected ) {\n\t\tdocument.getElementById('btn_Change_schedule').disabled = false;\n\t} else {\n\t\tdocument.getElementById('btn_Change_schedule').disabled = true;\n\t}\n} // END ScheduleChange_ChangeScheduleButtonCheck.", "function updateStudent(id) {\n let list = students[id - 1];\n console.log(list);\n setName(list.name)\n setRollNo(list.rollno)\n setStudentID(list.id)\n setFlag(false);\n }", "function updateActivity(id) {\n vm.updateResponse = \"\";\n if (!vm.isConnected()) {\n alert(\"Connect to Strava to update the local DB.\");\n return;\n }\n vm.updateResponse = \"Update in progress...\";\n $http.get('updateactivity', { params: { activity_id: id } }).then(function (response) {\n vm.updateResponse = \"Activity successfully updated.\";\n addPacetoActivities(response.data);\n setGearsNamesForActivities(response.data);\n const activitiesToRemove = []\n for (var i = 0; i < vm.activities.length; i++) {\n if (vm.activities[i].id == id) {\n activitiesToRemove.push(vm.activities[i])\n vm.activities[i] = response.data[0];\n break;\n }\n }\n updateGearTotals(response.data, activitiesToRemove);\n });\n }", "function changeStatus() {\n event.preventDefault();\n var taskID = {};\n console.log('you clicked me');\n taskID.id = $(this).parent().parent().data('taskID');\n //console.log('you clicked me',taskID);\n $.ajax({\n type: 'PUT',\n url: '/todo/status',\n data: taskID,\n success: function() {\n showTasks();\n var toad = new Audio('../assets/audio/mk64_toad03.wav');\n toad.play();\n }\n });\n}", "setStatus(pid, status) {\n\t\tthis.statusCache[pid] = status;\n\t}", "function updateSpots(id){\n for(const each of state.days){\n for(const ids of each.appointments){\n if(ids === id){\n Promise.all([axios.get(`http://localhost:8001/api/days`)])\n .then(response => setState(prev => ({...prev, days: response[0].data})))\n }\n }\n } \n }", "set id(val) {\n if (this._id) {\n throw new Error(`Can't change id!`);\n }\n this._id = val;\n }", "set id(val) {\n if (this._id) {\n throw new Error(`Can't change id!`);\n }\n this._id = val;\n }", "function editActivity(clicked_id) {\n\tvar baseUrl = \"../../php/objects/activityUpdate.php\";\n\tvar ddlDate = document.getElementById(\"ddlDate\" + clicked_id);\n\tvar startTime = document.getElementById(\"tbStartTime\" + clicked_id).value;\n\tvar endTime = document.getElementById(\"tbEndTime\" + clicked_id).value;\n\n\tvar checkValid = moment(startTime, \"hh:mm A\").isBefore(moment(endTime, \"hh:mm A\"));\n\n\t/* before allowing edit, check if time set is valid */\n\tif (checkValid == true) {\n\t\tdocument.getElementById(\"conflictAlert\" + clicked_id).style.display = \"none\";\n\n\t\t$.ajax({\n\t\t\turl: baseUrl,\n\t\t\ttype: \"POST\",\n\t\t\tdataType: \"json\",\n\t\t\tdata: {\n\t\t\t\tactivityID: clicked_id,\n\t\t\t\tactivityDate: ddlDate.options[ddlDate.selectedIndex].value,\n\t\t\t\tstartTime: moment(startTime, \"hh:mm A\").format(\"HH:mm\"),\n\t\t\t\tendTime: moment(endTime, \"hh:mm A\").format(\"HH:mm\"),\n\t\t\t},\n\t\t}).done(function (responseText) {\n\t\t\tif (responseText == 1) {\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t});\n\t} else {\n\t\tdocument.getElementById(\"conflictAlert\" + clicked_id).style.display = \"\";\n\t}\n}", "function saveSchedule(schedule) {\n var postData = JSON.stringify(schedule);\n var settings = {\n method: 'POST',\n url: 'Schedule/SaveSchedule',\n data: postData,\n headers: { 'Content-Type': 'application/json' }\n }\n return httpFactory.post(settings);\n }", "function getStatus(id) {\n $.ajax({\n url: `/schemas/datasets/${id}/`,\n method: 'GET'\n })\n .done((res) => {\n $('#'+id).html(\"Ready\");\n $('#'+id).toggleClass('disabled btn-outline-warning', false);\n $('#'+id).toggleClass('btn-outline-success', true);\n const status = res.status;\n const url = res.url;\n $('#'+id).attr(\"href\", url);\n if (status === 'ready') return false;\n $('#'+id).html(status);\n $('#'+id).toggleClass('disabled btn-outline-warning', true);\n $('#'+id).toggleClass('btn-outline-success', false);\n setTimeout(function() {\n getStatus(id);\n }, 1000);\n })\n .fail((err) => {\n console.log(err)\n });\n}", "function changeTaskStatus(taskId){\n\t\tlet task = $('.task[data-id=\"'+taskId+'\"]');\n\t\tif (!task.hasClass('task-done')) {\n\t\t\ttask.addClass('task-done');\n\t\t\ttask.data('status', 'done');\n\t\t\ttask.attr('data-status', 'done');\n\t\t}else{\n\t\t\ttask.removeClass('task-done');\n\t\t\ttask.data('status', 'to_do');\n\t\t\ttask.attr('data-status', 'to_do');\n\t\t}\n\t}", "function update_status () {\n $timeout(function () {\n var system_status = system_service.get_system_status_by_type(\"flow_in\");\n console.log('hv tgc flowin controller: query system status FlowIn[%s]', system_status);\n\n if (system_status == \"start\") {\n $scope.tgc_lock_state = true;\n $scope.hv_lock_state = true;\n }\n else if (system_status == \"stop\") {\n $scope.hv_lock_state = hv_tgc_service.get_lock_state(\"flow_in\", \"hv\");\n $scope.tgc_lock_state = hv_tgc_service.get_lock_state(\"flow_in\", \"tgc\");\n }\n else {\n console.log('hv tgc flowin controller: received invalid system status - '+system_status);\n }\n }, 0);\n }", "resetSchedule() {\n this._scheduler.resetSchedule();\n }", "function update(id, params, callback) {\n core.api('PUT', '/statuses/' + id, params, callback);\n }", "function changeReservationStatus(status, fetcher, junkId) {\n return axios.post(BASE_URL + '/itemStatus', {\n status, fetcher, junkId\n })\n .then(response => response.data)\n .catch(function (error) {\n return error;\n });\n}", "function saveActivity(id, planned_activity) {\n const bookedTimeslot = {\n ...state.planned_activities[id],\n planned_activity: { ...planned_activity },\n };\n\n const plannedActivities = {\n ...state.planned_activities,\n [id]: bookedTimeslot,\n };\n\n return axios\n .put(`/api/plannedActivities/${id}`, { planned_activity })\n .then(() => {\n setState((prev) => ({\n ...prev,\n plannedActivities,\n }));\n });\n }", "updateStatus(status: string){\n this.status = new Status(status);\n }", "constructor(schedule) {\n\n }", "function editSchedule(info) {\n $.get('/getScheduleInfo', {id: info}, function (data) { //This will make a call to the framework to get all the classrooms that are assigned to the selected room\n $(\"#_id\").val(data[0]._id);\n $(\"#Room_Number\").val(data[0].Room_Number);\n });\n}", "function updateTaskOnAPI(id, isCompleted) {\n let endpoint = '/tasks/' + id + '/update';\n executeHTTPRequest(isCompleted, 'PUT', endpoint)\n}", "function fnchangeStatus(obj){\r\n\tvar\tobjStatus=document.getElementById(\"status_\"+ obj);\r\n\tobjMessageContent.style.color=\"#000000\";\r\n\tfnselectTask ();\r\n\tstrMemberName=obj;\r\n\tif (strAssigndTask!=\"\")\r\n\t{\r\n\t\tif(strPlayerStatus==\"available\")\r\n\t\t{\r\n\t\t\tfnAssignTask(strMemberName);\r\n\t\t\tstrAssigndTask=\"\";\r\n\t\t\t//fnassignedTask(strMemberName, currentTask);\r\n\t\t\t//currentTask.style.backgroundColor=\"#CFBA81\";\r\n\t\t\tboolTaskStatus=false;\r\n\t\t\ttaskturnNo=\"1\";\r\n\t\t}else\r\n\t\t{\r\n\t\t\tstrAssigndTask=\"\";\r\n\t\t\tobjMessageContent.style.color=\"red\";\r\n\t\t}\r\n\t}else{\r\n\t\tif(!boolTaskStatus && strPlayerStatus==\"available\")\r\n\t\t{\r\n\t\tobjMessageContent.innerHTML = \"Message: Select a task to be assigned to the team member first.\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tvar resetLabel;\r\n\t\t\tresetLabel=ataskAssigned[strMemberName];\r\n\t\t\tvar strresetLabel=resetLabel\t\t\t\t// resetLabel.id;\r\n\t\t\tvar k=0;\r\n\t\t\tdocument.getElementById(resetLabel).style.backgroundColor=\"\";\r\n\t\t\tfnUnAssign(strMemberName);\r\n\t\t\tfnassignedTask(strMemberName, \"\");\r\n\t\t\tobjStatus.innerHTML=\"available\";\r\n\t\t\tboolBtnstatus=false;\r\n\t\t\tboolTaskStatus=false;\r\n\t\t}\r\n\t}\r\n\tobjFrmTask.reset();\r\n}", "function changeSchedule(inc) {\n\tvar list = document.getElementById(\"tableschedules\");\n\tvar currNum = parseInt(list.attributes[\"name\"].value);\n\tvar listItem = list.getElementsByTagName(\"table\");\n\tvar list2 = document.getElementById(\"textschedules\");\n\tvar listItem2 = list2.getElementsByTagName(\"table\");\n\tif (currNum + inc >= 0 && currNum + inc < Math.min(listItem.length, 500)) {\n\t\tlistItem[currNum].style.display = \"none\";\n\t\tlistItem[currNum + inc].style.display = \"table\";\n\t\tlist.attributes[\"name\"].value = listItem[currNum + inc].id;\n\t\tlistItem2[currNum].style.display = \"none\";\n\t\tlistItem2[currNum + inc].style.display = \"table\";\n\t\tlist2.attributes[\"name\"].value = listItem[currNum + inc].id;\n\t\t$('#changet').val(currNum + inc + 1);\n\t\tvar title = document.getElementById('title');\n\t\tvar split = title.innerText.split(' ');\n\t\tsplit[1] = (parseInt(split[1]) + inc) + \"\";\n\t\ttitle.innerHTML = \"<b>\" + split[0] + \" \" + split[1] + \" \" + split[2] + \" \" + split[3] + \"</b>\";\n\t}\n}", "getSchedule(doctorId) {\n return this.api.getDoctorSchedule(doctorId, this.selectedDateTime).then(schedule => {\n this.doctor = doctorId;\n this.schedule = schedule;\n this.originalDoctor = doctorId;\n });\n }", "set IsDirty(value) {\n this[s_scheduleIsDirty] = value;\n }", "function handleChangeStatus (id) {\n const confirmMessage = swal(\"Vas a cambiar el estado de este pago, estás seguro?\", {\n buttons: [\"Cancelar\", \"Confirmar\"],\n });\n\n confirmMessage.then( res => { \n dispatch(changeStatus(id))\n .then(() => {\n dispatch(getExpenses())\n })\n })\n }", "function stopSchedule() {\n window.clearTimeout(wrt.scheduleTimeout);\n window.clearTimeout(wrt.updateTimeout);\n setUpdateMessage('');\n wrt.isScheduled = false;\n }", "checkAvabilityScheduleExceptId(id, date, start, end) {\n const schedule = mysql_1.default.raw(`SELECT * FROM schedule WHERE date = \"${date}\" AND \n ((\"${start}\" BETWEEN start_time AND end_time) OR\n (\"${end}\" BETWEEN start_time AND end_time)) AND id <> ${id};`);\n return schedule;\n }", "editStatus(req, res) {\n try {\n const {\n todo_id,\n current_status,\n } = req.body\n\n\n ToDo.updateOne({ todo_id: todo_id }, {\n current_status: current_status\n }, function(\n err,\n response\n ) {\n if (err) {\n res.send(err);\n } else {\n response.status_code = 200\n res.json(response);\n }\n });\n } catch (error) {\n console.log(error);\n }\n }" ]
[ "0.6909573", "0.6799831", "0.60335", "0.60310316", "0.59682524", "0.5910756", "0.5839768", "0.57532656", "0.5659066", "0.5653452", "0.56521744", "0.565207", "0.5643706", "0.5599471", "0.55869824", "0.5576613", "0.55636865", "0.55456233", "0.5500756", "0.5496788", "0.5489824", "0.5476346", "0.5437485", "0.54254436", "0.54213554", "0.54128397", "0.5405578", "0.54021096", "0.5395447", "0.5381195", "0.53607583", "0.5336344", "0.5324105", "0.5309036", "0.5288773", "0.5286933", "0.52853644", "0.52779627", "0.52648634", "0.5263165", "0.52584565", "0.52582866", "0.5250822", "0.52495545", "0.5246528", "0.5236851", "0.522777", "0.52222365", "0.52217114", "0.5214936", "0.52098817", "0.52022123", "0.5195423", "0.5192777", "0.5187667", "0.5181321", "0.51766634", "0.5172954", "0.5166084", "0.5156312", "0.5156107", "0.5155046", "0.5154706", "0.51338285", "0.51175815", "0.51110923", "0.5105492", "0.51048964", "0.5075724", "0.50703037", "0.5069597", "0.50695217", "0.50345826", "0.50273645", "0.5024291", "0.5023087", "0.50217474", "0.5021017", "0.5021017", "0.5020637", "0.5017126", "0.5016411", "0.5007434", "0.5006005", "0.4992014", "0.4984704", "0.498443", "0.49827114", "0.49758178", "0.49753782", "0.49724436", "0.49702236", "0.4968911", "0.4959392", "0.49586943", "0.49548006", "0.49529654", "0.49488482", "0.49481314", "0.49415863" ]
0.77155966
0
Sets the time of a specific schedule. id id of the specific schedule which should be set up
setScheduleTime(id) { let minutes = this.state.WakeUpTimeMinutes; let hours = this.state.WakeUpTimeHours; if(minutes > this.state.sunriseDurationBeforeWakeUp) { minutes = minutes - this.state.sunriseDurationBeforeWakeUp; } else { minutes = 60 + minutes - this.state.sunriseDurationBeforeWakeUp; hours == 0 ? hours = 23 : hours -= 1; } let time = "W124/T" + (hours < 10 ? "0" + hours : hours) + ":" + (minutes < 10 ? "0" + minutes : minutes) + ":00"; /** * REST call to change the status of a schedule to enabled/disabled. */ fetch('http://192.168.0.21/api/CeyiFspaKI7cxGvtu9uOLJmQgOmAZuoUyMaxwETp/schedules/' + id, { method: 'PUT', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ 'localtime': time }) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTime() {\n var hours = $('input[name=\"schedule_hour_submit\"]').val();\n var minutes = $('input[name=\"schedule_minute_submit\"]').val();\n if (!_.isEmpty(hours) && !_.isEmpty(minutes)) {\n schedule.scheduleTime = $('input[name=\"schedule_hour_submit\"]').val() + ':' + $('input[name=\"schedule_minute_submit\"]').val() + ' ' + $('select[name=\"schedule_ampm_submit\"] option:selected').val();\n }\n\n if (!_.isNull(schedule.scheduleDate) && !_.isNull(schedule.scheduleTime)) {\n var date = moment(schedule.scheduleDate).format('DD-MM-YYYY');\n var datetime = date + ' ' + schedule.scheduleTime;\n schedule.scheduleDateTime = moment(datetime, 'DD-MM-YYYY hh:mm a');\n }\n\n }", "ScheduleAt(time){\n \tconsole.log(\"scheduleprofecionales at\");\n }", "function updateClock(id) {\r\n var now = new Date();\r\n var dname = now.getDay(),\r\n mo = now.getMonth(),\r\n dnum = now.getDate(),\r\n yr = now.getFullYear(),\r\n hou = now.getHours(),\r\n min = now.getMinutes(),\r\n sec = now.getSeconds(),\r\n pe = \"AM\";\r\n\r\n Number.prototype.pad = function (digits) {\r\n for (var n = this.toString(); n.lenght < digits; n = 0 + n);\r\n return n;\r\n };\r\n\r\n var months = [\r\n \"January\",\r\n \"February\",\r\n \"March\",\r\n \"April\",\r\n \"May\",\r\n \"June\",\r\n \"July\",\r\n \"August\",\r\n \"Septempber\",\r\n \"October\",\r\n \"November\",\r\n \"December\",\r\n ];\r\n var week = [\r\n \"Sunday\",\r\n \"Monday\",\r\n \"Tuesday\",\r\n \"Wednesday\",\r\n \"Thursday\",\r\n \"Friday\",\r\n \"Saturday\",\r\n ];\r\n var ids = [\r\n \"dayname\",\r\n \"month\",\r\n \"daynum\",\r\n \"year\",\r\n \"hour\",\r\n \"minutes\",\r\n \"seconds\",\r\n \"perdiod\",\r\n ];\r\n var values = [\r\n week[dname],\r\n months[mo],\r\n dnum.pad(2),\r\n yr.pad(2),\r\n hou.pad(2),\r\n min.pad(2),\r\n sec.pad(2),\r\n pe,\r\n ];\r\n for (var i = 0; i < ids.length; i++) {\r\n console.log(ids[i]);\r\n document.getElementById(ids[i]).firstChild.nodeValue = values[i];\r\n }\r\n}", "function onTimeChange(id) {\n currentHour = parseInt($('#' + id).val());\n // Sync all time selector\n $('.hour[id!=\"' + id + '\"]').val(currentHour);\n // Refresh UI element for time display\n $('.time-string').text(currentHour + ':00');\n // Update display data\n updateVisualData();\n // Update data binding\n updateVisualDataBinding();\n // Update display data\n updateDataByTime();\n // Dispatch event\n document.dispatchEvent(new CustomEvent('timechanged'));\n}", "getScheduleById(id) {\n const schedule = mysql_1.default('schedule').where('id', id);\n return schedule;\n }", "function updateAssignmentTimeCardData(id, data) {\n getAssignmentMapForID(id).setKeyProp('timeCardData', getTimeModelObj().date, data);\n }", "updateSchedule() {\n this.view.eventBlocks.setSchedule(this.model.getSchedule());\n }", "function startSetTime() { \n if (t == 1) {\n sSetTime++;\n if (sSetTime > 59) { //When sSetTime reaches 1 minute it resets to 0 the mSetTime value increases by 1\n mSetTime++;\n sSetTime = 0;\n }\n if (mSetTime > 59) { //When mSetTime reaches 1 hour it resets to 0 the hSetTime value increases by 1\n hSetTime++;\n mSetTime = 0;\n }\n if (hSetTime > 23) { //When hSetTime reaches 24 hours its value resets\n hSetTime = 0;\n } \n }\n setTimeTO = setTimeout(function () { startSetTime() }, 1000); //1 second intervals\n }", "function setBreakfast (i_day, id) {br_id[i_day] = id;}", "setTime(time) {\n this.time.setTime(time);\n }", "function setTime() {\n\n\ttime = new Date();\n\ttime.setTime(time.getTime() + 60000);\n\tinterval = setInterval(cronos, 10);\n}", "function updateSchedule() {\n // clear all textblocks\n $(\"textarea\").empty();\n // check the time and formatting]\n styleSchedule(startHr, endHr);\n // insert the text items\n // i is the id of the textarea associated\n // with each hour on the schedule\n for (i = startHr; i <= endHr; i++) {\n indx = i - startHr;\n var nextEl = $(`#${i}`);\n nextEl.text(scheduleList[indx].task);\n }\n }", "function setTime() {\n // Create date instance\n var date = new Date();\n // Get hours and minutes and store in variables\n var hours = date.getHours(),\n minutes = date.getMinutes();\n // If number of minutes < 10, the time looks like this: 6:6. We want 6:06 instead, so add a 0\n if (minutes < 10) {\n minutes = '0' + minutes;\n }\n // Define elements where to put hours and minutes\n var $hoursElement = $('#time .time-hours'),\n $minutesElement = $('#time .time-minutes');\n // Put hours and minutes in the elements\n $hoursElement.text(hours);\n $minutesElement.text(minutes);\n }", "function setTime( t ){\n\n this.time = t;\n\n }", "function setAlarmTime(value) {\r\n alarmTime = value;\r\n}", "function setTime(){\n let hr = Quas.getEl(\"#time-picker-hr\").val();\n let min = Quas.getEl(\"#time-picker-min\").val();\n\n //validate time\n if( isNaN(hr) || isNaN(min) ||\n min < 0 || min > 59 || hr < 0 || hr > 23 ||\n hr=== \"\" || min === \"\"){\n new Notification(\"Invalid Time\", 4).render();\n }\n else{\n Toolbar.curTime.setHours(Number(hr), Number(min), 0);\n setTimeString();\n Toolbar.publishNow = false;\n closeToolModals();\n }\n}", "constructor(schedule) {\n\n }", "function chooseSchedule(key) {\n _schedule = key;\n \n // load and display resources for this particular schedule\n loadResources();\n updateUI();\n setupCanvas();\n }", "updateStartedWorkLog(id, beginTime) {\n const index = dataModel.worklogs.findIndex((logs) => logs._id === id);\n try {\n dataModel.worklogs[index].startTime = beginTime;\n } catch (err) {\n console.log('couldn\\'t find the object');\n }\n\n }", "function update(day, time, eid, callback) {\n connection.query('UPDATE Schedule SET day = ?, time = ? WHERE eid = ?', [day, time, eid], function(err) {\n err ? callback(err) : callback(null);\n });\n}", "function Schedule(options,element){return _super.call(this,options,element)||this;}", "function setPlanner() {\n\n $(\"#currentDay\").text(moment().format(\"dddd, MMMM Do YYYY\"));\n\n $(\".time-block\").each(function () {\n const id = $(this).attr(\"id\");\n const schedule = localStorage.getItem(id);\n\n if (schedule !== null) {\n $(this).children(\".schedule\").val(schedule);\n }\n });\n}", "function SetTime() {\r\n let date = new Date();\r\n let time = (date.getHours()+1) + ':' + (date.getMinutes() < 10 ? '0' : '') + (date.getMinutes());\r\n \r\n document.querySelector('.order--timer').textContent = time;\r\n // console.log('updated at',time)\r\n setTimeout(SetTime, 60000);\r\n }", "function setTimes() {\n\tvar schTime = $(\"#sel_schedule\").val();\n\tif(schTime != -1) {\n\t\tvar schStr = $(\"#sel_schedule\").find('option:selected').text();\n\t\tvar beginDat = $.trim(schStr.split(',')[0]);\n\t\tvar endDat = $.trim(schStr.split(',')[1]);\n\t\t$(\"#startDate\").val(beginDat.split(' ')[0]);\n\t\t$(\"#startTime\").val(beginDat.split(' ')[1]);\n\t\t$(\"#endDate\").val(endDat.split(' ')[0]);\n\t\t$(\"#endTime\").val(endDat.split(' ')[1]);\n\t}\n}", "night() {\n this.time.setHours(21);\n }", "setScheduleStatus(id) {\n\n let statusToSet = this.state.scheduleIsOn ? 'enabled' : 'disabled';\n\n /**\n * REST call to change the status of a schedule to enabled/disabled.\n */\n fetch('http://192.168.0.21/api/CeyiFspaKI7cxGvtu9uOLJmQgOmAZuoUyMaxwETp/schedules/' + id, {\n method: 'PUT',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n 'status': statusToSet\n })\n });\n }", "morning() {\n this.time.setHours(4);\n }", "function setTimer(roomId) {\n const room = rooms[roomId];\n room.currentClaims = [0, 0, 0, 0];\n let sec = turnTime;\n var timer = setInterval(function(){\n io.to(roomId).emit('turn-timer', sec);\n if (sec === 0){\n clearInterval(timer);\n room.timerElapsed = true;\n executeGreatestClaim(roomId);\n }\n sec--;\n }, 1000);\n}", "function schedule() {\n\n\n\t$(\"#sections\").change(function () {\n\t\t$.ajax({\n\t\t\turl: base_url + \"Welcome/fetchSchedule\",\n\t\t\ttype: 'post',\n\t\t\tdataType: 'json',\n\t\t\tdata: { id: $(this).val() },\n\t\t\tsuccess: function (data) {\n\t\t\t\tif (data == false) {\n\t\t\t\t\t$(\"#schedule_section\").html(\"<div class='col s4'></div><div class='col s4'><h4>No Attendance Encoded Yet</h4></div><div class='col s4'></div>\");\n\t\t\t\t} else {\n\t\t\t\t\tvar calendar = new Timetable();\n\t\t\t\t\tcalendar.setScope(7, 21);\n\t\t\t\t\tcalendar.addLocations(['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']);\n\t\t\t\t\tfor (var i = 0; i < data.length; i++) {\n\n\t\t\t\t\t\t// console.log(data[i]);\t\n\t\t\t\t\t\tcalendar.addEvent(data[i].schedule_venue, data[i].day, new Date(2015, 7, data[i].s_d, data[i].s_h, data[i].s_min), new Date(2015, 7, data[i].e_d, data[i].e_h, data[i].e_min));\n\t\t\t\t\t\tvar renderer = new Timetable.Renderer(calendar);\n\t\t\t\t\t\trenderer.draw('.timetable');\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\n\n\t});\n}", "function Scheduler(guild_id) {\n\tlet timeRule, timeJob, midnightRule, midnightJob;\n\tfunction init(time = \"00:00\", timezone, timeCommand, midnightCommand) {\n\t\ttimeRule = new schedule.RecurrenceRule();\n\t\tmidnightRule = new schedule.RecurrenceRule();\n\t\tif (timezone) {\n\t\t\ttimeRule.tz = timezone;\n\t\t\tmidnightRule.tz = timezone;\n\t\t}\n\t\t[timeRule.hour, timeRule.minute] = time.split(\":\").map(part => part * 1);\n\t\ttimeJob = schedule.scheduleJob(timeRule, (time) => {\n\t\t\ttry {\n\t\t\t\ttimeCommand(guild_id, time);\n\t\t\t} catch(e) {\n\t\t\t\tconsole.error(guild_id, time, e);\n\t\t\t}\n\t\t});\n\t\t[midnightRule.hour, midnightRule.minute] = [0, 0];\n\t\tmidnightJob = schedule.scheduleJob(midnightRule, (time) => {\n\t\t\ttry {\n\t\t\t\tmidnightCommand(guild_id, time);\n\t\t\t} catch(e) {\n\t\t\t\tconsole.error(guild_id, time, e);\n\t\t\t}\n\t\t});\n\t}\n\tfunction setTimezone(timezone) {\n\t\ttimeRule.tz = timezone;\n\t\ttimeJob.reschedule(timeRule);\n\t\tmidnightRule.tz = timezone;\n\t\tmidnightJob.reschedule(midnightRule);\n\t}\n\tfunction setTime(time = \"00:00\") {\n\t\t[timeRule.hour, timeRule.minute] = time.split(\":\").map(part => part * 1);\n\t\ttimeJob.reschedule(timeRule);\n\t}\n\tfunction destroy() {\n\t\ttimeJob.cancel();\n\t\tmidnightJob.cancel();\n\t\tdelete schedulers[guild_id];\n\t}\n\treturn {\n\t\tinit,\n\t\tsetTimezone,\n\t\tsetTime,\n\t\tdestroy\n\t}\n}", "function setTime() {\n //increments timer\n ++totalSeconds;\n //temporarily stops timer at 5 seconds for my sanity\n if (totalSeconds === 59) {\n totalMinutes += 1;\n totalSeconds = 0;\n }\n\n //stops timer when game is won\n if (gameWon === true) {\n return;\n }\n //calls function to display timer in DOM\n domTimer();\n }", "function schedule(event) {\n let targetElementId = event.target.id;\n let targetElement = document.getElementById(targetElementId);\n let parentElement = targetElement.parentElement;\n let newElement = targetElement.cloneNode(true);\n newElement.classList.toggle('button-schedule-active');\n if (targetElement.innerHTML === 'schedule') {\n newElement.innerText = 'scheduled';\n } else {\n newElement.innerText = 'schedule';\n }\n newElement.addEventListener('click', schedule);\n parentElement.removeChild(targetElement);\n parentElement.appendChild(newElement);\n}", "function scheduleEmail(email_id, millisFromNow) {\n console.log(\"email with id \" + email_id + \" scheduled for \" + millisFromNow + \" milliseconds from now\");\n var job = setTimeout(function() {\n sendEmail(email_id);\n },millisFromNow);\n\n scheduled_emails.set(email_id,job);\n}", "function set_time_link(task_id, type) {\n $('.time-button').each( (_, bb) => {\n if (type === \"Start\") {\n if (task_id == $(bb).data('task-id') && $(bb).data('type') === \"Start\") {\n $(bb).data('clicked', \"Yes\");\n }\n }\n else {\n // Change the clicked flag of the Start button back to \"No\" so that it\n // will render as a 'Start' link again\n if (task_id == $(bb).data('task-id') && $(bb).data('type') === \"Start\") {\n $(bb).data('clicked', \"No\");\n // Cleat the time id so that the user cannot click 'End' before\n // clicking 'Start'\n TIME_ID = \"\";\n }\n }\n });\n end_links();\n}", "edit() {\n\t\tthis.mode = \"Edit Schedule\";\n\t\tthis.transaction = this.schedule;\n\t}", "function Schedule(input) {\n this.exclude = new ScheduleModifier_ScheduleModifier();\n this.include = new ScheduleModifier_ScheduleModifier();\n this.cancel = new ScheduleModifier_ScheduleModifier();\n this.meta = new ScheduleModifier_ScheduleModifier();\n if (Functions.isDefined(input)) {\n this.set(input);\n }\n }", "function set(obj) {\n obj.time = util.time();\n }", "function set_time(game_id) {\n\t\tvar e = document.getElementById('period').value\n\t\tif(e == \"FINAL\" || e == \"FINAL OT\" || e == \"FINAL 2OT\")\n\t\t{\n\t\t\tvar x = confirm(\"Setting the time as FINAL will publish stats to Twitter and Facebook and lock this game from further editing. Are you sure you wish to do this? (Games going into overtime should not be set as final!)\");\n\t\t}\n\t\tif(x || e != \"FINAL\")\n\t\t{\n\t\t\tdocument.getElementById('status_bar').style.backgroundColor = \"yellow\";\n\t\t\tdocument.getElementById('status').innerHTML = \"Saving...\";\n\t\t\tvar e = document.getElementById('period').value;\n\t\t\tif(e == \"HALF\" || e == \"FINAL\" || e == \"FINAL OT\" || e == \"FINAL 2OT\")\n\t\t\t{\n\t\t\t\tvar new_time = e;\n\t\t\t\tdocument.getElementById('time_input').value = \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar new_time = document.getElementById('time_input').value + \" \" + e;\n\t\t\t}\n\t\t\t$.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: \"actions/update_time.php\",\n\t\t\t\tdataType: \"json\",\n\t\t\t\tdata: { id: game_id, time: new_time }\n\t\t\t})\n\t\t\t.done(function( msg ) {\n\t\t\t\treset_timer();\n\t\t\t\tdocument.getElementById('status_bar').style.backgroundColor = msg.color;\n\t\t\t\tdocument.getElementById('status').innerHTML = msg.message;\n\t\t\t\tif(msg.lock == true)\n\t\t\t\t{\n\t\t\t\t\twindow.location = \"game_select.php\";\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdocument.getElementById('status_bar').style.backgroundColor = \"red\";\n\t\t\tdocument.getElementById('status').innerHTML = \"Time change was cancelled by user.\";\n\t\t}\n\t}", "function saveSchedule(timeString, val) {\n\n if(!localStorage.getItem('plans')) {\n localStorage.setItem('plans', JSON.stringify(plans));\n }\n\n let workHours = JSON.parse(localStorage.getItem('plans'));\n workHours[timeString] = val\n\n saveToS(workHours);\n}", "function ScheduleModifier() {\r\n this.map = {};\r\n }", "function ScheduleModifier() {\n this.map = {};\n }", "changeStartTime(startTime){\n this.startTime = startTime;\n }", "function end(task_id, time) {\n if (TIME_ID == \"\") {\n alert(\"You haven't started the task yet.\");\n }\n\n else {\n let text = JSON.stringify({\n time_block: {\n start: START_TIME,\n end: time,\n convert: true\n },\n });\n\n $.ajax(time_block_path + \"/\" + TIME_ID, {\n method: \"put\",\n dataType: \"json\",\n contentType: \"application/json; charset=UTF-8\",\n data: text,\n success: (resp) => { set_time_link(task_id, \"End\"); },\n error: (resp) => { console.log(resp); }\n });\n }\n}", "function fSchedule() {\n this.start_time = \"\";\n this.end_time = \"\";\n this.venue = \"\";\n}", "function SetClassEndTime(e) {\n\tvar DEBUG_SetClassEndTime = true;\n\tif ( DEBUG_SetClassEndTime ) { console.warn('SetClassEndTime[e.id='+e.id+']'); }\n\t// \n\t //chkAutoEnd.checked='+document.getElementById('chkAutoEnd').checked\n\t\n\tvar EndTime;\n\tif ( document.getElementById('chkAutoEnd').checked ) {\n\t\tdocument.getElementById('spn_asLab').style.display = 'inline';\n\t\t// Get course credits.\n\t\tvar CourseId = document.getElementById('id_courseid').value;\n\t\tvar CourseCredits = Course[CourseId].Cr;\n\t\tif ( DEBUG_SetClassEndTime ) { console.log(Course[CourseId].Title+' CourseCredits='+CourseCredits); }\n\t\t// Get meeting days.\n\t\tvar dayRadios = document.getElementsByName('weekdayIds[]');\n\t\tif ( DEBUG_SetClassEndTime ) { console.log('dayRadios.lenght='+dayRadios.length); }\n\t\tvar days = 0;\n\t\tfor ( var i=0; i<dayRadios.length; i++ ) { if ( dayRadios[i].checked ) { days++; } }\n\t\tif ( DEBUG_SetClassEndTime ) { console.log('days='+days); }\n\t\tif ( days > 0 ) {\n\t\t\t// Get beginning time.\n\t\t\tvar BeginTime = document.getElementById('id_scheduleclassmeetingBeginTime').value;\n\t\t\tif ( BeginTime ) {\n\t\t\t\tvar flags = '';\n\t\t\t\tif ( BeginTime.indexOf('m') !== -1 ) { flags = 'a'; } else { if ( BeginTime.indexOf('M') !== -1 ) { flags = 'P'; } }\n\t\t\t\tvar BeginMin = ConvertTimeToMinutes(BeginTime);\n\t\t\t\tif ( DEBUG_SetClassEndTime ) { console.log('BeginTime='+BeginTime+' BeginMin='+BeginMin+' flags='+flags); }\n\t\t\t\tvar meetingMinutes;\n\t\t\t\tif ( !document.getElementById('chkAsLab').checked ) {\n\t\t\t\t\tmeetingMinutes = parseInt( 50 * parseInt(CourseCredits) / days );\n\t\t\t\t} else {\n\t\t\t\t\tmeetingMinutes = parseInt( 110 * parseInt(CourseCredits) / days );\n\t\t\t\t}\n\t\t\t\tvar EndMin = BeginMin + meetingMinutes;\n\t\t\t\tif ( DEBUG_SetClassEndTime ) { console.log('meetingMinutes='+meetingMinutes+' EndMin='+EndMin); }\n\t\t\t\tEndTime = ConvertMinutesToTime(EndMin,flags);\n\t\t\t\tif ( DEBUG_SetClassEndTime ) { console.log('EndTime='+EndTime); }\n\t\t\t} else {\n\t\t\tEndTime = '';\n\t\t\tif ( DEBUG_SetClassEndTime ) { console.log('No begin time, EndTime='+EndTime); }\n\t\t\t}\n\t\t} else {\n\t\t\tEndTime = '';\n\t\t\tif ( DEBUG_SetClassEndTime ) { console.log('No days, EndTime='+EndTime); }\n\t\t}\n\t\tdocument.getElementById('id_scheduleclassmeetingEndTime').value = EndTime;\n\t} else {\n\t\tdocument.getElementById('spn_asLab').style.display = 'none';\n\t}\n} // END SetClassEndTime.", "getSchedule() {\n this.setRelativeTime();\n return this.schedule;\n }", "function setTime() {\n var minutes;\n\n if (status === \"Working\") {\n minutes = workMinutesInput.value.trim();\n } else {\n minutes = restMinutesInput.value.trim();\n }\n\n clearInterval(interval);\n totalSeconds = minutes * 60;\n}", "function Schedule(input) {\r\n this.exclude = new ScheduleModifier();\r\n this.include = new ScheduleModifier();\r\n this.cancel = new ScheduleModifier();\r\n this.meta = new ScheduleModifier();\r\n if (Functions.isDefined(input)) {\r\n this.set(input);\r\n }\r\n }", "updateTime() {\n\t\tthis.setState({\n\t\t\ttime: hrOfDay(),\n\t\t\tday: timeOfDay()\n\t\t});\n\t}", "resetSchedule() {\n this._scheduler.resetSchedule();\n }", "function updateSchedule(scheduleId, updatedSchedule){\n var deferred = q.defer();\n\n ScheduleModel.update(\n {_id: scheduleId},\n { date: updatedSchedule.date,\n time: updatedSchedule.time,\n location: updatedSchedule.location,\n adminId: updatedSchedule.adminId,\n players: updatedSchedule.players},\n\n function(err, doc){\n if (err){\n deferred.reject(err);\n } else {\n deferred.resolve(doc);\n }\n }\n );\n\n return deferred.promise;\n }", "function update_time()\n{\n\t$('.cronos').each(function() {\n\t\tvar name = $(this).attr(\"name\");\n\t\tvar estado = parseInt($(this).attr(\"estado\"));\n\t\tvar time = $(this).val();\n\t\tvar ID = name.substring(6); // a partir de la 6 posicio\n\t\tvar capa = '#time_'+ID;\n\t\tvar capabotons = '#capabotons_'+ID;\n\t\t\n\t\t// color\n\t\tvar color = \"blue\";\n\t\tif (time<3600) color = \"orange\";\n\t\tif (time<300) color = \"red\";\n\t\t$(capa).html(strtotime(time));\n\t\t$(capa).css(\"color\", color);\n\t\t$(this).val(time-1);\n\t\tif (time<0 && estado < 5)\n\t\t\t$(capabotons).hide();\t\n\t});\t\n}", "set time(value) {}", "function saveScheduled(scheduled) {\n const urlParams = new URLSearchParams(window.location.search);\n const idParam = urlParams.get(\"id\");\n\n dbPromised\n .then(function (db) {\n const tx = db.transaction(\"scheduled\", \"readwrite\");\n const store = tx.objectStore(\"scheduled\");\n console.log(scheduled.matches[idParam]);\n store.put(scheduled.matches[idParam]);\n return tx.complete;\n })\n .then(function () {\n M.toast({\n html: \"Jadwal berhasil di simpan.\",\n classes: \"blue darken-1\",\n });\n });\n}", "function startTime(){\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds(); \n//====================\t \n m = AddZero(m);\n s = AddZero(s);\n h = AddZero(h);\n //==================\n var weekday = new Array(7);\n weekday[0] = \"Sunday\";\n weekday[1] = \"Monday\";\n weekday[2] = \"Tuesday\";\n weekday[3] = \"Wednesday\";\n weekday[4] = \"Thursday\";\n weekday[5] = \"Friday\";\n weekday[6] = \"Saturday\";\n\tvar nday = weekday[today.getDay()];\n\tvar dDt= today.getUTCDate();\n\t //===========\n var Perid;\n if (h === \"00\") {Perid= \"It is a new Day !\";} \n else if (h < \"12\") {Perid= \"Good Morning !\";} \t \n else if (h >= \"12\" && h < \"17\") {Perid= \"Good Afternoon !\";} \n else if (h >= \"17\" && h < \"21\") {Perid= \"Good Evening !\";} \n else if (h >= \"21\") {Perid= \"We are in late night !\"; }\n var TimeStake=document.getElementById(\"momenT\"); \n var AdatesNtime=\"<span>It&acute;s \"+nday+\" \"+dDt+\" @ \"+ h + \":\" + m + \":\" + s+ \" \"+Perid+\"</span>\";\n TimeStake.innerHTML =AdatesNtime;\t \n setTimeout(startTime, 500);\n}", "static get schedule() {\n // once every minute\n return '0 0 10 1/1 * ? *'\n }", "function updateTime(s, m, h) {\n\tseconds = s;\n\tminutes = m;\n\thours = h;\n}", "function handleScheduleEdit() {\n var currentSchedule = $(this)\n .parent()\n .parent()\n .data(\"schedule\");\n window.location.href = \"/cms?schedule_id=\" + currentSchedule.id;\n }", "function schedule(event) {\n // local constants\n const scheduleText = 'schedule';\n const scheduledText = 'scheduled';\n\n const targetElementId = event.target.id;\n const targetElement = document.getElementById(targetElementId);\n const parentElement = targetElement.parentElement;\n const newElement = targetElement.cloneNode(true);\n newElement.classList.toggle('button-schedule-active');\n if (targetElement.innerHTML === scheduleText) {\n newElement.innerText = scheduledText;\n } else {\n newElement.innerText = scheduleText;\n }\n newElement.addEventListener('click', schedule);\n parentElement.removeChild(targetElement);\n parentElement.appendChild(newElement);\n }", "function updateTime(idNum) {\n var eventLength = $(\"#rect_\" + idNum)[0].width.animVal.value;\n var hours = Math.floor(eventLength/100);\n if (hours == 0) var minutes = (eventLength)/25*15;\n else var minutes = (eventLength%(hours*100))/25*15;\n \n $(\"#time_text_\" + idNum).text(hours + \"hrs \" + minutes + \"min\");\n\n $(\"#rect_\" + idNum).popover(\"show\");\n var title = $(\"#eventName_\" + idNum).attr(\"placeholder\");\n var startHr = $(\"#startHr_\" + idNum).attr(\"placeholder\");\n var startMin = $(\"#startMin_\" + idNum).attr(\"placeholder\");\n var eventNotes = flashTeamsJSON[\"events\"][getEventJSONIndex(idNum)].notes;\n updateEventPopover(idNum, title, startHr, startMin, hours, minutes, eventNotes);\n $(\"#rect_\" + idNum).popover(\"hide\");\n\n //Update JSON\n var indexOfJSON = getEventJSONIndex(idNum);\n flashTeamsJSON[\"events\"][indexOfJSON].duration = (hours*60) + minutes;\n flashTeamsJSON[\"events\"][indexOfJSON].startTime = (startHr*60) + startMin;\n}", "genSchedule(state, scheduleObj) {\n state.flats.find(\n (flat) => flat.id == state.currentFlatId\n ).chore = scheduleObj\n\n db.collection('flats').doc(state.currentFlatId).update({\n chore: scheduleObj,\n })\n }", "doScaleOnSchedule(id, props) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_applicationautoscaling_ScalingSchedule(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.doScaleOnSchedule);\n }\n throw error;\n }\n this.target.scaleOnSchedule(id, props);\n }", "function setMidnight(t) {\n\tt.setHours(0);\n\tt.setMinutes(0);\n\tt.setSeconds(0);\n\tt.setMilliseconds(0);\n\treturn t;\n}", "function getTrainSchedule(id){\n\t\treturn document.getElementById(id).value;\n\t}", "function manualSchedule() {\r\n streamController_.manualSchedule();\r\n }", "setTime () {\n this.clock.time = moment()\n .local()\n .format(\"dddd, MMMM Do YYYY, h:mm:ss A\")\n }", "function register (id, time) {\n if (!hasAlarm) {\n initAlarm();\n }\n let rule = tabStore[id] = tabStore[id] || { current: 0 }; // current is the current tick count\n if (time !== rule.time) {\n rule.time = time; // time is the desired reload at time\n rule.reloaded = 0; // reloaded is the count how many it has been reloaded\n updateBadge(id);\n }\n}", "function initializeClock(id, endtime) {\n clearAllIntervals();\n $('.workoutman--animated').show();\n $('.workoutman--still').hide();\n\n let clock = document.getElementById(id);\n let minutesEl = clock.querySelector('.minutes');\n let secondsEl = clock.querySelector('.seconds');\n\n function updateClock() {\n let t = getTimeRemaining(endtime);\n minutesEl.innerHTML = ('0' + t.minutes).slice(-2);\n secondsEl.innerHTML = ('0' + t.seconds).slice(-2);\n\n if (t.total <= 0) {\n window.clearInterval(timeInterval);\n // $('.timesup').removeClass('hide');\n // $('.illo--animated').hide();\n // $('.illo--still').show();\n showOutOfTime();\n }\n }\n updateClock();\n let timeInterval = setInterval(updateClock, 1000);\n activeIntervals.push(timeInterval)\n }", "function setPlayTime(t) {\n console.log(\"setPlayTime \" + t);\n pano.setPlayTime(t);\n if (PC)\n PC.sendMessage({ 'type': 'pano.control', time: t });\n}", "static async addSchedule(req, res) {}", "addTimerToSlot (slotId, timerName) {\n let crono = new nrvideo.Chrono()\n crono.start()\n if (this._slotAttributes[slotId] == undefined) {\n this._slotAttributes[slotId] = {}\n }\n this._slotAttributes[slotId][timerName] = crono\n }", "function updateSchedule() {\n //update schedules of all arenas ! \n Arena.find(function (err, arenaArr) {\n \n if (!err) {\n async.each(arenaArr,function(arena){\n arena.schedule.shift();\n arena.schedule.push(arena.default_weekly_schedule);\n arena.markModified('schedule');\n arena.save(function(arenaSaveErr){\n console.log(\"Arena Save Error \" + arenaSaveErr);\n })\n },function(asyncErr){\n console.log(\"Async has encountered an error \"+ asyncErr);\n })\n }\n else {\n console.log(err + \"Error accessing arenas from database\");\n\n }\n })\n}", "chronoReset(){\n document.getElementById(\"chronotime\").innerHTML = \"00:00:000\";\n this.start = new Date();\n }", "function setTime() {\n\t\tseconds += 500;\n\t}", "function setStandupTime(channel, standupTimeToSet) {\n \n controller.storage.teams.get('standupTimes', function(err, standupTimes) {\n\n if (!standupTimes) {\n standupTimes = {};\n standupTimes.id = 'standupTimes';\n }\n\n standupTimes[channel] = standupTimeToSet;\n controller.storage.teams.save(standupTimes);\n });\n}", "function setPositionByTime(element, starttime, endtime, day) {\n var gridHeight = window.innerHeight - 80;\n var hourHeight = (gridHeight * .11625) / 2;\n \n //SET THE TOP\n element.style.top = (80 + (hourHeight * (starttime - 8)) + 5).toString() + \"px\";\n\n //SET THE HEIGHT\n //Calculation: The -10 is for the 5px margin on top and bottom, the -2 is\n //for the top and bottom border (1px each)\n element.style.height = (((endtime-starttime)*hourHeight) - 10 - 2).toString() + \"px\";\n\n //SET THE LEFT\n var leftIndent = (window.innerWidth * .10) + 5.0;\n var rowWidth = (window.innerWidth * .3);\n if (day == \"Friday\") {\n element.style.left = leftIndent.toString() + \"px\";\n } else if (day == \"Saturday\") {\n element.style.left = (leftIndent + rowWidth).toString() + \"px\";\n } else if (day == \"Sunday\") {\n element.style.left = (leftIndent + (rowWidth * 2.0)).toString() + \"px\";\n }\n\n //SET THE WIDTH\n //Calculation: The -10 is for the 5px margin on the right and left,\n //the -2 is for the right and left border\n element.style.width = (rowWidth - 10 - 2).toString() + \"px\";\n }", "handleSetStartTime() {\n let newStartTime;\n\n if (this.props.startTime) {\n // pause the timer and clear the interval\n newStartTime = { elapsedTime: this.state.elapsedTime, startTime: null };\n clearInterval(this.interval);\n } else {\n // start the timer and create an interval\n newStartTime = { elapsedTime: this.state.elapsedTime, startTime: Date.now() };\n this.interval = setInterval(this.incrementTime, 1000);\n }\n\n // pass params onto parent\n this.props.onSetStartTime(newStartTime, this.props.uuid);\n }", "evening() {\n this.time.setHours(17);\n }", "addToSchedule(){\n const range = (start, end, length = end - start + 1) =>\n Array.from({ length }, (_, i) => start + i)\n\n let first = Number(document.querySelector('#add-startTime').value.slice(0, 2));\n let second = Number(document.querySelector('#add-endTime').value.slice(0, 2))\n // CHECK empty input\n if (document.querySelector('#add-startTime').value === \"\" && document.querySelector('#add-endTime').value === \"\") {\n alert(\"Add time slot!\");\n } else if (document.querySelector('#add-startTime').value === \"\") {\n alert(\"Add a start time!\");\n } else if (document.querySelector('#add-endTime').value === \"\") {\n alert(\"Add an end time!\");\n // Check if inputting correct time logic\n } else if (first > second){\n alert(\"End time must be past start time!\");\n // GET input and PUT in schedule\n } else if (first < second){\n let validTime = true;\n // CHECK if valid time\n validTime = this.state.schedule.map((time) =>{\n let scheduleFrame = range(time[0],time[1]);\n let inputFrame = range(first+1,second-1);\n scheduleFrame.forEach((value)=>{\n inputFrame.forEach((inputVal)=>{\n if(value === inputVal){\n return true;\n }\n })\n })\n return false;\n })\n // if valid Time\n if(validTime){\n let something = [];\n something[0] = first;\n something[1] = second;\n console.log(\"ADDED: \" + something);\n\n this.setState(prevState => ({\n schedule: [...prevState.schedule, something]\n }));\n setTimeout(() => {\n console.log(\"AFTER PUSH\", this.state.schedule)\n })\n } else {\n alert(\"Not a valid time slot!\");\n }\n }\n }", "async updateTime(req, res) {\n\t\tconst id = Number(req.params.id);\n\n\t\ttry {\n\t\t\tconst [numberOfAffectedRows, affectedRows] = await Time.update(\n\t\t\t\t{\n\t\t\t\t\ttitle: req.body.title,\n\t\t\t\t\tdescription: req.body.description,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\twhere: { id },\n\t\t\t\t\treturning: true, // needed for affectedRows to be populated\n\t\t\t\t\tplain: true, // makes sure that the returned instances are just plain objects\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn res.status(200).send({ time: affectedRows });\n\t\t} catch (error) {\n\t\t\treturn res.status(400).send(error);\n\t\t}\n\t}", "function setTimeController(controller) {\n _timeController = controller;\n }", "scaleOnSchedule(id, props) {\n return super.doScaleOnSchedule(id, props);\n }", "static get schedule() {\n // once every hour\n return '* */1 * * *';\n }", "get schedule() {\n\t\treturn this.__schedule;\n\t}", "updateCompletedWorkLog(id, lastTime) {\n const index = dataModel.worklogs.findIndex((logs) => logs._id === id);\n try {\n dataModel.worklogs[index].endTime = lastTime;\n } catch (err) {\n console.log('couldn\\'t find the object');\n }\n\n }", "function createTimeTrigger(type){\n var selector = document.getElementById(\"w\");\n w = selector.options[selector.selectedIndex].value;\n h = document.getElementById('h').value;\n m = document.getElementById('m').value;\n\n operation = h.toString() + ':' + m.toString() + ':' + w.toString();\n\n if(active_parent_id != \"triggers\"){\n var new_id = Date.now();\n task.triggers[new_id] = {\n \"type\": 'time',\n \"parent\": active_parent_id,\n \"operation\": operation\n }\n task.triggers[active_parent_id].operation.push(new_id.toString())\n } else {\n task['triggers']['trigger'] = {\n \"type\": 'time',\n \"parent\": \"triggers\",\n \"operation\": operation\n };\n }\n\n loadTask()\n $('#d2Assitant').modal('hide')\n}", "function scheduleEvents() {\n var event9 = JSON.parse(localStorage.getItem(\"9:00 AM\"));\n hour9.val(event9);\n var event10 = JSON.parse(localStorage.getItem(\"10:00 AM\"));\n hour10.val(event10);\n var event11 = JSON.parse(localStorage.getItem(\"11:00 AM\"));\n hour11.val(event11);\n var event12 = JSON.parse(localStorage.getItem(\"12:00 PM\"));\n hour12.val(event12);\n var event13 = JSON.parse(localStorage.getItem(\"1:00 PM\"));\n hour13.val(event13);\n var event14 = JSON.parse(localStorage.getItem(\"2:00 PM\"));\n hour14.val(event14);\n var event15 = JSON.parse(localStorage.getItem(\"3:00 PM\"));\n hour15.val(event15);\n var event16 = JSON.parse(localStorage.getItem(\"4:00 PM\"));\n hour16.val(event16);\n var event17 = JSON.parse(localStorage.getItem(\"5:00 PM\"));\n hour17.val(event17);\n var event18 = JSON.parse(localStorage.getItem(\"6:00 PM\"));\n hour18.val(event18);\n}", "function start(task_id, time, btn) {\n let text = JSON.stringify({\n time_block: {\n start: time,\n end: null,\n task_id: task_id,\n convert: true\n },\n });\n\n $.ajax(time_block_path, {\n method: \"post\",\n dataType: \"json\",\n contentType: \"application/json; charset=UTF-8\",\n data: text,\n success: (resp) => {\n TIME_ID = resp.data.id;\n set_time_link(task_id, \"Start\"); },\n error: (resp) => { console.log(resp); }\n });\n}", "function setId(id) {\n\t\tthis.id = id;\n\t}", "function currentSchedule() {\n var currentHourInt = parseInt(moment().format('HH'));\n\n var timeIDs = $('#schedule-table tr[id]')\n .map(function() {\n return this.id;\n })\n .get();\n\n if (day < 0) {\n $('.input-area').css('background-color', 'grey');\n } else if (day > 0) {\n $('.input-area').css('background-color', '#00BFFF');\n } else {\n for (var i = 0; i < timeIDs.length; i++) {\n var timeIDsInt = parseInt(timeIDs[i]);\n if (timeIDsInt < currentHourInt) {\n $('#' + timeIDs[i])\n .find('textarea')\n .css('background-color', 'grey');\n } else if (timeIDsInt === currentHourInt) {\n $('#' + timeIDs[i])\n .find('textarea')\n .css('background-color', 'lightblue');\n } else {\n $('#' + timeIDs[i])\n .find('textarea')\n .css('background-color', '#00BFFF');\n }\n }\n }\n }", "function schedule (id) {\n jQuery.ajax({\n url:'php/course/get-course-shedule.php',\n type:'post',\n data:{id:id},\n success:function(data){\n console.log(data);\n try{\n data=JSON.parse(data);\n }\n catch(e){\n alert(\"error loading schedule for this course\");\n }\n $(\"#schedule-form\")[0].reset();\n $(\"#schcousename\").html(data['name']);\n $(\"#schedule-courseid\").val(data['courseid']);\n if(data['error']==1){\n var a=$('input.schgroup');\n for (var i = 0; i < a.length; i++) {\n a[i].removeAttribute('checked');\n };\n $('#schedulecourse').modal('show');\n }\n else{\n $(\"#course-date\").val(data['date']);\n $(\"#course-time\").val(data['time']);\n var a=$('input.schgroup');\n var groups=JSON.parse(data['groups']);\n for (var i = 0; i < a.length; i++) {\n if(groups.indexOf(a[i].name)==-1)\n a[i].removeAttribute('checked');\n else{\n var att=document.createAttribute('checked');\n att.value=\"'checked'\";\n a[i].setAttributeNode(att);\n }\n };\n \n $('#schedulecourse').modal('show');\n }\n },\n error:function(){\n alert('Network error');\n }\n })\n }", "function startTimer () {\n // Get task UUID\n var uuid = getTaskUUID()\n // console.log(`taskUUID was found to be: ${uuid}`)\n // Send PUT request to add start time to task, reload page\n // console.log(`Student 'start click' was accepted, now sending PUT request`)\n $.ajax({ url: '/api/task/timer/start', method: 'PUT', data: { uuid } })\n .then(() => window.location.reload())\n .catch(() => window.location.reload())\n }", "function updateStatusSCHEDULE(now, board, status, done) {\n db.getSchedules(function(err, schedules) {\n\n var selected = null;\n for(var i in schedules) {\n selected = checkSingleSchedule(now, status, schedules[i]);\n if (selected) break;\n }\n\n status.schedule = selected;\n if (selected) {\n status.temp_desired = selected.temp_desired;\n\n if (status.temp_desired <= status.temp_indoor) {\n //hay que apagar la calefaccion\n powerOff(status, board);\n } else {\n //hay que encender\n powerOn(status, board)\n }\n } else {\n //ninguno encaja\n //hay que apagar la calefaccion\n powerOff(status, board);\n }\n\n return done();\n });\n \n }", "function schedule_time(type,json){\n // Condition for the regular schedule\n if(type == 'r'){\n // For looping the schedule to fun functions of the begin and end time\n for(var a in json.regular){\n // Begining Time \n begin_format(json.regular[a],a)\n end_format(json.regular[a],a)\n }\n // Condition for the Chapel/Pep Schedule\n }else if(type == 'c'){\n for(var b in json.chapel_pep){\n begin_format(json.chapel_pep[b],b)\n end_format(json.chapel_pep[b],b)\n }\n // Condition for the Weekend\n }else if(type == 'w'){\n console.log(\"It's the Weekend\")\n }else{\n console.log(\"Houston, I think we have a problem\")\n }\n }", "function cronCallbackTimer(arg, cron_id) {\n let hourNow = rtc.getTimeHours();\n let minNow = rtc.getTimeMinutes();\n\n print('[cronCallbackTimer] Hour: ' + JSON.stringify(hourNow));\n print('[cronCallbackTimer] Min: ' + JSON.stringify(minNow));\n\n if (hourOn !== hourOff) {\n if (yHour[hourNow]) {\n if (hourNow === JSON.parse(hourOn)) {\n if (minNow >= JSON.parse(minOn)) {\n print('On')\n applyBoardConfig();\n } else {\n print('Off');\n turnOffLed();\n }\n } else {\n print('On')\n applyBoardConfig();\n }\n } else {\n if (hourNow === JSON.parse(hourOff)) {\n if (minNow >= JSON.parse(minOff)) {\n print('Off');\n turnOffLed();\n } else {\n print('On')\n applyBoardConfig();\n }\n } else {\n print('Off');\n turnOffLed();\n }\n }\n }\n\n if (JSON.parse(hourOn) === JSON.parse(hourOff)){\n if (yHour[hourNow]) {\n if (hourNow === JSON.parse(hourOn)) {\n if(yMin[minNow]) {\n applyBoardConfig();\n } else {\n turnOffLed();\n }\n } else {\n applyBoardConfig();\n }\n } else {\n if (hourNow === JSON.parse(hourOff)) {\n if(yMin[minNow]) {\n applyBoardConfig();\n } else {\n turnOffLed();\n }\n } else {\n turnOffLed();\n }\n }\n }\n \n}", "set id(id) {\n idMap.set(this, id);\n }", "function stopSchedule() {\n window.clearTimeout(wrt.scheduleTimeout);\n window.clearTimeout(wrt.updateTimeout);\n setUpdateMessage('');\n wrt.isScheduled = false;\n }", "function setCurrentTime(){\n let now = new Date();\n let hours = now.getHours();\n let setHours = hours > 9 ? hours : `0${hours}`\n let minutes = now.getMinutes();\n let setMinutes = minutes > 9 ? minutes : `0${minutes}`;\n TIME.textContent = `${setHours}:${setMinutes}`;\n DATE.textContent = `${now.toLocaleDateString('en-US', { weekday: 'short', year: 'numeric', month: 'short', day: 'numeric'})}`;\n }", "function setClockAlarm(id){\n var clock =document.getElementById(id);\n clock.style.borderColor = \"#FF0000\";\n}", "function editdefaultschedule(req, res, nxt) {\n var arenaid = req.params.arenaid;\n Arena.findOne({ _id: arenaid }, function (err, arena) {\n if (err) {\n return res.status(500).json({ error: err.message });\n }\n if (!arena) {\n return res.status(400).json({ error: 'the arena is not found' });\n }\n if (req.user && arena.service_provider == req.user._id) {\n var new_sch = new Array(7);\n for (var i = 0; i < 7; i++)\n new_sch[i] = new Array(48).fill(0);\n if (req.body.schedule) {\n var ds = req.body.schedule;\n for (var i = 0; i < ds.length; i++) {\n var sa = ds[i].split(\",\");\n var x = parseInt(sa[0]);\n var y = parseInt(sa[1]);\n new_sch[x][y] = -1;\n }\n }\n arena.default_weekly_schedule = new_sch;\n arena.save(function (err) {\n if (err) {\n return res.status(500).json({ error: err.message });\n }\n });\n return res.json(arena);\n } else {\n return res.status(400).json({ error: 'you are not autherized to view this page' });;\n }\n });\n}" ]
[ "0.68209475", "0.60670316", "0.59914833", "0.59150565", "0.59122765", "0.5885495", "0.58764976", "0.5859781", "0.58267653", "0.58108634", "0.5805996", "0.57979095", "0.5760425", "0.57583797", "0.5687236", "0.56838435", "0.56824195", "0.56649256", "0.5635112", "0.5629422", "0.5627273", "0.56142586", "0.55933946", "0.5591086", "0.55556023", "0.5527998", "0.5501085", "0.55004084", "0.54865485", "0.5485997", "0.54654384", "0.5464704", "0.5449219", "0.54479367", "0.5447859", "0.543483", "0.5424453", "0.54193115", "0.5408356", "0.53940195", "0.53882337", "0.53720385", "0.5353812", "0.53448313", "0.5344661", "0.52954865", "0.5288828", "0.528137", "0.5276573", "0.5274412", "0.52522874", "0.5246691", "0.52449167", "0.52441907", "0.5235074", "0.52329326", "0.5225759", "0.52224576", "0.522245", "0.5219304", "0.52160627", "0.52067184", "0.520093", "0.5196846", "0.51944256", "0.51942235", "0.5182753", "0.51803076", "0.5173335", "0.5149231", "0.5149024", "0.5148191", "0.5140862", "0.513042", "0.513032", "0.5130155", "0.5129698", "0.51149344", "0.51111525", "0.51104647", "0.51038677", "0.51034325", "0.510053", "0.5091738", "0.50900304", "0.5083887", "0.50778794", "0.5068399", "0.5067422", "0.50666744", "0.50661176", "0.50620854", "0.5059871", "0.5056753", "0.505588", "0.5051162", "0.50506884", "0.5038687", "0.50356406", "0.5035636" ]
0.7021235
0
Renders the UI components. Returns the same result each time it's invoked, and it does not read from or write to the DOM or otherwise interact with the browser (e.g., by using setTimeout). If you need to interact with the browser, perform your work in componentDidMount().
render() { return ( <View style={styles.container}> <View style={{height: 50}}></View> <Text style={styles.textS}>Time you want to wake up</Text> <TouchableWithoutFeedback onPress={this.showPicker.bind(this, 'isoFormat', { hour: this.state.WakeUpTimeHours, minute: this.state.WakeUpTimeMinutes, is24Hour: true, })}> <View> <Text style={styles.textL}>{this.formatTime(this.state.WakeUpTimeHours, this.state.WakeUpTimeMinutes)}</Text> </View> </TouchableWithoutFeedback> <View style={{height: 150}}></View> <Text style={styles.textS}>Sunrise</Text> <View style={{height: 5}}></View> <Switch onValueChange={(value) => this.setState({scheduleIsOn: value})} value={this.state.scheduleIsOn} /> <View style={{height: 20}}></View> <Text style={styles.textS}>Minutes sunrise starts before you want to wake up</Text> <Picker style={styles.picker} selectedValue={this.state.sunriseDurationBeforeWakeUp.toString()} onValueChange={(value) => this.setState({sunriseDurationBeforeWakeUp: parseInt(value)})} > <Picker.Item label="0" value="0" /> <Picker.Item label="5" value="5" /> <Picker.Item label="10" value="10" /> <Picker.Item label="15" value="15" /> <Picker.Item label="20" value="20" /> <Picker.Item label="25" value="25" /> <Picker.Item label="30" value="30" /> </Picker> </View> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_render() {\n this._reactComponent = this._getReactComponent();\n if (!this._root) this._root = createRoot(this._container.getElement()[0]);\n this._root.render(this._reactComponent);\n }", "render() {\n this.el.innerHTML = this.template();\n\n setTimeout(() => {\n this.bindUIElements();\n }, 0);\n }", "componentDidMount() {\n this.render()\n\n }", "render() {\n\t\tif (!this.component_.element) {\n\t\t\tthis.component_.element = document.createElement('div');\n\t\t}\n\t\tthis.emit('rendered', !this.isRendered_);\n\t}", "componentDidMount() {\n console.log('TimerApp: componentDidMount: rendered markup available:', !!document.getElementById('wrapper'));\n this.intervalId = setInterval(() => this.tick(), 1000);\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "function render () {\n // If this is called synchronously we need to\n // cancel any pending future updates\n clearFrame()\n\n // If the rendering from the previous frame is still going,\n // we'll just wait until the next frame. Ideally renders should\n // not take over 16ms to stay within a single frame, but this should\n // catch it if it does.\n if (isRendering) {\n frameId = raf(render)\n return\n } else {\n isRendering = true\n }\n\n // 1. If there isn't a native element rendered for the current mounted element\n // then we need to create it from scratch.\n // 2. If a new element has been mounted, we should diff them.\n // 3. We should update check all child components for changes.\n if (!currentNativeElement) {\n currentElement = app.element\n currentNativeElement = toNative(rootId, '0', currentElement)\n container.appendChild(currentNativeElement)\n } else if (currentElement !== app.element) {\n currentNativeElement = patch(rootId, currentElement, app.element, currentNativeElement)\n currentElement = app.element\n updateChildren(rootId)\n } else {\n updateChildren(rootId)\n }\n\n // Allow rendering again.\n isRendering = false\n }", "componentDidMount() {\r\n console.log(\"El componente se renderizó\");\r\n }", "render() {\n\t\treturn <div>{this.renderContent()}</div>;\n\t}", "function render(){\n ReactDOM.render(\n <MyComponents.App\n data={data}\n actions={actions}/>,\n $('#app-container').get(0)\n );\n}", "function render(){\n ReactDOM.render(\n <MyComponents.App\n data={data}\n actions={actions}/>,\n $('#app-container').get(0)\n )\n}", "function render(){\n ReactDOM.render(\n <MyComponents.App\n data={data}\n actions={actions}/>,\n $('#app-container').get(0)\n )\n}", "function render () {\n\t // If this is called synchronously we need to\n\t // cancel any pending future updates\n\t clearFrame()\n\n\t // If the rendering from the previous frame is still going,\n\t // we'll just wait until the next frame. Ideally renders should\n\t // not take over 16ms to stay within a single frame, but this should\n\t // catch it if it does.\n\t if (isRendering) {\n\t frameId = raf(render)\n\t return\n\t } else {\n\t isRendering = true\n\t }\n\n\t // 1. If there isn't a native element rendered for the current mounted element\n\t // then we need to create it from scratch.\n\t // 2. If a new element has been mounted, we should diff them.\n\t // 3. We should update check all child components for changes.\n\t if (!currentNativeElement) {\n\t currentElement = app.element\n\t currentNativeElement = toNative(rootId, '0', currentElement)\n\t if (container.children.length > 0) {\n\t console.info('deku: The container element is not empty. These elements will be removed. Read more: http://cl.ly/b0Sr')\n\t }\n\t if (container === document.body) {\n\t console.warn('deku: Using document.body is allowed but it can cause some issues. Read more: http://cl.ly/b0SC')\n\t }\n\t removeAllChildren(container)\n\t container.appendChild(currentNativeElement)\n\t } else if (currentElement !== app.element) {\n\t currentNativeElement = patch(rootId, currentElement, app.element, currentNativeElement)\n\t currentElement = app.element\n\t updateChildren(rootId)\n\t } else {\n\t updateChildren(rootId)\n\t }\n\n\t // Call mount events on all new entities\n\t flushMountQueue()\n\n\t // Allow rendering again.\n\t isRendering = false\n\n\t }", "render() {\n console.debug(`Rendering DOM of ${this.constructor.name}`);\n this.shadowRoot.innerHTML = this.html;\n if (this.script != null) {\n console.debug(`Running script of ${this.constructor.name}`);\n this.script();\n console.debug(`Finished running script of ${this.constructor.name}`);\n }\n console.debug(`Finished rendering DOM of ${this.constructor.name}`);\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader>Getting data</Loader>;\n }", "renderUI() {\n this.displayMeasures();\n this.getBugCounts();\n\n // Update counts periodically\n window.setInterval(() => this.getBugCounts(), this.config.refreshMinutes * 60 * 1000);\n }", "render() {\n\n return (\n <div>\n {this.renderContent()}\n </div>\n );\n \n }", "componentDidMount(){\n this.setupEffectController();\n this.initView();\n this.display();\n }", "componentDidMount() {\n this.displayData();\n }", "render() {\n this.fetch(() => {\n /**\n * Notice that the order here doesn't matter, if we want it to work like React,\n * we have to set up a virtual DOM and then have another object which it's purpose\n * will be to get the virtual DOM and then put that into the DOM (ReactDOM job is actually just that).\n * Virtual DOM is just any representation of the DOM elements, for that we can use JSX to\n * make our job easier and actually doing that is way easier than what you might think!\n */\n new Articles(this.articles).render();\n });\n }", "function render(){ \n console.log('`render function` ran');\n const createdHtml = generateHtml(STORE); \n $('main').html(createdHtml);\n}", "function render () {\n\tReactDOM.render(\n\t\t<div className='container'>\n\t\t\t<App store={store} />\n\t\t\t<hr />\n\t\t\t<Results store={store} />\n\t\t</div>\n\t\t,\n\t\tdocument.getElementById('root'));\n\t\tregisterServiceWorker();\n}", "function render() {\n if (!willRender) {\n willRender = true;\n process.nextTick(function() {\n screen.render();\n willRender = false;\n });\n }\n}", "render() {\n this._userEvent('beforeRender');\n const html = this.template.render({data: this.viewData}, (data) => {\n return this.wrapTemplate(data);\n });\n if (!this.wrapper) {\n this.wrapper = this._createWrapper();\n }\n this.updateNode(this.wrapper, html);\n this.resize();\n this._userEvent('afterRender');\n }", "_renderScreen() {\n\t\tif (this._el && this._component) {\n\t\t\tthis._component.render(this._el);\n\t\t}\n\t}", "componentDidMount() {\n\t\tthis._loadInitialState().done();\n\t}", "function render() {\n\n const renderedString = createRenderString(store);\n\n // insert html into DOM\n $('main').html(renderedString);\n}", "componentDidMount(){\n console.log(\"metodo de react que se ejecuta despues de renderizar el conponente\")\n this.cargarCursos();\n }", "render() {\n if (!this.initialized) this.init();\n }", "render() {\n if (!this.initialized) {\n this.init();\n }\n }", "componentDidMount() {\n this.renderAboutUsTitle(this.props.language); // Will call the renderAboutUsTitle() method declared below\n this.renderAboutUsMessage(this.props.language); // Will call the renderAboutUsMessage() method declared below\n }", "render() {\n return this.renderContent();\n }", "render() {\r\n return (\r\n <div className=\"border red\">\r\n { this.renderContent() }\r\n </div>\r\n );\r\n }", "render() {\n if(this.state.currentDisplay === \"\")\n return (<div> loading... </div>);\n\n return this.state.displays[this.state.currentDisplay];\n }", "render() {\n //using template function to render component\n const html = this.getTemplate().call(this, (this.getData())).trim();\n // generate virtual dom tree\n const tree = tvdom.parse(html);\n const lastRender = this._lastRender;\n // update component\n if (lastRender) {\n // diff two trees: last and current\n const patches = tvdom.diff(lastRender.tree, tree);\n if (!this._isEmptyObject(patches)) {\n // patch last dom tree\n tvdom.patch(lastRender.root, patches);\n // save changes\n lastRender.html = html;\n lastRender.tree = tree;\n }\n } else {\n // first time render dom tree\n const root = tree.render();\n this._$mountPoint.empty().html(root);\n // save render states\n this._lastRender = { mountPoint: this.getMountPoint(), html, tree, root}\n }\n }", "render () {\n\n return (\n <div>\n { this.renderBodyContent() }\n </div>\n )\n\n }", "render() {\n return this.props.ready ? (\n this.renderPage()\n ) : (\n <Loader active>Getting data</Loader>\n );\n }", "mount() {\n this.willMount();\n this.render();\n this.didMount();\n }", "render() {\n const { id, sequence, className } = this.props;\n // Create the container div and store a reference to it once it is mounted\n // in the DOM. The componentDidMount function above will then get called\n // and render the widget.\n return (\n <div className={className} id={this.props.id} ref={this.handleRef}></div>\n );\n }", "componentDidMount() {\n\t\tthis.props.showAppMount && console.log('APP DID MOUNT');\n\t\tthis.displayBodyText();\n\t\tthis.getScripts();\n\t\t// this.getTitle();\n\t}", "componentDidMount() {\n // Ensure that the page processes a tick immediately on load.\n this.tick();\n\n // Set component to run an update tick every second.\n this.intervalId = setInterval(\n () => this.tick(),\n 1000\n );\n }", "_render() {\n const loaderInner = htmlHelper.createDivWithClass('');\n this.loader.appendChild(loaderInner);\n }", "render() { this.screen.render() }", "componentDidMount() {\n\t\tthis.refresh();\n\t}", "render() {\n this.renderComponents() // dial + outputs, algedonode, brass pads, strips, lights\n this.renderLabels()\n }", "render() {\n this.update();\n }", "render() {\n this.widgets.forEach((widget) => {\n widget.render();\n });\n }", "componentDidMount() {\n this.setDateTime();\n this.renderData();\n }", "_mountComponent() {\n\t\t// wait next frame\n\t\tthis.mutate(() => {\n\t\t\t// sometimes, the component has been unmounted between the\n\t\t\t// fastdom execution, so we stop here if it's the case\n\t\t\tif ( ! this._componentAttached) return;\n\t\t\t// init\n\t\t\tthis.componentMount();\n\t\t\t// render\n\t\t\tthis.render();\n\t\t\t// component did mount\n\t\t\tthis.componentDidMount();\n\t\t});\n\n\t}", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader>Getting data</Loader>;\n }", "async function renderUI(){\n var ua = navigator.userAgent.toLowerCase();\n var isAndroid = ua.indexOf(\"android\") > -1;\n if(isAndroid) document.body.style.width = \"100%\";\n\n let currentTotalCount = await getFromStorage(\"total_count\", 0);\n let currentTodayCount = await getFromStorage(\"today_count\", 0);\n let currentMonthCount = await getFromStorage(`month_${getMonthName()}_count`, 0);\n totalCountElement.innerHTML = nFormatter(currentTotalCount, 1);\n todayCountElement.innerHTML = nFormatter(currentTodayCount, 1);\n monthCountElement.innerHTML = nFormatter(currentMonthCount, 1);\n if(currentTotalCount==0){\n canvasBottom.style.backgroundColor = \"transparent\";\n }\n renderGraph();\n checkUpdates();\n}", "render() {\n return this.renderContent()\n }", "renderComponents() {\n this.algedonodeActivators.forEach(aa => {\n aa.render(this.renderer)\n })\n this.dials.forEach(d => {\n d.render(this.renderer)\n })\n this.strips.forEach(s => {\n s.render(this.renderer)\n })\n this.rows.forEach(r => {\n r.forEach(c => {\n c.render(this.renderer)\n })\n })\n this.lights.forEach(lightPair => {\n lightPair.forEach(light => light.render(this.renderer))\n })\n }", "render() {\n this.refresh();\n }", "render () {\n if (this.state.initialized === false) {\n return (\n <div>\n <h2>{this.state.progress.text}</h2>\n <h3>Current is {this.state.progress.value}%</h3>\n </div>\n )\n }\n return (\n <div className=\"game-canvas-container\" ref=\"gameCanvas\" />\n )\n }", "onRender()/*: void*/ {\n this.render();\n }", "render() {\n return <div>{this.toRender()}</div>;\n }", "componentDidMount(){\n\n\n\n\n}", "function render(){\n\n clearElement(container);\n renderList(); \n\n const selectedProject = projectList.find(project => project.id === selectedProjectId);\n \n clearElement(tasksContainer);\n renderTasks(selectedProject); \n }", "componentDidMount() {\n\t\tthis.updateContext();\n\t\tthis.updateBoundingClientRect();\n\t\tthis.drawPatterns();\n\t\t// attaching event handlers\n\t\twindow.addEventListener(\"scroll\", this.updateBoundingClientRect.bind(this));\n\t\twindow.addEventListener(\"resize\", this.updateBoundingClientRect.bind(this));\n\t}", "componentDidMount() {\n\t\t$('html').removeClass('loading');\n\t\tthis._getData();\n\t}", "function render() {\n renderLives();\n renderTimeRemaining();\n }", "render() {\n return (\n <div className=\"border red\">\n {this.renderContent()}\n </div>\n );\n \n }", "render() {\n\t\treturn (\n\t\t\t<div data-react-name={this.state.reactName}>{this.renderContent()}</div>\n\t\t);\n\t}", "render() {\n return (\n <div className=\"border red\">\n {this.renderContent()}\n </div>\n )\n }", "render() {\n return (\n <div id=\"main\">\n <Container>\n <Row>\n {\n this.refresh()\n }\n </Row>\n </Container>\n </div>\n )\n }", "connectedCallback() {\n this.innerHTML = this.render();\n\n }", "componentDidMount() {\n // this method runs after the component output has been rendered to the DOM\n this.timeID = setInterval(\n () => this.tick(),\n 1000\n );\n }", "function render() {\n var children = [SearchBar({\n update: updateSearchState\n }), ItemsList({\n items: _state.items,\n onUpdate: updateState\n })];\n if (!_node) {\n return _node = createElement('div', { class: 'main' }, children);\n } else {\n return _node.html(children);\n }\n }", "render() {\r\n return <div />\r\n }", "async componentDidMount(){ //una vez q el componente es montado procede a renderizar\n this.getUsers();\n }", "connectedCallback() {\n this.render();\n }", "render() {\n return(\n <div className=\"border red\">\n {this.renderContent()}\n </div> \n );\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "componentDidMount() {\n this.setState({result: \"Do the Clicky thing to begin the game thing\"})\n }", "render() {\n if (this.state.error) {\n return this.renderError();\n }\n else if (this.state.showResult) {\n return this.renderResult();\n } else {\n return this.renderNormal();\n }\n }", "componentDidMount() {\n\t\tthis.updateCanvas();\n\t}", "componentDidMount() {\n this.changeBG();\n this.props.changeContainer();\n this.props.getTransitionMusic();\n this.props.getMainMusic();\n this.props.getUserMusic();\n setTimeout(this.sessionBuild, 1000);\n setTimeout(this.startSession, 2000);\n setTimeout(this.durationStart, 2000);\n setTimeout(this.barCheckStart, 3000);\n }", "render (props) {\n if (this.state.error) return this.renderDefaultError(props)\n return this.renderContent(props)\n }", "refresh() {\n this.render();\n }", "async componentDidMount() {\n /* This is a react life-cycle method. Technically (due to some specifics \n about how they're executed that were explained to me) you're not supposed \n to call a life-cycle method inside of another. Otherwise I would just call \n componentDidUpdate directly here. */\n if (debug) console.log(\"componentDidMount()\");\n await this.fetchButtonInfo();\n }", "render() {\n return (\n <div className=\"red-border\">\n { this.renderContent() }\n </div>\n )\n }", "render() {\n return(<div />);\n }", "render() {\n return(\n <div className=\"border-red\">\n {this.renderContent()}\n </div>\n )\n\n }", "render() {\n if (this.props) return this.renderWithProps();\n if (this.store) return this.renderWithStore();\n }", "render () {\n\t\t\t\t//Clear the entire canvas every render\n\t\tthis\n\t\t\t\t\t\t.context\n\t\t\t\t\t\t.clearRect( 0, 0, this.width, this.height );\n\n\t\t\t\t//Trigger the render function on every child element\n\t\tfor ( let i = 0; i < this.circleContainers.length; i++ ) {\n\t\t\tthis\n\t\t\t\t\t\t\t\t.circleContainers[i]\n\t\t\t\t\t\t\t\t.render();\n\t\t}\n\t}", "render() {\n\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render(){\n console.log('Render Fired')\n return(\n <div>Lifecycle Method Examples</div>\n )\n }", "renderIncDom() {\n\t\tif (this.component_.render) {\n\t\t\tthis.component_.render();\n\t\t} else {\n\t\t\tIncrementalDOM.elementVoid('div');\n\t\t}\n\t}", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }" ]
[ "0.73375976", "0.72756207", "0.70760757", "0.69886875", "0.6903232", "0.6892822", "0.6892822", "0.6892822", "0.681339", "0.67150325", "0.6710088", "0.67068726", "0.6695447", "0.6695447", "0.66906536", "0.66662276", "0.6657271", "0.664744", "0.6633744", "0.663319", "0.66194034", "0.66111594", "0.6609667", "0.6605683", "0.65779984", "0.6554785", "0.6544422", "0.6525825", "0.6515763", "0.65084094", "0.6504687", "0.6478769", "0.64730394", "0.6454526", "0.64518243", "0.64398897", "0.6430126", "0.6420524", "0.64009976", "0.6392064", "0.63851756", "0.6380833", "0.63778883", "0.6366776", "0.6364082", "0.63624793", "0.6359938", "0.63550764", "0.6353559", "0.63502276", "0.634499", "0.63383335", "0.63383335", "0.63383335", "0.63383335", "0.6334439", "0.6328902", "0.6327726", "0.6316834", "0.6312716", "0.6310024", "0.6308977", "0.6305937", "0.6292782", "0.6292105", "0.6291067", "0.6288737", "0.62768215", "0.6272179", "0.62694365", "0.6266764", "0.6262656", "0.62621325", "0.6259959", "0.6259468", "0.6259345", "0.62585825", "0.6250372", "0.6248183", "0.6248183", "0.6247794", "0.6234092", "0.62228924", "0.62160265", "0.62125516", "0.6209753", "0.6202406", "0.6200007", "0.6195599", "0.61911184", "0.6189672", "0.6187189", "0.61844987", "0.61826795", "0.6180475", "0.61793786", "0.61793786", "0.61793786", "0.61793786", "0.61793786", "0.61793786" ]
0.0
-1
Identify modules used Merge package dependencies Create files for each module Find user input connections Prechain flow Write readme
bundle(user, flow, version){ console.log(user) version = '0.0.1' return new Promise((resolve, reject) => { console.log("Bundling Flow: ", flow) let modulesUsed = this.find_modules(flow); let connectionsUsed = this.find_connections(flow) let packageFiles = modulesUsed.map((x) => { return `${x.fs_path}/package.json` }) let moduleFileBundles = modulesUsed.map((x) => { return this.get_module_files(x) }) let mergedPackageFile = JSON.stringify(this.merge_packfiles(flow, packageFiles, version)) let libraries = {} let publishedModules = moduleFileBundles.map((x, ix) => { let published_mod = this.libify(modulesUsed, x, ix) libraries = {...libraries, ...published_mod.files} return published_mod }) console.log("Libraries", publishedModules) this.registry.newRepo(flow).then(() => { this.write_main(flow, modulesUsed, connectionsUsed, publishedModules).then((indexFile) => { this.getPackage(user.user, flow, indexFile, mergedPackageFile, libraries, (sha) => { resolve({name: mergedPackageFile.name, version: sha}) }) }) }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dependencies() {\n\n //as we do multiple things in this task, we merge the multiple streams\n var stream = new MergeStream();\n\n // Pick the dependencies we need from each package\n // so we don't just ship with a lot of files that aren't needed\n const nodeModules = [\n {\n \"name\": \"ace-builds\",\n \"src\": [\n \"./node_modules/ace-builds/src-min-noconflict/ace.js\",\n \"./node_modules/ace-builds/src-min-noconflict/ext-language_tools.js\",\n \"./node_modules/ace-builds/src-min-noconflict/ext-searchbox.js\",\n \"./node_modules/ace-builds/src-min-noconflict/ext-settings_menu.js\",\n \"./node_modules/ace-builds/src-min-noconflict/snippets/text.js\",\n \"./node_modules/ace-builds/src-min-noconflict/snippets/javascript.js\",\n \"./node_modules/ace-builds/src-min-noconflict/snippets/css.js\",\n \"./node_modules/ace-builds/src-min-noconflict/snippets/json.js\",\n \"./node_modules/ace-builds/src-min-noconflict/snippets/xml.js\",\n \"./node_modules/ace-builds/src-min-noconflict/theme-chrome.js\",\n \"./node_modules/ace-builds/src-min-noconflict/mode-razor.js\",\n \"./node_modules/ace-builds/src-min-noconflict/mode-javascript.js\",\n \"./node_modules/ace-builds/src-min-noconflict/mode-css.js\",\n \"./node_modules/ace-builds/src-min-noconflict/mode-json.js\",\n \"./node_modules/ace-builds/src-min-noconflict/mode-xml.js\",\n \"./node_modules/ace-builds/src-min-noconflict/worker-javascript.js\",\n \"./node_modules/ace-builds/src-min-noconflict/worker-css.js\",\n \"./node_modules/ace-builds/src-min-noconflict/worker-json.js\",\n \"./node_modules/ace-builds/src-min-noconflict/worker-xml.js\"\n ],\n \"base\": \"./node_modules/ace-builds\"\n },\n {\n \"name\": \"angular\",\n \"src\": [\n \"./node_modules/angular/angular.min.js\",\n \"./node_modules/angular/angular.min.js.map\"\n ],\n \"base\": \"./node_modules/angular\"\n },\n {\n \"name\": \"angular-aria\",\n \"src\": [\"./node_modules/angular-aria/angular-aria.min.js\",\n \"./node_modules/angular-aria/angular-aria.min.js.map\"],\n \"base\": \"./node_modules/angular-aria\"\n },\n {\n \"name\": \"angular-cookies\",\n \"src\": [\n \"./node_modules/angular-cookies/angular-cookies.min.js\",\n \"./node_modules/angular-cookies/angular-cookies.min.js.map\"\n ],\n \"base\": \"./node_modules/angular-cookies\"\n },\n {\n \"name\": \"angular-dynamic-locale\",\n \"src\": [\n \"./node_modules/angular-dynamic-locale/dist/tmhDynamicLocale.min.js\",\n \"./node_modules/angular-dynamic-locale/dist/tmhDynamicLocale.min.js.map\"\n ],\n \"base\": \"./node_modules/angular-dynamic-locale/dist\"\n },\n {\n \"name\": \"angular-sanitize\",\n \"src\": [\n \"./node_modules/angular-sanitize/angular-sanitize.min.js\",\n \"./node_modules/angular-sanitize/angular-sanitize.min.js.map\"\n ],\n \"base\": \"./node_modules/angular-sanitize\"\n },\n {\n \"name\": \"angular-touch\",\n \"src\": [\n \"./node_modules/angular-touch/angular-touch.min.js\",\n \"./node_modules/angular-touch/angular-touch.min.js.map\"\n ],\n \"base\": \"./node_modules/angular-touch\"\n },\n {\n \"name\": \"angular-ui-sortable\",\n \"src\": [\"./node_modules/angular-ui-sortable/dist/sortable.min.js\"],\n \"base\": \"./node_modules/angular-ui-sortable/dist\"\n },\n {\n \"name\": \"angular-route\",\n \"src\": [\n \"./node_modules/angular-route/angular-route.min.js\",\n \"./node_modules/angular-route/angular-route.min.js.map\"\n ],\n \"base\": \"./node_modules/angular-route\"\n },\n {\n \"name\": \"angular-animate\",\n \"src\": [\n \"./node_modules/angular-animate/angular-animate.min.js\",\n \"./node_modules/angular-animate/angular-animate.min.js.map\"\n ],\n \"base\": \"./node_modules/angular-animate\"\n },\n {\n \"name\": \"angular-i18n\",\n \"src\": [\n \"./node_modules/angular-i18n/angular-i18n.js\",\n \"./node_modules/angular-i18n/angular-locale_*.js\"\n ],\n \"base\": \"./node_modules/angular-i18n\"\n },\n {\n \"name\": \"angular-local-storage\",\n \"src\": [\n \"./node_modules/angular-local-storage/dist/angular-local-storage.min.js\",\n \"./node_modules/angular-local-storage/dist/angular-local-storage.min.js.map\"\n ],\n \"base\": \"./node_modules/angular-local-storage/dist\"\n },\n {\n \"name\": \"angular-messages\",\n \"src\": [\n \"./node_modules/angular-messages/angular-messages.min.js\",\n \"./node_modules/angular-messages/angular-messages.min.js.map\"\n ],\n \"base\": \"./node_modules/angular-messages\"\n },\n {\n \"name\": \"angular-mocks\",\n \"src\": [\"./node_modules/angular-mocks/angular-mocks.js\"],\n \"base\": \"./node_modules/angular-mocks\"\n },\n {\n \"name\": \"animejs\",\n \"src\": [\"./node_modules/animejs/lib/anime.min.js\"],\n \"base\": \"./node_modules/animejs/lib\"\n },\n {\n \"name\": \"bootstrap-social\",\n \"src\": [\"./node_modules/bootstrap-social/bootstrap-social.css\"],\n \"base\": \"./node_modules/bootstrap-social\"\n },\n\n {\n \"name\": \"angular-chart.js\",\n \"src\": [\n \"./node_modules/angular-chart.js/dist/angular-chart.min.js\",\n \"./node_modules/angular-chart.js/dist/angular-chart.min.js.map\"\n ],\n \"base\": \"./node_modules/angular-chart.js/dist\"\n },\n {\n \"name\": \"chart.js\",\n \"src\": [\"./node_modules/chart.js/dist/Chart.min.js\"],\n \"base\": \"./node_modules/chart.js/dist\"\n },\n {\n \"name\": \"clipboard\",\n \"src\": [\"./node_modules/clipboard/dist/clipboard.min.js\"],\n \"base\": \"./node_modules/clipboard/dist\"\n },\n {\n \"name\": \"jsdiff\",\n \"src\": [\"./node_modules/diff/dist/diff.js\"],\n \"base\": \"./node_modules/diff/dist\"\n },\n {\n \"name\": \"flatpickr\",\n \"src\": [\n \"./node_modules/flatpickr/dist/flatpickr.min.js\",\n \"./node_modules/flatpickr/dist/flatpickr.min.css\",\n \"./node_modules/flatpickr/dist/l10n/*.js\"\n ],\n \"base\": \"./node_modules/flatpickr/dist\"\n },\n {\n \"name\": \"font-awesome\",\n \"src\": [\n \"./node_modules/font-awesome/fonts/*\",\n \"./node_modules/font-awesome/css/font-awesome.min.css\"\n ],\n \"base\": \"./node_modules/font-awesome\"\n },\n {\n \"name\": \"jquery\",\n \"src\": [\n \"./node_modules/jquery/dist/jquery.min.js\",\n \"./node_modules/jquery/dist/jquery.min.map\"\n ],\n \"base\": \"./node_modules/jquery/dist\"\n },\n {\n \"name\": \"jquery-ui\",\n \"src\": [\"./node_modules/jquery-ui-dist/jquery-ui.min.js\"],\n \"base\": \"./node_modules/jquery-ui-dist\"\n },\n {\n \"name\": \"jquery-ui-touch-punch\",\n \"src\": [\"./node_modules/jquery-ui-touch-punch/jquery.ui.touch-punch.min.js\"],\n \"base\": \"./node_modules/jquery-ui-touch-punch\"\n },\n {\n \"name\": \"lazyload-js\",\n \"src\": [\"./node_modules/lazyload-js/LazyLoad.min.js\"],\n \"base\": \"./node_modules/lazyload-js\"\n },\n {\n \"name\": \"moment\",\n \"src\": [\"./node_modules/moment/min/moment.min.js\"],\n \"base\": \"./node_modules/moment/min\"\n },\n {\n \"name\": \"moment\",\n \"src\": [\"./node_modules/moment/locale/*.js\"],\n \"base\": \"./node_modules/moment/locale\"\n },\n {\n \"name\": \"ng-file-upload\",\n \"src\": [\"./node_modules/ng-file-upload/dist/ng-file-upload.min.js\"],\n \"base\": \"./node_modules/ng-file-upload/dist\"\n },\n {\n \"name\": \"nouislider\",\n \"src\": [\n \"./node_modules/nouislider/dist/nouislider.min.js\",\n \"./node_modules/nouislider/dist/nouislider.min.css\"\n ],\n \"base\": \"./node_modules/nouislider/dist\"\n },\n {\n \"name\": \"signalr\",\n \"src\": [\n \"./node_modules/@microsoft/signalr/dist/browser/signalr.min.js\"\n ],\n \"base\": \"./node_modules/@microsoft/signalr/dist/browser\"\n },\n {\n \"name\": \"spectrum\",\n \"src\": [\n \"./node_modules/spectrum-colorpicker2/dist/spectrum.js\",\n \"./node_modules/spectrum-colorpicker2/dist/spectrum.min.css\"\n ],\n \"base\": \"./node_modules/spectrum-colorpicker2/dist\"\n },\n {\n \"name\": \"tinymce\",\n \"src\": [\n \"./node_modules/tinymce/tinymce.min.js\",\n \"./node_modules/tinymce/plugins/**\",\n \"./node_modules/tinymce/skins/**\",\n \"./node_modules/tinymce/themes/**\",\n \"./node_modules/tinymce/models/**\",\n \"./node_modules/tinymce/icons/**\"\n ],\n \"base\": \"./node_modules/tinymce\"\n },\n {\n \"name\": \"typeahead.js\",\n \"src\": [\"./node_modules/typeahead.js/dist/typeahead.bundle.min.js\"],\n \"base\": \"./node_modules/typeahead.js/dist\"\n },\n {\n \"name\": \"underscore\",\n \"src\": [\"node_modules/underscore/underscore-min.js\"],\n \"base\": \"./node_modules/underscore\"\n },\n {\n \"name\": \"wicg-inert\",\n \"src\": [\n \"./node_modules/wicg-inert/dist/inert.min.js\",\n \"./node_modules/wicg-inert/dist/inert.min.js.map\"\n ],\n \"base\": \"./node_modules/wicg-inert\"\n },\n {\n \"name\": \"umbraco-ui\",\n \"src\": [\n \"./node_modules/@umbraco-ui/uui/dist/uui.min.js\",\n \"./node_modules/@umbraco-ui/uui/dist/uui.min.js.map\",\n \"./node_modules/@umbraco-ui/uui-css/dist/custom-properties.css\",\n \"./node_modules/@umbraco-ui/uui-css/dist/uui-text.css\"\n ],\n \"base\": \"./node_modules/@umbraco-ui\"\n }\n ];\n\n // add streams for node modules\n nodeModules.forEach(module => {\n var task = gulp.src(module.src, { base: module.base, allowEmpty: true });\n\n _.forEach(config.roots, function(root){\n task = task.pipe(gulp.dest(root + config.targets.lib + \"/\" + module.name))\n });\n\n stream.add(task);\n });\n\n //copy over libs which are not on npm (/lib)\n var libTask = gulp.src(config.sources.globs.lib, { allowEmpty: true });\n\n _.forEach(config.roots, function(root){\n libTask = libTask.pipe(gulp.dest(root + config.targets.lib))\n });\n\n stream.add(libTask);\n\n //Copies all static assets into /root / assets folder\n //css, fonts and image files\n\n var assetsTask = gulp.src(config.sources.globs.assets, { allowEmpty: true });\n assetsTask = assetsTask.pipe(imagemin([\n imagemin.gifsicle({interlaced: true}),\n imagemin.mozjpeg({progressive: true}),\n imagemin.optipng({optimizationLevel: 5}),\n imagemin.svgo({\n plugins: [\n {removeViewBox: true},\n {cleanupIDs: false}\n ]\n })\n ]));\n\n _.forEach(config.roots, function(root){\n assetsTask = assetsTask.pipe(gulp.dest(root + config.targets.assets));\n });\n\n\n stream.add(assetsTask);\n\n // Copies all the less files related to the preview into their folder\n //these are not pre-processed as preview has its own less compiler client side\n var lessTask = gulp.src(\"src/canvasdesigner/editors/*.less\", { allowEmpty: true });\n\n _.forEach(config.roots, function(root){\n lessTask = lessTask.pipe(gulp.dest(root + config.targets.assets + \"/less\"));\n });\n stream.add(lessTask);\n\n\n\n\t// TODO: check if we need these fileSize\n var configTask = gulp.src(\"src/views/propertyeditors/grid/config/*.*\", { allowEmpty: true });\n _.forEach(config.roots, function(root){\n configTask = configTask.pipe(gulp.dest(root + config.targets.views + \"/propertyeditors/grid/config\"));\n });\n stream.add(configTask);\n\n var dashboardTask = gulp.src(\"src/views/dashboard/default/*.jpg\", { allowEmpty: true });\n _.forEach(config.roots, function(root){\n dashboardTask = dashboardTask .pipe(gulp.dest(root + config.targets.views + \"/dashboard/default\"));\n });\n stream.add(dashboardTask);\n\n return stream;\n}", "function retrieveModuleDependenciesOfModules(moduleDependenceGraph, inputFiles, projectTypeIndex, isLibrary = false) {\n\t\n\t//convert hashmap to list (prevent writing many for loops)\n\tlet inputFileList = inputFiles.convertHashMapToArray();\n\n\t//firstly, retrieve imports/exports that need to be introduced in each module\n\t//due to its dependencies (incoming/outgoing)\n\t//then, if project is a library,\n\t//retrieve exports that are not included in module dependencies\n\t//(export features, regardless of their use)\n\t//all modules are assumed to be entry files\n\tinputFileList.forEach(inputFile => {\n\n\t\t//retrieve module dependencies of inputFile (imports)\n\t\t//(while an import of inputFile is retrieved, the export dependency\n\t\t//is added to the module represented by the adjacent node)\n\t\t//fileList contains (key,value) pairs\n\t\t// console.log('library: ' + isLibrary)\n\t\tretrieveModuleDependenciesOfModule(inputFiles, moduleDependenceGraph, inputFile, isLibrary);\n\t});\n\n\t//right after the module dependency list for each file is updated \n\t//with the definitions that need to be imported/exported\n\t//introduce dependencies for redundant imports\n\t//and unused exported definitions of each file in its dependency list\n\t//applies to non-library systems (non-library systems are syntactically transformed)\n\tif(isLibrary === false) {\n\n\t\tinputFileList.forEach(inputFile => {\n\n\t\t\tinputFile.addEncapsulationAndRedundancyDepsInModuleDependencyList();\n\t\t});\n\t}\n\telse {\n\n\t\tinputFileList.forEach(inputFile => {\n\n\t\t\tmdgUtilities.updateLibraryModuleExportDependencies(inputFile, inputFiles);\n\t\t});\n\t}\n\n\t// //after this iteration, imports/exports are resolved for each inputFile\n\t// //write definitions to JSON file (search exported/imported element by ast node)\n\t// let inputFileList = inputFiles.convertHashMapToArray();\n\n\tinputFileList.forEach(inputFile => {\n\t\t\n\t\t//generate a JSON file for each inputFile\n\t\tlet inputFileSourceTransformationObject = resultUtilities.generateJSONObjectContainingInputFileTransformations(inputFile, inputFiles, isLibrary);\n\t\tlet resultObject = resultUtilities.writeJSONObjectToFile(inputFile, inputFileSourceTransformationObject);\n\t\n\t\tjsonStreamList.push(resultObject);\n\t});\n\n\tconsole.log(`Generated json files.`);\n}", "function retrieveModuleDependenciesOfModule(inputFiles, moduleDependenceGraph, inputFile, isLibrary = false) {\n\t\n\t//(i) resolve module data and function dependencies of each inputFile\n\tmdgUtilities.retrieveModuleDependenciesOfModule(inputFiles, moduleDependenceGraph, inputFile, isLibrary);\n}", "parse() {\n const basePath = path.join(this.iotjs, 'docs/api');\n\n fs.readdir(basePath, (err, files) => {\n this.verboseLog(`Read '${basePath}' directory.`);\n\n if (err) {\n console.error(err.message);\n return false;\n }\n\n const promises = files.filter(file => !file.includes('reference')).map(file => {\n const name = file.slice(\n config.docname.pre.length,\n -config.docname.post.length\n ).toLowerCase().replace('file-system', 'fs');\n\n this.addModuleToOutput(name);\n\n return new Promise((resolve, reject) => {\n const filePath = path.join(basePath, file);\n\n fs.readFile(filePath, 'utf8', (error, data) => {\n this.verboseLog(`- Read '${filePath}' --> ${name} module`);\n\n if (error) {\n reject(error.message);\n } else {\n resolve({ name, data });\n }\n });\n });\n });\n\n Promise.all(promises).then((data) => {\n this.verboseLog('\\nParse each read file content to get their available functions list.');\n\n data.forEach((file) => {\n this.verboseLog(`- Parse ${file.name} module:`);\n\n let doc = false;\n let label = '';\n let detail = '';\n let insertText = '';\n let documentation = [];\n\n file.data.split('\\n').forEach(line => {\n // Prototype line match.\n if (!config.regex.new.test(line) && config.regex.proto.test(line)) {\n // Found a new prototype before an example, save the last known prototype if necessary.\n if (doc) {\n this.addFunctionToModule(file.name, {\n label: label,\n kind: 2,\n detail: detail,\n documentation: documentation.join('\\n'),\n insertText: insertText,\n });\n }\n\n const functionName = line.substring(4).replace(config.regex.args, '').split('.').pop();\n const functionDetail = line.substring(4);\n\n label = functionName;\n detail = functionDetail;\n insertText = functionName;\n documentation = [];\n doc = true;\n\n this.verboseLog(` = ${functionDetail}`);\n\n return;\n }\n\n // Documentation line match.\n if (!config.regex.event.test(line) &&\n !config.regex.exDef.test(line) &&\n !config.regex.exLess.test(line) &&\n !config.regex.proto.test(line) && doc) {\n documentation.push(line);\n } else {\n // Store the function documentation.\n if (doc) {\n this.addFunctionToModule(file.name, {\n label: label,\n kind: 2,\n detail: detail,\n documentation: documentation.join('\\n'),\n insertText: insertText,\n });\n }\n\n documentation = [];\n doc = false;\n }\n });\n });\n\n this.verboseLog('Modules are parsed.\\n');\n\n this.writeOutputToDestonation();\n }).catch((error) => {\n console.error(error);\n });\n });\n }", "function collectModules() {\n var mainPaths = (require.main && require.main.paths) || [];\n var paths = getPaths();\n var infos = {};\n var seen = {};\n paths.forEach(function (path) {\n var dir = path;\n /** Traverse directories upward in the search of package.json file */\n var updir = function () {\n var orig = dir;\n dir = path_1.dirname(orig);\n if (!dir || orig === dir || seen[orig]) {\n return undefined;\n }\n if (mainPaths.indexOf(dir) < 0) {\n return updir();\n }\n var pkgfile = path_1.join(orig, 'package.json');\n seen[orig] = true;\n if (!fs_1.existsSync(pkgfile)) {\n return updir();\n }\n try {\n var info = JSON.parse(fs_1.readFileSync(pkgfile, 'utf8'));\n infos[info.name] = info.version;\n }\n catch (_oO) {\n // no-empty\n }\n };\n updir();\n });\n return infos;\n}", "updateFilesInRootDependecies() {\n const { outDir } = this.config;\n\n const filesInRootDist = getFilesFromFolder(outDir)\n .filter(file => !isMapFile(file))\n .map(file => path.join(outDir, file));\n\n for (const file of filesInRootDist) {\n const fileProcessor = new FileProcessor(\n file,\n '',\n this.depGraph,\n this.config\n );\n\n fileProcessor.updateDependecies();\n }\n }", "function packages () {\n opts.packages = makeArray(argv.dep)\n opts.install = true\n }", "function getPackages() {\n\tvar packages = {};\n\tvar Package = {\n\t\tdescribe: function () {\n\t\t},\n\t\t_transitional_registerBuildPlugin: function () {\n\t\t},\n\t\tregister_extension: function () {\n\t\t},\n\t\tregisterExtension: function () {\n\t\t},\n\t\ton_use: function (callback) {\n\t\t\tcallback(api);\n\t\t},\n\t\tonUse: function (callback) {\n\t\t\tcallback(api);\n\t\t},\n\t\ton_test: function (callback) {\n\t\t\tcallback(api);\n\t\t},\n\t\tonTest: function (callback) {\n\t\t\tcallback(api);\n\t\t},\n\t\tregisterBuildPlugin: function () {\n\t\t}\n\t};\n\tNpm.depends = function () {\n\t};\n\tNpm.strip = function () {\n\t};\n\tvar Cordova = {\n\t\tdepends: function () {\n\t\t}\n\t};\n\tvar api = {\n\t\tadd_files: function () {\n\t\t},\n\t\taddFiles: function () {\n\t\t},\n\t\taddAssets: function () {\n\t\t},\n\t\timply: function () {\n\t\t},\n\t\tuse: function () {\n\t\t},\n\t\texport: function () {\n\t\t},\n\t\tversionsFrom: function() {\n\t\t},\n\t\tmainModule: function() {\n\t\t}\n\t}\n\n\tfs.readdirSync(packagesPath).forEach(handlePackage);\n\tif (fs.existsSync('packages')) {\n\t\tfs.readdirSync('packages').forEach(handlePackage);\n\t}\n\treturn packages;\n\n\tfunction initPackage(name) {\n\t\tif (typeof(packages[name]) === 'undefined') {\n\t\t\tvar packagePath = path.join(packagesPath, name);\n\t\t\tif (fs.existsSync(path.join('packages', name))) {\n\t\t\t\tpackagePath = path.join('packages', name);\n\t\t\t}\n\t\t\tpackages[name] = {\n\t\t\t\tpath: packagePath,\n\t\t\t\tserver: {\n\t\t\t\t\tuses: {},\n\t\t\t\t\timply: {},\n\t\t\t\t\tfiles: []\n\t\t\t\t},\n\t\t\t\tclient: {\n\t\t\t\t\tuses: {},\n\t\t\t\t\timply: {},\n\t\t\t\t\tfiles: []\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction handlePackage(package) {\n\t\tif (package.charAt(0) === '.') {\n\t\t\treturn;\n\t\t}\n\t\tinitPackage(package);\n\t\tvar packageJsPath = path.join(packagesPath, package, 'package.js');\n\t\tif (fs.existsSync(path.join('packages', package))) {\n\t\t\tpackageJsPath = path.join('packages', package, 'package.js');\n\t\t}\n\t\tif (package.charAt(0) === '.' || !fs.existsSync(packageJsPath)) {\n\t\t\treturn;\n\t\t}\n\t\tvar packageJs = fs.readFileSync(packageJsPath).toString();\n\t\tif (packageJs) {\n\t\t\tapi.use = function (name, where) {\n\t\t\t\tvar inServer = !where || where === 'server' || (where instanceof Array && where.indexOf('server') !== -1);\n\t\t\t\tvar inClient = !where || where === 'client' || where === 'web.cordova' || (where instanceof Array && (where.indexOf('client') !== -1 || where.indexOf('web.cordova') !== -1));\n\t\t\t\tif (!(name instanceof Array)) {\n\t\t\t\t\tname = [name];\n\t\t\t\t}\n\t\t\t\tname.forEach(function (item) {\n\t\t\t\t\tinitPackage(item);\n\t\t\t\t\tif (inServer) {\n\t\t\t\t\t\tpackages[package].server.uses[item] = packages[item];\n\t\t\t\t\t}\n\t\t\t\t\tif (inClient) {\n\t\t\t\t\t\tpackages[package].client.uses[item] = packages[item];\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\t\t\tapi.imply = function (name, where) {\n\t\t\t\tvar inServer = !where || where === 'server' || (where instanceof Array && where.indexOf('server') !== -1);\n\t\t\t\tvar inClient = !where || where === 'client' || where === 'web.cordova' || (where instanceof Array && (where.indexOf('client') !== -1 || where.indexOf('web.cordova') !== -1));\n\t\t\t\tif (!(name instanceof Array)) {\n\t\t\t\t\tname = [name];\n\t\t\t\t}\n\t\t\t\tname.forEach(function (item) {\n\t\t\t\t\tinitPackage(item);\n\t\t\t\t\tif (inServer) {\n\t\t\t\t\t\tpackages[package].server.imply[item] = packages[item];\n\t\t\t\t\t}\n\t\t\t\t\tif (inClient) {\n\t\t\t\t\t\tpackages[package].client.imply[item] = packages[item];\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\t\t\tapi.add_files = api.addFiles = function (name, where) {\n\t\t\t\tvar inServer = !where || where === 'server' || (where instanceof Array && where.indexOf('server') !== -1);\n\t\t\t\tvar inClient = !where || where === 'client' || where === 'web.cordova' || (where instanceof Array && (where.indexOf('client') !== -1 || where.indexOf('web.cordova') !== -1));\n\t\t\t\tif (!(name instanceof Array)) {\n\t\t\t\t\tname = [name];\n\t\t\t\t}\n\t\t\t\tvar items = name.filter(function (item) {\n\t\t\t\t\tif (item) {\n\t\t\t\t\t\treturn item.substr(item.length - 3) === '.ts';\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tif (inServer) {\n\t\t\t\t\tpackages[package].server.files = packages[package].server.files.concat(items);\n\t\t\t\t}\n\t\t\t\tif (inClient) {\n\t\t\t\t\tpackages[package].client.files = packages[package].client.files.concat(items);\n\t\t\t\t}\n\t\t\t};\n\t\t\tPackage.on_use = Package.onUse = function (callback) {\n\t\t\t\tcallback(api);\n\t\t\t};\n\t\t\tPackage.on_test = Package.onTest = function (callback) {\n\t\t\t\tcallback(api);\n\t\t\t};\n\t\t\tPackage.includeTool = function () {\n\t\t\t};\n\t\t\teval(packageJs);\n\t\t}\n\t}\n\n}", "_buildModuleTrees(results, sourceWidth) {\n // Map from meteorInstallOptions objects to trees of File objects for\n // all non-dynamic modules.\n const trees = new Map;\n\n function getTree({ meteorInstallOptions }) {\n if (! trees.has(meteorInstallOptions)) {\n trees.set(meteorInstallOptions, {});\n }\n return trees.get(meteorInstallOptions);\n }\n\n _.each(this.files, file => {\n if (file.bare) {\n // Bare files will be added before the synchronous require calls\n // in _chunkifyEagerRequires.\n return;\n }\n\n if (file.lazy && ! file.imported) {\n // If the file is not eagerly evaluated, and no other files\n // import or require it, then it need not be included in the\n // bundle.\n return;\n }\n\n const tree = getTree(file);\n\n if (file.aliasId) {\n addToTree(file.aliasId, file.absModuleId, tree);\n return;\n }\n\n if (file.isDynamic()) {\n const servePath = files.pathJoin(\"dynamic\", file.absModuleId);\n const { code: source, map } =\n getOutputWithSourceMapCached(file, servePath, { sourceWidth })\n\n results.push({\n source,\n servePath,\n sourceMap: map && map.toJSON(),\n dynamic: true,\n });\n\n const stubArray = file.deps.slice(0);\n\n if (file.absModuleId.endsWith(\"/package.json\") &&\n file.jsonData) {\n const stub = {};\n\n function tryMain(name) {\n const value = file.jsonData[name];\n if (_.isString(value) ||\n _.isObject(value)) {\n stub[name] = value;\n }\n }\n\n tryMain(\"browser\");\n tryMain(\"module\");\n tryMain(\"main\");\n\n stubArray.push(stub);\n }\n\n addToTree(stubArray, file.absModuleId, tree);\n\n } else {\n // If the file is not dynamic, then it should be included in the\n // initial bundle, so we add it to the static tree.\n addToTree(file, file.absModuleId, tree);\n }\n });\n\n return trees;\n }", "find_modules(flow){\n let modules = {}\n\n let nodes = flow.flow.nodes;\n\n for(var i = 0; i < nodes.length; i++){ \n modules[nodes[i].module_name] = this.modules[nodes[i].module_name]\n }\n \n let retArr = []\n for(var k in modules){\n modules[k].uuid = uuid.v4()\n retArr.push(modules[k])\n }\n return retArr\n }", "function modules(inst)\n{\n const dependencyModule = [];\n\n // Pull in static dependency modules\n dependencyModule.push({\n name: \"multiStack\",\n displayName: \"Multi-Stack Validation\",\n moduleName: \"/ti/common/multi_stack_validate\",\n hidden: true\n });\n\n dependencyModule.push({\n name: \"rfDesign\",\n displayName: \"RF Design\",\n moduleName: \"/ti/devices/radioconfig/rfdesign\",\n hidden: true\n });\n\n dependencyModule.push({\n name: \"rfModule\",\n displayName: \"RF\",\n moduleName: \"/ti/drivers/RF\",\n hidden: true\n\n });\n\n dependencyModule.push({\n name: \"powerModule\",\n displayName: \"Power\",\n moduleName: \"/ti/drivers/Power\",\n hidden: true\n\n });\n\n return(dependencyModule);\n}", "function gatherModules( config )\n{\n\tvar cwd = process.cwd();\n\n\t// Creating a stream through which each file will pass\n\tvar stream = through.obj( function( file, enc, callback )\n\t{\n\t\tif ( file.isBuffer() ) {\n\n\t\t\tvar modules = [];\n\n\t\t\t// Matches 'gj.User' and \"gj.User\"\n\t\t\t// The +? will do a greedy match.\n\t\t\tmodules = file.contents.toString().match( /['\"]gj\\.([a-zA-Z0-9\\.]+?)['\"]/g );\n\n\t\t\t// Convert each match to a filename format.\n\t\t\tmodules = _.map( modules, function( module )\n\t\t\t{\n\t\t\t\treturn module\n\t\t\t\t\t.replace( /['\"]/g, '' ) // Replace quotes.\n\t\t\t\t\t.replace( /gj\\./, '' ) // Replace the gj. part.\n\t\t\t\t\t.replace( /\\./g, '/' ) // Convert any other . to /.\n\t\t\t\t\t.replace( /([a-z])([A-Z])/g, '$1-$2' ) // Converts CamelCase to camel-case.\n\t\t\t\t\t.toLowerCase(); // Lowercase it.\n\t\t\t} );\n\n\t\t\t// Make sure the list is unique so we only include files once.\n\t\t\tmodules = _.uniq( modules );\n\n\t\t\tgutil.log( 'Injecting client lib modules: ' + gutil.colors.gray( JSON.stringify( modules ) ) );\n\n\t\t\tif ( modules.length ) {\n\t\t\t\tvar concat = new Concat( !!file.sourceMap, path.basename( file.path ), gutil.linefeed );\n\t\t\t\tconcat.add( path.relative( cwd, file.path ), file.contents, file.sourceMap );\n\n\t\t\t\t// Loop through each matched module.\n\t\t\t\tmodules.forEach( function( module )\n\t\t\t\t{\n\t\t\t\t\t// We glob it out so that module definitions load in first.\n\t\t\t\t\tvar files = globExpand( { cwd: cwd }, [\n\t\t\t\t\t\tconfig.gjLibDir + 'components/' + module + '/*.js',\n\t\t\t\t\t\t'!' + config.gjLibDir + 'components/' + module + '/*-{service,controller,directive,filter,model,vendor}.js',\n\t\t\t\t\t\tconfig.gjLibDir + 'components/' + module + '/*-{service,controller,directive,filter,model}.js',\n\t\t\t\t\t] );\n\n\t\t\t\t\tfiles.forEach( function( _file )\n\t\t\t\t\t{\n\t\t\t\t\t\tconcat.add( _file, fs.readFileSync( cwd + '/' + _file ) );\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\tfile.contents = concat.content;\n\n\t\t\t\tif ( concat.sourceMapping ) {\n\t\t\t\t\tfile.sourceMap = JSON.parse( concat.sourceMap );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Streams not supported.\n\t\telse if ( file.isStream() ) {\n\t\t\tthis.emit( 'error', new gutil.PluginError( PLUGIN_NAME, 'Streaming not supported.' ) );\n\t\t\treturn callback();\n\t\t}\n\n\t\tthis.push( file );\n\t\treturn callback();\n\t} );\n\n\t// returning the file stream\n\treturn stream;\n}", "function discoverModules(basePath) {\n const candidates = [];\n FS.readdirSync(basePath).forEach((name) => {\n const dir = Path.join(basePath, name);\n if (name.startsWith(\"@\") && FS.statSync(dir).isDirectory()) {\n FS.readdirSync(dir).forEach((n) => {\n candidates.push(Path.join(name, n));\n });\n }\n candidates.push(name);\n });\n candidates.forEach((name) => {\n const infoFile = Path.join(basePath, name, \"package.json\");\n if (!FS.existsSync(infoFile)) {\n return;\n }\n const info = loadPackageInfo(app.logger, infoFile);\n if (isPlugin(info)) {\n result.push(Path.join(basePath, name));\n }\n });\n }", "function buildAll(list) {\n var modulesList = []\n ;\n\n forEachAsync(list, function (next, modulename) {\n makePackageReady(moduleRoot + '/' + 'node_modules' + '/' + modulename, builtIns, function (err, pkg, m, u, v, l, p, b) {\n if (err) {\n console.error('[local#1]', err);\n next();\n return;\n //throw err;\n }\n\n l.forEach(function (module) {\n modulesList.push(render(module, pkg));\n });\n\n next();\n\n /*\n l.forEachAsync(function (next, module) {\n render(function (err, str) {\n modulesList.push(str);\n }, pkg, module));\n }).then(next);\n */\n });\n }).then(function () {\n makePackageReady(moduleRoot, builtIns, function (err, pkg, m, u, v, l, p, b) {\n l.forEach(function (module) {\n modulesList.push(render(module));\n });\n\n fn(null, modulesList.join('\\n'));\n \n /*\n l.forEachAsync(function (next, module) {\n render(function (err, str) {\n modulesList.push(str);\n }, pkg, module);\n }).then(function () {\n fn(null, modulesList.join('\\n'));\n });\n */\n });\n });\n }", "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}", "generate({baseDir, moduleName, units, asLib, generateSm, includePackage, prependCode}){\n let key, unit;\n const coreUnits = ((() => {\n const result = [];\n for (unit of Array.from(units)) { if (unit.isCore) {\n result.push(unit);\n }\n }\n return result;\n })());\n const binaryUnits = ((() => {\n const result1 = [];\n for (unit of Array.from(units)) { if (unit.isBinary) {\n result1.push(unit);\n }\n }\n return result1;\n })());\n const fileUnits = ((() => {\n const result2 = [];\n for (unit of Array.from(units)) { if (!unit.isCore && !unit.isBinary) {\n result2.push(unit);\n }\n }\n return result2;\n })());\n\n // for non core untis, figure out a unique key in __m\n fuse._makeKeys(fileUnits.concat(binaryUnits));\n for (unit of Array.from(coreUnits)) { unit.key = unit.fpath; } // core units: key = fpath\n\n // store the core modules (aka nodejs modules) in the global module map\n\n let sCoreRequires =\n ((() => {\n const result3 = [];\n for (unit of Array.from(coreUnits)) { result3.push(`\\\n__m['${unit.key}'] = {\n sts : 1,\n mod : {exports: __m.__sr('${unit.key}')}\n};\\\n`);\n }\n return result3;\n })()).join('\\n');\n\n (() => {\n const mem = {};\n return (() => {\n const result4 = [];\n for (unit of Array.from(binaryUnits)) {\n let binName = path.basename(unit.fpath);\n while (Array.from(mem).includes(binName)) { binName = `_${binName}`; } // ensure no dup\n unit.binName = binName;\n result4.push(sCoreRequires += `\\\n__m['${unit.key}'] = {\n sts : null,\n mod : {exports: {}},\n load : function() { return (__m['${unit.key}'].mod.exports = __m.__sr('./${binName}')); }\n};\\\n`);\n }\n return result4;\n })();\n })();\n\n let code = `\\\n${prependCode}\n(function(run, root) {\n var ret = run.bind(root)();\n if ('${moduleName}') root['${moduleName}'] = ret;\n if (\"object\" == typeof exports && \"undefined\" != typeof module)\n module.exports = ret;\n}(function() {\nvar __m = {};\nif (typeof require === 'undefined') __m.__sr = function() {};\nelse __m.__sr = require;\n__m.__r = function(key) {\n var m = __m[key];\n if (m.sts === null) m.load.call();\n return m.mod.exports;\n};\n${sCoreRequires}\\\n`;\n\n // [_\\w\\-\\.\\~], see RFC3986, section 2.3.\n const smRegex = /\\/\\/# sourceMappingURL=([_\\w\\-\\.\\~]+)/;\n for (let i = 0; i < fileUnits.length; i++) {\n var src;\n unit = fileUnits[i];\n const smMatch = smRegex.exec(unit.src);\n if (smMatch) {\n unit.src = (src = unit.src.replace(\"//# sourceMappingURL=\", \"// sourceMappingURL=\"));\n unit.sm = { url: smMatch[1] };\n } else {\n ({ src } = unit);\n }\n\n if (path.extname(unit.fpath) === \".json\") {\n code += `\\\n__m['${unit.key}'] = {\n sts: 1,\n mod: { exports:\\\n`;\n if (generateSm) { unit.smline = fuse._lc(code); }\n code += src;\n code += \"}};\\n\";\n } else {\n const lmapcode = (Array.from(unit.requires).map((r) => ` '${r.name}': '${r.unit.key}'`)).join(\",\\n\");\n let pkginfo = unit.package ? `${unit.package.name}@${unit.package.version || ''}` : \"\";\n pkginfo += `(${path.basename(unit.fpath)})`;\n code += `\\\n__m['${unit.key}'] = {\n sts: null,\n mod: { ${unit.package && includePackage ? `package: ${JSON.stringify(unit.package)},` : \"\"}\n exports: {} },\n load: (function() {\n var module = __m['${unit.key}'].mod;\n var exports = module.exports;\n var require = function(name) {\n var namemap = {\n${lmapcode}\n }\n var k = namemap[name];\n return k ? __m.__r(k) : __m.__sr(name);\n }\n require.resolve = __m.__sr.resolve;\n __m['${unit.key}'].sts = 0;\n//******** begin file ${pkginfo} ************\\n\\\n`;\n if (generateSm) { unit.smline = fuse._lc(code); }\n code += src;\n code += `\\\n\n//******** end file ${pkginfo}************\n __m['${unit.key}'].sts = 1;\n }).bind(this)\n};\\n\\\n`;\n }\n }\n // seal the code\n if (asLib) {\n code += \"return {\\n\";\n const packages = {};\n for (unit of Array.from(fileUnits)) {\n if (unit.package) {\n if (unit.package.name in packages) {\n // key-ed by package name, therefore must resolve conflicting version by appending version\n // to package name for the name of the key\n const oldunit = packages[unit.package.name];\n if (oldunit.package.version !== unit.package.version) {\n packages[`${oldunit.package.name}@${oldunit.package.version}`] = oldunit;\n packages[`${unit.package.name}@${unit.package.version}`] = unit;\n }\n } else {\n packages[unit.package.name] = unit;\n }\n }\n }\n\n for (key in packages) {\n unit = packages[key];\n code += `'${key}': __m.__r('${unit.key}'),\\n`;\n }\n code += \"};\\n\";\n } else {\n code += `\\nreturn __m.__r('${_(fileUnits).last().key}');\\n`;\n }\n code += \"\\n},this));\";\n\n return [code, binaryUnits, generateSm ? fuse._generateSourceMap(baseDir, code, fileUnits) : null];\n }", "function module1(folderpath, io_path, connection, callback) {\n async.waterfall([\n // SETUP: find files, connect, create userid, create io, insert io (result = [batches, null, null], returns batches)\n function setup(cb) {\n async.parallel([\n // Find the json files to be processed (returns batches)\n function find_files(pcb) {\n fs.readdir(folderpath, function(err, result) {\n if (err) {\n console.log('Error at find_files().')\n pcb(err)\n } else {\n let json_filepaths = []\n for (filename of result) { \n if (filename.endsWith('.json')) {\n json_filepaths.push(folderpath + '/' + filename)\n }\n }\n \n const batches = []\n const num_batches = Math.floor(json_filepaths.length / batch_size)\n for (let i = 0; i < num_batches; i ++) {\n batches.push(json_filepaths.slice(0, batch_size))\n json_filepaths.splice(0, batch_size)\n }\n batches.push(json_filepaths)\n \n console.log('Sorted folder: ' + folderpath + ': found ' + batches.length + ' batches.')\n pcb(null, batches)\n }\n })\n },\n // Create userid_table (returns null)\n function create_uuid(pcb) {\n create_table(userid_table, userid_example, userid_unique_keys, connection, (err, result) => {\n if (err) {\n console.log('Failed to create table: ' + userid_table)\n pcb(err)\n } else {\n console.log('Finished creating table: ' + userid_table)\n pcb(null)\n }\n })\n },\n // Submodule 1: create io, insert io (returns null)\n function submodule1(pcb) {\n async.waterfall([\n // Create io table.\n function create_io(sm_wcb) {\n create_table(io_table, io_example, undefined, connection, (err, result) => {\n if (err) {\n console.log('Failed to create table: ' + io_table)\n sm_wcb(err)\n } else {\n console.log('Finished creating table: ' + io_table)\n sm_wcb(null)\n }\n })\n },\n // Insert io file.\n function insert_io(sm_wcb) {\n read_csvfile(io_path, (err, result) => {\n if (err) {\n sm_wcb(err)\n } else { \n const headers = ['application', '_ID']\n const data = result.slice(1)\n const new_data = []\n for (d of data) {\n nd = []\n if (d[1]) {\n nd.push(d[1])\n } else {\n nd.push(d[0])\n }\n nd.push(d[3])\n new_data.push(nd)\n }\n const io_write = make_obj(headers, new_data)\n insert_table(io_write, io_table, connection, undefined, undefined, (err) => {\n if (err) {\n sm_wcb(err)\n } else {\n sm_wcb(null)\n }\n })\n }\n })\n }\n ], \n function (err) {\n if (err) {\n pcb(err)\n } else {\n pcb(null)\n }\n })\n }\n ], \n function (err, result) {\n if (err) {\n cb(err)\n } else {\n cb(null, result[0])\n }\n })\n },\n // Process batches (returns null)\n function process(batches, cb) {\n const pool = mysql.createPool({\n conncetionLimit: batches.length,\n host: 'localhost',\n port: '3306',\n database: 'LBLR_data',\n user: 'root',\n password: 'raceboorishabackignitedrum',\n })\n \n async.map(batches, \n (datum, map_callback) => {\n console.log(datum)\n batch(datum, userid_table, 0, connection, (err) => {\n if (err) {\n map_callback(err)\n }\n else {\n map_callback(null)\n }\n })\n },\n (err, result) => {\n if (err) {\n cb(err)\n }\n else {\n const select_query = \"SELECT * FROM \" + userid_table\n connection.query(select_query, (err, result, fields) => {\n if (err) {\n cb(err)\n } else {\n cb(null, result)\n }\n })\n }\n }\n )\n },\n\n // Drop io_table (returns null)\n function drop_io(output, cb) {\n drop_table(io_table, connection, (err, result) => {\n if (err) {\n console.log('Error dropping: ' + io_table)\n cb(err)\n } else {\n console.log('Dropped: ' + io_table)\n cb(null, output)\n }\n })\n },\n ], \n function (err, output) {\n if (err) {\n console.log('\\n\\t Trying to cleanup module 1\\n')\n cleanupTables(connection, (cleanErr) => {\n if (cleanErr) {\n console.log('Cleanup Error', cleanErr)\n }\n else {\n close_connection(connection, (conErr) => {\n if (conErr) {\n console.log('Close Connection Error', conErr)\n }\n else {\n callback(err)\n }\n })\n }\n })\n } else {\n module2(output, connection, callback)\n }\n })\n}", "function rstAllPackages() {\n for (let package of AllPackages.concat(extraPackages)) {\n rstConfiguration(package, `/tmp/${package}.rst`);\n }\n}", "function moduleInstances(inst)\n{\n let dependencyModule = [];\n\n // Pull in dependency modules\n const radioScriptModuleInst = radioScript.moduleInstances(inst);\n const securityScriptModuleInst = securityScript.moduleInstances(inst);\n const oadScriptModuleInst = oadScript.moduleInstances(inst);\n\n dependencyModule = dependencyModule.concat(radioScriptModuleInst);\n dependencyModule = dependencyModule.concat(securityScriptModuleInst);\n dependencyModule = dependencyModule.concat(oadScriptModuleInst);\n\n // Pull module for ti_154stack_config.h generation\n if(inst.project !== \"coprocessor\")\n {\n dependencyModule.push({\n name: \"ti154stackModule\",\n moduleName: \"/ti/ti154stack/ti154stack_config_mod.js\"\n });\n }\n\n return(dependencyModule);\n}", "collectDependencies() {}", "compileOneFile(inputFile) {\n\t\tvar pathInPackage = inputFile.getPathInPackage();\n\t\tvar packageName = inputFile.getPackageName();\n\t\tif (packageName) {\n\t\t\tpackageName = packageName.replace('local-test:', '');\n\t\t}\n\t\tvar fullPath = pathInPackage;\n\t\tif (packageName) {\n\t\t\tfullPath = path.join(packagesPath, packageName, fullPath);\n\t\t}\n\n\t\t// console.log('Compiling...', (packageName || 'app') + '/' + pathInPackage);\n\n\t\tif (pathInPackage.indexOf('node_modules/') !== -1) {\n\t\t\tconsole.log('Ignoring', (packageName || 'app') + '/' + pathInPackage, 'becouse its in node_modules');\n\t\t\treturn {};\n\t\t}\n\n\t\tif (pathInPackage.indexOf('typings/') !== -1) {\n\t\t\tconsole.log('Ignoring', (packageName || 'app') + '/' + pathInPackage, 'becouse its in typings');\n\t\t\treturn {};\n\t\t}\n\n\t\tif (pathInPackage.substr(-5) === '.d.ts') {\n\t\t\tconsole.log('Ignoring', (packageName || 'app') + '/' + pathInPackage, 'becouse its a definition');\n\t\t\treturn {};\n\t\t}\n\n\t\t// generatePackageRefs();\n\t\tif (\n\t\t\tpackageName &&\n\t\t\ttypescriptPackages[packageName].client.files.indexOf(pathInPackage) === -1 &&\n\t\t\ttypescriptPackages[packageName].server.files.indexOf(pathInPackage) === -1\n\t\t) {\n\t\t\tconsole.log('Ignoring', (packageName || 'app') + '/' + pathInPackage, 'becouse its not added to package.js');\n\t\t\treturn {};\n\t\t}\n\n\t\t// cache check\n\t\tvar cachePath = path.join(cacheDir, isApp && !disableInApp ? path.relative('../', fullPath) : path.relative(meteorPath, fullPath));\n\t\tvar baseName = path.basename(fullPath, '.ts');\n\t\tvar changeTime = fs.statSync(fullPath).mtime;\n\t\tvar jsPath = path.join(path.dirname(cachePath), baseName + '.js');\n\t\tvar error;\n\n\t\t// references\n\t\tvar dir = path.dirname(path.relative('./', fullPath));\n\t\tif (!packageName) {\n\t\t\tif (appDirs.indexOf(dir) == -1) {\n\t\t\t\tappDirs.push(dir);\n\t\t\t}\n\t\t\tif (appRefs.indexOf(pathInPackage) == -1) {\n\t\t\t\tappRefs.push(pathInPackage);\n\t\t\t\tappDirs.forEach(function (dir) {\n\t\t\t\t\tfs.writeFileSync(path.join(dir, '.#ts', \"server.d.ts\"), '///<reference path=\"' + path.relative(dir, path.join('.meteor', '.#ts', 'app-server.d.ts')) + '\" />\\n');\n\t\t\t\t\tfs.writeFileSync(path.join(dir, '.#ts', \"client.d.ts\"), '///<reference path=\"' + path.relative(dir, path.join('.meteor', '.#ts', 'app-client.d.ts')) + '\" />\\n');\n\t\t\t\t});\n\t\t\t\tfs.writeFileSync(path.join('.meteor', '.#ts', 'app-server.d.ts'), getAppRefs('server'));\n\t\t\t\tfs.writeFileSync(path.join('.meteor', '.#ts', 'app-client.d.ts'), getAppRefs('client'));\n\t\t\t}\n\t\t}\n\n\t\tvar doesntExists = !fs.existsSync(jsPath);\n\t\tvar existingTime = !doesntExists && fs.statSync(jsPath).mtime;\n\t\tvar isTooOld = existingTime && changeTime.getTime() > existingTime.getTime();\n\t\tif (doesntExists || isTooOld) {\n\n\t\t\tif (doesntExists) {\n\t\t\t\tconsole.log('Compiling because doesnt exist:', fullPath);\n\t\t\t\t// console.log(\n\t\t\t\t// \ttypescriptPackages[packageName].client.files,\n\t\t\t\t// \ttypescriptPackages[packageName].server.files\n\t\t\t\t// );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log('Compiling because too old:', fullPath);\n\t\t\t}\n\n\t\t\tvar exec = Npm.require('child_process').exec;\n\t\t\tvar Future = Npm.require('fibers/future');\n\n\t\t\tfunction execSync(command) {\n\t\t\t\tvar fut = new Future();\n\t\t\t\texec(command, function (error, stdout, stderr) {\n\t\t\t\t\tfut.return({\n\t\t\t\t\t\tstdout: stdout,\n\t\t\t\t\t\tstderr: stderr || error\n\t\t\t\t\t})\n\t\t\t\t});\n\t\t\t\treturn fut.wait();\n\t\t\t}\n\n\t\t\tvar compileCommand = 'node ' + compilerPath + ' ' +\n\t\t\t\t'--target ES5 ' +\n\t\t\t\t'--sourcemap ' +\n\t\t\t\t'--module amd ' +\n\t\t\t\t'--experimentalDecorators ' +\n\t\t\t\t'--emitDecoratorMetadata ' +\n\t\t\t\t//'--pretty ' +\n\t\t\t\t'--emitVerboseMetadata ' +\n\t\t\t\t'--skipEmitVarForModule ' +\n\t\t\t\t'--outDir ' + cacheDir + ' ' + (disableInApp ? meteorAllPath : allPath);\n\n\t\t\t// console.log(compileCommand);\n\t\t\ttry {\n\t\t\t\tvar result = execSync(compileCommand);\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\tconsole.log(e);\n\t\t\t}\n\n\t\t\tif (result.stderr) {\n\t\t\t\tvar lines = (typeof result.stderr === 'string' ? result.stderr : result.stdout).split('\\n');\n\t\t\t\tvar errors = [];\n\t\t\t\tfor (var i = 0; i < lines.length; i++) {\n\t\t\t\t\tif (!lines[i]) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\terrors.push(lines[i]);\n\t\t\t\t}\n\t\t\t\tif (errors.length > 0) {\n\t\t\t\t\terror = errors.join('\\n');\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!error && !fs.existsSync(jsPath)) {\n\t\t\t\terror = 'File was not created: ' + jsPath;\n\t\t\t}\n\t\t\tif (error) {\n\t\t\t\ttry {\n\t\t\t\t\tfs.unlinkSync(jsPath);\n\t\t\t\t\tfs.unlinkSync(cachePath + '.map');\n\t\t\t\t}\n\t\t\t\tcatch (e) {\n\t\t\t\t\t// ignore\n\t\t\t\t}\n\t\t\t\t// ../meteor/packages/marketing/TransactionServer.ts(1078,10)\n\t\t\t\terror = error\n\t\t\t\t\t.replace(/(\\x1b\\[30m)/g, '\\n$1')\n\t\t\t\t\t// .replace(/([a-zA-Z0-9\\.\\/_-]+)\\(([0-9]+),([0-9]+)\\)/g, '\\n\\x1b[42;1m' + process.cwd().replace(new RegExp('^/Users/' + process.env.USER, 'g'), '~') + '/$1:$2 $3\\x1b[0m');\n\t\t\t\tinputFile.error({\n\t\t\t\t\tmessage: error\n\t\t\t\t});\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\tvar data = fs.readFileSync(jsPath).toString();\n\n\t\t//console.log('adding: ' + jsPath)\n\t\t// couple of hacks for meteor namespacing\n\t\tvar prep = '';\n\t\tdata = data\n\t\t//.replace(/(new __\\(\\);\\n\\};\\n)var ([a-zA-Z0-9_]+);/, '$1' + prep)\n\t\t\t.replace(/(<reference path=\"[a-zA-Z0-9_\\.\\/-]+\"[ ]*\\/>\\n(\\/\\*(.|\\n)+\\*\\/\\n)?)var ([a-zA-Z0-9_]+);\\n/, '$1' + prep)\n\t\t\t//.replace(/(var __decorate[\\w\\s!=\"\\(\\)&|,.;:}{]*};\\n)var ([a-zA-Z0-9_]+);\\n/, '$1' + prep)\n\t\t\t.replace(/^\\s*var ([a-zA-Z0-9_]+);/, prep)\n\t\t\t.replace(/\\/\\/# sourceMappingURL=.+/, '');\n\t\t//\t\t.replace(/\\}\\)\\(([a-zA-Z0-9_]+) \\|\\| \\(([a-zA-Z0-9_]+) = \\{\\}\\)\\);(\\n\\/\\/# sourceMappingURL)/, '})($1);$3');\n\t\t//\tdata = data\n\t\t//\t\t.replace(/(new __\\(\\);\\n\\};\\n)var ([a-zA-Z0-9_]+);/, '$1this.$2 = this.$2 || {};\\nvar $2 = this.$2;')\n\t\t//\t\t.replace(/(<reference path=\"[a-zA-Z0-9_\\.\\/-]+\"[ ]*\\/>\\n)var ([a-zA-Z0-9_]+);/, '$1this.$2 = this.$2 || {};\\nvar $2 = this.$2;')\n\t\t//\t\t.replace(/^\\s*var ([a-zA-Z0-9_]+);/, 'this.$1 = this.$1 || {};\\nvar $1 = this.$1;');\n\n\t\tvar map = fs.readFileSync(jsPath + '.map')\n\t\t\t.toString()\n\t\t\t.replace(/\"sources\":\\[\"[0-9a-zA-Z-\\/\\.-]+\"]/, '\"sources\":[\"' + inputFile.getDisplayPath() + '\"]');\n\t\tmap = map.substr(0, map.length - 1) + ',\"sourcesContent\":[\"' + fs.readFileSync(fullPath)\n\t\t\t\t.toString()\n\t\t\t\t.replace(/[\\\\]/g, '\\\\\\\\')\n\t\t\t\t.replace(/[\"]/g, '\\\\\"')\n\t\t\t\t.replace(/[\\b]/g, '\\\\b')\n\t\t\t\t.replace(/[\\f]/g, '\\\\f')\n\t\t\t\t.replace(/[\\n]/g, '\\\\n')\n\t\t\t\t.replace(/[\\r]/g, '\\\\r')\n\t\t\t\t.replace(/[\\t]/g, '\\\\t') + '\"]}';\n\t\treturn {\n\t\t\tpath: pathInPackage + \".js\",\n\t\t\tdata: data,\n\t\t\tsourceMap: map\n\t\t};\n\t}", "onEndResolve(context) {\n const project = context.project;\n const home = project.directory;\n project.files.forEach((file) => {\n const reflections = [];\n file.reflections.forEach((reflection) => {\n reflections.push(reflection);\n });\n let directory = home;\n const path = Path.dirname(file.fileName);\n if (path !== \".\") {\n path.split(\"/\").forEach((pathPiece) => {\n if (!Object.prototype.hasOwnProperty.call(directory.directories, pathPiece)) {\n directory.directories[pathPiece] = new index_2.SourceDirectory(pathPiece, directory);\n }\n directory = directory.directories[pathPiece];\n });\n }\n directory.files.push(file);\n // reflections.sort(GroupHandler.sortCallback);\n file.parent = directory;\n file.reflections = reflections;\n });\n }", "function getAllNeededModules(tasks) {\n\tgloupslog(\"\\n SYNTAXICALY {1} FROM {0} ...\".format([logFilePath(\"gulpfile.js\"), chalk.bgMagenta(' IMPORTING MODULES ')]));\n\tconsole.log('\\n');\n\n\tgetModule(M.fs);\n\tseekInFoundElements('intask', JSON.stringify(tasks));\n\n\timportModulesFromFoundModules();\n}", "function find_dep (obj) {\n //TODO include require\n //TODO include other formating (like other spaces etc)\n const DepPattern = /const (.*) = require\\((.*)\\)/g\n //TODO include var and let\n const DepNamePattern = /const (.*) =/\n //TODO include require\n const DepReplacePattern = /require\\((.*)\\)/\n //TODO for more secure find better way to detect, if someone put comment with module name it will find comment insted of function\n const FunctionStarter = new RegExp('.*' + ' ' + obj.name + ' ' + '.*', 'm')\n var file = obj.file,\n allDeps = file.match(DepPattern),\n deps = [],\n depDescription = [],\n params = [],\n moduleStart = '',\n newModuleStart = '',\n moduleStartString = '\\n' + file.match(FunctionStarter) + '\\n',\n injectDep = ''\n\n if (allDeps) {\n for (let x = 0, max = allDeps.length; x < max; x++) {\n let dep = allDeps[x],\n name = dep.match(DepNamePattern)[1],\n toReplace = dep.match(DepReplacePattern);\n \n \n depDescription.push(dep.replace(toReplace[0], '$hpak__dep' + (x + 1)))\n params.push('$hpak__dep' + (x + 1))\n\n file = file.replace(/\\nmodule.exports.*\\n/m, '')\n file = file.replace(DepPattern, '')\n deps.push({\n name: name,\n path: toReplace[1]\n })\n }\n }\n if (depDescription) {\n injectDep = '(' + params.join() + ')'\n moduleStart = file.match(FunctionStarter)\n newModuleStart = moduleStart[0].replace(/\\(\\)/, injectDep) + '\\n'\n depDescription.forEach((shpak) => {\n newModuleStart += ' ' + shpak + '\\n'\n })\n file = file.replace(FunctionStarter, newModuleStart)\n //file = file.replace(FunctionStarter, moduleStartString)\n }\n\n file = file.replace(/\\n\\n/g, '\\n')\n file = file.replace(/\\n\\n/g, '\\n')\n\n return {\n name: obj.name, \n file: file, \n dep: deps\n }\n }", "function buildFileComponentGroups(product, inputs)\n{\n\tvar fileComponentGroups = {}\n\tvar installPaths = []\t// Used to prevent duplicates (JSON files produced by windeployqt contain duplicates).\n\n\tfor (var tagIndex = 0; tagIndex < product.inputFileTags.length; tagIndex++) {\n\t\tvar tagInputs = inputs[product.inputFileTags[tagIndex]]\n\t\tif (tagInputs === undefined)\n\t\t\tcontinue\n\n\t\tif (product.inputFileTags[tagIndex] === \"cutehmi.windeployqt.json\") {\n\t\t\tfor (var i = 0; i < tagInputs.length; i++) {\n\t\t\t\tconsole.log(\"Found \" + tagInputs[i].filePath + \" which will be used as a source of component groups data.\")\n\t\t\t\tvar jsonFile = new TextFile(tagInputs[i].filePath, TextFile.ReadOnly)\n\t\t\t\ttry {\n\t\t\t\t\tvar json = JSON.parse(jsonFile.readAll())\n\t\t\t\t} finally {\n\t\t\t\t\tjsonFile.close()\n\t\t\t\t}\n\t\t\t\tfor (var entryIndex in json[\"files\"]) {\n\t\t\t\t\tvar entry = json[\"files\"][entryIndex]\n\n\t\t\t\t\t//<WixInstaller-1.workaround target=\"windeployqt\" cause=\"bug\">\n\t\t\t\t\t// Check if file exists in target location and copy it if _windeployqt_ failed to do so.\n\t\t\t\t\tvar fileName = FileInfo.fileName(FileInfo.fromWindowsSeparators(entry[\"source\"]))\n\t\t\t\t\tvar targetPath = entry[\"target\"] + \"\\\\\" + fileName\n\t\t\t\t\tif (!File.exists(targetPath))\n\t\t\t\t\t\tFile.copy(entry[\"source\"], targetPath)\n\t\t\t\t\t//</WixInstaller-1.workaround>\n\n\t\t\t\t\tvar installDir = getInstallDirFromWindeployqtEntry(product, entry)\n\t\t\t\t\taddFileComponentGroupEntry(fileComponentGroups, installPaths, entry[\"source\"], installDir, [], qtRuntimeProductMock[\"name\"])\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (product.inputFileTags[tagIndex] === \"installable\") {\n\t\t\tfor (i = 0; i < tagInputs.length; i++) {\n\t\t\t\tinstallDir = getInstallDirFromInput(tagInputs[i])\n\t\t\t\tif (installDir === undefined) {\n\t\t\t\t\tconsole.warn(\"File \" + tagInputs[i].filePath + \" is not installable and it won't be listed in \" + output.filePath)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\taddFileComponentGroupEntry(fileComponentGroups, installPaths, tagInputs[i].filePath, installDir, tagInputs[i].fileTags, tagInputs[i].product.name)\n\t\t\t}\n\t\t} else\n\t\t\tconsole.warn(\"Unsupported file tag '\" + product.inputFileTags[tagIndex] + \"' used in inputs\")\n\t}\n\n\treturn fileComponentGroups\n}", "function discover(...moduleDirs) {\n var _a, _b, _c, _d;\n const jsii = {};\n const discoverJsii = (dir) => {\n const jsiiFile = path.join(dir, '.jsii');\n if (!fs.existsSync(jsiiFile)) {\n return;\n } // no jsii manifest\n const manifest = fs.readJsonSync(jsiiFile);\n for (const [fqn, type] of Object.entries(manifest.types)) {\n jsii[fqn] = type;\n }\n };\n // read all .jsii manifests from all modules (incl. projen itself) and merge\n // them all into a single map of fqn->type.\n for (const dir of [...moduleDirs, PROJEN_MODULE_ROOT]) {\n discoverJsii(dir);\n if (dir.includes('@') && fs.lstatSync(dir).isDirectory()) {\n const childDirs = fs.readdirSync(dir).map(file => path.join(dir, file));\n for (const child of childDirs) {\n discoverJsii(child);\n }\n }\n }\n const result = new Array();\n for (const [fqn, typeinfo] of Object.entries(jsii)) {\n if (!isProjectType(jsii, fqn)) {\n continue;\n }\n // projen.web.ReactProject -> web.ReactProject\n const typename = fqn.substring(fqn.indexOf('.') + 1);\n const docsurl = `https://github.com/projen/projen/blob/master/API.md#projen-${typename.toLocaleLowerCase()}`;\n let pjid = (_c = (_b = (_a = typeinfo.docs) === null || _a === void 0 ? void 0 : _a.custom) === null || _b === void 0 ? void 0 : _b.pjid) !== null && _c !== void 0 ? _c : decamelize(typename).replace(/_project$/, '');\n result.push({\n moduleName: typeinfo.assembly,\n typename,\n pjid,\n fqn,\n options: discoverOptions(jsii, fqn).sort((o1, o2) => o1.name.localeCompare(o2.name)),\n docs: (_d = typeinfo.docs) === null || _d === void 0 ? void 0 : _d.summary,\n docsurl,\n });\n }\n return result.sort((r1, r2) => r1.pjid.localeCompare(r2.pjid));\n}", "function buildDependencies() {\n return through2.obj(function (file, enc, cb) {\n var fp = file.history[0];\n var fn = fp.substring(fp.lastIndexOf('/') + 1, fp.lastIndexOf('.'));\n var txt = file.contents.toString();\n var firstLine = txt.substr(0, txt.indexOf('\\n'));\n var dependencyNames = /define\\(\\[(.*?)\\]/.exec(firstLine)[1]\n .split(', ')\n .map(d => d.substring(1, d.length - 1))\n .slice(2);\n // allow plain name not including path currently\n dependencyNames = dependencyNames.map(d => {\n var i = d.lastIndexOf('/');\n if (i == -1) return d;\n else return d.substring(i + 1, d.length - 1);\n })\n\n var dependencyAlias = /function \\((.+?)\\)/.exec(firstLine)[1]\n .split(', ')\n .slice(2);\n var moduleInfo = { fn: fn, exports: [], dependencies: [] };\n if (dependencyNames.length > 0) {\n for (var i = 0; i < dependencyNames.length; i++) {\n moduleInfo.dependencies.push({ key: dependencyNames[i], value: dependencyAlias[i] });\n }\n }\n var reg = /exports\\.(.*) = .*/g;\n var match = reg.exec(txt);\n while (match != null) {\n moduleInfo.exports.push(match[1]);\n match = reg.exec(txt);\n }\n\n // For enums\n var reg1 = /\\(exports\\.(.*) = {}\\)/g;\n var match1 = reg1.exec(txt);\n while (match1 != null) {\n moduleInfo.exports.push(match1[1]);\n match1 = reg1.exec(txt);\n }\n\n file['moduleInfo'] = moduleInfo;\n\n this.push(file);\n cb();\n });\n}", "async function compare() {\n let branchDir = path.join(__dirname, '..', 'dist', 'branch-api');\n let publishedDir = path.join(__dirname, '..', 'dist', 'published-api');\n if (!(fs.existsSync(branchDir) && fs.existsSync(publishedDir))) {\n if (!fs.existsSync(publishedDir) && fs.existsSync(branchDir)) {\n console.log('not showing private package', branchDir);\n } else if (fs.existsSync(publishedDir) && !fs.existsSync(branchDir)) {\n console.log('something has probably gone wrong, the package exists published but not locally', publishedDir);\n } else {\n console.log('something has probably gone wrong, the package does not exist in either place, this should be impossible', publishedDir);\n }\n return;\n }\n let summaryMessages = [];\n // don't worry about private packages, they don't make it through the build\n let branchAPIs = fg.sync(`${branchDir}/**/api.json`);\n let publishedAPIs = fg.sync(`${publishedDir}/**/api.json`);\n let pairs = [];\n for (let pubApi of publishedAPIs) {\n let pubApiPath = pubApi.split(path.sep);\n let sharedPath = path.join(...pubApiPath.slice(pubApiPath.length - 4));\n let matchingBranchFile;\n for (let branchApi of branchAPIs) {\n if (branchApi.includes(sharedPath)) {\n matchingBranchFile = branchApi;\n pairs.push({pubApi, branchApi});\n break;\n }\n }\n if (!matchingBranchFile) {\n summaryMessages.push({msg: `removed module ${pubApi}`, severity: 'error'});\n }\n }\n for (let branchApi of branchAPIs) {\n let branchApiPath = branchApi.split(path.sep);\n let sharedPath = path.join(...branchApiPath.slice(branchApiPath.length - 4));\n let matchingPubFile;\n for (let pubApi of publishedAPIs) {\n if (pubApi.includes(sharedPath)) {\n matchingPubFile = pubApi;\n // don't re-add to pairs\n break;\n }\n }\n if (!matchingPubFile) {\n summaryMessages.push({msg: `added module ${branchApi}`, severity: 'warn'});\n }\n }\n\n let count = 0;\n for (let pair of pairs) {\n console.log(`comparing ${pair.branchApi.replace(/.*branch-api/, '')}`);\n let publishedApi = fs.readJsonSync(pair.pubApi);\n delete publishedApi.links;\n walkObject(publishedApi, ({value, location, isLeaf}) => {\n if (!isLeaf && value.id && typeof value.id === 'string') {\n value.id = value.id.replace(/.*(node_modules|packages)/, '');\n }\n });\n let branchApi = fs.readJsonSync(pair.branchApi);\n delete branchApi.links;\n walkObject(branchApi, ({value, location, isLeaf}) => {\n if (!isLeaf && value.id && typeof value.id === 'string') {\n value.id = value.id.replace(/.*(node_modules|packages)/, '');\n }\n });\n let diff = changesets.diff(publishedApi, branchApi);\n if (diff.length > 0) {\n count += 1;\n console.log(util.inspect(diff, {depth: null}));\n }\n\n let publishedExports = publishedApi.exports;\n let branchExports = branchApi.exports;\n let addedExports = Object.keys(branchExports).filter(key => !publishedExports[key]);\n let removedExports = Object.keys(publishedExports).filter(key => !branchExports[key]);\n if (addedExports.length > 0) {\n summaryMessages.push({msg: `added exports ${addedExports} to ${pair.branchApi}`, severity: 'warn'});\n }\n if (removedExports.length > 0) {\n summaryMessages.push({msg: `removed exports ${removedExports} from ${pair.branchApi}`, severity: 'error'});\n }\n }\n summaryMessages.forEach(({msg, severity}) => {\n console[severity](chalk[severity === 'warn' ? 'yellow' : 'red'](msg));\n });\n let modulesAdded = branchAPIs.length - publishedAPIs.length;\n if (modulesAdded !== 0) {\n console.log(chalk[modulesAdded > 0 ? 'yellow' : 'red'](`${Math.abs(modulesAdded)} modules ${modulesAdded > 0 ? 'added' : 'removed'}`));\n } else {\n console.log(chalk.green('no modules removed or added'));\n }\n if (count !== 0) {\n console.log(chalk.yellow(`${count} modules had changes to their API`));\n } else {\n console.log(chalk.green('no modules changed their API'));\n }\n}", "function run () {\n // get category folders and functions\n var fcns = {};\n var mainpath = './../';\n var folders = fs.readdirSync(mainpath + 'lib','utf8');\n\n for (var i = 0;i < folders.length; i++) {\n\n if (folders[i].lastIndexOf('.js') === -1) {\n\n var files = fs.readdirSync(mainpath + 'lib/' + folders[i],'utf8');\n var outpath = mainpath + 'doc/' + folders[i];\n mkdirp(outpath, function(err) {\n if (err) console.log(err) \n });\n\n for (var j = 0;j < files.length; j++) {\n // generate doc\n var fundoc = gendoc(files[j],folders[i]);\n\n // generaye markdown\n var funmd = genmd(fundoc);\n\n // generate test\n gentest(fundoc);\n name = fundoc.name;\n fcns[name] = {\n name: name,\n category: fundoc.category,\n link: '/' + folders[i] + '/' + name + '.md',\n summary: fundoc.summary,\n md: funmd\n }\n try {\n fs.writeFileSync(outpath + '/' + name + '.md',funmd);\n } catch (err) {\n console.log(err)\n }\n }\n }\n }\n\n // set categories\n var catgs = {};\n for (var k in fcns) {\n var fn = fcns[k];\n var categ = catgs[fn.category];\n if (!categ) {\n catgs[fn.category] = {};\n }\n catgs[fn.category][k] = fcns[k];\n }\n \n // create CONTENTS.md for Markdown docs\n function categmd(catgs) {\n var categorical = \"## Contents\\n\\n\";\n categorical += Object.keys(catgs).sort().map(function(a) {\n var fn = catgs[a];\n return '### ' + a + '\\n\\n' +\n Object.keys(fn).sort().map(function(b) {\n return '- [' + fn[b].name + '](/doc' + fn[b].link + ')' + ' - ' + fn[b].summary;\n }).join('\\n') + '\\n';\n }).join('\\n');\n fs.writeFileSync(mainpath + 'doc/contents.md',categorical);\n }\n \n // create CONTENTS.md for HTML docs\n // ex. - [isarray](/doc/apiref.html#-test-isarray)\n function categhtml(catgs) {\n var categorical = \"# Contents\\n\\n\";\n categorical += Object.keys(catgs).sort().map(function(a) {\n var fn = catgs[a];\n return '## ' + a + '\\n\\n' +\n Object.keys(fn).sort().map(function(b) {\n var labcat = fn[b].category.toLowerCase().replace(/ /g,'-');\n return '- [' + fn[b].name + '](/doc/apidoc.html#-' + labcat + '-' + fn[b].name + ')' + ' - ' + fn[b].summary;\n }).join('\\n') + '\\n';\n }).join('\\n');\n fs.writeFileSync('../../maxto.github.io/doc/contentshtml.md',categorical);\n }\n \n // create APIDOC.md\n function apidoc(catgs) {\n var categorical = '';\n categorical += Object.keys(catgs).sort().map(function(a) {\n var fn = catgs[a];\n return '## ' + a + '\\n\\n' +\n Object.keys(fn).sort().map(function(b) {\n return fn[b].md;\n }).join('\\n') + '\\n';\n }).join('\\n');\n fs.writeFileSync('../../maxto.github.io/doc/apidochtml.md',categorical);\n }\n\n\n // build\n categmd(catgs);\n categhtml(catgs);\n apidoc(catgs);\n\n}", "function splitDependencies() {\n return project.dependencies().pipe(project.splitHtml());\n}", "async function mergePackageJsons() {\n // transform our package.json so we can replace variables\n const rawJson = await template.generate({\n directory: `${ignite.ignitePluginPath()}/boilerplate`,\n template: \"package.json.ejs\",\n props: { ...templateProps, kebabName: strings.kebabCase(templateProps.name) },\n })\n const newPackageJson = JSON.parse(rawJson)\n\n // read in the react-native created package.json\n const currentPackage = filesystem.read(\"package.json\", \"json\")\n\n // deep merge, lol\n const newPackage = pipe(\n assoc(\"dependencies\", merge(currentPackage.dependencies, newPackageJson.dependencies)),\n assoc(\n \"devDependencies\",\n merge(\n omit([\"@react-native-community/eslint-config\"], currentPackage.devDependencies),\n newPackageJson.devDependencies,\n ),\n ),\n assoc(\"scripts\", merge(currentPackage.scripts, newPackageJson.scripts)),\n merge(__, omit([\"dependencies\", \"devDependencies\", \"scripts\"], newPackageJson)),\n )(currentPackage)\n\n // write this out\n filesystem.write(\"package.json\", newPackage, { jsonIndent: 2 })\n }", "_fetchModules(){\n var directories = fs.readdirSync('./features/');\n for (let directory of directories){\n if (!directory.includes('.')) { //means is a directory\n this._requireModules('./features/' + directory, directory);\n }\n }\n }", "async function mergePackageJsons () {\n const rawJson = await template.generate({\n directory: `${PLUGIN_PATH}/boilerplate/src`,\n template: 'package.json.ejs',\n props: {}\n })\n\n\n const newPackageJson = JSON.parse(rawJson)\n const currentPackage = filesystem.read('package.json', 'json')\n\n // deep merge, lol\n const newPackage = pipe(\n assoc(\n 'dependencies',\n merge(currentPackage.dependencies, newPackageJson.dependencies)\n ),\n assoc(\n 'devDependencies',\n merge(currentPackage.devDependencies, newPackageJson.devDependencies)\n ),\n assoc('scripts', merge(currentPackage.scripts, newPackageJson.scripts)),\n merge(\n __,\n omit(['dependencies', 'devDependencies', 'scripts'], newPackageJson)\n )\n )(currentPackage)\n\n // write this out\n filesystem.write('package.json', newPackage, {jsonIndent: 2})\n }", "workspaceXdependencies(params = {}, span = new opentracing_1.Span()) {\n // Ensure package.json files\n return this.projectManager.ensureModuleStructure()\n .concat(rxjs_1.Observable.defer(() => util_1.observableFromIterable(this.inMemoryFileSystem.uris())))\n .filter(uri => uri.includes('/package.json') && !uri.includes('/node_modules/'))\n .mergeMap(uri => this.packageManager.getPackageJson(uri))\n .mergeMap(packageJson => rxjs_1.Observable.from(packages_1.DEPENDENCY_KEYS)\n .filter(key => !!packageJson[key])\n .mergeMap(key => lodash_2.toPairs(packageJson[key]))\n .map(([name, version]) => ({\n attributes: {\n name,\n version,\n },\n hints: {\n dependeePackageName: packageJson.name,\n },\n })))\n .map((dependency) => ({ op: 'add', path: '/-', value: dependency }))\n .startWith({ op: 'add', path: '', value: [] });\n }", "function processDependencies(dependencies, components, exclude) {\n Object.keys(dependencies).forEach(function(key) {\n grunt.log.debug(\"Obtaining package version for \" + key);\n\n var dependency = dependencies[key];\n var pkgMeta = dependency.pkgMeta;\n\n if(exclude.indexOf(pkgMeta.name) > -1) {\n grunt.log.ok('Excluding component: ' + pkgMeta.name);\n return;\n }\n\n var componentData = {};\n componentData['version'] = pkgMeta.version;\n componentData['directory'] = dependency.canonicalDir;\n components[pkgMeta.name] = componentData;\n\n grunt.log.debug(key + \" - version: \" + componentData['version'] + \" directory: \" + componentData['directory']);\n\n processDependencies(dependency.dependencies, components, exclude);\n });\n }", "function aggregateModules(dir, pkgs, callback) {\n var dep = pkgs.dependencies,\n mod,\n data = [],\n size = 0,\n counter = 0,\n pkg = {};\n Object.keys(dep).forEach(function (key) {\n size++;\n var modPath = path.join(dir, 'node_modules', key, 'package.json');\n fs.exists(modPath, function (exists) {\n counter++;\n if (exists) {\n pkg = {};\n mod = require(modPath);\n pkg.name = mod.name;\n pkg.version = mod.version;\n data.push(pkg);\n }\n if (counter === size) {\n aggregatedModules = data;\n callback(null, data);\n }\n });\n\n });\n\n}", "function checkDependencies() {\n console.log('Reading package.json'.green);\n fs.readFile('./package.json', (err, data) => {\n const pkgJson = JSON.parse(data);\n for (let dependency in pkgJson.dependencies) {\n // console.log(dependency);\n for (let package of packages) {\n if (dependency === package) {\n\n let index = packages.indexOf(package);\n console.log(index, dependency + ' already exist! '.yellow);\n packages.splice(index, 1);\n }\n }\n }\n // console.log(packages.length);\n if (packages.length == 0) {\n console.log('All dependencies are already exist skipping installation process!'.rainbow);\n updateAngularJson();\n } else {\n installDependencies();\n }\n });\n\n\n}", "outputDependencyGraphs(dependencyGraphs) {\n for (let i = 0; i < _constants_1.ALL_BOOT_STAGES.length; i++) {\n let stage = _constants_1.ALL_BOOT_STAGES[i];\n let oneGraph = dependencyGraphs[stage];\n if (oneGraph) {\n console.log(\"\\tStage:\", stage);\n for (let nodeName in oneGraph.graph.nodes) {\n console.log(\"\\t\\tName:\", nodeName);\n for (let j = 0; j < oneGraph.graph.nodes[nodeName].dependencies.length; j++) {\n console.log(\"\\t\\t\\tDependency:\", oneGraph.graph.nodes[nodeName].dependencies[j]);\n }\n }\n }\n }\n }", "function combine() {\n utils.richlog(`vendor modules to combine: `, utils.LOGTYPE.INFO)\n console.log(entry)\n\n for (let entry_name in entry) {\n let code = {}\n let temp = [].concat(entry[entry_name])\n\n temp.forEach(function (v) {\n let module_path = '',\n mini = {}\n\n try {\n if (DOT_RE.test(v)) { // for vendor modules under src/vendor\n module_path = path.resolve(rootPath, v)\n } else { // for vendor modules under node_modules\n module_path = handleNodeMudulesPath(v)\n }\n\n mini = handleMini(module_path)\n code[mini.suffix] = (code[mini.suffix] || '') + mini.code\n } catch (err) {\n utils.log(`cannot find vendor: `, `${v}`, 'red')\n }\n\n })\n\n for (let entry_type in code) {\n mkdirSync(outputPath, function () {\n let file = path.join(outputPath, entry_name + '.' + entry_type)\n utils.richlog(`generated compressed vendor file: ${file}`, utils.LOGTYPE.SUCCESSFUL)\n fs.writeFileSync(file, code[entry_type])\n })\n }\n }\n}", "function initdependencies(){\n process.spawnSync('npm',['install', '--save', 'express'], { cwd: './' });\n process.spawnSync('npm',['install', '--save', 'helmet'], { cwd: './' });\n}", "function generateChangeLog(options) {\n const currentHash = getHash( options.headRev );\n const previousHash = getHash( options.rev );\n getPackageNames(options).then(names => {\n return Promise\n .all(names\n .slice(0, options.limit)\n .map(name => buildPackageInfo(name, currentHash, previousHash, options))\n .filter(p => !!p))\n })\n .then(repos => { return {repos}; })\n .then(data => render(data, options.format))\n .then(view => output(view, options))\n .catch(console.log);\n}", "loadDependencies(){\n\n }", "function modules() {\n // Bootstrap JS \n var bootstrapJS = gulp.src('./node_modules/startbootstrap-sb-admin-2/vendor/bootstrap/js/*')\n .pipe(gulp.dest(paths.vendor + '/bootstrap/js'));\n\n // Bootstrap Select\n var bootstrapSelectJS = gulp.src('./node_modules/bootstrap-select/dist/js/*')\n .pipe(gulp.dest(paths.vendor + '/bootstrap-select/js'));\n var bootstrapSelectCSS = gulp.src('./node_modules/bootstrap-select/dist/css/*')\n .pipe(gulp.dest(paths.vendor + '/bootstrap-select/css'));\n\n // Bokeh\n var bokehJS = gulp.src('./node_modules/@bokeh/bokehjs/build/js/bokeh.min.js')\n .pipe(gulp.dest(paths.vendor + '/bokehjs'));\n\n // SB Admin 2 Bootstrap template\n var bootstrapSbAdmin2 = gulp.src([\n './node_modules/startbootstrap-sb-admin-2/js/*.js',\n './node_modules/startbootstrap-sb-admin-2/css/*.css'\n ]).pipe(gulp.dest(paths.vendor + '/startbootstrap-sb-admin-2'));\n\n // Bootstrap4 toggle\n var bootstrap4toggle = gulp.src([\n './node_modules/bootstrap4-toggle/js/*.js',\n './node_modules/bootstrap4-toggle/css/*.css'\n ]).pipe(gulp.dest(paths.vendor + '/bootstrap4-toggle'));\n\n // dataTables\n var dataTables = gulp.src([\n './node_modules/datatables.net/js/*.js',\n './node_modules/datatables.net-bs4/js/*.js',\n './node_modules/datatables.net-bs4/css/*.css'\n ])\n .pipe(gulp.dest(paths.vendor + '/datatables'));\n\n // dataTables-buttons\n var dataTablesButtons = gulp.src([\n './node_modules/datatables.net-buttons/js/*.js',\n './node_modules/datatables.net-buttons-bs4/js/*.js',\n './node_modules/datatables.net-buttons-bs4/css/*.css'\n ])\n .pipe(gulp.dest(paths.vendor + '/datatables-buttons'));\n\n // Font Awesome\n var fontAwesome = gulp.src('./node_modules/@fortawesome/**/*')\n .pipe(gulp.dest(paths.vendor + ''));\n\n // jQuery Easing\n var jqueryEasing = gulp.src('./node_modules/jquery.easing/*.js')\n .pipe(gulp.dest(paths.vendor + '/jquery-easing'));\n\n // jQuery\n var jquery = gulp.src([\n './node_modules/jquery/dist/*',\n '!./node_modules/jquery/dist/core.js'\n ])\n .pipe(gulp.dest(paths.vendor + '/jquery'));\n\n // jszip\n var jszip = gulp.src([\n './node_modules/jszip/dist/*.js',\n ])\n .pipe(gulp.dest(paths.vendor + '/jszip'));\n\n // d3 celestial\n var d3Celestial = gulp.src([\n './node_modules/d3-celestial/celestial*.js',\n './node_modules/d3-celestial/lib/d3*.js'\n ])\n .pipe(gulp.dest(paths.vendor + '/d3-celestial'));\n var d3CelestialData = gulp.src('./node_modules/d3-celestial/data/*.json')\n .pipe(gulp.dest(paths.vendor + '/d3-celestial/data'));\n var d3CelestialImage = gulp.src('./node_modules/d3-celestial/images/*')\n .pipe(gulp.dest(paths.cssDir + '/images'));\n\n // particles.js\n var particlesJs = gulp.src('./node_modules/particles.js/particles.js')\n .pipe(gulp.dest(paths.vendor + '/particles.js'));\n\n // PrismJs\n var prismJs = gulp.src('./node_modules/prismjs/prism.js')\n .pipe(gulp.dest(paths.vendor + '/prismjs'));\n var prismJsYaml = gulp.src('./node_modules/prismjs/components/prism-yaml.min.js')\n .pipe(gulp.dest(paths.vendor + '/prismjs'));\n var prismJsLineNum = gulp.src('./node_modules/prismjs/plugins/line-numbers/prism-line-numbers.min.js')\n .pipe(gulp.dest(paths.vendor + '/prismjs/line-numbers'));\n var prismJsCss = gulp.src('./node_modules/prismjs/themes/prism.css')\n .pipe(gulp.dest(paths.vendor + '/prismjs'));\n var prismJsLineNumCss = gulp.src('./node_modules/prismjs/plugins/line-numbers/prism-line-numbers.css')\n .pipe(gulp.dest(paths.vendor + '/prismjs/line-numbers'));\n\n return merge(bootstrapJS, bootstrapSbAdmin2, bootstrap4toggle, bokehJS, dataTables, dataTablesButtons, fontAwesome, jquery, jqueryEasing, jszip, d3Celestial, d3CelestialData, d3CelestialImage, particlesJs, prismJs, prismJsYaml, prismJsLineNum, prismJsCss, prismJsLineNumCss);\n}", "function buildApp(){\n var idAlias={};\n //idAlias[__dirname + \"/node_modules/react/react.js\"] = \"react\";\n idAlias[__dirname + \"/src/js/vendor/react-v0.12.2.min.js\"] = \"react\";\n idAlias[__dirname + \"/src/js/vendor/jquery.js\"] = \"jquery\";\n\n /**\n * We want to expose our core modules so they can be referenced via 'core/modulename' instead of './js/core/modulename'\n * We also want to alias some of the third party libs, and expose them so they can be referenced via 'jquery', 'react', etc.\n */\n //var labeler = through.obj(function (module, enc, next) {\n // console.log('module id: ' + module.id);\n // //expose id as 'react' rather than 'nodemodules/react/react.js'\n // if(idAlias[module.id]){\n // module.id = idAlias[module.id];\n // //console.log('exposing new id: ' + module.id);\n // }\n //\n // //iterate over each dependency of the module\n // Object.keys(module.deps).forEach(function (key) {\n // console.log('dep: %s key: %s', module.deps[key], key);\n // //expose core by 'core/X' rather than './js/core/X'\n // // if(key.indexOf('js/') >= 0) //only expose/tinker with core\n // module.deps[key] = key;\n //\n // //if there's a dep on something we've aliased, point to the alias.\n // //e.g. instead of 'react':'some/really/long/path/react.js' do 'react':'react'\n // if(idAlias[module.deps[key]]){\n // //console.log('pointing to alias for key:' + key);\n // module.deps[key] = key;\n // }\n // });\n //\n // this.push(module);\n // next();\n //});\n\n\n\n\n function getAppFilePaths(){\n //var files =glob.sync(\"core/**/*.js*\", { //./src/js/\n // cwd: buildConfig.jsBaseDir\n //});\n //files = _.filter(files, function(filePath){\n // return filePath.indexOf('vendor/') < 0;\n //});\n var files = [];\n files.push(\"app2\");\n\n var withoutExtensions=[];\n files.forEach(function(file){\n withoutExtensions.push(file.replace('.jsx', '').replace('.js', ''));\n });\n\n console.log('app file paths:\\n ' + JSON.stringify(withoutExtensions, null, 4));\n return withoutExtensions;\n }\n //mixin some of the common transforms, paths, etc.\n var browserifyConfig = mixinCommonBrowserifyConfig({\n entries:[].concat(getAppFilePaths())\n });\n console.log('build:app browserify config: %s', JSON.stringify(browserifyConfig, null, 2));\n\n var bundler = browserify(browserifyConfig);\n\n // bundler.pipeline.get('label').splice(0, 1, labeler);//rename module ids\n\n //require any third party libraries.\n bundler.require(buildConfig.jsBaseDir + '/vendor/jquery.js', {expose:'jquery'}); //expose is how the modules require it. e.g. require('jquery');\n bundler.require(buildConfig.jsBaseDir + '/vendor/react-v0.12.2.min.js', {expose:'react'});\n\n return bundler\n .bundle()\n .pipe(source('bundle.js'))//the generated file name\n //.pipe(gStreamify(uglify(buildConfig.uglify)))\n .pipe(gulp.dest(buildConfig.jsDistDir));//where to put the generated file name\n}", "constructor(){\n\t\t// Listed in order of activation\n\t\tconst packageNames = [\n\t\t\t\"nuclide\",\n\t\t\t\"tree-view\",\n\t\t\t\"tabs\",\n\t\t\t\"fuzzy-finder\",\n\t\t\t\"find-and-replace\",\n\t\t\t\"archive-view\"\n\t\t];\n\t\t\n\t\tthis.consumers = [];\n\t\tfor(const name of packageNames)\n\t\t\tif(this.needsPatch(name)){\n\t\t\t\tthis.consumers.push(require(`./${name}.js`));\n\t\t\t}\n\t}", "async function buildAll() {\n for (const { package, folder } of metadata) {\n await buildSinglePackage(package, folder);\n }\n\n console.log('All packages have been built and copied to \"node_modules\" successfully');\n}", "_updatePackage() {\n let dest = this.destinationPath('package.json');\n let template = this.templatePath('dependencies.stub');\n let pkg = program.helpers.readJson(this, dest);\n\n let deps = JSON.parse(program.helpers.readTpl(this, template, {\n relationalDB: program.helpers.isRelationalDB(this.answers.database),\n answers: this.answers\n }));\n\n pkg.dependencies = Object.assign(pkg.dependencies, deps);\n this.fs.writeJSON(dest, pkg);\n }", "function createTasks(moduleName) {\n\n var modulePath = moduleName,\n buildDir = config.pathToBuildDir,\n devDir = config.pathToDevDir,\n min = config.minification,\n watch = config.watching;\n\n\n moduleName === 'global' ? modulePath = '../' : null\n\n var gSrc = devDir + '/modules/' + moduleName,\n gDest = buildDir + '/modules/' + modulePath ;\n\n\n\n gulp.task(moduleName + ':js', js);\n gulp.task(moduleName + ':styles', styles);\n gulp.task(moduleName + ':assets', assets);\n gulp.task(moduleName + ':vendor', vendor);\n gulp.task(moduleName + ':installDep', installDep); \n\n \n gulp.task(moduleName, function() { \n gulp.run(moduleName + ':vendor'); \n gulp.run(moduleName + ':js');\n gulp.run(moduleName + ':assets');\n gulp.run(moduleName + ':styles');\n });\n\n gulp.task(moduleName + ':lib')\n\n function js() {\n var src = gSrc + '/js/**/*.js',\n dest = gDest + \"/\";\n\n gulp.src(src)\n .pipe(concat(moduleName + '.js'))\n .pipe(min ? uglify() : gulp.dest(dest))\n .pipe(gulp.dest(dest));\n\n if(watch) gulp.watch(src, function() { gulp.run(moduleName + ':js'); });\n }\n\n function styles() {\n var src = gSrc + '/includes.less',\n dest = gDest + \"/\";\n\n gulp.src(src)\n .pipe(less()).on('error', errorLog)\n .pipe(concat(moduleName + '.css'))\n .pipe(min ? csso() : gulp.dest(dest))\n .pipe(gulp.dest(dest))\n\n\n if(watch) gulp.watch(src, function() { gulp.run(moduleName + ':styles'); });\n }\n\n\n function assets() {\n var src = gSrc + '/assets/**/',\n dest = gDest + \"/\";\n\n gulp.src(src + \"!(*.html)\")\n .pipe(gulp.dest(dest));\n\n gulp.src(src + \"*.html\")\n .pipe(global['html-tag-include']()).on('error', errorLog)\n .pipe(gulp.dest(dest));\n\n if(watch) gulp.watch(src + \"*.html\", function() { gulp.run(moduleName + ':assets'); });\n }\n\n \n\n function vendor() {\n\n var jsStatic = gSrc + '/lib/**/*.js',\n cssStatic = gSrc + '/lib/**/*.css',\n cssJsDest = gDest + '/vendor',\n fonts = gDest + '/fonts';\n\n var srcJs = mainBowerFiles('/**/*.js'),\n srcCss = mainBowerFiles('/**/*.css');\n\n srcJs.push(jsStatic);\n srcCss.push(cssStatic);\n\n gulp.src(srcJs)\n .pipe(concat(moduleName + '.vendor.js'))\n .pipe(min ? uglify() : gulp.dest(cssJsDest))\n .pipe(gulp.dest(cssJsDest));\n gulp.src(srcCss)\n .pipe(concat(moduleName + '.vendor.css'))\n .pipe(min ? csso() : gulp.dest(cssJsDest))\n .pipe(gulp.dest(cssJsDest));\n gulp.src(mainBowerFiles(/\\.eot$|\\.svg$|\\.ttf$|\\.woff$/)).pipe(gulp.dest(fonts));\n\n function mainBowerFiles(filter) {\n var bowerComp = global['main-bower-files']({\n paths: gSrc,\n filter: filter\n });\n\n return bowerComp; \n }\n }\n\n function installDep(done) {\n var options = { \n cwd: gSrc\n };\n\n child_process.exec('bower install', options);\n } \n }", "detectDynamicRequires(unit) {\n const src = `\\\nvar _sysreq = require;\n(function() {\nvar dmodules = []\nvar require = function(module) {\n dmodules.push(module)\n return _sysreq(module)\n};\n${unit.src}\nmodule.exports = dmodules;\n})()\\\n`;\n const tmpfile = unit.fpath + \".bna.js\";\n fs.writeFileSync(tmpfile, src);\n let dmodules = [];\n try {\n const _r = require; // prevent warning when fusing bna itself\n return dmodules = _.unique(_r(tmpfile));\n } catch (e) {\n return unit.warnings.push({\n node: { loc: { file: unit.fpath, line: '?' } },\n reason: 'dynamicResolveError',\n error: e\n });\n } finally {\n delete require.cache[tmpfile];\n fs.unlinkSync(tmpfile);\n return dmodules;\n }\n }", "getAllFiles() {\n return this.cache.getOrAdd('getAllFiles', () => {\n let result = [];\n let dependencies = this.dependencyGraph.getAllDependencies(this.dependencyGraphKey);\n for (let dependency of dependencies) {\n //load components by their name\n if (dependency.startsWith('component:')) {\n let comp = this.program.getComponent(dependency.replace(/$component:/, ''));\n if (comp) {\n result.push(comp.file);\n }\n }\n else {\n let file = this.program.getFile(dependency);\n if (file) {\n result.push(file);\n }\n }\n }\n this.logDebug('getAllFiles', () => result.map(x => x.pkgPath));\n return result;\n });\n }", "function _getRamBundleInfo() {\n _getRamBundleInfo = _asyncToGenerator(function*(\n entryPoint,\n pre,\n graph,\n options\n ) {\n let modules = _toConsumableArray(pre).concat(\n _toConsumableArray(graph.dependencies.values())\n );\n\n modules = modules.concat(getAppendScripts(entryPoint, modules, options));\n modules.forEach(module => options.createModuleId(module.path));\n const ramModules = modules\n .filter(isJsModule)\n .filter(options.processModuleFilter)\n .map(module => ({\n id: options.createModuleId(module.path),\n code: wrapModule(module, options),\n map: fullSourceMapObject([module], {\n excludeSource: options.excludeSource,\n processModuleFilter: options.processModuleFilter\n }),\n name: path.basename(module.path),\n sourcePath: module.path,\n source: module.getSource().toString(),\n type: nullthrows(\n module.output.find(_ref => {\n let type = _ref.type;\n return type.startsWith(\"js\");\n })\n ).type\n }));\n\n const _ref2 = yield _getRamOptions(\n entryPoint,\n {\n dev: options.dev,\n platform: options.platform\n },\n filePath => getTransitiveDependencies(filePath, graph),\n options.getTransformOptions\n ),\n preloadedModules = _ref2.preloadedModules,\n ramGroups = _ref2.ramGroups;\n\n const startupModules = [];\n const lazyModules = [];\n ramModules.forEach(module => {\n if (preloadedModules.hasOwnProperty(module.sourcePath)) {\n startupModules.push(module);\n return;\n }\n\n if (module.type.startsWith(\"js/script\")) {\n startupModules.push(module);\n return;\n }\n\n if (module.type.startsWith(\"js/module\")) {\n lazyModules.push(module);\n }\n });\n const groups = createRamBundleGroups(\n ramGroups,\n lazyModules,\n (module, dependenciesByPath) => {\n const deps = getTransitiveDependencies(module.sourcePath, graph);\n const output = new Set();\n\n for (const dependency of deps) {\n const module = dependenciesByPath.get(dependency);\n\n if (module) {\n output.add(module.id);\n }\n }\n\n return output;\n }\n );\n return {\n getDependencies: filePath => getTransitiveDependencies(filePath, graph),\n groups,\n lazyModules,\n startupModules\n };\n });\n return _getRamBundleInfo.apply(this, arguments);\n}", "function pack(files) {\n var ids = {}\n , next = 0\n\n var modules = files.map(function (file) {\n ids[file.hash] = next++\n\n var map = file.deps.map(function (dep) {\n return JSON.stringify(dep.name) + ':' + ids[dep.file.hash]\n }).join(',')\n\n return '[function(require,module,exports){\\n' +\n file.src + '\\n},{' + map + '}]'\n })\n\n var args = '[' + modules.join(',\\n') + ']'\n , js = prelude.replace(/\\(\\[\\]\\)[;\\s]*$/, function () {\n return '(' + args + ');'\n })\n\n return js\n}", "populateWorkspaceWithComponentsAndPackages() {\n this.npm.initNpm();\n this.npm.installNpmPackage('left-pad', '1.3.0');\n this.fs.createFile('utils', 'is-type.js', fixtures().isTypeLeftPad);\n this.addComponentUtilsIsType();\n this.fs.createFile('utils', 'is-string.js', fixtures().isString);\n this.addComponentUtilsIsString();\n this.createComponentBarFoo(fixtures().barFooFixture);\n this.addComponentBarFoo();\n }", "function preparePackage() {\n var ignoreFiles = ['package.json', 'README.md', 'LICENSE.md', '.gitignore', '.npmignore', '.editorconfig', 'index.js', 'index.pcss'];\n var ignoreSrcJsFiles = ['main.js', 'packages.js'];\n var copyRecursiveSync = function(src, dest) {\n var exists = fs.existsSync(src);\n var stats = exists && fs.statSync(src);\n var isDirectory = exists && stats.isDirectory();\n if (exists && isDirectory) {\n if (!fs.existsSync(dest)) {\n fs.mkdirSync(dest);\n }\n fs.readdirSync(src).forEach(function(filename) {\n copyRecursiveSync(path.join(src, filename),\n path.join(dest, filename));\n });\n } else {\n if (ignoreSrcJsFiles.indexOf(path.basename(src)) === -1) {\n fs.linkSync(src, dest);\n }\n }\n };\n var src = path.join(process.cwd(), 'src', 'js');\n if (fs.existsSync(src)) {\n fs.readdirSync(process.cwd()).forEach(function(filename) {\n var curPath = path.join(process.cwd(), filename);\n if (ignoreFiles.indexOf(path.basename(curPath)) === -1 && fs.statSync(curPath).isFile()) {\n fs.unlinkSync(curPath);\n }\n });\n copyRecursiveSync(src, process.cwd());\n }\n}", "function addModuleToPipeline(moduleID, moduleName){\n\n var module_name = ''\n var documentation = ''\n var moduleSourceCode_settings = ''\n var moduleSourceCode_main = ''\n var moduleSourceCode_html = ''\n\n $.ajax({\n type: \"POST\",\n cache: false,\n url: \"/get_module_details\",\n data: 'p_module_key=' + moduleName,\n success: function (option) {\n //alert(\"@ success\");\n module_name = option.module_name\n documentation = option.documentation\n moduleSourceCode_settings = option.moduleSourceCode_settings\n moduleSourceCode_main = option.moduleSourceCode_main\n moduleSourceCode_html = option.moduleSourceCode_html\n user_role = option.user_role\n\n user_role_based_edit = ''\n if (user_role == 'image_researcher') {\n user_role_based_edit = '| <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"btn_edit_code\"> Edit </a> | <a style=\"font-size:12px;color:#000000;\" href=\"#\" > Contact Author </a>';\n }\n\n //Parse the givn XML for tool definition\n var xmlDoc = $.parseXML( moduleSourceCode_html );\n var $xml_tool_definition = $(xmlDoc);\n\n //the tool configuration.\n //TODO: add the input port info.\n var tool_configs = $xml_tool_definition.find(\"toolConfigurations\");\n tool_configs = tool_configs.html();\n\n\n\n var tool_documentation = $xml_tool_definition.find(\"toolDocumentation\");\n tool_documentation = tool_documentation.html();\n\n\n var ioInformation = '';\n\n var $toolInput = $xml_tool_definition.find(\"toolInput\");\n\n $toolInput.each(function(){\n\n var label = $(this).find('label').text(),\n dataFormat = $(this).find('dataFormat').text(),\n referenceVariable = $(this).find('referenceVariable').text();\n\n ioInformation += '<input type=\"text\" style=\"display:none;\" class=\"setting_param module_input '+ referenceVariable + '\" ' + ' size=\"45\"/>';\n\n\n });\n\n\n var $toolOutput = $xml_tool_definition.find(\"toolOutput\");\n\n $toolOutput.each(function(){\n\n var label = $(this).find('label').text(),\n dataFormat = $(this).find('dataFormat').text(),\n referenceVariable = $(this).find('referenceVariable').text();\n\n //var thisPortOutput = 'module_id_' + moduleID + '_' + referenceVariable+'.' + dataFormat;\n //var thisPortOutputPath = referenceVariable + '=\"' + thisPortOutput + '\"';\n\n ioInformation += '<input type=\"text\" style=\"display:none;\" class=\"setting_param module_output '+ referenceVariable + '\" size=\"45\"/>';\n\n\n });\n\n\n\n\n\n\n\n//Parse the givn XML\n//var xmlDoc = $.parseXML( xml );\n\n//var $xml = $(xmlDoc);\n\n // Find Person Tag\n//var $person = $xml.find(\"toolConfigurations\");\n\n\n //append new module to the pipeline...\n $(\"#img_processing_screen\").append(\n '<div style=\"background-color:#EEE;width:100%;display:none;\" class=\"module\" id=\"module_id_'+ moduleID +'\">' +\n\n '<!-- Documentation -->' +\n '<div style=\"margin:10px;font-size:17px;color:#000000;\">' +\n ' ' + module_name + ' (Module ' + moduleID + ')'+ '<hr/>' +\n ' Documentation: <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"documentation_show_hide\">(Show/Hide)</a>' +\n '<div class=\"documentation\" style=\"background-color:#DDDDDD;display:none;font-size:14px;\">' + tool_documentation + '</div>' +\n '</div>' +\n\n\n '<!-- Settings -->' +\n '<div style=\"margin:10px;font-size:17px;color:#000000;\">' +\n ' Settings: <a style=\"font-size:12px;color:#000000;\" href=\"#\" class=\"settings_show_hide\">(Show/Hide)</a>' +\n ' <div class=\"settings\" style=\"background-color:#DDDDDD;font-size:14px;\">' + tool_configs + '<br/>' + ioInformation +\n '<input type=\"hidden\" class=\"setting_param \" size=\"45\" id=\"module_id_'+ moduleID +'_output_destination\"/>'+\n '</div>' +\n '</div>' +\n\n\n '<div style=\"margin:10px;font-size:17px;color:#000000;\" class=\"setting_section\">' +\n ' <a style=\"display:none;font-size:12px;color:#000000;\" href=\"#\" class=\"code_show_hide\">(Show/Hide)</a>' + user_role_based_edit +\n\n ' <div class=\"edit_code\" style=\"background-color:#888888;font-size:14px;display:none;\">' +\n ' <textarea rows=7 cols=150 class=\"code_settings\">' + moduleSourceCode_settings + '</textarea>' +\n ' <p style=\"color:#000000;\">Main Implementation: </p>' +\n ' <textarea rows=10 cols=150>' + moduleSourceCode_main + '</textarea>' +\n '</div>' +\n\n ' <pre style=\"background-color:#333333;width:100%;display:none;\" class=\"pre_highlighted_code\">' + '<code class=\"python highlighted_code\" style=\"display:none;\">' + moduleSourceCode_settings +\n ' ' +\n moduleSourceCode_main + '</code></pre>' +\n\n ' </div>' +\n\n '</div>'\n\n\n );//end of append\n\n\n\n\n\n\n\n\n $(\"#module_id_\"+ moduleID + \"_output_destination\").val(\"output_destination = '/home/ubuntu/Webpage/app_collaborative_sci_workflow/workflow_outputs/test_workflow/Module_\" + moduleID + \"'\").trigger('change');\n\n\n\n\n\n\n\n\n\n\n\n var listOfInputPorts = [];\n var listOfOutputPorts = [];\n\n\n\n //input port definition\n var $toolInput = $xml_tool_definition.find(\"toolInput\");\n\n $toolInput.each(function(){\n\n var label = $(this).find('label').text(),\n dataFormat = $(this).find('dataFormat').text(),\n referenceVariable = $(this).find('referenceVariable').text();\n\n //$(\"#ProfileList\" ).append('<li>' +label+ ' - ' +dataFormat+ ' - ' + idn +'</li>');\n\n var aNewInputPort = makePort(dataFormat,referenceVariable,true);\n listOfInputPorts.push(aNewInputPort);\n\n\n\n var thisPortInput = 'module_id_' + moduleID + '_NO_INPUT_SOURCE_SELECTED_.' + dataFormat;\n thisPortInput = referenceVariable + '=\"' + WORKFLOW_OUTPUTS_PATH + THIS_WORKFLOW_NAME + '/' +thisPortInput + '\"';\n\n $(\"#module_id_\"+moduleID + ' .' + referenceVariable).val(thisPortInput).trigger('change');\n\n });\n\n\n\n\n\n //output port definition\n var $toolOutput = $xml_tool_definition.find(\"toolOutput\");\n\n $toolOutput.each(function(){\n\n var label = $(this).find('label').text(),\n dataFormat = $(this).find('dataFormat').text(),\n referenceVariable = $(this).find('referenceVariable').text();\n\n //$(\"#ProfileList\" ).append('<li>' +label+ ' - ' +dataFormat+ ' - ' + idn +'</li>');\n\n var aNewOutputPort = makePort(dataFormat,referenceVariable,false);\n listOfOutputPorts.push(aNewOutputPort);\n\n\n var thisPortOutput = 'module_id_' + moduleID + '_' + referenceVariable+'.' + dataFormat;\n thisPortOutput = referenceVariable + '=\"' + WORKFLOW_OUTPUTS_PATH + THIS_WORKFLOW_NAME + '/' +thisPortOutput + '\"';\n\n $(\"#module_id_\"+moduleID + ' .' + referenceVariable).val(thisPortOutput).trigger('change');\n\n });\n\n\n\n\n\n makeTemplate(moduleName,\"images/55x55.png\", \"white\",\n listOfInputPorts,\n listOfOutputPorts);\n\n\n\n\n\n\n //Update the DAG\n //var newWorkflowModule = workflow.add(\"Module_\"+moduleID, \"Module_0\", workflow.traverseDF);\n //newWorkflowModule.nodeName = moduleName;\n //redrawWorkflowStructure();\n\n\n //alert(\"Add\");\n myDiagram.startTransaction(\"add node\");\n // have the Model add the node data\n var newnode = {\"key\":\"module_id_\" + moduleID, \"type\":moduleName, \"name\":moduleName, \"module_id\": \"Module \"+moduleID};\n myDiagram.model.addNodeData(newnode);\n // locate the node initially where the parent node is\n // diagram.findNodeForData(newnode).location = node.location;\n // and then add a link data connecting the original node with the new one\n //var newlink = { from: node.data.key, to: newnode.key };\n //diagram.model.addLinkData(newlink);\n // finish the transaction -- will automatically perform a layout\n myDiagram.commitTransaction(\"add node\");\n\n\n\n\n\n\n if(isItMyFloor() == false)lockParamsSettings();\n\n /*$('pre code').each(function (i, block) {\n hljs.highlightBlock(block);\n });*/\n\n\n },\n error: function (xhr, status, error) {\n alert(xhr.responseText);\n }\n\n });//end of ajax\n\n\n}", "function fillComponentRepository() {\n var moduleName;\n while (moduleName = finalDependencies.pop()) {\n var registeredComps = liteJSModules[moduleName].registeredComps,\n length = registeredComps.length;\n for (var i = 0; i < length; i++) {\n if (componentRepository[registeredComps[i].name]) {\n //console.error(\"duplicate component found between module..\");\n } else {\n componentRepository[registeredComps[i].name] = registeredComps[i];\n }\n }\n //key registeredComps is not required as this is already pushed to componentRepository;\n delete liteJSModules[moduleName];\n }\n }", "function buildDeps(arrDeps) {\n arrDeps.forEach(function (deps) {\n var depsId = deps, vmPath;\n\n var depsObj = map[depsId];\n if (!depsObj) {\n console.error('%s is not in map!!', depsId);\n return;\n }\n var hisDeps = depsObj['deps'] || [];\n if (hisDeps && hisDeps.length) {\n buildDeps(hisDeps);\n }\n\n var type = depsObj.type;\n var uri = depsObj.uri;\n\n switch (type) {\n case 'vm':\n\n // 检查deps中的js,添加到arrJsMod里\n // arrJsMod中只放每一个vm同名依赖的js模块,它的依赖已经打包在arrCombJs中提前加载了\n var depsIdPre = depsId.replace(/(.*?)(\\.vm)$/, '$1');\n hisDeps.map(function (item) {\n if (item === depsIdPre + '.js') {\n var modId = map[item] && map[item]['extras']['moduleId'];\n arrJsMod.push({\n moduleId: '\"' + modId + '\"',\n widgetId: deps.idf\n });\n }\n });\n\n break;\n case 'js':\n if (!~conf['arrGlobalJs'].indexOf(uri)) {\n arrCombJs.pushUnique(uri);\n }\n break;\n case 'css':\n if (!~conf['arrGlobalCss'].indexOf(uri)) {\n arrCombCss.pushUnique(uri);\n }\n break;\n default:\n break;\n } //end of switch\n }); //end of forEach\n\n }", "function createAssets(){\n assets = [];\n assets.push(path.join(__dirname, '../plug/pip_resolve.py'));\n assets.push(path.join(__dirname, '../plug/distPackage.py'));\n assets.push(path.join(__dirname, '../plug/package.py'));\n assets.push(path.join(__dirname, '../plug/reqPackage.py'));\n assets.push(path.join(__dirname, '../plug/utils.py'));\n\n assets.push(path.join(__dirname, '../plug/requirements/fragment.py'));\n assets.push(path.join(__dirname, '../plug/requirements/parser.py'));\n assets.push(path.join(__dirname, '../plug/requirements/requirement.py'));\n assets.push(path.join(__dirname, '../plug/requirements/vcs.py'));\n assets.push(path.join(__dirname, '../plug/requirements/__init__.py'));\n\n return assets;\n}", "fileDep(filepath) {\n filepath = path.resolve(filepath);\n let unit = bna._parseFile(null, filepath, {});\n var getreqs = function(unit, cache) {\n let units;\n if (unit.fpath in cache) { return cache[unit.fpath]; }\n cache[unit.fpath] = (units = []);\n units = _(units).concat(\n _((() => {\n const result = [];\n for (let { node, unit: child_unit }\n of Array.from(unit.requires)) {\n result.push(getreqs(child_unit, cache));\n }\n return result;\n })())\n .flatten());\n units.push(unit);\n return units;\n };\n\n // get all dependencies including self (filepath), deduplicated\n let units = getreqs(unit, {});\n units = _(units).unique(unit => unit.fpath);\n const warnings = _((() => {\n const result = [];\n for (unit of Array.from(units)) {\n result.push(unit.warnings);\n }\n return result;\n })()).flatten();\n const ret = {};\n for (let u of Array.from(units)) {\n if (u.package) {\n ret[u.package.name] = u.package.version;\n }\n }\n return [ret, warnings];\n }", "gatherProjectInfo() {\n const generatorTitle = `${_consts.GENERATOR_NAME} v${_package.version}`;\n this.log(_yosay(\n `Node.js Library Generator.\\n${_chalk.red(generatorTitle)} `\n ));\n return _prompts.getProjectInfo(this, true)\n .then(() => { return _prompts.getAuthorInfo(this, true); });\n }", "function devpackages () {\n opts.devpackages = makeArray(argv.dev)\n opts.files.test = true\n opts.install = true\n }", "function dependencies() {\n return project.splitDependencies()\n .pipe(project.rejoin());\n}", "function addDependenceis(project, context, allNamesBefore) {\n if (allNamesBefore === void 0) { allNamesBefore = []; }\n var newNames = [];\n if (!allNamesBefore.includes(project.name)) {\n newNames.push(project.name);\n }\n tnp_models_1.Models.npm.ArrNpmDependencyType.forEach(function (depName) {\n newNames = newNames.concat(project.getDepsAsProject(depName, context)\n .filter(function (d) { return !allNamesBefore.includes(d.name); })\n .map(function (d) { return d.name; }));\n });\n var uniq = {};\n newNames.forEach(function (name) { return uniq[name] = name; });\n newNames = Object.keys(uniq);\n var projects = newNames\n .map(function (name) {\n return abstract_1.Project.From(tnp_core_1.path.join(context, tnp_config_1.config.folder.node_modules, name));\n })\n .filter(function (f) { return !!f; });\n // console.log('projects', projects.length)\n allNamesBefore = allNamesBefore.concat(newNames);\n projects.forEach(function (dep) {\n allNamesBefore = addDependenceis(dep, context, allNamesBefore);\n });\n return allNamesBefore;\n}", "function analyse(argv) {\n if (argv.debug) {\n Debug.enable('analyse:*');\n }\n debug('Args:', argv);\n const nodeModules = getNodeModules(argv.path);\n const filePathes = getFiles(argv.path, argv.ignoreDir || []);\n // debug(filePathes);\n const regexp = /require\\(([^)]*)\\)/gi;\n filePathes.forEach(({path: filePath})=>{\n const data = fs.readFileSync(filePath, 'utf8');\n (data.match(regexp) || []).forEach(req => {\n const required = req.substr(9, req.length - 11);\n if (nodeModules.includes(required)) {\n return;\n }\n const possiblePathes = getPossiblePathes(required, filePath, argv.node_path);\n possiblePathes.forEach(possiblePath=>{\n const found = filePathes.find(({path: filePath2})=> filePath2 === possiblePath);\n if (found) {\n if (!found.used) {\n found.used = 1;\n } else {\n found.used++;\n }\n }\n });\n });\n });\n const ignoreFiles = argv.ignoreFileName || [];\n const nonUsed = filePathes\n .filter(({used, path: filePath2})=>!used && !ignoreFiles.some(ignoreFile=>filePath2.includes(ignoreFile)))\n .map(({path: filePath2})=>filePath2);\n // eslint-disable-next-line no-console\n console.log(`\\n\\nNon used files (${nonUsed.length}):\\n\\n${nonUsed.join('\\n')}`);\n const mostUsed = filePathes\n .filter(({used, path: filePath2})=>used && !ignoreFiles.some(ignoreFile=>filePath2.includes(ignoreFile)))\n .sort((a, b)=>b.used - a.used)\n .map(el=>({used: el.used, path: el.path}))\n .slice(0, 20);\n // eslint-disable-next-line no-console\n console.log('\\n\\nMost used files:');\n // eslint-disable-next-line no-console\n console.log(mostUsed.map(el=>`${el.path} ${el.used}`).join('\\n'));\n}", "function dependOn() {\n 'use strict';\n return [\n require(\"util\"),\n require(\"common\"),\n require(\"analytics\"),\n require(\"proxy\")\n ];\n}", "function mergeFilesFromRepoA() {\n\n /**\n * Simple routine to copy files in js\n * @param {string} srcFile path for source file\n * @param {string} destFile path for destination file\n * @return {object} reference to the created file\n */\n var copyFile = function(srcFile, destFile) {\n console.log('copying ' + srcFile + ' into ' + destFile);\n var BUF_LENGTH, buff, bytesRead, fdr, fdw, pos;\n BUF_LENGTH = 64 * 1024;\n buff = ''; // new Buffer(BUF_LENGTH);\n fdr = fs.readFileSync(srcFile);\n fdw = fs.writeFileSync(destFile, fdr);\n return fdw;\n };\n\n\n\n /**\n * Our simple merge business logic simply copies all files from following folders into our project\n */\n\n var toBeCopied = ['controllers', 'styles', 'views', 'lib'];\n\n for (var i = 0; i < toBeCopied.length; i++) {\n var folder = toBeCopied[i];\n\n\n var dir = path.join(repoA, 'app', folder);\n // logger.info('copying files from ' + dir);\n var files = fs.readdirSync(dir);\n for (var j = files.length - 1; j >= 0; j--) {\n\n\n var file = path.join(dir, files[j]);\n // logger.info('file ' + file);\n var source = file;\n var destination = path.join('./app', folder, files[j]);\n copyFile(source, destination);\n }\n };\n\n \n\n\n\n console.log('RepoA copied!');\n }", "function log(err, pkg, tree) {\n var list\n ;\n\n if (err) {\n throw err;\n }\n\n // puts the list in the correct order\n list = reduceTree(tree);\n // pop off the bottom (this local package)\n list.pop();\n\n installAll(list);\n }", "function tailorModule() {\n\tif (!options.environment) {\n\t\tthrow new Error(\"no environment for tailoring specified.\");\n\t}\n\n\t// locate dependency module and get all files in module folder\n\tconst dependencyLocation = locateDependencyModule();\n\tconst allFiles = scanFolder(dependencyLocation);\n\tdebug(`files found: ${allFiles.join(\"\\n \")}`);\n\n\t// identify files to be deleted\n\tconst filesToDelete = allFiles.filter(fn => options.environment.deleteFilePredicate(fn));\n\n\tconsole.log(`\\nTailoring npm module for environment '${options.environment.name}'`);\n\n\tif (options.dryRun) {\n\t\tconsole.log(\"Dry run - following files will be deleted from npm module\");\n\t\tfilesToDelete.forEach((fn) => {\n\t\t\t// check file access rights\n\t\t\tfs.accessSync(fn, fs.F_OK | fs.R_OK | fs.W_OK);\n\t\t\tconsole.log(` ${fn}`);\n\t\t});\n\t\tconsole.log();\n\t}\n\telse {\n\t\t// set undefined state\n\t\twriteStateFile(cStateUndefined);\n\t\tfilesToDelete.forEach((fn) => {\n\t\t\tconsole.log(` deleting file '${fn}'`);\n\t\t\tfs.unlinkSync(fn);\n\t\t});\n\t\twriteStateFile(options.environment.name);\n\t}\n}", "function modules() {\n // Bootstrap JS\n let bootstrapJS = gulp.src('./node_modules/bootstrap/dist/js/*').pipe(gulp.dest('./libs/bootstrap/js'))\n\n // Font Awesome CSS\n let fontAwesomeCSS = gulp.src('./node_modules/@fortawesome/fontawesome-free/css/**/*')\n .pipe(gulp.dest('./libs/fontawesome-free/css'))\n\n // Font Awesome Webfonts\n let fontAwesomeWebfonts = gulp.src('./node_modules/@fortawesome/fontawesome-free/webfonts/**/*')\n .pipe(gulp.dest('./libs/fontawesome-free/webfonts'))\n\n // Jquery Easing\n let jqueryEasing = gulp.src('./node_modules/jquery-easing/*.js')\n .pipe(gulp.dest('./libs/jquery-easing'))\n\n // JQuery\n let jquery = gulp.src([\n './node_modules/jquery/dist/*',\n '!./node_modules/jquery/dist/core.js'\n ]).pipe(gulp.dest('./libs/jquery'))\n\n return merge(bootstrapJS, fontAwesomeCSS, fontAwesomeWebfonts, jquery, jqueryEasing)\n}", "make_modules() {\n let s = ``\n for (var id in se.mods) {\n if (!se.mods[id].api) continue\n s += `const ${id} = se.mods['${id}'].api[self.id]`\n s += '\\n'\n }\n return s\n }", "async populateFlattenedDependencies() {\n _logger().default.debug(`populateFlattenedDependencies starts with ${this.components.length} components`);\n\n this.createGraphs(this.components);\n await this.importExternalDependenciesInBulk();\n await (0, _pMapSeries().default)(this.components, async component => {\n component.flattenedDependencies = await this.getFlattened(component.id);\n });\n }", "async function compare() {\n let branchDir = path.join(__dirname, '..', 'dist', 'branch-api');\n let publishedDir = path.join(__dirname, '..', 'dist', 'published-api');\n if (!(fs.existsSync(branchDir) && fs.existsSync(publishedDir))) {\n console.log(chalk.redBright(`you must have both a branchDir ${branchDir} and publishedDir ${publishedDir}`));\n return;\n }\n let summaryMessages = [];\n\n let branchAPIs = fg.sync(`${branchDir}/**/api.json`);\n let publishedAPIs = fg.sync(`${publishedDir}/**/api.json`);\n let pairs = [];\n // we only care about changes to already published APIs, so find all matching pairs based on what's been published\n for (let pubApi of publishedAPIs) {\n let pubApiPath = pubApi.split(path.sep);\n let sharedPath = path.join(...pubApiPath.slice(pubApiPath.length - 4));\n let matchingBranchFile;\n for (let branchApi of branchAPIs) {\n if (branchApi.includes(sharedPath)) {\n matchingBranchFile = branchApi;\n pairs.push({pubApi, branchApi});\n break;\n }\n }\n if (!matchingBranchFile) {\n summaryMessages.push({msg: `removed module ${pubApi}`, severity: 'error'});\n }\n }\n let privatePackages = [];\n // don't care about not private APIs, but we do care if we're about to publish a new one\n for (let branchApi of branchAPIs) {\n let branchApiPath = branchApi.split(path.sep);\n let sharedPath = path.join(...branchApiPath.slice(branchApiPath.length - 4));\n let matchingPubFile;\n for (let pubApi of publishedAPIs) {\n if (pubApi.includes(sharedPath)) {\n matchingPubFile = pubApi;\n // don't re-add to pairs\n break;\n }\n }\n if (!matchingPubFile) {\n let json = JSON.parse(fs.readFileSync(path.join(branchApi, '..', '..', 'package.json')), 'utf8');\n if (!json.private) {\n summaryMessages.push({msg: `added module ${branchApi}`, severity: 'warn'});\n } else {\n privatePackages.push(branchApi);\n }\n }\n }\n\n let count = 0;\n let diffs = {};\n for (let pair of pairs) {\n let diff = getDiff(summaryMessages, pair);\n if (diff.diff.length > 0) {\n count += 1;\n diffs[diff.name] = diff.diff;\n }\n }\n let modulesAdded = branchAPIs.length - privatePackages.length - publishedAPIs.length;\n if (modulesAdded !== 0) {\n summaryMessages.push({msg: `${Math.abs(modulesAdded)} modules ${modulesAdded > 0 ? 'added' : 'removed'}`, severity: modulesAdded > 0 ? 'warn' : 'error'});\n } else {\n summaryMessages.push({msg: 'no modules removed or added', severity: 'info'});\n }\n if (count !== 0) {\n summaryMessages.push({msg: `${count} modules had changes to their API ${Object.keys(diffs).map(key => `\\n - ${simplifyModuleName(key)}`)}`, severity: 'warn'});\n } else {\n summaryMessages.push({msg: 'no modules changed their API', severity: 'info'});\n }\n summaryMessages.push({});\n let matches = analyzeDiffs(diffs);\n let moreMessages = generateMessages(matches);\n [...summaryMessages, ...moreMessages].forEach(({msg, severity}) => {\n if (!msg) {\n console.log('');\n return;\n }\n let color = 'default';\n switch (severity) {\n case 'info':\n color = 'greenBright';\n break;\n case 'log':\n color = 'blueBright';\n break;\n case 'warn':\n color = 'yellowBright';\n break;\n case 'error':\n color = 'redBright';\n break;\n default:\n color = 'defaultBright';\n break;\n }\n console[severity](chalk[color](msg));\n });\n}", "function pub_stageModFiles(filesToStage) {\n\n\tconsole.log('Staging project files...');\n\n\texec('git add -u', function(err, stdout, stderr) {\n\n\t\tif(err) {\n\t\t\tconsole.error('ERROR', err);\n\t\t\treturn process.exit(1);\n\t\t}\n\n\t\tpub_commitModFiles(filesToStage);\n\n\t});\n\n}", "function buildPackageInfo(name, currentHash, previousHash, options) {\n if (!packageExist(name)) {\n return;\n }\n\n try {\n const currentPackageJson = loadPackage(name, currentHash);\n const previousPackageJson = loadPackage(name, previousHash);\n const repo = currentPackageJson.repository.url.match(/^.*?github\\.com\\/(.*?)\\.git$/)[1];\n\n if (previousPackageJson.gitHead === currentPackageJson.gitHead) {\n return;\n }\n \n return getCommits(repo, previousPackageJson.gitHead, currentPackageJson.gitHead, options)\n .then(commits => {\n return {\n name,\n current: currentPackageJson.gitHead,\n previous: previousPackageJson.gitHead,\n commits\n };\n });\n } catch (e) {\n // TODO: handle this\n // dependencies that were just introduced will fail\n // to get the previous revision because it didn't exist\n // console.log(e);\n }\n}", "function copyAddons(target) {\n // fs.copyFileSync(path.resolve(__dirname, '../node_modules/drivelist/build/Release/drivelist.node'), path.join(target, 'drivelist.node'))\n // fs.copyFileSync(path.resolve(__dirname, '../node_modules/drivelist/scripts/darwin.sh'), path.join(target, 'drivelist/darwin.sh'))\n // fs.copyFileSync(path.resolve(__dirname, '../node_modules/drivelist/scripts/linux.sh'), path.join(target, 'drivelist/linux.sh'))\n // fs.copyFileSync(path.resolve(__dirname, '../node_modules/drivelist/scripts/win32.bat'), path.join(target, 'drivelist/win32.bat'))\n\n fs.copyFileSync(path.resolve(__dirname, '../node_modules/nsfw/build/Release/nsfw.node'), path.join(target, 'nsfw.node'))\n fs.copyFileSync(path.resolve(__dirname, '../node_modules/find-git-repositories/build/Release/findGitRepos.node'), path.join(target, 'findGitRepos.node'))\n fs.copyFileSync(path.resolve(__dirname, '../node_modules/oniguruma/build/Release/onig_scanner.node'), path.join(target, 'onig_scanner.node'))\n }", "packageImports(nodes) {\n const 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) d.imports.forEach(function(i) {\n imports.push({source: map[d.name], target: map[i]});\n });\n });\n\n return imports;\n }", "function compileModule(filename, sourceLines, options){\n//Compile a module from source in memory\n//input:\n//* filename (for error reporting),\n//* sourceLines: LiteScript code: string array | large string | Buffer\n//* options: GeneralOptions\n\n//output:\n//* moduleNode: Grammar.Module: module's code AST root node\n\n //default filename = 'unnamed'\n if(filename===undefined) filename='unnamed';\n //options.mainModuleName = filename\n options.mainModuleName = filename;\n\n //#since \"options\" come from a external source, it can be anything\n //options = prepareOptions(options)\n options = prepareOptions(options);\n\n //var project = new Project(options)\n var project = new Project(options);\n\n //var fileInfo = new Environment.FileInfo(filename)\n var fileInfo = new Environment.FileInfo(filename);\n\n //var moduleNode = project.createNewModule(fileInfo)\n var moduleNode = project.createNewModule(fileInfo);\n\n//add to module list, so WalkAllNodes includes it\n\n //project.moduleCache.set fileInfo.filename, moduleNode\n project.moduleCache.set(fileInfo.filename, moduleNode);\n\n//store result in memory\n\n //moduleNode.lexer.outCode.fileMode=false\n moduleNode.lexer.outCode.fileMode = false;\n\n//parse source lines\n\n //project.parseOnModule moduleNode, filename, sourceLines\n project.parseOnModule(moduleNode, filename, sourceLines);\n\n //if no project.options.single\n if (!project.options.single) {\n \n //project.importDependencies moduleNode\n project.importDependencies(moduleNode);\n };\n\n//validate var & property names\n\n //if no project.options.skip\n if (!project.options.skip) {\n \n\n //Validate.execute\n Validate.execute();\n //if logger.errorCount is 0, logger.info \"Validation OK\"\n if (logger.errorCount === 0) {logger.info(\"Validation OK\")};\n };\n\n//initialize out buffer & produce target code\n\n //logger.msg \"Generating #{project.options.target}\"\n logger.msg(\"Generating \" + project.options.target);\n\n //project.produceModule moduleNode\n project.produceModule(moduleNode);\n //# the produced code will be at: moduleNode.lexer.out.getResult() :string array\n\n //if logger.errorCount isnt 0, logger.throwControlled \"#{logger.errorCount} errors during compilation\"\n if (logger.errorCount !== 0) {logger.throwControlled('' + logger.errorCount + \" errors during compilation\")};\n\n//text compiled result can be obtained with: moduleNode.lexer.out.getResult() :string array\n\n //return moduleNode\n return moduleNode;\n }", "async getIdsOfDepsInstalledAsPackages() {\n if (!this.options.objectsOnly) {\n // this is needed only when importing objects. we don't want these components to be written to the fs\n return [];\n }\n\n const authoredNonExportedComponentsIds = this.consumer.bitMap.getAuthoredNonExportedComponents();\n const {\n components: authoredNonExportedComponents\n } = await this.consumer.loadComponents(_bitId().BitIds.fromArray(authoredNonExportedComponentsIds), false);\n const dependencies = (0, _flatten2().default)(authoredNonExportedComponents.map(c => c.getAllDependenciesIds()));\n const missingDeps = [];\n await Promise.all(dependencies.map(async dep => {\n if (!dep.hasScope()) return;\n const isInScope = await this.scope.isComponentInScope(dep);\n if (!isInScope) missingDeps.push(dep);\n }));\n return missingDeps;\n }", "function sortAndCombineModules (deps) {\n _sorted = _sorted || _sort();\n var all = allModulesForDependencies(deps),\n urls = [], i, l, module,\n current = [], fullUrl, paths;\n \n // adds a URL for a single module to the URL list\n function commitFull (name, path) {\n fullUrl = config.base + config.prefix + config.modules[module].path;\n urls.push(fullUrl);\n _cachedURLs[module] = fullUrl;\n }\n \n // adds a combo URL for multiple modules to the URL list\n function commitCombo () {\n if (! current || ! current.length) return;\n \n paths = [];\n for (i = 0, l = current.length; i < l; i++) {\n paths.push( config.comboPrefix + config.modules[current[i]].path );\n }\n fullUrl = config.comboBase + paths.join(\"&\");\n urls.push(fullUrl);\n \n // save this combo url for all the applicable modules\n for (i = 0; i < l; i++) {\n _cachedURLs[current[i]] = fullUrl;\n }\n // clear the current combo list for the next pass\n current = [];\n }\n \n // loop through the sorted array\n for (i = -1; module = _sorted[++i]; ) {\n // but only pay attention to the needed dependencies\n if (all.indexOf(module) > -1) {\n \n // if a module has already been requested, re-add the previous URL\n // to the URL list. LABjs will take care of not re-requesting it.\n if (_cachedURLs[module]) {\n commitCombo(current);\n urls.push(_cachedURLs[module]);\n continue;\n }\n \n // this module will be loaded in a combo URL\n if (config.combine && config.modules[module].combined !== false) {\n current.push(module);\n \n // this module will be loaded separately\n } else {\n commitCombo(current);\n commitFull(module, config.modules[module].path);\n }\n \n }\n }\n \n // if we haven't add the last known combo URL to the list\n commitCombo(current);\n return uniqAndCompact(urls);\n }", "_bundleFiles(file, callback) {\n// Instantiate the jsonTransform....\n const JSONTransform = new jsonTransform()\n\n// Set up options with a transforms array....\n let transforms = [],\n opts = {\n transform: transforms\n }\n\n if (this.options.babel) {\n opts.transform.push(this._processBabel)\n }\n\n// invoke module-deps by passing in the entry point file\n let mDeps = moduleDependencies(opts),\n parser = JSONStream.parse(['file'])\n\n mDeps\n .pipe(JSONStream.stringify())\n .pipe(this._esWait())\n .on('data', (data)=> {\n// Store json data into memory....\n this.moduleDepsJSON = JSON.parse(data)\n })\n .pipe(JSONTransform)\n .pipe(browserPack( {\n prelude: this.prelude,\n preludePath: this.preludePath\n } ))\n .pipe(this._esWait())\n .on('data', (data)=> {\n let bundle\n // log('DATA', 'yellow'); log(data)\n// Tack on/ remove any additional needed code....\n if (this.options.strict) {\n if (this.options.reloading) {\n bundle = this._addHMRClientCode(data)\n } else {\n bundle = String(data)\n }\n } else {\n if (this.options.reloading) {\n bundle = this._loosyGoosy(\n this._addHMRClientCode(data)\n )\n } else {\n bundle = this._loosyGoosy(String(data))\n }\n }\n // log('BUNDLE', 'yellow');log(bundle)\n// Write the data to bundle string file....\n fs.writeFile(this.outputFile, bundle, (err)=> {\n if (err) {\n log(err, ['red', 'bold'])\n return\n }\n\n// Call the callBack....\n if (typeof callback === 'function') {\n// Call the callback....\n callback()\n// Bundle success message.....\n log(\n `🎶 ${chalk.hex('#161616').bgWhite.bold(` Mixolydian `)}${chalk.hex('#4073ff').bold(' bundle written in: ')}${chalk.hex('#fccd1b').bold(`${this.ms}ms.`)} 🎶\\n`\n )\n\n// If This is the first bundle from the initial command....\n if (this.firstBundle) {\n/// If the watch option is set....\n if (this.options.watch && this.options.mode !== 'production') {\n/// log out dev server started message....\n log(`${chalk.white.bold(`Development Server started on port ${app.get('port')}. Press Ctrl-C to terminate.`)}\n ${this.options.jc? chalk.hex('#fccd1b').bold('\\n⛪️ Jesus is King!! ⛪️') : ''}\n `)\n process.stdout.write(`\\n`)\n }\n }\n\n// Check for jc option, if present, praise Jesus Christ!\n if (this.options.jc && !this.firstBundle) {\n log(`${chalk.hex('#fccd1b').bold(`🙏 Praise the Lord! 🙏\\n`)}`)\n }\n if (this.firstBundle) {\n this.firstBundle = false\n }\n }\n })\n })\n// End the stream....\n mDeps.end({\n file: path.join(process.env.PWD, file)\n })\n }", "_chunkifyModuleTrees(trees, chunks, sourceWidth) {\n const self = this;\n\n assert.ok(_.isArray(chunks));\n assert.ok(_.isNumber(sourceWidth));\n\n let moduleCount = 0;\n\n function walk(t) {\n if (Array.isArray(t)) {\n ++moduleCount;\n chunks.push(JSON.stringify(t, null, 2));\n\n } else if (typeof t === \"string\") {\n // This case can happen if a package.json file has an\n // object-valued \"browser\" field that aliases this module to a\n // different module identifier string. Note that the runtime\n // module system resolves string aliases relative to the original\n // module identifier, so it's probably a good idea to make sure\n // these identifiers are absolute (start with a '/') to avoid\n // ambiguity, since identifiers in package.json \"browser\" fields\n // are meant to be resolved relative to the package.json file.\n ++moduleCount;\n chunks.push(JSON.stringify(t));\n\n } else if (t === false) {\n // This case can happen if a package.json file has an\n // object-valued \"browser\" field that maps this module to `false`,\n // indicating it should be replaced by an empty stub.\n ++moduleCount;\n chunks.push(\"function(){}\");\n\n } else if (t instanceof File) {\n ++moduleCount;\n\n chunks.push(t.getPrelinkedOutput({\n sourceWidth,\n }));\n\n } else if (_.isObject(t)) {\n chunks.push(\"{\");\n const keys = Object.keys(t);\n _.each(keys, (key, i) => {\n chunks.push(JSON.stringify(key), \":\");\n walk(t[key]);\n if (i < keys.length - 1) {\n chunks.push(\",\");\n }\n });\n chunks.push(\"}\");\n }\n }\n\n const chunksLengthBeforeWalk = chunks.length;\n\n if (trees.size > 0) {\n chunks.push(\"var require = \");\n }\n\n // Emit one meteorInstall call per distinct meteorInstallOptions\n // object, since the options apply to all modules installed by a given\n // call to meteorInstall.\n trees.forEach((tree, options) => {\n chunks.push(\"meteorInstall(\");\n walk(tree);\n chunks.push(\",\", self._stringifyInstallOptions(options), \");\\n\");\n });\n\n if (moduleCount === 0) {\n // If no files were actually added to the chunks array, roll back\n // to before the `var require = meteorInstall(` chunk.\n chunks.length = chunksLengthBeforeWalk;\n }\n\n return moduleCount;\n }", "loadModules() {\n const modulePath = this._urlParams.get('modulePath');\n const filePath = this._urlParams.get('filePath');\n let partitions = this._urlParams.get('partition');\n let split = parseInt(this._urlParams.get('split'), 10);\n\n split = isNaN(split) ? 1 : split;\n\n if (partitions === undefined) {\n partitions = [1];\n } else if (!Array.isArray(partitions)) {\n partitions = [partitions];\n }\n\n super.loadModules();\n\n if (modulePath || filePath) {\n this._testModules = filterTestModules(\n this._testModules,\n modulePath,\n filePath\n );\n }\n\n this._testModules = splitTestModules(this._testModules, split, partitions);\n this._testModules.forEach((moduleName) => {\n super.require(moduleName);\n super.unsee(moduleName);\n });\n }", "function moduleExportationAddition(ctxt, callback) {\n\t\tfs.readFile(ctxt.bundlePath, { encoding: 'utf8' }, function (err, content) {\n\t\t\tif (err) {\n\t\t\t\tcallback(err);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcontent += '\\nif (typeof module !== \\'undefined\\') {' +\n\t\t\t\t'\\n\\t// node.js export (if we\\'re using node.js)' +\n\t\t\t\t'\\n\\tmodule.exports = window.j2j;' +\n\t\t\t'\\n}\\n';\n\t\t\tfs.writeFile(ctxt.bundlePath, content, callback);\n\t\t});\n\t}", "static async scaffold(filename) {\n const bpmnObject = BpmnParser.parseBpmn(filename)[0];\n const taskTypes = await BpmnParser.getTaskTypes(bpmnObject);\n const interfaces = await BpmnParser.generateConstantsForBpmnFiles(filename);\n const headerInterfaces = {}; // mutated in the recursive function\n await scanForHeadersRecursively(bpmnObject);\n const importStmnt = `import { ZBClient, Auth } from \"zeebe-node\"\n\nconst getToken = new Auth().getToken({\n\turl: \"https://login.cloud.camunda.io/oauth/token\",\n\taudience: \"817d8be9-25e2-42f1-81b8-c8cfbd2adb75.zeebe.camunda.io\",\n\tclientId: \"YaNx4Qf0uQSBcPDW9qQk6Q4SZaRUA7SK\",\n\tclientSecret:\n\t\t\"llKhkB_r7PsfnaWnQVDbdU9aXPAIjhTKiqLwsAySZI6XRgcs0pHofCBqT1j54amF\",\n\tcache: true\n});\n\n// @TODO Point to your Zeebe contact point\nconst zbc = new ZBClient('0.0.0.0', {\n\n}) \n`;\n const genericWorkflowVariables = `// @TODO Update with the shape of your job variables\n// For better intellisense and type-safety\nexport interface WorkflowVariables {\n\t[key: string]: any\n}`;\n const workers = taskTypes\n .map(t => `// Worker for tasks of type \"${t}\"\n${headerInterfaces[t]\n ? headerInterfaces[t].join('|')\n : 'type ' + getSafeName(t) + 'CustomHeaders = never'}\n\nexport const ${getSafeName(t)}Worker = zbc.createWorker<\nWorkflowVariables, \n${getSafeName(t)}CustomHeaders, \nWorkflowVariables\n>(null, \"${t}\", (job, complete, worker) => {\n\tworker.log(job)\n\tcomplete.success()\n})\n`)\n .join('\\n');\n return `${importStmnt}\n${genericWorkflowVariables}\n${interfaces} \n${workers}`;\n async function scanForHeadersRecursively(obj) {\n if (obj instanceof Object) {\n for (const k in obj) {\n if (obj.hasOwnProperty(k)) {\n if (k === 'bpmn:serviceTask') {\n const tasks = Array.isArray(obj[k])\n ? obj[k]\n : [obj[k]];\n tasks.forEach(t => {\n let customHeaderNames;\n const hasCustomHeaders = t['bpmn:extensionElements']['zeebe:taskHeaders'];\n if (hasCustomHeaders) {\n let customHeaders = hasCustomHeaders['zeebe:header'];\n if (!Array.isArray(customHeaders)) {\n customHeaders = [customHeaders];\n }\n customHeaderNames = customHeaders.map(h => h.attr['@_key']);\n }\n const tasktype = t['bpmn:extensionElements']['zeebe:taskDefinition'].attr['@_type'];\n const headerInterfaceName = getSafeName(tasktype);\n if (customHeaderNames) {\n const headerInterfaceDfnBody = customHeaderNames\n .sort()\n .map(h => ' ' + h + ': string')\n .join('\\n');\n const headerInterfaceDfn = `interface ${headerInterfaceName}CustomHeaders {\n${headerInterfaceDfnBody}\n}`;\n if (!headerInterfaces[tasktype]) {\n headerInterfaces[tasktype] = [\n headerInterfaceDfn,\n ];\n }\n else {\n if (headerInterfaces[tasktype].filter(d => d === headerInterfaceDfn).length === 0) {\n headerInterfaces[tasktype].push(`{\n${headerInterfaceDfnBody}\n}`);\n }\n }\n }\n });\n }\n else {\n // recursive call to scan property\n await scanForHeadersRecursively(obj[k]);\n }\n }\n }\n }\n else {\n // not an Object so obj[k] here is a value\n }\n }\n }", "function createModules() {\n\t\tvar moduleElements = document.documentElement.querySelectorAll(\"[data-module]\"), moduleName = \"\";\n\t\tif (moduleElements.length) {\n\t\t\t// If this page requires any modules to be created, attempt to comply for each of them\n\t\t\tvar i = 0, length = moduleElements.length;\n\t\t\tfor (; i < length; i++) {escape\n\t\t\t\tmoduleName = moduleElements[i].getAttribute(\"data-module\");\n\t\t\t\tif (BISDT.modules[moduleName]) {\n\t\t\t\t\t// If this module does actually exist, create it\n\t\t\t\t\tif (!activeModules[moduleName]) activeModules[moduleName] = [];\n\t\t\t\t\tactiveModules[moduleName].push(new BISDT.modules[moduleName].Controller(moduleElements[i]));\n\t\t\t\t} else {\n\t\t\t\t\tif (window.console && console.warn) console.warn(\"Found a module request for '\" + moduleName + \"', but no module with that name exists.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function main (filePath$, packagePath, prepend, blockScope, nonstop, preventEval, includePrevented, silence, debug, output, delimeter) {\n var logStore = []\n DEBUG = debug\n log = logFactory(logStore, silence)\n var filePaths = flatten([filePath$])\n logInfo('it worked if it ends with', 'ok')\n return getPackage(packagePath)\n .then(function (pkg) {\n return Promise.map(filePaths, function (filePath) {\n return assemble(filePath, pkg, prepend, blockScope, nonstop, preventEval, includePrevented, output, delimeter)\n })\n })\n .then(function (mdResults) {\n // console.log(mdResults)\n var exitCode = getExitCode(mdResults)\n if (exitCode === 0) logInfo('ok')\n logDebug('exit code', exitCode)\n return {\n dataSets: mdResults,\n exitCode: exitCode,\n log: logStore\n }\n })\n .catch(function (error) {\n logErr(error)\n var exitCode = 1\n logDebug('exit code', exitCode)\n return {\n dataSets: null,\n exitCode: 1,\n log: null\n }\n })\n}", "mainLogic() {\n this.apexParser = new ApexParser(this.accessModifiers,this.sourceDirectory);\n const filesArray = this.getClassFilesFromPackageDirectories();\n\n //Create a new array of ClassModels\n const classModels = this.getClassModelsFromFiles(filesArray);\n const mapGroupNameToClassGroup = this.createMapGroupNameToClassGroup(classModels, this.sourceDirectory);\n\n const projectDetail = this.fm.parseHTMLFile(this.bannerFilePath);\n const homeContents = this.fm.parseHTMLFile(this.homefilepath);\n this.fm.createDoc(mapGroupNameToClassGroup, classModels, projectDetail, homeContents, this.hostedSourceUrl);\n console.log('ApexDoc has completed!');\n }", "function getAngularFiles(items, owner, repoName) {\n console.log(\"Owner \"+owner);\n var jsFiles = [];\n var count = 0;\n var countJS = 0;\n var fileSaved = false;\n var jsFilesFound = false;\n console.log(\"array size \"+items.length);\n items.forEach(function(element, index, arr) {\n if (element.type === \"blob\" && element.path.endsWith(\".js\")) {\n var libraryFile = false;\n for (var i=0; i<angularKeyWords.length; i++) {\n if (element.path.indexOf(angularKeyWords[i]) != -1) libraryFile = true;\n }\n if (!libraryFile) {\n //console.log(element.path.indexOf(\"node_modules\")+\" element.path \"+element.path);\n jsFilesFound = true;\n //call /repos/:owner/:repo/contents/:path\n github.repos.getContent({owner: owner, repo: repoName, path: element.path}, function (err, res){\n element.content = res.content;\n jsFiles.push(element);\n countJS++;\n count++;\n if (count === items.length && !fileSaved) {\n fileSaved = true;\n console.log(countJS+\" JS files in repo \"+owner+\"/\"+repoName+\" out of \"+count);\n var str = owner+\"/\"+repoName+\"\\t\"+count+\"\\t\"+countJS+\"\\n\";\n fs.appendFile(dir+\"filelist.txt\", str, function (err) {\n if (err) {\n return console.log(err);\n }\n });\n //console.log(JSON.stringify(jadeFiles));\n filename = dir + angularDir + owner+\"_\"+repoName +\"_angularfiles.json\";\n writeJSONtoFile(filename, jsFiles);\n }\n });\n } else count++;\n } else count++;\n });\n if (! jsFilesFound)\n {\n console.log(\"No JS files in repository \"+owner+\"/\"+repoName);\n var str = owner+\"/\"+repoName+\"\\t\"+0+\"\\t\"+0+\"\\n\";\n fs.appendFile(dir+\"filelist.txt\", str, function (err) {\n if (err) {\n return console.log(err);\n }\n });\n }\n}", "function loadDemos() {\n // const files = glob.sync(path.join(__dirname, 'main-process/**/*.js'))\n // files.forEach((file) => {\n // console.log('require file path:' + file)\n // require(file)\n // })\n\n require(path.join(__dirname, 'sugr/consolemanager.js'));\n require(path.join(__dirname, 'sugr/main.js'));\n require(path.join(__dirname, 'sugr/dialog.js'));\n}", "function generateLayers () {\n\t\t\tgrunt.log.write(\"Generating layers...\");\n\n\t\t\tvar config = lang.extend({}, requireConfig, {\n\t\t\t\tisPrepareStage: true,\n\t\t\t\toptimize: \"none\",\n\t\t\t\toptimizeCss: \"none\",\n\t\t\t\tappDir: buildDir,\n\t\t\t\tdir: tempDir,\n\t\t\t\tbaseUrl: \"./\",\n\t\t\t\tlogLevel: 2, // WARN\n\t\t\t\tremoveCombined: false,\n\t\t\t\tskipDirOptimize: true,\n\t\t\t\tkeepBuildDir: false,\n\t\t\t\tskipSemiColonInsertion: true,\n\t\t\t\tpragmas: {\n\t\t\t\t\tprepare: true,\n\t\t\t\t\tbuild: true\n\t\t\t\t},\n\t\t\t\t// Pragmas for rjs plugins:\n\t\t\t\tpragmasOnSave: {\n\t\t\t\t\tprepareSave: true\n\t\t\t\t},\n\t\t\t\t// main (root) modules:\n\t\t\t\tmodules: modules.map(function (module) { return { name: module }; }),\n\t\t\t\tonBuildWrite: function (moduleName, modulePath, contents) {\n\t\t\t\t\t// put moduleName into some layer basing on its path\n\t\t\t\t\tlayers.some(function (layer) {\n\t\t\t\t\t\tvar relPath = path.relative(path.resolve(config.dir), modulePath);\n\t\t\t\t\t\tvar layerDir = layer.dir;\n\t\t\t\t\t\tif (!Array.isArray(layerDir)) {\n\t\t\t\t\t\t\tlayerDir = [layerDir];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlayerDir.forEach(function(dir) {\n\t\t\t\t\t\t\tif (relPath.indexOf(dir) === 0) {\n\t\t\t\t\t\t\t\tif (options.ignoreModules) {\n\t\t\t\t\t\t\t\t\tif (options.ignoreModules.some(function (m) {\n\t\t\t\t\t\t\t\t\t\treturn m === moduleName;\n\t\t\t\t\t\t\t\t\t})) {\n\t\t\t\t\t\t\t\t\t\treturn;\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\tlayer.modules[moduleName] = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t\tif (moduleName.indexOf('xhtmpl!') === 0) {\n\t\t\t\t\t\tmodulesToDelete.push(path.join(outputDir, modulePath.slice('xhtmpl!'.length)));\n\n\t\t\t\t\t\t// Manually save pre-compiled template back into buildDir as\n\t\t\t\t\t\t// we're currently saving into tempDir (that's why we can't rely on returning content)\n\n\t\t\t\t\t\t// NOTE: manually remove leading semicolon\n\t\t\t\t\t\t// TODO: the code should be removed after migrating on 2.1.9 (with skipSemiColonInsertion support)\n\t\t\t\t\t\tif (contents.charAt(contents.length-1) === \";\") {\n\t\t\t\t\t\t\tcontents = contents.slice(0, contents.length-1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfile.saveFile(path.join(buildDir, modulePath.slice('xhtmpl!'.length)), contents);\n\t\t\t\t\t}\n\t\t\t\t\t//return contents;\n\t\t\t\t\treturn \"// this is a stub for finding layer's dependencies: moduleName=\" + moduleName;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\trequirejs.optimize(\n\t\t\t\tconfig,\n\t\t\t\tlang.safeCallback(function () {\n\t\t\t\t\t// create layer modules using 'layers' structure created in onBuildWrite:\n\t\t\t\t\t// every 'layer module' is an empty RJS module with imports (via define([..])) of all modules inside this layer\n\t\t\t\t\tlayers.forEach(function (layer) {\n\t\t\t\t\t\tvar modules = Object.keys(layer.modules).sort(),\n\t\t\t\t\t\t\tcontent = \"define([\\n\\t\\\"\" + modules.join(\"\\\",\\n\\t\\\"\") + \"\\\"\\n], function () {});\";\n\t\t\t\t\t\tfile.saveFile(path.join(buildDir, layer.name) + \".js\", content);\n\t\t\t\t\t});\n\n\t\t\t\t\tgrunt.log.writeln('OK'.green);\n\n\t\t\t\t\t// Go to next step\n\t\t\t\t\toptimizeModules();\n\t\t\t\t}),\n\t\t\t\tlang.errorCallback\n\t\t\t);\n\t\t}", "hoistDeps(duplicateDepsToCheck) {\n const dependentInfo = this.collectDependencyInfo(this.srcDeps);\n const peerDependentInfo = this.collectDependencyInfo(this.peerDeps, true);\n // In case peer dependency duplicates to existing transitive dependency, set \"missing\" to `false`\n for (const [peerDep, peerInfo] of peerDependentInfo.entries()) {\n if (!peerInfo.missing)\n continue;\n let normInfo = dependentInfo.get(peerDep);\n if (normInfo) {\n peerInfo.duplicatePeer = true;\n peerInfo.missing = false;\n peerInfo.by.unshift(normInfo.by[0]);\n }\n if (duplicateDepsToCheck) {\n normInfo = duplicateDepsToCheck.get(peerDep);\n if (normInfo) {\n peerInfo.duplicatePeer = true;\n peerInfo.missing = false;\n peerInfo.by.unshift(normInfo.by[0]);\n }\n }\n }\n // merge directDepsList (direct dependencies of workspace) into dependentInfo (transive dependencies)\n for (const [depName, item] of this.directDepsList.traverse()) {\n const info = {\n sameVer: true,\n direct: true,\n missing: false,\n duplicatePeer: false,\n by: [{ ver: item.ver, name: item.by }]\n };\n dependentInfo.set(depName, info);\n }\n return [dependentInfo, peerDependentInfo];\n }", "installCommonModules(installType) {\n try {\n // Example: \"C:\\MyRepo\\common\\temp\\npm-local\\node_modules\\.bin\\npm\"\n const packageManagerFilename = this._rushConfiguration.packageManagerToolFilename;\n if (!fsx.existsSync(packageManagerFilename)) {\n // This normally should never occur -- it indicates that some code path forgot to call\n // InstallManager.ensureLocalNpmTool().\n throw new Error('Expected to find local package manager tool here: \"' + packageManagerFilename + '\"');\n }\n console.log(os.EOL + colors.bold('Checking node_modules in ' + this._rushConfiguration.commonTempFolder)\n + os.EOL);\n const commonNodeModulesFolder = path.join(this._rushConfiguration.commonTempFolder, 'node_modules');\n // This marker file indicates that the last \"rush install\" completed successfully\n const markerFileExistedAndWasValidAtStart = this._commonNodeModulesMarker.isValid();\n // If \"--clean\" or \"--full-clean\" was specified, or if the last install was interrupted,\n // then we will need to delete the node_modules folder. Otherwise, we can do an incremental\n // install.\n const deletingNodeModules = installType !== InstallType.Normal || !markerFileExistedAndWasValidAtStart;\n // Based on timestamps, can we skip this install entirely?\n if (!deletingNodeModules) {\n const potentiallyChangedFiles = [];\n // Consider the timestamp on the node_modules folder; if someone tampered with it\n // or deleted it entirely, then we can't skip this install\n potentiallyChangedFiles.push(commonNodeModulesFolder);\n // Additionally, if they pulled an updated npm-shrinkwrap.json file from Git,\n // then we can't skip this install\n potentiallyChangedFiles.push(this._rushConfiguration.committedShrinkwrapFilename);\n // Also consider timestamps for all the temp tarballs. (createTempModulesAndCheckShrinkwrap() will\n // carefully preserve these timestamps unless something has changed.)\n // Example: \"C:\\MyRepo\\common\\temp\\projects\\my-project-2.tgz\"\n potentiallyChangedFiles.push(...this._rushConfiguration.projects.map(x => {\n return this._getTarballFilePath(x);\n }));\n // NOTE: If commonNodeModulesMarkerFilename (or any of the potentiallyChangedFiles) does not\n // exist, then isFileTimestampCurrent() returns false.\n if (Utilities_1.default.isFileTimestampCurrent(this._commonNodeModulesMarker.path, potentiallyChangedFiles)) {\n // Nothing to do, because everything is up to date according to time stamps\n return;\n }\n }\n else {\n if (this._rushConfiguration.packageManager === 'npm') {\n console.log(`Deleting the \"npm-cache\" folder`);\n // This is faster and more thorough than \"npm cache clean\"\n this._asyncRecycler.moveFolder(this._rushConfiguration.npmCacheFolder);\n console.log(`Deleting the \"npm-tmp\" folder`);\n this._asyncRecycler.moveFolder(this._rushConfiguration.npmTmpFolder);\n }\n else if (installType !== InstallType.Normal) {\n console.log(`Deleting the \"pnpm-store\" folder`);\n this._asyncRecycler.moveFolder(this._rushConfiguration.pnpmStoreFolder);\n }\n }\n // Delete the successful install file to indicate the install transaction has started\n this._commonNodeModulesMarker.clear();\n // Since we're tampering with common/node_modules, delete the \"rush link\" flag file if it exists;\n // this ensures that a full \"rush link\" is required next time\n Utilities_1.default.deleteFile(this._rushConfiguration.rushLinkJsonFilename);\n // Is there an existing \"node_modules\" folder to consider?\n if (fsx.existsSync(commonNodeModulesFolder)) {\n // Should we delete the entire \"node_modules\" folder?\n if (deletingNodeModules) {\n // YES: Delete \"node_modules\"\n // Explain to the user why we are hosing their node_modules folder\n if (installType === InstallType.Normal) {\n console.log('Deleting the \"node_modules\" folder because the previous Rush install' +\n ' did not complete successfully.');\n }\n else {\n console.log('Deleting old files from ' + commonNodeModulesFolder);\n }\n this._asyncRecycler.moveFolder(commonNodeModulesFolder);\n // Since it may be a while before NPM gets around to creating the \"node_modules\" folder,\n // create an empty folder so that the above warning will be shown if we get interrupted.\n Utilities_1.default.createFolderWithRetry(commonNodeModulesFolder);\n }\n else {\n // NO: Do an incremental install in the \"node_modules\" folder\n // note: it is not necessary to run \"prune\" with pnpm\n if (this._rushConfiguration.packageManager === 'npm') {\n console.log(`Running \"${this._rushConfiguration.packageManager} prune\"`\n + ` in ${this._rushConfiguration.commonTempFolder}`);\n const args = ['prune'];\n this.pushConfigurationArgs(args);\n Utilities_1.default.executeCommandWithRetry(MAX_INSTALL_ATTEMPTS, packageManagerFilename, args, this._rushConfiguration.commonTempFolder);\n }\n // Delete the (installed image of) the temp projects, since \"npm install\" does not\n // detect changes for \"file:./\" references.\n // We recognize the temp projects by their names, which always start with \"rush-\".\n // Example: \"C:\\MyRepo\\common\\temp\\node_modules\\@rush-temp\"\n const pathToDeleteWithoutStar = path.join(commonNodeModulesFolder, RushConstants_1.RushConstants.rushTempNpmScope);\n console.log(`Deleting ${pathToDeleteWithoutStar}\\\\*`);\n // Glob can't handle Windows paths\n const normalizedpathToDeleteWithoutStar = node_core_library_1.Text.replaceAll(pathToDeleteWithoutStar, '\\\\', '/');\n // Example: \"C:/MyRepo/common/temp/node_modules/@rush-temp/*\"\n for (const tempModulePath of glob.sync(globEscape(normalizedpathToDeleteWithoutStar) + '/*')) {\n // We could potentially use AsyncRecycler here, but in practice these folders tend\n // to be very small\n Utilities_1.default.dangerouslyDeletePath(tempModulePath);\n }\n }\n }\n // Run \"npm install\" in the common folder\n // NOTE:\n // we do NOT install optional dependencies for Rush, as it seems that optional dependencies do not\n // work properly with shrinkwrap. Consider the \"fsevents\" package. This is a Mac specific package\n // which is an optional second-order dependency. Optional dependencies work by attempting to install\n // the package, but removes the package if the install failed.\n // This means that someone running generate on a Mac WILL have fsevents included in their shrinkwrap.\n // When someone using Windows attempts to install from the shrinkwrap, the install will fail.\n //\n // If someone generates the shrinkwrap using Windows, then fsevents will NOT be listed in the shrinkwrap.\n // When someone using Mac attempts to install from the shrinkwrap, (as of NPM 4), they will NOT have the\n // optional dependency installed.\n //\n // One possible solution would be to have the shrinkwrap include information about whether the dependency\n // is optional or not, but it does not appear to do so. Also, this would result in strange behavior where\n // people would have different node_modules based on their system.\n const installArgs = ['install', '--no-optional'];\n this.pushConfigurationArgs(installArgs);\n console.log(os.EOL + colors.bold(`Running \"${this._rushConfiguration.packageManager} install\" in`\n + ` ${this._rushConfiguration.commonTempFolder}`) + os.EOL);\n Utilities_1.default.executeCommandWithRetry(MAX_INSTALL_ATTEMPTS, packageManagerFilename, installArgs, this._rushConfiguration.commonTempFolder, undefined, false, () => {\n if (this._rushConfiguration.packageManager === 'pnpm') {\n // If there is a failure in pnpm, it is possible that it left the\n // store in a bad state. Therefore, we should clean out the store\n // before attempting the install again.\n console.log(colors.yellow(`Deleting the \"node_modules\" folder`));\n this._asyncRecycler.moveFolder(commonNodeModulesFolder);\n console.log(colors.yellow(`Deleting the \"pnpm-store\" folder`));\n this._asyncRecycler.moveFolder(this._rushConfiguration.pnpmStoreFolder);\n // Since it may be a while before the package manager gets around to creating the \"node_modules\" folder,\n // create an empty folder so that the warning on the next attempt of \"rush install\"\n Utilities_1.default.createFolderWithRetry(commonNodeModulesFolder);\n }\n });\n this._fixupNpm5Regression();\n // Finally, create the marker file to indicate a successful install\n this._commonNodeModulesMarker.create();\n }\n finally {\n // Delete anything hanging around in the Async Recycler\n this._asyncRecycler.deleteAll();\n }\n console.log('');\n }", "_addDependentsToPackage (packageNode, depObj, type) {\n Object.keys(depObj).forEach(dependencyName => {\n if (this.packageStore.hasOwnProperty(dependencyName)) {\n // packageNode has a dependency of dependencyName - therefore dependencyName is dependent on packageNode\n const dependentPackageNode = this.packageStore[dependencyName];\n const version = depObj[dependencyName];\n dependentPackageNode.addDependent(packageNode.name, new DependentLinkNode({\n type, version, packageNode\n }));\n }\n });\n }", "async updateAllModuleSemantics() {\n await this.db.transaction('rw', this.db.files, this.db.classes, this.db.modules, this.db.functions, () => {\n this.db.files.where(\"type\").equals(\"file\").each((file) => {\n this.addModuleSemantics(file)\n })\n })\n }", "function read(folderpath, io_name, start_module=1, callback) {\n async.waterfall([\n // Connect to database\n function connect(cb) {\n connect_db((err, connection) => {\n if (err) {\n console.log('Error connection to database.')\n cb(err)\n } else {\n console.log('Connected to database with id: ' + connection.threadId)\n cb(null, connection)\n }\n })\n },\n // Select which module to start from\n function modules(connection, cb) {\n if (start_module == 1) {\n const io_path = folderpath + '/' + io_name\n module1(folderpath, io_path, connection, (err) => {\n if (err) {\n cb(err)\n } else {\n cb(null, connection)\n }\n })\n } else if (start_module == 2) {\n module2(null, connection, (err) => {\n if (err) {\n cb(err)\n } else {\n cb(null, connection)\n }\n })\n } else if (start_module == 3) {\n module3(null, connection, (err) => {\n if (err) {\n cb(err)\n } else {\n cb(null, connection)\n }\n })\n } else {\n module4(null, connection, (err) => {\n if (err) {\n cb(err)\n } else {\n cb(null, connection)\n }\n })\n } \n },\n // Cleanup function\n function cleanup(connection, cb) {\n console.log('Start clean up.')\n async.parallel([\n // Clean up database: drop run, close connection\n function database(pcb) {\n async.waterfall([\n // Drop run map\n function drop_run(wcb) {\n drop_table(run_map, connection, (err) => {\n if (err) {\n console.log('Error dropping run map.')\n wcb(err)\n } else {\n console.log('Dropped run map')\n wcb(null)\n }\n })\n },\n // Close connection to database\n function close(wcb) {\n connection.end(function(err) {\n if (err) {\n console.log('Error closing connection to databse.')\n wcb(err)\n } else {\n console.log('Closed connection to database.')\n wcb(null)\n }\n })\n }\n ], \n function (err) {\n if (err) {\n pcb(err)\n } else {\n pcb(null)\n }\n })\n },\n function delete_t2(pcb) {\n if (fs.existsSync(__dirname + '/t2_clusters.json')) {\n fs.unlink(__dirname + '/t2_clusters.json', (err) => {\n if (err) {\n console.log('Error cleaning up t2_clusters.json')\n pcb(err)\n } else {\n console.log('Finished cleaning up t2_clusters.json')\n pcb(null)\n }\n })\n } else {\n console.log('Finished cleaning up t2_clusters.json')\n pcb(null)\n }\n },\n // Delete postflask.csv if exists\n function delete_pf(pcb) {\n if (fs.existsSync(__dirname + '/postflask.csv')) {\n fs.unlink(__dirname + '/postflask.csv', (err) => {\n if (err) {\n console.log('Error cleaning up postflask.csv')\n pcb(err)\n } else {\n console.log('Finished cleaning up postflask.csv')\n pcb(null)\n }\n })\n } else {\n console.log('Finished cleaning up postflask.csv')\n pcb(null)\n }\n },\n ], \n function (err) {\n if (err) {\n console.log('Error at cleanup.')\n cb(err)\n } else {\n console.log('Finished cleaning up.')\n cb(null)\n }\n })\n }\n ], \n function (err) {\n if (err) {\n callback(err)\n } else {\n callback(null)\n }\n })\n}", "populateWorkspaceWithComponents() {\n this.fs.createFile('utils', 'is-type.js', fixtures().isType);\n this.addComponentUtilsIsType();\n this.fs.createFile('utils', 'is-string.js', fixtures().isString);\n this.addComponentUtilsIsString();\n this.createComponentBarFoo(fixtures().barFooFixture);\n this.addComponentBarFoo();\n }", "async function main() {\n for await (const p of walker('elvenware')) {\n const fileName = process.env.HOME + '/Git/CloudNotes/' + p\n debug(getTitleFromPath(fileName));\n const stats = await fsp.stat(fileName);\n debug(stats);\n // execProcess();\n const command = \"sh git-call.sh \" + fileName;\n //const result = await ep.callExec(command);\n const result = await ep.result(command);\n debug('cm result:', result);\n const elfCodes = await getElfCode(fileName);\n await addElfCode(fileName, elfCodes);\n // debug('health codes', elfCodes);\n /* if ((elfCodes.hasElfCode) + (elfCodes.hasTocCode) <= 1) {\n debug('needs work');\n await addElfCode(fileName, elfCodes);\n } */\n /* {\n if(!err){\n debug(response);\n }else {\n debug(err);\n }\n }); */\n return;\n }\n}", "function getListOfModulesAndCreateModules(projectAttachment, configs) {\n\t\tExt.Ajax.request({\n\t\t\tmethod : \"GET\",\n\t\t\turl : projectAttachment + \"/projectModules\",\n\t\t\tscope : this,\n\t\t\tsuccess : function (response) {\n\t\t\t\tvar json = Ext.decode(response.responseText);\n\t\t\t\tExt.each(json.data, function (projectModule) {\n\t\t\t\t\tvar projectConfig = findProjectModuleConfig(configs, projectModule.id);\n\t\t\t\t\tif (!Ext.isEmpty(projectConfig)) {\n\t\t\t\t\t\tvar configModule = Ext.applyIf(projectConfig, projectModule\t|| {});\n\t\t\t\t\t\tvar module = createModule(configModule);\t\t\t\t\t\t\n\t\t\t\t\t\tSitoolsDesk.app.modules.push(module);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tExt.Msg.alert(i18n.get('label.error'), String.format(i18n\n\t\t\t\t\t\t\t\t\t\t\t.get('label.undefinedModule'),\n\t\t\t\t\t\t\t\t\tprojectModule.name));\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t//if all includes are done, Add 1 to the modulesCharges \n\t\t\t\t\t\tSitoolsDesk.modulesCharges++;\n\t\t\t\t\t\t//test if all modules are loaded.\n\t\t\t\t\t\tif (SitoolsDesk.modulesCharges === SitoolsDesk.modulesACharger) {\n\t\t\t\t\t\t\t//End of loading all Javascript files. \n\t\t\t\t\t\t\tSitoolsDesk.app.fireEvent('allJsIncludesDone', this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}, this);\n\t\t\t},\n\t\t\tfailure : alertFailure\n\t\t});\t\t\n\t}", "function patchResDeps() {\n [\"rescript\"].concat(bsconfig[\"bs-dependencies\"]).forEach((bsDep) => {\n fs.writeFileSync(`./node_modules/${bsDep}/index.js`, \"\");\n const json = require(`./node_modules/${bsDep}/package.json`);\n json.main = \"index.js\";\n fs.writeFileSync(\n `./node_modules/${bsDep}/package.json`,\n JSON.stringify(json, null, 2)\n );\n });\n}", "function createHelp() {\n\tvar related;\n\tvar aliases;\n\tvar fpath;\n\tvar alias;\n\tvar ropts;\n\tvar fopts;\n\tvar file;\n\tvar pkg;\n\tvar out;\n\tvar len;\n\tvar tmp;\n\tvar a;\n\tvar p;\n\tvar i;\n\tvar j;\n\n\tropts = {\n\t\t'basedir': ROOT\n\t};\n\tdebug( 'Package resolve options: %s', JSON.stringify( ropts ) );\n\n\tfopts = {\n\t\t'encoding': 'utf8'\n\t};\n\n\taliases = aliasMap();\n\n\tout = {};\n\tfor ( i = 0; i < NAMESPACE.length; i++ ) {\n\t\talias = NAMESPACE[ i ].alias;\n\t\tdebug( 'Resolving `%s`', alias );\n\n\t\tfpath = resolve( NAMESPACE[ i ].path, ropts );\n\t\tdebug( 'Resolved module path: %s', fpath );\n\n\t\tdebug( 'Resolving package information.' );\n\t\tfpath = resolveParentPath( 'package.json', {\n\t\t\t'dir': dirname( fpath )\n\t\t});\n\t\tif ( fpath === null ) {\n\t\t\tdebug( 'Unable to resolve package information.' );\n\t\t\tcontinue;\n\t\t}\n\t\tdebug( 'Reading package information.' );\n\t\tpkg = readJSON( fpath, fopts );\n\t\tif ( pkg instanceof Error ) {\n\t\t\tdebug( 'Unable to read package information: %s', pkg.message );\n\t\t\tcontinue;\n\t\t}\n\t\tdebug( 'Checking package information.' );\n\t\tif ( pkg.name !== NAMESPACE[ i ].path ) {\n\t\t\tdebug( 'Package information does not match path. Expected: %s. Actual: %s.', NAMESPACE[ i ].path, pkg.name );\n\t\t\tcontinue;\n\t\t}\n\t\tfpath = join( dirname( fpath ), REPL_TEXT );\n\t\tdebug( 'Attempting to read REPL text: %s', fpath );\n\n\t\tfile = readFile( fpath, fopts );\n\t\tif ( file instanceof Error ) {\n\t\t\tdebug( 'Unable to read REPL text.' );\n\t\t\tcontinue;\n\t\t}\n\t\tdebug( 'Successfully read REPL text.' );\n\n\t\tdebug( 'Processing REPL text.' );\n\t\tfile = replace( file, '{{alias}}', alias );\n\n\t\tdebug( 'Checking for package identifiers.' );\n\t\ttmp = file.match( RE_ALIASES );\n\t\tif ( tmp ) {\n\t\t\tdebug( 'Resolving package identifier aliases.' );\n\t\t\ttmp = unique( tmp );\n\t\t\tfor ( j = 0; j < tmp.length; j++ ) {\n\t\t\t\tp = RE_ALIAS.exec( tmp[ j ] )[ 1 ]; // extracts a package identifier\n\t\t\t\ta = aliases[ p ];\n\t\t\t\tif ( a === void 0 ) {\n\t\t\t\t\tdebug( 'Unable to resolve alias: %s.', p );\n\t\t\t\t\tconsole.warn( 'WARNING: unable to resolve alias `%s` for `%s`. ', p, alias );\n\t\t\t\t} else {\n\t\t\t\t\tfile = replace( file, tmp[ j ], a );\n\t\t\t\t\tdebug( 'Resolved alias: %s => %s.', p, a );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdebug( 'Resolving related aliases.' );\n\t\tlen = NAMESPACE[ i ].related.length;\n\t\tif ( len ) {\n\t\t\ttmp = [];\n\t\t\trelated = NAMESPACE[ i ].related;\n\t\t\tfor ( j = 0; j < len; j++ ) {\n\t\t\t\ta = aliases[ related[ j ] ];\n\t\t\t\tif ( a === void 0 ) {\n\t\t\t\t\tdebug( 'Unable to resolve related alias: %s.', related[ j ] );\n\t\t\t\t\tconsole.warn( 'WARNING: unable to resolve related alias `%s` for `%s`. ', related[ j ], alias );\n\t\t\t\t} else {\n\t\t\t\t\ttmp.push( a );\n\t\t\t\t\tdebug( 'Resolved alias: %s => %s.', related[ j ], a );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( tmp.length ) {\n\t\t\t\tfile = replace( file, SEE_ALSO, SEE_ALSO+' '+tmp.join( ', ' ) );\n\t\t\t} else {\n\t\t\t\tfile = replace( file, SEE_ALSO, '' );\n\t\t\t}\n\t\t} else {\n\t\t\tfile = replace( file, SEE_ALSO, '' );\n\t\t}\n\t\tdebug( 'Successfully processed `%s`.', alias );\n\t\tout[ alias ] = file;\n\t}\n\tdebug( 'Writing REPL text hash to file.' );\n\tout = PREAMBLE+'module.exports = '+JSON.stringify( out, null, '\\t' )+';\\n';\n\twriteFile( HELP_OUTPUT, out, fopts );\n}" ]
[ "0.6271695", "0.6253758", "0.6236957", "0.5923804", "0.5858413", "0.5682076", "0.5675119", "0.5647293", "0.5607576", "0.5589731", "0.5576396", "0.5574216", "0.5554441", "0.55509794", "0.55461514", "0.5525063", "0.5514758", "0.5510601", "0.5478361", "0.54779506", "0.54471904", "0.5421577", "0.54118854", "0.5390271", "0.537964", "0.5366892", "0.5332451", "0.5324962", "0.52965677", "0.527355", "0.5264958", "0.5249587", "0.52426857", "0.52422374", "0.5236366", "0.52277887", "0.5214437", "0.52073574", "0.52018565", "0.51995456", "0.5195443", "0.5189067", "0.51851904", "0.5173364", "0.5172392", "0.5158766", "0.514909", "0.5145294", "0.5143576", "0.51330227", "0.5124576", "0.512364", "0.5109522", "0.510717", "0.5107146", "0.510637", "0.51018244", "0.50982165", "0.5084298", "0.5079966", "0.50772566", "0.50751656", "0.5072223", "0.5071514", "0.5065844", "0.50561243", "0.505539", "0.50519866", "0.5039305", "0.50390977", "0.5028262", "0.50194174", "0.5017175", "0.50092", "0.49905518", "0.4986452", "0.4977903", "0.49760437", "0.4966391", "0.49631742", "0.49591577", "0.4957311", "0.4957027", "0.49563086", "0.49560556", "0.49542695", "0.49521387", "0.49508107", "0.49492982", "0.49460945", "0.49445814", "0.4944282", "0.49421477", "0.4941617", "0.49365985", "0.49331567", "0.49325654", "0.4930113", "0.49248385", "0.4922831" ]
0.56609595
7
TODO check that all modules added will actually get fired
find_modules(flow){ let modules = {} let nodes = flow.flow.nodes; for(var i = 0; i < nodes.length; i++){ modules[nodes[i].module_name] = this.modules[nodes[i].module_name] } let retArr = [] for(var k in modules){ modules[k].uuid = uuid.v4() retArr.push(modules[k]) } return retArr }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _onModulesLoaded() {\n\t checkModules.call(this, projectGlobal.modules, onAllInit);\n\t}", "runModules (event) {\n if (event === 'init') {\n // Initializing a module should only be done if it has an init\n // function, which means it's not rendered in the template.\n for (let key in PNotify.modules) {\n if (!PNotify.modules.hasOwnProperty(key)) {\n continue;\n }\n if (typeof PNotify.modules[key].init === 'function') {\n const module = PNotify.modules[key].init(this);\n this.initModule(module);\n }\n }\n } else {\n const {_modules} = this.get();\n for (let module in _modules) {\n if (!_modules.hasOwnProperty(module)) {\n continue;\n }\n const moduleOptions = Object.assign({\n '_notice': this,\n '_options': this.get()\n }, this.get().modules[module]);\n _modules[module].set(moduleOptions);\n if (typeof _modules[module][event] === 'function') {\n _modules[module][event]();\n }\n }\n }\n }", "function moduleDidStartLoad() {\n appendToEventLog('Begin module loading');\n}", "function _onAllJsIncludesDone() {\n\t\tinitNavigationMode();\n//\t\tSitoolsDesk.loadPreferences(this);\n\n\t\tthis.fireEvent('modulesLoaded');\n\t}", "_initAddons() {\n //\tInvoke \"before\" hook.\n this.trigger('initAddons:before');\n for (let addon in Mmenu.addons) {\n Mmenu.addons[addon].call(this);\n }\n //\tInvoke \"after\" hook.\n this.trigger('initAddons:after');\n }", "initModules() {\n for (let i = 0; i < this.modules.length; i++) {\n this.modules[i].init(this);\n }\n }", "load (context, actions) {\n console.log(`Loading module ${this.name} finished`)\n }", "function initialize_modules() {\n let modules = [];\n /* read all modules from modules directory */\n let files = fs.readdirSync(\"./modules\");\n for (file of files) {\n const mod = require(\"./modules/\" + file);\n for (event in mod.hooks) {\n client.on(event, mod.hooks[event]);\n }\n modules.push(mod);\n }\n bot.modules = modules;\n}", "function eventHandlersInit(){\r\n $.logEvent('[dataVisualization.core.eventHandlersInit]');\r\n \r\n var activeModuleObj;\r\n var interactivePluginId;\r\n var inputObj;\r\n \r\n $('#' + dataVisualization.configuration.visualizationWrapperId).on('click', '.module A.reload',function(e){\r\n e.preventDefault();\r\n \r\n activeModuleObj = $(this).parents('.module');\r\n interactivePluginObj = activeModuleObj.find('[data-initialized=\"true\"]');\r\n \r\n // Show the overlay\r\n activeModuleObj\r\n .find('.overlay')\r\n .show();\r\n \r\n // Unload the active component\r\n interactivePluginObj\r\n .removeAttr('style')\r\n .empty();\r\n \r\n // Remove any '.centre-value' DOM elements\r\n $('.centre-value',activeModuleObj).remove();\r\n \r\n // Remove any standalone keys\r\n $('.key',activeModuleObj).remove();\r\n \r\n // Initialize the required functionality for the desired module\r\n dataVisualization.dispatcher.moduleInitialize({\r\n id: interactivePluginObj.attr('id')\r\n })\r\n });\r\n }", "function loadMyModules(){\n var module = $('#' + appendModuleOrder);\n\n // APPEND PARENT DIVS\n $('.container').append('<section id=\"' + appendModuleOrder + '\" class=\"module ' + appendModuleName + ' posX-' + myModulePosX + ' ' + 'posY-' + myModulePosY + ' ' + 'col-' + myModuleCol + ' ' + 'row-' + myModuleRow + ' ' + appendModuleHighlight + '\"></section>');\n\n // IF MODULE EXISTS RUN TEXT FUNCTION TO APPEND TEXT\n if($('#' + appendModuleOrder).length) {\n appendText();\n\n // IF MODULE H1 TEXT EXISTS RUN MEDIA FUNCTION\n if($('#' + appendModuleOrder).find('h1').length) {\n myMediaFunction();\n\n // IF MEDIA FUNCTION IS FINSIHED RUN RE-ORDER function\n if(p = true) {\n window[appendModuleName]();\n } else {\n alert('Please refresh your page');\n }\n\n } else {\n alert('Please refresh your page');\n }\n } else {\n alert('Please refresh your page');\n }\n\n\n }", "function setEventsListeners() {\n events.on(CONSTANTS.EVENTS.AUCTION_INIT, (args) => {\n subModules.forEach(sm => { sm.auctionInit && sm.auctionInit(args, sm.config) })\n });\n events.on(CONSTANTS.EVENTS.AUCTION_END, (args) => {\n subModules.forEach(sm => { sm.auctionEnd && sm.auctionEnd(args, sm.config) })\n });\n events.on(CONSTANTS.EVENTS.BEFORE_REQUEST_BIDS, (args) => {\n subModules.forEach(sm => { sm.updateBidRequest && sm.updateBidRequest(args, sm.config) })\n });\n events.on(CONSTANTS.EVENTS.BID_RESPONSE, (args) => {\n subModules.forEach(sm => { sm.updateBidResponse && sm.updateBidResponse(args, sm.config) })\n });\n}", "function updateModuleReferences() {\n if (!self.initialized) return;\n if (cmdScheduler && cmdScheduler.initialized) return;\n cmdScheduler = self.bot.getSubmodule('./cmdScheduling.js');\n if (!cmdScheduler || !cmdScheduler.initialized) {\n cmdScheduler = null;\n setTimeout(updateModuleReferences, 100);\n } else {\n cmdScheduler.on('shutdown', handleShutdown);\n cmdScheduler.on('commandRegistered', handleCommandRegistered);\n cmdScheduler.on('commandCancelled', handleCommandCancelled);\n }\n }", "function setForeignListeners(){\n for(var module in createdModules){\n createdModules[module].setForeignValueListeners();\n }\n}", "registerModules(commandModules) {\n commandModules.forEach((module) => {\n this.registerModule(module);\n });\n }", "[LOAD_MODULES](state, modules) {\n state.modules = modules;\n }", "_bindUtilHooks() {\n // initial events: when an update button is clicked\n this.cartChangeHooks.forEach((hook) => {\n utils.hooks.on(hook, (event) => {\n this._showOverlay();\n });\n });\n\n // remote events: when the proper response is sent\n this.cartChangeRemoteHooks.forEach((hook) => {\n utils.hooks.on(hook, (event) => {\n this._refreshcartPreview();\n });\n })\n }", "function onAllLoaded() {\n console.log('all loaded');\n}", "function setNewModuleHandler(newModuleHandler) {\n myNewModuleHandler = newModuleHandler;\n }", "function eventHandlersOnce() {\n\tif (globalDebug) {console.group(\"Event Handlers Once\");}\n\n\tmenuTrigger();\n\n\tif (globalDebug) {console.groupEnd();}\n}", "queueModule(modulePath) {\n this.modulesToAdd.push(modulePath);\n }", "function init() {\n loadDependencies();\n attachEventHandlers();\n}", "function initModules() {\n model_store = new Soapify.model_store();\n vc_navbar = new Soapify.viewcontroller_navbar();\n vc_info = new Soapify.viewcontroller_info();\n vc_map = new Soapify.viewcontroller_map(model_store);\n vc_contact = new Soapify.viewcontroller_contact();\n }", "function moduleDidLoad() {\n naclModule = document.getElementById(pluginId);\n onLoadCallback();\n }", "function addClickEvents() {\n\t\tfunction executeModules(selectedElement) {\n\t\t\toptions.selectionModules().forEach(function (module) {\n\t\t\t\tmodule.handle(selectedElement);\n\t\t\t});\n\t\t}\n\n\t\tnodeElements.on(\"click\", function (clickedNode) {\n\t\t\texecuteModules(clickedNode);\n\t\t});\n\n\t\tlabelGroupElements.selectAll(\".label\").on(\"click\", function (clickedProperty) {\n\t\t\texecuteModules(clickedProperty);\n\t\t});\n\t}", "initModulesDynamic() {\n if (this.isDynamicInitialized) {\n return;\n }\n for (let i = 0; i < this.modules.length; i++) {\n this.modules[i].initDynamic(this);\n }\n this.isDynamicInitialized = true;\n }", "function bindEvents() {\n\t\t\teManager.on('showForm', function() {\n\t\t\t\tshowForm();\n\t\t\t});\n\t\t\teManager.on('csvParseError', function() {\n\t\t\t\tshowError();\n\t\t\t});\n\t\t}", "trackEvent(params = {}, excludedModules = []) {\n this.modulesEnabled.forEach(module => {\n if (excludedModules.indexOf(module.name) === -1) {\n module.trackEvent(params);\n }\n });\n }", "function loadHook() {\n targetBlank();\n bindEnqueue();\n bindIndexButtons();\n}", "addEvents() {\n this.moduleView.getModuleContainer().addEventListener(\"mousedown\", this.eventDraggingHandler, false);\n this.moduleView.getModuleContainer().addEventListener(\"touchstart\", this.eventDraggingHandler, false);\n this.moduleView.getModuleContainer().addEventListener(\"touchmove\", this.eventDraggingHandler, false);\n this.moduleView.getModuleContainer().addEventListener(\"touchend\", this.eventDraggingHandler, false);\n if (this.moduleView.textArea != undefined) {\n this.moduleView.textArea.addEventListener(\"touchstart\", (e) => { e.stopPropagation(); });\n this.moduleView.textArea.addEventListener(\"touchend\", (e) => { e.stopPropagation(); });\n this.moduleView.textArea.addEventListener(\"touchmove\", (e) => { e.stopPropagation(); });\n this.moduleView.textArea.addEventListener(\"mousedown\", (e) => { e.stopPropagation(); });\n }\n if (this.moduleView.closeButton != undefined) {\n this.moduleView.closeButton.addEventListener(\"click\", () => { this.deleteModule(); });\n this.moduleView.closeButton.addEventListener(\"touchend\", () => { this.deleteModule(); });\n }\n if (this.moduleView.miniButton != undefined) {\n this.moduleView.miniButton.addEventListener(\"click\", () => { this.minModule(); });\n this.moduleView.miniButton.addEventListener(\"touchend\", () => { this.minModule(); });\n }\n if (this.moduleView.maxButton != undefined) {\n this.moduleView.maxButton.addEventListener(\"click\", () => { this.maxModule(); });\n this.moduleView.maxButton.addEventListener(\"touchend\", () => { this.maxModule(); });\n }\n if (this.moduleView.fEditImg != undefined) {\n this.moduleView.fEditImg.addEventListener(\"click\", this.eventOpenEditHandler);\n this.moduleView.fEditImg.addEventListener(\"touchend\", this.eventOpenEditHandler);\n }\n }", "function _bindEventHandlers() {\n\t\t\n helper.bindEventHandlers();\n }", "constructor() {\n super();\n\n this.generateModules();\n }", "reloadAllModules() {\r\n console.info(\"Reloading all modules.\")\r\n\r\n this.client.removeAllListeners()\r\n this.commands = {}\r\n this.modules = {}\r\n\r\n this.loadAllModules()\r\n this.configureClient()\r\n }", "function getNewModuleHandler() {\n return myNewModuleHandler;\n }", "addedToWorld() { }", "function main() {\n addEventListeners();\n addAdvancedEventListeners();\n}", "onRun(call) {\r\n\r\n if (this.run_ext.indexOf(call) == -1) {\r\n this.run_ext.push(call);\r\n }\r\n }", "onEnd({ compilation }) {\n console.log('end detecting webpack modules cycles');\n }", "function initializeModules()\n{\n var i = 0;\n var len = ws_modules.length;\n var context =\n {\n server : server,\n require : require\n };\n for(i = 0; i < len; i++)\n {\n \tws_modules[i].init(context, config);\n }\n}", "function moduleDidLoad() {\n jitModule = document.getElementById('jit');\n appendToEventLog('Finished module loading');\n updateStatus('SUCCESS');\n jitModule.postMessage(\"GO\")\n}", "loadModules(modules={}) {\n for(let [name, module={}] of Object.entries(modules)) {\n const {actions={}} = module\n this.actions[name] = {...actions}\n }\n }", "registerSourceModuleChange() {\n\t\t\tlet select = this.container.find('#inputSourceModule');\n\t\t\tlet blocks = this.container.find('.js-dynamic-blocks');\n\t\t\tselect.on('change', (e) => {\n\t\t\t\tthis.sourceModule = select.find('option:selected').data('module');\n\t\t\t\tblocks.html('');\n\t\t\t\tAppConnector.request({\n\t\t\t\t\tmodule: app.getModuleName(),\n\t\t\t\t\tparent: app.getParentModuleName(),\n\t\t\t\t\tview: 'Edit',\n\t\t\t\t\tmode: 'dynamic',\n\t\t\t\t\tselectedModule: this.sourceModule\n\t\t\t\t}).done((data) => {\n\t\t\t\t\tblocks.html(data);\n\t\t\t\t\tApp.Fields.Picklist.changeSelectElementView(blocks);\n\t\t\t\t\tthis.loadConditionBuilderView();\n\t\t\t\t});\n\t\t\t});\n\t\t}", "function init_modules() {\n $('.placeholder:not(.initialised)').each(function() {\n $(this).addClass('initialised');\n var delay = $(this).data('delay');\n if (delay === undefined) {\n get_module($(this).data('module'), {\n poll: $(this).data('poll')\n });\n } else {\n var module = $(this).data('module');\n var poll = $(this).data('poll');\n setTimeout(function() {\n get_module(module, {\n poll: poll\n });\n }, delay * 1000);\n }\n });\n }", "function requireDone (cb) {\n window.modules._done_cbs = window.modules._done_cbs || [];\n window.modules._done_cbs.push(cb);\n}", "onRender() {\n const { trackingId, moduleName } = getProperties(\n this,\n 'trackingId',\n 'moduleName'\n );\n get(this, 'moduleTracking').fireCustomView(moduleName, trackingId);\n }", "function _main() {\n try {\n // the modules own main routine\n //_logCalls();\n\n // enable a global accessability from window\n window.tools = {} || window.tools;\n window.tools._log = _log;\n window.tools._addNavigation = _addNavigation;\n } catch (error) {\n console.log(error);\n }\n\n }", "function registerEvents() {\n}", "init() {\n this.loadModules();\n this.cacheDOM();\n this.attachEvents();\n this.stickFooterToBottom();\n }", "launchModuleCreation() {\n if (this.arrayRecalScene.length != 0) {\n var jsonObject = this.arrayRecalScene[0];\n if (jsonObject.factory != undefined) {\n console.log(jsonObject);\n this.tempPatchId = jsonObject.patchId;\n faust.readDSPFactoryFromMachine(jsonObject.factory, (factory) => {\n this.updateAppTempModuleInfo(jsonObject);\n this.sceneName = jsonObject.sceneName;\n this.createModule(factory);\n });\n }\n else if (jsonObject.moduleType == ModuleType.MidiController) {\n console.log(jsonObject);\n this.tempPatchId = jsonObject.patchId;\n this.updateAppTempModuleInfo(jsonObject);\n this.sceneName = jsonObject.sceneName;\n this.createCompositionModule(jsonObject.moduleJSON);\n }\n else if (jsonObject.patchId != \"output\" && jsonObject.patchId != \"input\") {\n this.tempPatchId = jsonObject.patchId;\n this.sceneName = jsonObject.sceneName;\n var argumentCompile = { isMidi: false, name: jsonObject.name, sourceCode: jsonObject.code, x: parseFloat(jsonObject.x), y: parseFloat(jsonObject.y), callback: (factory) => { this.createModule(factory); } };\n this.compileFaust(argumentCompile);\n }\n else if (jsonObject.moduleType == ModuleType.SamplePlayer) {\n }\n else {\n this.arrayRecalScene.shift();\n this.launchModuleCreation();\n }\n }\n else {\n for (var i = 0; i < this.arrayRecalledModule.length; i++) {\n this.connectModule(this.arrayRecalledModule[i]);\n }\n for (var i = 0; i < this.arrayRecalledModule.length; i++) {\n delete this.arrayRecalledModule[i].patchID;\n }\n this.arrayRecalledModule = [];\n var event = new CustomEvent(\"updatename\");\n document.dispatchEvent(event);\n Utilitary.hideFullPageLoading();\n }\n }", "function initModules() {\n\n /**\n * Instantiate moduleDispatcher to init Modules\n * @type {moduleDispatcher}\n */\n new moduleDispatcher({\n Library : codex\n });\n\n /**\n * CodeX Special\n *\n * Availiable options:\n * position {String} (optional) — toolbar position on screen\n * 'top-left', 'bottom-right', 'bottom-left', 'top-right'\n * blockId {String} (optional) — toolbar wrapper\n * lang {String} (optional) — language 'ru' or 'en'. (default: 'ru')\n */\n codex.special.init({\n blockId: 'js-contrast-version-holder'\n });\n\n /**\n * Stylize custom checkboxes\n */\n codex.checkboxes.init();\n\n /**\n * Init approval buttons\n */\n codex.content.approvalButtons.init();\n\n /**\n * Enable textarea autoresizer\n */\n codex.autoresizeTextarea.init();\n\n /**\n * Activate scroll-up button\n */\n codex.scrollUp.init('js-layout-holder');\n\n /**\n * Client is ready\n */\n codex.core.log('Initialized', 'CodeX', 'info');\n\n /**\n * Initiate branding preload\n */\n codex.branding.init();\n\n /**\n * Initiate pages sharing\n */\n codex.sharer.init();\n\n }", "patch () {\n const enablesInstruments = this._options.enables\n // Use all if not specify\n if (enablesInstruments && enablesInstruments.length) {\n instrumentations = instrumentations.filter((instrument) => enablesInstruments.indexOf(instrument.module) !== -1)\n }\n\n const instrumentedModules = _.uniq(instrumentations.map((instrumentation) => instrumentation.module))\n\n // Instrunent modules: hook require\n hook(instrumentedModules, (moduleExports, moduleName, moduleBaseDir) =>\n this.hookModule(moduleExports, moduleName, moduleBaseDir))\n\n debug('Patched')\n }", "registerModules() {\n const { modules } = this.options;\n\n if (Object.keys(modules).length) {\n Object.keys(modules).forEach((moduleName) => {\n const module = modules[moduleName];\n const hasPromisse = typeof module.then === 'function';\n\n // Loaded module\n if (!hasPromisse) {\n this.registerModuleRoutes(module.routes);\n this.registerModuleStore(moduleName, module.store);\n\n return;\n }\n\n // Load lazy modules\n module.then((moduleLoaded) => {\n const { routes, store } = moduleLoaded.default;\n\n this.registerModuleRoutes(routes);\n this.registerModuleStore(moduleName, store);\n });\n });\n }\n }", "async registerModules() {\n const { modules } = this.options;\n\n for (let index = 0; index < Object.keys(modules).length; index += 1) {\n const name = Object.keys(modules)[index];\n const module = modules[name];\n\n // eslint-disable-next-line no-await-in-loop\n await module.then((loadedModule) => {\n const { routes, store } = loadedModule.default;\n this.registerModuleRoutes(routes);\n this.registerModuleStore(name, store);\n });\n }\n }", "function setHookedModules(...modules) {\n modules.forEach(function (module, key) {\n let moduleName = HOOK_MODULES[key].split(\".\")[0]; // some module names have an extension like \".bs\"\n Modules[moduleName] = module;\n });\n}", "function enqueueModuleForDelayedScoping(moduleType,ngModule){moduleQueue.push({moduleType:moduleType,ngModule:ngModule});}", "function addModuleToInvoke(moduleToInvoke) {\r\n\t\t\t// add given module to not invoked modules\r\n\t\t\t modulesToInvoke.push(\r\n\t\t\t\t{\r\n\t\t\t\t\t\"module\": moduleToInvoke,\r\n\t\t\t\t\t\"dependencies\": moduleToInvoke.requiredModules\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t// take and run modules as long as their dependencies are solved\r\n\t\t\tvar resolvedModule = checkForSolvedDependencies();\r\n\t\t\twhile(typeof resolvedModule !== \"undefined\") {\r\n\t\t\t\t// run module function\r\n\t\t\t\trunModule(resolvedModule);\r\n\t\t\t\tresolvedModule = checkForSolvedDependencies();\r\n\t\t\t};\r\n\t\t}", "load(){\n\n\t\tfor(var moduleName in this.ControllerManifest){\n\n\t\t\tLog.info(\"Loading app module {}\", moduleName);\n\n\t\t\tvar thisModuleManifest = this.ControllerManifest[moduleName];\n\t\t\t\n\t\t\tvar moduleFileName = thisModuleManifest.file || $.concat(\".\", moduleName + \"Module\", \"js\");\n\t\t\tvar ModuleObject = false;\n\n\t\t\ttry{\n\t\t\t\tModuleObject = require(__CONFIG.paths.modules + \"/\" + moduleFileName);\n\t\t\t}catch(e){\n\t\t\t\tLog.error(\"Can't include file of module {}\", moduleName, e);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._validatePayloadSchema(moduleName, this.ControllerManifest[moduleName].methods);\n\t\t\tthis.Prototypes[moduleName.toLowerCase()] = {\n\t\t\t\tobject : ModuleObject,\n\t\t\t\tmanifest : this.ControllerManifest[moduleName]\n\t\t\t}\t\t\t\n\t\t}\n\t\tLog.info(\"__________________________ INITIALISED. APP RUNNING. __________________________ \");\n\t}", "function registerEventHandlers() {\n\n\t\tEventDispatcher.addEventListener( \"LOAD_BUTTON_CLICKED\" , function(){\n\n\t\t\t// Increment number of visible the Articles model unless all are visible\n\t\t\tif( ArticleStore.visibleArticles < ArticleStore.totalArticles ) {\n\n\t\t\t\tArticleStore.visibleArticles++;\n\t\t\t\t\n\t\t\t\trender();\n\n\t\t\t}\n\n\t\t});\n\t}", "function _hooker(name, parent) {\n\tvar timeIn = Date.now(),\n\t\t\texports = _load.apply(Module, arguments),\n\t\t\ttimeOut = Date.now(),\n\t\t\tmod = parent.children[parent.children.length - 1]; // should be the last loaded children\n\t// call the listener\n\t_listener({\n\t\tname: name,\n\t\tparent: parent,\n\t\tmodule: mod,\n\t\tfilename: mod ? mod.filename : name,\n\t\texports: exports,\n\t\trequiredOn: timeIn,\n\t\tstartedIn: timeOut - timeIn\n\t});\n\treturn exports;\n}", "function _hooker(name, parent) {\n\tvar timeIn = Date.now(),\n\t exports = _load.apply(Module, arguments),\n\t timeOut = Date.now(),\n\t mod = parent.children[parent.children.length - 1]; // should be the last loaded children\n\t// call the listener\n\t_listener({\n\t\tname: name,\n\t\tparent: parent,\n\t\tmodule: mod,\n\t\tfilename: mod ? mod.filename : name,\n\t\texports: exports,\n\t\trequiredOn: timeIn,\n\t\tstartedIn: timeOut - timeIn\n\t});\n\treturn exports;\n}", "init() {\n this.addAdditionnalScripts();\n }", "function module() {\n this.moduleConstants = {};\n\n this.startupData = {};\n this.moduleName = '';\n this.moduleContext = {};\n this.activeDevice = undefined;\n\n\n\n\n /**\n * Function is called once every time the module tab is selected, loads the module.\n * @param {[type]} framework The active framework instance.\n * @param {[type]} onError Function to be called if an error occurs.\n * @param {[type]} onSuccess Function to be called when complete.\n **/\n this.onModuleLoaded = function(framework, onError, onSuccess) {\n self.startupData = framework.moduleData.startupData;\n self.moduleName = framework.moduleData.name;\n\n onSuccess();\n };\n\n /**\n * Function is called once every time a user selects a new device. \n * @param {[type]} framework The active framework instance.\n * @param {[type]} device The active framework instance.\n * @param {[type]} onError Function to be called if an error occurs.\n * @param {[type]} onSuccess Function to be called when complete.\n **/\n this.onDeviceSelected = function(framework, device, onError, onSuccess) {\n self.activeDevices = device;\n framework.clearConfigBindings();\n framework.setStartupMessage('Reading Device Configuration');\n \n onSuccess();\n };\n\n\n this.onDeviceConfigured = function(framework, device, setupBindings, onError, onSuccess) {\n\n // self.getRegistersToDisplay()\n // .then(self.getRegistersModbusInfo)\n // .then(self.cachedRegistersToDisplay)\n // .then(self.getInitialDeviceData)\n // .then(function(registers) {\n // console.log('Registers to display:', registers);\n // self.moduleContext = {\n // 'activeRegisters': self.getActiveRegistersData(registers)\n // };\n // framework.setCustomContext(self.moduleContext);\n // onSuccess();\n // });\n framework.setCustomContext({'test':'TestRes', 'testB': 'TestBRes'});\n onSuccess();\n };\n\n this.onTemplateLoaded = function(framework, onError, onSuccess) {\n onSuccess();\n };\n\n this.hideSaveButtons = function() {\n var defered = q.defer();\n\n // $('#saved-indicator').hide();\n $('#configure-button').slideUp();\n $('#saving-indicator').slideDown();\n defered.resolve();\n return defered.promise;\n };\n var TARGET_REGISTER = {\n factory: 'IO_CONFIG_SET_CURRENT_TO_FACTORY',\n powerup: 'IO_CONFIG_SET_CURRENT_TO_DEFAULT'\n };\n var configureDeviceStrategies = {\n factory: function(device) {\n // Write a 1 to the appropriate register.\n return device.iWrite(TARGET_REGISTER.factory, 1);\n },\n powerup: function(device) {\n // Write a 1 to the appropriate register.\n return device.iWrite(TARGET_REGISTER.powerup, 1);\n }\n };\n this.configureSelectedDevice = function(device) {\n var selectedOption = $('.radio input:checked');\n var selectedVal = selectedOption.val();\n return configureDeviceStrategies[selectedVal](device);\n };\n this.configureSelectedDevices = function() {\n var defered = q.defer();\n var promises = self.activeDevices.map(self.configureSelectedDevice);\n q.allSettled(promises)\n .then(function() {\n defered.resolve();\n });\n return defered.promise;\n };\n this.showSaveButtons = function() {\n var defered = q.defer();\n $('#saving-indicator').slideUp();\n // $('#saved-indicator').slideDown();\n $('#configure-button').slideDown();\n defered.resolve();\n return defered.promise;\n };\n this.attachListener = function() {\n var defered = q.defer();\n var buttonEle = $('#configure-button');\n // buttonEle.off('click');\n buttonEle.one('click', self.configureDevice);\n defered.resolve();\n return defered.promise;\n };\n this.configureDevice = function() {\n\n self.hideSaveButtons()\n .then(self.configureSelectedDevices)\n .then(self.showSaveButtons)\n .then(self.attachListener);\n };\n /**\n * Function that gets executed after the module's template is displayed.\n * @param {object} framework framework object.\n * @param {function} onError function to be called on error.\n * @param {function} onSuccess function to be called on success\n * @return {[type]} [description]\n */\n this.onTemplateDisplayed = function(framework, onError, onSuccess) {\n self.attachListener()\n .then(onSuccess);\n };\n this.onRegisterWrite = function(framework, binding, value, onError, onSuccess) {\n onSuccess();\n };\n this.onRegisterWritten = function(framework, registerName, value, onError, onSuccess) {\n onSuccess();\n };\n this.onRefresh = function(framework, registerNames, onError, onSuccess) {\n onSuccess();\n };\n this.onRefreshed = function(framework, results, onError, onSuccess) {\n onSuccess();\n };\n this.onCloseDevice = function(framework, device, onError, onSuccess) {\n // self.saveModuleStartupData()\n // .then(onSuccess);\n var buttonEle = $('#configure-button');\n buttonEle.off('click');\n onSuccess();\n };\n this.onUnloadModule = function(framework, onError, onSuccess) {\n onSuccess();\n };\n this.onLoadError = function(framework, description, onHandle) {\n console.log('in onLoadError', description);\n onHandle(true);\n };\n this.onWriteError = function(framework, registerName, value, description, onHandle) {\n console.log('in onConfigError', description);\n onHandle(true);\n };\n this.onRefreshError = function(framework, registerNames, description, onHandle) {\n console.log('in onRefreshError', description);\n onHandle(true);\n };\n\n var self = this;\n}", "function init () {\n bindEventHandlers();\n}", "async loadModule() {\n const { state, actx } = this;\n try {\n await actx.audioWorklet.addModule(`worklet/${state.processor.module}.js`);\n this.setState({ moduleLoaded: true, status: null });\n console.log(`loaded module ${state.processor.module}`);\n } catch (e) {\n this.setState({ moduleLoaded: false });\n console.log(`Failed to load module ${state.processor.module}`);\n }\n }", "function moduleDidEndLoad() {\n // appendToEventLog('loadend');\n var lastError = event.target.lastError;\n if (lastError != undefined && lastError.length != 0) {\n appendToEventLog('lastError: ' + lastError);\n }\n}", "added() {}", "function onModuleLoaded(logger){\n $.config.logging.logger = logger;\n }", "function onReady() {\n module = this; //IMPORTANT: get a hold of themed module object.\n\n $(document).bind(\"couponsinc:changepage\", handleChangePage);\n }", "handleUpdates(){\n\t\t//put per update scripts here\n\t\tconsole.log('update');\n\t}", "function initMod() {\n if (document.querySelector(\"#panels .webpanel-stack\")) {\n observeUIState();\n observePanelSwitchChildren();\n convertWebPanelButtonstoAdvancedPanelButtons();\n listenForNewPanelsAndConvertIfNecessary();\n } else {\n setTimeout(initMod, 500);\n }\n }", "function startLoad()\n\t{\n\t\t\tif(startedLoading)\n\t\t\t{\n\t\t\t\tlogger.debug('ND-node startLoad called more than once');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tstartedLoading=true;\n\n\t\t\tcoreModules.forEach(function (moduleName){\n\t\t\t\tmoduleLoaders.push(moduleLoader.getLoader(getCoreModulePath(moduleName)));\n\t\t\t});\n\t\t\tmoduleLoaders.push(moduleLoader.getLoader({instance:logger,moduleName:'$logger'}));\n\t\t\tmoduleLoaders.push(moduleLoader.getLoader({instance:newBackendInstance,moduleName:'$backend'}));\n\n //var modules=getModulesAndDependencies(modulePaths);\n moduleLoaders=moduleLoader.getSortedByDepends(moduleLoaders);\n\n\t\t\tvar modulePromises={};\n\n //we will augment each module in modules with .instance - a member containg a promise returning its instance\n moduleLoaders.forEach(\n \t\t\tfunction(moduleLoader)\n \t\t\t{\n\t\t\t\t\t\t//we init each module instance promise then create it when all dependcies are ready\n\t\t\t\t\t\tmodulePromises[moduleLoader.name]=new BBPromise(function (resolve){\n\t\t var args=\n\t\t _.map(moduleLoader.dependencies,\n\t\t function(name){ return modulePromises[name];}\n\t\t );//concat all dependencies\n\n\t\t\t\t\t\t\t\t\tresolve(BBPromise.all(args).then(//all dependencies have ben created - create this module now\n\t\t\t function(argValues)\n\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\tlogger.debug('Creating an instance of '+moduleLoader.name);\n\t\t\t\t\t\t\t\t\t\t\tvar factoryRet=moduleLoader.factory.apply(newBackendInstance,argValues);\n\t\t\t\t\t\t\t\t\t\t\tif(!factoryRet)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tloadedModules[moduleLoader.name]={};\n\t\t\t\t\t\t\t\t\t\t\t\treturn BBPromise.resolve({});\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\treturn BBPromise.resolve(factoryRet).then(function(instResolved)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tloadedModules[moduleLoader.name]=instResolved;\n\t\t\t\t\t\t\t\t\t\t\t\treturn instResolved;\n\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t }\n\t\t\t ));\n\t\t\t\t\t\t});\n \t\t\t}\n\t\t\t);\n\n //wait for all loading to complete and update status\n return BBPromise.all(_.values(modulePromises)).then(\n function()\n {\n logger.debug('finished loading modules');\n finishedLoading=true;\n }\n );\n\n\t}", "_prepare_module_init(){\n this.module_faces=[this.module_base_face_dimensions_axes,\n this.module_top_face_dimensions_axes,\n this.module_left_face_dimensions_axes,\n this.module_right_face_dimensions_axes];\n this.initial_module_faces=[this.module_base_face_dimensions_axes.slice(),\n this.module_top_face_dimensions_axes.slice(),\n this.module_left_face_dimensions_axes.slice(),\n this.module_right_face_dimensions_axes.slice()];\n }", "function dependencyLoaded() {\n dependenciesLoaded += 1;\n if (dependenciesLoaded >= dependencies) {\n odyssey.dispatchEvent(new Odyssey.Events.InitializedEvent());\n }\n }", "function addModule(module) {\n function addIndividualModule(module) {\n if (!mapNames[module.moduleName]) {\n mapNames[module.moduleName] = true;\n allModules.push(module);\n ModuleRegistry.register(module);\n }\n }\n addIndividualModule(module);\n if (module.dependantModules) {\n module.dependantModules.forEach(addModule);\n }\n }", "function initializeModules() {\r\n\r\n\t\t\t\t//Hide the full content divs\r\n\t\t\t\tmodules.find(\"div.full\").hide();\r\n\t\t\t\t\r\n\t\t\t\t//Apply link styling to the li summary and hide the summary anchors\r\n\t\t\t\tmodules.find(\"div.summary\").css(\"cursor\", \"pointer\").find(\"a\").hide();\r\n\t\t\t\t\r\n\t\t\t\t//Apply absolute positioning to the modules instead of floating them\r\n\t\t\t\tmodules.css({\r\n\t\t\t\t\tfloat: \"none\",\r\n\t\t\t\t\tposition: \"absolute\",\r\n\t\t\t\t\tbottom: 0\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tmodules.each(function(i) {\r\n\r\n\t\t\t\t\tvar startingLeftPosition = (summaryFullWidth + 2 + summaryMargin) * i; //The 2 is for border width\r\n\t\t\t\t\tvar smallLeftPosition = (summarySmallWidth + 2 + summaryMargin) * i;\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar fullLeft = (summarySmallWidth + summaryMargin + 2) * i; //Calculates the left position of the module when it would be fully open\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Initialize the data for this particular module\r\n\t\t\t\t\tmoduleData[i] = {\r\n\t\t\t\t\t\tanimating: false, //whether or not this particular module is currently animating\r\n\t\t\t\t\t\tatInitialState: true, //whether or not this particular module is currently in it's initial state\r\n\t\t\t\t\t\tatSmallSummaryState: false, //whether or not this item is currently in small summary state\r\n\t\t\t\t\t\tsummaryVisible: true, //whether or not the summary is visible\r\n\t\t\t\t\t\tsummaryImageVisible: true, //whether or not the summary image is visible\r\n\t\t\t\t\t\titemResized: false, //whether or not the item has been re-sized\r\n\t\t\t\t\t\tfullContentVisible: false, //whether or not the full content layer is visible\r\n\t\t\t\t\t\tfullContentShadowsAdded: false, //whether or not the full content layer has had drop-shadows applied\r\n\t\t\t\t\t\tstartingLeftPosition: startingLeftPosition, //the starting left position of this module in its initial state\r\n\t\t\t\t\t\tsmallSummaryLeftPosition: smallLeftPosition, //the base left position of the module when it's in small summary state\r\n\t\t\t\t\t\tfullLeftPosition: fullLeft, //the base left position of the module when it's at its fully open state\r\n\t\t\t\t\t\tlastCalledAnimation: \"shrink\", //the last animation type to happen\r\n\t\t\t\t\t\telem: $(this) //the jQuery object for this module\r\n\t\t\t\t\t};\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Set the starting left position\r\n\t\t\t\t\tmoduleData[i].elem.css(\"left\", startingLeftPosition);\r\n\r\n\t\t\t\t});\r\n\r\n\t\t\t}", "leftBuild () {\n admin.prototype.scriptCallLeft();\n }", "function init (scriptManager, cwd, modules) {// jshint ignore:line\n\tvar logger = scriptManager.logger;//Shortcut method\n\n\tvar eventCount = 0;\n\n\tvar scriptManagerWrapper = {\n\t\tbind : function (event, value, listener) {\n\t\t\tvar Listener = Java.extend(Java.type('org.virtue.engine.script.listeners.EventListener'), {\n\t\t\t\tinvoke : function (eventType, trigger, args) {\n\t\t\t\t\targs.event = eventType;\n\t\t\t\t\targs.trigger = trigger;\n\t\t\t\t\tlistener(args);\n\t\t\t\t}\n\t\t\t});\n\t\t\tvar events = Array.isArray(event) ? event : [event];\n\t\t\tvar values = Array.isArray(value) ? value : [value];\n\t\t\tfor (var i in events) {\n\t\t\t\tfor (var j in values) {\n\t\t\t\t\tscriptManager.registerListener(events[i], values[j], new Listener());\n\t\t\t\t\teventCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tgetLogger : function () {\n\t\t\treturn scriptManager.getLogger();\n\t\t}\n\t};\n\n\trequire('./modules');\n\n\tvar start = new Date().getTime();\n\tfor (var i in modules) {\n\t\tvar module = modules[i];\n\t\trequire('./modules/'+module+'/bootstrap')(scriptManagerWrapper);\n\t}\n\tvar end = new Date().getTime();\n\tlogger.info(`Loaded ${eventCount} event listeners in ${end-start} milliseconds`);\n\n\t//TODO: Method to support legacy skills. Remove once all have been converted\n\treturn {\n\t\tCraftProcess : require('./shared/makex/progress'),\n\t\tCraftDialog : require('./shared/makex/selection')\n\t};\n}", "addEventHandlers() {\n\n\t\tthis.elementConfig.addButton.on(\"click\",this.handleAdd);\n\t\tthis.elementConfig.cancelButton.on(\"click\",this.handleCancel);\n\t\tthis.elementConfig.retrieveButton.on(\"click\",this.retrieveData);\n\n\n\t}", "function main() {\n addEventListeners();\n}", "function doSetup(moduleName) {\n var module = modules.modules[moduleName];\n if (module.setup) {\n module.setup();\n }\n }", "boot() {\n const Events = this.app.getInstance('Events')\n this.app\n .make('AutoLoader')\n .context(require.context('@listeners', true, /\\.js$/))\n .each((alias, abstract)=>{\n this.app.bind(alias, abstract,false)\n Events.$on((abstract.event || alias), (payload)=>{\n try{\n this.app.make(alias).handle(payload)\n }catch (e) {\n this.app.handleError(e)\n }\n })\n })\n }", "function allModulesLoaded() {\n this.flexipRef.imageLoadSource(config.image);\n}", "init() {\n module_utils.patchModule(\n 'bunyan',\n '_emit',\n emitWrapper,\n bunyan => bunyan.prototype\n );\n }", "function preRun(){if(Module['preRun']){if(typeof Module['preRun']=='function')Module['preRun']=[Module['preRun']];while(Module['preRun'].length){addOnPreRun(Module['preRun'].shift());}}callRuntimeCallbacks(__ATPRERUN__);}", "function init() {\r\n bindEventListeners();\r\n }", "getModules() { return this.fModuleList; }", "function addDrumListeners()\n{\n\n}", "function addModule(module) {\n var newIndex = modules.push(module) - 1,\n $host;\n // add base functions and properties\n module._values = {};\n module.isRunning = false;\n module.val = function (name, newValue, source) {\n if (!source) source = module;\n if (newValue === undefined) return this._values[name];\n\n this._values[name] = newValue;\n $(module).trigger(\"valueChanged\", { name: name, value: newValue, source: source });\n return newValue;\n }\n\n module.getValues = function () {\n return this._values;\n }\n moduleIDIndex[module.id] = newIndex;\n\n // create ui\n $('#moduleContainer').append(\n $host =\n $('<div />', { id: module.id, 'class': 'moduleContent' })\n .css('display', 'none')\n );\n $('#changeModuleMenu .menuItemsPanel').append(\n $('<li>' + module.name + '</li>').click(function () {\n $(this).parent().hide();\n showModule.call(this, module);\n }));\n\n // add any saved values\n if (my.startupModuleValues[module.id]) {\n var modValues = my.startupModuleValues[module.id];\n for (var i in modValues) {\n // we don't want to trigger onValueChanged since the module isn't initialized.\n module._values[i] = modValues[i];\n }\n }\n \n module.init($host);\n }", "ngAfterViewInit() {\n const fireOnInit = this.swalFireOnInit === undefined\n ? this.moduleLevelFireOnInit\n : this.swalFireOnInit;\n fireOnInit && this.fire();\n }", "initializeEvents () {\n }", "postRenderSetup() {\n this.el.querySelectorAll('a.addBoxerLink').forEach((link) => {\n link.onclick = () => {\n this.callbacks.closeSidebar();\n this.callbacks.createNewFighter(link.id);\n }\n });\n\n this.el.querySelector('#directoryReport').onclick = () => {\n this.callbacks.closeSidebar();\n this.callbacks.directoryReport();\n };\n\n this.el.querySelector('#assessmentReport').onclick = () => {\n this.callbacks.closeSidebar();\n this.callbacks.assessmentReport();\n }\n }", "function init() {\n console.log( \"init\" );\n\n initExampleModule();\n //initScrollTo();\n //initCarouselModules();\n }", "loadAll() {\n\tlet rooms = require(\"./rooms/*.js\", { mode: 'list' });\n\tfor (let i of rooms) {\n\t console.log(\"room-loader: adding room \"+i.module);\n\t this.add(i.module);\n\t}\n }", "function bindAddHandlers() {\n $(\".add-button\").bind(\"click\", function(event) {\n $(this).attr(\"disabled\", \"disabled\");\n $(this).closest('li').hide('blind', { direction: 'vertical' }, ANIMATION_TIMEOUT);\n var url = ('/playlists/edit/' + encodeURIComponent(playlistId) +\n '/add_playlist_entry?video_id=' + encodeURIComponent(event.target.id) +\n '&uuid=' + encodeURIComponent(uuid));\n $.ajax({ type: 'POST', url: url });\n });\n }", "initialize() {\n console.log('Module is initialized.');\n }", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}" ]
[ "0.73181087", "0.7080021", "0.6895552", "0.6754784", "0.6447568", "0.6406349", "0.6396715", "0.636616", "0.6361018", "0.63585675", "0.6314566", "0.61783516", "0.61671954", "0.61578286", "0.60860515", "0.60593766", "0.6034606", "0.60229135", "0.6019595", "0.6005321", "0.5993204", "0.5990463", "0.59850806", "0.5977896", "0.5965738", "0.5950616", "0.59475976", "0.59468424", "0.5945595", "0.59312415", "0.59215665", "0.591677", "0.5893282", "0.5882851", "0.58792067", "0.5858409", "0.5855864", "0.5854108", "0.58410835", "0.5841054", "0.5840058", "0.5836888", "0.5830605", "0.5829621", "0.5826883", "0.57993543", "0.57904595", "0.5777937", "0.5765183", "0.57605636", "0.5757559", "0.57529473", "0.57493854", "0.57485", "0.5723099", "0.5712042", "0.5697232", "0.56940436", "0.5686308", "0.5683675", "0.5673092", "0.5666988", "0.56473476", "0.5640308", "0.56317925", "0.563029", "0.5626164", "0.5609812", "0.5600529", "0.55991477", "0.5597609", "0.5587608", "0.5586744", "0.5586234", "0.5582638", "0.5579163", "0.5573389", "0.5570459", "0.5567395", "0.5563404", "0.5561075", "0.5553595", "0.5553498", "0.55526704", "0.5546341", "0.55388933", "0.5535997", "0.5534955", "0.5527693", "0.5520813", "0.551585", "0.5510305", "0.55094725", "0.5508564", "0.55052114", "0.55052114", "0.55052114", "0.55052114", "0.55052114", "0.55052114", "0.55052114" ]
0.0
-1
Since our contract will have different addresses depending on which network it is deployed on we need to load the network ID before we can initialize the contract. This will happen async.
static currentNetwork() { return web3.eth.net.getId().then(function(networkID){ return web3.eth.getAccounts().then(function(accounts){ return new TokenService(networkID, accounts[0]); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function init() {\n console.log(\"init is running\")\n const networkId = await web3.eth.net.getId() \n\n // const new Web3.HttpProvider()\n\n // instantiate local versions of hedging contract\n\n const HCDeployedNetwork = HedgingContract.networks[networkId]\n const hedgingcontract = new web3.eth.Contract(\n HedgingContract.abi,\n HCDeployedNetwork.address\n )\n\n console.log(['hedging contract address:', hedgingcontract.address])\n\n const RouterDeployedNetwork = Router.networks[networkId]\n const router = new web3.eth.Contract(\n Router.abi,\n RouterDeployedNetwork.address\n )\n\n console.log(['router address:', RouterDeployedNetwork.address])\n\n}", "loadContract() {\r\n try {\r\n this.contract = new this.web3.eth.Contract(this.ABI, this.address);\r\n } catch (error) {\r\n console.error(error);\r\n throw new Error('Error loading contract.');\r\n }\r\n }", "function loadContract(cb) {\n stateManager.getAccount(runState.address, function (err, account) {\n if (err) return cb(err);\n runState.contract = account;\n cb();\n });\n }", "function initialize_contract() {\n if (web3.utils.isAddress(document.getElementById(\"initialize_contract_input\").value)) {\n console.log(\"Using the address provided, please wait ...\");\n newContract.setAddress(document.getElementById(\"initialize_contract_input\").value);\n } else {\n console.log(\"Initializing existing contract at \" + newContract.getAddress());\n }\n var multiswapContractInstance = new web3.eth.Contract(abi, newContract.getAddress());\n newContract.setContractInstanceObject(multiswapContractInstance);\n}", "async loadBlockchainData() {\n const web3 = window.web3\n\n const accounts = await web3.eth.getAccounts()\n this.setState({account: accounts[0]})\n\n const networkId = await web3.eth.net.getId()\n \n\n //Load Factory Contract\n // take token json from imported files, get networkId, that will give us\n // the address \n const factoryData = Factory.networks[networkId]\n if(factoryData) { //create web3 version of factory if it exists\n \n const factory = new web3.eth.Contract(Factory.abi, factoryData.address)\n this.setState({factory})\n this.setState({ loadingpg: false })\n\n } else {\n window.alert('factory contract not deployed to detected network')\n }\n\n \n\n }", "async initContracts() {\n this.contract = new ethers.Contract(\n this.evn.SUPPORT_ADDRESS,\n this.evn.SUPPORT_ABI,\n this.wallet\n );\n this.contract.provider.polling = false;\n }", "static async initContractInstance(inputInitParams) {\n const {contractAddress} = inputInitParams;\n const aelf = AelfBridgeCheck.getAelfInstanceByExtension();\n if (!accountInfo) {\n throw Error('Please login');\n }\n const address = JSON.parse(accountInfo.detail).address;\n\n const contractInstance = await aelf.chain.contractAt(contractAddress);\n contractInstances[contractAddress + address] = contractInstance;\n return contractInstance;\n }", "async initBeforeSync() {\n this.__rootNetworkAddress = await this.db.getData('rootNetworkAddress');\n let initialNetworkAddress = this.options.initialNetworkAddress || this.address;\n\n if(Array.isArray(initialNetworkAddress)) {\n initialNetworkAddress = _.shuffle(initialNetworkAddress);\n initialNetworkAddress = initialNetworkAddress.sort(a => a === this.address? 0: -1);\n }\n \n this.initialNetworkAddress = await this.getAvailableAddress(initialNetworkAddress);\n \n if(!this.initialNetworkAddress) {\n throw new Error('Provided initial network addresses are not available');\n }\n }", "async loadBlockchainData() {\n const web3 = window.web3\n //Load account\n const accounts = await web3.eth.getAccounts()\n this.setState({account: accounts[0]})\n const networkId = await web3.eth.net.getId()\n const networkData = CarChain.networks[networkId]\n if(networkData){\n const abi = CarChain.abi\n const address = networkData.address\n const chain = new web3.eth.Contract(abi, address)\n this.setState({chainContract: chain})\n\n //get CarPurchase contract address and deploy it using web3\n var purAddr = await this.state.chainContract.methods.getMyPendingPurchase().call({from:this.state.buyer})\n if(purAddr){\n const abi3 = CarPurchase.abi\n const purchase = new web3.eth.Contract(abi3, purAddr)\n this.setState({purchaseContract: purchase})\n this.setState({states: await purchase.methods.getState().call()})\n }\n }\n else {\n window.alert('Smart contract not deployed to detected network.')\n }\n }", "async loadContractData() {\n \n let contractAdmin, PoolTogetherData\n PoolTogetherData = CharityPool.networks[3]\n if(PoolTogetherData) {\n const abi = CharityPool.abi\n const address = PoolTogetherData.address\n //Load contract and set state\n const poolContract = new this.state.web3.eth.Contract(abi, address)\n contractAdmin = await poolContract.methods.admin().call()\n this.setState({admin: contractAdmin, poolContract, poolContractAddress: address})\n }\n //Compound Ropsten address located here: https://compound.finance/docs#networks\n const compoundCETHContractAddress = '0x859e9d8a4edadfedb5a2ff311243af80f85a91b8'\n const cETHContract = new this.state.web3.eth.Contract(cETH, compoundCETHContractAddress)\n await this.setState({cETHContract, cETHAddress: compoundCETHContractAddress})\n let cETHBalance = await this.state.cETHContract.methods.balanceOf(this.state.poolContractAddress).call()\n this.setState({contractCETHBalance: cETHBalance})\n}", "async loadBlockchainData() { \n //Obtener la cuenta\n const web3 = window.web3;\n const accounts = await web3.eth.getAccounts()\n this.setState({account: accounts[0]})\n console.log(accounts)\n \n //Obtener la red\n const networkId = await web3.eth.net.getId();\n console.log(networkId)\n const networkData = Curriculum.networks[networkId];\n console.log(networkData)\n \n if (networkData) {\n //Obtener abi\n const abi = Curriculum.abi\n console.log(abi)\n //Obtener la dirección\n const address = networkData.address\n console.log(address)\n //Fetch Contrato\n const contract = new web3.eth.Contract(abi, address)\n this.setState({contract})\n const ipfsHash = await contract.methods.get().call()\n\n this.setState({ipfsHash})\n console.log(ipfsHash)\n } else {\n window.alert('El Smart Contract no ha sido desplegado en la red.')\n }\n\n }", "async init() {\n try {\n const [contractInstance, accounts] = await Promise.all([\n this\n .facilitatorContract\n .deployed(),\n this\n .web3\n .eth\n .getAccounts(),\n this\n .ipfs\n .isOnline()\n ? this.waitFor('ipfs-ready')\n : 0\n ]);\n\n this.accountAddress = accounts[0];\n\n this.contractInstance = contractInstance;\n\n this.emit('ready')\n } catch (error) {\n this.emit('error', error)\n }\n }", "function init()\n{\n // Initialize the ethereum client\n const web3 = new Web3(`${ConfigServer.nodePath}geth.ipc`, net);\n\n // Initialize the access smart contract\n const AccessABI = require(\"./contracts/access.json\");\n let accessSC = common.initContract(web3, AccessABI, ConfigServer.accessContractAddr);\n\n // Initialize balance smart contract\n const BalanceABI = require(\"./contracts/balance.json\");\n let balanceSC = common.initContract(web3, BalanceABI, ConfigServer.balanceContractAddr);\n\n // Intialize data smart contract\n const DataABI = require(\"./contracts/data.json\");\n let dataSC = common.initContract(web3, DataABI, ConfigServer.dataContractAddr);\n\n // Create struct that stores these parameters\n let ethClient = {\"web3\": web3, \"accessSC\": accessSC, \"balanceSC\":balanceSC, \"dataSC\": dataSC, \"config\": ConfigServer};\n\n return ethClient;\n}", "function setup_contract() {\n var contract = web3.eth.contract(CONTRACT_ABI)\n return contract.at(CONTRACT_ADDRESSS)\n}", "async function init () {\n // get info for ganache or hardhat testnet\n const provider = await new ethers.providers.JsonRpcProvider();\n //console.log(\"\\n\\nprovider\\n\\n\", provider);\n\n // the following 2 lines are used if contract is on rinkeby instead of ganache or hardhat testnet\n //let provider;\n //window.ethereum.enable().then(provider = new ethers.providers.Web3Provider(window.ethereum));\n\n const signer = await provider.getSigner()\n //console.log(\"\\n\\nsigner\\n\\n\", signer);\n const userAddress = await signer.getAddress();\n //console.log(\"\\n\\nuser address\\n\\n\", userAddress);\n\n // initialize shadow contract\n\n let AppInstance = null;\n // get the contract address from deployment to test network. Make sure it is the applicaton contract, not the oracle.\n const abi = AppContractJSON.abi;\n\n // Make sure you set this correctly after deployment or nothing will work!!!\n AppInstance = new ethers.Contract('0x5FbDB2315678afecb367f032d93F642f64180aa3', abi, signer);\n\n // listen for events\n filterEvents(AppInstance);\n\n return { AppInstance, signer }\n}", "verifyNetwork() {\n if (this.isNetworkLoading()) this.lookupNetwork()\n }", "function loadContract(){\n // we know the abi of the contract\n var abriStr = '[ { \"constant\": false, \"inputs\": [ { \"name\": \"newSellPrice\", \"type\": \"uint256\" }, { \"name\": \"newBuyPrice\", \"type\": \"uint256\" } ], \"name\": \"setPrices\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"name\", \"outputs\": [ { \"name\": \"\", \"type\": \"string\", \"value\": \"Rodrigo\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"_spender\", \"type\": \"address\" }, { \"name\": \"_value\", \"type\": \"uint256\" } ], \"name\": \"approve\", \"outputs\": [ { \"name\": \"success\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"name\": \"\", \"type\": \"address\" } ], \"name\": \"fabricBalanceOf\", \"outputs\": [ { \"name\": \"\", \"type\": \"uint256\", \"value\": \"0\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"totalSupply\", \"outputs\": [ { \"name\": \"\", \"type\": \"uint256\", \"value\": \"2e+24\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"_from\", \"type\": \"address\" }, { \"name\": \"_to\", \"type\": \"address\" }, { \"name\": \"_value\", \"type\": \"uint256\" } ], \"name\": \"transferFrom\", \"outputs\": [ { \"name\": \"success\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"decimals\", \"outputs\": [ { \"name\": \"\", \"type\": \"uint8\", \"value\": \"18\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"_value\", \"type\": \"uint256\" } ], \"name\": \"burn\", \"outputs\": [ { \"name\": \"success\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"sellPrice\", \"outputs\": [ { \"name\": \"\", \"type\": \"uint256\", \"value\": \"0\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"name\": \"\", \"type\": \"address\" } ], \"name\": \"balanceOf\", \"outputs\": [ { \"name\": \"\", \"type\": \"uint256\", \"value\": \"0\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"target\", \"type\": \"address\" }, { \"name\": \"mintedAmount\", \"type\": \"uint256\" } ], \"name\": \"mintToken\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"_from\", \"type\": \"address\" }, { \"name\": \"_value\", \"type\": \"uint256\" } ], \"name\": \"burnFrom\", \"outputs\": [ { \"name\": \"success\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"buyPrice\", \"outputs\": [ { \"name\": \"\", \"type\": \"uint256\", \"value\": \"0\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"owner\", \"outputs\": [ { \"name\": \"\", \"type\": \"address\", \"value\": \"0x567ec4d3a5506e76066bb6999474c48f810dc2f3\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"symbol\", \"outputs\": [ { \"name\": \"\", \"type\": \"string\", \"value\": \"rod\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [], \"name\": \"buy\", \"outputs\": [], \"payable\": true, \"stateMutability\": \"payable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"_to\", \"type\": \"address\" }, { \"name\": \"_value\", \"type\": \"uint256\" } ], \"name\": \"transfer\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"name\": \"\", \"type\": \"address\" } ], \"name\": \"frozenAccount\", \"outputs\": [ { \"name\": \"\", \"type\": \"bool\", \"value\": false } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"_spender\", \"type\": \"address\" }, { \"name\": \"_value\", \"type\": \"uint256\" }, { \"name\": \"_extraData\", \"type\": \"bytes\" } ], \"name\": \"approveAndCall\", \"outputs\": [ { \"name\": \"success\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"_number\", \"type\": \"uint8\" } ], \"name\": \"setFabricRequiredSignatures\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"name\": \"\", \"type\": \"address\" }, { \"name\": \"\", \"type\": \"address\" } ], \"name\": \"allowance\", \"outputs\": [ { \"name\": \"\", \"type\": \"uint256\", \"value\": \"0\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"sell\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"from\", \"type\": \"address\" }, { \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"fabricTransfer\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"target\", \"type\": \"address\" }, { \"name\": \"freeze\", \"type\": \"bool\" } ], \"name\": \"freezeAccount\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"newOwner\", \"type\": \"address\" } ], \"name\": \"transferOwnership\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"name\": \"initialSupply\", \"type\": \"uint256\", \"index\": 0, \"typeShort\": \"uint\", \"bits\": \"256\", \"displayName\": \"initial Supply\", \"template\": \"elements_input_uint\", \"value\": \"2000000\" }, { \"name\": \"tokenName\", \"type\": \"string\", \"index\": 1, \"typeShort\": \"string\", \"bits\": \"\", \"displayName\": \"token Name\", \"template\": \"elements_input_string\", \"value\": \"Rodrigo\" }, { \"name\": \"tokenSymbol\", \"type\": \"string\", \"index\": 2, \"typeShort\": \"string\", \"bits\": \"\", \"displayName\": \"token Symbol\", \"template\": \"elements_input_string\", \"value\": \"rod\" }, { \"name\": \"_fabricRequiredSignatures\", \"type\": \"uint8\", \"index\": 3, \"typeShort\": \"uint\", \"bits\": \"8\", \"displayName\": \"&thinsp;<span class=\\\\\"punctuation\\\\\">_</span>&thinsp;fabric Required Signatures\", \"template\": \"elements_input_uint\", \"value\": \"2\" } ], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"constructor\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"name\": \"owner\", \"type\": \"address\" }, { \"indexed\": false, \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"FabricTransfer\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"name\": \"target\", \"type\": \"address\" }, { \"indexed\": false, \"name\": \"frozen\", \"type\": \"bool\" } ], \"name\": \"FrozenFunds\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"name\": \"from\", \"type\": \"address\" }, { \"indexed\": false, \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"Burn\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"name\": \"from\", \"type\": \"address\" }, { \"indexed\": true, \"name\": \"to\", \"type\": \"address\" }, { \"indexed\": false, \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"Transfer\", \"type\": \"event\" } ]';\n var abi = JSON.parse(abriStr);\n var contract = web3.eth.contract(abi);\n\n // we know the address of the contract\n var ethContract = contract.at(\"0xA760C64DfDB1EE168f2CB7873759d917d919cfb1\");\n return ethContract;\n}", "async _initializeContracts() {\n logger.debug('Entering _initializeContracts');\n for (const walletOrg of this.orgWallets.keys()) {\n logger.info(`Retrieving and persisting contract map for organization ${walletOrg}`);\n const orgWallet = this.orgWallets.get(walletOrg);\n\n // Prepare client contracts based on wallet identities only\n const walletIdentities = await orgWallet.list();\n for (const identity of walletIdentities) {\n logger.info(`Retrieving and persisting contract map for identity ${identity}`);\n // Retrieve\n const contractMap = await this._retrieveContractMapForIdentity(identity, orgWallet);\n // Persist\n this.userContracts.set(identity, contractMap);\n }\n }\n logger.debug('Exiting _initializeContracts');\n }", "function initializeContract(){\n\tmyContractInstance = Maintenance.deployed();\n\n\t//registerMachine();\n\t//myContractInstance.methods.getMachineDetails.call().then('Testing->'+console.log);\n\n\tconsole.log('myContractInstance->'+myContractInstance);\n\n\tconsole.log('myContractInstance.address->'+myContractInstance.creator);\n\tconsole.log('myContractInstance.address@@@@@@@@@@@->'+myContractInstance);\n\t$('#cf_address').html(myContractInstance.address);\n\t//$('#cf_address').html(myContractInstance.address);\n\t//console.log('myContractInstance.address->'+myContractInstance.address);\n\t$('#cf_address').html(account);\n\tconsole.log('account.address->'+account);\n//\t$('#cf_machines').html(myContractInstance.numMachines);\n//\tconsole.log('cf_machines->'+myContractInstance.numMachines);\n\n\tmyContractInstance.numMachines.call().then(\n\t\t\tfunction(numMachines){\n\t\t\t\t$('#cf_machines').html(numMachines.toNumber());\n\t\t\t\treturn myContractInstance.numServiceRequests.call();\n\n\t}).then(\n\t\t\tfunction(numServiceRequests){\n\t\t\t\t$('#cf_servicerequests').html(numServiceRequests.toNumber());\n\t\t\t\tgetServiceRequests();\n\t});\n}", "function Contract() {\n if (this instanceof Contract) {\n instantiate(this, arguments[0]);\n } else {\n var C = mutate(Contract);\n var network_id = arguments.length > 0 ? arguments[0] : \"default\";\n C.setNetwork(network_id);\n return C;\n }\n }", "function Contract() {\n if (this instanceof Contract) {\n instantiate(this, arguments[0]);\n } else {\n var C = mutate(Contract);\n var network_id = arguments.length > 0 ? arguments[0] : \"default\";\n C.setNetwork(network_id);\n return C;\n }\n }", "function Contract() {\n if (this instanceof Contract) {\n instantiate(this, arguments[0]);\n } else {\n var C = mutate(Contract);\n var network_id = arguments.length > 0 ? arguments[0] : \"default\";\n C.setNetwork(network_id);\n return C;\n }\n }", "function Contract() {\n if (this instanceof Contract) {\n instantiate(this, arguments[0]);\n } else {\n var C = mutate(Contract);\n var network_id = arguments.length > 0 ? arguments[0] : \"default\";\n C.setNetwork(network_id);\n return C;\n }\n }", "function Contract() {\n if (this instanceof Contract) {\n instantiate(this, arguments[0]);\n } else {\n var C = mutate(Contract);\n var network_id = arguments.length > 0 ? arguments[0] : \"default\";\n C.setNetwork(network_id);\n return C;\n }\n }", "function Contract() {\n if (this instanceof Contract) {\n instantiate(this, arguments[0]);\n } else {\n var C = mutate(Contract);\n var network_id = arguments.length > 0 ? arguments[0] : \"default\";\n C.setNetwork(network_id);\n return C;\n }\n }", "function Contract() {\n if (this instanceof Contract) {\n instantiate(this, arguments[0]);\n } else {\n var C = mutate(Contract);\n var network_id = arguments.length > 0 ? arguments[0] : \"default\";\n C.setNetwork(network_id);\n return C;\n }\n }", "function Contract() {\n if (this instanceof Contract) {\n instantiate(this, arguments[0]);\n } else {\n var C = mutate(Contract);\n var network_id = arguments.length > 0 ? arguments[0] : \"default\";\n C.setNetwork(network_id);\n return C;\n }\n }", "async loadBlockchainData(){\n const web3 =window.web3;\n // fetch the account to which metamask is connected to\n const accounts=await web3.eth.getAccounts();\n //console.log(accounts[0]);\n //set the account state to first account of ganache\n this.setState({account:accounts[0]});\n //console.log(this.state.account);\n\n const ethBalance = await web3.eth.getBalance(this.state.account);\n // if same name and value then only name is enoguh\n this.setState({ethBalance});\n\n // Load bibaToken SC\n // import the smart contracts and make their function accessible\n //new web3.eth.Contract(jsonInterface,address,options);\n //const abi = bibaToken.abi;\n // get network id via metamask dynamically\n const networkId = await web3.eth.net.getId();// returns 5777 automatically for ganache\n const tokenData=bibaToken.networks[networkId];\n // it would be in networks->ganache network id->address from bibaToken.json\n //const address= bibaToken.networks[networkId].address;\n // token has the javascript version of smart contract\n //const token = new web3.eth.Contract(abi,address);\n //console.log(token);\n if(tokenData){\n const token = new web3.eth.Contract(bibaToken.abi,tokenData.address);\n //console.log(token);\n this.setState({token});\n let tokenBalance = await token.methods.balanceOf(this.state.account).call();\n //console.log(\"Token Balance:\",tokenBalance.toString());\n if(!tokenBalance){\n toast.error('The Smart Contracts are not migrated properly...');\n return;\n }\n this.setState({tokenBalance:tokenBalance.toString()});\n }else{\n toast.error('bibaToken contract is not deployed to the detected network.');\n return;\n }\n\n // Load ethSwap SC\n const ethSwapData = ethSwap.networks[networkId];\n if(ethSwapData){\n const EthSwap = new web3.eth.Contract(ethSwap.abi,ethSwapData.address);\n this.setState({EthSwap});\n }else{\n toast.error('ethSwap contract is not deployed to the detected network.');\n }\n //console.log(this.state.EthSwap);\n // once all the smart contract are loaded then setloading state to false to remove the loader.\n this.setState({loading:false});\n }", "async init() {\r\n await this.requestMetaMaskAccount();\r\n await this.downloadABI();\r\n await this.loadContract();\r\n }", "async function loadNetwork(dispatch, getState, { peerId, isFirstRun }) {\n const channels = await network.getChannels();\n for (const channel of channels) {\n dispatch(addChannel(channel));\n }\n\n const identities = await network.getIdentities();\n for (const identity of identities) {\n dispatch(addIdentity(identity));\n }\n\n dispatch(networkReady({ peerId, isFirstRun }));\n setInitialPage(dispatch, getState);\n\n runChainMapLoop(dispatch).catch((e) => {\n dispatch(addNotification({\n kind: 'error',\n content: 'Failed to wait for an chain map: ' + e.message,\n }));\n });\n}", "function onNetworkChanged(id) {\n\n if (id == chainId) return;\n\n chainId.current = id;\n web3Provider.current = getWeb3Provider(id);\n setContractAddresses(id);\n // setBlockchainSwitchState(usingBinance(id));\n\n updateGenericBlockchainData();\n \n if (ref(account)) updateUserSpecificBlockchainData();\n\n }", "SET_REQUIRED_NETWORK(state, network) {\n state.network.required = network\n }", "async loadBlockchainVars() {\n try {\n const ethereumjs = new Eth(window.web3.currentProvider);\n const requestNetwork = new RequestNetwork(window.web3.currentProvider, 46);\n let accounts = await ethereumjs.accounts();\n this.payeeAddress = accounts[0];\n this.rn = requestNetwork;\n this.eth = ethereumjs;\n } catch (error) {\n console.error(error);\n }\n }", "async init() {\n if (!this.eventStoreContractInstance) {\n this.eventStoreContractInstance = await this.eventStoreContract.deployed();\n }\n }", "function getNetwork(network) {\n // No network (null)\n if (network == null) {\n return null;\n }\n if (typeof (network) === \"number\") {\n for (const name in networks) {\n const standard = networks[name];\n if (standard.chainId === network) {\n return {\n name: standard.name,\n chainId: standard.chainId,\n ensAddress: (standard.ensAddress || null),\n _defaultProvider: (standard._defaultProvider || null)\n };\n }\n }\n return {\n chainId: network,\n name: \"unknown\"\n };\n }\n if (typeof (network) === \"string\") {\n const standard = networks[network];\n if (standard == null) {\n return null;\n }\n return {\n name: standard.name,\n chainId: standard.chainId,\n ensAddress: standard.ensAddress,\n _defaultProvider: (standard._defaultProvider || null)\n };\n }\n const standard = networks[network.name];\n // Not a standard network; check that it is a valid network in general\n if (!standard) {\n if (typeof (network.chainId) !== \"number\") {\n logger.throwArgumentError(\"invalid network chainId\", \"network\", network);\n }\n return network;\n }\n // Make sure the chainId matches the expected network chainId (or is 0; disable EIP-155)\n if (network.chainId !== 0 && network.chainId !== standard.chainId) {\n logger.throwArgumentError(\"network chainId mismatch\", \"network\", network);\n }\n // @TODO: In the next major version add an attach function to a defaultProvider\n // class and move the _defaultProvider internal to this file (extend Network)\n let defaultProvider = network._defaultProvider || null;\n if (defaultProvider == null && standard._defaultProvider) {\n if (isRenetworkable(standard._defaultProvider)) {\n defaultProvider = standard._defaultProvider.renetwork(network);\n }\n else {\n defaultProvider = standard._defaultProvider;\n }\n }\n // Standard Network (allow overriding the ENS address)\n return {\n name: network.name,\n chainId: standard.chainId,\n ensAddress: (network.ensAddress || standard.ensAddress || null),\n _defaultProvider: defaultProvider\n };\n}", "constructor() { \n \n MozuCoreApiContractsAddress.initialize(this);\n }", "function lib_esm_getNetwork(network) {\n // No network (null)\n if (network == null) {\n return null;\n }\n if (typeof (network) === \"number\") {\n for (const name in networks) {\n const standard = networks[name];\n if (standard.chainId === network) {\n return {\n name: standard.name,\n chainId: standard.chainId,\n ensAddress: (standard.ensAddress || null),\n _defaultProvider: (standard._defaultProvider || null)\n };\n }\n }\n return {\n chainId: network,\n name: \"unknown\"\n };\n }\n if (typeof (network) === \"string\") {\n const standard = networks[network];\n if (standard == null) {\n return null;\n }\n return {\n name: standard.name,\n chainId: standard.chainId,\n ensAddress: standard.ensAddress,\n _defaultProvider: (standard._defaultProvider || null)\n };\n }\n const standard = networks[network.name];\n // Not a standard network; check that it is a valid network in general\n if (!standard) {\n if (typeof (network.chainId) !== \"number\") {\n lib_esm_logger.throwArgumentError(\"invalid network chainId\", \"network\", network);\n }\n return network;\n }\n // Make sure the chainId matches the expected network chainId (or is 0; disable EIP-155)\n if (network.chainId !== 0 && network.chainId !== standard.chainId) {\n lib_esm_logger.throwArgumentError(\"network chainId mismatch\", \"network\", network);\n }\n // @TODO: In the next major version add an attach function to a defaultProvider\n // class and move the _defaultProvider internal to this file (extend Network)\n let defaultProvider = network._defaultProvider || null;\n if (defaultProvider == null && standard._defaultProvider) {\n if (isRenetworkable(standard._defaultProvider)) {\n defaultProvider = standard._defaultProvider.renetwork(network);\n }\n else {\n defaultProvider = standard._defaultProvider;\n }\n }\n // Standard Network (allow overriding the ENS address)\n return {\n name: network.name,\n chainId: standard.chainId,\n ensAddress: (network.ensAddress || standard.ensAddress || null),\n _defaultProvider: defaultProvider\n };\n}", "async loadBlockchainData() {\n const Web3 = require('web3')\n const web3Extension = require('@energi/web3-ext');\n const web3 = new Web3(Web3.givenProvider || \"https://nodeapi.test3.energi.network\")\n\n web3Extension.extend(web3);\n\n// instantiate the contract and the Metamask app\n\n const election = await new web3.eth.Contract(election_ABI, election_address)\n\n this.setState({Contract: election})\n\n const accounts = await web3.eth.getAccounts()\n\n this.setState({account: accounts[0]})\n\n\n// instantiate the methods of the contract\n\n const getCandidate = await election.methods.candidateName().call()\n this.setState({candidateName: getCandidate})\n\n\n}", "function getNetwork(network) {\n // No network (null)\n if (network == null) {\n return null;\n }\n if (typeof (network) === \"number\") {\n for (var name_1 in networks) {\n var standard_1 = networks[name_1];\n if (standard_1.chainId === network) {\n return {\n name: standard_1.name,\n chainId: standard_1.chainId,\n ensAddress: (standard_1.ensAddress || null),\n _defaultProvider: (standard_1._defaultProvider || null)\n };\n }\n }\n return {\n chainId: network,\n name: \"unknown\"\n };\n }\n if (typeof (network) === \"string\") {\n var standard_2 = networks[network];\n if (standard_2 == null) {\n return null;\n }\n return {\n name: standard_2.name,\n chainId: standard_2.chainId,\n ensAddress: standard_2.ensAddress,\n _defaultProvider: (standard_2._defaultProvider || null)\n };\n }\n var standard = networks[network.name];\n // Not a standard network; check that it is a valid network in general\n if (!standard) {\n if (typeof (network.chainId) !== \"number\") {\n logger.throwArgumentError(\"invalid network chainId\", \"network\", network);\n }\n return network;\n }\n // Make sure the chainId matches the expected network chainId (or is 0; disable EIP-155)\n if (network.chainId !== 0 && network.chainId !== standard.chainId) {\n logger.throwArgumentError(\"network chainId mismatch\", \"network\", network);\n }\n // @TODO: In the next major version add an attach function to a defaultProvider\n // class and move the _defaultProvider internal to this file (extend Network)\n var defaultProvider = network._defaultProvider || null;\n if (defaultProvider == null && standard._defaultProvider) {\n if (isRenetworkable(standard._defaultProvider)) {\n defaultProvider = standard._defaultProvider.renetwork(network);\n }\n else {\n defaultProvider = standard._defaultProvider;\n }\n }\n // Standard Network (allow overriding the ENS address)\n return {\n name: network.name,\n chainId: standard.chainId,\n ensAddress: (network.ensAddress || standard.ensAddress || null),\n _defaultProvider: defaultProvider\n };\n}", "async setInstanceNetworkID(\n TruffleContractInstance,\n chainNetworkID,\n gasLimit\n ) {\n // if chainNetworkID already present as network configuration, use it\n if (TruffleContractInstance.hasNetwork(chainNetworkID)) {\n TruffleContractInstance.setNetwork(chainNetworkID);\n return {\n id: TruffleContractInstance.network_id,\n blockLimit: gasLimit\n };\n }\n // chainNetworkID not present,\n // parse all known networks\n const matchedNetwork = await Utils.parseKnownNetworks(\n TruffleContractInstance,\n gasLimit\n );\n if (matchedNetwork) return matchedNetwork;\n\n // network unknown, trust the provider and use given chainNetworkID\n TruffleContractInstance.setNetwork(chainNetworkID);\n return { id: TruffleContractInstance.network_id, blockLimit: gasLimit };\n }", "async setInstanceNetworkID(\n TruffleContractInstance,\n chainNetworkID,\n gasLimit\n ) {\n // if chainNetworkID already present as network configuration, use it\n if (TruffleContractInstance.hasNetwork(chainNetworkID)) {\n TruffleContractInstance.setNetwork(chainNetworkID);\n return {\n id: TruffleContractInstance.network_id,\n blockLimit: gasLimit\n };\n }\n // chainNetworkID not present,\n // parse all known networks\n const matchedNetwork = await Utils.parseKnownNetworks(\n TruffleContractInstance,\n gasLimit\n );\n if (matchedNetwork) return matchedNetwork;\n\n // network unknown, trust the provider and use given chainNetworkID\n TruffleContractInstance.setNetwork(chainNetworkID);\n return { id: TruffleContractInstance.network_id, blockLimit: gasLimit };\n }", "constructor(networkClient, network) {\n this.networkClient = networkClient;\n this.network = network;\n }", "async componentWillMount() {\n await this.contract.loadContract()\n }", "async init() {\n if (!this.eventStoreFactoryContractInstance) {\n this.eventStoreFactoryContractInstance = await this.eventStoreFactoryContract.deployed();\n }\n }", "async connectToContract(){\n\n await this.auctionContract.connect( App.provider.getSigner(), this.auctionContract.contractAddress);\n this.auctionContract.registerToEvents(sellerUI);\n }", "async function deployContract(walletObj) {\n console.log('DCWalletBuild', DCWalletBuild)\n\n // Create an instance of a Contract Factory\n let factory = new ethers.ContractFactory(DCWalletBuild.abi, DCWalletBuild.bytecode, walletObj);\n console.log('factory done')\n\n // Notice we pass in \"Hello World\" as the parameter to the constructor\n let provider = new ethers.providers.Web3Provider(wallet);\n let network = await provider.getNetwork();\n contract = await factory.deploy([USDC.networks[network.chainId].address, TCAD.networks[network.chainId].address]);\n console.log('factory.deploy done')\n\n // The address the Contract WILL have once mined\n // See: https://ropsten.etherscan.io/address/0x2bd9aaa2953f988153c8629926d22a6a5f69b14e\n console.log('contract.address', contract.address);\n // \"0x2bD9aAa2953F988153c8629926D22A6a5F69b14E\"\n\n // The transaction that was sent to the network to deploy the Contract\n // See: https://ropsten.etherscan.io/tx/0x159b76843662a15bd67e482dcfbee55e8e44efad26c5a614245e12a00d4b1a51\n console.log('contract.deployTransaction.hash', contract.deployTransaction.hash);\n // \"0x159b76843662a15bd67e482dcfbee55e8e44efad26c5a614245e12a00d4b1a51\"\n\n // The contract is NOT deployed yet; we must wait until it is mined\n await contract.deployed()\n\n // Done! The contract is deployed.\n return contract.address\n}", "async function loadContract(address) {\n return ethers.getContractFactory('Greeter').then(f => f.attach(address));\n}", "constructor() {\n this._contractInstance = undefined;\n\n if (typeof web3 !== 'undefined') {\n web3 = new Web3(web3.currentProvider);\n } else {\n let url = `http://${ blockchainConfig.host }:${ blockchainConfig.port }`;\n web3 = new Web3(new Web3.providers.HttpProvider(url));\n }\n }", "async loadBlockchainData() {\n const web3 = await window.web3;\n const account = await web3.eth.getAccounts(); // get the account from our blockchain data \n\n this.setState({ account: account[0] });\n console.log(account); // 0x6021e2c50B7Ff151EDb143e60DDf52358a33689B\n\n // set up network ID that we can connect to Tether contract\n const networkID = await web3.eth.net.getId();\n console.log(networkID) // 5777\n\n // load Tether Contract\n const tetherData = Tether.networks[networkID];\n if (tetherData) {\n const tether = new web3.eth.Contract(Tether.abi, tetherData.address) // ABI + Address \n this.setState({ tether });\n // load Tether balance\n let tetherBalance = await tether.methods.balanceOf(this.state.account).call();\n this.setState({ tetherBalance: tetherBalance.toString() }); // set to the state of tether.balance{}\n console.log({balance: tetherBalance}, 'tether balance')\n } else { // if we dont load tether data\n alert('Error! Tether contract data not available. Consider changing to the Ganache network.')\n }\n \n \n // load Reward token Contract\n const rewardData = Reward.networks[networkID];\n if (rewardData) {\n const reward = new web3.eth.Contract(Reward.abi, rewardData.address) // ABI + Address \n this.setState({ reward });\n // load Tether balance\n let rewardBalance = await reward.methods.balanceOf(this.state.account).call();\n this.setState({ rewardBalance: rewardBalance.toString() }); \n console.log({balance: rewardBalance})\n } else { \n alert('Error! Reward contract data not available. Consider changing to the Ganache network.')\n }\n\n // load Decentral Bank Contract\n const decentralBankData = DecentralBank.networks[networkID];\n if (decentralBankData) {\n const decentralBank = new web3.eth.Contract(DecentralBank.abi, decentralBankData.address) \n this.setState({ decentralBank });\n let stakingBalance = await decentralBank.methods.stakingBalance(this.state.account).call();\n this.setState({ stakingBalance: stakingBalance.toString() }); \n console.log({balance: stakingBalance})\n } else { \n alert('Error! Decentral Bank contract data not available. Consider changing to the Ganache network.')\n }\n\n this.setState({loading: false });\n }", "function loadContract (name) {\n loadScript (\n \"target/test-solc-js/\" + name + \".abi.js\");\n return web3.eth.contract (_);\n}", "async function load() {\n await loadWeb3();\n window.contract = await loadContract();\n await getMyFiles();\n window.contract.defaultAccount = await getCurrentAccount();\n console.log(window.contract.defaultAccount);\n}", "async function createNewContract() {\n var deploy = await LANDMARK.new()\n LANDMARK_instance = LANDMARK.at(deploy.address);\n}", "function getNetwork(network) {\n // No network (null)\n if (network == null) {\n return null;\n }\n if (typeof (network) === \"number\") {\n for (var name_1 in networks) {\n var standard_1 = networks[name_1];\n if (standard_1.chainId === network) {\n return {\n name: standard_1.name,\n chainId: standard_1.chainId,\n ensAddress: (standard_1.ensAddress || null),\n _defaultProvider: (standard_1._defaultProvider || null)\n };\n }\n }\n return {\n chainId: network,\n name: \"unknown\"\n };\n }\n if (typeof (network) === \"string\") {\n var standard_2 = networks[network];\n if (standard_2 == null) {\n return null;\n }\n return {\n name: standard_2.name,\n chainId: standard_2.chainId,\n ensAddress: standard_2.ensAddress,\n _defaultProvider: (standard_2._defaultProvider || null)\n };\n }\n var standard = networks[network.name];\n // Not a standard network; check that it is a valid network in general\n if (!standard) {\n if (typeof (network.chainId) !== \"number\") {\n errors.throwError(\"invalid network chainId\", errors.INVALID_ARGUMENT, { arg: \"network\", value: network });\n }\n return network;\n }\n // Make sure the chainId matches the expected network chainId (or is 0; disable EIP-155)\n if (network.chainId !== 0 && network.chainId !== standard.chainId) {\n errors.throwError(\"network chainId mismatch\", errors.INVALID_ARGUMENT, { arg: \"network\", value: network });\n }\n // Standard Network (allow overriding the ENS address)\n return {\n name: network.name,\n chainId: standard.chainId,\n ensAddress: (network.ensAddress || standard.ensAddress || null),\n _defaultProvider: (network._defaultProvider || standard._defaultProvider || null)\n };\n}", "async function getContractInterface(contractName) {\n console.log(`\\nCalling getContractInterface(${contractName})`);\n return new Promise((resolve, reject) => {\n const options = {\n url: `${url}/metadata/contractInterface`,\n method: 'GET',\n json: true,\n body: { contractName },\n };\n request(options, (err, res, body) => {\n if (err) reject(err);\n else resolve(body.data);\n });\n });\n}", "async insertContract(ctx, contractDetails) {\n try {\n let contractInfo = JSON.parse(contractDetails.trim());\n if(!contractInfo.name) {\n return 'Contract must have a name';\n }\n if(!contractInfo.owner) {\n return 'Contract must have an owner';\n }\n if(!contractInfo.contactInfo) {\n return 'Contract must have contact info';\n }\n if(!contractInfo.thirdpartyusage) {\n return 'Missing condition for third party usage';\n }\n if(!contractInfo.offerings) {\n return 'Missing offerings';\n }\n if(!contractInfo.requirements){\n return 'Missing requirements';\n }\n if(!contractInfo.dataSources) {\n return 'Contract must provide data sources';\n }\n if(!contractInfo.limit) {\n return 'Contract must have a limit';\n }\n if(!contractInfo.stage) {\n return 'Contract must have a stage';\n }\n if(!contractInfo.lifetime) {\n return 'Contract must have a lifetime';\n }\n if(!contractInfo.restrictions) {\n return 'Missing restrictions field';\n }\n let currentContracts = await ctx.stub.getState('contracts'); \n if(!currentContracts.length > 1) {\n currentContracts = new HashMap();\n }\n if (contractDetails.uuid) { \n\n let existingContract = await ctx.stub.getState(contractDetails.uuid);\n await ctx.stub.putState(contractDetails.uuid, JSON.stringify(contractInfo));\n \n currentContracts.set(contractDetails.uuid, contractDetails); \n await ctx.stub.putState('contracts', currentContracts);\n if (existingContract.length > 0) {\n return 'replaced existing contract with the new contract: ' +JSON.stringify(contractInfo) + ' at id '+contractId; \n }\n else {\n return 'Inserted new contract :' + contractInfo + ' with id '+contractId;\n } \n \n } else {\n let uid = uuidv5(contractInfo.name, namespace);\n await ctx.stub.putState(uid, JSON.stringify(contractInfo));\n return 'contract with new id ' + uid + ' and details: ' + contractDetails + ' has been inserted';\n } \n } catch (error) {\n return ' JSON parse failed on '+ contractDetails + ' with error ' +error;\n } \n }", "constructor() {\n this.network = null;\n }", "constructor(networkClient) {\n this.networkClient = networkClient;\n }", "function initNetwork() {\n\tlog(\"Initialized new network.\");\n\tnetwork = new NeuralNet(NET_STATE_SIZE, NOTE_RANGE, NOTE_RANGE);\n}", "async function deployContract() {\n /*\n `miniERC20.constructor` is construct method of `MiniERC20` contract,\n send constructor encoded transaction to deploy a contract,\n await till transaction `executed` to get receipt.\n */\n const receipt = await miniERC20\n .constructor('MiniERC20', 18, 'MC', 10000)\n .sendTransaction({ from: accountAlice })\n .executed();\n\n console.log('receipt', JSON.stringify(receipt, null, 2));\n // outcomeStatus == 0 means success, got created contract address '0x8ba2e83e8d58ad37c91ad72ea35961846b16793b'\n /*\n receipt {\n \"index\": 0,\n \"epochNumber\": 711763,\n \"outcomeStatus\": 0,\n \"gasUsed\": \"1054467\",\n \"gasFee\": \"1054467000000000\",\n \"blockHash\": \"0xb70ae9034ee2393f02d9afa4c5b2624f17f78ebdc06f6ec00c9421246fde1717\",\n \"contractCreated\": \"CFXTEST:TYPE.CONTRACT:ACF4F4B8VZPM4R8KDNNW7J43PGCG0FX3HPKZE0ZZEU\",\n \"from\": \"CFXTEST:TYPE.USER:AAR7X4R8MKRNW39GGS8RZ40J1ZNWH5MRRPUFPR2U76\",\n \"logs\": [],\n \"logsBloom\": \"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\n \"stateRoot\": \"0x27ef34b1b70e3ee86d3154086c79d9ec8e391e33ffad046f232e47826079237a\",\n \"to\": null,\n \"transactionHash\": \"0x0215231b0f9f108dee4fc2a7b12f32ab5e14992d59506c05f96410fe6715c1d1\",\n \"txExecErrorMsg\": null\n }\n */\n}", "async function deployContract(){\n\n let abiPath = path.join(__dirname + '/bin/DataStorageEvent.abi');\n let binPath = path.join(__dirname + '/bin/DataStorageEvent.bin');\n\n console.log(chalk.green(abiPath));\n console.log(chalk.green(binPath));\n\n let abi = fs.readFileSync(abiPath);\n // let bin = '0x' + fs.readFileSync(binPath); updated version of ganache-cli does not need 'Ox' to be added to depict hexadecimal.\n let bin = fs.readFileSync(binPath);\n\n\n let contract = new web3.eth.Contract(JSON.parse(abi));\n\n console.log()\n // Returns an object of abstract contract.\n let status = await contract.deploy({\n data: bin,\n arguments: [100]\n }).send({\n from: '0x96b6E861698DfBA5721a3Ccd9AfBCa808e360bf3',\n gasPrice: 1000,\n gas: 300000\n })\n\n console.log(chalk.red('Address of Contract Deployed : ' + status.options.address));\n}", "function setupContract(address) {\n if(!abis) {\n window.alert(\"ABI data not loaded\");\n return;\n }\n\n // Load contract ABI data\n var EInvoicingRegistry = web3.eth.contract(abis.EInvoicingRegistry.abi);\n\n // Instiate proxy object\n contract = EInvoicingRegistry.at(address);\n\n try {\n var ver = contract.version();\n } catch(e) {\n window.alert(\"Error communicating with the contract:\" + e);\n return;\n }\n\n if(!ver) {\n window.alert(\"Contract seems to be invalid\");\n return;\n }\n\n $(\"#active-address\").text(address);\n $(\"#active-version\").text(ver);\n $(\"#alert-contract-success\").show();\n\n $(\"#contract-manipulation input, #contract-manipulation button, #contract-manipulation textarea\").removeAttr(\"disabled\");\n\n window.localStorage.setItem(\"contractAddress\", address);\n window.contract = contract;\n }", "async initWeb3() {\n try {\n const ethereumUrl = `${config.ethereum.protocol}://${config.ethereum.host}`\n this.web3 = new Web3(new Web3.providers.HttpProvider(ethereumUrl))\n\n this.networkId = await this.getNetworkId()\n this.network = await this.getNetwork()\n\n return true\n } catch (err) {\n // remote not available\n return false\n }\n }", "constructor(network) {\n logger.checkNew(new.target, __WEBPACK_IMPORTED_MODULE_0__ethersproject_abstract_provider__[\"a\" /* Provider */]);\n super();\n // Events being listened to\n this._events = [];\n this._emitted = { block: -2 };\n this.formatter = new.target.getFormatter();\n // If network is any, this Provider allows the underlying\n // network to change dynamically, and we auto-detect the\n // current network\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"anyNetwork\", (network === \"any\"));\n if (this.anyNetwork) {\n network = this.detectNetwork();\n }\n if (network instanceof Promise) {\n this._networkPromise = network;\n // Squash any \"unhandled promise\" errors; that do not need to be handled\n network.catch((error) => { });\n // Trigger initial network setting (async)\n this._ready().catch((error) => { });\n }\n else {\n const knownNetwork = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__ethersproject_properties__[\"e\" /* getStatic */])((new.target), \"getNetwork\")(network);\n if (knownNetwork) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"_network\", knownNetwork);\n this.emit(\"network\", knownNetwork, null);\n }\n else {\n logger.throwArgumentError(\"invalid network\", \"network\", network);\n }\n }\n this._maxInternalBlockNumber = -1024;\n this._lastBlockNumber = -2;\n this._pollingInterval = 4000;\n this._fastQueryDate = 0;\n }", "static set network(network) {\n Config._network = network;\n }", "function loadContract() {\n \n// sources.contracts.query(\"GALO_ContractNum == :1 and BillToCompanyID = :2\", {\n// params: [GALO_ContractNum, clientKey],\n\t\t\tsources.contracts.query(\"ContractID == :1 or GALO_ContractNum == :1\", {\n params: [contractID],\n onSuccess: function() {\n if (sources.contracts.length > 0) {\n viewCompWidget.loadComponent({\n onSuccess: function() {\n Wap.viewComp = $$(this.id);\n Wap.viewComp.displayContractDetail(sources.contracts.ContractID);\n }\n });\n } else {\n viewCompWidget.hide();\n sorryText.show();\n }\n },\n onError: function() {\n viewCompWidget.hide();\n sorryText.show();\n }\n });\n }", "async function main() {\n if(bre.network.name.indexOf(\"sidechain\")>=0 || bre.network.name.indexOf(\"sokol\")>=0){\n const Liker = await deploy(\"Liker\")\n const NiftyRegistry = await deploy(\"NiftyRegistry\")\n const NiftyInk = await deploy(\"NiftyInk\")\n const NiftyToken = await deploy(\"NiftyToken\")\n const NiftyMediator = await deploy(\"NiftyMediator\")\n await NiftyRegistry.setInkAddress(NiftyInk.address)\n await NiftyRegistry.setTokenAddress(NiftyToken.address)\n await NiftyRegistry.setBridgeMediatorAddress(NiftyMediator.address)\n await NiftyInk.setNiftyRegistry(NiftyRegistry.address)\n await NiftyToken.setNiftyRegistry(NiftyRegistry.address)\n await NiftyMediator.setNiftyRegistry(NiftyRegistry.address)\n await Liker.addContract(NiftyInk.address)\n\n if(bre.network.name.indexOf(\"kovan\")>=0){\n await NiftyMediator.setBridgeContract(\"0xFe446bEF1DbF7AFE24E81e05BC8B271C1BA9a560\")\n await NiftyRegistry.setTrustedForwarder(\"0x77777e800704Fb61b0c10aa7b93985F835EC23fA\")\n await NiftyMediator.setRequestGasLimit(\"1500000\")\n }\n\n if(bre.network.name.indexOf(\"sidechain\")>=0) {\n let trustedForwarder\n try{\n await NiftyMediator.setBridgeContract(\"0x9539a46432a405f0CCc1a1fceaD5866bFf271B04\")\n await NiftyMediator.setRequestGasLimit(\"1500000\")\n\n let trustedForwarderObj = JSON.parse(fs.readFileSync(\"../react-app/src/gsn/Forwarder.json\"))\n console.log(\"⛽️ Setting GSN Trusted Forwarder on NiftyRegistry to \",trustedForwarderObj.address)\n await NiftyRegistry.setTrustedForwarder(trustedForwarderObj.address)\n console.log(\"⛽️ Setting GSN Trusted Forwarder on Liker to \",trustedForwarderObj.address)\n await Liker.setTrustedForwarder(trustedForwarderObj.address)\n }catch(e){\n console.log(e)\n }\n }\n }\n\n if(bre.network.name.indexOf(\"localhost\")>=0 || bre.network.name.indexOf(\"kovan\")>=0){\n const NiftyMain = await deploy(\"NiftyMain\")\n\n if(bre.network.name.indexOf(\"kovan\")>=0) {\n await NiftyMain.setBridgeContract(\"0xFe446bEF1DbF7AFE24E81e05BC8B271C1BA9a560\")\n await NiftyMain.setMediatorContractOnOtherSide(\"0x339d0e6f308a410F18888932Bdf661636A0F538f\")\n await NiftyMain.setRequestGasLimit(\"1500000\")\n }\n\n if(bre.network.name.indexOf(\"localhost\")>=0) {\n await NiftyMain.setBridgeContract(\"0x9539a46432a405f0CCc1a1fceaD5866bFf271B04\")\n await NiftyMain.setRequestGasLimit(\"1500000\")\n let MediatorAddress = fs.readFileSync(bre.config.paths.artifacts + \"/NiftyMediator.address\").toString()\n await NiftyMain.setMediatorContractOnOtherSide(MediatorAddress)\n }\n }\n}", "async function init() {\n await connect(\"bsc\");\n const provider = new ethers.providers.Web3Provider(window.BinanceChain)\n const signer = provider.getSigner(account);\n const contract = new ethers.Contract(CONTRACT_ADDRESS, Company.abi, signer);\n\n // listen for minted companies\n contract.on(\"UKCompanyMinted\", async () => {\n console.log('Company Minted', arguments);\n await loadTokens();\n });\n }", "async _init() {\n if (!this._isInitialized) {\n\n this._account = await getDefaultAccount(this._web3)\n this._ipfs = ipfsAPI('localhost', '5002', {protocol: 'http'}) \n\n if (await isOpenCollabRepo(this._repoPath)) {\n this.isOpenCollabRepo = true\n this._contractAddress = await common.getContractAddress(this._repoPath)\n }\n else\n this.isOpenCollabRepo = false\n\n this._isInitialized = true\n }\n }", "deploy(contractAddress = null) {\n // if this isn't compiled yet, we need to compile it for the bytecode and web3 interface (abi)\n if (!this.compiled) {\n this.compile();\n }\n // if there is an address passed in then assume that it is already deployed\n if (contractAddress !== null) {\n this.contractAddress = contractAddress;\n return this.node1.then((web3) => {\n this.contractInterface = new web3.eth.Contract(this.abi, this.contractAddress);\n return this.contractAddress;\n });\n }\n\n // No address provided so let's deploy a new one onto the chain\n return this.node1.then((web3) => {\n let contract = new web3.eth.Contract(this.abi);\n console.log(\"Getting default account from node1 to deploy new contract\");\n return web3.eth.getAccounts().then((accounts) => {\n console.log(\"Deploying new contract from address: \" + accounts[0]);\n return contract.deploy({ data: this.bytecode, arguments: [defaultValue] }).send({\n data: this.bytecode,\n from: accounts[0],\n gasPrice: 0,\n gas: 2000000\n }).then((response) => {\n //console.log(response);\n this.contractAddress = response._address;\n this.contractInterface = new web3.eth.Contract(this.abi, this.contractAddress);\n return this.contractAddress;\n })\n })\n })\n\n }", "constructor() {\n this.node1 = getWeb3(0);\n this.node2 = getWeb3(1); // this node is not used in this example\n this.compiled = false;\n this.contractAddress = \"\";\n }", "async initAccounts() {\n if (window['ethereum']) {\n try {\n //returns the active address\n await window['ethereum'].enable()\n } catch (error) {}\n }\n\n\n }", "async function createContract(client, fromPrivateKey, fromPublicKey, toPublicKey) {\n const web3 = new Web3(client.url)\n // web3Quorum in quorum mode (web3 client, enclave options, isQuorum)\n // https://consensys.github.io/web3js-quorum/latest/Web3Quorum.html\n const web3quorum = new Web3Quorum(web3, {privateUrl: client.privateUrl}, true);\n\n // unlock the account so you can sign the tx; uses web3.eth.accounts.decrypt(keystoreJsonV3, password);\n const accountKeyPath = path.resolve(__dirname, '../../','config/quorum/networkFiles', client.name ,'accountkey');\n const accountKey = JSON.parse(fs.readFileSync(accountKeyPath));\n const signingAccount = web3.eth.accounts.decrypt(accountKey, \"\");\n\n // get the nonce for the accountAddress\n const accountAddress = client.accountAddress;\n const txCount = await web3.eth.getTransactionCount(`0x${accountAddress}`);\n\n const txOptions = {\n nonce: txCount,\n gasPrice: 0, //ETH per unit of gas\n gasLimit: 0x24A22, //max number of gas units the tx is allowed to use\n value: 0,\n data: '0x'+contractBin+contractConstructorInit,\n from: signingAccount,\n isPrivate: true,\n privateKey: fromPrivateKey,\n privateFrom: fromPublicKey,\n privateFor: [toPublicKey]\n };\n console.log(\"Creating contract...\");\n // Generate and send the Raw transaction to the Besu node using the eea_sendRawTransaction JSON-RPC call\n const txHash = await web3quorum.priv.generateAndSendRawTransaction(txOptions);\n console.log(\"Getting contractAddress from txHash: \", txHash);\n return txHash\n}", "async function main() {\n const contractName = \"UniLion\";\n const [ deployer ] = await hre.ethers.getSigners();\n const network = await hre.ethers.provider.getNetwork() // needs to be this router address for testnet in order for swapbnb to work\n const routerAddress = (network.name == \"bnb\") ? \"0x10ED43C718714eb63d5aA57B78B54704E256024E\" : \"0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3\" // or testnet: 0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3, 0xD99D1c33F9fC3444f8101754aBC46c52416550D1\n const balance = await deployer.getBalance();\n console.log(`Deploying on network: ${network.name}, using router address ${routerAddress}`)\n console.log(`Deploying Contract with Account: ${deployer.address}`) \n console.log(`Account Balance: ${balance.toString()}`) \n const contract = await hre.ethers.getContractFactory(contractName);\n const unilion = await contract.deploy(routerAddress, snipers.addresses);\n await unilion.deployed();\n console.log(\"UniLion Contract Deployed:\", unilion.address);\n if (network.name != 'unknown') {\n let blockchainHost = (network.name != 'bnbt') ? \"bscscan.com\" : \"testnet.bscscan.com\"\n console.log(`Contract URL: https://${blockchainHost}/address/${unilion.address}`)\n }\n console.log(`Console Script: const token = await (await ethers.getContractFactory(\"${contractName}\")).attach(\"${unilion.address}\")`)\n}", "function loadContract(arweave, contractID, contractSrcTXID) {\n return __awaiter(this, void 0, void 0, function* () {\n // Generate an object containing the details about a contract in one place.\n const contractTX = yield arweave.transactions.get(contractID);\n const contractOwner = yield arweave.wallets.ownerToAddress(contractTX.owner);\n contractSrcTXID = contractSrcTXID || utils_1.getTag(contractTX, 'Contract-Src');\n const minFee = utils_1.getTag(contractTX, 'Min-Fee');\n const contractSrcTX = yield arweave.transactions.get(contractSrcTXID);\n const contractSrc = contractSrcTX.get('data', { decode: true, string: true });\n let state;\n if (utils_1.getTag(contractTX, 'Init-State')) {\n state = utils_1.getTag(contractTX, 'Init-State');\n }\n else if (utils_1.getTag(contractTX, 'Init-State-TX')) {\n const stateTX = yield arweave.transactions.get(utils_1.getTag(contractTX, 'Init-State-TX'));\n state = stateTX.get('data', { decode: true, string: true });\n }\n else {\n state = contractTX.get('data', { decode: true, string: true });\n }\n const { handler, swGlobal } = createContractExecutionEnvironment(arweave, contractSrc, contractID, contractOwner);\n return {\n id: contractID,\n contractSrcTXID,\n contractSrc,\n initState: state,\n minFee,\n contractTX,\n handler,\n swGlobal,\n };\n });\n}", "function init() {\n self = {};\n fBalance = 0;\n if ( fAddress === undefined && fCryptPrivateKey === undefined ) {\n createNewAddress();\n }\n }", "async function createSmartContracts() {\n console.log('Setting smart contract scripts...');\n AUCTION_SCRIPT_ADDRESS = await createAuctionContract()\n \n BIDDER_SCRIPT_ADDRESS = await createBidContract()\n\n listAuctions()\n}", "async function init() {\r\n\r\n await fs.connect();\r\n //===========================Init Data ==============================\r\n var idnInformation = await idn.getIdentity();\r\n var idnRegis = {\r\n ip: idnInformation.ip,\r\n name: idnInformation.hostname,\r\n status: 'online',\r\n actionResult: []\r\n }\r\n idnRegis.actionResult.push({ tag: 'indentity-information', isDone: true, payload: idnInformation, message: null });\r\n console.log(idnRegis);\r\n //===========================Init Data ==============================\r\n fs.add(idnRegis).then((val) => {\r\n connectionID = val.id;\r\n console.log('connect success id : ' + val.id);\r\n var ipText = document.getElementById('connectionIP');\r\n ipText.innerHTML = 'Connection ID : ' + connectionID;\r\n listenning(connectionID);\r\n });\r\n}", "async getBlockNumber(network) {\n let blockNumber = await this.getProvider(network).getBlockNumber();\n return {\n blockNumber\n };\n }", "async function resolve(contractAddress,entryKey){\n Tezos = window.taquito.Tezos\n //NOTE: USING TESTNET\n Tezos.setProvider({rpc: 'https://carthagenet.SmartPy.io'})\n \n //Get contract\n const contract = await Tezos.contract.at(contractAddress)\n //Get storage of contract\n const storage = await contract.storage()\n //Get value associated with entryKey, from the map keyToCID\n const value = await storage.keyToCID.get(entryKey)\n //Return value\n return value\n}", "static initialize(obj, networkIdentifier, blockIdentifier) { \n obj['network_identifier'] = networkIdentifier;\n obj['block_identifier'] = blockIdentifier;\n }", "async instantiate(ctx) {\n console.log(\"Smart Contract Instantiated\");\n }", "function deploy_contract() {\n web3.eth.getGasPrice(function(error, gas_price) {\n console.log(\"Gas price: \" + gas_price);\n if (!error) {\n web3.eth.getBlock(\"latest\", function(error, block) {\n console.log(\"The gas block limit is: \" + block.gasLimit.toString());\n if (!error) {\n var transaction_object = {\n chainId: web3.utils.toHex(newBlockchain.getChainId()),\n from: document.getElementById(\"public_key_input\").value,\n gasPrice: web3.utils.toHex(gas_price),\n gas: web3.utils.toHex(block.gasLimit.toString()),\n data: bytecode\n };\n web3.eth.accounts.signTransaction(transaction_object, document.getElementById(\"private_key_input\").value, function(error, signed_tx) {\n if (!error) {\n web3.eth.sendSignedTransaction(signed_tx.rawTransaction, function(error, sent_tx) {\n if (!error) {\n document.getElementById(\"deploy_contract_output\").innerHTML = \"Please wait for about 10 seconds for transaction to be confirmed ...\";\n setTimeout(function() {\n web3.eth.getTransactionReceipt(sent_tx, function(err, res_rec) {\n if (!err) {\n if (res_rec != null && res_rec != undefined) {\n //console.log(\"Success, we now have a transaction receipt: \" + JSON.stringify(res_rec));\n document.getElementById(\"deploy_contract_output\").innerHTML = \"Contract address: \" + res_rec[\"contractAddress\"];\n newContract.setAddress(res_rec[\"contractAddress\"]);\n console.log(\"New contract at: \" + newContract.getAddress());\n var multiswapContractInstance = new web3.eth.Contract(abi, res_rec[\"contractAddress\"]);\n newContract.setContractInstanceObject(multiswapContractInstance);\n }\n } else {\n console.log(\"Unable to get transaction receipt \" + err);\n }\n });\n }, 60000);\n\n } else {\n console.log(\"*\\nSend signed transaction failed: \" + error);\n }\n });\n } else {\n console.log(error);\n }\n });\n\n } else {\n console.log(error);\n }\n });\n\n } else {\n console.log(error);\n }\n });\n}", "initializeIC ({ commit, state, dispatch }) {\r\n if (!state.contractValues.ownerPrivateKeyWIF || !state.contractValues.heirPrivateKeyWIF) {\r\n const ownerPrivateKeyWIF = newWIF(state.contractValues.networkChoice);\r\n const heirPrivateKeyWIF = newWIF(state.contractValues.networkChoice);\r\n commit('setContractValues', { ownerPrivateKeyWIF, heirPrivateKeyWIF });\r\n // redo the ready/valid checks\r\n dispatch('updatePageStatusIC');\r\n }\r\n }", "constructor() { \n \n IdentityAddress.initialize(this);\n }", "static usePublicNetwork() {\n this.use(new Network(Networks.PUBLIC));\n }", "async instantiate ({ codeId, initMsg = {}, label = '' }) {\n const initTx = await this.API.instantiate(codeId, initMsg, label)\n const codeHash = await this.API.getCodeHashByContractAddr(initTx.contractAddress)\n return { ...initTx, codeId, label, codeHash }\n }", "async instantiate(ctx){\n console.log('************ Pharnet Transporter Smart Contract Instantiated *************');\n\t}", "async function main() {\n\n const CONTRACTS = [ \n { address: \"0xCdB0c60EA5bF50641A570E25875EAB6c889E949d\", abi : DYNAMIC_FARM_ABI, rewardToken: \"dynamicTracker\", stakeToken: \"lpt\"},\n { address: \"0x030cF06D8A39d5Ef4b169EAc0D4D5B0c51b42194\", abi : DYNAMIC_FARM_ABI, rewardToken: \"dynamicTracker\", stakeToken: \"lpt\"}\n ];\n \n const App = await init_ethers();\n \n _print(`Initialized ${App.YOUR_ADDRESS}`);\n _print(\"Reading smart contracts...\\n\");\n \n var tokens = {};\n var prices = {};\n let tvl = 0;\n \n for (const c of CONTRACTS) {\n try {\n const { staked_tvl } =await loadSynthetixPool(App, tokens, prices, c.abi, c.address, c.rewardToken, c.stakeToken);\n tvl += staked_tvl;\n }\n catch (ex) {\n console.error(ex);\n }\n }\n const BOARDROOM_ADDRESS = \"0x175B1A116028508aC3A4e4B62722b845C3bD1ab3\";\n const ORACLE_ADDRESS = \"0x3a9a1cec3546b4fb810756cd3ad072a3d6345a8a\"\n const DAI_DST_ADDRESS = \"0x706b21bf60adb79d2326d39086e4c27766193185\"\n const REWARD_TOKEN_ADDRESS = \"0xfa9c3dc54baa9eefbe9453b1f3b3b93ad2af0a77\";\n\n const br_tvl = await loadBoardroom(App, prices, BOARDROOM_ADDRESS, ORACLE_ADDRESS, DAI_DST_ADDRESS, REWARD_TOKEN_ADDRESS,\n \"DSTR\", \"DST\", 4, 0.1, 2, 1, 24);\n tvl += br_tvl.staked_tvl;\n _print_bold(`Total staked: $${formatMoney(tvl)}`);\n\n hideLoading();\n }", "deploy() {\n if (this.deployed && this.contractAddress) {\n console.log(\"Deploy function already called\");\n this.UserContract = this.USER.then(web3 => {\n return new web3.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n this.JoeContract = this.JOE.then(web3 => {\n return new web3.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n this.StoreContract = this.STORE.then(web3 => {\n return new web3.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n\n return new Promise((resolve) => {resolve(this.contractAddress)});\n }\n\n // else deploy the contract\n return this.STORE.then((web3) => {\n let bytecode = KaleidoKardsContract.bytecode;\n let abi = KaleidoKardsContract.abi;\n\n let contract = new web3.eth.Contract(abi);\n console.log(\"Getting kard_store account to deploy new contract\");\n return web3.eth.getAccounts().then((accounts) => {\n console.log(\"Deploying new contract from address: \" + accounts[0]);\n return contract.deploy({data: bytecode}).send({data: bytecode, from: accounts[0], gasPrice: 0, gas: 2000000})\n .then( (response) => {\n this.contractAddress = response._address;\n console.log(\"Successfully deployed at address: \" + this.contractAddress);\n\n this.UserContract = this.USER.then(response => {\n // return new response.eth.Contract(KaleidoKardsContract.abi, '0xb7a996f99afff30a8a7c5b95aa9617f0985da9ee');\n return new response.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n this.JoeContract = this.JOE.then(response => {\n // return new response.eth.Contract(KaleidoKardsContract.abi, '0xb7a996f99afff30a8a7c5b95aa9617f0985da9ee');\n return new response.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n this.StoreContract = this.STORE.then(response => {\n // return new response.eth.Contract(KaleidoKardsContract.abi, '0xb7a996f99afff30a8a7c5b95aa9617f0985da9ee');\n return new response.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n this.deployed = true;\n return this.contractAddress;\n });\n })\n })\n\n }", "function RouterContract(contract) {\n }", "checkNetworkArtifactMatch({ networks, network_id, contractName }) {\n if (networks[network_id] == null)\n throw new Error(\n `${contractName} has not been deployed to detected network (network/artifact mismatch)`\n );\n }", "checkNetworkArtifactMatch({ networks, network_id, contractName }) {\n if (networks[network_id] == null)\n throw new Error(\n `${contractName} has not been deployed to detected network (network/artifact mismatch)`\n );\n }", "async function deployContracts(deployer, network) {\n let saltAddr = this.contract.Salt;\n await deployer.deploy(SaltTrader, saltAddr);\n}", "async instantiate(ctx){\n console.log('Pharmanet Contract instantiated')\n }", "function getContractObject(){\n let abiPath = path.join(__dirname + '/bin/DataStorageEvent.abi');\n let abi = fs.readFileSync(abiPath);\n\n // Replace the contract address with the contract you want to invoke.\n // let contractAddress = '0xadb1e7fea9a24daee48492c3523721ea6b42f271'; // address of the deployed contract\n let options = {\n from: '0x96b6E861698DfBA5721a3Ccd9AfBCa808e360bf3',\n gasPrice: 1000,\n gas: 300000\n };\n let deployedContract = new web3.eth.Contract(JSON.parse(abi),contractAddress,options);\n return deployedContract;\n}", "constructor(ip, port, protocol = 'http', networkID = constants_1.DefaultNetworkID, XChainID = undefined, CChainID = undefined, hrp = undefined, skipinit = false) {\n super(ip, port, protocol);\n /**\n * Returns a reference to the Admin RPC.\n */\n this.Admin = () => this.apis.admin;\n /**\n * Returns a reference to the Auth RPC.\n */\n this.Auth = () => this.apis.auth;\n /**\n * Returns a reference to the EVMAPI RPC pointed at the C-Chain.\n */\n this.CChain = () => this.apis.cchain;\n /**\n * Returns a reference to the AVM RPC pointed at the X-Chain.\n */\n this.XChain = () => this.apis.xchain;\n /**\n * Returns a reference to the Health RPC for a node.\n */\n this.Health = () => this.apis.health;\n /**\n * Returns a reference to the Info RPC for a node.\n */\n this.Info = () => this.apis.info;\n /**\n * Returns a reference to the Metrics RPC.\n */\n this.Metrics = () => this.apis.metrics;\n /**\n * Returns a reference to the Keystore RPC for a node. We label it \"NodeKeys\" to reduce\n * confusion about what it's accessing.\n */\n this.NodeKeys = () => this.apis.keystore;\n /**\n * Returns a reference to the PlatformVM RPC pointed at the P-Chain.\n */\n this.PChain = () => this.apis.pchain;\n let xchainid = XChainID;\n let cchainid = CChainID;\n if (typeof XChainID === 'undefined'\n || !XChainID\n || XChainID.toLowerCase() === 'x') {\n if (networkID.toString() in constants_1.Defaults.network) {\n xchainid = constants_1.Defaults.network[networkID].X.blockchainID;\n }\n else {\n xchainid = constants_1.Defaults.network[12345].X.blockchainID;\n }\n }\n if (typeof CChainID === 'undefined'\n || !CChainID\n || CChainID.toLowerCase() === 'c') {\n if (networkID.toString() in constants_1.Defaults.network) {\n cchainid = constants_1.Defaults.network[networkID].C.blockchainID;\n }\n else {\n cchainid = constants_1.Defaults.network[12345].C.blockchainID;\n }\n }\n if (typeof networkID === 'number' && networkID >= 0) {\n this.networkID = networkID;\n }\n else if (typeof networkID === \"undefined\") {\n networkID = constants_1.DefaultNetworkID;\n }\n if (typeof hrp !== \"undefined\") {\n this.hrp = hrp;\n }\n else {\n this.hrp = helperfunctions_1.getPreferredHRP(this.networkID);\n }\n if (!skipinit) {\n this.addAPI('admin', api_1.AdminAPI);\n this.addAPI('auth', api_2.AuthAPI);\n this.addAPI('xchain', api_3.AVMAPI, '/ext/bc/X', xchainid);\n this.addAPI('cchain', api_4.EVMAPI, '/ext/bc/C/avax', cchainid);\n this.addAPI('health', api_5.HealthAPI);\n this.addAPI('info', api_6.InfoAPI);\n this.addAPI('keystore', api_7.KeystoreAPI);\n this.addAPI('metrics', api_8.MetricsAPI);\n this.addAPI('pchain', api_9.PlatformVMAPI);\n }\n }", "async function connectToEth() {\n setLoading(true);\n\n try {\n const [account] = await connect();\n setEthAddress(account);\n localStorage.setItem(\"ethAddress\", account);\n setLoading(false);\n\n // Use the address to get Auth Clients\n getAuthenticatedClients(account);\n } catch (error) {\n setLoading(false);\n }\n }", "_setMspidFromConfig() {\n\t\tif (!this._network_config) {\n\t\t\tthrow new Error('No network configuration has been loaded');\n\t\t}\n\n\t\tconst client_config = this._network_config.getClientConfig();\n\t\tif (client_config && client_config.organization) {\n\t\t\tlet organization_config = this._network_config.getOrganization(client_config.organization, true);\n\t\t\tif (organization_config) {\n\t\t\t\tthis._mspid = organization_config.getMspid();\n\t\t\t}\n\t\t}\n\t}", "constructor(scope, id, props) {\n super(scope, id, { type: CfnNetworkInterface.resourceTypeName, properties: props });\n cdk.requireProperty(props, 'subnetId', this);\n this.networkInterfacePrimaryPrivateIpAddress = this.getAtt('PrimaryPrivateIpAddress').toString();\n this.networkInterfaceSecondaryPrivateIpAddresses = this.getAtt('SecondaryPrivateIpAddresses').toList();\n this.networkInterfaceName = this.ref.toString();\n const tags = props === undefined ? undefined : props.tags;\n this.tags = new cdk.TagManager(cdk.TagType.Standard, \"AWS::EC2::NetworkInterface\", tags);\n }", "static get network()\n{\nreturn network;\n}" ]
[ "0.7202198", "0.7064355", "0.68463504", "0.68232316", "0.6729329", "0.67176574", "0.6618755", "0.65911233", "0.6493597", "0.64898986", "0.6466433", "0.64412105", "0.6373389", "0.629049", "0.6257765", "0.6217128", "0.61947113", "0.6179849", "0.6158657", "0.60866874", "0.60866874", "0.60866874", "0.60866874", "0.60866874", "0.60866874", "0.60866874", "0.60866874", "0.59988403", "0.59831905", "0.5963218", "0.5944942", "0.5933207", "0.59304154", "0.5913537", "0.5902752", "0.59021896", "0.58925045", "0.5891435", "0.5873258", "0.5868453", "0.5868453", "0.58626217", "0.5855872", "0.58456755", "0.5833372", "0.58291525", "0.5827312", "0.57940227", "0.5736251", "0.57339126", "0.5712453", "0.5702817", "0.5687579", "0.56782603", "0.56243443", "0.5615662", "0.5587327", "0.55722755", "0.5564647", "0.5554238", "0.5526998", "0.55194914", "0.5517901", "0.5507175", "0.5502747", "0.54936033", "0.5474376", "0.5469896", "0.5446313", "0.54443246", "0.5440796", "0.5432789", "0.5421527", "0.54194957", "0.54193527", "0.54010826", "0.5400505", "0.53963345", "0.5367816", "0.5366599", "0.5356831", "0.5352814", "0.5331299", "0.53164726", "0.5306249", "0.53058094", "0.5302876", "0.53022903", "0.5291836", "0.5278481", "0.52779347", "0.52779347", "0.5271949", "0.52636766", "0.5240677", "0.52396965", "0.5200977", "0.51825386", "0.51800925", "0.5177537" ]
0.53061754
85
Creates a new token, as long as we are not over our limit. createCitizen(string _name, address _to, uint _strength, uint _perception, uint _endurance, uint _charisma, uint _intelligence, uint _agility, uint _luck)
createCitizen() { let randomTokenID = web3.utils.randomHex(32); return this.contract.methods.mint(randomTokenID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createCharacter(name, nickname, race, origin, attack, defense, weapon = 'their fists') {\n let character = {\n name, nickname, race, origin, attack, defense, weapon,\n describe: () => `${name} is a ${race} from ${origin} who uses ${weapon}`,\n evaluateFight: (char) => `Your opponent takes ${attack - char.defense < 0 ? 0 : attack - char.defense} damage and you receive ${char.attack - defense < 0 ? 0 : char.attack - defense} damage`\n };\n \n if (character.weapon !== 'their fists') {\n character.attack += 2;\n }\n\n return character;\n}", "function createCharacter(name, nickName, race, origin, weapon, attack, defense) {\n // this.name = name;\n return {\n name,\n nickName,\n race,\n origin,\n weapon,\n attack,\n defense,\n describe() {\n console.log(`${this.name} is a ${this.race} of ${this.origin} who uses ${this.weapon}.`);\n },\n evaluateFight(opponent) {\n const myDamage = this.attack < opponent.defense ? 0 : this.attack - opponent.defense;\n const opponentDamage = opponent.attack < this.defense ? 0 : opponent.attack - this.defense;\n console.log(\n `Your opponent takes ${damage} damage and you receive ${opponentDamage} damage.`)\n },\n };\n}", "function createCharacter(name, nickname, race, origin, attack, defense, weapon){\n return {\n name: name,\n nickname: nickname,\n race: race,\n origin: origin,\n attack: attack,\n defense: defense,\n weapon: weapon,\n describe: function(){\n console.log(`${name} is a ${race} of ${origin} who uses ${weapon}.`);\n },\n evaluateFight: function(character){\n return `Your opponent takes ${character.defense > attack ? 0 : attack - character.defense} damage and you receive ${defense > character.attack ? 0 : character.attack - defense} damage.`;\n }\n\n };\n\n}", "function createCharacter(name, nickname, race, origin, attack, defense) {\n return {\n name,\n nickname,\n race,\n origin,\n attack,\n defense,\n describe() {\n console.log(`${this.name} is a ${this.race} from ${this.origin}.`);\n },\n evaluateFight(char) {\n let x = Math.max(this.attack - char.defense, 0); //my attack - opponents defense\n let y = Math.max(char.attack - this.defense, 0); // opponents attack - my defense\n return `Your opponent takes ${x} damage and you recieve ${y} damage.`;\n },\n };\n}", "function createCharacter (newName, newRace, newOrigin, newWeapon, \n newAttack, newDefense) {\n return {\n name: newName,\n race: newRace,\n origin: newOrigin,\n weapon: newWeapon,\n attack: newAttack,\n defense: newDefense,\n describe: function () {\n console.log (`${this.name} is a ${this.race} from ${this.origin}\\\n who uses a ${this.weapon}`);\n },\n evaluateFight: function (character) {\n let theirDamage = 0;\n if (this.attack > character.defense) theirDamage = this.attack - character.defense;\n let myDamage = 0;\n if (this.attack < character.defense) myDamage = character.attack - this.defense; \n console.log (`Your opponent takes ${theirDamage} damage and you receive ${myDamage} damage`);\n }\n };\n}", "function createCharacter(name, options) {\n return {\n name: name,\n options: nickname, race, origin, attack, defense,\n describe: function (){\n console.log(`${name} is a ${race} from ${origin}.`);\n\n },\n\n evaluateFight(character) {\n let x = 0;\n let y = 0;\n if (this.attack > character.defense) {\n x = this.attack - character.defense;\n }\n if (this.defense < character.attack) {\n y = character.attack - this.defense;\n }\n console.log(`Your opponent takes ${x} damage and you receive ${y} damage`);\n }\n }\n}", "requestCreateCharacter( name, race, charClass, ackCB ) {\n this._log(\"request create character\")\n this.send(\"createCharacter\", { name:name, race:race, charClass:charClass }, ackCB)\n }", "function createCharacter(charName){\n try{\n if(charName == undefined){\n throwException(\"IllegalArgument\", \"charName is undefined.\");\n }\n \n const path = \"character\";\n const content = {characterName: charName};\n return dao.sendRequest(\"put\", path, content);\n }catch(err){\n const message = arguments.callee.name + \" - \" + err.name + \": \" + err.message;\n logService.log(message, \"error\");\n return new Response();\n }\n }", "function createCertificate(profileName, skill, organization) {\n\t// TODO obtain data \n\t// registerMemberSkills(address member, uint hashKey, bytes32 skill, uint spendHours, uint demandHours)\n\tvar account = getAccountByName(profileName);\n\tvar hashKey = (String(skill) + String(organization)).hashCode(); // TODO generate hashKey based on org and skill name\n\tvar skillInBytes = web3.fromAscii(skill); // TODO convert skill string into bytes32\n\tvar spendHours = 100; // optional\n\tvar demandHours = 100; // optional\n\n\tconsole.log(\"w3\", \"Account: \" + account);\n\n\tSkillsMarket.registerMemberSkills.sendTransaction(\n\t\taccount,\n\t\thashKey,\n\t\tskillInBytes, \n\t\tspendHours, \n\t\tdemandHours,\n\t\t{from: account, gas: 300000}\n\t);\n\t\n\t// console.log(\"w3\", \"RegisterMemberSkills: \");\n\t\n\t// TODO wait till it would be executed on blockchain\n\t// TODO get a status and return back to the client\n\tconst skillsLength = SkillsMarket.getSkillForMember(account);\n\tconsole.log(\"w3\", \"Amount of skills: \" + skillsLength);\n}", "function createCustomer(name) {\n name = name || \"New customer\";\n var customerType = getCustomerType();\n var customer = customerType.createEntity();\n customer.CompanyName(name);\n return customer;\n }", "function GenerateCharacter() {\n\tNameGenerator();\n\tAssignPersonality();\n\tAssignBuild();\n\tAbiltyScores();\n\tAssignRace();\n\tRacialAttributes(OPC.race);\n\tAssignClass();\n\tClassAttributes(OPC.class);\n\tEquipBest();\n\tCalculateEncumberance();\n\tWriteOPC();\n}", "function generateCreep(){\n let body = [WORK];\n let name = Game.spawns[Memory.learn['name']].createCreep(body);\n return 'Created creep: ' + name;\n}", "function createFaculty(name) {\n return new Faculty(name);\n}", "function stellarToken(name, fullName, decimalPlaces, asset, domain, features, prefix, suffix, network) {\n if (domain === void 0) { domain = ''; }\n if (features === void 0) { features = AccountCoin.DEFAULT_FEATURES; }\n if (prefix === void 0) { prefix = ''; }\n if (suffix === void 0) { suffix = name.toUpperCase(); }\n if (network === void 0) { network = networks_1.Networks.main.stellar; }\n return Object.freeze(new StellarCoin({\n name: name,\n fullName: fullName,\n decimalPlaces: decimalPlaces,\n asset: asset,\n domain: domain,\n features: features,\n prefix: prefix,\n suffix: suffix,\n network: network,\n isToken: true,\n }));\n}", "async function mintToken() {\n if (typeof window.ethereum !== 'undefined') {\n await requestAccount();\n const provider = new ethers.providers.Web3Provider(window.ethereum);\n const signer = provider.getSigner();\n const contract = new ethers.Contract(tokenAddress, Token.abi, signer);\n let signerAddress = await signer.getAddress();\n console.log(\"Account:\", signerAddress);\n\n try {\n const tx = await contract.createCollectible(signerAddress, \"ipfs://QmZhQho7NniB1pZLzAz9aZzHFw2M7jyZm2bmStFshYWURT\");\n console.log('data: ', tx);\n } catch (err) {\n console.log(\"Error: \", err);\n }\n }\n }", "async createToken({\n account,\n key\n }, {\n initialAmount,\n tokenName,\n decimalUnits,\n tokenSymbol\n }) {\n if (!this.BrandedTokenFactory) {\n return;\n }\n\n initialAmount = Web3.utils.toBN(Web3.utils.toWei(\"\" + initialAmount, \"ether\"));\n // let nonce = await this.web3.eth.getTransactionCount(account);\n let result = await this._signedAndSubmit({\n from: account,\n // nonce: nonce,\n gas: this.config.gas,\n gasPrice: this.config.gasPrice,\n to: this.BrandedTokenFactory.options.address,\n data: this.BrandedTokenFactory.methods.create(initialAmount, tokenName, decimalUnits, tokenSymbol).encodeABI(),\n }, key);\n\n return result;\n }", "function MakeCard(pName, ccVendor, expire) {\n var sp = ' ';\n var cCard = {};\n\n var ccNum1 = getRandomInt(1000, 9999);\n var ccNum2 = getRandomInt(1000, 9999);\n var ccNum3 = getRandomInt(1000, 9999);\n var ccNum4 = getRandomInt(1000, 9999);\n var ccNum = ccNum1 + sp + ccNum2 + sp + ccNum3 + sp + ccNum4;\n\n var secCode = getRandomInt(200, 999);\n\n cCard.cardvendor = ccVendor;\n cCard.name = pName;\n cCard.cardnumber = ccNum;\n cCard.cardexpire = expire;\n cCard.securitycode = secCode;\n\n return cCard;\n}", "function SpoofConstructor(name){\n this.name=\"I am \" + name;\n return {name:\"I am Deadpool\"};\n}", "function tstellarToken(name, fullName, decimalPlaces, asset, domain, features, prefix, suffix, network) {\n if (domain === void 0) { domain = ''; }\n if (features === void 0) { features = AccountCoin.DEFAULT_FEATURES; }\n if (prefix === void 0) { prefix = ''; }\n if (suffix === void 0) { suffix = name.toUpperCase(); }\n if (network === void 0) { network = networks_1.Networks.test.stellar; }\n return stellarToken(name, fullName, decimalPlaces, asset, domain, features, prefix, suffix, network);\n}", "generateSupportCharacter() {\r\n species = this.shuffle(species)\r\n let race = species[0]\r\n let gender = this.shuffle([\"Female\", \"Male\"])[0]\r\n let firstName = this.shuffle(race[gender])[0]\r\n let lastName = this.shuffle(race[\"Family\"])[0]\r\n\r\n let attributePool = this.shuffle([10, 10, 9, 9, 8, 7])\r\n let attributes = [\r\n \"Control (\" +\r\n (attributePool[0] +\r\n this.findAttribute(\"Control\", race.AttributeBonus)) +\r\n \")\",\r\n \"Fitness (\" +\r\n (attributePool[1] +\r\n this.findAttribute(\"Fitness\", race.AttributeBonus)) +\r\n \")\",\r\n \"Presence (\" +\r\n (attributePool[2] +\r\n this.findAttribute(\"Presence\", race.AttributeBonus)) +\r\n \")\",\r\n \"Daring (\" +\r\n (attributePool[3] + this.findAttribute(\"Daring\", race.AttributeBonus)) +\r\n \")\",\r\n \"Insight (\" +\r\n (attributePool[4] +\r\n this.findAttribute(\"Insight\", race.AttributeBonus)) +\r\n \")\",\r\n \"Reason (\" +\r\n (attributePool[5] + this.findAttribute(\"Reason\", race.AttributeBonus)) +\r\n \")\"\r\n ]\r\n\r\n let disciplinePool = this.shuffle([4, 3, 2, 2, 1, 1])\r\n let disciplines = [\r\n \"Command (\" + disciplinePool[0] + \")\",\r\n \"Conn (\" + disciplinePool[1] + \")\",\r\n \"Security (\" + disciplinePool[2] + \")\",\r\n \"Engineering (\" + disciplinePool[3] + \")\",\r\n \"Science (\" + disciplinePool[4] + \")\",\r\n \"Medicine (\" + disciplinePool[5] + \")\"\r\n ]\r\n\r\n let talent = this.shuffle(race.Talents)[0]\r\n\r\n return {\r\n title: firstName + \" \" + lastName,\r\n description: \"Generated support character\",\r\n fields: [\r\n {\r\n name: \"Race\",\r\n value: race.Name\r\n },\r\n {\r\n name: \"Gender\",\r\n value: gender\r\n },\r\n {\r\n name: \"Attributes\",\r\n value: attributes.join(\", \")\r\n },\r\n {\r\n name: \"Disciplines\",\r\n value: disciplines.join(\", \")\r\n },\r\n {\r\n name: \"Talent\",\r\n value: talent\r\n }\r\n ]\r\n }\r\n }", "function createEstablishmentCode() {\n let _lText = '';\n let _lPossible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n for (let _i = 0; _i < 9; _i++) {\n _lText += _lPossible.charAt(Math.floor(Math.random() * _lPossible.length));\n }\n return _lText;\n}", "async function newCourt() {\n code = await generateAccessCode();\n return await insertCourt(code);\n}", "async function mintToken() {\r\n \r\n const provider = new HDWalletProvider(mnemonic, `https://rinkeby.infura.io/v3/${infuraKey}`)\r\n \r\n const web3Instance = new web3(provider)\r\n\r\n if (solnSquareVerifierAddress) {\r\n const factoryContract = new web3Instance.eth.Contract(\r\n SolnSquareVerifier.abi,\r\n solnSquareVerifierAddress,\r\n { gasLimit: '1000000' }\r\n )\r\n const minterAddress = \"0xf062BE692c443C13746da4256D85D693e0Ed1735\";\r\n const proof = await JSON.parse(fs.readFileSync(\"../test/proof10.json\")) ;\r\n\r\n console.log(\"Proof a: \" + proof.proof.a);\r\n\r\n const accountsArr = await web3Instance.eth.getAccounts();\r\n console.log(\"Accounts length: \" + accountsArr.length);\r\n console.log(\"Accounts: \" + accountsArr);\r\n\r\n try {\r\n const result = await factoryContract.methods.mintToken(minterAddress, 2011, proof.proof.a, proof.proof.b, proof.proof.c, proof.inputs).send({from:accountsArr[0]});\r\n console.log(\"result: \" + result)\r\n } catch(e) {\r\n console.log(\"Exception: \" + e)\r\n }\r\n\r\n } else {\r\n console.error(\r\n 'Add FACTORY_CONTRACT_ADDRESS to the environment variables'\r\n )\r\n }\r\n console.log(\"leaving mint token\");\r\n}", "constructor(isAdmin, chips, name) {\n // this.tokenID = tokenID;\n this.name = name;\n this.isAdmin = isAdmin;\n this.hand = [];\n this.twoCard = [];\n // this.handValue = null;\n this.chips = chips;\n this.status = 1;\n this.chipsInHand = 0;\n }", "function createRoom(){\n roomToken = random()\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n }", "function terc20(name, fullName, decimalPlaces, contractAddress, asset, features, prefix, suffix, network) {\n if (features === void 0) { features = AccountCoin.DEFAULT_FEATURES; }\n if (prefix === void 0) { prefix = ''; }\n if (suffix === void 0) { suffix = name.toUpperCase(); }\n if (network === void 0) { network = networks_1.Networks.test.kovan; }\n return erc20(name, fullName, decimalPlaces, contractAddress, asset, features, prefix, suffix, network);\n}", "function createDoctor (name, specialty, address) {\n let Doctor = {\n name: name,\n specialty: specialty,\n address: address\n }\n console.log ('Doctor', Doctor)\n}", "function Token(name) {\n name = String(name);\n return primFreeze({\n toString: markFuncFreeze(function tokenToString() { return name; }),\n throwable___: true\n });\n }", "function createCustomer(em, name) {\r\n name = name || \"New customer\";\r\n var customerType = getCustomerType(em);\r\n var customer = customerType.createEntity();\r\n customer.CompanyName(name);\r\n return customer;\r\n }", "function kittyCreator (catInfo) {\n console.info('kittyCreator functional, human.');\n var kNew = this;\n \n this.name = catInfo.name || 'Purrcival';\n this.color = catInfo.color;\n this.breed = catInfo.breed;\n this.dead = false;\n this.lives = 9;\n this.inventory = [canOfTuna, prettyKittyCollar];\n this.class = 'Catventurer';\n this.desc = \"You examine yourself. You're looking purrty good! You are \" + this.name + \", the \" + this.breed + \" \" + this.class + \"! Your fur is \" + this.color + \" and \" + this.furLength + \" in length. You could really go for a can of tuna.\"; //ou have \" + this.lives + \" lives left, and y\n this.atkBoost = 0;\n this.type = 'kitty';\n \n if (kNew.breed == 'siamese'){\n kNew.attack = dieTypes[4];\n kNew.hp = 50;\n kNew.maxHp = 50;\n kNew.furLength = 'short';\n kNew.meowType = 'with barely restrained rage';\n }\n if (kNew.breed == 'maineCoon'){\n kNew.attack = dieTypes[0];\n kNew.hp = 75;\n kNew.maxHp = 75;\n kNew.furLength = 'long';\n kNew.meowType = 'lazily';\n }\n if (kNew.breed == 'tabby'){\n kNew.attack = dieTypes[1];\n kNew.hp = 60;\n kNew.maxHp = 60;\n kNew.furLength = 'average';\n kNew.meowType = 'adorably';\n }\n party.push(this);\n }", "function createChannel() {\n return message.guild.channels.create(`mafia-${gameNumber}`, \"text\").then(chnl => {\n chnl.setParent(\"732742979701309532\");\n chnl.overwritePermissions([\n {\n id: message.guild.id,\n deny: ['VIEW_CHANNEL']\n }\n ])\n return chnl;\n \n }).catch(console.error);\n }", "function CrewMember (x, y, location, color, name) {\n\tthis.x = x;\n\tthis.y = y;\n\t\n\tthis.w = 15;\n\tthis.h = 15;\n\t\n\tthis.color = color || \"red\";\n\t\n\tthis.goal = null;\n\tthis.xgoal = null;\n\tthis.ygoal = null;\n\t\n\tthis.auto = false;\n\t\n\tthis.target = location;\n\tthis.xtarget = x;\n\tthis.ytarget = y;\n\t\n\tthis.location = location;\n\t\n\tthis.station = location;\n\t\n\tthis.xspd = 5;\n\tthis.yspd = 5;\n\t\n\tthis.name = name || names.splice(Math.floor(Math.random() * names.length), 1);\n\tthis.hp = 100;\n\tthis.hpMax = 100;\n\t\n\tthis.air = 100;\n\tthis.airMax = 100;\n\t\n\tthis.pilot = 0;\n\tthis.engine = 0;\n\tthis.weapon = 0;\n\tthis.repair = 0;\n\tthis.sonar = 0;\n}", "static create(aText = null, aMaxLength = null, aOutputName = null) {\n\t\tlet newLimitTextLength = new LimitTextLength();\n\t\t\n\t\tnewLimitTextLength.setup(aText, aMaxLength, aOutputName);\n\t\t\n\t\treturn newLimitTextLength;\n\t}", "function createTeam(name, skill) {\n return{\n name: name,\n skill: skill,\n };\n}", "createAccount (name) {\r\n name = cleanTextInput(name);\r\n if (typeof name === 'string' && this.findAccountIndex(name) === -1) {\r\n this._accountList.push(new Account(name));\r\n return this._accountList[this._accountList.length-1];\r\n } else {\r\n console.log('Error creating an account.'+\r\n ' Account name was not a string or a duplicate');\r\n }\r\n }", "function EnemyCreate() {\n\tif (quantity < 3) {\n\t\tenemy[quantity] = {\n\t\t\tx: 1,\n\t\t\ty: 1,\n\t\t\tnav: 6,\n\t\t\tspeed: 1,\n\t\t\tpermission: true,\n\t\t\tbomb: [],\n\t\t}\n\t\tquantity++;\n\t\tconsole.log(quantity)\n\t}\n}", "async function createAccount() {\n try {\n const pair = StellarSdk.Keypair.random();\n console.log(\"Requesting XLMs\");\n\n // Asking friendbot to give us some lumens on the new a/c\n await fetch(\n `https://horizon-testnet.stellar.org/friendbot?addr=${pair.publicKey()}`\n );\n\n return pair;\n } catch (e) {\n console.error(\"ERROR!\", e);\n }\n}", "function New(c, n) {\n if (n == 0) {\n return \"\";\n }\n else if (n == 1) {\n return c;\n }\n else {\n var s = \"\";\n for (var i = 1; i < n; ++i) {\n s = s + c;\n }\n return s;\n }\n }", "function create_game_room_card(name, players_in_game, max_players) {\r\n\r\n const card = document.createElement(\"div\");\r\n card.setAttribute('class', 'room-card');\r\n\r\n const room_name = document.createElement(\"h2\");\r\n room_name.innerText = name;\r\n card.appendChild(room_name);\r\n\r\n const ctj_text = document.createElement(\"h5\");\r\n ctj_text.innerText = \"Click to join!\"\r\n card.appendChild(ctj_text);\r\n\r\n const player_in_room = document.createElement(\"p\");\r\n player_in_room.innerText = \"Players: \" + players_in_game + \"/\" + max_players;\r\n player_in_room.setAttribute(\"class\", \"numOfPlayers\");\r\n card.appendChild(player_in_room);\r\n\r\n\r\n card.classList.add(\"room-card\");\r\n\r\n room_card_container.appendChild(card);\r\n\r\n}", "function createContact(name,phoneNumber){\n\n}", "static create(fromID, owner, endTime, capacity, title, goal, description, difficulty, memberIDs, tags, access,\r\n restriction, prize, challengeType, streakUpdateSpanType, streakUpdateInterval, streakN, successHandler, failureHandler) {\r\n return Lambda.create(fromID, \"Challenge\", {\r\n owner,\r\n endTime,\r\n capacity,\r\n title,\r\n goal,\r\n description,\r\n difficulty,\r\n memberIDs,\r\n tags,\r\n access,\r\n restriction,\r\n prize,\r\n challengeType,\r\n streakUpdateSpanType,\r\n streakUpdateInterval,\r\n streakN,\r\n }, successHandler, failureHandler);\r\n }", "function createCompleteFerrenCharacter()\n {\n getFerrenAge();\n getFerrenBuild();\n getFerrenHumanAppearance();\n getFelineAppearance();\n getFerrenMannerism();\n getFerrenPersonality();\n getFerrenBackground();\n }", "createNewMan(name) {\n\t\tname = encodeURI(name);\n\t\tvar manId = this.findSmallId(this.men);\n\t\tvar newAuth = Math.abs(Math.random() * 0xffffffff | 0);\n\t\tthis.auth[newAuth] = manId;\n\t\tif (name.length>10) {\n\t\t\tname = name.substr(0,7)+'...';\n\t\t}\n\t\tvar man = new KaboomenMan(manId, name);\n\t\tvar pos = this.gameMap.getFloor();\n\t\tman.setPosition(pos.x, pos.y);\n\t\tthis.gameMap.createLandingField(pos.x, pos.y, manId);\n\t\tthis.men[manId] = man;\n\t\tthis.commit(true);\n\t\tthis.chat(man.getName() + \", enjoy the game!\");\n\t\twinston.info(\"[player] '%s' created ID=%s\", man.getName(), manId);\n\t\t//wouldnt it better to send a json?\n\t\treturn newAuth + ',' + manId;\n\t}", "static createClaimInstruction(\n programID,\n tokenProgramKey,\n authorityKey,\n playerKey,\n publisherKey,\n bankKey,\n mintKey,\n airdropKey,\n playerSPLKey,\n ) {\n const dataLayout = BufferLayout.struct([\n BufferLayout.u8(\"i\"),\n ]);\n \n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n i:2, // claim instruct \n },\n data,\n );\n \n let keys = [\n {pubkey: tokenProgramKey, isSigner: false, isWritable: true},\n {pubkey: authorityKey, isSigner: false, isWritable: true},\n {pubkey: playerKey, isSigner: true, isWritable: true},\n {pubkey: publisherKey, isSigner: false, isWritable: true},\n {pubkey: bankKey, isSigner: false, isWritable: true},\n {pubkey: mintKey, isSigner: false, isWritable: true},\n {pubkey: airdropKey, isSigner: false, isWritable: true},\n {pubkey: playerSPLKey, isSigner: false, isWritable: true},\n ];\n\n const trxi = new TransactionInstruction({\n keys,\n programId: programID,\n data,\n });\n return trxi;\n }", "async createAccount(ctx, name) {\n const userId = ctx.clientIdentity.getID();\n const newAccount = {\n ID: userId,\n Name: name,\n Balance: 0,\n AuthedParties: {},\n };\n ctx.stub.putState(userId, Buffer.from(JSON.stringify(newAccount)));\n return JSON.stringify(newAccount);\n }", "function createCompleteOrcCharacter()\n{\n getOrcAge();\n getOrcBuild();\n getOrcAppearance();\n getOrcBackground();\n getOrcPersonality();\n}", "function createNewCustomer (callback) {\n\n validateUserPayment(function(result) {\n if (!result) {\n\n return callback(false);\n }\n else {\n if (!$scope.$parent.user) {\n registerCustomerLocally(function (localUser) {\n if (!localUser) {\n return callback(false);\n }\n else {\n $scope.$parent.user = localUser;\n\n createStCustomer(function (updatedUser) {\n return callback(updatedUser);\n });\n }\n });\n }\n else if (!$scope.$parent.user.stId) {\n createStCustomer(function (updatedUser) {\n return callback(updatedUser);\n });\n }\n else {\n return callback($scope.$parent.user);\n }\n }\n });\n\n }", "function generateCharacter()\n{\n\t//PHP code needed here to retrieve a specific character's name, image, stats, and description for all the characters\n\t//charName is retrieved from the table \"characters\"\n\t\n\tthis.name = charName;\n\tthis.nickname = \"\";\n\tthis.motto = \"\";\n\tthis.perk = \"\";\n\tthis.health = 0;\n\tthis.hunger = 0;\n\tthis.sanity = 0;\n\tthis.imageHidden = charName + \"_silho.png\";\n\tthis.image = charName + \".png\";\n\tthis.headSlot\n}", "static createNonce(length) {\n let text = '';\n let possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n for(let i = 0; i < length; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n }", "function createDataTraining(name, fee) {\n return { name, fee };\n}", "create_contract() {\n var mission = \"Destroy one debris\";\n var success_rate = this.get_successrate();\n var reward = this.get_reward(success_rate);\n var expiration = null; // TODO not implemented yet\n return new Contract(mission, reward, success_rate, expiration);\n }", "function _createCoffeeBrand(CoffeeBrandName, NumbersOfCoffeesNeeded, callback)\n{\n validate.valBrand(CoffeeBrandName, NumbersOfCoffeesNeeded, function (data)\n {\n if (data)\n {\n CoffeeBrand.createCoffeeBrand(CoffeeBrandName, NumbersOfCoffeesNeeded, function (data2)\n {\n callback(data2)\n })\n } else callback(false)\n })\n\n\n}", "function NinjaConstructor(name, prevOccupation) {\n this.name = name;\n this.prevOccupation = prevOccupation\n this.introduce = function() {\n console.log(\"Hi my name is \" + this.name + \". I used to be a \" + this.prevOccupation + \" and now I'm a Ninja!\");\n }\n}", "function maketoken(info){\n info.expires=Date.now()+tokenExpiresTime\n return jwt.encode(info,secret)\n}", "function createIntern() {\n inquirer.prompt(internQuestions)\n .then(({ name, emailID, employeeId, school}) => {\n const intern = new Intern(name, \"Intern\", emailID, employeeId, school)\n teamMembers.push(intern)\n buildTeam();\n\n })\n}", "function createContatct() {\n let firstName = prompt(\"Enter First Name \");\n let lastName = prompt(\"Enter last Name \");\n let address = prompt(\"Enter Address \");\n let city = prompt(\"Enter City \");\n let state = prompt(\"Enter State \");\n let zip = prompt(\"Enter Zip \");\n let phoneNumber = prompt(\"Enter phone number \");\n let email = prompt(\"Enter Email address \");\n return new Contact(firstName,lastName,address,city,state,zip,phoneNumber,email)\n}", "function create_code(number_of_characters_int)\n {\n let new_code_str = \"\";\n let current_index_int = 0;\n\n while(current_index_int < number_of_characters_int)\n {\n new_code_str += create_code_character();\n ++current_index_int;\n }\n\n return new_code_str;\n }", "createAccount() {\n if (document.getElementById('newaccount-name').value == '')\n return;\n let options = {\n username: '',\n group: '',\n permission: 0\n };\n if (document.getElementById('newaccount-name').value != '') {\n options.username = document.getElementById('newaccount-name').value;\n }\n if (document.getElementById('newaccount-permission').value != '') {\n options.permission = document.getElementById('newaccount-permission').value;\n }\n if (document.getElementById('newaccount-group').value != '') {\n options.group = document.getElementById('newaccount-group').value;\n }\n\n window.Lemonade.Mirror.send('account-create', CookieManager.getCookie('loggedIn_user'), CookieManager.getCookie('loggedIn_session'), options);\n }", "function account(name, fullName, network, decimalPlaces, asset, features, prefix, suffix, isToken) {\n if (features === void 0) { features = AccountCoin.DEFAULT_FEATURES; }\n if (prefix === void 0) { prefix = ''; }\n if (suffix === void 0) { suffix = name.toUpperCase(); }\n if (isToken === void 0) { isToken = false; }\n return Object.freeze(new AccountCoin({\n name: name,\n fullName: fullName,\n network: network,\n prefix: prefix,\n suffix: suffix,\n features: features,\n decimalPlaces: decimalPlaces,\n isToken: isToken,\n asset: asset,\n }));\n}", "function newContact(name, number) {\n dispatch(\n contactsOperations.ADD({\n name: name,\n number: number,\n })\n );\n\n setName('');\n setNumber('');\n }", "function createEnemy(){\n function Enemy(name, hp){\n this.name = name\n this.hp = hp \n this.ap = 6 \n }\n const enemies = [\"Bigfoot\", \"Chupacabra\", \"Werewolf\"]\n\n const randomName = enemies[Math.floor(Math.random() * enemies.length )]\n console.log(randomName + \" appears!!!\")\n \n const randomHP = Math.floor(Math.random() * 30) + 1\n\n return new Enemy(randomName, randomHP);\n \n}", "function createToken() {\n stripe.createToken($scope.card).then(function(result) {\n if (result.error) {\n $scope.cardError = result.error.message;\n $scope.submitting = false;\n } else {\n // Send the token to your server\n stripeTokenHandler(result.token);\n }\n });\n }", "function characterFactory(name, image, HP, baseAttack, counter){\n let character = {\n name: name,\n image: image,\n baseHP: HP,\n HP: HP,\n baseAttack: baseAttack,\n counter: counter,\n attack: baseAttack,\n position: '',\n displayNewCard: function(newPosition){\n if (this.position !== ''){\n this.destroyOldCard();\n }\n let newHTML = ''\n if (newPosition === 'player'){ \n newHTML = `\n <div id=${this.name} class='card-body'>\n <h4 class='card-header'>\n Player\n </h4>\n <h5 class='card-subtitle name'>\n ${this.name}\n </h5>\n <img src='${this.image}' class='character-img img-thumbnail'>\n <p class='card-text hit-points'>\n HP: ${this.HP}\n </p>\n <p class='card-text attack'>\n Attack: ${this.attack}\n </p>\n </div>`;\n }\n else if (newPosition === 'enemy'){\n newHTML = `\n <div id=${this.name} class='card-body'>\n <h4 class='card-header'>\n Player\n </h4>\n <h5 class='card-subtitle name'>\n ${this.name}\n </h5>\n <img src='${this.image}' class='character-img img-thumbnail'>\n <p class='card-text hit-points'>\n HP: ${this.HP}\n </p>\n <p class='card-text attack'>\n Counter: ${this.counter}\n </p>\n </div>`;\n }\n else {\n newHTML = `\n <div id=${this.name} class='card-body available-character-card'>\n <h5 class='card-subtitle name'>\n ${this.name}\n </h5>\n <img src='${this.image}' class='character-img img-thumbnail'>\n <p class='card-text hit-points'>\n HP: ${this.HP}\n </p>\n <p class='card-text base-attack'>\n Attack: ${this.baseAttack}\n </p>\n <p class='card-text counter'>\n Counter: ${this.counter}\n </p>\n </div>`;\n }\n $(`#card-holder-${newPosition}`).html(newHTML);\n this.position = newPosition;\n },\n destroyOldCard: function(){\n $(`#card-holder-${this.position}`).children().remove();\n },\n updateAttack: function(){\n // Updates attack stat with baseAttack\n this.attack += this.baseAttack;\n // Updates character card attack stat display\n $(`#card-holder-${this.position}`).children().children('.attack').text(`Attack: ${this.attack}`);\n },\n takeDamage: function(damage){\n this.HP -= damage;\n // Updates character card HP display\n $(`#card-holder-${this.position}`).children().children('.hit-points').text(`HP: ${this.HP}`);\n },\n reset: function(){\n this.HP = this.baseHP;\n this.attack = this.baseAttack;\n this.pointer = '';\n // Does not update character card because this function only called on character death\n // Or Game Over\n },\n }\n return character;\n }", "function createAccount() {\n try {\n const tronWeb = new TronWeb(fullNode, solidityNode, eventServer);\n return tronWeb.createAccount();\n\n } catch (error) {\n console.log(error);\n throw error;\n }\n}", "static newAndTakeCContext(ctxPtr) {\n // assert(typeof ctxPtr === 'number');\n return new CipherAlgInfo(ctxPtr);\n }", "function Cn(){}", "function erc20(name, fullName, decimalPlaces, contractAddress, asset, features, prefix, suffix, network) {\n if (features === void 0) { features = AccountCoin.DEFAULT_FEATURES; }\n if (prefix === void 0) { prefix = ''; }\n if (suffix === void 0) { suffix = name.toUpperCase(); }\n if (network === void 0) { network = networks_1.Networks.main.ethereum; }\n return Object.freeze(new Erc20Coin({\n name: name,\n fullName: fullName,\n network: network,\n contractAddress: contractAddress,\n prefix: prefix,\n suffix: suffix,\n features: features,\n decimalPlaces: decimalPlaces,\n asset: asset,\n isToken: true,\n }));\n}", "charge(payee,atm){\nif(this.balance()>= atm){\n let charge = new transaction((amt * -1), payee)\n this.transactions.push(charge)\n} else {\n console.log(\"insufficient funds\")\n}\n}", "function createOneCharac(characterInfo) {\n charactersAPI.createOneRegister(characterInfo)\n .then(() => document.getElementById(\"send-data-create\").classList.add('active')) //Set the button \"submit\" to green to indicate all is ok\n .catch(err => {\n document.getElementById(\"send-data-create\").classList.add('error') //Set the button \"submit\" to red to indicate something is wrong\n console.log(`Error: ${err}`)\n })\n}", "function createNode(kind, pos) {\n nodeCount++;\n if (!(pos >= 0)) {\n pos = scanner.getStartPos();\n }\n return kind >= 139 /* FirstNode */ ? new NodeConstructor(kind, pos, pos) :\n kind === 69 /* Identifier */ ? new IdentifierConstructor(kind, pos, pos) :\n new TokenConstructor(kind, pos, pos);\n }", "function create() {\n\n}", "function createCity(name, description){\n cities[name] = description;\n return name;\n}", "async generateTokens ({ dispatch, state, getters }, { amount, to = false }) {\n state.instance.generateTokens(!to ? state.account : to, amount, getters.txParams)\n }", "function generateCoupon() {\r\n //it doesn't generate 6 digit number between 000000-100000 //need to be fixed\r\n let randomNum = Math.random() * (999999 - 100000) + 100000;\r\n \r\n\r\n dispatchCouponToSave(updateCoupon(randomNum))\r\n }", "function VehicleConstructor(name, num_of_wheels, num_of_passengers){\n\t/* object that will be returned */\n\tvar vehicle = {};\n\n\t/* private properties of vehicle object */\n\tvehicle.name = name;\n\tvehicle.num_of_wheels = num_of_wheels;\n\tvehicle.num_of_passengers =num_of_passengers;\n\n\t/* private methods*/\n\tvehicle.makeNoise = function(){\n\t\tconsole.log(\"Vroom vroom!\"); // default makeNoise\n\t}\n\n\treturn vehicle;\n}", "constructor(token, amount) {\n super(token, amount);\n this.token = token;\n }", "static createWetColony() {\n return new AntColony(2, 3,8,3);\n }", "function create(line, character) {\n if (line === Number.MAX_VALUE) {\n line = uinteger.MAX_VALUE;\n }\n\n if (character === Number.MAX_VALUE) {\n character = uinteger.MAX_VALUE;\n }\n\n return {\n line: line,\n character: character\n };\n }", "function _createNewCommunication(params, callback) {\n const message = params.message;\n const type = params.type;\n const subject = params.subject;\n const tryUpstream = params.tryUpstream;\n\n customerService.createNewCommunication({\n 'recipient': _model.customer.email,\n 'message': message,\n 'type': type,\n 'subject': subject,\n 'ticketId': _ticketId,\n 'name': _model.customer.firstname,\n 'tryUpstream': tryUpstream\n }, function (err, communicationId) {\n if (err) {\n _setError(err);\n }\n _setMessage('Communication created succesfully');\n return callback(null, communicationId);\n });\n }", "createToken(username) {\n return jwt.sign({\n issuer: username,\n iat: Math.floor(Date.now() / 1000),\n exp: Math.floor(Date.now() / 1000) + ((60 * 60) * 10)\n }, 'secret');\n }", "constructor(name, id, color, active){\n this.name = name;\n this.id = id;\n this.color = color;\n //will originally be false for active\n this.active = active;\n this.tokens = this.createTokens(21);\n }", "function createCity(name, description) {\n cities[name] = description;\n return name;\n}", "function handleClaimers(flag, brain) {\n let role = 'claimer';\n let reserveAgain = false;\n if (!(flag.room && flag.room.controller.my)) {\n flag.requiredCreepAmounts[role] = 1;\n } else {\n flag.requiredCreepAmounts[role] = 0;\n }\n return flag.requestCreepIfNeeded(brain, role, {\n assignment: flag,\n workRoom: flag.roomName,\n patternRepetitionLimit: 1\n });\n }", "function createEntry(name, kicks, regain, addr, onFail, onSucceed) {\n const url = addr + \"/new\";\n const now = new Date();\n let entry = JSON.stringify(\n { name: name\n , activeKicks: kicks\n , lastHeartbeat: now\n , recoveryRate: regain.rate\n , recoveryHurdle: regain.hurdle\n , maxRecovery: regain.maximum\n , canNextSetKicks: now\n });\n createRequest(url, entry, \"POST\", onFail, onSucceed);\n\n}", "function Character(name, level, race, classtype, role) {\n this.Character_name = name;\n this.Character_level = level;\n this.Character_race = race;\n this.Character_classtype = classtype;\n this.Character_role = role;\n}", "static async create ({ name = 'Anonymous', mnemonic, keyPair, ...args }={}) {\n if (mnemonic) {\n // if keypair doesnt correspond to the mnemonic, delete the keypair\n if (keyPair && mnemonic !== Bip39.encode(keyPair.privkey).data) {\n warn(`keypair doesn't match mnemonic, ignoring keypair`)\n keyPair = null\n }\n } else if (keyPair) {\n // if there's a keypair but no mnemonic, generate mnemonic from keyapir\n mnemonic = Bip39.encode(keyPair.privkey).data\n } else {\n // if there is neither, generate a new keypair and corresponding mnemonic\n keyPair = EnigmaUtils.GenerateNewKeyPair()\n mnemonic = Bip39.encode(keyPair.privkey).data\n }\n const pen = await Secp256k1Pen.fromMnemonic(mnemonic)\n return new this({name, mnemonic, keyPair, pen, ...args})\n }", "function makeNonce() {\n return leb128_1.lebEncode(BigInt(+Date.now()) * BigInt(100000) + BigInt(Math.floor(Math.random() * 100000)));\n}", "function createBlind (blindName , number, x, y, roomNumber) {\n\t\t\t\t\tblindName = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon.createRegularPolygon(\n\t\t\t\t\t\t\t\t\t\tnew OpenLayers.Geometry.Point(x, y),\n\t\t\t\t\t\t\t\t\t\t6,\n\t\t\t\t\t\t\t\t\t\t4\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\t\t\t\t\t\t\tblindName.attributes = {\n\t\t\t\t\t\t\t\t\t key: number , \n\t\t\t \t\t\t\t\t\t room: roomNumber\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 vectorLayer.addFeatures([blindName]);\n\t\t\t\t}", "function MakeCharacter() {\n const START = 18000; // start of unicode in decimal\n let text = (START + Math.floor(Math.random()*NCHARS)).toString(16); \n return String.fromCharCode(parseInt(text,16));\n}", "async createVaccine(ctx, vaccineId, vaccineBatchId, owner){\n console.info('============= START : Create Vaccine ===========');\n const vaccine = {\n docType: 'vaccine',\n vaccineBatchId : vaccineBatchId,\n owner : owner\n };\n await ctx.stub.putState(\"VACCINE\" + vaccineId, Buffer.from(JSON.stringify(vaccine)));\n console.info('============= END : Create Vaccine ===========');\n }", "function Spawning()\n{\n for (var name in Memory.creeps)\n {\n if (!Game.creeps[name])\n {\n delete Memory.creeps[name];\n }\n }\n\n var controllerLevel = 0;\n\n for (var name in Game.rooms)\n {\n controllerLevel = controllerLevel + Game.rooms[name].controller.level;\n }\n\n var harvesters = _.filter(Game.creeps, (creep) => creep.memory.role == 'harvester');\n\n if (harvesters.length < 4)\n {\n Game.spawns.Main.createCreep([WORK, WORK, CARRY, CARRY, MOVE], undefined, { role: 'harvester' });\n }\n\n var builders = _.filter(Game.creeps, (creep) => creep.memory.role == 'builder');\n\n if (builders.length < 3)\n {\n Game.spawns.Main.createCreep([WORK, WORK, CARRY, MOVE], undefined, { role: 'builder' });\n }\n\n var upgraders = _.filter(Game.creeps, (creep) => creep.memory.role == 'upgrader');\n\n if (upgraders.length < 2)\n {\n Game.spawns.Main.createCreep([WORK, CARRY, MOVE], undefined, { role: 'upgrader' });\n }\n\n var guards = _.filter(Game.creeps, (creep) => creep.memory.role == 'guard');\n\n if (guards.length < 6)\n {\n Game.spawns.Main.createCreep([MOVE, MOVE, ATTACK, TOUGH, TOUGH, TOUGH, TOUGH, TOUGH], undefined, { role: 'guard' });\n }\n}", "function UnmoderatedCaucus(length){\n this.length = length;\n if (this.length === 0)\n throw new Error(\"Invalid caucus length\");\n}", "static create() {\n\t\tlet name, muts, tag, attr\n\n\t\tcl(`Creating new atom. \"Ctrl+c\" to exit`.gray);\n\n\t\trl.question(`Name » `.green, atomName => {\n\t\t\tname = atomName;\n\n\t\t\trl.question(`Mutates » `.green, atomMutate => {\n\t\t\t\tmuts = atomMutate.split(' ');\n\n\t\t\t\trl.question(`Tag » `.green, atomTag => {\n\t\t\t\t\ttag = atomTag;\n\n\t\t\t\t\trl.question(`Attributes » `.green, atomAttr => {\n\t\t\t\t\t\tattr = atomAttr.split(' ');\n\n\t\t\t\t\t\tvar atom = new Atom(name, muts, tag, attr);\n\n\t\t\t\t\t\tAtom.save(atom);\n\t\t\t\t\t\trl.close();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}", "function createNPC() {\n if (validateNPCFormComplete()) {\n\t\tvar c = new Character(false, $(\"npc-monster-name\").value, $(\"npc-race\").value, \"monster\", $(\"npc-armor-class\").value,\n\t\t\t\t\t\t\t $(\"npc-passive-perception\").value, $(\"npc-dexterity\").value, $(\"npc-hit-points\").value,\n\t\t\t\t\t\t\t $(\"npc-hit-dice\").value, $(\"npc-d4\").checked, $(\"npc-d6\").checked, $(\"npc-d8\").checked,\n\t\t\t\t\t\t\t $(\"npc-d10\").checked, $(\"npc-d12\").checked, $(\"npc-d20\").checked,\n\t\t\t\t\t\t\t $(\"npc-modifier\").value, $(\"npc-page-number\").value);\n c.initializeRandomizedVars();\n characters.push(c);\n showElement(\"right-container\");\n showElement(\"edit-menu\");\n hideElement(\"npc-form\");\n addCharacterToColumn(c.unique, c.name, c.race, c.passivePerception, c.armorClass, characters.length - 1);\n enableEditingButtons();\n clearNPCForm();\n }\n}", "async function createCustomer() {\n\n}", "function newZombie() {\n\t\t\tvar zombie = new lib.zombieMc(); // constructs the zombie\n\t\t\ttotalZombies++;\n\t\t\tzombieContainer.addChild(zombie); // adds the zombie\n\t\t\tzombie.blood = 1.0; //僵尸的血\n\t\t\tzombie.zombieRow = Math.floor(Math.random() * 5); // chooses a random row where to place the zombie\n\t\t\tzombie.name = \"zombie_\" + totalZombies; //gives a name to the zombie\n\t\t\tzombie.num = totalZombies;\n\t\t\tzombiesArray[zombie.zombieRow].push(zombie.name); // adds the zombie in the row-th row\n\t\t\tzombie.x = 660; // places the zombie on the board, outside the stage to the right\n\t\t\tzombie.y = zombie.zombieRow * 75 + 115;\n\t\t}", "function newTokenGeneration(request) {\r\n return \"ABC\";\r\n}", "async function newIntern() {\n\tconst input = await inquirer.prompt([\n\t\t{\n\t\t\ttype: \"input\",\n\t\t\tname: \"name\",\n\t\t\tmessage: \"What is the name of this intern?\"\n\t\t},\n\t\t{\n\t\t\ttype: \"input\",\n\t\t\tname: \"id\",\n\t\t\tmessage: \"What is this intern's employee ID number?\"\n\t\t},\n\t\t{\n\t\t\ttype: \"input\",\n\t\t\tname: \"email\",\n\t\t\tmessage: \"What is this intern's email address?\"\n\t\t},\n\t\t{\n\t\t\ttype: \"input\",\n\t\t\tname: \"school\",\n\t\t\tmessage: \"What school is the intern attending?\"\n\t\t}\n\t]);\n\tconst intern = new Intern(input.name, input.id, input.email, input.school);\n\tteamArray.push(intern);\n\tnewTeam();\n}", "function chestCreator(amount, room) {\n for(var idx = 0; idx < amount; idx++) {\n var chest = new Location(-1, -1);\n chest.canMove = false;\n chest.description = \"An old wooden chest\";\n chest.terrainType = \"chest\";\n chest.symbol = \"∃\";\n chest.color = \"purple\";\n chest.searchable = true;\n chest.drops = [];\n\n room.chests.push(chest);\n }\n}", "function createTicket(amount, ip, account = \"unknown\") {\n return new Promise((resolve, reject) => {\n\n function create() {\n // If the account is present, use its checksum.\n let accountChecksum = \"0000000000\"\n if (account != \"unknown\") {\n const parse = parseNanoAddress(account)\n accountChecksum = parse.checksum\n }\n\n // Build the ticket\n const expires = now() + TICKET_EXPIRTATION\n const expiresHex = expires.toString(16).padStart(8, '0')\n const amountHex = rawsToHex(amount)\n const ipHex = ip2int(ip).toString(16)\n const ticket = amountHex + accountChecksum + expiresHex + ipHex\n\n // Sign the ticket\n const ticketSigned = signBlock(ticket.padEnd(64, '0'), wallet.myWallet.privateKey)\n const ticketSignedChecksum = blakeChecksum(ticketSigned)\n\n // Formated ticket\n let formatedTicket = amountHex.replace(/^0+/, '') + '-' + expiresHex + '-' + ticketSignedChecksum\n if (formatedTicket.startsWith('-')) formatedTicket = '0' + formatedTicket // when amount == 0\n\n console.log(\"Created ticket: \" + formatedTicket.toUpperCase())\n\n return formatedTicket.toUpperCase()\n }\n\n const ticket = create()\n\n if (data.ipInfo(ip) !== undefined) {\n resolve(ticket)\n } else {\n ipInfo(ip)\n .then((info) => {\n data.updateIPInfoList(ip, info)\n resolve(ticket)\n })\n .catch((err) => {\n reject(err)\n })\n }\n })\n}" ]
[ "0.58797634", "0.57275736", "0.5680671", "0.56391835", "0.55792046", "0.54358405", "0.54237443", "0.5272464", "0.5132492", "0.5077638", "0.50669724", "0.4972312", "0.49484265", "0.49454793", "0.48942825", "0.48887536", "0.48596305", "0.48398778", "0.48358983", "0.48267353", "0.475466", "0.47485226", "0.47355905", "0.47241855", "0.47129425", "0.47123545", "0.46880096", "0.4651196", "0.46508116", "0.46360406", "0.4634798", "0.460082", "0.45911655", "0.45709407", "0.4569936", "0.4563049", "0.45611915", "0.45602363", "0.45525026", "0.45508185", "0.4545305", "0.45420644", "0.453412", "0.45284966", "0.45218945", "0.4520502", "0.4501357", "0.44886488", "0.44883537", "0.4487841", "0.4475562", "0.44628233", "0.44608042", "0.44593382", "0.4448607", "0.4445955", "0.44304907", "0.44187805", "0.44116932", "0.44114324", "0.44052622", "0.44024396", "0.44015396", "0.43952337", "0.43922925", "0.4391969", "0.43893972", "0.43863177", "0.43846422", "0.43841922", "0.43718076", "0.43707597", "0.43681484", "0.43678793", "0.43676358", "0.43640903", "0.43639636", "0.43639144", "0.4360153", "0.43515292", "0.43503234", "0.43440983", "0.43432707", "0.4342387", "0.4335255", "0.4335233", "0.43335548", "0.43292525", "0.4327531", "0.4327178", "0.4325869", "0.43230456", "0.43201634", "0.43144006", "0.4310618", "0.43060628", "0.43052027", "0.42983064", "0.42906687", "0.42867026" ]
0.60173595
0
battle(uint _citizenId, uint _targetId) onlyOwnerOf(_citizenId)
battle(token, targetId) { return this.contract.methods.battle(this.contract._address, token, targetId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playerAfflictedCheck(target) {\n if (target.name === 'Bog Rat') {\n poxChance(player);\n } else if (target.name === 'Basilisk') {\n poxChance(player);\n } else if (target.name === 'Moor Hound') {\n bleedChance(player);\n } else if (target.name === 'Cursed Militia') {\n var throwChance = Math.ceil(Math.random() * 4);\n if (throwChance > 3) {\n newMessage('The Cursed Militia threw a powdershell at ' + player.name + '!');\n burn(player);\n }\n } else {\n player.condition = player.condition;\n }\n}", "function dealDamage(attackingCombatant, targetCombatant) {\n\n}", "function UseAbility(target: SelectableComponent) : boolean {\n\t\t// make sure you can target the village\n\t\tvar targetVillage = target as Village;\n\t\t\n\t\tif(TurnController.cardsPlayed == 0) {\n\t\t\t// Do effect\n\t\t\ttargetVillage.AdjustPopulation(-3);\n\t\t\t\n\t\t\t// send card played messages\n\t\t\tvar deck = GameObject.Find(\"ControllerHub\").GetComponent(Deck) as Deck;\n\t\t\tdeck.RemoveCardFromHand(card);\n\t\t\tTurnController.CardPlayed();\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// if we couldn't summon there\n\t\treturn false;\n\t}", "getTileOwner(x, y) {\n const players = Object.keys(this.players);\n\n for (let i = 0; i < players.length; i++) {\n if (this.isAllowedBuilding(x, y, players[i])) {\n return players[i];\n }\n }\n return undefined; \n }", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function OwnerID() {}", "function PKAttackNextPlayer() {\n Orion.Ignore(self);\n var target = Orion.FindType(\"-1\", \"-1\", \"ground\", \"human|near|live|ignorefriends\", 18, \"gray|criminal|orange|red|innocent|blue\");\n if (target.length != 0) {\n Orion.Attack(target[0]);\n Orion.Ignore(target[0]);\n } else {\n Orion.IgnoreReset();\n Orion.Ignore(self);\n target = Orion.FindType(\"-1\", \"-1\", \"ground\", \"human|near|live|ignorefriends\", 18, \"gray|criminal|orange|red|innocent|blue\");\n if (target.length != 0) {\n Orion.Attack(target[0]);\n Orion.Ignore(target[0]);\n }\n }\n}", "pickAttackTarget() {\n super.pickAttackTarget()\n /** @ts-ignore @type {MoonEngine} */\n /** @ts-ignore @type {MoonEngine} */\n const ge = this.gameEngine;\n if (ge) {\n const players = ge.getPlayers();\n for (const p of players) {\n if (p.id != this.lastTarget) {\n this.lastTarget = p.id;\n return p.id;\n }\n }\n }\n return -1;\n }", "function checkAndAttack(target) {\n // The 'target' parameter is just a variable!\n // It contains the argument when the function was called.\n if(target) {\n hero.attack(target);\n }\n hero.moveXY(43, 34);\n}", "attackTarget(attack) {\n _gameService.attackTarget(attack)\n draw()\n }", "function OwnerID() { }", "collision(attackeruid){\n this.building_bar.cutHPBar(5);\n this.takeDamage(5,attackeruid);\n this.beingAttacked=true;\n }", "battleCry() {\n return \"Odin Owns You All!\"\n }", "function battle(victimStrength, attackerStrength){\nif (victim.strength === attacker.strength) {\n console.log(\"Dead\");\n}\nelse if (victim.strength < attacker.strength) {\n console.log(\"Also dead\");\n}\nelse {\n console.log(\"Alive\");\n}\n}", "enemyChooseAttack(animal,attacker,attackee,ally,enemy){return attackee}", "calcAttack(targetUnit, from, target) {\n if (!from)\n from = this.assignment;\n if (!target)\n target = targetUnit.assignment;\n\n let calc = {};\n let power = Math.max(0, this.power + this.mPower);\n let armor = Math.max(0, Math.min(100, targetUnit.armor + targetUnit.mArmor));\n let blocking = targetUnit.blocking + targetUnit.mBlocking;\n\n // Equality check the unit ID since targetUnit may be a clone.\n if (this.aLOS && this.getLOSTargetUnit(target, from).id !== targetUnit.id) {\n // Armor reduces melee/magic damage.\n calc.damage = Math.round(power * (100 - armor) / 100);\n\n // Another unit is in the way. No chance to hit target unit.\n calc.chance = 0;\n calc.miss = 'miss';\n }\n else if (\n (\n /^(melee|magic|heal)$/.test(this.aType) &&\n targetUnit.barriered\n ) ||\n (\n this.aType === 'melee' &&\n targetUnit.blocking === 100 &&\n targetUnit.directional === false &&\n !targetUnit.paralyzed &&\n !targetUnit.focusing\n )\n ) {\n calc.miss = 'immune';\n calc.chance = 0;\n calc.damage = 0;\n }\n else if (this.aType === 'melee') {\n // Armor reduces magic damage.\n calc.damage = Math.round(power * (100 - armor) / 100);\n\n if (targetUnit.paralyzed || targetUnit.focusing)\n calc.chance = 100;\n else if (targetUnit.directional === false) {\n // Wards have 100% blocking from all directions.\n // Chaos Seed has 50% blocking from all directions.\n // Shrubs have 0% blocking from all directions.\n calc.chance = Math.max(0, Math.min(100, 100 - blocking));\n\n // A successful block reduces Chaos Seed blocking temporarily.\n // But, a failed block does not boost Chaos Seed blocking.\n calc.bonus = 0;\n calc.penalty = 100 - targetUnit.blocking;\n }\n else {\n // My direction to target can be diagonal, such as NW\n let direction = this.board.getDirection(from, targetUnit.assignment, true);\n\n if (direction.indexOf(targetUnit.direction) > -1) {\n // Hitting a unit from behind always succeeds.\n calc.chance = 100;\n }\n else {\n let team = this.team;\n // Hits from the side have a greater chance and penalty\n let factor = direction.indexOf(this.board.getRotation(targetUnit.direction, 180)) > -1 ? 1 : 2;\n let chance = Math.max(0, Math.min(100, 100 - blocking/factor));\n\n if (team.useRandom)\n calc.chance = chance;\n else if (chance <= 50)\n calc.chance = 0;\n else if (targetUnit.blocking && targetUnit.mBlocking/factor >= targetUnit.blocking/2)\n calc.chance = 0;\n else\n calc.chance = 100;\n\n if (calc.chance === 0)\n calc.miss = 'block';\n\n calc.bonus = targetUnit.blocking;\n calc.penalty = 100*factor - targetUnit.blocking;\n }\n }\n }\n else if (this.aType === 'magic') {\n // Armor reduces magic damage.\n calc.damage = Math.round(power * (100 - armor) / 100);\n\n // Magic can only be stopped by barriers.\n calc.chance = 100;\n }\n else if (this.aType === 'heal') {\n // Armor has no effect on heal power.\n calc.damage = -power;\n\n // Healing can only be stopped by barriers.\n calc.chance = 100;\n }\n else {\n // The attack type is the name of an effect.\n calc.effect = this.aType;\n\n // Not even barriers can stop effects.\n calc.chance = 100;\n }\n\n return calc;\n }", "function bullsPlayers(player) {\r\n return player.TEAM === \"CHI\";\r\n}", "toggleAuraForTarget(paladinID, targetID) {\n if (Token.tokenIsPaladin(paladinID)) {\n const paladinObj = STATE.get('TokenList', paladinID);\n const targetObj = STATE.get('TokenList', targetID);\n if (paladinObj.paladinProps === undefined) {\n Chat.send('Could not toggle aura for target because supplied paladin has no paladin properties.', 'warning');\n }\n else {\n const target = getObj('graphic', targetID);\n if (target === undefined || target.get('_subtype') !== 'token' || target.get('layer') !== 'objects') {\n Chat.send('Could not grant bonus to target, the target is not a token (possibly a drawing or card).', 'warning');\n }\n else {\n const tIsNPC = targetObj && targetObj.isNPC;\n const character = targetObj && targetObj.characterID && getObj('character', targetObj.characterID);\n const forceInclusion = character ?\n Paladin.getInclusion(paladinObj, character.id) :\n Paladin.getInclusion(paladinObj, targetID);\n let newVal;\n if (forceInclusion !== undefined) {\n if (character)\n Paladin.toggleInclusion(paladinObj, character.id);\n else\n Paladin.toggleInclusion(paladinObj, targetID);\n }\n else {\n newVal = tIsNPC ? 1 : 0;\n if (character)\n Paladin.addInclusion(paladinObj, character.id, newVal);\n else\n Paladin.addInclusion(paladinObj, targetID, newVal);\n }\n if (targetObj) {\n Token.setBonus(targetObj, Token.calcBonus(targetObj));\n }\n else {\n calcAndSetAllBonuses();\n }\n }\n }\n }\n else {\n Chat.send('The selected token is not registered as a paladin. Try restarting the API if this is an error.', 'error');\n }\n }", "function attack(damage, target) {\n\t// Generates and stores a random number from 1 to 10.\n $(\"#room-hider\").hide();\n $(\"#searcher-images\").hide();\n // hide room description on attack in case it bugs out and is showing\n\tvar hitChance = Math.floor(Math.random() * 10) + 1;\n var defense = target.defense;\n\n if(hitChance <= defense) {\n $(\"#combat-display\").append(\"<p>\" + target.name + \" defended, no damage.</p>\");\n } else if(hitChance >= 1 && hitChance <= 10) {\n \ttarget.takeDamage(damage);\n // Doesn't need to be an else if, but made it one to illustrate \tthe concept.\n }\n}", "attack(target) {\n return (target.res -= this.power);\n }", "function find_viable_targets() {\r\n\tvar monsters = Object.values(parent.entities).filter(\r\n\t\tmob => (mob.target == null\r\n\t\t\t|| parent.party_list.includes(mob.target)\r\n\t\t\t|| mob.target == character.name)\r\n\t\t\t&& (mob.type == \"monster\"\r\n\t\t\t\t&& (parent.party_list.includes(mob.target)\r\n\t\t\t\t\t|| mob.target == character.name))\r\n\t\t\t|| monster_targets.includes(mob.mtype));\r\n\r\n\tfor (id in monsters) {\r\n\t\tvar monster = monsters[id];\r\n\r\n\t\tif (parent.party_list.includes(monster.target) || monster.target == character.name) {\r\n\t\t\tmonster.targeting_party = 1;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tmonster.targeting_party = 0;\r\n\t\t}\r\n\t}\r\n\r\n\t//Order monsters by whether they're attacking us, then by distance.\r\n\tmonsters.sort(function (current, next) {\r\n\t\tif (current.targeting_party > next.targeting_party) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\tvar dist_current = distance(character, current);\r\n\t\tvar dist_next = distance(character, next);\r\n\t\t// Else go to the 2nd item\r\n\t\tif (dist_current < dist_next) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\telse if (dist_current > dist_next) {\r\n\t\t\treturn 1\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t});\r\n\treturn monsters;\r\n}", "lose(opponent) {}", "findAttackTarget(creep) {\n\n let hostile = creep.pos.findClosestByPath(FIND_HOSTILE_CREEPS, {filter: (enemy) => !global.Friends[enemy.owner.username]}); \n if (!hostile) {\n hostile = creep.pos.findClosestByPath(FIND_HOSTILE_STRUCTURES, {filter: (enemy) => !global.Friends[enemy.owner.username]});\n }\n\n if (hostile){\n creep.memory.attackTarget = hostile.id;\n }\n }", "setTargetOwner(aTargetOwner) {\n this.target_owner = aTargetOwner;\n }", "function AttackNextPlayer() {\n Orion.Ignore(self);\n var target = Orion.FindType(\"-1\", \"-1\", \"ground\", \"human|near|live|ignorefriends\", 18, \"gray|criminal|orange|red\");\n if (target.length != 0) {\n Orion.Attack(target[0]);\n Orion.Ignore(target[0]);\n } else {\n Orion.IgnoreReset();\n Orion.Ignore(self);\n target = Orion.FindType(\"-1\", \"-1\", \"ground\", \"human|near|live|ignorefriends\", 18, \"gray|criminal|orange|red\");\n if (target.length != 0) {\n Orion.Attack(target[0]);\n Orion.Ignore(target[0]);\n }\n }\n}" ]
[ "0.57123727", "0.5673088", "0.55670863", "0.55659145", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53862154", "0.53772515", "0.5365638", "0.5353595", "0.53477216", "0.53242767", "0.52931166", "0.5256811", "0.52558124", "0.52506125", "0.5248877", "0.5248824", "0.522285", "0.52112114", "0.52077913", "0.518412", "0.5177534", "0.5174291", "0.51719725", "0.51586133" ]
0.6104942
0
Gets a list of all tokens owned by us.
list() { return this.contract.methods.getOwnerTokens(this.contract.defaultAccount).call(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getTokens () {\n\t\tthis.tokens = this.members.reduce((tokens, user) => {\n\t\t\tconst userAttrs = user.attributes || user;\n\t\t\tif (userAttrs.broadcasterToken) {\n\t\t\t\ttokens.push(userAttrs.broadcasterToken);\n\t\t\t}\n\t\t\treturn tokens;\n\t\t}, []);\n\t}", "static async getUsers (token) {\n const query = `*[_type == 'user'] {\n name,\n _id\n }\n `\n client.config({ token })\n return client.fetch(query)\n }", "function listTokens(req, res) {\n Token.find(\n {\n $and: [\n {\n user: res.locals.user\n },\n utils.formatQuery(req.query)\n ]\n },\n '-salt -value'\n )\n .lean()\n .sort({ _id: -1 })\n .then(function(tokens) {\n res\n .status(200)\n .json(tokens.map(token => utils.formatTokenResponse(token)));\n })\n .catch(function(err) {\n console.log(err);\n\n res.status(500).json({\n error: {\n code: 500,\n message: 'Internal server error'\n }\n });\n });\n}", "function getUserList() {\n \n return userList;\n }", "async loadTokensList() {\n return null;\n }", "function getUsernameList() {\r\n\tvar userlist = getUsernames();\r\n\treturn userlist;\r\n}", "function getUserList(tok) {\n\treturn new Promise(function(resolve, reject) {\n\t\trequest.get('https://slack.com/api/users.list?token='+tok,\n\t\t\tfunction (error, response, body) {\n\t\t\t\tif (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t} else {\n //console.log(body);\n resolve(JSON.parse(body));\n }\n });\n\t});\n}", "async getTokens() {\n const apiURL = `${this.dxApiURL}/v1/tokens`\n const res = await fetcher(apiURL)\n\n return res.data\n }", "users() {\r\n\t\treturn API.get(\"pm\", \"/list-users\");\r\n\t}", "function get_users(){\n\tconst q = datastore.createQuery(USER);\n\treturn datastore.runQuery(q).then( (entities) => {\n\t\t\treturn entities[0].map(ds.fromDatastore);\n\t\t});\n}", "async getUserIds() {\n let keys = Object.keys(this.user)\n let make = function*() {\n for (var key of keys) {\n yield key\n }\n }\n return make()\n }", "static loadTokensList() {\n const { availableTokens, network, walletAddress } = store.getState();\n\n if (network !== 'mainnet') return Promise.resolve();\n\n const availableTokensAddresses = availableTokens\n .filter(token => token.symbol !== 'ETH')\n .map(token => token.contractAddress);\n\n return fetch(\n `https://api.ethplorer.io/getAddressInfo/${walletAddress}?apiKey=freekey`,\n )\n .then(response => response.json())\n .then(data => {\n if (!data.tokens) {\n return Promise.resolve();\n }\n\n return data.tokens\n .filter(\n token =>\n !availableTokensAddresses.includes(token.tokenInfo.address),\n )\n .forEach(token => {\n store.dispatch({\n type: ADD_TOKEN,\n token: {\n contractAddress: token.tokenInfo.address,\n decimals: parseInt(token.tokenInfo.decimals, 10),\n name: token.tokenInfo.name,\n symbol: token.tokenInfo.symbol,\n },\n });\n });\n });\n }", "_getTokens() {\n return http\n .get(`${ENV.VUE_APP_TOKEN_INFO_API_URL}/tokens`)\n .then(resp => resp.data);\n }", "get tokenIds() {\n return this._state.tokenIds;\n }", "function getUserList(){\r\n var ret = [];\r\n for(var i=0;i<clients.length;i++){\r\n ret.push(clients[i].username);\r\n }\r\n return ret;\r\n}", "function getUserList(){\r\n var userListforGet = [];\r\n for(var i=0;i<chatAppUsers.length;i++){\r\n userListforGet.push(chatAppUsers[i].currentUser);\r\n }\r\n return userListforGet;\r\n}", "async getUsers() {\n let userResult = await this.request(\"users\");\n return userResult.users;\n }", "function listOfUsers() {\n request.get('https://slack.com/api/users.list?token='+\n process.env.Apptoken+'&pretty=1',function (err,requ,response)\n {\n var data= JSON.parse(response);\n usersLists=data.members;\n });//end of get users.list function\n}", "static getUsers() {\n return API.fetcher(\"/user\");\n }", "function get_users(){\n var q = datastore.createQuery(USERS);\n\n return datastore.runQuery(q).then( (entities) => {\n return entities;\n });\n}", "async list() {\n\t\treturn this.store.User.findAll()\n\t}", "static getUsers(state) {\n return state.users;\n }", "async function getUserList() {\n\n // Connection properties\n var options = {\n method: 'GET',\n uri: conf.API_PATH + `5808862710000087232b75ac`,\n json: true\n };\n\n return (await request(options)).clients;\n}", "function getUserList() {\n userService.getUsers()\n .then(function (users) {\n var result = users.filter(function (u) {\n return u.Id !== vm.current.details.ownerId;\n });\n vm.ownerForm.users = result;\n });\n }", "allUser() {\n return ['member', 'teamlead', 'admin', 'supervisor', 'manager']\n }", "function activeUsers() {\n let users = ['Jaynie', 'Brent', 'Reggie', 'Willie'];\n return users;\n} // end activeUsers", "async getUserIds() {\n console.log('GET /users')\n return this.server.getUserIds()\n }", "queryTokens(tokens) {\n return from(\n this.$tokenQuery.queryInfo(this.$provider.currentAccount, tokens)\n );\n }", "async userNames() {\n let cursor;\n const userNames = {};\n do {\n const {\n members: users,\n response_metadata: { next_cursor: nextCursor },\n } = await this.usersList({\n cursor,\n });\n\n for (const user of users) {\n userNames[user.id] = user.name;\n }\n\n cursor = nextCursor;\n } while (cursor);\n return userNames;\n }", "get tokens() {\n return this._tokens;\n }", "async getUsers () {\n\t\tif (this.members) {\n\t\t\treturn;\n\t\t}\n\t\tthis.members = await this.data.users.getByIds(\n\t\t\tthis.team.getActiveMembers(),\n\t\t\t{\n\t\t\t\t// only need these fields\n\t\t\t\tfields: ['isRegistered', 'accessToken', 'accessTokens', 'broadcasterToken']\n\t\t\t}\n\t\t);\n\t}", "function getUsers() {\n return getItem('users');\n}", "async allUsernames() {\n\t\t// Redis key search pattern.\n\t\tlet pattern = \"*\"\n\t\tif (this._prefix !== null) {\n\t\t\tpattern = this._prefix + pattern;\n\t\t}\n\n\t\tlet keys = await this.redisKeys(pattern);\n\t\tlet usernames = keys.map((el) => {\n\t\t\tlet prefix = this._prefix === null ? \"\" : this._prefix;\n\t\t\treturn el.replace(new RegExp(\"^\" + prefix), \"\");\n\t\t});\n\n\t\treturn usernames;\n\t}", "function getallusers() {\n\n\t}", "async function getTokens() {\n const result = await gql(process.env.SUBGRAPH_ENDPOINT).assets();\n console.log(JSON.stringify(result, null, 2))\n return result;\n}", "getUsers() {\n const slack_users = this.bot.getUsers()._value.members;\n\n for (let item = 0; item < slack_users.length; item++) {\n this.users[slack_users[item].id] = slack_users[item].name;\n }\n }", "get allUsers() {\n // Returning a freezed copy of the list of users to prevent outside changes\n return Object.fromEntries(this.users.map((user) => [user.id, user]));\n }", "async function listUsers() {\r\n let res = await request\r\n .get(reqURL(config.routes.user.list))\r\n .withCredentials()\r\n .set(\"Content-Type\", \"application/json\")\r\n .set(\"Accept\", \"application/json\")\r\n .auth(\"team\", \"DHKHJ98N-UHG9-K09J-7YHD-8Q7LK98DHGS7\");\r\n log(`listUsers:${util.inspect(res.body)}`);\r\n return res.body\r\n}", "function getUsers() {\n return Object.values(usersDictById);\n }", "function getSubscribedUsers() {\n var users = [];\n var subscribed = getSubscribedList();\n for(var user in subscribed) {\n users.push(user.toString());\n }\n return users;\n }", "function peeps() {\n userlist = [];\n for (var uid in users) {\n userlist.push(users[uid].name);\n }\n return userlist;\n}", "getAllUsers() {\n return Api.get(\"/admin/user-list\");\n }", "function getUserList(){\n\tvar userList = [];\n\tfor(var i in users)\n\t\tif(!(users[i].socket.isPaired))\n\t\tuserList.push({\"name\":users[i].socket.name});\n\treturn userList;\n}", "async getAllAccounts() {\n if (this.nativeBrokerPlugin) {\n const correlationId = this.cryptoProvider.createNewGuid();\n return this.nativeBrokerPlugin.getAllAccounts(this.config.auth.clientId, correlationId);\n }\n return this.getTokenCache().getAllAccounts();\n }", "async function getallwillOwners() {\n let accounts = await web3.eth.getAccounts();\n let owners = await contract.methods\n .getAllUsersAddresses()\n .call({ from: accounts[0] });\n setWillOwner(owners);\n }", "function GetAllTokens() {\n\n var appendTo = document.getElementById('member-tokens-assigned');\n\n axios.get('/0/workspace/'+ space + '/getAllTokens').then(function ( res ) {\n\n var tokens = res.data;\n\n console.log(tokens);\n\n tokens.forEach(function( generated, index) {\n var html = document.createElement('div');\n html.classList.add('token-generated');\n\n generated.claimed ? html.classList.add('token-used') : html.classList.add('token-free');\n html.innerHTML = '<p>' + generated.token + '</p>';\n\n appendTo.appendChild(html);\n });\n })\n .catch(function (error) { console.log(error) });\n}", "async function getPushTokens() {\n try {\n const expoTokens = await Account.find(\n { expoToken: { $ne: null }}, {expoToken: 1})\n var tokens = [];\n expoTokens.forEach((device) => tokens.push(device.expoToken));\n\n return tokens;\n } catch (error) {\n console.log(error.message);\n }\n}", "function getAllUnits(decodedToken) {\n return db.raw(\n `SELECT DISTINCT unit.id, unit.name, unit.street_address, unit.city, unit.state, unit.zip, unit.occupied, unit.rent\n FROM public.user join\n public.user_unit ON user_unit.user_id = public.user.id join\n public.unit ON unit.id = public.user_unit.unit_id\n where public.user.id = ?`,\n [decodedToken.user_id],\n )\n}", "static async getAll() {\n\t\tconst usersRes = await db.query(`SELECT * FROM users ORDER BY username`);\n\t\treturn usersRes.rows;\n\t}", "function getSubscribedUsers() {\n\tvar users = [];\n\tvar subscribed = getSubscribedList();\n\tfor(var user in subscribed) {\n\t\tusers.push(user);\n\t}\n\treturn users;\n}", "get providerTokens() {\n return getInjectionTokens(this.nativeNode);\n }", "function getAllListsOfUser() {\n \n const allLists = storage.getItem('P1_todoUsersDB');\n \n for (const list of allLists) {\n if (currentUser.userId === list.userId) {\n userLists.push(list);\n }\n }\n \n return userLists;\n }", "function get_users(){\n var q = datastore.createQuery(USER);\n return datastore.runQuery(q).then( (entities) => {\n return entities[0];\n });\n}", "function getListUserAuthorized() {\n var ListUserAuthorized = [];\n var temp;\n var len;\n var dataDA;\n \n // Recuperation de la liste des users de la BU de la DA\n temp = (globalDAData.managerBU).split(',');\n //Log_Severe(\"getListUserAuthorized\", Utilities.formatString(\"globalDAData.managerBU=%s\",globalDAData.managerBU));\n len = temp.length;\n //Log_Severe(\"getListUserAuthorized\", Utilities.formatString(\"len=%s\",len));\n for(n=1;n<len+1;++n){\n ListUserAuthorized.push(temp[n-1]);\n //Log_Severe(\"getListUserAuthorized\", Utilities.formatString(\"temp[n-1]=%s\",temp[n-1]));\n }\n //Log_Severe(\"getListUserAuthorized\", ListUserAuthorized);\n return ListUserAuthorized;\n}", "static async getUsers() {\n return await this.request('users/', 'get');\n }", "GetUsersList(room){\n var users = this.users.filter((user) => user.room === room );\n \n var namesArray = users.map((user) => user.name );\n \n let NamesArray = namesArray;\n\t\tlet newNamesArray = Array.from(new Set(NamesArray));\n\t//\tconsole.log(newNamesArray);\n\t\treturn newNamesArray;\n }", "getTokens() {\n this.$http.get('/settings/api/tokens')\n .then(function(response) {\n this.tokens = response.data;\n });\n }", "getUserList() {\n return this.http.get(this.url + '/cesco/getlanguages', this.httpOptions);\n }", "getUserList(room){\n var users = this.users.filter((user)=> user.room === room); /* FINDING USER WITH SAME ROOM NAME */\n var namesArray = users.map((user)=> user.name); /* SELECTING USER NAMES IN THAT ROOM */\n\n return namesArray;\n }", "get siteUserInfoList() {\r\n return new List(this, \"siteuserinfolist\");\r\n }", "async function nowusers()\n{\n var users = await Viewers.SelectUser()\n return users\n}", "function getUsers(){\n return users;\n}", "getAccounts() {\n return privates.get(this).keyring.getAccounts();\n }", "getAllUsers() {\r\n return this.users;\r\n }", "getAccountsList() {\n const params = { type: 'list' };\n return this.apiService.get(`${this.url}/user/find`, { params }).pipe(\n map(res => res.map((account) => this._modifyUserAccountSummary(account)))\n );\n }", "function getAll() {\n return $firebaseArray(ref.child('users'));\n }", "function findAllUsers() {\n return fetch(self.url).then(response => response.json())\n }", "function userList() {\n let jsonFileRead = fs.readFileSync(path.join(__dirname, '../data/users.json'), 'utf-8')\n return JSON.parse(jsonFileRead)\n}", "function getMentions (msg) {\n return msg.mentions.users.array()\n}", "function getAllUsers() {\n let todoUsersDB = storage.getItem('P1_todoUsersDB');\n\n if (todoUsersDB) { return JSON.parse(todoUsersDB); }\n else { return []; }\n }", "static async read(token) {\n return await sendRequest(\"GET\", \"/users/self\", token);\n }", "get tokenSet() {\n this._syncWithElement();\n return this._tokenSet;\n }", "function tokenStream() {\n\n return Observable.from(TOKENS);\n}", "function allAccounts() {\n return __awaiter(this, void 0, void 0, function* () {\n var prev_last_id = '0';\n var accounts = [];\n var done = false;\n while (!done) {\n let query = `query {\n accounts(\n where: {id_gt: \"${prev_last_id}\"}\n first: 1000\n ){\n id\n creationTimestamp\n lastSeenTimestamp\n scaledCollateralVolume\n lastTradedTimestamp\n }\n }`;\n yield query_subgraph(query).then((res) => {\n if (res.data.data.accounts.length == 0) {\n done = true;\n return;\n }\n // Join lists of accounts, ignoring duplicates\n accounts = accounts.concat(res.data.data.accounts);\n prev_last_id = res.data.data.accounts.slice(-1)[0].id;\n })\n .catch((error) => {\n console.log(error);\n throw error;\n });\n }\n return accounts;\n });\n}", "function listUsers() {\n $listUsers.empty();\n\n if (event) event.preventDefault();\n\n var token = localStorage.getItem('token');\n $.ajax({\n url: '/users',\n method: 'GET',\n beforeSend: function beforeSend(jqXHR) {\n if (token) return jqXHR.setRequestHeader('Authorization', 'Bearer ' + token);\n }\n }).done(function (users) {\n showUsers(users, 0, 10);\n });\n }", "function getPublicUsers()\n{\n let users = readUsers();\n let publicUsers = [];\n for (let i = 0; i < users.length; ++i)\n {\n if (users[i].accountType == \"public\")\n {\n publicUsers.push(users[i]);\n }\n }\n return publicUsers;\n}", "getAccounts(): Promise<Array<Account>> {\n return this._member.getAccounts();\n }", "async function getAllUsers () {\r\n\t/*var listAddress = [];\r\n\tlistAddress = await Token.getMembers(function(err,result) {return result})\r\n\tfor (var i=0; i<listAddress.length; i++){\r\n\t\tvar address = listAddress[i];\r\n\t\tvar name = await Token.getName(address, function(err, result){return result});\r\n\t\tvar balance = await Token.balanceOf(address, function(err, result){return result})\r\n\t\tusers[name].address = address;\r\n\t\tusers[name].name = name;\r\n\t\tusers[name].balance = balance;\r\n\t}\r\n\t*/\r\n\ttry{\r\n\t\tlistAddress = await Token.getMembers(function(err,result) {return result})\r\n\t}\r\n\tcatch(err){\r\n\t\talert(err.message)\r\n\t}\r\n\talert(listAddress.length)\r\n}", "function userScopes(decodedToken) {\n if (!(decodedToken.scope instanceof Array && decodedToken.scope.length)) {\n return [];\n }\n return decodedToken.scope\n .map(function (s) { return (s.includes('.') ? s.substr(s.indexOf('.') + 1, s.length) : s); })\n .map(function (s) { return ({ name: s }); });\n}", "static getList() {\n return new Promise((resolve) => {\n setTimeout(() => {\n // build some dummy users list\n const users = [];\n for (let x = 1; x <= 28; x += 1) {\n users.push({\n id: x,\n username: `Johny ${x}`,\n job: `Employee ${x}`,\n });\n }\n resolve(users);\n }, 1000);\n });\n }", "listUsers(aud) {\n return this.user._request('/admin/users', {\n method: 'GET',\n audience: aud,\n });\n }", "async getAllAccounts() {\n this.logger.trace(\"getAllAccounts called\");\n let cacheContext;\n try {\n if (this.persistence) {\n cacheContext = new msalCommon.TokenCacheContext(this, false);\n await this.persistence.beforeCacheAccess(cacheContext);\n }\n return this.storage.getAllAccounts();\n } finally {\n if (this.persistence && cacheContext) {\n await this.persistence.afterCacheAccess(cacheContext);\n }\n }\n }", "async getAllUsers(){\n data = {\n URI: `${ACCOUNTS}`,\n method: 'GET'\n }\n return await this.sendRequest(data)\n }", "static getAllUsers() {\n return fetch('https://dev-selfiegram.consumertrack.com/users').then(response => {\n return response.json();\n }).catch(error => {\n return error;\n });\n }", "function getAllUsers() {\n\treturn JSON.parse(localStorage.getItem('users')); \n}", "async function getUsers() {\n const to_return = await localStorage.getItem(DATA_KEY);\n return to_return;\n}", "async CheckTokens(ctx, id) {\n //Get the tokens member with the \"id\" has\n console.log('memberId'+id);\n let member = await ctx.stub.getState(id);\n member = JSON.parse(member);\n return member.Tokens;\n }", "function getUsers(users){\n\tlet user = [];\n\tfor (let i in users){\n\t\tuser.push(users[i]);\n\t}\n\treturn user;\n}", "getTodoSharedUsers(accessToken, todoId) {\n\n var todo = this.Class.Object(todoId);\n\n return todo.fetch()\n .then((result) => {\n var rolesObject = result.getACL().toJSON();\n return this.getUsersList(rolesObject.roles);\n });\n }", "async function getAccountTokenIds(addr) {\n let cadence = await (await fetch(getAccountTokenIdsScript)).text();\n const encoded = await fcl.send([\n fcl.script(cadence),\n fcl.args([fcl.arg(addr, t.Address)])\n ]);\n return await fcl.decode(encoded);\n}", "function findAllUsers() {\n return fetch('https://wbdv-generic-server.herokuapp.com/api/alkhalifas/users')\n .then(response => response.json())\n }", "static async getAllUsers() {\n try {\n logger.info('[user]: listing all users');\n const userList = await UserService.findAllUsers();\n\n return userList;\n } catch (e) {\n throw new InternalServerException();\n }\n }", "getUsers() {\n const users = [];\n return new Promise((resolve, reject) => {\n // Scan for keys starting with user:\n this.rdsCli.scan(0, 'MATCH', 'user:*', 'COUNT', 100, (err, reply) => {\n if (err) {\n reject();\n }\n\n const totalUsers = reply[1].length;\n let i = 0; // Counter\n\n // Loop through and get data for each user\n _.forEach(reply[1], (user) => {\n this.rdsCli.hgetall(user, (err, reply) => {\n i++;\n users.push(reply); // Add to array\n\n // Resolve promise when finished\n if (i === totalUsers) {\n resolve(users);\n }\n });\n });\n });\n });\n }", "getTokenUsage(startDate, endDate) {\n return __awaiter(this, void 0, void 0, function* () {\n // moment really upsets tslint\n // tslint:disable:no-unsafe-any\n if (endDate === undefined) {\n endDate = new Date();\n }\n const startMoment = moment(startDate).startOf(\"month\");\n const endMoment = moment(endDate).startOf(\"month\");\n assert(endMoment.diff(startMoment) >= 0, \"Invalid arguments. startDate should be before endDate (and also not in the future)\");\n let tokenSessions = [];\n while (endMoment.diff(startMoment) >= 0) {\n const newTokenSessions = yield this._getTokenUsageForMonth(startMoment.toDate());\n tokenSessions = (newTokenSessions.filter((sess) => sess.date >= startDate && sess.date <= endDate)).concat(tokenSessions);\n startMoment.add(1, \"month\");\n }\n return tokenSessions;\n // tslint:enable:no-unsafe-any\n });\n }", "async getUsers () {\n\t\tlet userIds = this.posts.reduce((accum, post) => {\n\t\t\taccum = [...accum, post.get('creatorId'), ...(post.get('mentionedUserIds') || [])];\n\t\t\treturn accum;\n\t\t}, []);\n\t\tuserIds = ArrayUtilities.unique(userIds);\n\n\t\tthis.users = await this.data.users.getByIds(userIds);\n\t}", "all() {\n return users;\n }", "getAllUserCryptos() {\n return Api.get(\"/client\");\n }", "static getTargetTokens({required=false}={}) {\n\t\tconst character = game.user.character;\n\t\tconst controlled = canvas.tokens.controlled;\n\t\tif (!controlled.length && character) {\n\t\t\treturn [character];\n\t\t}\n\n\t\tconst results = controlled.filter(a => a);\n\t\tif (required && !controlled.length) {\n\t\t\tui.notifications.warn(game.i18n.localize(\"SNS.ActionWarningNoToken\"));\n\t\t}\n\n\t\treturn results;\n\t}", "getAll() {\n return this.tenants;\n }", "get usersList() {\n return this.model.users.toArray();\n }" ]
[ "0.7440106", "0.6707279", "0.6542079", "0.6446956", "0.64206964", "0.63754565", "0.6301163", "0.6225859", "0.6164834", "0.60858214", "0.60697484", "0.6043096", "0.60347664", "0.59970623", "0.59858334", "0.59721", "0.5882159", "0.5868559", "0.5864072", "0.58545834", "0.5854328", "0.5816492", "0.58120304", "0.5800717", "0.57581836", "0.5758091", "0.5757083", "0.5748063", "0.57466024", "0.5738191", "0.57346934", "0.5732036", "0.57173055", "0.5712173", "0.57068217", "0.56988156", "0.56930166", "0.56737685", "0.5670214", "0.5661688", "0.56570214", "0.56478405", "0.5645637", "0.5637636", "0.56303513", "0.56302077", "0.5619788", "0.5598203", "0.5596457", "0.55897003", "0.5585369", "0.55824614", "0.5573893", "0.5562533", "0.5562214", "0.5560285", "0.5554366", "0.5542778", "0.5542668", "0.55421174", "0.55351055", "0.55350894", "0.55289733", "0.55234677", "0.55043346", "0.5496276", "0.5482385", "0.54761624", "0.5472016", "0.5451022", "0.5444313", "0.5423691", "0.5423423", "0.54097265", "0.5407752", "0.54006296", "0.5395501", "0.5391911", "0.53910613", "0.5380671", "0.53764164", "0.5368512", "0.5362854", "0.53507996", "0.5349606", "0.5345554", "0.53365016", "0.5335597", "0.53344524", "0.5334391", "0.53244513", "0.5314469", "0.5313238", "0.53093004", "0.5309262", "0.53038335", "0.52914137", "0.52869743", "0.5282918", "0.52754813" ]
0.73607177
1
Gets a count of our tokens.
balance() { return this.contract.methods.balanceOf(this.contract.defaultAccount).call(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function count_Tokens()\n{\n return this.tokens.length;\n}", "get getTokenCallCount() {\n return this._getTokenCallCount;\n }", "get count() {}", "count() {\n return this.reduce(0, math_1.incr);\n }", "function getCount() {\n return count;\n}", "function charactersOccurencesCount() {\n \n}", "function charactersOccurencesCount() {\n \n}", "function charactersOccurencesCount() {\n \n}", "function charactersOccurencesCount() {\n \n}", "function dungeonTokenCount (values) {\n return values.ascalonianTears + values.sealsOfBeetletun + values.deadlyBlooms +\n values.manifestosOfTheMoletariate + values.flameLegionCharrCarvings +\n values.symbolsOfKoda + values.knowledgeCrystals + values.shardsOfZhaitan\n}", "function charactersOccurencesCount() {\n\n}", "function charactersOccurencesCount() {\n\n}", "function charactersOccurencesCount() {\n\n}", "function charactersOccurencesCount() {\n\n}", "function charactersOccurencesCount() {\n\n}", "getSearchResultCount(){\n let text = this.txtSearchResult.getText()\n return parseInt(text.split(\" \")[0])\n }", "function count(){\r\n\r\n\tvar n=0;\r\n\tObject.keys(this.datastore).forEach((key)=>\r\n\t{\r\n\t\t++n;\r\n\t});\r\n\treturn n;\r\n}", "function count()\n {\n var count = 0;\n for(var t in templates){\n count += templates[t].count();\n }\n return count;\n }", "getCount(word) {\n return this.dict[word];\n }", "getCount(word) {\n return this.dict[word];\n }", "GetItemCount() {}", "count()\n\t{\n\t\treturn this.numCards;\n\t}", "function getNumOfTransactions(address, tokenName) {\n\ttxs = getTokenTransactions(address, tokenName);\n\tresult = txs.length;\n \treturn result;\n}", "get length() {\n return this.request(`${this.prefix}line_count`, []);\n }", "function count() {\n return counter +=1;\n }", "count() {\n let sum = this.items.length;\n return sum;\n }", "count() {}", "function getOrderCount (baseUrl, token)\n{\n const url = `${baseUrl}/admin/orders/count.json?&access_token=${token}`;\n return fetchJson(url)\n .then(data => data.count);\n}", "get count () {\n\t\treturn this._count;\n\t}", "count () {\n return Object.keys(this.cards).length;\n }", "function getTotalRewardTokens(req, res, next) {\n Reward.getTotalRewardTokens()\n .then(tokens => {\n req.result = {\n _id: req.groupId,\n name: req.groupName,\n initialTokens: 0,\n usedTokens: tokens[0].totalTokens\n };\n next();\n })\n .catch(e => next(e));\n}", "count() {\n if (this.head == null) {\n return 0;\n } else {\n let intCounter = 1;\n let countHead = this.head;\n while (countHead.next != null) {\n intCounter++;\n countHead = countHead.next;\n }\n\n return intCounter;\n }\n }", "length() {\n let count = 0;\n\n this.traverse(function (node) {\n count++;\n console.log('current count is ' + count);\n });\n\n return count;\n }", "count (ngram, options) {\n let matchingDocs = this.findDocs(ngram, options)\n return matchingDocs.length\n }", "function getcounts(tag) {\n var counts = 0;\n for (var i = 0; i < gettags().length; i++) {\n if (gettags()[i] == tag){counts += 1;}\n }\n return counts;\n}", "function getcounts(tag) {\n var counts = 0;\n for (var i = 0; i < gettags().length; i++) {\n if (gettags()[i] == tag){counts += 1;}\n }\n return counts;\n}", "count() {\n return Object.keys(this.getAll()).length;\n }", "get tokens() {\n return this._tokens;\n }", "function count() {\n\tvar counter = 0;\n\tfor (var p in this) if (this.hasOwnProperty(p))++counter;\n\treturn counter;\n}", "getCharacterCount() {\n console.warn('[tiptap warn]: \"editor.getCharacterCount()\" is deprecated. Please use \"editor.storage.characterCount.characters()\" instead.');\n return this.state.doc.content.size - 2;\n }", "count() {\n return this._entities.length;\n }", "count() {\n return this._entities.length;\n }", "function getWordCounts(text) {\n\n}", "function count() {\n var n=0; \n for (var key in this.dataStore) {\n ++n;\n }\n return n;\n}", "get length() {\n // Assume that every newline is a keystroke, and that whitespace is stripped.\n const lines = this.code.split('\\n');\n const total_characters = lines.map(line => line.trim().length).reduce((a, b) => a + b);\n return total_characters + lines.length - 1;\n }", "get count() {\r\n return this._count;\r\n }", "get count() {\n return this._count;\n }", "static get MuscleCount() {}", "getCount() {\n return this.count;\n }", "function count() {\r\n return data.length;\r\n}", "function getDigitizeMonsterCount() {\n return (0, _property.get)(\"_sourceTerminalDigitizeMonsterCount\");\n}", "async getCount() {\n return axios\n .get(UrlBuilder[this.storeType].paths.count, createHeaders())\n .then(response => response.data)\n .catch(error => handleError(error.response))\n }", "function count(env) {\n 'use strict';\n var a = env.lookupVariable1('a');\n if (a.isWord()) {\n return new Word(a.value.length);\n }\n return new Word(a.values.length);\n}", "get count () {\n return this._stack.length\n }", "count() {\r\n return this.length;\r\n }", "async function getUserCount() {\n const query = datastore.createQuery(USERS);\n const entities = await datastore.runQuery(query);\n const count = Object.keys(entities[0]).length;\n return count;\n}", "size() {\n\t\tvar runner = this.head;\n\t\tvar counter = 0;\n\n\t\twhile (runner != null) {\n\t\t\tcounter += 1;\n\t\t\trunner = runner.next;\n\t\t}\n\t\treturn counter;\n\t}", "size() {\n\t\tvar runner = this.head;\n\t\tvar counter = 0;\n\n\t\twhile (runner != null) {\n\t\t\tcounter += 1;\n\t\t\trunner = runner.next;\n\t\t}\n\t\treturn counter;\n\t}", "function count_occurences(symbol, string) {\n\tvar count = 0;\n\n\tvar _iteratorNormalCompletion4 = true;\n\tvar _didIteratorError4 = false;\n\tvar _iteratorError4 = undefined;\n\n\ttry {\n\t\tfor (var _iterator4 = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_get_iterator___default()(string), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n\t\t\tvar character = _step4.value;\n\n\t\t\tif (character === symbol) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError4 = true;\n\t\t_iteratorError4 = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion4 && _iterator4.return) {\n\t\t\t\t_iterator4.return();\n\t\t\t}\n\t\t} finally {\n\t\t\tif (_didIteratorError4) {\n\t\t\t\tthrow _iteratorError4;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn count;\n}", "function count(inputco) {\n return inputco.length;\n}", "size() {\n let current, counter;\n [current, counter] = [this.head, 0];\n while (current) {\n counter++;\n current = current.next;\n }\n return counter;\n }", "count(){\n\t\treturn this.size;\n\t}", "size()\r\n {\r\n return this.#count;\r\n }", "get count() {\n\t\t\treturn this.items\n\t\t\t\t.map(item => item.qty)\n\t\t\t\t.reduce((total, qty) => total += qty, 0);\n\t\t}", "function getGemCount() {\n // Default to 0 in case errors\n\n // If user has a beta token in localstorage, use that. Else, get one.\n // This needs to be done right now because the CA-API does not currently support auth0 tokens only.\n var gemCount = 0;\n\n $.ajax({\n url: gemCountPath,\n cache: false,\n contentType: 'application/json',\n headers: {\n Authorization: accessToken()\n },\n success: function (data) {\n console.log(data)\n gemCount = data.gem_count;\n },\n error: function (error) {\n // console.log(error.responseJSON)\n },\n complete: function () {\n // Schedule the next request when the current one's complete\n $('#gemCount').text(gemCount);\n }\n });\n}", "function counter () {\n let count = 0\n \n // this method has access to count\n // because it closes over outer variables\n const plus = (function () {\n count++\n })\n \n plus()\n \n return count;\n \n }", "get line_count() {\n const newlines = this.code.match(/\\n/g) || [];\n return newlines.length + 1;\n }", "size () {\n\t\tlet count = 0;\n\t\tlet node = this.head;\n\n\t\twhile (node) {\n\t\t\tcount++;\n\t\t\tnode = node.next;\n\t\t}\n\n\t\treturn count;\n\t}", "size () {\n\t\tlet count = 0;\n\t\tlet node = this.head;\n\n\t\twhile (node) {\n\t\t\tcount++;\n\t\t\tnode = node.next;\n\t\t}\n\n\t\treturn count;\n\t}", "size () {\n\t\tlet count = 0;\n\t\tlet node = this.head;\n\n\t\twhile (node) {\n\t\t\tcount++;\n\t\t\tnode = node.next;\n\t\t}\n\n\t\treturn count;\n\t}", "getCounts () { return this.counts; }", "function getDepth(token) {\n var level = 0;\n var context = token.state.context;\n while (context) {\n level++;\n context = context.prev;\n }\n return level;\n }", "function GetNumTiles() {\n var tileCount = 0;\n\n for (var key in ScrabbleTiles) {\n tileCount += ScrabbleTiles[key].number_remaining;\n }\n\n return tileCount;\n}", "getFeldCount() {\n const count = { a: 0, b: 0, c: 0 };\n Object.entries(this.fachstunden).forEach((fach) => {\n const feld = c.faecher[fach[0]].feld;\n if (feld === 'a') {\n count.a += 1;\n } else if (feld === 'b') {\n count.b += 1;\n } else if (feld === 'c') {\n count.c += 1;\n }\n });\n return count;\n }", "function measure (token) {\n if (!token) { return -1 }\n\n return categorizeGroups(token).replace(/^C/, '').replace(/V$/, '').length / 2\n}", "function NextTokenInfo()\n {\n if (tokenIndex >= tokens.length) {\n console.log(\"sheets.js: NextTokenInfo: Ran out of tokens!\");\n return ['.', -1, -1];\n }\n var tokenInfo = tokens[tokenIndex++];\n return tokenInfo;\n }", "function getCounts() {\n return Promise.all([\n redisCommand('get', MUTANT),\n redisCommand('get', HUMAN)\n ])\n}", "function wordCount() {\n\n var example = document.getElementById(\"target\").textContent;\n //Splits into array\n tokens = example.split(/\\W+/);\n //Cycles through array and counts words\n for (var i = 0; i < tokens.length; i++) {\n var word = tokens[i];\n // It's a new word!\n if (concordance[word] === undefined) {\n concordance[word] = 1;\n // We've seen this word before!\n } else {\n concordance[word]++;\n }\n }\n return concordance;\n }", "function wordCount() {\n\n var example = document.getElementById(\"target\").textContent;\n //Splits into array\n tokens = example.split(/\\W+/);\n //Cycles through array and counts words\n for (var i = 0; i < tokens.length; i++) {\n var word = tokens[i];\n // It's a new word!\n if (concordance[word] === undefined) {\n concordance[word] = 1;\n // We've seen this word before!\n } else {\n concordance[word]++;\n }\n }\n return concordance;\n }", "function count_users() {\n\tconst q = datastore.createQuery(USER);\n\treturn datastore.runQuery(q)\n\t\t.then( (count) => {\n\t\t\treturn count[0].length;\n\t\t});\n}", "function count()\n {\n return form_counter;\n }", "function count (instructions) {\n let total = 0\n let i = 0\n\n while (i < instructions.length) {\n const instruction = instructions[i]\n // console.log(instruction)\n\n if (instruction.type === 'CHAR') {\n // consume the char, adding 1 to the total\n total++\n i++\n } else {\n // consume the marker, which adds nothing to the total\n i++\n\n // group the instructions that are repeated by this marker\n let consumed = 0\n let group = []\n\n while (consumed < instruction.span) {\n const next = instructions[i++]\n group.push(next)\n consumed += next.strLength\n }\n\n total += (instruction.repeats * count(group))\n }\n }\n\n return total\n}", "get length() {\n let node = this.head;\n let count = 0;\n while (node !== null) {\n count++;\n node = node.next;\n }\n return count;\n }", "function getObjectLength(object) {\n // YOUR CODE BELOW HERE //\n //create new variable count\n let count = 0;\n \n //declare for in loop\n for (var key in object){\n count++;\n }\n //print values of count\n return count;\n \n // YOUR CODE ABOVE HERE //\n}", "getCounter() {\n precondition.ensureNotNull('this.ctxPtr', this.ctxPtr);\n\n let proxyResult;\n proxyResult = Module._vscr_ratchet_message_get_counter(this.ctxPtr);\n return proxyResult;\n }", "function yylength() {\n return zzMarkedPos-zzStartRead;\n }", "async loadCount()\n {\n const qParams = this._cache.queryParams;\n if (!qParams)\n {\n throw new Meteor.Error('Calling .loadCount() while query params are not ready');\n }\n\n return this.getEntity().getCount(qParams.filter || {});\n }", "async getCount() {\n try {\n const countString = await AsyncStorage.getItem(eventCountKey);\n return parseInt(countString, 10);\n } catch (ex) {\n console.log('Couldn\\'t retrieve positive events count. Error:', ex);\n }\n }", "getVisitorCount () {\n return 1234;\n }", "size() {\n let count = 0;\n let node = this.head;\n\n // Iterate through the linked list nodes\n // Increase counter for every node found in the linked list\n while (node) {\n count++;\n node = node.next;\n }\n return count;\n }", "function getCounts() {\n kwordArr.sort();\n let currentWord = null;\n let cnt = 0;\n for (var i = 0; i < kwordArr.length; i++) {\n if (kwordArr[i] !== currentWord) {\n if (cnt > 0) {\n let word = {\n \"value\": currentWord,\n \"count\": cnt,\n }\n dataArray.push(word);\n }\n currentWord = kwordArr[i];\n cnt = 1;\n } else {\n cnt++;\n }\n }\n if (cnt > 0) {\n let word = {\n \"value\": currentWord,\n \"count\": cnt,\n }\n dataArray.push(word);\n }\n }", "size() {\r\n let count = 0;\r\n let runner = this.data.head;\r\n while(runner != null) {\r\n runner = runner.next;\r\n count++;\r\n }\r\n return count;\r\n }", "get length() {\n let entry = this.first;\n let length = 0;\n while (entry) {\n ++length;\n entry = entry.next;\n }\n return length;\n }", "getTrafficPermissionTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllTrafficPermissions()\n const count = entities.items.length\n\n commit('SET_TOTAL_TRAFFIC_PERMISSION_COUNT', count)\n }\n\n getItems()\n }", "async function getCount(){\n \t\t\tconst response = await fetch('getcount.php')\n\t\t\t\tconst conteo = await response.json()\n\t\t\t\treturn conteo;\n\t\t}", "function measure(token) {\n if(!token)\n\treturn -1;\n\n return categorizeGroups(token).replace(/^C/, '').replace(/V$/, '').length / 2;\n}", "size() {\n\n var count = 0\n\n if (this.head == null) {\n return count\n }\n else {\n var runner = this.head\n while (runner != null){\n count += 1;\n runner = runner.next;\n }\n return count\n }\n \n }", "function count() {\n /* let cont = 0\n while (cont <= vetores.length) {\n cont += 1\n }\n return cont - 1*/\n let cont = vetores.length\n return cont\n}", "count() {\n let c = 0;\n\n if (this.players.p1 !== undefined) {\n c++;\n }\n if (this.players.p2 !== undefined) {\n c++;\n }\n\n return c;\n }", "size() {\r\n let runner = this.data.head;\r\n let count = 0;\r\n while(runner != null) {\r\n runner = runner.next;\r\n count++;\r\n }\r\n return count;\r\n }", "length() {\n return this.forEachNode( (currentNode, i) => {\n return i;\n });\n }" ]
[ "0.8540666", "0.6882339", "0.6584911", "0.63925767", "0.62011325", "0.61118215", "0.61118215", "0.61118215", "0.61118215", "0.6058852", "0.6058108", "0.6058108", "0.6058108", "0.6058108", "0.6058108", "0.6041395", "0.603463", "0.60307956", "0.59777796", "0.5945682", "0.5893288", "0.5883461", "0.5876087", "0.587607", "0.5875279", "0.58728796", "0.58715993", "0.5833934", "0.58147204", "0.5808564", "0.580377", "0.5790498", "0.5782379", "0.57763934", "0.57758", "0.57758", "0.576686", "0.57654953", "0.5759477", "0.5736465", "0.5702474", "0.5702474", "0.569722", "0.5692865", "0.56868994", "0.5684941", "0.56708723", "0.5662384", "0.56601536", "0.5659627", "0.5659338", "0.56590724", "0.5645648", "0.5633715", "0.5608138", "0.56057775", "0.55976987", "0.55976987", "0.55916", "0.55905336", "0.5580651", "0.5570669", "0.5540491", "0.55301243", "0.55121547", "0.5508346", "0.55052906", "0.5503673", "0.5503673", "0.5503673", "0.55031246", "0.5493507", "0.54925346", "0.54916424", "0.54912615", "0.5488783", "0.547796", "0.54776865", "0.54776865", "0.54740226", "0.54707223", "0.54692495", "0.5459412", "0.54445606", "0.5431974", "0.5430137", "0.54293513", "0.54084384", "0.5405683", "0.5403335", "0.54009706", "0.54008013", "0.53980654", "0.53873044", "0.53842944", "0.5381167", "0.5378885", "0.5372561", "0.5371296", "0.5369282", "0.5369246" ]
0.0
-1
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ home movie click
function home_movie_details(url_query, respond){ //get data from db my_sql_conn.connect(function(err){//doing mysql connection handshake aka test connectability if(err){ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>connection error: "+err+"</p>"); //return respond.end();//ending here } else{ // respond.write("<p>connected to db</p>"); //respond.end();//ending here } //get data from db //multiple row search var mysql_db_home_movie_data_show = "SELECT * FROM movie_table WHERE movie_id="+url_query; //connect to existing db my_sql_conn_db.query(mysql_db_home_movie_data_show, function(err, results){ if(err){ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Data connection error : "+err+"</p>"); return ;//respond.end();//ending here } else{ // respond.write("<p>Data added "+JSON.stringify(results[0].m_producer)+"</p>"); //console.log(results.length); if(results.length ==0){return respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Could'nt find movie with any details of whats searched for</p>");}//if record match not found respond.write("<script>document.getElementById('heading').innerHTML ='"+results[0].m_title+"';</script>"); //change header respond.write("<p style='width:100%;height:auto;overflow:auto;background-color:white;color:black'><style>#movie_poster{width:15em;height:10em;top:0px;}</style><img id='movie_poster' src='"+results[0].m_image+"'><br>Movie Title : "+results[0].m_title+" <br> Movie Director : "+results[0].m_director+" <br> Movie Producer : "+results[0].m_producer+" <br> Movie Producing Company : "+results[0].m_production_company+" <br> Movie filmed Country : "+results[0].m_country+" <br> Movie Starring : "+results[0].m_actor+" <br> Movie Genre : "+results[0].m_genre+" <br> Movie Synopsis : "+results[0].m_description+" <br> Movie Disclaimer : "+results[0].m_disclaimer+"</p><hr>"); } //respond.end();//ending here } ); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "click_Homescreen_TVShows(){\n this.Homescreen_TVShows.waitForExist();\n this.Homescreen_TVShows.click();\n }", "function walkHome(){\r\n\tbackground(0);\r\n\tfirstOption.hide();\r\n\tsecondOption.hide();\r\n\tuserName.hide();\r\n\r\n\t//change the text for the title\r\n\ttitle.html(\"You have gone home. Good Night.\");\r\n\r\n\t//startOver = createA(\"index.html\", \"Start Over\")\r\n\t//firstOption.mousePressed(startOver);\r\n}", "function onClick(e) {\r\n onPause();\r\n if (getCarrier(e.yValue) == story.getFrameValue()) {\r\n onPlay();\r\n } else {\r\n story.goToFrame(getCarrier(e.yValue));\r\n onPause();\r\n }\r\n }", "function nextMovie(){\n removeMoviesAction();\n }", "function gohome(){\n mouse_down = false;\n clearinfo();\n if (track_obj && track_obj != 'home'){\n track_obj['highlighted'] = false;\n }\n track_obj = 'home';\n}", "async press(game, data) {\n\t\tif (this._won && data.time - this._won_time > this._fadeout) {\n\t\t\tawait game.view({ name: 'title_screen' });\n\t\t}\n\t}", "function C005_GymClass_Outro_Click() {\n\n\t// Jump to the next animation\n\tTextPhase++;\n\tif (TextPhase >= 2) SaveMenu(\"C007_LunchBreak\", \"Intro\");\n\n}", "function mainMenuClick() {\n //load landing screen of the game\n loadHomeScreen();\n //play button audio sound\n playButtonAudio();\n}", "function C005_GymClass_Intro_Click() {\n\tTextPhase++;\n\tif (TextPhase >= 5) {\n\t\tPlayerClothes(\"Judo\");\n\t\tCommon_SelfBondageAllowed = false;\n\t\tSetScene(CurrentChapter, \"Jennifer\");\t\t\n\t}\n}", "function C012_AfterClass_Roommates_Click() {\t\n\n\t// Regular interactions\n\tClickInteraction(C012_AfterClass_Roommates_CurrentStage);\n\n\t// The player can click on herself in most stages\n\tvar ClickInv = GetClickedInventory();\n\tif (ClickInv == \"Player\") {\n\t\tC012_AfterClass_Roommates_IntroText = OverridenIntroText;\n\t\tC012_AfterClass_Roommates_CurrentActor = CurrentActor; \n\t\tInventoryClick(ClickInv, CurrentChapter, CurrentScreen);\n\t}\n\n}", "function onClicked() {\r\n\t\ttablet.gotoWebScreen(APP_URL);\r\n\t}", "function youtubeclick(){\n $(\".right_box.movie a\").click(function(e){\n var _youtubeurl=$(this).attr(\"href\");\n var _string=_youtubeurl.substr(32,42);//get youtube id\n var _youtubehref=\"https://www.youtube.com/embed/\"+_string+\"?rel=0\";\n $(\".video-container iframe\").attr(\"src\",_youtubehref);\n $(this).addClass(\"clicked\").siblings().removeClass(\"clicked\");\n\n return false;\n });\n $(\".right_box.movie a\").eq(0).click();\n }", "function gotoVictoryVan(event) {\n\taddNavActionJS(\"initial victory van\", \"\");\n\tswitchTo('victoryVanStart');\n}", "function onClick(e) {\r\n // Pause the animation\r\n story.pauseAnimation();\r\n // If it is already selected resume the animation\r\n // otherwise pause and move to the selected month\r\n if (e.yValue === story.getFrameValue()) {\r\n story.startAnimation();\r\n } else {\r\n story.goToFrame(e.yValue);\r\n story.pauseAnimation();\r\n }\r\n }", "function movies() {\n\tif (moviesClicked == false) {\n\t\tdocument.getElementById('moviesGo').src=moviesGif.src;\n\t\tmoviesClicked = true;\n\t} else {\n\t\tdocument.getElementById('moviesGo').src=moviesJpeg.src;\n\t\tmoviesClicked = false;\n\t}\n}", "function moviebtn() {\n currentHeader();\n var x = document.getElementById(\"moviegame\");\n if (x.style.display === \"none\") {\n x.style.display = \"block\";\n }\n else x.style.display = \"none\";\n display();\n wordBank();\n eventListener();\n winLose();\n }", "function johnHelpsHimself(action) {\r\n\tswitch (action) {\r\n\t\tcase 'explore':\r\n\t\t\ttextDialogue(narrator, \"Narocube: Who knows sarcasim better than you \" + player.name + \" Lets take a peak\", 1000);\r\n\t\t\texploreship(gameobj.explore);\r\n\t\t\tgameobj.explore++;\r\n\t\tbreak;\r\n\r\n\t\tcase 'sit tight':\r\n\t\t\ttextDialogue(narrator, \"Narocube: Good choice, Nothing passive aggression like more passive aggression!\", 1000);\r\n\t\t\tgameobj.sittight++;\r\n\t\tbreak;\r\n\t}\r\n}", "function flyToHome() {\r\n $('#main').data('clicked', true);\r\n toggleSvgButton('#main', true);\r\n\r\n closePanel2();\r\n\r\n let selectedAsset = main;\r\n onPickedAsset(selectedAsset);\r\n }", "function C002_FirstClass_Intro_Click() {\n\tTextPhase++;\n\tif (TextPhase >= 5)\n\t\tSetScene(CurrentChapter, \"Mildred\");\n}", "function onBoardClick() {\n if (!hasStarted) {\n startGame();\n } else {\n startPause();\n }\n }", "function gameover() {\n home();\n }", "function handTitleClick() {\n console.log('title was clicked!');\n}", "function humanClicked(event)\n{\n if( origBoard[event.target.id] !== 'O' && origBoard[event.target.id] !== 'X' )\n {\n var status = gameAdvance(event.target.id,human);\n if(status==0 && !checkTie())\n {\n gameAdvance(bestSpot(),computer);\n }\n }\n}", "function handleClickSeeDerivation() {\n if (state.currentSceneIndex + 1 < state.scenes.length) {\n state.currentSceneIndex = state.currentSceneIndex + 1;\n videoElement.currentTime = state.scenes[state.currentSceneIndex].startTime;\n refreshCanvasVideo();\n }\n}", "function goTo(x){\n application.goToAlbum(x);\n}", "function onClick(e) {\n // Pause the animation\n story.pauseAnimation();\n // If it is already selected resume the animation\n // otherwise pause and move to the selected month\n if (e.yValue === story.getFrameValue()) {\n story.startAnimation();\n } else {\n story.goToFrame(e.yValue);\n story.pauseAnimation();\n }\n }", "function mousePressed() {\n introScreen1.mousePressed();\n introScreen2.mousePressed();\n gameWonScreen.mousePressed();\n gameOverScreen.mousePressed();\n //secret \"mobile friendly\" option\n if (gameState === \"playing\"){\n player.firePhazer();\n }\n}", "singleMovie() {\n console.log(\"singleMovie\")\n }", "function showAmosVideo() {\r\n var amosVideo = document.querySelector(\".amos_launch\");\r\n var junoVideo = document.querySelector(\".juno_launch\");\r\n var zaryaVideo = document.querySelector(\".zarya_launch\");\r\n var videoContainer = document.querySelector(\".video_container\");\r\n var videoDescription = document.querySelector(\".video_description\");\r\n var videoH1 = document.querySelector(\".launch_videos h1\");\r\n\r\n videoH1.innerHTML = \"Amos-17 Mission\";\r\n junoVideo.style.display = \"none\"; \r\n zaryaVideo.style.display = \"none\"; \r\n amosVideo.style.display = \"block\";\r\n videoContainer.style.display = \"block\";\r\n videoDescription.innerHTML = \r\n '<p>' + videoDescriptionObject[0].amos + '</p>\\n' +\r\n '<p>' + videoDescriptionObject[0].amosSecond + '</p>';\r\n\r\n window.location.href = \"launches.html#launch_anchor\";\r\n}", "function run() { \n\n moveToNewspaper();\n pickBeeper();\n returnHome();\n\n}", "click_Homescreen_RaceResult(){\n this.Homescreen_RaceResult.waitForExist();\n this.Homescreen_RaceResult.click();\n }", "function mousePressed() {\n if (state === `title`) {\n startPiranhaArray();\n\n state = `aquarium`;\n }\n }", "function playmovie(){\r\n\tparent.cpCmndResume = true;\r\n\texportRoot.runTime_mc.pbcPause_mc.visible = true;\r\n\texportRoot.runTime_mc.pbcPlay_mc.visible = false;\r\n}", "function pauseGame()\n {\n toMenu();\n }", "function nothingMoreToPlay() {\n goToSimilarArtist(cur_artist_info);\n}", "function toMenu() {\n\tclearScreen();\n\tviewPlayScreen();\n}", "function videoClick(){\n\tif(video.paused){\n\t\tplayVideo();\n\t}else{\n\t\tpauseVideo();\n\t}\n}", "onObjectClicked(pointer, gameObject) {\n\t\tif (gameObject.name === 'ok') {\n\t\t\tlet nextAction = game.gameData.getNextAction();\n\t\t\tgame.scene.start(nextAction.sceneName);\n\t\t}\n\t}", "proceed()\n\t{\n\t\tthis.musicScreen.setYTinfo(this.menuScreen.hasYTinfo())\n\t\tthis.musicScreen.init(this.url,this.gif_set)\n\t\t\n\t\tthis.menuScreen.hide()\n\t\tthis.musicScreen.show()\n\t}", "function startGame() {\r\n\r\n\tBrowser.loadUrl(CLICKERHEROES_URL);\r\n\tBrowser.finishLoading();\r\n\r\n\tHelper.sleep(5);\r\n\r\n\tfindAndClick(PLAY_PNG);\r\n\r\n\tHelper.log(\"Search Close Button...\");\r\n\tHelper.sleep(5);\r\n\r\n\t//Try to match close button\r\n\tfindAndClick(CLOSE_PNG);\r\n}", "function faceClick_first() {\n document.face.src = faceWait.src;\n numMoves = 0;\n closeAllMenus();\n clockStop();\n clockClear();\n makeBoard();\n clearBoardImages(); \n forceFocus();\n dead = false;\n win = false;\n openRemainingUsed = false;\n document.face.src = faceSmile.src;\n return false;\n }", "function prevscene() {\n\tvar location = document\n\t\t.getElementById('skybox')\n\t\t.getAttribute('src')\n\t\t.split('#')[1];\n\tvar currentLoc = parseInt(location.substring(3));\n\tif (currentLoc - 1 != 0) {\n\t\t$('#loc'.concat(currentLoc - 1, 'spot')).click();\n\t}\n}", "function imgClick(e) {\n musicInfo = e.target.alt;\n splitInfo = musicInfo.split('_');\n DOMString.getCurrentMusicVideoTitle.textContent = splitInfo[0];\n DOMString.getCurrentMusicVideoArtist.textContent = splitInfo[1];\n DOMString.getCurrentMusicVideo.src = e.target.dataset.src;\n\n DOMString.getCurrentMusicVideoHeading.classList.add('fadeIn');\n setTimeout(() => DOMString.getCurrentMusicVideoHeading.classList.remove('fadeIn'), 500);\n }", "function start(action) {\r\n\t\r\n\t\tswitch (action) {\r\n\t\t\tcase 'go look':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: What are you going to look at??\", 1000);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'explore':\r\n\t\t\t\texploreship(gameobj.explore);\r\n\t\t\t\tgameobj.explore++;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'sit tight':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: Good choice we should probably wait for John to get back.\", 1000);\r\n\t\t\t\tgameobj.sittight++;\r\n\t\t\tbreak;\t\r\n\t\t}\r\n}", "function hit()\n {\n //switches to tab\n switchTab(name, number);\n }", "function animateHomeScreen(action) {\n if (action === \"OPEN\") {\n Animated.timing(homeScreen_opacity, {\n toValue: 0.15,\n duration: 300,\n useNativeDriver: false,\n }).start();\n } else if (action === \"CLOSE\") {\n Animated.timing(homeScreen_opacity, {\n toValue: 1,\n duration: 200,\n useNativeDriver: false,\n }).start();\n }\n }", "function C101_KinbakuClub_Discipline_Click() {\n\n\t// Jump to the next animation\n\tTextPhase++;\n\t\t\t\n\t// Jump to lunch on phase 3\n\t//if (TextPhase >= 4) SaveMenu(\"C102_KinbakuDiscipline\", \"Intro\");\n\n}", "function landingPlayVideo(e) {\n\n\t\t\t// play all videos\n\t\t\tvideoOne.play();\n\t\t\tvideoTwo.play();\n\t\t\tvideoThree.play();\n\n\t\t\taudioThree.play();\n\t\t\taudioOne.play();\n\n\t\t\taudioThree.volume = 0.15;\n\n\t\t\tvideoWindow.classList.add(\"move-content\");\n\n\t\t\t// change videoPlay button text to pause\n\t\t\tvideoPlay.innerHTML = \"Pause\";\n\t\t\t// add \"playing\" class to video play button\n\t\t\tvideoPlay.classList.add(\"playing\");\n\n\t\t}", "function C001_BeforeClass_Intro_Click() {\n\tTextPhase++;\n\tif (TextPhase >= 6)\n\t\tSetScene(CurrentChapter, \"Classroom\");\n}", "selectedMovie(movie) {\n // Display selected movie\n this.displaySingleMovie(movie)\n }", "function SarahClick() {\n\tif ((MouseX >= 1885) && (MouseX < 1975) && (MouseY >= 25) && (MouseY < 115) && Player.CanWalk()) CommonSetScreen(\"Room\", \"MainHall\");\n\tif ((MouseX >= 1885) && (MouseX < 1975) && (MouseY >= 145) && (MouseY < 235)) InformationSheetLoadCharacter(Player);\n\tfor (let C = 0; C < SarahCharacter.length; C++)\n\t\tif ((MouseX >= 1000 - (SarahCharacter.length * 250) + (C * 500)) && (MouseX < 1500 - (SarahCharacter.length * 250) + (C * 500)) && (MouseY >= 0) && (MouseY < 1000) && (MouseX < 1885)) {\n\t\t\tif ((SarahCharacter[C].Name == \"Mistress Sophie\") || (SarahCharacter[C].Name == \"Sophie\")) SarahSophieSetPunishmentIntro(0);\n\t\t\tif ((SarahCharacter[C].ID == 0) || (SarahCharacter[C].Name == \"Mistress Sophie\") || (SarahCharacter[C].Name == \"Sophie\") || !SophieInside || (Sophie == null) || ((Sophie.Stage != \"200\") && (Sophie.Stage != \"201\")))\n\t\t\t\tCharacterSetCurrent(SarahCharacter[C]);\n\t\t}\n}", "function itemInvoked(e) {\n currentMIXID = e.detail.itemPromise._value.data.id;\n currentMIXNAME = e.detail.itemPromise._value.data.name\n currentMIXURL = e.detail.itemPromise._value.data.restful_url;\n playMix(currentMIXID);\n window.location.hash = '#playingsectionofpage';\n document.getElementById(\"nphacksong\").winControl.label = \"Hack Mix\";\n document.getElementById(\"titleofpage1\").innerText = \"HackTracks\";\n document.getElementById(\"myTextArea\").value = \"\";\n }", "goHome () {\n this.viewer.viewport.goHome()\n }", "function goto(screen) {\r\n\t//screen move\r\n\tvar where = screen || event.target.getAttribute('data-where') || null;\r\n\tvar destination = where ? document.querySelector('.' + where) : '';\r\n\tvar newScreen = destination ? getChildNumber( destination ) : 0;\r\n\r\n\tif (where) {\r\n\t\t//handle ads\r\n\t\tdisplayAdsOnScreenChange(where);\r\n\t\t\r\n\t\t//slide to new screen\r\n\t\tscreens.forEach(function(screen){\r\n\t\t\tscreen.style.transform = 'translate3d(' + ((getChildNumber(screen) - newScreen) * 100) + '%, 0, 0)';\r\n\t\t\tscreen.classList.remove('active');\r\n\t\t});\r\n\t\tsetTimeout(function(){\r\n\t\t\tdestination.classList.add('active');\r\n\t\t}, 700);\r\n\t\tdestination.scrollTop = 0;\r\n\t\t\r\n\t\t//slide background\r\n\t\tvar game = document.getElementById('game');\r\n\t\tvar newX = -(newScreen * screens[0].getBoundingClientRect().width);\r\n\t\tgame.style.backgroundPosition = newX + 'px 0';\r\n\t} else {\r\n\t\treturn;\r\n\t}\r\n}", "onOptionSelection(movie) {\n document.querySelector(\".tutorial\").classList.add(\"is-hidden\");\n onMovieSelection(movie, document.querySelector(\"#left-summary\"), \"left\");\n }", "function memeclicker() {\n\tif( frame == 5 ) { frame = 0; }\n\t\telse { frame = frame + 1; }\n\tscore = score + 1;\n\tupdate_values();\n\tdocument.getElementById(\"ugandan\").firstChild.setAttribute(\"src\", \"frames/\" + frame + \".png\");\n}", "backToMenu(button, groupName, index, pointer, event){\n button.scene.board.setHighScore();\n button.scene.scene.start(\"TitleScene\", button.scene.gameData);\n }", "function clickthrough(event) \n{\n switch(event.target)\n {\n case video :\n \n if (!isMobile.any())\n {\n addClass(animation, 'start'); \n Enabler.exit(\"Click_On_Video\");\n freeze();\n videoContainer.style.visibility = \"hidden\";\n video.pause(); \n \n }\n break;\n case click:\n case zoneExpandCtaBtn :\n Enabler.exit(\"Click_On_Endshot\");\n addClass(animation, 'start'); \n freeze();\n break;\n case loader:\n clickOnLoader = true;\n loader.style.display = \"none\";\n addClass(animation, 'start'); \n freeze();\n Enabler.exit(\"Click_On_Loader\");\n break;\n }\n}", "function mouseClickHandler(e){\n if (gameMenu) {\n gameMenu = false;\n Started = true;\n click.play();\n } else if (Endgame) {\n Endgame = false;\n Started = false;\n click.play();\n window.location.reload();\n }\n}", "function nextscene() {\n\tvar location = document\n\t\t.getElementById('skybox')\n\t\t.getAttribute('src')\n\t\t.split('#')[1];\n\tvar currentLoc = parseInt(location.substring(3));\n\tif ($('#loc'.concat(currentLoc + 1, 'spot'))) {\n\t\t$('#loc'.concat(currentLoc + 1, 'spot')).click();\n\t}\n}", "onOptionSelection(movie) {\n document.querySelector(\".tutorial\").classList.add(\"is-hidden\");\n onMovieSelection(movie, document.querySelector(\"#right-summary\"), \"right\");\n }", "function returnHomeDetection(){\n if (state === 'piano' || state === 'guitar'){\n if(mouseIsPressed){\n if (mouseX > 25 && mouseX < 75 &&\n mouseY > 25 && mouseY < 75){\n state = 'menu';\n }\n }\n }\n}", "function mouseClicked() {\n\n if (menu == 'intro') {\n if (mouseX >= 500 &&\n mouseX <= 700 &&\n mouseY >= 320 &&\n mouseY <= 420) {\n goToMenu('instructionScreen');\n }\n } else if (menu == 'instructionScreen') {\n if (mouseX >= 680 &&\n mouseX <= 880 &&\n mouseY >= 90 &&\n mouseY <= 400) {\n goToMenu('play');\n }\n } else if (menu == 'fail') {\n if (mouseX >= 275 &&\n mouseX <= 615 &&\n mouseY >= 310 &&\n mouseY <= 385) {\n goToMenu('play');\n }\n } else if (menu == 'win') {\n if (mouseX >= 285 &&\n mouseX <= 620 &&\n mouseY >= 300 &&\n mouseY <= 400) {\n goToMenu('intro');\n }\n }\n}", "view_GameMovie(){\n let currMoviePlayInfo = this.model.getCurrentMoviePlayInfo();\n this.view.updateCurrentMoviePiece(currMoviePlayInfo[0][0], currMoviePlayInfo[0][1], currMoviePlayInfo[1][1]);\n this.view.redoPlay(currMoviePlayInfo[0][0], currMoviePlayInfo[0][1], currMoviePlayInfo[1][1]);\n this.state = 'WAIT_GM_ANIMATION_END';\n }", "function goToScene(scene) {\n\t$(\".scene[data-scene=\"+scene+\"]\").click();\n}", "function switch_game(home, away) {\n ls_update_all = 1;\n ls_home_id = home;\n ls_away_id = away;\n ls_validate_matchup(ls_home_id,ls_away_id);\n ls_check_if_bye();\n show_game(ls_home_id, ls_away_id);\n update_scores();\n if (ls_includeInjuryStatus) ls_update_injuries();\n ls_add_icons(ls_home_id);\n try { MFLPlayerPopupNewsIcon();} catch (er) {}\n ls_add_caption();\n ls_add_records(ls_home_id, ls_away_id);\n $(\"#LS_AwayTeamName,#LS_AwayTeamRecord,#LS_AwayScore\").trigger('click');\n}", "function mouseClicked() {\n if (mouseY >= 620 && mouseY <= 720 && mouseX >= 1040 && mouseX <= 1280) {\n aanvalActie = false;\n aanvalKnopStatus = false;\n beweegActie = false;\n beweegKnopStatus = false;\n beurtVeranderen();\n veranderKleur(donkerblauw,wit);\n veranderKleur(lichtblauw,wit);\n }\n}", "function displayMovie(event){\n let target = event.target || event.srcElement;\n\n // Retrieves title if parent element selected\n if(target.className == \"movie\"){\n target = target.getElementsByClassName(\"title\")\n target = target[0];\n }\n\n // sends an API request for the specific movie to be displayed\n searchByTitle(target).then(result => {\n let movies = result[\"Title\"];\n displayMovieResult(result);\n });\n}", "function homepageUnwaste() {\n getActivity();\n activityInfoAnimation();\n setTimeout(gifContainerAnimation, 300);\n toggleHide();\n toggleShow();\n alterUnwasteBtnAction();\n}", "function InventoryItemMouth2CupholderGagClick() {\n\tInventoryItemMouthCupholderGagClick();\n}", "function go_home() {\n\tdocument.getElementById(\"display-screen\").innerHTML = loading;\n\tx_home_page(\"\", do_display);\t\t\t\t\n}", "function handleClick() {\n var pressedButton = this.innerHTML;\n buttonAnimation(pressedButton);\n switch (pressedButton) {\n case \"w\":\n tom1.play();\n break;\n case \"a\":\n tom2.play();\n break;\n case \"s\":\n tom3.play();\n break;\n case \"d\":\n tom4.play();\n break;\n case \"j\":\n snare.play();\n break;\n case \"k\":\n crash.play();\n break;\n case \"l\":\n kick.play();\n break;\n default:\n }\n}", "function startScreen() {\n fill(255, 56, 115, opacity);\n rect(0,0,width,height);\n textSize(12);\n if (frameCount%2 == 0){\n fill(255,opacity);\n textAlign(CENTER);\n textSize(12);\n text(\"CLICK TO PLAY\", width/2, height/2);\n }\n}", "function play_here(ev)\n {\n ev.preventDefault();\n activate(parseInt(this.getAttribute(\"data-slide\"), 10));\n seek_video();\n play_video();\n ev.stopPropagation();\n }", "function actionOnClick(){\n score = 0;\n health = 100;\n reach = 0;\n day = 1;\n game.state.start('brushing');\n\n console.log('click');\n\n }", "function goHomeFromExams() {\n document.getElementById('classSpecific').style.display = \"none\";\n document.getElementById('welcome-div').style.display = \"block\";\n document.getElementById('wrapper').style.display = \"grid\";\n document.getElementById('doesNotExist').style.display = \"none\";\n document.getElementById('no-exams').style.display = \"none\";\n document.getElementById('exam-wrapper').style.display = \"none\";\n\n document.body.style.backgroundImage = \"none\"\n\n var examDataHasLoaded = false;\n}", "clickNewsVideoTab(){\n this.newsVideoTab.waitForExist();\n this.newsVideoTab.click();\n }", "function videoButtonPress(event)\n{\n changeVideo();\n}", "function navigateToScoreOverview(){\n ApplicationEnded=true;\n gotoScoreOverview();\n}", "function onStartClick() {\n startCatWalk();\n}", "function easterEgg() {\n\t\t// Rick-Roll\n\t\twindow.location = \"https://www.youtube.com/watch?v=dQw4w9WgXcQ\"\n\t}", "function showMovieDetails(movie)\n{\n movieTitle.html(movie.title);\n movieDesc.html(movie.description);\n moviePoster.attr(\"src\", movie.posterImage.attr(\"src\"));\n movieView.on(\"click\", function() {\n window.location.href = \"/movie.html?imdb=\" + movie.imdb;\n });\n\n // Show info to user\n movieDetails.modal(\"show\");\n}", "gotoMusic(event) {\n this.menu.hide();\n this.song = event.detail.songValue;\n this.music.load(event.detail.gifValue);\n document.getElementById('loading').classList.remove('inactive');\n //this.music.show(event.detail.songValue);\n }", "click(){\n app.quit();\n //Quits the app in a click event\n }", "function clickVideo(time) {\n\tif(!checkVehIsOnLine(time)) {\n\t\talert('You can not view the video because the vehicle is offline!');\n\t\treturn;\n\t} else {\n\t\topenTimeWin(time);\n\t}\n}", "handleClick () {\n super.handleClick()\n this.player_.trigger('next')\n }", "function C002_FirstClass_Outro_Click() {\n\n\t// Jump to the next animation\n\tTextPhase++;\n\tif (TextPhase >= 4)\n\t\tSaveMenu(\"C004_ArtClass\", \"Intro\");\n\t\n\t// Release the player on phase 2\n\tif (TextPhase == 2) {\n\n\t\t// Remove all inventory if subdue has failed\n\t\tif (C002_FirstClass_Classroom_MildredSubdueFailed == true) {\n\t\t\tPlayerUnlockAllInventory();\n\t\t\tPlayerRemoveAllInventory();\n\t\t}\n\n\t\t// Remove all remaining restraints\n\t\tPlayerReleaseBondage();\n\n\t}\n\n}", "function returnToHome(){\n\t\n}", "temporaryMovie(movie) {\n this.displaySingleMovie(movie)\n }", "function homeClick() {\n\n\tif ($(\"#home\").hasClass(\"current-item\") == false)\n\t{\n\t\t// add class to $(\"#home\"), delete for others\n\t\t$(\"#states\").removeClass();\n\t\t$(\"#msgs\").removeClass();\n\t\t$(\"#home\").addClass(\"current-item\");\n\n\t\tshowDiv(\"main-body\");\n\t}\n}", "function playerClick() {\n playerSequence.push(\"#\" +this.id);\n console.log(\"Player: \" + playerSequence);\n animate(this);\n currentClickCount+=1;\n checkForMatch();\n }", "function _attachMenuActions() {\n $('#toggleAnimation').click(function(){\n if($(this).text() == \"Pause\"){\n $(this).html(\"Start\");\n $(document).bgStretcher.pause();\n $('#previousImage').removeClass('disabled');\n $('#nextImage').removeClass('disabled');\n } else {\n $(this).html(\"Pause\");\n $(document).bgStretcher.play();\n $('#previousImage').addClass('disabled');\n $('#nextImage').addClass('disabled');\n }\n \t });\n\n $('#previousImage').click(function(){\n if ($(this).hasClass('disabled')) return;\n $(document).bgStretcher.previous();\n });\n\n $('#nextImage').click(function(){\n if ($(this).hasClass('disabled')) return;\n $(document).bgStretcher.next();\n });\n\n $('.album').click(function() {\n $(document).bgStretcher.changeAlbum($(this).text());\n });\n }", "function clickOnGameButton(event)\n{\n // Hier coderen we alles wat moet worden gedaan zodra een speler op de game button clicked\n // @TODO: Click event van de game button programmeren. Wat moet er allemaal gebeuren na een klik?\n}", "function C007_LunchBreak_ActorSelect_Click() {\t\n\tClickInteraction(C007_LunchBreak_ActorSelect_CurrentStage);\n\tInventoryClick(GetClickedInventory(), CurrentChapter, \"ActorSelect\");\n}", "tocarchampan()\n {\n if(this.scene.sonidoactive && this.scene.sigueJugando)\n {\n this.scene.music.pause();\n this.champmusic.play();\n }\n }", "function mousePressed()\n{\n\tvar page = story.getCurrentPage();\n\tpage.mouseP();\n}", "function alertMovieName() {}", "function InventoryItemMouthFuturisticHarnessPanelGagClick() {\n\tInventoryItemMouthFuturisticPanelGagClick();\n}", "function CheckMovie()\n{\n var movieName = location.hash.substring(1, location.hash.length);\n if (movieIndex.indexOf(movieName) < 0) {\n alert(\"Movie does not exist. Sorry.\");\n history.back();\n } else {\n Display_Movie_Bios(movieName);\n }\n}", "function openNav(movie) {\r\n let id = movie.id;\r\n fetch(BASE_URL + '/tv/'+id+'/videos?'+API_KEY).then(res => res.json()).then(videoData => {\r\n console.log(videoData);\r\n if(videoData){\r\n document.getElementById(\"myNav\").style.width = \"100%\";\r\n if(videoData.results.length > 0){\r\n var embed = [];\r\n var dots = [];\r\n \r\n var content = `\r\n <h1 class=\"no-results\">${tv.name}</h1>\r\n <br/>\r\n \r\n ${embed.join('')}\r\n <br/>\r\n <div class=\"dots\">${dots.join('')}</div>\r\n \r\n `\r\n overlayContent.innerHTML = content;\r\n activeSlide=0;\r\n showVideos();\r\n }else{\r\n overlayContent.innerHTML = `<h1 class=\"no-results\">No Results Found</h1>`\r\n }\r\n }\r\n })\r\n}", "function C010_Revenge_SidneyJennifer_Click() {\t\n\n\t// Regular interactions\n\tClickInteraction(C010_Revenge_SidneyJennifer_CurrentStage);\n\t\n\t// The player can click on herself\n\tvar ClickInv = GetClickedInventory();\n\tif (ClickInv == \"Player\") {\n\t\tC010_Revenge_SidneyJennifer_IntroText = OverridenIntroText;\n\t\tC010_Revenge_SidneyJennifer_CurrentActor = CurrentActor; \n\t\tInventoryClick(ClickInv, CurrentChapter, CurrentScreen);\n\t}\n\t\n\t// The heroine can be restrained on stage 400\n\tif ((C010_Revenge_SidneyJennifer_CurrentStage == 38) && (ClickInv != \"\") && (ClickInv != \"Player\")) {\n\n\t\t// Both heroines react differently to the crop\n\t\tif ((ClickInv == \"Crop\") && !C010_Revenge_SidneyJennifer_CropDone) {\n\t\t\tC010_Revenge_SidneyJennifer_CropDone = true;\n\t\t\tActorChangeAttitude(-1, 1);\n\t\t}\n\n\t\t// Apply the clicked restrain\n\t\tActorApplyRestrain(ClickInv);\n\t\tOverridenIntroImage = \"\";\n\t\tC010_Revenge_SidneyJennifer_IsGagged = ActorIsGagged();\n\t\tif (C010_Revenge_SidneyJennifer_IsGagged) ActorSpecificSetPose(\"Jennifer\", \"Dog\");\n\t\tif (ClickInv == \"Crop\") OverridenIntroText = GetText(\"CropJennifer\");\n\n\t}\n\t\n}" ]
[ "0.68992555", "0.677454", "0.66580296", "0.64274836", "0.6400437", "0.63258904", "0.63191915", "0.6310086", "0.6224483", "0.6219141", "0.62177896", "0.6197731", "0.61815256", "0.6173206", "0.61189127", "0.61172444", "0.6115505", "0.60853595", "0.6075443", "0.6062602", "0.6058801", "0.6027842", "0.6022914", "0.6010962", "0.5988096", "0.5986325", "0.5979946", "0.5963857", "0.5959255", "0.5954161", "0.59405285", "0.5939171", "0.5937756", "0.5936272", "0.5922465", "0.5919661", "0.59149057", "0.59073746", "0.5906675", "0.5898394", "0.5887166", "0.58862966", "0.58707297", "0.5868431", "0.5851461", "0.584835", "0.584781", "0.58438236", "0.5837092", "0.5835219", "0.5828912", "0.5817349", "0.5815605", "0.5810983", "0.5810135", "0.5810019", "0.58097416", "0.58012336", "0.5796913", "0.5780152", "0.57787704", "0.5774221", "0.5773326", "0.57613903", "0.5760273", "0.57588506", "0.5751507", "0.57509094", "0.5748748", "0.5744617", "0.5742558", "0.5742521", "0.5740681", "0.5739166", "0.5734434", "0.5728478", "0.5724948", "0.57243586", "0.5722897", "0.5716761", "0.5707896", "0.5707226", "0.5705504", "0.5698763", "0.56982183", "0.5697362", "0.56930494", "0.56904167", "0.5683715", "0.56833243", "0.5667939", "0.5667401", "0.56672466", "0.5665503", "0.5663712", "0.56633765", "0.56616133", "0.56605524", "0.56592375", "0.56560546", "0.56507105" ]
0.0
-1
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ mysql table create
function routing(respond){ respond.write("<script>document.getElementById('heading').innerHTML ='SQL db& table create';</script>") my_sql_conn.connect(function(err){//doing mysql connection handshake aka test connectability if(err){ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>connection error: "+err+"</p>"); //return respond.end();//ending here } else{ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>connected to db</p>"); //respond.end();//ending here } //create database give a name; my_sql_conn.query("CREATE DATABASE movie_shop",function(err, results){ if(err){ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>DB creation err "+err+"</p>"); //return respond.end();//ending here } else{ respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>DB created "+JSON.stringify(results)+"</p>"); //respond.end();//ending here } }); //create db table var mysql_db_table ="CREATE TABLE movie_table (movie_id int NOT NULL AUTO_INCREMENT PRIMARY KEY, m_title varchar(255), m_director varchar(255), m_producer varchar(255), m_production_company varchar(255), m_country varchar(255), m_actor varchar(255), m_genre varchar(255), m_description varchar(255), m_disclaimer varchar(255), m_image varchar(255))"; //connect to existing db my_sql_conn_db.query(mysql_db_table, function(err, results){ if(err){ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>table creation err "+err+"</p>"); return;// respond.write();//ending here } else{ respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>table created "+results+"</p>"); // respond.end();//ending here } } ); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTable() {\n var conn = Jdbc.getCloudSqlConnection(dbUrl, user, userPwd);\n conn.createStatement().execute('CREATE TABLE entries ' +\n '(guestName VARCHAR(255), content VARCHAR(255), ' +\n 'entryID INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(entryID));');\n}", "function makeCreateTable() {\n\n var keyStr = '';\n var keyCol = '';\n\n var ddl = 'DROP TABLE IF EXISTS ' + gTblName + ';'\n\n ddl += newLine;\n\n // var ddl = 'CREATE TABLE ' + gTblNameUpper + ' (' + newLine;\n ddl += 'CREATE TABLE ' + gTblName + ' (' + newLine;\n\n for (var i = 1; i < gValuesOfRange.length; i++) {\n\n /** set common var in column range*/\n if (!setCommonVar(i)) {\n return '';\n }\n\n if (cPhysicalNameOfColumn == '') {\n break;\n }\n\n ddl += cPhysicalNameOfColumnUpper;\n if (cTypeVal.toUpperCase() == TIMESTAMP) {\n ddl += ' TIMESTAMP(6)';\n } else if (cTypeVal.toUpperCase() == DATETIME) {\n ddl += ' DATETIME';\n } else if (cSizeVal != '') {\n ddl += ' ' + cTypeVal + '(' + cSizeVal + ')';\n } else {\n ddl += ' ' + cTypeVal;\n }\n\n if (cDefaultVal != '') {\n ddl += ' DEFAULT ' + cDefaultVal;\n }\n if (isNotNull) {\n ddl += ' NOT NULL';\n }\n\n // Browser.msgBox(cRemark);\n\n if (cRemark.indexOf('主キー') > -1 && (cRemark.indexOf('自動連番') > -1 || cRemark.indexOf('連番') > -1)) {\n ddl += ' AUTO_INCREMENT';\n }\n\n if (cRemark.indexOf('主キー') > -1) {\n if (keyCol != '') {\n keyCol += ', ' + cPhysicalNameOfColumn;\n } else {\n keyCol = cPhysicalNameOfColumn;\n }\n }\n\n if (cLogicalNameOfColumn != '') {\n ddl += ' COMMENT ' + \"'\" + cLogicalNameOfColumn + \"'\";\n }\n\n\n if (!cIsLastRow) {\n ddl += ',';\n }\n\n ddl += newLine;\n }\n\n if (keyCol != '') {\n keyStr = ', PRIMARY KEY (' + keyCol + ')';\n ddl += keyStr;\n }\n\n ddl += ')';\n\n\n if (gTblNameLogic != '') {\n ddl += ' COMMENT = ' + \"'\" + gTblNameLogic + \"'\";\n }\n\n ddl += ';';\n\n return ddl;\n}", "function createTable() {\n const sql = `CREATE TABLE ${table} (c1 int, c2 int)`;\n const request = new Request(sql, (err, rowCount) => {\n if (err) {\n throw err;\n }\n\n console.log(`'${table}' created!`);\n prepareSQL();\n });\n\n connection.execSql(request);\n}", "function createTable(name) {\n\t var cols = [];\n\t for (var col in f.columns) {\n\t var attrs = f.columns[col];\n\t var decl;\n\t switch (attrs.type) {\n\t case ColumnType.ptr:\n\t console.assert(attrs.ref != null);\n\t console.assert(attrs.ref.columns != null);\n\t console.assert(attrs.ref.tableName != null);\n\t console.assert(attrs.ref.key != null);\n\t var foreignType = attrs.ref.columns[attrs.ref.key].type;\n\t decl = col + ' ' + Column.sqlType(foreignType);\n\t cols.push(decl);\n\t break;\n\t case ColumnType.set:\n\t break;\n\t default:\n\t decl = col + ' ' + Column.sqlType(attrs.type);\n\t if (f.key === col) {\n\t decl += ' PRIMARY KEY';\n\t }\n\t cols.push(decl);\n\t }\n\t }\n\t return self.exec(tx, 'CREATE ' + (f.temp ? 'TEMP ' : '') + 'TABLE ' + name + ' (' + cols.join(', ') + ')');\n\t }", "function createTables() {\n\n var db = getDatabase();\n db.transaction(\n function(tx) {\n tx.executeSql('CREATE TABLE IF NOT EXISTS jenkins_data(id INTEGER PRIMARY KEY AUTOINCREMENT, jenkins_name TEXT, jenkins_url TEXT)');\n });\n }", "function createTable() {\n const sql = `CREATE TABLE ${table} (c1 int UNIQUE) `;\n const request = new Request(sql, (err, rowCount) => {\n if (err) {\n console.log('error occured!');\n throw err;\n }\n\n console.log(`'${table}' created!`);\n\n createTransaction();\n });\n\n connection.execSql(request);\n}", "function setupTable(tx) {\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS setting(id INTEGER PRIMARY KEY,theme)\");\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS levels(id INTEGER PRIMARY KEY,board_row_size INTEGER,board_col_size INTEGER,floor_details,tile_details,powerup_details,max_moves,completed,help_used INTEGER)\");\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS powerup(id INTEGER PRIMARY KEY, details)\");\n createSetting();\n}", "function createTable() {\n const db = dbConn.connection;\n if (!db) {\n return;\n }\n\n const sqlTable = `CREATE TABLE IF NOT EXISTS ${TABLE} (` +\n 'code TEXT NOT NULL UNIQUE,' +\n 'expiresAt INTEGER NOT NULL,' +\n 'redirectUri TEXT,' +\n 'scope TEXT,' +\n 'client TEXT NOT NULL,' +\n 'user TEXT NOT NULL,' +\n 'PRIMARY KEY (code))';\n db.exec(sqlTable, (err) => {\n if (err) {\n return void logger.error(`${LOG_MODNAME} ${err.message}`);\n }\n });\n}", "function createTable()\n{\n \n\tfilesDB.transaction(\n function (transaction) {\n transaction.executeSql('CREATE TABLE IF NOT EXISTS files(id VARCHAR NOT NULL PRIMARY KEY, LastModified TIMESTAMP NOT NULL, name TEXT NOT NULL, json BLOB NOT NULL DEFAULT \"\");', [], nullDataHandler, killTransaction);\n \t}\n\t);\n}", "function setupTable(tx) {\r\n\ttx.executeSql('CREATE TABLE IF NOT EXISTS HIMM (id INTEGER PRIMARY KEY AUTOINCREMENT, Title TEXT NOT NULL, Content TEXT NOT NULL,Category INTEGER, FileURI TEXT,Longitude TEXT, Latitude TEXT,weather,updated)');\r\n}", "function createTable() {\n\n db.transaction(function (tx) { tx.executeSql(createStatement, [], showRecords, onError); });\n\n}", "function createTbl(tx) {\n tx.executeSql('CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, role BOOL NOT NULL, name VARCHAR, username VARCHAR NOT NULL, email VARCHAR NOT NULL, password VARCHAR NOT NULL, description VARCHAR)');\n}", "create_search_history_table(){\n\t\tvar create_search_history_cols = \"(id integer PRIMARY KEY AUTOINCREMENT, project_id integer, keyword varchar, file_name varchar, file_line integer, file_pos integer, user_id integer, created_at datetime, updated_at datetime)\";\n\t\tvar create_search_history_query = \"CREATE TABLE IF NOT EXISTS search_histories \" + create_search_history_cols + \";\";\n\t\tthis.sqlite3_db.exec(create_search_history_query);\n\t}", "function crearTablaAscensorValoresMaquinas(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_maquinas (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores maquinas...Espere\");\n console.log('transaction creada ok');\n });\n}", "createTable() {\n this.dbConnector.query(this.dbConnector.statements.createTable({ ...this.params, owner: this.dbConnector.options.role || this.dbConnector.options.user }), (error) => {\n if (error) {\n this.end(error);\n }\n this.write();\n }, []);\n }", "function crearTablaAscensorValoresCabina(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_cabina (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores cabina...Espere\");\n console.log('transaction creada ok');\n });\n}", "function create_table(name, example_data, unique_keys = [], connection, callback) {\n let create_query = 'CREATE TABLE ' + name + ' '\n const keys = Object.keys(example_data)\n let cols = []\n\n for (k of keys) {\n let col_string = k\n if (typeof example_data[k] === 'number') {\n if (example_data[k] > 0) { \n col_string = col_string.concat(' VARCHAR(' + example_data[k] + ') ')\n }\n else {\n col_string = col_string.concat(' BIGINT ')\n }\n } else {\n col_string = col_string.concat(' VARCHAR(500) ')\n }\n cols.push(col_string)\n }\n\n if (unique_keys.length > 0) {\n cols.push('UNIQUE ' + bracket(unique_keys))\n }\n\n create_query = create_query.concat(bracket(cols))\n\n\n\n connection.query(create_query, callback)\n}", "function createTable() {\n var connStr =\n 'jdbc:google:rdbms://' +\n 'elwarbito:chapter6/contacts',\n conn,\n stmt,\n ddl;\n ddl = 'CREATE TABLE person(' +\n ' person_id MEDIUMINT ' +\n 'AUTO_INCREMENT' +\n ' NOT NULL PRIMARY KEY,' +\n ' first_name VARCHAR(100) NOT NULL,' +\n ' last_name VARCHAR(100) NOT NULL,' +\n ' date_of_birth DATE,' +\n ' height_cm SMALLINT)';\n try {\n conn = Jdbc.getCloudSqlConnection(connStr);\n stmt = conn.createStatement();\n stmt.execute(ddl);\n Logger.log('Table created!');\n } catch (ex) {\n Logger.log(ex);\n throw (ex);\n } finally {\n Logger.log('Cleaning up.');\n if (stmt) {\n stmt.close();\n }\n if (conn) {\n conn.close();\n }\n }\n}", "function crearTablaAscensorValoresProteccion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_proteccion (k_codusuario,k_codinspeccion,k_coditem,v_sele_inspector,v_sele_empresa,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores protección...Espere\");\n console.log('transaction creada ok');\n });\n}", "function createDbTable(t, dbInfo, callback, errorCallback) {\n\t t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n\t}", "function createTable() {\n rethink\n .db(\"test\")\n .tableCreate(\"authors\")\n .run(connection, (err, result) => {\n if (err) throw err;\n console.log(\"Table Creation results:\");\n console.log(JSON.stringify(result, null, 2));\n insertData();\n });\n}", "function createTable(tableName, fields, numberTablesToCreate, resolve, reject) { //TODO: make this more intelligent to match changes to defaultTables.json\n\tvar keyCount = 0;\n\tvar queryString = 'CREATE TABLE ' + tableName + ' (';\n\n\tfor (var field in fields) {\n if (!fields.hasOwnProperty(field))\n continue;\n\n\t\tif(keyCount < Object.keys(fields).length-1) {\n\t\t\tqueryString += field + ' ' + possibleTypes[fields[field][lit.sql.TYPE]];\n\t\t\tif (fields[field][lit.sql.DEFAULT]) {\n\t\t\t\tif (fields[field][lit.sql.DEFAULT] === 'CURRENT_TIMESTAMP' || fields[field][lit.sql.DEFAULT] === 'GETDATE()') {\n\t\t\t\t\tqueryString += \" DEFAULT \" + fields[field][lit.sql.DEFAULT];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tqueryString += \" DEFAULT '\" + fields[field][lit.sql.DEFAULT] + \"'\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (fields[field][lit.sql.PRIMARY_KEY])\n\t\t\t\tqueryString += \" PRIMARY KEY\";\n\n\t\t\tif (fields[field][\"constraint\"])\n\t\t\t\tqueryString += \" \" + fields[field][\"constraint\"];\n\n\t\t\tqueryString += ', ';\n\t\t\tkeyCount++;\n\t\t}\n\t\telse {\n\t\t\tif (!fields.hasOwnProperty(field))\n\t\t\t\tcontinue;\n\n\t\t\tqueryString += field + ' ' + possibleTypes[fields[field][lit.sql.TYPE]];\n\t\t\tif (fields[field][lit.sql.DEFAULT]){ //make this better\n\t\t\t\tif (fields[field][lit.sql.DEFAULT] === 'CURRENT_TIMESTAMP' || fields[field][lit.sql.DEFAULT] === 'GETDATE()') {\n\t\t\t\t\tqueryString += \" DEFAULT \" + fields[field][lit.sql.DEFAULT];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tqueryString += \" DEFAULT '\" + fields[field][lit.sql.DEFAULT] + \"'\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (fields[field][lit.sql.PRIMARY_KEY])\n\t\t\t\tqueryString += \" PRIMARY KEY\";\n\t\t\t\n\t\t\tqueryString += ')';\n\t\t}\n\t}\n\n\tdbm.query(queryString).then(function(){\n\t\tnumCreated++;\n\t\tlog.info(\"Table '\" + tableName + \"' created!\");\n\t\tif (numberTablesToCreate === numCreated) {\n log.info(\"~~~~~~~~~~~~~~~End of Database Setup~~~~~~~~~~~~~~~~\\n\\n\");\n resolve();\n }\n\t}).catch(function () {\n numCreated++;\n log.warn(\"Table '\" + tableName + \"' not created! Likely due to a previously logged error\");\n if (numberTablesToCreate === numCreated) {\n log.info(\"~~~~~~~~~~~~~~~End of Database Setup~~~~~~~~~~~~~~~~\\n\");\n log.severe('THERE WAS AN ERROR DURING DATABASE TABLE CREATION');\n log.severe('SOME TABLES FAILED TO BE CREATED');\n reject(\"Failure to create tables for database\");\n }\n });\n}", "function createEmployeeTable() {\n var sql = `CREATE TABLE employees (\n id INTEGER AUTO_INCREMENT PRIMARY KEY,\n first_name VARCHAR(30) NOT NULL,\n last_name VARCHAR(30) NOT NULL,\n role_id INTEGER NOT NULL,\n manager_id INTEGER,\n CONSTRAINT fk_role FOREIGN KEY (role_id) REFERENCES roles(id),\n CONSTRAINT fk_manager FOREIGN KEY (manager_id) REFERENCES employees(id)\n );\n `\n queryReturn(sql, `${sql.split(' ')[2]} table created.`)\n}", "function crearTablaPuertasValoresManiobras(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_maniobras (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores maniobras...Espere\");\n console.log('transaction creada ok');\n });\n}", "async create() {\n await this.db.schema.createTable(this.name, colGen => {\n for (const name in this.columns) {\n if (this.columns.hasOwnProperty(name)) {\n const element = this.columns[name];\n if(typeof element === \"object\")\n tableColumnGen(this, colGen, element.type, name, element);\n else\n tableColumnGen(this, colGen, element, name);\n }\n }\n });\n\n return;\n }", "function createUserListTable() {\n db.transaction((tx) => {\n tx.executeSql(\n \"create table if not exists userlist (id integer primary key not null, title text not null, imgURL text not null, notes text);\",\n [],\n () => {\n console.log(\"Created userlist table in database!\");\n }\n );\n });\n }", "function crearTablaInforme(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE informe (k_codinforme,v_consecutivoinforme,k_codusuario,f_informe)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores informe...Espere\");\n console.log('transaction creada ok');\n });\n}", "function createRoleTable() {\n var sql = `CREATE TABLE roles (\n id INTEGER AUTO_INCREMENT PRIMARY KEY,\n title VARCHAR(30) NOT NULL,\n salary DECIMAL(9,2) NOT NULL,\n department_id INTEGER NOT NULL,\n CONSTRAINT fk_department FOREIGN KEY (department_id) REFERENCES departments(id)\n );\n `\n queryReturn(sql, `${sql.split(' ')[2]} table created.`)\n}", "function createTables() {\n var db = getDatabase();\n\n db.transaction(\n function(tx) {\n tx.executeSql('CREATE TABLE IF NOT EXISTS configuration(id INTEGER PRIMARY KEY AUTOINCREMENT, param_name TEXT, param_value TEXT)');\n tx.executeSql('CREATE TABLE IF NOT EXISTS temperature(id INTEGER PRIMARY KEY AUTOINCREMENT, date TEXT, temperature_value REAL)');\n }\n );\n}", "function populateDB(tx) {\r\n \r\n var sql = \"CREATE TABLE IF NOT EXISTS Client ( \"\r\n + \"cin INTEGER PRIMARY KEY, \"\r\n + \"prenom VARCHAR(50), \" + \"nom VARCHAR(50), \"\r\n + \"age INTEGER,\" + \"telephone INTEGER,\"+ \"adress VARCHAR(50),\" + \"code INTEGER, \" + \"email VARCHAR(50), \" + \"login VARCHAR(50),\" + \"password VARCHAR(200))\";\r\n tx.executeSql(sql);\r\n }", "function crearTablaUsuario(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE usuario (k_codusuario unique, n_usuario, o_cedula, n_nombre, n_apellido, o_correo, o_rol, contrasena)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorValoresIniciales(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_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)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores iniciales...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaEscalerasValoresProteccion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_proteccion (k_codusuario,k_codinspeccion,k_coditem,v_sele_inspector,v_sele_empresa,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores protección...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorValoresPozo(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_pozo (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores pozo...Espere\");\n console.log('transaction creada ok');\n });\n}", "function setupTableForLessons(tx){\n console.log(\"before execute sql for Lessons Database\");\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS lessons(lessonRow_id INTEGER,teacher_id INTEGER,lesson_id INTEGER,exercise_id INTEGER,exercise_title,exercise_detail,\\\n exercise_voice,exercise_image,PRIMARY KEY(lessonRow_id))\");\n console.log(\"Created table if not existed for Lessons Database\");\n}", "function crearTablaEscalerasValoresDefectos(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_defectos (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores defectos...Espere\");\n console.log('transaction creada ok');\n });\n}", "function _init_my_job_and_quote_count_info_table(db){\n db.execute('CREATE TABLE IF NOT EXISTS my_job_and_quote_count_info('+\n 'id INTEGER PRIMARY KEY autoincrement,'+\n 'date TEXT,'+\n 'job_count INTEGER,'+\n 'quote_count INTEGER)'); \n }", "function crearTablaPuertasValoresElectrica(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_electrica (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores electrica...Espere\");\n console.log('transaction creada ok');\n });\n}", "function createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n } // Open the WebSQL database (automatically creates one if one didn't", "function crearTablaEscalerasItemsDefectos(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_items_defectos(k_coditem_escaleras, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaPuertasValoresMotorizacion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_motorizacion (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores motorizacion...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaEscalerasValoresIniciales(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_iniciales (k_codusuario,k_codinspeccion,n_cliente,n_equipo,n_empresamto,v_velocidad,o_tipo_equipo,v_inclinacion,v_ancho_paso,f_fecha,ultimo_mto,inicio_servicio,ultima_inspeccion,v_codigo,o_consecutivoinsp,h_hora,o_tipo_informe)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores iniciales...Espere\");\n console.log('transaction creada ok');\n });\n}", "function createTables()\n{\n \n if( location.hash.indexOf('DropTables') >= 0 ) {\n\t\t dropAllTables();\n\t\t return;\n\t\t}\n \n\tfilesDB.transaction(\n function (transaction) {\n transaction.executeSql('CREATE TABLE IF NOT EXISTS files(id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, LastModified TIMESTAMP NOT NULL, name TEXT NOT NULL, json BLOB NOT NULL DEFAULT \"\");', [], nullDataHandler, killTransaction);\n \t}\n\t);\n \t\n \tsystemDB.transaction(\n function (transaction) {\n transaction.executeSql('CREATE TABLE IF NOT EXISTS files(id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, LastModified TIMESTAMP NOT NULL, name TEXT NOT NULL, json BLOB NOT NULL DEFAULT \"\");', [], nullDataHandler, killTransaction);\n \t}\n\t);\n}", "function crearTablaPuertasValoresOtras(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_otras (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores otras...Espere\");\n console.log('transaction creada ok');\n });\n}", "function createActivityTable() {\n // explicitly declaring the rowIdNum protects rowids from changing if the \n // table is compacted; not an issue here, but good practice\n const cmd = 'CREATE TABLE ActivityTable (id INTEGER PRIMARY KEY, date INTEGER, activity TEXT, amount FLOAT';\n db.run(cmd, function(err, val) {\n if (err) {\n console.log(\"Database creation failure\",err.message);\n } else {\n console.log(\"Created database\");\n }\n });\n}", "function crearTablaInformeValoresAudios(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE informe_valores_audios (k_codusuario,k_codinforme,n_audio,n_directorio,o_estado_envio)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaPuertasItemsManiobras(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_items_maniobras(k_coditem_maniobras, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorValoresFoso(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_foso (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores foso...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorValoresAudios(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_audios (k_codusuario,k_codinspeccion,n_audio,n_directorio,o_estado_envio)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaEscalerasItemsProteccion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_items_proteccion(k_coditem, o_descripcion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorValoresFotografias(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_fotografias (k_codusuario,k_codinspeccion,k_coditem,n_fotografia,n_directorio,o_estado_envio)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaPuertasValoresProteccion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_proteccion (k_codusuario,k_codinspeccion,k_coditem,v_sele_inspector,v_sele_empresa,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores protección...Espere\");\n console.log('transaction creada ok');\n });\n}", "function iniciarTablaHistorial(tx) {\n\ttx.executeSql('CREATE TABLE IF NOT EXISTS Historial (IDUsuario, CuentaDesde, CuentaHasta, Monto, FechaHora)');\n}", "function crearTablaCliente(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE cliente (k_codcliente, v_consecutivocliente,k_codusuario, n_cliente, n_contacto, v_nit, o_direccion, o_telefono, o_correo, n_encargado)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores cliente...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorItemsProteccion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_items_proteccion(k_coditem, o_descripcion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaEscalerasValoresAudios(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_audios (k_codusuario,k_codinspeccion,n_audio,n_directorio,o_estado_envio)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaPuertasValoresAudios(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_audios (k_codusuario,k_codinspeccion,n_audio,n_directorio,o_estado_envio)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorItemsCabina(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_items_cabina (k_coditem_cabina, v_item, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function createParentTable(){\n const mysql = require(\"mysql\");\n\n //create conn\n const connection = mysql.createConnection({\n host: \"localhost\",\n user: \"root\",\n password: \"mysql\",\n database: \"db\"\n });\n \n //open conn\n connection.connect(error => {\n if (error) throw error;\n \n //data fetch\n connection.query(\"CREATE TABLE IF NOT EXISTS `db`.`data` (`microvolts` DECIMAL(10 , 6 ) NULL,`trialstart` INT NULL,`oddball` INT NULL,`flag` VARCHAR(45) NULL,`ID` INT NOT NULL AUTO_INCREMENT,PRIMARY KEY (`ID`));\", function(error) {\n if (error) throw error;\n console.log(\"Table created or already exists!\");\n });\n });\n}", "function crearTablaConsecutivoPuertas(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE consecutivo_puertas (k_codusuario, k_consecutivo unique, n_inspeccion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorValoresPreliminar(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_preliminar (k_codusuario,k_codinspeccion,k_coditem_preli,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores preliminares...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaPuertasValoresIniciales(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_iniciales (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 }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores iniciales...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaEscalerasValoresFotografias(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_fotografias (k_codusuario,k_codinspeccion,k_coditem,n_fotografia,n_directorio,o_estado_envio)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}", "function createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}", "function createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}", "function createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}", "function createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}", "function createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}", "function crearTablaPuertasItemsElectrica(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_items_electrica(k_coditem_electrica, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorItemsMaquinas(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_items_maquinas(k_coditem_maquinas, v_item, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaPuertasValoresMecanicos(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_mecanicos (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores mecanicos...Espere\");\n console.log('transaction creada ok');\n });\n}", "function createDepartmentTable() {\n var sql = `CREATE TABLE departments (\n id INTEGER AUTO_INCREMENT PRIMARY KEY,\n department_name VARCHAR(30) NOT NULL\n ); \n `\n queryReturn(sql, `${sql.split(' ')[2]} table created.`)\n}", "function crearTablaPuertasItemsMotorizacion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_items_motorizacion(k_coditem_motorizacion, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "async _createTable (silent = true) {\n\t\tconst fn = `${this._tableName}._createTable`\n\t\tconst create = `CREATE TABLE IF NOT EXISTS ${this._tableName} ();`\n\t\tlet res;\n\t\tif (!silent) log.info('DB._createTable', create)\n\t\ttry {\n\t\t\tawait this.query(create)\n\t\t} catch (err) {\n\t\t\tif (err.code === '42P07') {\n\t\t\t\tif (!silent) log.info(fn, `TABLE ${this._tableName} already exists`)\n\t\t\t} else {\n\t\t\t\tlog.error(fn, { err: err })\n\t\t\t}\n\t\t}\n\t\tif (!silent && res) log.info(fn, `Created TABLE ${this._tableName}`)\n\t\tawait this._describeTable()\n\t}", "function setupTableForResponseAndMarks(tx){\n console.log(\"before execute sql for ResponseAndMarks Database\");\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS responseandmark(row_id INTEGER PRIMARY KEY,teacher_id INTEGER,student_id INTEGER,lesson_id INTEGER,\\\n exercise_id INTEGER,response,scoremark INTEGER,comment)\");\n}", "function createTables( mysql_conn )\n{\n\n\t//The following variables are SQL statements for creating the tables\n\t//for our database. \n\tlet microbilitesTbl = {\n\t\tname: 'microbialites', \n\t\tquery: SQL`CREATE TABLE microbialites( \n\t\t\tNorthing FLOAT, \n\t\t\tEasting FLOAT, \n\t\t\tSampleID varchar(20), \n\t\t\tMacrostructureType INT, \n MesostructureDesc INT, \n LaminaShape INT, \n LaminaInheritance INT);` \n\t}\n\n\tlet macrostructureDataTbl = {\n\t\tname: 'macrostructureData', \n\t\tquery: SQL`CREATE TABLE macrostructureData(\n\t\t\tMacrostructureID INT, \n\t\t\tMacrostructureType INT, \n\t\t\tComments varchar(100), \n\t\t\tWaypointID INT, \n SectionHeight INT, \n\t\t\tMegastructureType INT );` \n\t}\n\n\tlet macrostructureLocationsTbl = {\n\t\tname: 'macrostructureLocations', \n\t\tquery: SQL`CREATE TABLE macrostructureLocations(\n\t\t\tWaypointName INT, \n\t\t\tNorthing FLOAT, \n\t\t\tEasting FLOAT, \n\t\t\tDatum varchar(10), \n\t\t\tMacrostructureType INT, \n MacrostructureID INT,\n MegastructureType INT); ` \n\t}\n\n\t//TODO: Check datatypes of D,M,N,O,P,Q,R \n\tlet mesostructureDataTbl = {\n\t\tname: 'mesostructureData', \n\t\tquery: SQL`CREATE TABLE mesostructureData(\n\t\t\tSampleIDKey INT, \n\t\t\tSampleID varchar(20), \n\t\t\tSampleSize varchar(20),\n\t\t\tFieldDescription varchar(50), \n\t\t\tRockDescription varchar(2000),\n\t\t\tMesostructureDesc INT, \n LaminaShape INT, \n\t\t\tLaminaThickness FLOAT, \n MacrostructureID FLOAT, \n\t\t\tSynopticRelief FLOAT, \n Wavelength FLOAT, \n\t\t\tAmplitudeOrHeight INT, \n\t\t\tMesostructureTexture INT, \n MesostructureGrains INT, \n MesostructureTexture2 INT, \n Analyst1 INT, \n LaminaInheritance INT, \n MesoClotShape INT,\n MesoClotSize INT);`\n\t}\n\n\tlet photoLinksDataTbl = {\n\t\tname: 'photoLinksData', \n\t\tquery: SQL`CREATE TABLE photoLinksData(\n\t\t\tPhotoIDKey INT, \n SampleIDKey INT, \n PhotoLinkRelative2 varchar(300), \n OutcropPhoto BOOLEAN, \n Photomicrograph BOOLEAN, \n TSOverview BOOLEAN, \n\t\t\tCLImage BOOLEAN, \n OtherImage BOOLEAN, \n OtherDocument BOOLEAN, \n MacrostructureID INT, \n TSDescID INT, \n\t\t\tWaypointIDKey INT, \n SampleID varchar(20));` \n\t}\n\n\t//TODO: The date format in the CSV is backwards. \n\t//\t\tDatetime needs to be in the format of YYYYMMDD HH:MM:SS\n\tlet samplesForARCTbl = { \n\t\tname: 'samplesForARC',\n\t\tquery: SQL`CREATE TABLE samplesForARC(\n\t\t\tSampleID VARCHAR(20), \n Datum VARCHAR(20), \n\t\t\tUTMZone1 INT, \n UTMZone2 varchar(10), \n\t\t\tEasting FLOAT, \n Northing FLOAT, \n\t\t\tDateCollected DATETIME,\n\t\t\tMacrostructureType INT, \n MacrostructureDesc INT ); ` \n\t}\n\n\t//check datatype of C, .\n\tlet thinSectionDataTbl = { \n\t\tname: 'thinSectionData', \n\t\tquery: SQL`CREATE TABLE thinSectionData(\n\t\t\tTSDescID INT, \n\t\t\tSampleID VARCHAR(20),\n\t\t\tSubsample VARCHAR(10), \n SampleIDKey INT, \n\t\t\tTSDescription TEXT, \n\t\t\tPrimaryTexture INT, \n SecondaryTexture INT, \n Cement1 INT, \n Porosity1 INT, \n\t\t\tCement2 INT, \n Porosity2 INT, \n PorosityPercentEst INT, \n CementFill BOOLEAN, \n Mineralogy1 INT,\n Mineralogy2 INT,\n ClasticGrains1 INT,\n ClasticGrains2 INT\n ); `\n\t}\n\n\tlet thrombolitesOnlyTbl = {\n\t\tname: 'thrombolitesOnly', \n\t\tquery: SQL`CREATE TABLE thrombolitesOnly(\n\t\t\tNorthing FLOAT, \n Easting FLOAT, \n\t\t\tSampleID VARCHAR(20), \n\t\t\tMesostructureDesc INT ); `\n\t}\n\n\tvar tables = [microbilitesTbl, macrostructureDataTbl, macrostructureLocationsTbl, \n\t\tmesostructureDataTbl, photoLinksDataTbl, \n\t\tsamplesForARCTbl, thinSectionDataTbl, thrombolitesOnlyTbl];\n\n\n\t//where the queries are made. \n\tfor( let table of tables )\n\t{\n\t\t//console.log(table.query.sql); \n\t\tlet queryPromise = sendQuery(mysql_conn, table.query.sql ); \n\t\tqueryPromise.then( () => { console.log(\"Added table \" + table.name); }, queryPromiseReject ); \n\t}\n\n}", "function crearTablaConsecutivoEscalerasAndenes(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE consecutivo_escaleras (k_codusuario, k_consecutivo unique, n_inspeccion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "getTableName() {}", "function setupTable(tx){\n console.log(\"before execute sql for studentProfile Database\");\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS students(id INTEGER PRIMARY KEY,name,image)\");\n console.log(\"Created table if not existed for studentProfile Database\");\n console.log(\"after execute sql in studentProfile Database\");\n}", "function createTableRecord(tx) {\n\t\n\t console.log(\"Entering createTableRecord\");\n\t \n\t var sqlStr = 'CREATE TABLE IF NOT EXISTS records (type TEXT, date DATE)';\n\t console.log(sqlStr);\n\t \n\t tx.executeSql(sqlStr, [], onSqlSuccess, onSqlError);\n\t console.log(\"Leaving createTableRecord\");\n\t}", "function crearTablaAscensorValoresElementos(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_elementos (k_codusuario,k_codinspeccion,k_coditem,o_descripcion,v_selecion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores elementos...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaEscalerasValoresPreliminar(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_preliminar (k_codusuario,k_codinspeccion,k_coditem_preli,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores preliminares...Espere\");\n console.log('transaction creada ok');\n });\n}", "function create_table_statement(table_name, results, field_names) {\n statement = 'CREATE TABLE ' + table_name + ' (\\n'\n field_names[table_name] = []\n for (let i = 0; i < results.length; i++) {\n field_names[table_name].push(results[i].Field)\n statement += ' ' + results[i].Field + ' ' + results[i].Type.toUpperCase()\n if (results[i].Key === 'PRI') {\n statement += ' PRIMARY KEY'\n }\n if (i < results.length - 1) {\n statement += ',\\n'\n }\n else {\n statement += '\\n);\\n'\n }\n }\n return {'statement': statement, 'field_names': field_names}\n}", "function createNewTable(){\n\ttopRefugeesTable.addColumn('Country');\n\ttopRefugeesTable.addColumn('Total');\n\tfor (var i = 0; i < refugeeTable.getRowCount(); i++) {\n\t\tvar totalRefugees = refugeeTable.getNum(i, 'Total');\n\t\tif (totalRefugees >= 100000) {\n\t\t\tvar newRow = topRefugeesTable.addRow()\n\t\t\tnewRow.setString('Country', refugeeTable.getString(i, 'Country'));\n\t\t\tnewRow.setNum('Total', refugeeTable.getNum(i, 'Total'));\n\t\t}\n\t}\n\tprint('New top refugee table created...');\n}", "function createDB(){\r\n db.transaction(setupTable, dbErrorHandler, getEntries); \r\n}", "function createDBTable($data) {\n \n var arr = [];\n var s = \"&nbsp;&nbsp;&nbsp;\";\n var x = \"\", n = \"\";\n var $o;\n var $r; \n var t = 0;\n var f = \"\";\n var y = \"\";\n\n var dbName = $.trim($dbName.val());\n \n for (var i = 0; i < $data.objects.arr.length; i++) {\n $o = $data.objects.arr[i];\n\n //Class Name (or Object name) --- this should represent the table\n n = $o.name.replace(/[^\\w\\s]/gi, '').replace(/\\s/g, '_').toLowerCase();\n x = $o.tableName;\n arr.push(`CREATE TABLE ${x} (`);\n\n for (var j = 0; j < $o.records.length; j++) {\n console.log($r);\n $r = $o.records[j];\n t = $r.typeID;\n f = $r.name.toUpperCase();\n\n if (t == 1 && f == \"ID\") {\n arr.push(s + \"ID INT NOT NULL PRIMARY KEY IDENTITY(1,1),\");\n }\n else {\n\n y = \"\";\n if ($r.ref.active) {\n y = \" REFERENCES \" + $(\".object[data-num='\" + $r.ref.cls + \"']\").find(\".object-name\").attr(\"data-sqltable\") + \" (\" + $(\".object[data-num='\" + $r.ref.cls + \"']\").find(\".object-table-record[data-row='\" + $r.ref.field + \"']\").attr(\"data-sqlfield\") + \") ON DELETE CASCADE \";\n }\n\n switch (t) {\n case 0:\n arr.push(s + f + \" NVARCHAR(255) NULL\" + y + \",\");\n break;\n case 1:\n arr.push(s + f + \" INT NOT NULL \" + ( (y.length == 0) ? \"DEFAULT \" + $r.def : y) + \",\");\n break;\n case 2:\n arr.push(s + f + \" DECIMAL(18,6) NOT NULL \" + ( (y.length == 0) ? \"DEFAULT \" + $r.def : y) + \",\");\n break;\n case 3:\n arr.push(s + f + \" TINYINT NOT NULL \" + ( (y.length == 0) ? \"DEFAULT \" + $r.def : y) + \",\");\n break;\n case 4:\n arr.push(s + f + \" DATETIME2 NOT NULL DEFAULT GETDATE()\" + y + \",\");\n break;\n case 5:\n case 6:\n case 7:\n default: \n }\n }\n }\n\n var _s = arr[arr.length - 1].slice(0,-1); \n arr[arr.length-1] = _s; \n arr.push(\");\");\n arr.push(\"\");\n }\n \t\n\t\treturn arr;\n\t}", "function crearTablaPuertasValoresFotografias(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_fotografias (k_codusuario,k_codinspeccion,k_coditem,n_fotografia,n_directorio,o_estado_envio)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaPuertasItemsProteccion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_items_proteccion(k_coditem, o_descripcion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function create_table(json) {\n\n // hard coding is cheating, mostly... make it dynamic!\n\n db.serialize( () => {\n db.run('create table if not exists '\n + 'todo ('\n + 'id numeric primary key, '\n + 'userid numeric, '\n + 'title text, '\n + 'completed text)');\n\n db.run('delete from todo'); //or drop the table first..\n\n var stmt = db.prepare('insert into todo values (?,?,?,?)');\n\n json.forEach( (item) => {\n stmt.run([item.id, item.userid, item.title, item.completed]);\n });\n\n stmt.finalize();\n\n });\n\n}", "function crearTablaAscensorItemsPreliminar(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_items_preliminar(k_coditem_preli, o_descripcion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function createTable(table) {\n if (user.id == table.owner_id) {\n sittedTable = new Table(table.id,true);\n }\n}", "function _init_my_supplier_type_code_table(db){\n db.execute('CREATE TABLE IF NOT EXISTS my_supplier_type_code('+\n 'code INTEGER PRIMARY KEY,'+\n 'name TEXT,'+\n 'description TEXT,'+\n 'abbr TEXT)'); \n }", "function crearTablaConsecutivoAscensores(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE consecutivo_ascensores (k_codusuario, k_consecutivo unique, n_inspeccion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function createTasksTable() {\n client.query(\"SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_schema = 'public' AND table_name = 'tasks')\", (err, result) => {\n if(err) {\n console.log(err.stack);\n }\n else {\n if(result.rows[0].exists === false) {\n client.query(\"CREATE TABLE Tasks (Id SERIAL, task VARCHAR NOT NULL, done BOOLEAN NOT NULL)\", (err) => {\n console.log(err ? err.stack : \"Tabela TASKS utworzona!\");\n });\n }\n else {\n console.log(\"Tabela TASKS juz istnieje! :)\");\n }\n }\n });\n}", "function createTasksTable() {\n client.query(\"SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_schema = 'public' AND table_name = 'tasks')\", (err, result) => {\n if(err) {\n console.log(err.stack);\n }\n else {\n if(result.rows[0].exists === false) {\n client.query(\"CREATE TABLE Tasks (Id SERIAL, task VARCHAR NOT NULL, done BOOLEAN NOT NULL)\", (err) => {\n console.log(err ? err.stack : \"Tabela TASKS utworzona!\");\n });\n }\n else {\n console.log(\"Tabela TASKS juz istnieje! :)\");\n }\n }\n });\n}", "function createTables(db) {\n db.run('CREATE TABLE IF NOT EXISTS movies(link varchar(30), id varchar(30), metascore integer, rating float, synopsis varchar(30), title varchar(30), votes float, year integer)');\n db.run('CREATE TABLE IF NOT EXISTS awesome(link varchar(30), id varchar(30), metascore integer, rating float, synopsis varchar(30), title varchar(30), votes float, year integer)');\n console.log(\"The tables movies and awesome were created.\");\n}", "function _init_my_manager_user_mobile_code_table(db){\n db.execute('CREATE TABLE IF NOT EXISTS my_manager_user_mobile_code('+\n 'code INTEGER PRIMARY KEY,'+\n 'abbr TEXT,'+\n 'name TEXT,'+\n 'description TEXT)'); \n }", "function _createTables(){\n var d = $.Deferred();\n\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE IF NOT EXISTS entries (' +\n 'id INTEGER PRIMARY KEY ASC, ' +\n 'name TEXT, ' +\n 'content TEXT, ' +\n 'lat REAL, ' +\n 'long REAL, ' +\n 'imageSrc TEXT, ' +\n 'link TEXT, ' +\n 'sortIndex INTEGER, ' +\n 'dateAdded TEXT, ' +\n 'phone TEXT, ' +\n 'email TEXT, ' +\n 'address TEXT ' +\n ')'\n );\n },\n function (error) {\n console.log(\"Transaction Error: \" + error.message);\n d.reject();\n },\n function () {\n //console.log(\"Created tables if not exists\");\n d.resolve();\n });\n\n return d;\n }", "function crearTablaPuertasValoresPreliminar(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_preliminar (k_codusuario,k_codinspeccion,k_coditem_preli,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores preliminares...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaEscalerasValoresElementos(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_elementos (k_codusuario,k_codinspeccion,k_coditem,o_descripcion,v_selecion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores elementos...Espere\");\n console.log('transaction creada ok');\n });\n}" ]
[ "0.7311507", "0.71923107", "0.71092254", "0.71060216", "0.70860463", "0.7048172", "0.70120513", "0.7011127", "0.69860816", "0.6977017", "0.6973753", "0.6892336", "0.68128604", "0.6806557", "0.67949283", "0.6787026", "0.6754884", "0.67395496", "0.6726497", "0.67124575", "0.67082506", "0.66934484", "0.6692614", "0.6684404", "0.6670711", "0.6669779", "0.66595286", "0.6653455", "0.66421455", "0.66182154", "0.6617619", "0.66125524", "0.660843", "0.66075265", "0.65974915", "0.65887374", "0.65885425", "0.65848875", "0.657092", "0.656809", "0.65439427", "0.6531345", "0.6529581", "0.6527276", "0.65257037", "0.6521624", "0.6520446", "0.651961", "0.6510023", "0.6507032", "0.65052634", "0.6492999", "0.64887017", "0.6487224", "0.6485277", "0.6475127", "0.6470859", "0.646542", "0.6457769", "0.6450642", "0.64498585", "0.6443673", "0.64355695", "0.64249927", "0.64249927", "0.64249927", "0.64249927", "0.64249927", "0.64249927", "0.64185387", "0.64128387", "0.6410883", "0.64040077", "0.6402326", "0.640213", "0.6395598", "0.63769084", "0.6373851", "0.63732207", "0.6360075", "0.63448656", "0.6342526", "0.6336352", "0.6328971", "0.6318834", "0.6316995", "0.6316909", "0.63027424", "0.6299827", "0.62909836", "0.62884015", "0.6288185", "0.62789506", "0.62683153", "0.6263358", "0.6263358", "0.6260498", "0.62530065", "0.6246498", "0.62369525", "0.62315625" ]
0.0
-1
++++++++++++++++++++++++++++++++++++++++++++++++++++++ create db movie adding form
function db_add(url_query, respond){ respond.write("<script>document.getElementById('heading').innerHTML ='DB Add data';</script>"); var add_form ='<input type ="text" id="m_title" placeholder="Please enter Movie title" style="width:60%;height:5%; text-align:center;margin-left:20%"><br><input type ="text" id="m_director" placeholder="Please enter Movie director name" style="width:60%;height:5%;text-align:center;margin-left:20%"><br><input type ="text" id="m_producer" placeholder="Please enter Movie producer name" style="width:60%;height:5%;text-align:center;margin-left:20%"><br><input type ="text" id="m_production_company" placeholder="Please enter Movie production company" style="width:60%;height:5%;text-align:center;margin-left:20%"><br><input type ="text" id="m_country" placeholder="Please enter country movie produced in" style="width:60%;height:5%;text-align:center;margin-left:20%"><br><input type ="text" id="m_actor" placeholder="Please enter Movie Starring" style="width:60%;height:5%;text-align:center;margin-left:20%"><br><input type ="text" id="m_genre" placeholder="Please enter Movie genre" style="width:60%;height:5%;text-align:center;margin-left:20%"><br><textarea id="m_description" style="width:60%;height:10%;text-align:center;margin-left:20%">Please give Movie description</textarea><br><input type ="text" id="m_disclaimer" placeholder="Please give Movie disclaimer" style="width:60%;height:5%;text-align:center;margin-left:20%"><br><input type ="text" id="m_image" placeholder="Please enter image link" style="width:60%;height:5%;text-align:center;margin-left:20%"><hr><input type="button" onclick ="db_write()" value="Save data" style="width:100%;height:10%; border-radius:0px"; class="btn btn-primary">'+ '<script> var m_title=document.getElementById("m_title");var m_director=document.getElementById("m_director");var m_producer=document.getElementById("m_producer");var m_production_company=document.getElementById("m_production_company");var m_country=document.getElementById("m_country");var m_actor=document.getElementById("m_actor");var m_genre=document.getElementById("m_genre"); var m_description=document.getElementById("m_description");var m_disclaimer=document.getElementById("m_disclaimer"); var m_image=document.getElementById("m_image"); function db_write(){if(m_title.value==""||m_director.value==""||m_producer.value==""||m_production_company.value==""||m_country.value==""||m_actor.value==""||m_genre.value==""||m_description.value==""||m_disclaimer.value==""){ document.getElementById("heading").innerHTML ="Please feel in all information";}else{ window.open("db_write?"+m_title.value+"&"+m_director.value+"&"+m_producer.value+"&"+m_production_company.value+"&"+m_country.value+"&"+m_actor.value+"&"+m_genre.value+"&"+m_description.value+"&"+m_disclaimer.value+"&"+m_image.value, "_self");} /*alert(m_title.value+"&"+m_director.value+"&"+m_producer.value+"&"+m_production_company.value+"&"+m_country.value+"&"+m_actor.value+"&"+m_genre.value+"&"+m_description.value+"&"+m_disclaimer.value+"&"+m_image.value)*/;}</script>'; respond.write(add_form); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createMovie(e) {\n e.preventDefault();\n const title = $(\"#title\").val();\n if (title.length < 2) {\n return;\n }\n const rating = $(\"#rating\").val();\n const movieData = { title, rating, id: currentMovieID };\n movieMap.push(movieData);\n\n $(\"#movie-table\").append(createMovieHTML(movieData));\n $(\"#movie-form\").trigger(\"reset\");\n currentMovieID++;\n}", "function saveMovieToList() {\n let addMovSect = document.querySelector(\"#addMovieSec\");\n // Get input fields values\n let fName = document.querySelector(\"#movName\").value;\n let fMovUrl = document.querySelector(\"#movUrl\").value;\n let fPostUrl = document.querySelector(\"#postUrl\").value;\n let fType = document.querySelector(\"#movType\").value;\n // create new movie\n let newMovie = new Movie(fName, fMovUrl, fPostUrl, fType);\n // add new movie to the collection\n movies.addMovie(newMovie);\n addMovSect.style.display = \"none\";\n reloadPosters();\n addImageEvents();\n //reset input fields\n fName.value = \"\";\n fMovUrl.value = \"\";\n fPostUrl.value = \"\";\n fType.value = \"\";\n}", "async addFilm(film){\n return Movie.create(film)\n }", "function createMovie() {\n var title = document.querySelector(\"#movie-title\").value.trim();\n var length = document.querySelector(\"#movie-length\").value;\n var formSelect = document.querySelector(\"#movie-genre\");\n var genre = formSelect.options[formSelect.selectedIndex].value;\n\n var movie = new Movie(title, length, genre);\n\n // Check if movie already exists\n if (listOfMovies.hasElem(movie)) {\n alert(\"movie already exist\");\n return;\n }\n\n var movieItem = document.createElement(\"li\");\n var movieText = document.createTextNode(movie.getData());\n\n movieItem.appendChild(movieText);\n movieUlList.appendChild(movieItem);\n\n // Push created movie to global list of movies and get it's index\n var movieIndex = listOfMovies.push(movie) - 1;\n\n // Put created movie to the drop-down menu\n var option = document.createElement(\"option\");\n option.value = movieIndex;\n var text = document.createTextNode(movie.title);\n option.appendChild(text);\n movieSelector.appendChild(option);\n\n // Reset form\n document.querySelector(\"#movie-form\").reset();\n}", "async addFilm(film){\n return movie.create(film)\n }", "function addMovie( e ){\n var dict = {\n \tMovieId: this[\"movieid\"].value,\n \tTitle : this[\"title\"].value,\n \tGenre: this[\"genre\"].value,\n \tDirector: this[\"director\"].value\n };\n var url = \"\";\n var httpType = \"\";\n //var movieId = getMovieById();\n if (dict.MovieId) {\n \turl = \"https://localhost:44352/api/movie/\" + dict.MovieId;\n \thttpType = \"put\";\n }\n else{\n \turl = \"https://localhost:44352/api/movie/\";\n \thttpType = \"post\";\n }\n $.ajax({\n url: url,\n dataType: 'json',\n type: httpType,\n contentType: 'application/json',\n data: JSON.stringify(dict),\n success: function( data, textStatus, jQxhr ){\n $('#response pre').html( data );\n alert(\"Success\");\n },\n error: function( jqXhr, textStatus, errorThrown ){\n console.log( errorThrown );\n }\n });\n\n e.preventDefault();\n }", "function addMovie(data) {\n var val = data.val();\n viewModel.movies.push(new Movie(val));\n}", "function createMovie(title, length, genre) {\n\n genre_err.textContent = \"\";\n\n var title = title.value;\n var length = parseInt(length.value);\n var genre = genre.value; \n \n if(title !== \"\" && length !== \"\" && genre !== \"\") {\n\n if(isFinite(length)) {\n\n var movie = new Movie(title, length, genre);\n\n var li = document.createElement(\"li\");\n li.setAttribute(\"id\", index);\n li.textContent = movie.getData();\n genre_list.appendChild(li);\n\n festival.movieList.push(movie);\n var index = festival.movieList.length - 1;\n\n var option = document.createElement(\"option\");\n option.setAttribute(\"value\", index);\n option.textContent = festival.movieList[index].getData()\n movie_select.appendChild(option);\n\n movieTitle.value = \"\";\n movieGenre.value = \"\";\n movieLength.value = \"\";\n\n } else {\n genre_err.textContent = \"Movie length must be a number!!\";\n }\n\n } else {\n genre_err.textContent = \"All fields are required\";\n }\n}", "async addFilm(newMovie) {\n return Film.create(newMovie);\n }", "function addMovie(movieText) {\n console.log(movieText);\n fetch(url, {\n method: \"POST\",\n headers: { \"Content-type\": \"application/json\" },\n body: JSON.stringify({\n title: movieText,\n watched: false,\n created_at: moment().format(),\n }),\n })\n .then((response) => response.json())\n .then((movie) => createMovieBox(movie));\n}", "function createMovie() {\n //create new movie\n var movieObject = new Movie (titleNode.value, lengthNode.value, genreNode.value);\n \n \n if(!titleNode.value){\n alert(\"Title is empty\");\n } else if(!lengthNode.value){\n alert(\"Length is empty\");\n } else if(genreNode.value === \"-\"){\n alert(\"You must chose genre\");\n }\n \n var index = festival.addMovie(movieObject);\n //create li element to put list of movie\n var createLiElementNode = document.createElement(\"li\");\n\n //add text to li\n createLiElementNode.textContent = movieObject.getData();\n\n //add li in list\n ulListForAddMovieNode.appendChild(createLiElementNode);\n\n //add movie to movie list in program\n var createOptionNode = document.createElement(\"option\");\n createOptionNode.textContent = movieObject.getData();\n createOptionNode.setAttribute(\"value\", index);\n addMovieToListInProgramNode.appendChild(createOptionNode);\n\n //clear value\n titleNode.value = \"\";\n lengthNode.value = \"\";\n genreNode.value = \"-\";\n}", "render() {\r\n return (\r\n <form className='Form'>\r\n \r\n <input onChange={ e => this.handleChange(e)} name='title' placeholder='Title' />\r\n <input onChange={ e => this.handleChange(e)} name='year' placeholder='Year' />\r\n <input onChange={ e => this.handleChange(e)} name='posterImg' placeholder='Poster url' />\r\n <button type='submit' onClick={ e => this.addMovie(e)}>Add Movie</button>\r\n\r\n </form>\r\n )\r\n }", "function createMovie () {\n var movieTitle = document.getElementById('movie-title').value;\n var movieLength = document.getElementById('movie-length').value;\n var movieGenre = document.getElementById('genre').value;\n\n var movieObject = new Movie(movieTitle, movieGenre, movieLength);\n //console.log(movieObject);\n\n listOfCreatedMovies.push(movieObject);\n // creating new li (movie) and adding it to the ul below the button\n var createdMovieLi = document.createElement('li');\n createdMovieLi.textContent = movieObject.getData();\n createdMovieElementUl.appendChild(createdMovieLi);\n // adding new movie to movie dropdown\n var movieOption = document.createElement('option');\n movieOption.textContent = movieObject.getData();\n movieOption.setAttribute('value', movieObject.getData());\n selectMovieList.appendChild(movieOption);\n // reseting inputs\n document.getElementById('movie-title').value = '';\n document.getElementById('movie-length').value = '';\n document.getElementById('genre').value = '-'\n}", "function updateMovies(movie){\n if(movie.destinationId){\n var form = FormApp.openById(movie.formId);\n form.setDescription(' \\n Format: ' + movie.format + \n ' \\n DCP Drive Type: ' + movie.dcpDriveType + \n ' \\n DCP File Size: ' + movie.dcpFileSize +\n ' \\n DCP Encription: ' + movie.dcpEncryption + \n ' \\n DCP Notes: ' + movie.dcpNotes +\n ' \\n Aspect Ratio: ' + movie.aspectRatio + \n ' \\n Sound Format: ' + movie.soundFormat +\n ' \\n Runtime: ' + movie.runtime + \n ' \\n Backup: ' + movie.backupFormat\n );\n }\n \n}", "function createMovie(movie) {\n let elMovie = movieTemplate.cloneNode(true);\n\n elMovie.querySelector(\".movie-img\").src = movie.poster;\n elMovie.querySelector(\".movie-img\").width = \"300\";\n elMovie.querySelector(\".movie-title\").textContent = movie.title;\n\n movie.genres.forEach((genre) => {\n let newGenreLi = makeElement(\"li\");\n\n newGenreLi.textContent = genre;\n elMovie.querySelector(\".genre-list\").appendChild(newGenreLi);\n\n getMovieGenre(genre);\n });\n\n elMovie.querySelector(\".movie-year\").textContent = date(movie.release_date);\n elMovie.querySelector(\".item-btn\").dataset.id = movie.id;\n elMovie.querySelector(\".bookmark-btn\").dataset.id = movie.id;\n\n movieList.appendChild(elMovie);\n}", "function postMovie(e){\n\tresetFilmNumbers();\n\n\n\t//Get the 'target'; the element that the user clicks on\n\tvar target = e.target;\n\n\t//Checking for a \"generator\" case and 'explode()'s if yes\n\t\n\tif(target.id === \"generator\" && data.genStory){\n\n\t\t//checking for age appropriateness\n\t\tdata.dark = ageApp(data.filmData);\n\n\t\t//explosion\n\t\texplode();\n\n\t\t//clear button\n\t\tget(\"theButton\").innerHTML = \"\"; \n\t}\n\n\t//If it's an \"add\" case...\n\telse if(target.id === \"adder\"){\n\n\t\t//get the year\n\n\t\tvar yearInt = parseInt(elYear.value);\n\n\t\t//if input is okay...\n\n\t\tif(elMovie.value !== \"Title\" && elMovie.value && elYear.value !== \"Year\" && 2016 > yearInt && yearInt > 1890){\n\n\t\t\tvar movieTitle = elMovie.value;\n\t\t\tvar year = elYear.value;\n\n\t\t\t//smooth out the title to make it easy for the API, build the request URL\n\t\t\t// from there\n\t\t\tvar urlToCall = urlBuild(titleSmoother(movieTitle), year);\n\n\t\t\t//request the data, mrSulu! \n\t\t\tmrSulu(urlToCall);\n\t\t\t\n\t\t}\n\n\t\t//With the logic of Spock, we can determine if the fields filled out in the \n\t\t//form are okay or not. \n\n\t\t//Basically, this tests for acceptable data entered into the form field. \n\t\t//If not, it will update the \"feedback\" tag right above the form, so the \n\t\t//user can read it and act accordingly. Live long and prosper!\n\t\t\n\t\telse{\n\n\t\t\tif((elMovie.value === \"Title\" || !elMovie.value) && (isNaN(parseInt(elYear.value)) || typeof parseInt(elYear.value) !== \"number\" || 2016 < parseInt(elYear.value) || parseInt(elYear.value) < 1890)){\n\t\t\t\t//clear the feedback paragraph\n\t\t\t\tget(\"feedback\").innerHTML = \"\";\n\t\t\t\t//update with error\n\t\t\t\tdomMan(\"p\", tNode(\"Valid movie title and year required\"), get(\"feedback\"));\n\t\t\t\tget(\"movie\").focus();\n\t\t\t}\n\n\t\t\telse if(isNaN(parseInt(elYear.value)) || typeof parseInt(elYear.value) !== \"number\" || 2016 < parseInt(elYear.value) || parseInt(elYear.value) < 1890){\n\t\t\t\t//clear the feedback paragraph\n\t\t\t\tget(\"feedback\").innerHTML = \"\";\n\t\t\t\t//update with error\n\t\t\t\tdomMan(\"p\", tNode(\"Please enter valid year between 1890 and 2015\"), get(\"feedback\"));\n\t\t\t\tget(\"year\").focus();\n\t\t\t}\n\t\t\n\t\t\telse{\n\t\t\t\t//clear the feedback paragraph\n\t\t\t\tget(\"feedback\").innerHTML = \"\";\n\t\t\t\t//update with error\n\t\t\t\tdomMan(\"p\", tNode(\"Movie title required\"), get(\"feedback\"));\n\t\t\t\tget(\"movie\").focus();\n\t\t\t}\n\t\t}\n\t}\n}", "save(movie) {\n movie.id = crypto.randomBytes(20).toString('hex'); // fast enough for our purpose\n this.movieList.push(movie);\n return 1;\n }", "function Movie(Name, Year, Director, Genre) {\r\n this.Movie_Name = Name;\r\n this.Movie_Year = Year;\r\n this.Movie_Director = Director;\r\n this.Movie_Genre = Genre;\r\n}", "function addFilm() {\n\tvar resultRegion = \"add-film-result\";\n\tvar info = $(\"#add-film-form\").serialize();\n\n\t$.ajax({\n\t\turl : \"./AddServlet\",\n\t\tdata : \"format=text&\" + info,\n\t\tdatatype : \"text\",\n\t\tsuccess : function(rawData) {\n\t\t\thtmlInsert(resultRegion, rawData)\n\t\t},\n\t\terror : function() {\n\t\t\talert(\"Error\")\n\t\t}\n\t});\n}", "function insert() {\n\t$(\"#descr\").val(\"\");\n\t$(\"#videourl\").val(\"\");\n\t$(\"#controls\").val(\"0\");\n\t$(\"#question\").val(\"\");\n\t$(\"#info\").val(\"\");\n\t$(\"#submit\").val(\"Create\");\n\t$(\"#action\").val(\"2\");\n $(\"#accordion\").accordion({ collapsible: true, active: false });\n\t$(\"#videoinfo\").overlay().load();\n\ttoControls($(\"#controls\").val());\n}", "function Movie(name,year,genre,cast,description){\n this.name = name\n this.year = year\n this.genre = genre\n this.cast = cast\n this.description = description\n}", "add(movie) {\n\t\tthis.push(movie);\n\t}", "function addNewMovie() {\n\tconsole.log(\"\\n\");\n\tconsole.log(SPACER);\n\tlet title = PROMPT.question(\"Movie title: \");\n\tmovies.push({\n\t\ttitle: title,\n\t\tratings: []\n\t});\n}", "function clickToAdd(e) {\n var thisMovieImdbId = e.target.id; // grabs movie in search results from id on add button\n // var thisMovieImdbId = allResults[thisMovieId].imdbID; // grabs proper movie information given correct id\n $.ajax({ // Makes the next api request to get full listing on movie, not just search results (which were abbreviated)\n url: \"http://www.omdbapi.com/?i=\" + thisMovieImdbId + \"&r=json\"\n }).done(function(fullMovieListing) {\n\n // Need If Then Poster\n if (fullMovieListing.Poster !== \"N/A\") {\n fullMovieListing.Poster = \"http://img.omdbapi.com/?i=\" + thisMovieImdbId + \"&apikey=8513e0a1\";\n }\n \n // Sends full movie listing, with user login ID, to store on website database\n grabmovies.findMovie(fullMovieListing, authInfo);\n\n });\n }", "async function addMovieHandler(movie) {\n console.log(movie);\n const response = await fetch('https://react-http-test-d8033-default-rtdb.asia-southeast1.firebasedatabase.app/movies.json', {\n // We define the 'fetch' method to POST to send data to the database\n method: 'POST',\n // We need to send a JSON object, not a JavaScript object\n body: JSON.stringify(movie),\n // Headers for REST APIs\n headers: {\n 'Content-Type': 'application/json',\n }\n });\n const data = await response.json();\n console.log(data);\n }", "function newMovieSuccess(json) {\n\t$('#newMovieForm input').val('');\n\tallMovies.push(json);\n\trender();\n}", "function addMovieToProgram(movie, program) {\n\n movie_err.textContent = \"\";\n \n if(movie.value !== \"\" && program.value !== \"\") {\n\n var movieValue = movie.value;\n var programValue = program.value;\n\n var movie = festival.movieList[movieValue]\n var program = festival.programList[programValue];\n program.addMovie(movie);\n\n\n var liUpdate = document.querySelector(\"#movie-item-\" + programValue);\n var optionUpdate = document.querySelector(\"#program-item-\" + programValue);\n liUpdate.textContent = program.getData();\n optionUpdate.textContent = program.getData();\n\n program_select.value = \"\";\n movie_select.value = \"\";\n \n } else {\n movie_err.textContent = \"All fields are required!\";\n }\n}", "function addMovieSucceded(result) {\n //notificationService.displaySuccess($scope.genre.Name + ' has been submitted to Home Cinema');\n console.log(\"add triggered 3>\" + result.data.Result);\n $scope.account = result.data.Result.Items;\n //$scope.items = result.data.Result.Items; \n\n $scope.items = result.data;\n\n $scope.page = result.data.Result.Page;\n $scope.pagesCount = result.data.Result.TotalPages;\n $scope.totalCount = result.data.Result.TotalCount;\n //$scope.movie = response.data;\n //if (movieImage) {\n // fileUploadService.uploadImage(movieImage, $scope.movie.ID, redirectToEdit);\n //}\n //else\n // redirectToEdit();\n }", "function pressEnterAddMovie(e) {\n if (e.keyCode == 13) {\n createNewItem();\n \n }\n}", "render() {\n return (\n <div className='App'>\n <form onSubmit={this.onSubmit}>\n <div className='form-group'>\n <label>Add Movie Title: </label>\n <input type='text'\n className='form-control'\n value={this.state.Title}\n onChange={this.onChangeTitle}></input>\n </div>\n <div className='form-group'>\n <label>Add Movie Year: </label>\n <input type='text'\n className='form-control'\n value={this.state.Year}\n onChange={this.onChangeYear}></input>\n </div>\n <div className='form-group'>\n <label>Movie Poster: </label>\n <textarea type='text'\n className='form-control'\n value={this.state.Poster}\n onChange={this.onChangePoster}>\n </textarea>\n </div>\n\n\n <div className='form-group'>\n <input type='submit'\n value='Add Movie'\n className='btn btn-primary'></input>\n </div>\n </form>\n </div>\n );\n }", "function submitMovie() {\n event.preventDefault();\n // console.log('Adding new Movie:', movieTitle, imageUrl, movieDescription, movieGenre);\n dispatch({type: 'ADD_NEW_MOVIE', payload: \n {\n title: movieTitle ,\n poster: imageUrl, \n description: movieDescription, \n genre_id: movieGenre\n }\n })\n history.push('/');\n\n }", "function addMovieToLibrary(movie_id) {\n\t// Reset timer in case it's ticking\n\ttimerInf = \"\";\n\tshowInfo('Adding...', false);\n\t$.post('/library/add_movie/' + movie_id + '/', function(msg) {\n\t\tif(msg == 'err_login') {\n\t\t\tshowInfo('You need to <a href=\"/login\">log in</a> or <a href=\"/register\">register</a> to add a movie to your library.', false);\n\t\t} else if(msg == 'alr') {\n\t\t\tshowInfo('You have already added this movie to your library.', true);\n\t\t} else if(msg == 'no_movie') {\n\t\t\tshowInfo('You have not selected a movie.', true);\n\t\t} else {\n\t\t\tshowInfo(msg, false);\n\t\t\t$('#add_movie_form').submit(function() {\n\t\t\t\tvar tags = $('#add_movie_tags').val();\n\t\t\t\tif(tags != '') {\n\t\t\t\t\tshowInfo('Adding...', false);\n\t\t\t\t\t$.post('/library/add_movie/' + movie_id + '/', { tags: tags }, function(msg) {\n\t\t\t\t\t\tif(msg == 'alr') {\n\t\t\t\t\t\t\tshowInfo('You have already added this movie to your library.', true);\n\t\t\t\t\t\t} else if(msg == 'err_login') {\n\t\t\t\t\t\t\tshowInfo('You need to <a href=\"/login\">log in</a> or <a href=\"/register\">register</a> to add a movie to your library.', false);\n\t\t\t\t\t\t} else if(msg == 'ok') {\n\t\t\t\t\t\t\tshowInfo('The movie has been added to your library.', true);\n\t\t\t\t\t\t\t$('#boxxed_movie_' + movie_id).css('background-color', '#ddffdd');\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\talert('Please describe where you have stored the movie.');\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t});\n\t\t\t// Auto focus\n\t\t\t$('#add_movie_tags').focus();\n\t\t\t// Autocomplete de concepto\n\t\t\t$(\"#add_movie_tags\").autocomplete('/ac_tags', {\n\t\t\t\tmultiple: true,\n\t\t\t\tautoFill: true\n\t\t\t});\n\t\t}\n\t});\n}", "function Movie(name, year, genre, cast, description){\n this.name = name;\n this.year = year;\n this.genre = genre;\n this.cast = cast;\n this.description = description;\n}", "function Movie (name, year, genre, cast, description) {\n this.name = name;\n this.year = year;\n this.genre = genre;\n this.cast = cast;\n this.description = description;\n}", "displayRelatedMovie(movies) {\n // It create all html element with movie data\n this.createRelatedMovie(movies)\n }", "function Movie(name, year, genre, cast, description) {\n this.name = name;\n this.year = year;\n this.genre = genre;\n this.cast = cast;\n this.description = description;\n}", "function Movie(name, year, genre, cast, description) {\n this.name = name;\n this.year = year;\n this.genre = genre;\n this.cast = cast;\n this.description = description;\n}", "function displayNewMovie(movie) {\n\n let divNode = document.createElement(\"div\");\n divNode.setAttribute(\"id\", `movieID${movie.id}`);\n\n\n //create title node and append\n let ttlNode = document.createElement(\"p\");\n ttlNode.setAttribute(\"class\", \"title\");\n ttlNode.innerHTML = `${movie.title}`;\n divNode.appendChild(ttlNode);\n\n\n //create year node and append\n let yrNode = document.createElement(\"p\");\n yrNode.setAttribute(\"class\", \"year\");\n yrNode.innerHTML = `${movie.year}`;\n divNode.appendChild(yrNode);\n\n //create rating node and append\n let rtNode = document.createElement(\"p\");\n rtNode.setAttribute(\"class\", \"rating\");\n rtNode.innerHTML = `${movie.rating}`;\n divNode.appendChild(rtNode);\n\n let genreNode = document.createElement(\"p\");\n genreNode.setAttribute(\"class\", \"genre\");\n genreNode.innerHTML = `${movie.genre}`;\n divNode.appendChild(genreNode);\n\n let usrRtNode = document.createElement(\"p\");\n usrRtNode.setAttribute(\"class\", \"usrRating\");\n usrRtNode.innerHTML = `${movie.userRating}`;\n divNode.appendChild(usrRtNode);\n\n let imgNode = document.createElement(\"p\");\n imgNode.setAttribute(\"class\", \"image\");\n imgNode.innerHTML = `${movie.image}`;\n divNode.appendChild(imgNode);\n\n //create edit node and append\n let ediNode = document.createElement(\"p\");\n ediNode.setAttribute(\"class\", \"edit\");\n ediNode.innerHTML = `<img src=\"pen1.png\" alt=\"pen icon\"> Edit`;\n divNode.appendChild(ediNode);\n\n //create delete node and append\n let delNode = document.createElement(\"p\");\n delNode.setAttribute(\"class\", \"dlt\");\n delNode.innerHTML = `<img src=\"trash1.jpg\" alt=\"trash icon\"> Delete`;\n divNode.appendChild(delNode);\n\n outEl.appendChild(divNode);\n\n\n setTimeout(() => {\n var editBtnsList = document.getElementsByClassName('edit');\n var dletBtnsList = document.getElementsByClassName('dlt');\n\n for (let i = 0; i < editBtnsList.length; i++) {\n editBtnsList.item(i).addEventListener(\"click\", editMovie);\n dletBtnsList.item(i).addEventListener(\"click\", deleteMovie);\n }\n }, 0);\n}", "function addMovie(movieFormObj) {\n console.log(\"addMovie\", movieFormObj);\n return new Promise((resolve, reject) => {\n $.ajax({\n url: `${firebase.getFBsettings().databaseURL}/movies.json`,\n type: 'POST',\n data: JSON.stringify(movieFormObj),\n dataType: 'json'\n }).done((movieID) => {\n resolve(movieID);\n });\n });\n}", "function Movie(title,newRelease,times) {\n this.title = title;\n this.newRelease = newRelease;\n this.times = times; \n}", "function addMovie(addedMovie) {\n AJAXRequest(serverURL, 'POST', addedMovie).then(getAllMovies)\n }", "function addEventListeners() {\n $(`.deleteButton`).click(function (e) {// delete function\n e.preventDefault();\n const movieIdToDelete = $(this).attr(`data-id`);\n console.log(movieIdToDelete);\n deleteMovie(movieIdToDelete);\n })\n $('#submit-movie').click(function (e) {// add movie function\n e.preventDefault();\n let movieTitle = $('#title-input').val();//grabs what is typed in html and puts it into new card poster\n let moviePlot = $(\"#plot-input\").val();\n let movieRating = $(\"#rating-select\").val();\n let addedMovie = {title: movieTitle, plot: moviePlot, rating: movieRating};\n addMovie(addedMovie);\n console.log(addMovie);\n })\n $('.editMovie').click(function (e) {// edit movie info/ rating function\n e.preventDefault();\n // .modal(`show`)\n // .modal(`hide`)\n\n const movieToBeEdited = $(this).attr(`data-id`);\n // const originalMovie = localMovies.filter(movie => movieID == movie.id)[0]\n // $('#titles-input').val(originalMovie.year)\n console.log(movieToBeEdited);\n updateMovie(movieToBeEdited)\n\n // let movieRating = $(\"#rating-select\").val();\n updateMovie(movieToBeEdited); //old version updateMovie(addedMovie)\n console.log(updateMovie);\n // .modal(`hide`)\n })\n $('.loading').hide();\n }", "function addMovie(movieId, w){\r\n sessionStorage.setItem('movieId', movieId);\r\n if(w == 1)\r\n addToWatched();\r\n else\r\n addToWished();\r\n}", "function insertFilm(){\n\tvar addTitle = $('#addTitle').val();\n\tvar addYear = $('#addYear').val();\n\tvar addDirector = $('#addDirector').val();\n\tvar addStars = $('#addStars').val();\n\tvar addReview = $('#addReview').val();\n\t\n\tconsole.log(\"https://eloquent-yew-227217.appspot.com/InsertFilm?Title=\"+addTitle+\"&Year=\"+addYear+\"&Director=\"+addStars+\"&Stars=\"+addStars+\"&Review=\"+addReview);\n\taddMovieAjax(\"https://eloquent-yew-227217.appspot.com/InsertFilm?Title=\"+addTitle+\"&Year=\"+addYear+\"&Director=\"+addStars+\"&Stars=\"+addStars+\"&Review=\"+addReview,\"#results\");\n}", "onSaveMovie() {\n let obj = { title: this.title, year: this.year };\n this.dbService.createMovie(obj).subscribe(result => {\n this.onGetMovies();\n });\n }", "function buildNewAdd(moviejson) {\r\n var newFilm = document.getElementById(\"newAdd\");\r\n var tbl = document.createElement(\"table\");\r\n var tblbody = document.createElement(\"tbody\");\r\n for (var i = 0; i < moviejson.response.data.recently_added.length; i++) {\r\n var row = document.createElement(\"tr\");\r\n var cellOne = document.createElement(\"td\");\r\n var fontA = document.createElement(\"i\");\r\n fontA.setAttribute(\"class\", \"fa fa-tv w3-text-green w3-large\");\r\n cellOne.appendChild(fontA);\r\n var cellTwo = document.createElement(\"td\");\r\n cellTwo.textContent = moviejson.response.data.recently_added[i].full_title;\r\n row.appendChild(cellOne);\r\n row.appendChild(cellTwo);\r\n tblbody.appendChild(row);\r\n tbl.appendChild(tblbody);\r\n }\r\n tbl.setAttribute(\"class\", \"w3-table w3-striped w3-white\");\r\n newFilm.appendChild(tbl);\r\n}", "function requestNewItem(){\n var movieTitle = $(\"#inputTitle\").val();\n\n if(movieTitle == \"\"){\n setErrorToINputField();\n $(\"#errorMessage\").slideDown();\n }else{\n var titleCellId = createIdForTitleCell(movieTitle);\n var tableRowId = createIdForTableRow(movieTitle);\n var imageCellId = createIdForImageCell(movieTitle);\n var renameButtonId = createIdForRenameButton(movieTitle);\n var removeButtonId = createIdForRemoveButton(movieTitle);\n \n var returnVal = {\n \"name\":movieTitle,\n \"rowId\": tableRowId,\n \"titleId\": titleCellId,\n \"isSeen\": \"false\",\n \"ration\": 10,\n \"imageId\": imageCellId,\n \"imageHTML\": \"Noch keine Bewertung\",\n \"renameButtonId\": renameButtonId,\n \"removeButtonId\": removeButtonId\n };\n\n //Persist the Item\n pushItemToParse(returnVal);\n\n //Append Item to the List\n appendListItem(returnVal);\n }\n\n\n //Clear the Input-Field\n $(\"#inputTitle\").val(\"\");\n}", "function Movie(name, year, genre, cast, description){\n\tthis.name = name;\n\tthis.year = year;\n\tthis.genre = genre;\n\tthis.cast = cast;\n\tthis.description = description;\n}", "function addFormToPage() {\n const formDivNode = document.getElementById(\"create-monster\")\n\n const addForm = document.createElement(\"form\")\n addForm.addEventListener(\"submit\", createNewMonster)\n addForm.id = \"add-monster-form\"\n \n let nameField = document.createElement(\"input\")\n nameField.id = \"name\";\n nameField.placeholder = \"Name...\";\n \n let ageField = document.createElement(\"input\")\n ageField.id = \"age\";\n ageField.placeholder = \"Age...\";\n \n let descriptionField = document.createElement(\"input\")\n descriptionField.id= \"description\"\n descriptionField.placeholder = \"description...\";\n \n let newMonsterBtn = document.createElement(\"button\")\n newMonsterBtn.innerText = \"Create Monster\"\n \n addForm.append(nameField, ageField, descriptionField, newMonsterBtn)\n formDivNode.innerHTML = \"<h3>Create a New Monster</h3>\"\n //adds form to page \n formDivNode.append(addForm)\n\n\n}", "function addMovie(req,res,next){\n // var tID = req.params.id;\n db.any(`INSERT INTO movies(title, img_url, year, rating, director, plot, actors) VALUES($1,$2,$3,$4,$5,$6,$7) RETURNING movie_id;`,\n [req.body.title, req.body.img_url, req.body.year, req.body.rating, req.body.director, req.body.plot, req.body.actors])\n .then((data)=>{\n console.log(data); // need to get movie_id\n var showTimes = req.body.showTimes; // string or array?\n // iterate & add each showTime to theatre_movie_showtime table\n for(var i in showTimes){\n addShowtime(data.movie_id_holder, req.params.id, showTimes[i]);\n }\n next();\n })\n .catch(()=>{\n console.log('ERROR in ADDING MOVIE!');\n }) \n}", "function listenForAddToFirebase() {\r\n const createForm = document.querySelector('#add-movie-form');\r\n createForm.addEventListener('submit', e => {\r\n e.preventDefault();\r\n db.collection('movies').add({\r\n name: Client.capitalize(createForm['movie-name'].value),\r\n year: parseInt(createForm['movie-year'].value)\r\n }).then(() => {\r\n createForm.reset()\r\n }).catch(err => {\r\n console.log(err.message)\r\n });\r\n });\r\n\r\n // const fetchForm = document.querySelector('#fetch-movies-form');\r\n // fetchForm.addEventListener('submit', async (e) => {\r\n // e.preventDefault();\r\n // let data = {\r\n // eventStart: fetchForm['fetch-movies-event-start'].value,\r\n // eventEnd: fetchForm['fetch-movies-event-end'].value,\r\n // yearStart: fetchForm['fetch-movies-year-start'].value,\r\n // yearEnd: fetchForm['fetch-movies-year-end'].value\r\n // };\r\n // let movies = await Client.getMovies(`${Client.localUrl}/getMovies`, data);\r\n // Client.displayMovies(movies)\r\n // });\r\n}", "render() {\n return (\n //add movie title field, simple input and sends information \n <div>\n <h1>This is my Create Component!</h1>\n <form onSubmit={this.handleSubmit}>\n <div className=\"form-group\">\n <label>Add Movie Name: </label>\n <input type=\"text\"\n className=\"form-control\"\n //takes in infor here\n value={this.state.Title}\n //sends here\n onChange={this.onChangeMovieName}\n />\n </div>\n {/* add movie year here */}\n <div className=\"form-group\">\n <label>Add Movie Year: </label>\n <input type=\"number\"\n className=\"form-control\"\n //takes\n value={this.state.Year}\n //send\n onChange={this.onChangeMovieYear}\n />\n </div>\n {/* add movie poster url here */}\n <div className=\"form-group\">\n <label>Add Movie Poster: </label>\n <input type=\"text\"\n className=\"form-control\"\n //takes\n value={this.state.Poster}\n //sends\n onChange={this.onChangeMoviePoster}\n />\n </div>\n <div>\n {/* button to send info, once clicked, pops handleSubmit function */}\n <input type=\"submit\" value=\"Add Movie\" className=\"btn btn-primary\" />\n </div>\n </form>\n </div>\n );\n }", "createRelatedMovie(movies) {\n this.relatedMovie.innerHTML = ''\n let ul = `<ul>`\n if (movies) {\n movies.forEach(movieName => {\n ul += `<li id=\"${movieName.id}\"><a href=\"#\" id=\"${movieName.id}\">${movieName.original_title}</a></li>`\n })\n }\n ul += `</ul>`\n this.relatedMovie.insertAdjacentHTML('afterbegin', ul)\n }", "function Movie(name, genre, rating) {\n this.name = name;\n this.genre = genre;\n this.rating = rating;\n}", "handleMovieAdd() {\n var newMovie = document.getElementById('new-movie-input').value.trim();\n if (newMovie) {\n var newMovies = this.state.movies.concat([{title: newMovie, watched: false}]);\n var newDisplayedMovies = this.resetDisplayedMovies(newMovies);\n this.setState({\n movies: newMovies,\n displayedMovies: newDisplayedMovies // re-render shows all movies including new one\n });\n }\n }", "function addMovie(title){\n $.ajax({\n url: './db/movies',\n type: 'PUT',\n data: {title: title, rating: 0},\n success: function(result) {\n console.log(\"successfully added movie to collection\")\n }\n });\n event.preventDefault();\n}", "function CreateFilm(data) {\n $.ajax({\n url: \"/api/film\",\n contentType: \"application/json\",\n method: \"POST\",\n data: JSON.stringify({\n nameUa: data.nameUa,\n nameEn: data.nameEn,\n sourseImg: data.sourseImg,\n sourseVideo: data.sourseVideo,\n qualityVideo: data.qualityVideo,\n translation: data.translation,\n motto: data.motto,\n year: data.year,\n country: data.country,\n genre: data.genre,\n category: data.category,\n producer: data.producer,\n duration: data.duration,\n age: data.age,\n firstRun: data.firstRun\n }),\n success: function (film) {\n reset();\n $(\"table tbody\").append(row(film));\n }\n })\n }", "function onClickAdd(ev) {\n ev.preventDefault();\n\n const name = inputFields[0].value;\n const hall = inputFields[1].value;\n const ticketPrice = Number(inputFields[2].value);\n if (!name || !hall || !ticketPrice) {\n return;\n }\n\n function createMovie() {\n const ticketsSold = document.createElement('input');\n ticketsSold.placeholder = 'Tickets Sold';\n const button = el('button', 'Archive');\n button.addEventListener('click', e => onClickArchive(e, name, ticketPrice, ticketsSold));\n return el('li',\n el('span', name),\n el('strong', 'Hall: ' + hall),\n el('div',\n el('strong', ticketPrice.toFixed(2)),\n ticketsSold,\n button,\n )\n );\n }\n\n onScreen.appendChild(createMovie());\n inputFields.forEach(e => e.value = '');\n }", "function addMovieBox() {\n\tlet mContent = document.getElementById('mainContent');\n\tlet boxHTML = '<div id=\"addMovieBox\"></div>';\n\n\tif (mContent.innerHTML.includes('<div id=\"addMovieBox\">')){\n\t\tremoveMovieBox();\n\t\tblurUnblur('gridContainer')\n\t}\n\telse {\n\t\tmContent.innerHTML += boxHTML;\n\t\tshowAddMovies();\n\t\tlet inputTittel = document.getElementById('inputTittel');\n\t\tlet inputSpilletid = document.getElementById('inputSpilletid');\n\t\tlet inputSjanger = document.getElementById('inputSjanger');\n\t\tlet inputFavoritt = document.getElementById('inputFavoritt'); \n\t}\n\tblurUnblur('gridContainer')\n}", "function addMovieDetail(data){\n var $target = $(\".movie-details\");\n\n if (data.Title === undefined) {\n $target.empty();\n $target.append(\"<h2>Sorry, never heard of it!</h2>\");\n } else {\n var poster = data.Poster === \"N/A\" ? \"http://i.imgur.com/rXuQiCm.jpg?1\" : data.Poster;\n $target.empty();\n $target.append(\"<img src=\" + poster + \"></img>\");\n $target.append(\"<h1>\" + data.Title + \"</h1>\");\n $target.append(\"<h2> Year: \" + data.Year + \"</h2>\");\n $target.append(\"<h2> IMDB Rating: \" + data.imdbRating + \"</h2>\");\n\n $target.append(\"<button class='btn btn-default btn-xs add-movie'>Add Movie</button>\");\n }\n}", "AddMovie(e) {\n let mid = e.detail;\n this.props.onShowScreenSpinner();\n axios.post(SERVER_URL + '/movie', {\n user_id: this.props.userId,\n pid: this.props.partyId,\n mid: mid\n }).then((response) => {\n if (response) {\n if (response.data.isOK || !response.data.isOK) {\n this.setState({\n searchResult: [],\n search: ''\n }, () => {\n if (this.props.onFilmAdded && typeof this.props.onFilmAdded === 'function') {\n this.props.onFilmAdded();\n }\n });\n }\n }\n }).catch(err => {\n if (err && err.response) {\n let evt;\n switch (err.response.status) {\n case 403:\n evt = new CustomEvent('showErrorAlert', {\n detail: 'Вы уже добавили доступное количество фильмов.'\n });\n window.dispatchEvent(evt);\n break;\n case 409:\n evt = new CustomEvent('showErrorAlert', {\n detail: 'Этот фильм уже есть в списке.'\n });\n window.dispatchEvent(evt);\n break;\n default:\n evt = new CustomEvent('showErrorAlert', {\n detail: 'Не удалось добавить фильм.'\n });\n window.dispatchEvent(evt);\n }\n }\n });\n }", "function add(event) {\n event.preventDefault();\n // clear inputs set button\n $('#bomForm input').each(function (index, val) {\n $(this).val('');\n });\n $post.prop(\"hidden\", false);\n $put.prop(\"hidden\", true);\n // set title\n $('#modalTitle').text(\"Add New bom\");\n // spawn modal\n $('#formModal').modal();\n}", "function Movie(){\n\tthis.title = \"Movie Title: \";\n\tthis.actor = \"Movie Actors: \"\t\n}", "function createNewItem(){\n var title = getNewMovieTitle();\n\n var user = Parse.User.current();\n var username = user.get(\"username\");\n\n var viewable;\n\n //Check if field is filled\n if(checkEmptynessOfInputfield()){\n\n //Remove Error\n $(\"#errorContainer\").html(\"\");\n destroyErrorField();\n \n //Check whether the Movie exists\n var exists = checkIfMovieExists(title);\n \n if(exists){\n //Movie already exists\n $(\"#errorContainer\").html(\"<span class='error'>Dieser Film befindet sich bereits in der Datenbank</span>\"); \n makeErrorField();\n }else{\n //Detect the User\n var user = Parse.User.current();\n\n var item = {\n \"name\":title,\n \"user\":user,\n \"isSeen\": false,\n \"ration\": 0,\n \"seenButton\":createId(title,8),\n \"owner\": username\n };\n\n if(item.isSeen){\n\n }else{\n viewable = createLoggedInObject(item);\n viewable.isSeenHtml = _.template(notSeenButtonTemplate, {provider:item});\n }\n\n //Save item to Parse\n saveItemToParse(item);\n \n //Save the rating object\n saveRateObject(title);\n\n //Append the Item\n appendNewMovie(viewable);\n\n //Toggle Toolbar to new Item\n toggleToolBar(); \n }\n\n //Clear the Field\n clearInputField();\n }else{\n $(\"#errorContainer\").html(\"<span class='error'>Feld darf nicht leer sein</span>\");\n makeErrorField();\n }\n}", "function Movie(title, director, rating) {\n this.title = title;\n this.director = director;\n this.rating = rating;\n}", "function addMovie(){\n var today = new Date();\n var name = $('#name').val();\n var year = $('#year').val();\n // validates de year intro\n if(parseInt(year)>=1900 && parseInt(year)<=parseInt(today.getFullYear()) && (name)){ \n var dataString = 'name='+ name + '&year='+ year;\n $.ajax({\n type: \"POST\",\n url: \"movieadd.php\",\n dataType: \"html\",\n data: dataString,\n success: function(data){\n // Is input was correct, calls movielist function to refresh the list \n movielist(); \n }\n });\n } else {\n alert('Please use a valid date');\n }\n}", "function Movie(title, times, age){\n this.title = title;\n this.times = times;\n this.age = age;\n\n}", "function newMovieError() {\n\tconsole.log('Unable to add new movie...');\n}", "function addActor() {\n var actorName;\n var birthday;\n var biography;\n var actorId;\n\n var elementNumFromGetSelItem2;\n var movies = [];\n var movie0, movie1, movie2, movie3, movie4;\n \n var elementNumFromGetSelItem2 = parseInt(strSel2, 10);\n \n\n actorName = document.getElementById(\"actorName\").value;\n console.log(actorName);\n \n birthday = document.getElementById(\"birthday\").value;\n console.log(birthday);\n\n biography = document.getElementById(\"bio\").value;\n console.log(biography);\n\n\n // Getting input for the movie stars associated with the movie, then clear text fields\n if (elementNumFromGetSelItem2 == 5) {\n movie0 = document.getElementById(\"4\").value;\n console.log(movie0);\n\n movies.push(movie0);\n \n // clear text fields\n document.getElementById(\"actorName\").value = \"\";\n document.getElementById(\"bio\").value = \"\";\n document.getElementById(\"birthday\").value = \"\";\n document.getElementById(\"4\").value = \"\";\n \n } else if (elementNumFromGetSelItem2 == 6) {\n movie0 = document.getElementById(\"4\").value;\n console.log(movie0);\n \n movie1 = document.getElementById(\"5\").value;\n console.log(movie1);\n\n //Pushing values to the choices array\n movies.push(movie0, movie1);\n \n // clear text fields\n document.getElementById(\"actorName\").value = \"\";\n document.getElementById(\"bio\").value = \"\";\n document.getElementById(\"birthday\").value = \"\";\n document.getElementById(\"4\").value = \"\";\n document.getElementById(\"5\").value = \"\";\n\n } else if (elementNumFromGetSelItem2 == 7) {\n movie0 = document.getElementById(\"4\").value;\n console.log(movie0);\n \n movie1 = document.getElementById(\"5\").value;\n console.log(movie1);\n\n movie2 = document.getElementById(\"6\").value;\n console.log(movie2);\n\n \n //Pushing values to the choices array\n movies.push(movie0, movie1, movie2);\n \n // clear text fields\n document.getElementById(\"actorName\").value = \"\";\n document.getElementById(\"bio\").value = \"\";\n document.getElementById(\"birthday\").value = \"\";\n document.getElementById(\"4\").value = \"\";\n document.getElementById(\"5\").value = \"\";\n document.getElementById(\"6\").value = \"\";\n\n }else if (elementNumFromGetSelItem2 == 8) {\n movie0 = document.getElementById(\"4\").value;\n console.log(movie0);\n \n movie1 = document.getElementById(\"5\").value;\n console.log(movie1);\n\n movie2 = document.getElementById(\"6\").value;\n console.log(movie2);\n\n movie3 = document.getElementById(\"7\").value;\n console.log(movie3);\n\n \n //Pushing values to the choices array\n movies.push(movie0, movie1, movie2, movie3);\n \n // clear text fields\n document.getElementById(\"actorName\").value = \"\";\n document.getElementById(\"bio\").value = \"\";\n document.getElementById(\"birthday\").value = \"\";\n document.getElementById(\"4\").value = \"\";\n document.getElementById(\"5\").value = \"\";\n document.getElementById(\"6\").value = \"\";\n document.getElementById(\"7\").value = \"\";\n\n }else if (elementNumFromGetSelItem2 == 9) {\n movie0 = document.getElementById(\"4\").value;\n console.log(movie0);\n \n movie1 = document.getElementById(\"5\").value;\n console.log(movie1);\n\n movie2 = document.getElementById(\"6\").value;\n console.log(movie2);\n\n movie3 = document.getElementById(\"7\").value;\n console.log(movie3);\n\n movie4 = document.getElementById(\"8\").value;\n console.log(movie4);\n\n \n //Pushing values to the choices array\n movies.push(movie0, movie1, movie2, movie3, movie4);\n \n // clear text fields\n document.getElementById(\"actorName\").value = \"\";\n document.getElementById(\"bio\").value = \"\";\n document.getElementById(\"birthday\").value = \"\";\n document.getElementById(\"4\").value = \"\";\n document.getElementById(\"5\").value = \"\";\n document.getElementById(\"6\").value = \"\";\n document.getElementById(\"7\").value = \"\";\n document.getElementById(\"8\").value = \"\";\n\n }\n\n console.log(movies);\n \n // Database steps\n var db = firebase.firestore();\n var doc = db.collection(\"Actors\").doc();\n \n \n var actors = {\n createdBy: firebase.auth().currentUser.uid,\n name: actorName,\n movies: movies,\n actorId: doc.id,\n birthday: birthday,\n bio: biography,\n dateCreated: new Date(),\n dateUpdated: new Date()\n };\n \n doc.set(actors);\n \n if (elementNumFromGetSelItem2 == 5) {\n \n document.getElementById(\"4\").remove();\n\n }else if (elementNumFromGetSelItem2 == 6) {\n document.getElementById(\"4\").remove();\n document.getElementById(\"5\").remove();\n \n }else if (elementNumFromGetSelItem2 == 7) {\n document.getElementById(\"4\").remove();\n document.getElementById(\"5\").remove();\n document.getElementById(\"6\").remove();\n\n }else if (elementNumFromGetSelItem2 == 8) {\n document.getElementById(\"4\").remove();\n document.getElementById(\"5\").remove();\n document.getElementById(\"6\").remove();\n document.getElementById(\"7\").remove();\n }else if (elementNumFromGetSelItem2 == 5) {\n document.getElementById(\"4\").remove();\n document.getElementById(\"5\").remove();\n document.getElementById(\"6\").remove();\n document.getElementById(\"7\").remove();\n document.getElementById(\"8\").remove();\n } \n // This will disable the get selected item button\n document.getElementById(\"clicky2\").disabled = false;\n\n document.getElementById(\"actorName\").value = \"\";\n document.getElementById(\"bio\").value = \"\";\n document.getElementById(\"birthday\").value = \"\";\n}", "async function addToMovieTable(movie, user) {\n const result = await db.Movie.findOne({\n where: {\n apiReferenceId: movie.apiReferenceId\n }\n });\n if (!result) {\n db.Movie.create(movie).then((response) => {\n db.User.update(\n {\n movieOnDeckId: response.id\n },\n {\n where: {\n id: user\n }\n }\n ).then(() => {\n console.log(\"Movie was added to movie table\");\n });\n });\n } else {\n db.User.update(\n {\n movieOnDeckId: result.id\n },\n {\n where: {\n id: user\n }\n }\n ).then((result) => {\n console.log(\"Updated \"+ result + \" rows\");\n });\n }\n}", "function insertMovies(db) {\n movies.forEach(movie => {\n const sql = 'INSERT INTO movies(link, id, metascore, rating, synopsis, title, votes, year) ' +\n 'VALUES(\"' + movie.link + '\", \"' + movie.id + '\", ' + movie.metascore + ', ' + movie.rating +\n ', \"' + movie.synopsis + '\", \"' + movie.title + '\", ' + movie.votes + ', ' + movie.year + ')';\n db.run(sql);\n })\n console.log(\"Data from the movies.json file were inserted in the database.\");\n}", "function addNewCar(){\n var model = document.forms[\"modelForm\"][\"Model\"].value;\n var marque = document.forms[\"modelForm\"][\"Marque\"].value\n var prix = document.forms[\"modelForm\"][\"Prix\"].value\n var image = document.forms[\"modelForm\"][\"Image\"].value\n let newCar = new Voiture(model,marque,prix,image)\n listeVoitures.push(newCar)\n affichageTableau()\n}", "function addVideoForm(container) {\n\n var videoForm = $('<div>');\n videoForm.html('<h2>Video</h2>')\n .css('width', '750')\n .css('padding', '10')\n .css(\"backgroundColor\", '#F3F3F3');\n\n var video = $('<div id=\"video\">');\n video.corner();\n videoForm.append(video);\n form.addNewlineInput(video, 'Name', 'name', 30);\n form.addNewlineInput(video, 'Reference ID', 'referenceId', 30);\n\n var renditions = $('<div id=renditions>');\n renditions.html('<h3>Live Renditions</h3>');\n videoForm.append(renditions);\n\n var renditionsView = $('<div>');\n\n var renditionSelectElem = $('<span>').html('Select number of renditions (Warning: changing will clear values): ');\n var renditionSelect = $('<select/>')\n for (var r=1;r<9;r++) {\n $('<option />', {value: r, text: r}).appendTo(renditionSelect);\n } \n renditionSelect.change(function(){updateRenditionView(renditionsView, $(this).val())});\n renditionSelect.val(4);\n renditionSelect.change();\n renditionSelectElem.append(renditionSelect);\n\n renditions.append(renditionSelectElem);\n renditions.append(renditionsView);\n\n var hlsRendition = $('<div>');\n hlsRendition.html('<h3>Live HLS Rendition</h3>');\n addHlsRendition(hlsRendition);\n videoForm.append(hlsRendition);\n\n videoForm.append('<div id=\"results\"/>');\n\n form.addButton(videoForm, createVideo, 'Create Video!');\n form.addButton(videoForm, fillInForm, 'Pre-Fill Data');\n\n container.append(videoForm);\n}", "add(event){\n const title = event.target.parentNode.parentNode.querySelector('.title').textContent;\n const year = event.target.parentNode.parentNode.querySelector('.year').textContent;\n const poster = event.target.parentNode.parentNode.querySelector('.poster').getAttribute(\"src\");\n\n this.db.put({\n _id: title,\n year,\n poster\n }).then(rsp => {\n console.log('rsp', rsp);\n }).catch(function (err) {\n console.log(err);\n });\n }", "render() {\n //returns div tag content with form and print to screen \n return (\n <div className=\"App\">\n <form onSubmit={this.onSubmit}>\n {/*input control - title*/}\n <div className=\"form-group\">\n <label>Add Movie Name: </label>\n <input type=\"text\"\n className=\"form-control\"\n //value method - uses existing title\n value={this.state.Title}\n //onChange method - change movie title\n onChange={this.onChangeMovieName}></input>\n </div><br />\n\n {/*input control - year*/}\n <div className=\"form-group\">\n <label>Add Movie year: </label>\n <input type=\"text\"\n className=\"form-control\"\n //value method - uses existing year\n value={this.state.Year}\n //onChange method - change movie year\n onChange={this.onChangeMovieYear}></input>\n </div><br />\n\n {/*input control - poster*/}\n <div className=\"form-group\">\n <label>Add Movie poster: </label>\n <textarea type=\"text\"\n className=\"form-control\"\n //value method - uses existing poster\n value={this.state.Poster}\n //onChange method - change movie poster\n onChange={this.onChangeMoviePoster}>\n </textarea>\n\n </div><br />\n {/*submit button*/}\n <div className=\"form-group\">\n <input type=\"submit\"\n value=\"Add Movie\"\n className=\"btn btn-primary\"></input>\n </div>\n </form>\n </div>\n )//end return\n }", "function populateModal(movie){\n document.title = movie['movieName'] + \" - FilmDags\";\n $('#posterTitle').text(movie['movieName']);\n $('#genreAge').text(movie['genreName'] + \", \" + movie['age'] + \" - \" + movie['formattedLength']);\n $('.embed-responsive-item').attr('src', movie['highQualityTrailerLink']);\n var actorList = \"\";\n for (i = 0; i <= movie['actors'].length-1; i++){\n if(i != movie['actors'].length-1){\n actorList += movie['actors'][i]['name'] + \", \";\n }\n else{\n actorList += movie['actors'][i]['name']\n }\n }\n $('#actors').text(actorList);\n $('#desc').text(movie['shortDescription']);\n $('#directors').text(movie['directors'][0]['name']);\n}", "function MovieController() {\n let vm = this;\n vm.newMovie = {}\n vm.movies = [\n { title: \"Dope-ass movie\", releaseYear: 2017, genreId: 1 }\n ];\n\n /**\n * Add movie to list of favorite movies\n * @param {Object} movie An object that contains a title, releaseYear, and genreId representing a movie\n */\n vm.addMovie = function addMovie(movie) {\n if (typeof movie !== 'object' || typeof movie.title !== 'string') {\n return;\n }\n\n vm.movies.push({\n title: movie.title,\n releaseYear: movie.releaseYear,\n genreId: movie.genreId\n })\n\n vm.newMovie = {};\n };\n }", "function addMovie(title, summary) {\n console.log(title, summary)\n const displaySection = document.getElementById(\"movieDetails\")\n const titleSection = displaySection.querySelector(\"h4\")\n const summarySection = displaySection.querySelector(\"p\")\n\n titleSection.textContent = title\n summarySection.textContent = summary\n}", "function navAddMovieToAPIOnEvent() {\n navAddButton.addEventListener(\"click\", () => {\n addOrEditMovieDiv.innerText = \"\"\n\n var addTitleOfMovie = document.createElement(\"input\");\n addTitleOfMovie.setAttribute(\"placeholder\", \"Wpisz nazwę filmu\");\n\n var addYearOfMovie = document.createElement(\"input\");\n addYearOfMovie.setAttribute(\"placeholder\", \"Wpisz rok produkcji\");\n\n var addActorsOfMovie = document.createElement(\"input\");\n addActorsOfMovie.setAttribute(\"placeholder\", \"Wpisz aktorów\");\n\n var addGenreOfMovie = document.createElement(\"input\");\n addGenreOfMovie.setAttribute(\"placeholder\", \"Wpisz gatunek\");\n\n var addUrlOfPicture = document.createElement(\"input\");\n addUrlOfPicture.setAttribute(\"placeholder\", \"Link do zdjęcia\");\n\n var addRateOfMovie = document.createElement(\"input\");\n addRateOfMovie.setAttribute(\"placeholder\", \"Oceń film (1-6)\");\n\n var addDescriptionOfMovie = document.createElement(\"input\");\n addDescriptionOfMovie.setAttribute(\"placeholder\", \"Dodaj opis\");\n\n var addMovieToServerButton = document.createElement(\"button\");\n addMovieToServerButton.innerText = \"Dodaj film!\";\n addMovieToServerButton.setAttribute(\"class\", \"btn\");\n\n addMovieToServerButton.addEventListener(\"click\", function addMovieByEventClick() {\n\n fetch(MOVIE_API_URL, {\n method: \"POST\",\n headers: { \"Content-type\": \"application/json; charset=UTF-8\" },\n body: JSON.stringify({\n title: addTitleOfMovie.value,\n year: addYearOfMovie.value,\n cast: addActorsOfMovie.value,\n genres: addGenreOfMovie.value,\n imgSrc: addUrlOfPicture.value,\n rate: addRateOfMovie.value,\n description: addDescriptionOfMovie.value,\n })\n })\n .then((resp) => {\n if (resp.ok) {\n return resp.json();\n } else {\n Promise.reject(\"http code: \", resp.status);\n }\n })\n .then(loadAllMovies)\n .then(data => {\n console.log(\"dane od serwera\", data);\n startWindow()\n })\n .catch(err => console.warn(\"nie działa, nie udało się wysłac na serwer ponieważ wystapił błąd: \", err))\n }\n )\n\n addOrEditMovieDiv.appendChild(addTitleOfMovie);\n addOrEditMovieDiv.appendChild(addYearOfMovie);\n addOrEditMovieDiv.appendChild(addActorsOfMovie);\n addOrEditMovieDiv.appendChild(addGenreOfMovie);\n addOrEditMovieDiv.appendChild(addUrlOfPicture);\n addOrEditMovieDiv.appendChild(addRateOfMovie);\n addOrEditMovieDiv.appendChild(addDescriptionOfMovie);\n addOrEditMovieDiv.appendChild(addMovieToServerButton);\n changeAllDeleteButtonsVisibility(\"hidden\");\n document.body.scrollTop = document.documentElement.scrollTop = 0\n })\n}", "function uploded() {\n\tvar videoTitle = document.getElementById('title').value;\n\tvar videoPath = document.getElementById('videoPath').value;\n\tvar videoPoster = document.getElementById('videoPosterPath').value;\n\tvar videoDuration = document.getElementById('duration').value;\n\tvar videoText = document.getElementById('description').value;\n\tvar videoCategory = document.getElementById('category').value;\t\n\tvar isPrivace = document.getElementById('privace').value;\n\tvar serverName = document.getElementById('originName').value;\n\tvar musicGenre = null;\n\t\n\tvar dataGenre = document.querySelectorAll('.genre > input');\n\n\t//-=-=-=-=-=-=--=---=-=ckeck for music genre =-=-=-=-=-=-=--=-=-==-=-=\\\\\n\tfor (var index = 0; index < dataGenre.length; index++){\n\t\tif (dataGenre[index].checked){\n\t\t\tmusicGenre = dataGenre[index].value;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t//-=-=-=-=-=-=--=---=-=ajax query add video in DB =-=-=-=-=-=-=--=-=-==-=-=\\\\\n\tvar xhr = new XMLHttpRequest();\n\tvar dataSend = 'video=' + JSON.stringify({title:videoTitle, pathVideo:videoPath, posterVideo:videoPoster, duration:videoDuration, description:videoText, category:videoCategory, genre:musicGenre, privacy:isPrivace});\n\t\n\txhr.open('POST', 'ajax/addVideoController.php', true);\n\txhr.setRequestHeader(\"Content-type\", \"application/json\");\n\t\n\txhr.send(dataSend);\n\txhr.onload = function() {\n\t\tif (this.status === 400){\n\t\t\tvar response = JSON.parse(this.responseText);\n\t\t\tif (response['error']){\n\t\t\t\tdocument.getElementById('errorUploded').style.display = 'block';\n\t\t\t\tdocument.getElementById('errorUploded').innerHTML = response['error'];\n\t\t\t}else document.getElementById('errorUploded').style.display = 'block';\n\t\t}\n\t\tif (this.status === 200) {\n\t\t\tvar response = JSON.parse(this.responseText);\n\t\t\tdocument.getElementById('sucssesUploded').style.display = 'block';\n\t\t\tdocument.getElementById('videoDetails').style.display = 'none';\n\t\t\tdocument.getElementById('delete').style.display = 'none';\n\t\t}\n\t}\t\n}", "async function createMovie() {\n setLoading(true);\n let formdata = new FormData();\n formdata.append(\"name\", movie);\n formdata.append(\"language\", language);\n formdata.append(\"release\", release);\n formdata.append(\"thumbnail\", thumbnail);\n formdata.append(\"trailer\", trailer);\n\n try {\n let options = {\n onUploadProgress: (progressEvent) => {\n const { loaded, total } = progressEvent;\n let percentage = Math.floor((loaded * 100) / total);\n console.log(percentage);\n if (percentage < 100) {\n setProgress(percentage);\n }\n },\n };\n const response = await axios.post(\n \"/api/v1/movie/add\",\n formdata,\n options,\n {\n headers: {\n \"Content-type\": \"multipart/form-data\",\n },\n }\n );\n if (response) {\n setProgress(100);\n setTimeout(() => {\n setProgress(0);\n }, 1000);\n setLoading(false);\n }\n\n alert.show(response.data.message, {\n type: \"success\",\n });\n } catch (error) {\n setLoading(false);\n alert.show(error.message, {\n type: \"error\",\n });\n }\n }", "function createMovie(movieObject) {\n let options = {\n method: \"POST\",\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(movieObject)\n }\n return fetch(movieAPIURL, options)\n .then((response) => response.json())\n\n}", "function addData(e) {\n // prevent default - we don't want the form to submit in the conventional way\n e.preventDefault();\n\n // grab the values entered into the form fields and store them in an object ready for being inserted into the DB\n let newItem = { title: titleInput.value, body: bodyInput.value };\n\n // open a read/write db transaction, ready for adding the data\n let transaction = db.transaction(['notes_os'], 'readwrite');\n\n // call an object store that's already been added to the database\n let objectStore = transaction.objectStore('notes_os');\n\n // Make a request to add our newItem object to the object store\n let request = objectStore.add(newItem);\n request.onsuccess = function() {\n // Clear the form, ready for adding the next entry\n titleInput.value = '';\n bodyInput.value = '';\n };\n\n // Report on the success of the transaction completing, when everything is done\n transaction.oncomplete = function() {\n console.log('Transaction completed: database modification finished.');\n\n // update the display of data to show the newly added item, by running displayData() again.\n displayData();\n };\n\n transaction.onerror = function() {\n console.log('Transaction not opened due to error');\n };\n}", "function Movie(val){\n\n this.title = val.title\n this.overview = val.overview\n this.image_url = `https://image.tmdb.org/t/p/w500${val.poster_path}`; \n \n}", "function createNewRow(Media) {\n \n var newMovieCard = $(\"<div>\");\n newMovieCard.addClass(\"card\");\n var newMovieTitle = $(\"<h2>\");\n // var newMovieRating = $(\"<small>\");\n var newMovieDescription = $(\"<small>\");\n var newMovieRelYear = $(\"<small>\")\n\n\n var newMovieCardBody = $(\"<div>\");\n newMovieCardBody.addClass(\"card-body\");\n var newMovieBody = $(\"<p>\");\n newMovieTitle.text(Media.media_name + \" \");\n // newMovieRating.text(Media.description);\n newMovieRelYear.text(Media.release_yr);\n newMovieDescription.text(Media.description);\n newPostTitle.append(newPostDate);\n\n newMovieCardBody.append(newMovieTitle);\n newMovieCardBody.append(newMovieDescription);\n newMovieCardBody.append(newMovieLength);\n // newPostCard.append(newPostCardHeading);\n // newPostCard.append(newPostCardBody);\n newMoiveCard.data(\"Media\", post);\n return newMovieCard;\n }", "function addBtnProcess(e) {\n\n // ADD to book when fields is not empty\n if (\n\t\t\tmovie_name.value.length != 0 &&\n\t\t\trelease_date.value.length != 0 &&\n\t\t\tmovie_banner.value.length != 0 &&\n\t\t\tdescription.value.length != 0\n\t\t) {\n\t\t\t// when not empty call this function\n\t\t\tAddToBook(type='alert-success');\n\t\t} else {\n setTimeout(ErrorAlert(type='alert-danger'), 1000);\n\t\t}\n\t\t\t\n \n e.preventDefault();\n}", "function addPlayer() {\n \t\tvar p = $(\"#add\").val();\n \t\tif (p) {\n \t\t\tmodel.addPlayer(p);\n \t\t} else {\n \t\t\talert(\"The player field is required\");\n \t\t}\n \t}", "function openFormCreate(elem)\n{\n\t//Clean form data\n\tdocument.getElementById('formEnreg').reset();\t\n\t//Cache table list film\n\trendreInvisible(elem);\n\t//Display form\n\t$(\"#divFormFilm\").show();\n}", "render() {\n return (\n <div>\n <form onSubmit={this.handleSubmit}>\n <label htmlFor='movieTitle'>Title</label>\n <input \n id='movieTitle'\n type='text'\n value={this.state.movieTitle}\n onChange={this.handleChange}\n />\n <input \n type='submit'\n value='Engage Movie Trek'\n />\n </form>\n {this.state.movie ? <MovieInfo movie={this.state.movie} /> : ''}\n </div>\n )\n }", "function addMovieToWishlist(movie_id) {\n\t// Reset timer in case it's ticking\n\ttimerInf = \"\";\n\tshowInfo('Adding...', false);\n\t$.post('/library/add_movie_wishlist/' + movie_id + '/', function(msg) {\n\t\tif(msg == 'err_login') {\n\t\t\tshowInfo('You need to <a href=\"/login\">log in</a> or <a href=\"/register\">register</a> to add a movie to your wish list.', false);\n\t\t} else if(msg == 'alr') {\n\t\t\tshowInfo('You have already added this movie to your wish list.', true);\n\t\t} else if(msg == 'no_movie') {\n\t\t\tshowInfo('You have not selected a movie.', true);\n\t\t} else {\n\t\t\tshowInfo('The movie has been added to your wish list.', true);\n\t\t\t$('#movie_img_favorite_' + movie_id).attr('src', '/site_media/imgs/favorite_16.png');\n\t\t}\n\t});\n}", "render() {\n let addModalClose = () => this.setState({ addModalShow: false });\n return ( \n <div className=\"MovieCardButton\">\n <div className=\"displays\">\n {this.props.movies.map((el) => (\n <div className=\"card\">\n <div>\n <img src={el.image} className=\"image11\" alt=\"Jocker film\" />\n </div>\n <div>\n <h4>{el.name}</h4>\n </div>\n <div>\n {\" \"}\n <h6 className=\"DesignRate\">{el.rating}</h6>{\" \"}\n </div>\n \n <div>\n {\" \"}\n <p>{el.description} </p>\n </div>\n <div className=\"btnCard\">\n {\" \"}\n \n <span\n className=\"favoris\"\n onClick={() => this.props.addFavoris(el)}\n >\n {\" \"}\n <i style={{ color: \"red\" }} className=\"fas fa-heart\"></i>{\" \"}\n </span>\n \n \n\n <div className=\"btn-card\">\n <Router>\n <Link to={\"/detail/\" + el.id}>\n {\" \"}\n <span className=\"btn_detail\"> <i style={{ color: \"white\" }} className=\"fas fa-chevron-circle-right\"></i> </span>\n </Link>\n </Router>\n </div>\n </div>\n </div>\n ))}\n\n \n </div>\n <div className=\"btnA\">\n <button\n \n className=\"addmovie\" onClick={() => this.setState({ addModalShow: true })}\n ><i class=\"fas fa-plus-square\"></i>\n Add Movie\n </button>\n <FormAddMovie\n addfilmName={this.handleChangeName}\n addfilmDescription={this.handleChangeDescription}\n addfilmRate={this.handleChangeRate}\n addfilmImage={this.handleChangeImage}\n addObjectMovie={this.addObjectMovie}\n state={this.state}\n show={this.state.addModalShow}\n onHide={addModalClose}\n />\n </div>\n </div>\n );\n }", "editMovie(movie) {\n this.props.editMovie(movie);\n\n if (!this.state.errors) {\n this.closeEditingMode();\n }\n }", "function addNewItem() {\n log.debug('[TodoList] : addNewItem');\n\n var formValues = getFormValues();\n var id;\n // Edit or create new\n if (todo_id) {\n todoItem.set(formValues);\n todoItem.save();\n id = todo_id;\n } else {\n var newModel = Alloy.createModel(\"ToDo\", formValues);\n newModel.save();\n id = newModel.get(\"todo_id\");\n }\n\n // Make sure the collection is current\n todo.fetch();\n\n //alert(\"Saved this model: \" + JSON.stringify(newModel, null, 4));\n\n Alloy.Globals.Menu.setMainContent('TodoListDetail', {todo_id: id});\n\n}", "function Movie(displayTitle, mmpaRating, criticsPick) {\n this.displayTitle = displayTitle;\n this.mmpaRating = mmpaRating;\n this.criticsPick = criticsPick;\n // this.byLine = byLine;\n // this.headline = headline;\n // this.summaryShort = summaryShort;\n // this.publicationData = publicationData;\n // this.openingDate = openingDate;\n // this.link = link;\n // this.dateUpdated = dateUpdated;\n // this.ultimedia = ultimedia;\n}", "get_add_infos(movie, five_actors){\r\n\r\n let new_id = movie.id;\r\n let new_genres = this.get_genres(movie.genre_ids);\r\n let new_actors = five_actors\r\n\r\n let add_info_obj ={\r\n id: new_id,\r\n genres: new_genres,\r\n main_actors: new_actors\r\n };\r\n\r\n return add_info_obj;\r\n }", "function createForm() {\n let form = document.createElement(`form`);\n form.id = `form`;\n document.getElementById(`create-monster`).appendChild(form);\n\n document.getElementById(`form`).appendChild(createInputAndPlaceholder(`input`,`Name`));\n document.getElementById(`form`).appendChild(createInputAndPlaceholder(`input`,`Age`));\n document.getElementById(`form`).appendChild(createInputAndPlaceholder(`input`,`Description`));\n\n let button = document.createElement('button');\n button.innerHTML = `Create`;\n document.getElementById(`form`).appendChild(button);\n\n\n}", "function addFilm() {\n\n // Verify if input are filled with something\n if (!document.getElementById('film').value) {\n\n // Display error message\n document.getElementById('error-message-required').style.display = \"block\";\n\n } else {\n\n // hidde error message\n document.getElementById('error-message-required').style.display = \"none\";\n\n // Push the movie into the movies array\n filmsArr.push(document.getElementById('film').value);\n\n // Clear the input field value\n document.getElementById('film').value = \"\";\n\n // Clear the currently displayed movies to display the new movie\n document.getElementById('filmsList').innerHTML = \"\";\n \n for (let i = 0; i < filmsArr.length; i++) {\n\n // Verify if the filled value is a .jpg\n if (filmsArr[i].endsWith(\".jpg\")) {\n\n // Hidde the error message\n document.getElementById('error-message-url').style.display = \"none\";\n\n // Display the new movie\n document.getElementById('filmsList').innerHTML = document.getElementById('filmsList').innerHTML + \"<div class='col-12 col-md-4 col-lg-3 text-center'><img class='film' src=\" + filmsArr[i] + \"></div\";\n \n } else {\n\n // Display the error message\n document.getElementById('error-message-url').style.display = \"block\";\n \n }\n }\n }\n\n\n}", "function Movie(title, runTime, yearReleased, genre, description) {\n this.title = title;\n this.runTime = runTime;\n this.yearReleased = yearReleased;\n this.genre = genre;\n this.description = description;\n this.checkedIn = true;\n}", "function Movie(dataMovie) {\n this.title = dataMovie.title;\n this.overview = dataMovie.overview;\n this.average_votes = dataMovie.vote_average;\n this.total_votes = dataMovie.vote_count;\n this.image_url = dataMovie.poster_path;\n this.popularity = dataMovie.popularity;\n this.released_on = dataMovie.release_date;\n}", "function saveMovie(movie) {\n if (!movie) return 'No movie to save';\n chrome.storage.sync.set({'movie': movie})\n}" ]
[ "0.7157837", "0.7155326", "0.7067668", "0.7009994", "0.6984904", "0.6712076", "0.6585498", "0.6529115", "0.65018344", "0.6472152", "0.64082736", "0.6357879", "0.6338004", "0.62977815", "0.62845975", "0.62621653", "0.6189075", "0.6172359", "0.61614996", "0.61525935", "0.60904384", "0.60683084", "0.6063795", "0.60524213", "0.6028083", "0.60269725", "0.601072", "0.5987785", "0.59338206", "0.59280515", "0.5922463", "0.5909838", "0.5893958", "0.5885382", "0.58828485", "0.5866588", "0.5866588", "0.5856144", "0.58442235", "0.58357555", "0.58356804", "0.58043355", "0.5798538", "0.5793874", "0.5791553", "0.5785944", "0.57839465", "0.57783735", "0.5769223", "0.57464033", "0.57458776", "0.57368934", "0.571849", "0.56865036", "0.5676376", "0.5671339", "0.56598157", "0.5657286", "0.56496686", "0.5638697", "0.5635042", "0.56187874", "0.5590368", "0.5584488", "0.55814266", "0.5578989", "0.55739015", "0.5572481", "0.55690944", "0.55597174", "0.55451715", "0.55346435", "0.55343586", "0.552343", "0.5515966", "0.5443544", "0.5442677", "0.5441522", "0.5433079", "0.54325056", "0.54072654", "0.5398523", "0.53948504", "0.5386506", "0.5380116", "0.53793263", "0.5366464", "0.5364825", "0.5350996", "0.53446794", "0.53416336", "0.5325332", "0.5318883", "0.5317322", "0.53131235", "0.5302174", "0.52985173", "0.5298154", "0.52967024", "0.52944005" ]
0.60281587
24
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++ write data to db
function db_write(url_query, respond){ // create an array var data_to_write = url_query.replace(/%20/g, " ").split('&'); respond.write("<script>document.getElementById('heading').innerHTML ='DB Add data 2';</script>"); console.log(data_to_write); //add data to db table my_sql_conn.connect(function(err){//doing mysql connection handshake aka test connectability if(err){ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>connection error: "+err+"</p>"); //return respond.end();//ending here } else{ // respond.write("<p>connected to db</p>"); //respond.end();//ending here } //add data to db var mysql_db_data_add ="INSERT INTO movie_table (m_title, m_director, m_producer, m_production_company, m_country, m_actor, m_genre, m_description, m_disclaimer, m_image) VALUES ('"+data_to_write[0]+"','"+data_to_write[1]+"','" +data_to_write[2]+"','" +data_to_write[3]+"','" +data_to_write[4]+"','" +data_to_write[5]+"','" +data_to_write[6]+"','" +data_to_write[7]+"','" +data_to_write[8]+"','" +data_to_write[9]+"')"; console.log(mysql_db_data_add); //connect to existing db my_sql_conn_db.query(mysql_db_data_add, function(err, results){ if(err){ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Data adding err(write to db) "+err+"</p>"); return ;//respond.end();//ending here } else{ respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Data added "+JSON.stringify(results)+"</p>"); return;// respond.end();//ending here } } ); }); //respond.write(url_query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveData(data) {\n const transaction = db.transaction([\"open\"], \"readwrite\");\n\n const store = transaction.objectStore(\"open\");\n\n store.add(data);\n}", "function dbWriteData( query, callback){\n dbCon.query( query, function( error, result){\n if( error) handleError( error);\n else callback( result);\n });\n }", "save() {\n this.db.write();\n }", "function writeDataIntoDB(database) {\n database.save(function (err) {\n if (err) throw err;\n console.log('Write in DB successfully');\n })\n}", "function writeData(name, data){\n return dbPromise\n .then(function(db){\n const tx = db.transaction(name, 'readwrite');\n const store = tx.objectStore(name);\n store.put(data);\n \n return tx.complete;\n });\n}", "write() {\n const statement = this.dbConnector.statements.set(this.params, this.writeBuffer);\n this.dbConnector.query(statement, this.onWriteResult.bind(this), [], true);\n }", "function writeData(st,data){\n return dbPromise\n .then(function(db){\n //here we are creating a transaction i.e setting the property where first one is the name of the store in IndexedDB while second one is type of that is \"read-write\" in this\n //here \"st\"-> is the store where we want to store data (EX-> posts)\n var tx = db.transaction(st,\"readwrite\");\n //opening the store via the transaction \"tx\" to give read-write property to the store\n var store = tx.objectStore(st);\n //to store the data in the store and the key is the one we added up in the begining \"id\" to actually store the data\n store.put(data);\n //to complete the transaction(this is performed only on write operations)\n return tx.complete;\n })\n }", "writeData( key, data ) {\n\t\tBdApi.saveData( this.getShortName(), key, data );\n\t}", "function WriteDB(the_record){\n connection.query('select count(id) from record', function (error, results, fields) {\n if (error) throw error\n var num = results[0]['count(id)'];\n var t1 = new Date();\n var time = t1.getFullYear() * 10000 + (t1.getMonth()+1)*100 + t1.getDate();\n\n connection.query(`INSERT INTO record(lineId, id, time) VALUES (\"${the_record.id}\", ${num}, ${time});`);\n connection.query(`INSERT INTO location(id, lat, lng, statu, address) VALUES (${num}, ${the_record.lat}, ${the_record.lon}, '0', '${the_record.address}');`);\n UploadFolder(oAuth2Client, num.toString(), num, the_record);\n })\n}", "function write(dbData) {\n\tfs.writeFileSync('db/db.json', JSON.stringify(dbData), 'utf-8');\n}", "function write_in_db (internal_data) {\n database.collection(\"people_presence_db\").insertOne(internal_data, function(err,res) {\n if(err) throw err;\n //console.log(res.connection)\n //console.log(res.ops)\n //client.close();\n })\n }", "function data_write(mydata) {\n\n const pool = mysql.createPool({\n host: process.env.RDS_HOSTNAME,\n user: process.env.RDS_USERNAME,\n password: process.env.RDS_PASSWORD,\n port: process.env.RDS_PORT,\n database: process.env.RDS_DATABASE\n });\n\n var id = convert_value(mydata.id,'qs');\n var siteid = convert_value(mydata.site_id,'s');\n var site = convert_value(mydata.site); \n var location = convert_value(mydata.address);\n var timestamp = Date.now();\n var latitude = mydata.latitude;\n var longitude = mydata.longitude;\n var temperature = mydata.temperature;\n var humidity = mydata.humidity;\n var pressure = mydata.pressure;\n var co2 = mydata.co2;\n var lpg = mydata.lpg;\n var registers = \"INSERT INTO SENSORS (id,\" +\n \"timestamp,\" +\n \"temperature,\" +\n \"humidity,\" +\n \"pressure,\" +\n \"lpg,\" +\n \"co2,\" +\n \"latitude,\" +\n \"longitude,\" +\n \"siteid,\" +\n \"site,\" +\n \"location)\" +\n \"VALUES (?,?,?,?,?,?,?,?,?,?,?,?)\";\n \n // Insert values in the database of MySQL \n context.callbackWaitsForEmptyEventLoop = false;\n pool.getConnection(function(error, connection) {\n connection.query(registers,\n [id,\n timestamp,\n temperature,\n humidity,\n pressure,\n lpg,\n co2,\n latitude,\n longitude,\n siteid,\n site,\n location],\n function(error, results, fields) {\n connection.release();\n if (error) {\n callback(error);\n } else {\n callback(null, results);\n console.log(null,results);\n }\n }); \n });\n }", "function writeData(storeName, data){\n\treturn dbPromise.\n\t then(function(db){\n\t var tx = db.transaction(storeName, 'readwrite'); //creating a transaction using name of store and type of operation\n\t var store = tx.objectStore(storeName); //opening the store\n\t store.put(data);\n\t return tx.complete;\t//necessary for write operations\n\t }); \n}", "function writeFileContent(data) {\n console.log(\"Write file data to db\");\n\n FileData.find({})\n .exec(function (err, fileData) {\n if (err) {\n console.log(err);\n } else {\n if (fileData.length == 0) {\n //save file data into db\n var newFileData = new FileData()\n\n newFileData.data = data\n\n newFileData.save(function (err) {\n if (err) {\n console.log(err);\n }\n })\n }\n else {\n //update file data into db\n FileData.update({}, {\n $set: {\n data: data\n }\n },\n {\n new: true\n },\n function (err, updatedDetails) {\n if (err) {\n console.log(err);\n }\n });\n }\n }\n });\n}", "save(data) {\n this.db.save(data);\n }", "function writeData(data) {\n // Write data to database\n earnings.writePoints(data, {\n database: dbName,\n precision: 's',\n })\n .catch(error => {\n console.error(`Error saving data to InfluxDB! ${error}`)\n })\n}", "function saveToDatabase() {\n idb.add(dbKeys.stations, JSON.stringify(stationList));\n idb.add(dbKeys.lastFrequency, lastFrequency);\n }", "save() {\n this.db._write(this.data);\n return this.db;\n }", "storeData(jsonData) {\n fs.writeFileSync(dbPath, JSON.stringify(jsonData));\n }", "function storeDataInDatabase(surveyId, controlId, value, db) {\n\tvar query = \"INSERT INTO surveyData('surveyId','controId','value') \"\n\t\t\t\t+\"VALUES ('\"+surveyId+\"','\"+controlId+\"','\"+value+\"')\";\n\tdb.transaction(\n\t\tfunction (tx) {\n\t\t\ttx.executeSql(query, [],successMsg ,onError);\n\t\t});\n}", "function addLevelDBData(key,value){\n console.log('Add data to level db ' + key + ' value ' + value);\n db.put(key, value, function(err) {\n if (err) return `Block ${key} submission failed: ${err}`;\n })\n}", "function writeOneRecord() {\n var conn = Jdbc.getCloudSqlConnection(dbUrl, user, userPwd);\n\n var stmt = conn.prepareStatement('INSERT INTO entries ' +\n '(guestName, content) values (?, ?)');\n stmt.setString(1, 'First Guest');\n stmt.setString(2, 'Hello, world');\n stmt.execute();\n}", "function writeToDB() {\n\tvar pos = markerPos(); //return pos of marker in the markers array\n\tvar spawn = require(\"child_process\").spawn; //spawns a childs proc.\n\tvar child = spawn('python',[\"userInterface/py/updateDB.py\", new_lat, new_lng, pos]); //calls a python script with parameters\n}", "function addLevelDBData(key,value){\n db.put(key, value, function(err) {\n if (err) return console.log('Block ' + key + ' submission failed', err);\n })\n}", "function addLevelDBData(key,value){\n db.put(key, value, function(err) {\n if (err) return console.log('Block ' + key + ' submission failed', err);\n })\n}", "saveDB() {\n const dbpath = path.join(__dirname, \"../db/data.json\");\n fs.writeFileSync(dbpath, JSON.stringify(this.toJson));\n }", "function addDataIndexedDb(dataJson){\n var date = dataJson.date;\n var description = dataJson.description;\n var value = dataJson.value;\n \n var transaction = db.transaction([constDbObject],\"readwrite\");\n transaction.oncomplete = function(event) {\n console.log(\"Sucesso :)\");\n };\n transaction.onerror = function(event) {\n console.log(\"Erro :(\");\n };\n\n var objectStore = transaction.objectStore(constDbObject);\n objectStore.add({date:date, description:description, value:value});\n}", "function saveDataIntoDB(url) {\n // Feed the database\n var dbObj = getEntityCustomData('infoKey', dataBaseID, null);\n if(dbObj) {\n var myName = MyAvatar.displayName ? MyAvatar.displayName : \"Anonymous\";\n dbObj.dbKey[dbObj.dbKey.length] = {name: myName, score: scoreAssigned, clip_url: url};\n setEntityCustomData('infoKey', dataBaseID, dbObj);\n print(\"Feeded DB: \" + url);\n }\n }", "function saveToDataBase(data) {\n console.log(data);\n}", "function writeUserData(date, meal, location, food) {\n firebase.database().ref(`masterData`).push().set({\n date : date,\n meal : meal,\n location : location,\n food : food\n });\n document.write(\"Successfully wrote \" + food + \" to master db\")\n}", "function addLevelDBData(key,value){\n db.put(key, value, function(err) {\n if (err) {\n return ('Block ' + key + ' submission failed', err);\n // reject('error in addLevelDBData')\n\n }else{\n // getLevelDBData(key);\n }\n \n \n })\n \n \n }", "async save() {\n const priv = privates.get(this);\n const tableName = priv.get(\"tableName\");\n if (tableName) {\n const formData = new FormData(this.form);\n if (formData.get(\"saveDetails\") !== \"on\") {\n return;\n }\n const dataToSave = Object.assign({}, this.data, this.toObject());\n if (!db.isOpen()) {\n await db.open();\n }\n await db[tableName].put(dataToSave);\n this.data = dataToSave;\n }\n }", "function updateDb() {\n fs.writeFile(\"db/db.json\",JSON.stringify(notes,'\\t'),err => {\n if (err) throw err;\n return true;\n });\n }", "function updateDb() {\n fs.writeFile(\"db/db.json\",JSON.stringify(notes,'\\t'),err => {\n if (err) throw err;\n return true;\n });\n }", "function saveDatabase(newData) {\r\n return fs.writeFileSync(path.join(__dirname, \"../../db/db.json\"), JSON.stringify(newData))\r\n}", "function setDBData(addSql, addSqlParams){\n // var addSql = 'users(name, account, password) VALUES(?,?,?)';\n // var addSqlParams = [name, account,password];\n connection.query('INSERT INTO ' + addSql,addSqlParams,function (err, results) {\n if(err){\n console.log('[INSERT ERROR] - ',err.message);\n return;\n } \n \n console.log('--------------------------INSERT----------------------------');\n console.log('INSERT ID:',results); \n console.log('-----------------------------------------------------------------\\n'); \n });\n // connection.release();\n}", "guardarDB (){\n const payload ={\n historial: this.historial\n };\n\n fs.writeFileSync(this.dbPath, JSON.stringify(payload));\n\n }", "function updateDb() {\n fs.writeFile(\"./db/db.json\", JSON.stringify(notes), (err, data) => {\n if (err) throw err;\n return true;\n });\n }", "function writeRecord(db, table, data, key) {\n var $def = $.Deferred();\n try {\n var transaction = db.transaction([table], 'readwrite'),\n store = transaction.objectStore(table);\n\n transaction.onerror = function(e) {\n $def.reject('image write failed');\n };\n transaction.onabort = function(e) {\n var error = event.target.error; // DOMError\n if (error.name == 'QuotaExceededError') {\n // Fallback code comes here\n logEvent('offline', 'quota exceeded')\n }\n $def.reject(error.name);\n }\n transaction.oncomplete = function(event) {\n $def.resolve(key);\n };\n if (key) {\n store.put(data, key);\n } else {\n store.put(data);\n }\n } catch(e) {\n $def.reject('write exception');\n }\n return $def;\n }", "function awsDBwrite(uuid, thumb, titleEN, bodyEN, keysEN, titleFR, bodyFR, keysFR, topicCat) {\n\t//Insert a new content table row for the FGP entry\n\t\n\tcon.query('INSERT INTO fgpwp_content (uuid, thumbnailURL, titleEN, bodyEN, keywordsEN, titleFR, bodyFR, keywordsFR, topic) VALUES (\"'+uuid+'\", \"'+thumb+'\", \"'+titleEN+'\", \"'+bodyEN+'\", \"'+keysEN+'\", \"'+titleFR+'\", \"'+bodyFR+'\", \"'+keysFR+'\", \"'+topicCat+'\")');\n}", "addItems() {\n let id = 0;\n let name = \"\";\n let amount = 0;\n let datecreated = \"\";\n let status = \"\";\n let type = \"\";\n\n db.transaction(async function(d) {\n\n console.log(data);\n data.forEach(e => {\n id = e.id;\n name = e.name;\n amount = e.amount;\n datecreated = e.date;\n status = e.status;\n type = e.type;\n\n d.executeSql('INSERT INTO activities (id,name, amount, datecreated, status, type) VALUES (?,?,?,?,?,?)', [id, name, amount, datecreated, status, type]);\n\n });\n });\n }", "function updateDb() {\n fs.writeFile(\"db/db.json\", JSON.stringify(notes, \"\\t\"), (err) => {\n if (err) throw err;\n return true;\n });\n }", "function saveData(data) {\n fs.writeFileSync(TASK_STORAGE_PATH, JSON.stringify(data));\n console.log(`Saved to database.`)\n list();\n}", "function saveData(stream, sqlString)\n{\n stream.write(sqlString);\n}", "function insertNewData(){\n let datSave = {\n \"line\":1,\n \"machines\":[{\"id\":1,\"name\":\"oven 01\"},{\"id\":2,\"name\":\"creamer 01\"}],\n \"webserviceurl\":\"http://mv-webservice.test\",\n \"machid\": '2001'\n }\n\n db.insert(datSave, function(err, newDocs){\n\n });\n}", "function saveSauvegarde(id,nbCoupe,aireAtteinte,temps,score) {\n // création d'un objet contenant les données\n // il sert d'\"enregistrement\" dans la base\n var sauvegarde = {\n\t\tid:id,\n nbCoupe: nbCoupe,\n aireMinimaleAtteinte: aireAtteinte,\n\t\ttemps:temps,\n\t\tscore:score\n }\n\n // on ouvre la base, et on déclare les listeners\n var request = indexedDB.open(\"spacelash2\", 1);\n request.onerror = errorOpen;\n request.onupgradeneeded = createDatabase;\n\n request.onsuccess = function(event) {\n // ici la base a été ouverte avec succés, il faut ajouter l'enregistrement\n\n // on récupère l'objet database\n var db = event.target.result; \n\n // on ouvre une transaction qui permettra d'effectuer\n // les opérations sur la base\n var transaction = db.transaction([\"sauvegarde\"], \"readwrite\");\n transaction.oncomplete = function(event) {\n \n \n };\n\n transaction.onerror = function(event) {\n window.alert('erreur de transaction ');\n };\n\n // on récupère l'object store dans lequel on veut stocker l'objet\n var sauvegardeStore = transaction.objectStore(\"sauvegarde\");\n\n // on créé l'ordre d'ajouter un enregistrement\n // sera effectivement executé lors de la fermeture de la transaction\n var req = sauvegardeStore.put(sauvegarde);\n req.onsuccess = function(event) {\n \n }\n req.onerror = function(event) {\n window.alert('erreur ajout');\n }\n }\n}", "function insert_products(data){\n var number = data['name'];\n var num = \"\"; \n for (var i = 0; i < number.length ; i++) {\n if (i > 5){\n num += number[i];\n }\n }\n\n var products = get_products(data);\n var filebuffer = fs.readFileSync('orders_tpv.db');\n var db = new sqlite3.Database(filebuffer);\n sqlstr = \"INSERT INTO products (name_product, quantity, price, order_id) VALUES (:name_product, :quantity, :price, :order_id);\";\n\n for (var j in products){\n db.run(sqlstr, {':name_product': products[j]['orderlines['+j+'][product_name]'],\n ':quantity': products[j]['orderlines['+j+'][quantity]'],\n ':price': products[j]['orderlines['+j+'][price]'],\n ':order_id': num});\n }\n \n var data = db.export();\n var buffer = new Buffer(data);\n fs.writeFileSync(\"orders_tpv.db\", buffer);\n db.close();\n}", "function writeDateData(date) {\n firebase.database().ref(`dateData`).push().set({\n date : date\n });\n document.write(\"Successfully wrote \" + date + \" to date db\")\n}", "function put(data, callback) {\n if(typeof data == 'string')data = eval('('+data+')');\n if (typeof data == 'object') {\n // Batch put\n if(typeof data.length == 'number') {\n var i = 0;\n for(i in data)data[i].type = 'put';\n db.batch(data, function(err) {\n if (err) return console.log('Put operation failed! :', err)\n console.log('Batch put create success');\n if(callback)callback();\n }); \n }\n // Put\n else\n {\n db.put(data.key, data.value, function(err) {\n if (err) return console.log('Put operation failed! :', err)\n console.log('put(\"'+ data.key +'\", \"'+ data.value +'\") success');\n if(callback)callback();\n }); \n } \n }\n}", "addLevelDBData(key,value){\n\n return db.put(key, value , function(err){\n if(err)\n console.log(\"submission failed\")\n });\n \n}", "addLevelDBData(key,value){\n return new Promise((resolve, reject)=>{\n db.batch()\n .put(HEIGHT_KEY, key)\n .put(key, JSON.stringify(value))\n .write(function(err) {\n if (err) {\n console.log('Block ' + key + ' submission failed', err);\n reject(err);\n } else {\n resolve();\n }\n });\n\n });\n }", "function putEntry(data) {\n db.get(\"data_entries_point\").push(data).write();\n}", "async function writeToDB(content) {\n try {\n await fs.writeFileSync(path.join(__dirname, '../../db/db.json'), JSON.stringify(content));\n } catch(err) {\n console.log('Could not write to file :(' + err); \n }\n}", "function writeData(req, res){\n try {\n let input = req.body //Capture the query in the request\n\n DataPoint.remove({});\n\n if (!req.body.meetdata) req.body.meetdata = generateMockData();\n\n //Turned the next limit off for testing purposes TODO: turn it on again to reasonable limit\n //if (req.headers['content-length'] > 100 || req.url.length > 5000) {throw 'Request too large to process'};\n if (!input.meetsysteemId) {throw 'No device id provided'}\n if (!input.status) {throw 'No status provided in message'}\n if (isNaN(Number(input.status))) {throw 'Provided status is not a number'}\n if (!input.meetdata) {throw 'No data provided in message'}\n\n const dataPoints = input.meetdata.split(';').map(dp => {\n const dateString = dp.substr(0, 6);\n const date = moment(dateString, \"DDMMYY\").format();\n\n return {\n deviceId: input.meetsysteemId,\n date: new Date(date),\n status: input.status,\n metrics: dp\n }\n })\n\n DataPoint.insertMany(dataPoints, function(error, docs) {\n if (error) {\n console.error('Insert into db failed', err);\n }\n else {\n res.status(200)\n res.send(docs.length + \" docs succesfully inserted into db\")\n }\n });\n }\n catch(e){\n console.log(\"Client didn't provde the right arguments for the request\", e)\n res.status(406)\n res.send(e)\n }\n}", "save() {\n let columns = Object.keys(this.data);\n let sql;\n // build sql string\n if (this.data[this.primaryKey]) {\n sql = Squel.update().table(this.table);\n } else {\n sql = Squel.insert().into(this.table);\n }\n\n columns.map( (column) => {\n // ignore primary key column\n if (column != this.primaryKey) {\n let value = this.data[column];\n sql.set(column, value);\n }\n });\n\n // update mode: set where condition\n if (this.data[this.primaryKey])\n sql.where(`${this.primaryKey} = ${this.data[this.primaryKey]}`);\n\n // execute sql\n sql = sql.toString();\n\n return new Promise( (resolve, reject) => {\n getSQLiteDB(this.table).executeSql(sql, [], (results) => {\n // update model's primaryKey on insertId\n if (results.insertId && !this.data[this.primaryKey])\n this.data[this.primaryKey] = results.insertId;\n\n resolve(true);\n });\n });\n }", "function writeData(Head, details) {\n firebase.database().ref(Head).set({ details });\n }", "guardarDB() {\n fs.writeFileSync(this.dbPath, JSON.stringify(this.historial));\n }", "function WriteUserToDB() {\n var newRef;\n switch (mode) {\n case 1:\n newRef = ref.push({\n phonenumber: \"\",\n id: \"\",\n email_address: user.email_address,\n email: user.email,\n sms: user.sms,\n whatsapp: user.whatsapp,\n setting_key: settingkey2,\n });\n break;\n case 2:\n newRef = ref.push({\n phonenumber: user.phonenumber,\n id: \"\",\n email_address: \"\",\n email: 0,\n sms: user.sms,\n whatsapp: user.whatsapp,\n setting_key: settingkey2,\n });\n break;\n }\n // Add Key to Entry\n var newID = newRef.key;\n newRef.update({\n id: newID\n })\n }", "function insert_orders(data){\n var number = data['name'];\n var num = \"\"; \n for (var i = 0; i < number.length ; i++) {\n if (i > 5){\n num += number[i];\n }\n }\n\n var day = format_date(data['date[date]']);\n var month = (parseInt(data['date[month]'])+1).toString();\n month = format_date(month);\n\n date_sale = day + \"/\" + month + \"/\" + data['date[year]'];\n hour = data['date[hour]'] + \":\" + data['date[minute]']\n var filebuffer = fs.readFileSync('orders_tpv.db');\n var db = new sqlite3.Database(filebuffer);\n sqlstr = \"INSERT INTO orders (num_order, total, paid, user, total_paid, change, date, hour) VALUES (:order, :total, :paid, :user, :total_paid, :change, :date, :hour);\";\n db.run(sqlstr, {':order': num, ':total': data['total_with_tax'], ':paid': data['paymentlines[0][journal]'],\n ':user': data['cashier'], ':total_paid': data['total_paid'], ':change': data['change'], ':date': date_sale, ':hour': hour});\n var data = db.export();\n var buffer = new Buffer(data);\n fs.writeFileSync(\"orders_tpv.db\", buffer);\n db.close();\n}", "function insertToDB(firstName, lastName, email, education, opleidingsInstelling, know, jeBericht, ervaring, date) {\r\n // open database\r\n var db = new sqlite3.Database('admissions.db', (err) => {\r\n if (err) {\r\n return console.error(err.message);\r\n }\r\n });\r\n\r\n // create table for storage\r\n db.run('CREATE TABLE IF NOT EXISTS test (firstName TEXT, lastName TEXT, email TEXT, education TEXT, opleidingsInstelling TEXT, know TEXT, jeBericht TEXT, ervaring TEXT, date TEXT)');\r\n\r\n // insert one row into the test table\r\n db.run(`INSERT INTO test (firstName, lastName, email, education, opleidingsInstelling, know, jeBericht, ervaring, date) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`, [firstName, lastName, email, education, opleidingsInstelling, know, jeBericht, ervaring, date], function(err) {\r\n if (err) {\r\n return console.log(err.message);\r\n }\r\n });\r\n\r\n\r\n // close database\r\n db.close((err) => {\r\n if (err) {\r\n return console.error(err.message);\r\n }\r\n });\r\n}", "write(info) {\n return writeToFile('./db/db.json', JSON.stringify(info));\n }", "function writeFile() {\r\n if (!'indexedDB' in window) {\r\n console.log(\" your browser doesnt support indexDB\");\r\n // return;\r\n }\r\n const databaseName = \"TextEditorDB\";\r\n const DBname = window.indexedDB.open(databaseName);\r\n DBname.onupgradeneeded = () => {\r\n let db = DBname.result;\r\n let store = db.createObjectStore(\"Files\", { autoIncrement: true });\r\n // put method\r\n store.put({ name: \"file1\", format: \"text\" });\r\n }\r\n DBname.onsuccess = () => {\r\n if (DBname.readyState == \"done\") {\r\n console.log(\"Data is successfully loaded\");\r\n }\r\n }\r\n}", "function updateNoteDb() {\n fs.writeFile(\"db/db.json\",JSON.stringify(notes,'\\t'),err => {\n if (err) throw err;\n return true;\n });\n}", "function writeToDB(file1, songName) {\n var transaction = db.transaction([\"audioFiles\"], \"readwrite\");\n var store = transaction.objectStore(\"audioFiles\");\n console.log(file1);\n var request = store.add(file1, songName);\n\n }", "function saveData(conn,callback){\n sampleEmployee.save(function(err){\n callback(err,conn);\n });\n\n}", "function addDataToLevelDB(value) {\n let i = 0;\n db.createReadStream().on('data', function(data) {\n i++;\n }).on('error', function(err) {\n return console.log('Unable to read data stream!', err)\n }).on('close', function() {\n console.log('Block #' + i);\n addLevelDBData(i, value);\n });\n }", "function addData(question,answer,option1,option2,option3,table){ \n\tvar createSql=\"create table if not exists \"+table+\"(question text,answer text,option1 text,option2 text,option3 text)\";\n\tvar insertSql=\"insert into \"+table+\" values(?,?,?,?,?)\";\n\n db.transaction(function(tx)\n\t{ \t\n\t \ttx.executeSql(createSql,[])\n\t\ttx.executeSql(insertSql,[question,answer,option1,option2,option3],onSuccess,onError)\t\t\n }); \n}", "saveItem(event, data) {\n data = convertToLowerCase(data);\n itemsDB.insert(data, (err, newDoc) => {\n yearsDB.find({}, (err, docs) => {\n docs.forEach(doc => {\n let setupData = {\n item: newDoc._id,\n year: doc._id,\n rent: 1,\n avakHammali: 1,\n javakHammali: 1\n };\n setupsDB.insert(setupData, (err, newDoc) => {\n let response = {};\n response.error = err;\n this.mainWindow.webContents.send('saveItemResponse', response);\n });\n });\n });\n });\n }", "function saveWatchlistData(itemData) {\r\n setDatabaseName('dbCat', ['users', 'items', 'categories', 'subcategories ', 'events', 'watchlist']);\r\n setCurrObjectStoreName('watchlist');\r\n startDB(function () {\r\n //format of table\r\n var data = {\r\n 'itemName': itemData.itemName,\r\n 'itemDesc': itemData.itemDesc,\r\n 'itemPrice': itemData.itemPrice,\r\n 'itemSubcategory': itemData.itemSubcategory,\r\n 'itemImage': itemData.itemImage\r\n };\r\n\r\n //saves new item in watchlist table\r\n insertOne(data, function (lastID) {\r\n event.preventDefault();\r\n console.log(\"saveWatchlistData lastID:\" + lastID);\r\n return false;\r\n });\r\n });\r\n}", "function bulkInsert(data, cb){\n db.Workout.bulkWrite(data)\n .then(dbTransaction => {\n cb(dbTransaction);\n })\n .catch(err => {\n cb((err));\n });\n}", "function write_in_db()\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"Event idd: \", event_id);\n\n\t\t\t\t\t\t\t\t\t\t\tvar email = user_data.email;\n\t\t\t\t\t\t\t\t\t\t\tvar name = user_data.name;\n\t\t\t\t\t\t\t\t\t\t\tvar contact = user_data.contact;\n\t\t\t\t\t\t\t\t\t\t\tvar lati = user_data.lati;\n\t\t\t\t\t\t\t\t\t\t\tvar longi = user_data.longi;\n\t\t\t\t\t\t\t\t\t\t\tvar time = new Date();\n\t\t\t\t\t\t\t\t\t\t\tvar amb_id = best_ambulance_id;\n\t\t\t\t\t\t\t\t\t\t\tvar beingServed = true;\n\n\t\t\t\t\t\t\t\t\t\t\tvar json_object = {\n\t\t\t\t\t\t\t\t\t\t\t\teventId: event_id,\n\t\t\t\t\t\t\t\t\t\t\t\temail: email,\n\t\t\t\t\t\t\t\t\t\t\t\tname: name,\n\t\t\t\t\t\t\t\t\t\t\t\tcontact: contact,\n\t\t\t\t\t\t\t\t\t\t\t\tlati: lati,\n\t\t\t\t\t\t\t\t\t\t\t\tlongi: longi,\n\t\t\t\t\t\t\t\t\t\t\t\ttime: time,\n\t\t\t\t\t\t\t\t\t\t\t\tamb_id: amb_id,\n\t\t\t\t\t\t\t\t\t\t\t\tbeingServed: beingServed\n\t\t\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\t\t\tcoll_users.insert(json_object);\n\n\t\t\t\t\t\t\t\t\t\t\tcoll_ambulances.update( { _id: best_ambulance_id },{ $set: {isServing: true, eventId: event_id} } );\n// Send Push Notification ########################################################################################################################################\n\n\t\t\t\t\t\t\t\t\t\t\tvar message_tuple = {\n\t\t\t\t\t\t\t\t\t\t\t\tname: name, contact:contact, lati:lati, longi:longi\n\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tvar request = require('request');\n\t\t\t\t\t\t\t\t\t\t\tvar send_data = {\n\t\t\t\t\t\t\t\t\t\t\t message : message_tuple, regId: best_ambulance_id\n\t\t\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\t\t\trequest({url:\"http://172.16.100.139/btp/send_message.php\", qs:send_data}, function(err, response, body) {\n\t\t\t\t\t\t\t\t\t\t\t if(err) { console.log(err); return; }\n\t\t\t\t\t\t\t\t\t\t\t console.log(\"Get response: \" + response.statusCode);\n\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\tclose_all();\n\t\t\t\t\t\t\t\t\t\t}", "save() {\n\t\treturn this.db2data().then(()=>AppData.saveCollection(this.path, this.data))\n\t}", "async function saveData(data) {\n\tfor (let countryData of data) {\n\t\t// check that country is not yet exists\n\t\tlet sql = `SELECT id FROM country WHERE id = ?`;\n\t\tconst countries = await db.query(sql, [countryData.id]);\n\t\t// if there is no such country then save it to DB\n\t\tif (countries.length == 0) {\n\t\t\tsql = `INSERT INTO country SET ?`;\n\t\t\tconst data = {\n\t\t\t\tid: countryData.id,\n\t\t\t\tshort_name: countryData.extra ? countryData.extra.fifa : null,\n\t\t\t\tfull_name: countryData.name,\n\t\t\t\t// TODO: fix\n\t\t\t\t// flag_svg: countryData.extra.flag\n\t\t\t}\n\t\t\tawait (db.query(sql, data));\n\t\t}\n\t}\n}", "function saveTempDataToFirebase(data) {\n db.ref('sensordatatemp/').push({\n mmac: ESP32USERS_ARRAY.indexOf(clientID), //You could add an ekstra variable to every dataFromBoard transmission with a microcontrollerID to lessen the need for authentication\n data: data, //This would be the sensor data, eg a temperature datapoint\n ip_address: IPArr[3] //What is the IP-address of the unit that logged the data\n }).then((snap) => { //When the data has been successfully saved\n console.log(\"Sensordata was saved\");\n });\n }", "function writeToFile(data) {\n try {\n return fs.writeFileSync(\"./db/db.json\", JSON.stringify(data));\n }\n catch {\n return console.log(\"db.json failed.\");\n }\n}", "function saveData() {\n const transaction = db.transaction([\"transactions\"], \"readwrite\");\n const transactionStore = transaction.objectStore(\"transactions\");\n const allData = transactionStore.getAll();\n\n allData.onsuccess = () => {\n if (allData.result.length > 0) {\n fetch(\"/api/transaction/bulk\", {\n method: \"POST\",\n body: JSON.stringify(allData.result),\n headers: {\n Accept: \"application/json, text/plain, */*\",\n \"Content-Type\": \"application/json\",\n },\n })\n .then((response) => {\n return response.json();\n })\n .then(() => {\n const transaction = db.transaction(\n [\"transactions\"],\n \"readwrite\"\n );\n const transactionStore =\n transaction.objectStore(\"transactions\");\n transactionStore.clear();\n });\n }\n };\n}", "function writeDB(type){\n fs.writeFile(\"db/db.json\",JSON.stringify(notes,'\\t'),err => {\n if (err) throw err;\n return true;\n });\n\n return console.log(`note ${type}`);\n }", "function saveDB (file) {\n\n\t// Get file contents\n var source = fs.readFileSync(file. source, 'utf8')\n var source = source.substr(1) // FIX ÿ issue\n\n // Save outputs\n file.output.forEach(function (output) {\n\n\t\t// Connect to database\n\t\tvar connection = new tedious.Connection({\n\t\t userName: config.database.username,\n\t\t password: config.database.password,\n\t\t server : config.database.server,\n\t\t options : {\n\t\t instanceName: config.database.instance,\n\t\t databaseName: config.database.database\n\t\t }\n\t\t})\n\n var query = \" UPDATE \" + argv.table\n + \" SET ReporteSecundario = @file\"\n + \" WHERE NombreReporteOriginal = @name\"\n\n\n // Configure request\n var request = new tedious.Request(query, function (err) {\n if (!!err) return console.error(err)\n \tconnection.close();\n console.log('-> Updated', output)\n })\n\n request.addParameter('name', tedious.TYPES.VarChar, output)\n request.addParameter('file', tedious.TYPES.VarChar, source)\n\n // Execute Query\n connection.on('connect', function (err) {\n\t\t if (!!err) throw err\n \tconnection.execSql(request)\n\t\t})\n })\n\n\n\t\n\n}", "async function dbWrite(path, data) {\n const url = `https://${config.firebaseID}.firebaseio.com/${path}.json?auth=${config.firebaseSecret}`;\n try {\n const res = await axios.put(url, data)\n return res.data;\n } catch (err) {\n console.log(err.response);\n return null;\n }\n}", "function addStudentInDatabase() {\n const roll = document.getElementById(\"add_roll\").value;\n const name = document.getElementById(\"add_name\").value;\n const department = document.getElementById(\"add_department\").value;\n const year = document.getElementById(\"add_year\").value;\n const semester = document.getElementById(\"add_semester\").value;\n\n const addStudentInfo = {\n Roll: roll,\n Name: name,\n Department: department,\n Year: year,\n Semester: semester\n };\n\n const tx = db.transaction(\"StudentTable\", \"readwrite\");\n const studentInfo = tx.objectStore(\"StudentTable\");\n studentInfo.add(addStudentInfo);\n}", "function saveRecord(isAdding) {\n\n let nameEl = JSON.stringify(document.querySelector(\"#t-name\").value);\n let amountEl = document.querySelector(\"#t-amount\").value;\n\n if (!isAdding) {\n amountEl *= -1;\n }\n\n let amountString = JSON.stringify(amountEl);\n\n let transactionObject = [ { name: nameEl, value: amountString, date: new Date().toISOString() } ]\n\n const transaction = db.transaction(['transactions'], 'readwrite'); // Create transaction\n const table = transaction.objectStore('transactions'); // Access table\n table.add(transactionObject); // Add data to table\n}", "function writeData() {\n var thesis = db.collection(\"thesis\");\n\n thesis.doc(\"1\").set({\n title: \"Klima\",\n thesis: \"Frankfurt soll bis 2035 klimaneutral werden. Dazu sollen schon bis 2030 der öffentliche Nahverkehr, die städtischen Gebäude und die Stadtverwaltung komplett auf erneuerbare Energien umgestellt werden.\",\n });\n thesis.doc(\"2\").set({\n title: \"Klima\",\n thesis: \"Um die Folgen des Klimawandels im städtischen Raum zu lindern, soll in Frankfurt die Entsiegelung von städtischen Plätzen, Schulhöfen und anderen öffentlichen Räumen vorangetrieben werden. Durch das Pflanzen von großkronigen Bäumen im Straßenraum und andere Maßnahmen soll die Klimawandelanpassung zusätzlich unterstützt werden.\",\n });\n thesis.doc(\"3\").set({\n title: \"Klima\",\n thesis: \"Frankfurt soll in Parks und Grünanlagen, aber auch in Einkaufsstraßen und an Knotenpunkten des öffentlichen Nahverkehrs, Trinkbrunnen aufstellen, damit sich Bürger*innen in den immer heißer werdenden Sommern kostenlos mit Trinkwasser versorgen können.\",\n });\n thesis.doc(\"4\").set({\n title: \"Verkehr\",\n thesis: \"Frankfurt soll bei der Verkehrsplanung konsequent den ÖPNV, den Rad- und Fußverkehr ins Zentrum rücken. Fuß- und Radverkehr sollen künftig mehr, der ruhende Verkehr durch geparkte Fahrzeuge deutlich weniger Platz beanspruchen. Damit soll das Ziel einer klimaneutralen Stadt erreicht und gleichzeitig die Lebensqualität in der Stadt deutlich erhöht werden.\",\n });\n thesis.doc(\"5\").set({\n title: \"Verkehr\",\n thesis: \"Senior*innen über 75 Jahren, Frankfurt-Pass-Inhaber*innen und alle Schüler*innen sollen den ÖPNV in Frankfurt kostenlos nutzen können.\",\n });\n thesis.doc(\"6\").set({\n title: \"Verkehr\",\n thesis: \"Der Mainkai soll wieder autofrei sein. Er soll Grünräume, Spielflächen, Platz für Kunst und Kultur, sowie Raum für Begegnungen erhalten.\",\n });\n thesis.doc(\"7\").set({\n title: \"Bildung\",\n thesis: \"Neben der baulichen Sanierung der Schulen soll Frankfurt auch in die Digitalisierung der Schulen investieren - nicht nur in Infrastruktur und Geräte sondern in Koordinierung mit den zuständigen Stellen auf Landesebene auch in Fachkräfte und pädagogische Angebote zur Medienbildung. Die Corona-Pandemie hat deutlich gemacht, wie groß hier der Nachholbedarf ist.\",\n });\n thesis.doc(\"8\").set({\n title: \"Frauen\",\n thesis: \"In Frankfurter Unternehmen soll Transparenz darüber herrschen, wie die Führungspositionen zwischen Männern und Frauen verteilt sind. Über eine Frauenquote soll wirkliche Gleichberechtigung durchgesetzt werden.\",\n });\n thesis.doc(\"9\").set({\n title: \"Kultur\",\n thesis: \"Alle Menschen sollen Zugang zu Kunst und Kultur haben. Um dieses Ziel zu erreichen, sollen Kinder sehr früh an Kultur beteiligt werden. Dafür soll die Zusammenarbeit zwischen Kulturschaffenden einerseits und Kinderbetreuungseinrichtungen und Schulen andererseits gezielt gefördert werden.\",\n });\n thesis.doc(\"10\").set({\n title: \"Stadtplanung und Wohnen\",\n thesis: \"In Frankfurt sollen öffentliche und private Träger von Wohnungsbau bei jedem Bauvorhaben 60% sozialen bzw. preisgebundenen Wohnungsbau (in Form von Sozialwohnungen und Wohnungen für das sog. Frankfurter Mittelstandsprogramm) und 20% gemeinschaftliche und genossenschaftliche Wohnprojekte realisieren. \",\n });\n thesis.doc(\"11\").set({\n title: \"Vielfältigkeit\",\n thesis: \"Frankfurt soll sich dafür einsetzen, die Themen Rassismus und Diskriminierung in der Polizeiausbildung zu stärken, entsprechende Schulungen für alle Polizist*innen verpflichtend zu machen und den Anteil der Menschen mit sogenanntem Migrationshintergrund bei der Polizei zu erhöhen.\",\n });\n thesis.doc(\"12\").set({\n title: \"Flucht und Integration\",\n thesis: \"Die Stadt Frankfurt soll sich ohne Einschränkungen zum sicheren Hafen für Geflüchtete erklären. Kommunen sollen selbst entscheiden können, ob sie mehr Geflüchtete aufnehmen wollen, als die verpflichtende Anzahl aus dem bundesweit gültigen Königsteiner Schlüssel.\",\n });\n thesis.doc(\"13\").set({\n title: \"Soziales\",\n thesis: \"Die Stadt Frankfurt und ihre Behörden sollen sich aktiv engagieren, um bürokratische Hürden abzubauen, die häufig der Unterstützung von sozial benachteiligten Familien im Weg stehen. So sollen die Bürger*innen, die auf Unterstützung angewiesen sind, alle verfügbaren Mittel bekommen können.\",\n });\n thesis.doc(\"14\").set({\n title: \"Gesundheit\",\n thesis: \"Der öffentliche Gesundheitsdienst soll unter Berücksichtigung der Erfahrungen aus der Pandemie personell und finanziell gestärkt werden. Dazu sollen insbesondere auch die Chancen der Digitalisierung genutzt werden.\",\n });\n thesis.doc(\"15\").set({\n title: \"Gesundheit\",\n thesis: \"In der Drogenpolitik soll der Frankfurter Weg konsequent weiter entwickelt werden, um auf die aktuelle Situation der suchtkranken Menschen einzugehen. Niedrigschwellige Substitutionsangebote sollen genauso weiterentwickelt werden wie besondere Angebote für Crack-Konsument*innen, die häufig von den bestehenden Einrichtungen nicht angesprochen werden.\",\n });\n\n}", "function addDataToLevelDB(value) {\n let i = 0;\n db.createReadStream().on('data', function(data) {\n i++;\n }).on('error', function(err) {\n return `Unable to read data stream!' ${err}`\n }).on('close', function() {\n console.log('Block #' + i);\n addLevelDBData(i, value);\n });\n}", "function writeRecipesToDatabase(recipes){\n db.serialize(function() {\n\n //Here we will drop the current files in the database and work with the new ones that we are creating now\n var serverStringNeeded = \"DROP TABLE IF EXISTS recipes\";\n db.run(serverStringNeeded);\n\n\t //this will create a new table within the database\n serverStringNeeded = \"CREATE TABLE IF NOT EXISTS recipes (id INTEGER PRIMARY KEY, recipe_name TEXT, contributor TEXT, category TEXT, description TEXT, spices TEXT, source TEXT, rating TEXT, ingredients TEXT, directions TEXT)\";\n\n db.run(serverStringNeeded);\n\n var stmt = db.prepare(\"INSERT INTO recipes (recipe_name,contributor,category,description,spices,source,rating,ingredients,directions) VALUES (?,?,?,?,?,?,?,?,?)\");\n for (var i = 0; i < recipes.length; i++) {\n \t recipe = recipes[i];\n stmt.run(recipe.recipe_name, recipe.contributor, recipe.category, recipe.description, recipe.spices, recipe.source, recipe.rating, recipe.ingredients, recipe.directions);\n }\n stmt.finalize();\n });\n}", "data2db() {\n\t\tlet tables = ['modules', 'terms']\n\t\treturn this.db.transaction('rw', this.db.tables, () => {\n\t\t\treturn Promise.all(tables.map(t => \n\t\t\t\tthis.db.table(t).clear().then(()=>\n\t\t\t\t\tthis.db.table(t).bulkAdd(this.data[t]))))\n\t\t})\n\t}", "function tableInsertionCallback(err) {\n if (err) {\n console.log(\"data storing error\", err);\n respondObject.status = \"data storing error\";\n res.json(respondObject);\n } else {\n console.log(\"data stored\");\n respondObject.status = \"data stored\";\n res.json(respondObject);\n //db.close();\n }\n }", "function writeToFunmoneyDatabase(who,amount){\r\n let junk = '';\r\n let junkB = '';\r\n let lostAmount = amount * -1;\r\n mikeyHistory = historyAll[\"mikey\"].split(',');\r\n yokoHistory= historyAll[\"yoko\"].split(',');\r\n amount = parseFloat(amount);\r\n lostAmount = parseFloat(lostAmount);\r\n if (who == \"mikey\"){\r\n // add money to mikey\r\n mikeyMoney = mikeyMoney * 1;\r\n mikeyMoney += amount;\r\n let newBal = (mikeyMoney.toFixed(2)).toString();\r\n junk = mikeyHistory.unshift(amount.toString());\r\n junk = mikeyHistory.pop();\r\n let toAppend = mikeyHistory.toString();\r\n // minus money yoko\r\n yokoMoney = yokoMoney * 1;\r\n yokoMoney += lostAmount;\r\n let newBalY = (yokoMoney.toFixed(2)).toString();\r\n junkB = yokoHistory.unshift(lostAmount.toString());\r\n junkB = yokoHistory.pop();\r\n let toAppendY = yokoHistory.toString();\r\n // write db\r\n docFMH.set({\r\n yoko : toAppendY,\r\n mikey : toAppend\r\n }, { merge: true });\r\n docFM.set({\r\n yoko : newBalY,\r\n mikey : newBal\r\n }, { merge: true });\r\n }\r\n if (who == \"yoko\"){\r\n yokoMoney = yokoMoney * 1;\r\n yokoMoney += amount;\r\n let newBal = (yokoMoney.toFixed(2)).toString();\r\n junk = yokoHistory.unshift(amount.toString());\r\n junk = yokoHistory.pop();\r\n let toAppend = yokoHistory.toString();\r\n // mikey minus loss\r\n mikeyMoney = mikeyMoney * 1;\r\n mikeyMoney += lostAmount;\r\n let newBalM = (mikeyMoney.toFixed(2)).toString();\r\n junkB = mikeyHistory.unshift(lostAmount.toString());\r\n junkB = mikeyHistory.pop();\r\n let toAppendM = mikeyHistory.toString();\r\n // write db\r\n docFMH.set({\r\n yoko : toAppend,\r\n mikey : toAppendM\r\n }, { merge: true });\r\n docFM.set({\r\n yoko : newBal,\r\n mikey : newBalM\r\n }, { merge: true });\r\n }\r\n // console.log(amount);\r\n}", "function save() {\r\n var site_name = document.getElementById(\"site_Name\").value;\r\n dev_name = document.getElementById(\"dev_Name\").value;\r\n var test_num = document.getElementById(\"try_num\").value;\r\n var language = document.getElementById(\"language\").value;\r\n\r\n database.ref('test/' + dev_name).set({\r\n siteName : site_name,\r\n developer : dev_name,\r\n testNumber : test_num,\r\n lSitLanguage : language\r\n });\r\n\r\n alert('saved');\r\n }", "function storeLikeInDatabase(surveyId, likeControId, objectId, objectType,\n\t\t\t\t\t\t\t\t xCoordinate, yCoordinate, db) {\n\tvar queryf = \"INSERT INTO likeData('surveyId','likeControId', 'objectId',\"\n\t+\" 'objectType', 'xCoordinate', 'yCoordinate') VALUES (\"+surveyId+\",\"\n\t+likeControId+\",\"+objectId+\",'\"+objectType+\"',\"\n\t+xCoordinate+\",\"+yCoordinate+\")\";\n\tdb.transaction(\n\t\tfunction (tx) {\n\t\t\ttx.executeSql(queryf, [],successMsg ,onError);\n\t\t}); \n}", "function write_sell_toDB(){\n keystone.list('Voucher Codes').model.findOne()\n .where({voucheramount : seller_voucher_amount_, voucherstate : 'new'})\n .exec( function(error, response){\n if(error){\n return res.jsonp({status: 'sorry Please try again, later', new_credit : 'no_value_change'});\n }\n if(response == null){\n return res.jsonp({status : 'error Selling voucher, Please try different amount, or try again later', new_credit : 'no_value_change'});\n } \n // console.log(response);\n \n \n \n // res.jsonp('voucher sold for R'+seller_voucher_amount_); \n \n response.voucherstate = 'used';\n response.soldby = req.query.seller_id;\n response.soldto = seach_code_;\n response.save();\n \n var seller_id = req.query.seller_id;\n // var seller_voucher_amount = seller_voucher_amount_;\n voucher_sell_subtract_amount(seller_id, seller_voucher_amount_, res); \n });\n //on error throw error\n \n //on sucess, create voucher on the front\n \n \n }", "async function addLevelDBData(key,value){\n try {\n return await db.put(key, value)\n } catch(err) {\n console.log('Having error with adding data to DB. Error: '+err);\n }\n}", "function writeCompanyData(query, callback) {\n var companyRef = db.ref('companies/' + query.company);\n\n companyRef.set({\n employees: query.employees,\n industry: query.industry,\n location: query.location,\n imgUrl: query.imgUrl,\n description: query.description\n });\n\n callback(NULL, \"Added company to database!\");\n}", "static saveToDB(restaurants){\r\n const dbPromise = DBHelper.openDB();\r\n dbPromise.then(db => {\r\n if(!db) return ;\r\n const transaction = db.transaction(\"restaurantList\", \"readwrite\");\r\n const store = transaction.objectStore(\"restaurantList\");\r\n restaurants.forEach(restaurant => {\r\n store.put(restaurant);\r\n });\r\n return transaction.complete;\r\n });\r\n }", "function writePriceToDB(price, location){\n var query = 'INSERT INTO prices (timestamp, location, service, estimate, minimum, low_estimate, high_estimate, surge)'\n + ' VALUES (?,?,?,?,?,?,?,?)';\n var timestamp = new Date();\n\n db.run(query, [timestamp.toUTCString(), location, price.localized_display_name, parseDollarPrice(price.estimate),\n price.minimum, price.low_estimate, price.high_estimate, price.surge_multiplier]);\n\n completedInsertions ++;\n if(completedInsertions.length === locations.length){\n db.close();\n }\n}", "saveData(context, data, callback) {\n // We initialize on every call, but only block on the first call. The reason for this is that we can't run asynchronous initialization in the class ctor\n this.initialize().then(() => {\n // Build list of write commands\n let list = [];\n if (context.userId) {\n if (context.persistUserData) {\n // Write userData\n list.push({\n id: this.getUserDataId(context),\n userId: context.userId,\n field: Fields.userData,\n botData: data.userData,\n });\n }\n if (context.conversationId) {\n // Write privateConversationData\n list.push({\n id: this.getPrivateConversationDataId(context),\n userId: context.userId,\n conversationId: context.conversationId,\n field: Fields.privateConversationData,\n botData: data.privateConversationData,\n });\n }\n }\n if (context.persistConversationData && context.conversationId) {\n // Write conversationData\n list.push({\n id: this.getConversationDataId(context),\n conversationId: context.conversationId,\n field: Fields.conversationData,\n botData: data.conversationData,\n });\n }\n // Execute writes in parallel\n async.each(list, (entry, errorCallback) => {\n let filter = { \"_id\": entry.id };\n // let document = {\n // // Tag each document with user id so we can find all user data later\n // userId: entry.userId || \"\",\n // data: entry.botData,\n // };\n let document = entry.botData;\n document.userId = entry.userId || \"\";\n this.botStateCollection.updateOne(filter, document, { upsert: true }, err => errorCallback(err));\n }, (err) => {\n if (callback) {\n if (!err) {\n callback(null);\n }\n else {\n let m = err.toString();\n callback(err instanceof Error ? err : new Error(m));\n }\n }\n });\n }, (err) => callback(err));\n }", "async function saveInDb() {\n\t\ttry {\n\t\t\tawait Snapshot.create({\n\t\t\t\tTitle: req.body.title,\n\t\t\t\tText: fullUnitedText,\n\t\t\t\tDictionary: JSON.stringify(fullInfo.dictionary),\n\t\t\t\tWikipedia: JSON.stringify(fullInfo.wiki)\n\t\t\t});\n\n\t\t\tres.status(201).end()\n\t\t} catch (e) {\n\t\t\tres.status(500).send({error: e})\n\t\t}\n\t}", "function writeOrderData() {\r\n \r\n var orderNotes = prompt(\"Eklemek istediğiniz notlar (Örnek : acısız) ?\");\r\n firebase.database().ref(\"Basket/\" + userId + \"/\").push().update({\r\n \r\n \r\n phone : userPhoneNo,\r\n //ARRANGE THIS TO WRITE EVERYTHING IN THE LIST\r\n //productTotalPrice : totalPrice,\r\n //productLocation : orderLocation,\r\n notes : orderNotes,\r\n name: fname,\r\n nameid: nameid,\r\n ucret: fprice,\r\n quantity: f_adet,\r\n restid: storeUID\r\n \r\n \r\n }, function(error) {\r\n if (error) {\r\n alert(\"Siparişiniz gönderilemedi, lütfen tekrar deneyin\");\r\n } else {\r\n \r\n var x = document.getElementById(\"snackbar\");\r\n x.className = \"show\";\r\n setTimeout(function(){ x.className = x.className.replace(\"show\", \"\"); }, 3000);\r\n } } );}", "writeDbObject(obj) {\n this.writeUB4(obj.toid.length);\n this.writeBytesWithLength(obj.toid);\n if (obj.oid) {\n this.writeUB4(obj.oid.length);\n this.writeBytesWithLength(obj.oid);\n } else {\n this.writeUB4(0);\n }\n this.writeUB4(0); // snapshot\n this.writeUB4(0); // version\n const packedData = obj._getPackedData();\n this.writeUB4(packedData.length);\n this.writeUB4(obj.flags);\n this.writeBytesWithLength(packedData);\n }", "function saveNote(tx, results) {\n\t\n\tvar numberOfRecords = results.rows.item(0).count;\t\t\n\tvar noteName = $(\"#name\").val();\n\tvar noteData = $(\"#data\").val();\n\t\n\tif (numberOfRecords == 0)\n\t\ttx.executeSql('INSERT INTO notes (name, data) VALUES (\"'+noteName+'\",\"'+noteData+'\")');\n\telse if (numberOfRecords == 1)\n\t\ttx.executeSql('UPDATE notes SET data = \"'+ noteData +'\", save_time = DateTime(\"now\") WHERE name = \"'+ noteName +'\"');\n\telse\n\t\talert(\"DB Error: More than one Note exists with this name.\");\n\t\n\t//tx.executeSql('SELECT * FROM notes', [], querySuccess, errorCB);\n\talert(\"Note saved\");\n}", "function writeSPData(userId, name, tel, email, address, ic, pwd) {\n firebase.database().ref('spPrivate/' + userId).set({\n \n fullName: name,\n phone: tel,\n email: email,\n address: address,\n icNumber: ic,\n password : pwd,\n role: \"serviceProvider\"\n })\n .then (function() {\n console.log(\"SP Information Saved in database:\", userId, email);\n })\n .catch(function(error) {\n console.log(\"Error writing SP data: \", error);\n });\n}" ]
[ "0.72436124", "0.72302604", "0.72029907", "0.71798366", "0.71541655", "0.7149343", "0.7074406", "0.7072854", "0.70201933", "0.6945145", "0.6925748", "0.68811136", "0.6841664", "0.68416315", "0.6793797", "0.6778868", "0.67386675", "0.67350036", "0.6658894", "0.66179466", "0.6572768", "0.6538627", "0.65035814", "0.6492031", "0.6492031", "0.649156", "0.64800376", "0.6475696", "0.645663", "0.64485943", "0.6445071", "0.64412045", "0.6431246", "0.6431246", "0.64231867", "0.6404147", "0.6403185", "0.63997865", "0.6386229", "0.6352001", "0.63314223", "0.6330781", "0.63190126", "0.63153505", "0.63126254", "0.63100374", "0.6305523", "0.63029355", "0.6302722", "0.6280516", "0.62559414", "0.62452596", "0.62435913", "0.62323695", "0.6230467", "0.6215301", "0.6206825", "0.62008137", "0.61960775", "0.61860013", "0.61763155", "0.61745393", "0.61629194", "0.61585957", "0.6154729", "0.61452574", "0.6142323", "0.6137587", "0.61372554", "0.61286134", "0.6113562", "0.6109006", "0.6108373", "0.61050415", "0.6097464", "0.60907835", "0.60903156", "0.6080146", "0.6074966", "0.60749394", "0.6059097", "0.6053698", "0.6044561", "0.6035686", "0.60298026", "0.60199094", "0.60112804", "0.60112685", "0.6010127", "0.60037416", "0.60017985", "0.6000271", "0.5998112", "0.59928316", "0.59893435", "0.5986616", "0.59746975", "0.5974163", "0.5971592", "0.5970577" ]
0.60102344
88
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//edited only take as is mysql_db_data_get copy paste, can get spacing issues search movie
function movie_find_search(url_query, respond){ respond.write("<script>document.getElementById('heading').innerHTML ='You searched for : "+url_query.replace(/%20/g, " ")+"';</script>"); var search_input ='<style>input[type=search] {width: 130px;box-sizing: border-box;border: 2px solid #ccc;border-radius: 4px;font-size: 16px;background-color: white; margin:2% auto 2% 40%;background-image:url("searchicon.png");background-position: 10px 10px;background-repeat: no-repeat;padding: 12px 20px 12px 40px;-webkit-transition: width 0.4s ease-in-out;transition: width 0.4s ease-in-out;}input[type=search]:focus {width: 95%;margin:2% auto 2% auto;}/* #searh_input{margin:2% auto 2% 40%;width: 50%;} */</style><input type="search" name="search" placeholder="Search.." id="search_input" onsearch ="call_db_search()"><button onclick="call_db_search()" style ="width:4%; height:7.5%;font-size:2.3em;border-radius:0px;background-color:transparent;" class="btn btn-info"><i class="fas fa-search"></i></button><br><hr><div id style="width:100%;height:7%;background-color:white;color:black;font-size:1em;"><a href="movie_find_show_all" onclick ="">Show all stored movies</a></div><hr><script> function call_db_search(){ var search_query = document.getElementById("search_input"); if(search_query.value == ""){ document.getElementById("heading").innerHTML ="Please feel data to be searched for"; } else{ window.open("movie_find_search?"+search_query.value, "_self"); } } </script>'; respond.write(search_input);//search header //clean query string var data_to_search = url_query.replace(/%20/g, " "); //get data from db my_sql_conn.connect(function(err){//doing mysql connection handshake aka test connectability if(err){ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>connection error: "+err+"</p>"); //return respond.end();//ending here } else{ // respond.write("<p>connected to db</p>"); //respond.end();//ending here } //get data from db //multiple row search var mysql_db_data_get = "SELECT * FROM movie_table WHERE m_title like '%"+data_to_search+"%' OR m_director like '%"+data_to_search+"%' OR m_producer like '%"+data_to_search+"%' OR m_production_company like '%"+data_to_search+"%' OR m_country like '%"+data_to_search+"%' OR m_actor like '%"+data_to_search+"%' OR m_genre like '%"+data_to_search+"%' OR m_description like '%"+data_to_search+"%' OR m_disclaimer like '%"+data_to_search+"%' "; //connect to existing db my_sql_conn_db.query(mysql_db_data_get, function(err, results){ if(err){ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Data connection error : "+err+"</p>"); return ;//respond.end();//ending here } else{ // respond.write("<p>Data added "+JSON.stringify(results[0].m_producer)+"</p>"); //console.log(results.length); var result = results; if(results.length ==0){return respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Could'nt find movie with any details of whats searched for</p>");}//if record match not found var extra_results = 1;//skip result duplicate var count = 0; for(var i =0; i<=result.length; i++){ db_data_shower();//break if setup is not like this extra_results =i;//capture duplicate count = i; } //respond.end();//ending here } function db_data_shower(){ if(extra_results==0){return} respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Movie Title : "+result[count].m_title+" | Movie Director : "+result[count].m_director+" | Movie Producer : "+result[count].m_producer+" | Movie Producing Company : "+result[count].m_production_company+" | Movie filmed Country : "+result[count].m_country+" | Movie Starring : "+result[count].m_actor+" | Movie Genre : "+result[count].m_genre+" | Movie Synopsis : "+result[count].m_description+" | Movie Disclaimer : "+result[count].m_disclaimer+" | Movie Poster : "+result[count].m_image+"</p><hr>"); } } ); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SearchByTitlePre(database,word,func) {\r\n database.query('SELECT books_basic.ID,Title,Subtitle,Image FROM books_basic WHERE Title = \"'+word+'\";', func);\r\n}", "function getOMDB(movie='Mr. Nobody') {\n\tvar vImdbRating=\"\";\n\t// console.log('move is ', movie);\n\t// console.log(\"OMDB function ran\");\n\t// console.log('request string ', (omdb1+movie+omdb2));\n\tRequest(omdb1+encodeURI(movie)+omdb2)\n\t\t.then(function(data){\n\t\t\tvar parseData=JSON.parse(data);\n\t\t\t// console.log('parseData ', parseData);\n\t\t\tfor (i in parseData.Ratings) {\n\t\t\t\t// console.log('i is ', i);\n\t\t\t\tif (parseData.Ratings[i].Source===\"Rotten Tomatoes\") {\n\t\t\t\t\tvImdbRating = (parseData.Ratings[i].Value);\n\t\t\t\t\t// console.log(\"Rotten tomatoe true\", \" \", parseData.Ratings[i].Source, \" \", parseData.Ratings[i].Value );\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t// console.log('vImdbRating', vImdbRating);\n\t\t\t// console.log('data ', data);\n\t\t console.log(\"\\n\\n\" + \"OMDB MOVIE RESULTS\".black.bgMagenta + \"\\n\");\t\t\t\n\n\t\t\tconsole.log(`Title ${JSON.parse(data).Title} | Released ${JSON.parse(data).Year}`.black.bgWhite);\t\t\t\n\t\t\tconsole.log(`IMDB Rating ${JSON.parse(data).imdbRating} | Rotten Tomatoes Rating ${vImdbRating}`);\n\t\t\tconsole.log(`Production Country(w) ${parseData.Country} | Language ${parseData.Language}`);\n\t\t\tconsole.log(`Plot: ${parseData.Plot}`.white);\n\t\t\tconsole.log(`Actors: ${parseData.Actors}`.inverse);\n\t\t}, function(err) {\n\t\t\tconsole.log('response ', response);\n\t\t\tconsole.log('Sorry, I had a problem. ', err);\t\t\t\n\t\t});\n}", "function SearchByAuthorPre(database,word,func) {\r\n database.query('SELECT books_basic.ID,Title,Subtitle,Image FROM books_basic WHERE Author = \"'+word+'\";',func);\r\n}", "function movie_find_show_all(url_query, respond){\r\n respond.write(\"<script>document.getElementById('heading').innerHTML ='Movie search All';</script>\");\r\n \r\n var search_input ='<style>input[type=search] {width: 130px;box-sizing: border-box;border: 2px solid #ccc;border-radius: 4px;font-size: 16px;background-color: white; margin:2% auto 2% 40%;background-image:url(\"searchicon.png\");background-position: 10px 10px;background-repeat: no-repeat;padding: 12px 20px 12px 40px;-webkit-transition: width 0.4s ease-in-out;transition: width 0.4s ease-in-out;}input[type=search]:focus {width: 95%;margin:2% auto 2% auto;}/* #searh_input{margin:2% auto 2% 40%;width: 50%;} */</style><input type=\"search\" name=\"search\" placeholder=\"Search..\" id=\"search_input\" onsearch =\"call_db_search()\"><button onclick=\"call_db_search()\" style =\"width:4%; height:7.5%;font-size:2.3em;border-radius:0px;background-color:transparent;\" class=\"btn btn-info\"><i class=\"fas fa-search\"></i></button><br><div id style=\"width:100%;height:7%;background-color:white;color:black;font-size:1em;\"><a href=\"movie_find_show_all\" onclick =\"\">Show all stored movies</a><br><a href=\"delete_all\" onclick =\"\">Delete all stored movies</a></div><hr><script> function call_db_search(){ var search_query = document.getElementById(\"search_input\"); if(search_query.value == \"\"){ document.getElementById(\"heading\").innerHTML =\"Please feel data to be searched for\"; } else{ window.open(\"movie_find_search?\"+search_query.value, \"_self\"); } } </script>';\r\n\r\n\r\n respond.write(search_input);\r\n \r\n \r\n //get data from db\r\n my_sql_conn.connect(function(err){//doing mysql connection handshake aka test connectability\r\n if(err){\r\n // respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>connection error: \"+err+\"</p>\");\r\n //return respond.end();//ending here\r\n }\r\n else{\r\n // respond.write(\"<p>connected to db</p>\");\r\n //respond.end();//ending here\r\n }\r\n \r\n //get data from db\r\n var mysql_db_data_get = \"SELECT * FROM movie_table\"\r\n \r\n \r\n //connect to existing db\r\n \r\n my_sql_conn_db.query(mysql_db_data_get, function(err, results){\r\n \r\n if(err){\r\n // respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Data adding err (serach) \"+err+\"</p>\");\r\n return ;//respond.end();//ending here\r\n }\r\n else{\r\n // respond.write(\"<p>Data added \"+JSON.stringify(results[0].m_producer)+\"</p>\");\r\n var result = results;\r\n if(results.length ==0){return respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Could'nt find movie in db, please add some</p>\");}//if record match not found\r\n var extra_results = 1;//skip result duplicate\r\n var count = 0;\r\n for(var i =0; i<=result.length; i++){\r\n db_data_shower();//break if setup is not like this\r\n extra_results =i;//capture duplicate\r\n count = i;\r\n \r\n }\r\n \r\n\r\n \r\n //respond.end();//ending here\r\n }\r\n function db_data_shower(){\r\n if(extra_results==0){return} \r\n respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Movie Title : \"+result[count].m_title+\" | Movie Director : \"+result[count].m_director+\" | Movie Producer : \"+result[count].m_producer+\" | Movie Producing Company : \"+result[count].m_production_company+\" | Movie filmed Country : \"+result[count].m_country+\" | Movie Starring : \"+result[count].m_actor+\" | Movie Genre : \"+result[count].m_genre+\" | Movie Synopsis : \"+result[count].m_description+\" | Movie Disclaimer : \"+result[count].m_disclaimer+\" | Movie Poster : \"+result[count].m_image+\"<br>\"+ \r\n '<input type=\"button\" style=\"width:40%;height:2em;margin:1% 1% 1% 1%\" onclick=\"window.open(\\'movie_update?'+result[count].movie_id+'\\',\\'_self\\')\" value=\"Update Movie\" class=\"btn btn-primary\"><input type=\"button\" style=\"width:40%;height:2em;margin:1% 1% 1% 1%\" onclick=\"window.open(\\'movie_delete?'+result[count].movie_id+'\\',\\'_self\\')\" value=\"Delete Movie\" class=\"btn btn-primary\"></p>');\r\n }\r\n }\r\n \r\n ); \r\n \r\n });\r\n \r\n}", "function SearchByPublisherPre(database,word,func) {\r\n database.query('SELECT books_basic.ID,Title,Subtitle,Image FROM books_basic WHERE ID IN (SELECT ID FROM books_detail WHERE Publisher = \"'+word+'\");',func);\r\n}", "function getFilm(search) {\n\n\tomdb.getMovie(search)\n\n}", "function search_list(search_string) {\n var picvid_list2 = []\n if (search_string == \"\") {\n\tpicvid_list2 = picvid_list\n }\n else {\n\tconsole.log(\"db search_list: \" + search_string);\n\tsearch_regex = new RegExp(search_string, \"i\")\n\tfor (i=0; i <= picvid_list.length; i++) {\n if (picvid_list[i].match(search_regex)) {\n\t\tpicvid_list2.push(picvid_list[i])\n }\n\t}\n }\n\n var slidecount2 = picvid_list2.length\n slidesrc = [];\n slidelabel = [];\n console.log(\"db search_list slide count1: \" + slidecount2 + \" pause\" + paused + \" ss=\" + search_string)\n for (i=0; i<slidecount1; i++) {\n\tif (i >= slidecount2) {break}\n\tvar j\n\tif (slidecount1 <= slidecount2) {\n\t j = Math.floor((Math.random() * slidecount2))\n\t}\n\telse {\n\t j = i\n\t}\n\tvar pic = picvid_list2[j].replace(\"/mnt/\", \"../\")\n//\tvar pic = picvid_list2[j]\n// \tconsole.log(\"db search_list: i=\" + i + \" j=\" + j + \" pic=\" + pic)\n\tvar pic_label = pic;\n\n\tvar prefix = \"\";\n\tvar suffix = \"\";\n\n// Pick out optional slide label data, drop video time index\n n = pic.search(/label=/);\n if (n > 0) {\n\t suffix = pic.substr(n + 6);\n\t pic = pic.substr(0, n-1);\n \t}\n\n\n\t// Try to pick out the year from the file path/name\n\tvar year = \"\";\n\tn = pic.search(/(19\\d\\d|20\\d\\d)/);\n\tif (n > 0) {\n\t year = pic.substr(n, 4);\n\t}\n\telse {\n\t n = pic.search(/[\\/\\_ ]\\d\\d[\\/ /-]/);\n\t if (n > 0) {\n\t\tyear = pic.substr(n+1, 2);\n\t\tif (year > 20) {\n\t\t year = 1900 + parseInt(year);\n\t\t}\n\t\telse {\n\t\t year = 2000 + parseInt(year);\n\t\t}\n\t }\n }\n if (year > 0) {\n prefix = year + \": \";\n//\t prefix = year + \": \" + i + \"/\" + slidecount1 + \"/\" + slidecount2 + \": \"\n }\n\n n = pic.search(/#t=/);\n if (n > 0) {\n\t pic_label = pic.substr(0, n);\n \t}\n// console.log(\"db search_list n=\" + n + \" pic=\" + pic + \" s=\" + suffix);\n\n\tslidesrc[i] = pic;\n slidelabel[i] = prefix + \" \" + pic_label.replace(/..\\/photos\\/|..\\/videos\\//, \"\") + \" \" + suffix;\n\n//\tconsole.log(\"db search_list i=\" + i + \" j=\" + j + \" p1=\" + slidesrc[i]);\n }\n\n whichslide = 0;\n// if (search_string != \"\") slide_pause('inc');\n\n}", "function SearchByID(database,word,func) {\r\n database.query('SELECT books_basic.ID,Title,Subtitle,Image FROM books_basic WHERE ID = \"'+word+'\";',func);\r\n}", "function getMovieContent() {\n\tvar queryURL = 'https://www.omdbapi.com/?t=' + searchTerm + '&y=&plot=short&apikey=trilogy';\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: 'GET'\n\t}).then(function (response) {\n\t\tvar movieRatingLong = response.Ratings[0].Value;\n\t\tvar movieRatingDouble = movieRatingLong.substr(0, 3);\n\t\tvar movieRatingUnround = movieRatingDouble / 2;\n\t\tmovieRating = Math.round(movieRatingUnround * 10) / 10;\n\t\tvar moviePosterUrl = response.Poster;\n\t\tmoviePoster = $('<img>');\n\t\tmoviePoster.attr('id', 'movieposterThumbnail');\n\t\tmoviePoster.attr('src', moviePosterUrl);\n\t\tmoviePlot = response.Plot;\n\t\tmovieTitle = response.Title;\n\t\tsetContent();\n\t});\n}", "function allMovies(db) {\n const sql = 'SELECT DISTINCT * FROM MOVIES'\n db.all(sql, function (err, rows) {\n rows.forEach(function (row) {\n console.log(row);\n })\n });\t\n}", "function home_movie_details(url_query, respond){\r\n \r\n //get data from db\r\n my_sql_conn.connect(function(err){//doing mysql connection handshake aka test connectability\r\n if(err){\r\n // respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>connection error: \"+err+\"</p>\");\r\n //return respond.end();//ending here\r\n }\r\n else{\r\n // respond.write(\"<p>connected to db</p>\");\r\n //respond.end();//ending here\r\n }\r\n \r\n //get data from db\r\n //multiple row search\r\n var mysql_db_home_movie_data_show = \"SELECT * FROM movie_table WHERE movie_id=\"+url_query;\r\n \r\n \r\n //connect to existing db\r\n \r\n my_sql_conn_db.query(mysql_db_home_movie_data_show, function(err, results){\r\n \r\n if(err){\r\n // respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Data connection error : \"+err+\"</p>\");\r\n return ;//respond.end();//ending here\r\n }\r\n else{\r\n // respond.write(\"<p>Data added \"+JSON.stringify(results[0].m_producer)+\"</p>\");\r\n //console.log(results.length);\r\n \r\n if(results.length ==0){return respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Could'nt find movie with any details of whats searched for</p>\");}//if record match not found\r\n respond.write(\"<script>document.getElementById('heading').innerHTML ='\"+results[0].m_title+\"';</script>\"); //change header\r\n respond.write(\"<p style='width:100%;height:auto;overflow:auto;background-color:white;color:black'><style>#movie_poster{width:15em;height:10em;top:0px;}</style><img id='movie_poster' src='\"+results[0].m_image+\"'><br>Movie Title : \"+results[0].m_title+\" <br> Movie Director : \"+results[0].m_director+\" <br> Movie Producer : \"+results[0].m_producer+\" <br> Movie Producing Company : \"+results[0].m_production_company+\" <br> Movie filmed Country : \"+results[0].m_country+\" <br> Movie Starring : \"+results[0].m_actor+\" <br> Movie Genre : \"+results[0].m_genre+\" <br> Movie Synopsis : \"+results[0].m_description+\" <br> Movie Disclaimer : \"+results[0].m_disclaimer+\"</p><hr>\");\r\n }\r\n \r\n\r\n \r\n //respond.end();//ending here\r\n }\r\n \r\n ); \r\n \r\n });\r\n \r\n}", "function insertIMDbLinks() {\n\t\tvar movieNodes = getMovieTitles();\n \n\t\tvar i=0;\n while ( movieNodes[i] !=null ) { \n insertRating(movieNodes[i]);\n i++;\n }\n\t}", "function searchOMDB (input) {\n // If nothing is searched, Mr. Nobody will be used.\n if (input == \"\") {\n input = \"Fantastic Mr. Fox\"\n };\n // OMDB request\n request(\"http://www.omdbapi.com/?t=\" + input + \"&y=&plot=shortnode&apikey=trilogy\", function (error, response, body) {\n if (error) {\n console.log(\"An error occured: \" + error)\n } else {\n console.log(\n \"Movie title: \" + JSON.parse(body).Title +\n \"\\nReleased: \" + JSON.parse(body).Year +\n \"\\nIMDB Rating: \" + JSON.parse(body).imdbRating +\n \"\\nRotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value +\n \"\\nThe movie was produced in: \" + JSON.parse(body).Country +\n \"\\nLanguage: \" + JSON.parse(body).Language +\n \"\\nThe Plot: \" + JSON.parse(body).Plot +\n \"\\nThe Actors: \" + JSON.parse(body).Actors\n );\n }\n })\n}", "function ratingMovies(db) {\n const sql = 'SELECT DISTINCT * FROM MOVIES WHERE RATING >= 7'\n db.all(sql, function (err, rows) {\n rows.forEach(function (row) {\n console.log(row);\n })\n });\t\n}", "function parseOMDBResponse(data) {\r\n\r\n logContent(\"Title: \" + data.Title);\r\n logContent(\"Year: \" + data.Year);\r\n\r\n // Loop, format and print the movie ratings\r\n var ratings = data.Ratings;\r\n ratings.forEach(rating => {\r\n switch (rating.Source) {\r\n case \"Internet Movie Database\":\r\n logContent(\"IMDB Rating: \" + rating.Value);\r\n break;\r\n case \"Rotten Tomatoes\":\r\n logContent(\"Rotton Tomatoes Rating: \" + rating.Value);\r\n break;\r\n }\r\n });\r\n\r\n logContent(\"Country Produced: \" + data.Country);\r\n logContent(\"Language: \" + data.Language);\r\n logContent(\"Plot: \" + data.Plot);\r\n\r\n // Loop, format and print the actors on their own lines\r\n var actors = data.Actors.split(\", \");\r\n logContent(\"Actors:\");\r\n logContent(\"=======\");\r\n actors.forEach(actor => {\r\n logContent(\" \" + actor);\r\n });\r\n logContent(\"------------------------------------\");\r\n}", "function searchCallback2(data) {\n var genres = data.genres.map(function(obj){ return obj }).join(\", \");\n var directors = data.abridged_directors.map(function(obj){ return obj.name }).join(\", \");\n\n $('.movie-genre').html('<i>' + '<strong>Genres - </strong>' + genres + '</i>');\n $('.movie-director').html('<i>' + '<strong>Directed By - </strong>' + directors + '</i>');\n $('#rating_genres').val(genres);\n $('#rating_directors').val(directors);\n }", "function searchMovie(searchWord, page) {\n fetch(\n `http://www.omdbapi.com/?s=${searchWord}&apikey=dd68f9f&page=${page}&plot=short`\n )\n .then(function(response) {\n return response.json();\n })\n .then(function(data) {\n let searchResults = data.Search;\n results.innerHTML = \"\";\n return searchResults.map(function(movie) {\n let movieDiv = createNode(\"div\");\n let movieTitle = createNode(\"h1\");\n let moviePoster = createNode(\"img\");\n let more = createNode(\"div\");\n let movieDetails = createNode(\"p\");\n let movieID = movie.imdbID;\n let movieActors = createNode(\"p\");\n let movieDirector = createNode(\"p\");\n let movieRating = createNode(\"p\");\n\n movieDiv.className = \"movie-div\";\n\n movieTitle.textContent = `${movie.Title} (${movie.Year})`;\n movieTitle.className = \"movie-title\";\n\n moviePoster.src = movie.Poster;\n moviePoster.className = \"movie-images\";\n\n more.textContent = \"More...\";\n more.className = \"more\";\n\n movieDetails.className = \"movie-details--off\";\n\n append(results, movieDiv);\n append(movieDiv, movieTitle);\n append(movieDiv, moviePoster);\n append(movieDiv, more);\n append(more, movieActors);\n append(more, movieDirector);\n append(more, movieRating);\n append(more, movieDetails);\n\n more.addEventListener(\"click\", function(event) {\n event.preventDefault();\n if (movieDetails.className == \"movie-details--off\") {\n fetch(\n `http://www.omdbapi.com/?i=${movieID}&apikey=dd68f9f&plot=full`\n )\n .then(function(response) {\n return response.json();\n })\n .then(function(data) {\n console.log(data);\n movieActors.textContent = `Cast: ${data.Actors}`;\n if (movie.Director !== \"N/A\") {\n movieDirector.textContent = `Directed by: ${data.Director}`;\n }\n movieRating.textContent = `${data.Ratings[0].Source}: ${\n data.Ratings[0].Value\n }\n ${data.Ratings[1].Source}: ${data.Ratings[1].Value}\n ${data.Ratings[2].Source}: ${data.Ratings[2].Value}`;\n\n movieDetails.className = \"movie-plot\";\n movieDetails.textContent = `Plot: ${data.Plot}`;\n });\n\n movieDetails.classList.toggle(\"movie-details--on\");\n } else if (movieDetails.className == \"movie-details--on\") {\n movieDetails.classList.toggle(\"movie-details--off\");\n }\n });\n });\n });\n}", "function movieSearch() {\n var encodeName = encodeURI(searchName);\n request(\"http://www.omdbapi.com/?t=\" + encodeName + \"&y=&plot=short&r=json\", function(error, response, body) {\n\tif (!error && response.statusCode === 200) {\n\t //console.log(JSON.parse(body));\n\t console.log(\"Title: \" + JSON.parse(body).Title);\n\t // year\n\t console.log(\"Year Released: \" + JSON.parse(body).Year);\n\t // imdb rating\n\t console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t // country produced\n\t console.log(\"Country: \" + JSON.parse(body).Country);\n\t // language of movie\n\t console.log(\"Language: \" + JSON.parse(body).Language);\n\t // plot\n\t console.log(\"Plot: \" + JSON.parse(body).Plot);\n\t // actors\n\t console.log(\"Actors: \" + JSON.parse(body).Actors);\n\t // rotten tomatoes rating\n\t console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t // rotten tomotoes url\n\t console.log(\"Rotten Tomatoes: https://www.rottentomatoes.com/search/?search=\" + encodeName);\n\t} else {\n\t console.log(error);\n\t}\n });\n} // close movie search", "function putData(movie,data){\n var table = $(\"#shows\");\n var genre = $(\"#genre\");\n var film = $(\"#film\");\n var watch = $(\"#watch\");\n var h4 = $(\"<h4>\").append(\"Watch\")\n var link = $(\"<li>\").append(h4);\n watch.append(link);\n var li = $(\"<li>\").append(\"GENRE :\")\n genre.append(li);\n var cast = $(\"#cast\")\n var names = $(\"<li>\").append(\"CAST :\");\n cast.append(names);\n var length = $(\"#length\")\n var len = $(\"<li>\").append(\"LENGTH :\");\n length.append(len);\n var head = table.find(\"thead\");\n var body = table.find(\"tbody\");\n head.empty();\n body.empty();\n var row = $(\"<tr>\");\n var theater = $(\"<th>\").append(\"Theater\")\n row.append(theater);\n head.append(row);\n\n for(a of data.BookMyShow.arrEvent ){\n if(a.EventTitle == movie){\n var image = $(\"<img>\").attr({src:a.BannerURL,class:'img-responsive'}).addClass(\"img-rounded\")\n $(\"#banner\").html(image);\n for(hall of a.arrVenues){\n var tr = $(\"<tr>\");\n var italicHAll = $(\"<i>\").attr(\"style\",\"font-weight:800;color:black\").append(hall.VenueName)\n var name = $(\"<td>\").append(italicHAll);\n tr.append(name);\n body.append(tr);\n }\n //...adding TRAILER URL\n var headTrailer = $(\"<h4>\").append(\"trailer\")\n var hyperlink = $(\"<a>\").attr({href:a.TrailerURL,target:'_blank'}).append(headTrailer);\n var trailer = $(\"<li>\").append(hyperlink);\n watch.append(trailer);\n //..displaying MOVIE'S NAME\n var name = $(\"<h2>\").attr(\"style\",\"font-weight:900;color:darkmagenta\").append(a.EventTitle);\n var italic = $(\"<i>\").append(name);\n var filmName = $(\"<li>\").append(italic); //name\n var censor = $(\"<h3>\").attr(\"style\",\"color:crimson;font-weight:900\").append(a.EventCensor);\n var addCensor = $(\"<li>\").append(censor);\n film.append(filmName);\n film.append(addCensor);\n //..displaying movie's length\n var movieLength = $(\"<li>\").append(a.Length);\n length.append(movieLength);\n //.. displaying genres\n for(j=0;j<3;j++){\n var list = $(\"<li>\").append(a.GenreArray[j]);\n genre.append(list);\n }\n //.. displaying actors' name\n var actors = a.Actors.split(\",\");\n for(i=0;i<4;i++){\n var link = $(\"<a>\").attr({href:\"https://en.wikipedia.org/wiki/\"+actors[i],target:\"_blank\"}).append(actors[i]);\n var li = $(\"<li>\").append(link);\n cast.append(li);\n }\n }\n }\n}", "function OrderSearchByKeyWords(database,word,orderkey,func) {\r\n var pword=word.split(' ').join('%').concat('%');\r\n var ppword='%'.concat(pword);\r\n database.query('SELECT books_basic.ID,Title,Subtitle,Image FROM books_basic INNER JOIN books_detail ON books_basic.ID=books_detail.ID WHERE Title LIKE \"'+ppword+'\" OR Subtitle LIKE \"'+ppword+'\" OR Description LIKE \"'+ppword+'\" ORDER BY '+orderkey+ ';',func);\r\n}", "function getIMDBid(title) {\n var resp = showtime.httpGet('http://www.google.com/search?q=imdb+' + encodeURIComponent(showtime.entityDecode(unescape(title))).toString()).toString();\n var imdbid = resp.match(/http:\\/\\/www.imdb.com\\/title\\/(tt\\d+).*?<\\/a>/);\n if (imdbid) imdbid = imdbid[1];\n else {\n imdbid = resp.match(/http:\\/\\/<b>imdb<\\/b>.com\\/title\\/(tt\\d+).*?\\//);\n if (imdbid) imdbid = imdbid[1];\n };\n\tif (!imdbid) { // Trying to get imdbid by original name\n var fTitle = unescape(title).split(\" | \");\n if (fTitle[1]) {\n resp = showtime.httpGet('http://www.google.com/search?q=imdb+' + encodeURIComponent(showtime.entityDecode(fTitle[1])).toString()).toString();\n imdbid = resp.match(/http:\\/\\/www.imdb.com\\/title\\/(tt\\d+).*?<\\/a>/);\n if (imdbid) imdbid = imdbid[1];\n else {\n imdbid = resp.match(/http:\\/\\/<b>imdb<\\/b>.com\\/title\\/(tt\\d+).*?\\//);\n if (imdbid) imdbid = imdbid[1];\n };\n };\n\t}\n return imdbid;\n }", "function findMovie(title){\n\tvar title = processInput(title);\n\n\tif(title != undefined){\n\t\tvar formattedTitle = title.replace(\" \", \"+\");\t\n\t\tvar query = \"http://www.omdbapi.com/?t=\" + formattedTitle;\n\n\t\trequest(query, function (error, response, body) {\n\t\t\tif(error){\n\t\t\t\tconsole.log(error);\n\t\t\t} else{\n\t\t\t\tvar movieTitle = JSON.parse(body).Title;\n\t\t\t\tvar year = JSON.parse(body).Year;\n\t\t\t\tvar imdbRating = JSON.parse(body).Ratings[0].Value;\n\t\t\t\tvar country = JSON.parse(body).Country;\n\t\t\t\tvar language = JSON.parse(body).Language;\n\t\t\t\tvar plot = JSON.parse(body).Plot;\n\t\t\t\tvar actors = JSON.parse(body).Actors;\n\t\t\t\tvar rottenRating = JSON.parse(body).Ratings[1].Value;\n\t\t\t\tvar rottenURL = \"blah\";\n\n\t\t\t\tvar output = \"\\nMovie Title: \" + movieTitle + \"\\nYear Released: \" \n\t\t\t\t\t+ year + \"\\nCountry Filmed: \" + country + \"\\nLanguages Released In: \"\n\t\t\t\t\t + language + \"\\nActors: \" + actors + \"\\n\\nPlot: \" + plot + \"\\n\\nIMDB Rating: \" \n\t\t\t\t\t + imdbRating + \"\\nRotten Tomatoes Rating: \" + rottenRating + \"\\nRotten Tomatoes URL: \" \n\t\t\t\t\t + rottenURL;\n\n\t\t\t\tconsole.log(output);\n\t\t\t\twriteFS(output);\n\n\t\t\t};\n\t\t});\n\t};\n}", "function movieStuff(){\n\t//Variable for the Omdb's api.\n\tvar moiveQuery = \"http://www.omdbapi.com/?t=\" + term + \"&y=&plot=short&r=json\";\n\trequest(moiveQuery, function(error, response, body) {\n\t\t// If the request is successful\n\t \tif (!error && response.statusCode === 200) {\n\n\t \t// Parse the body of the site to find wanted info.\n\t \tconsole.log(\"Title: \" + JSON.parse(body).Title + \"\\nRelease Year: \" + \n\t \t\tJSON.parse(body).Year + \"\\nIMDB Rating: \" + \n\t \t\tJSON.parse(body).imdbRating + \"\\nCountry: \" + \n\t \t\tJSON.parse(body).Country + \"\\nLanguage: \" + \n\t \t\tJSON.parse(body).Language + \"\\nPlot: \" + JSON.parse(body).Plot + \n\t \t\t\"\\nActors: \" + JSON.parse(body).Actors + \"\\nRotten Tomatoes Score: \" \n\t \t\t+ JSON.parse(body).Ratings[1].Value);\n\t \t//The one below is in the requirements as Rotten Tomatoes page. However, \n\t \t//that information isn't provided by OMDb. I can't be certain Rotten \n\t \t//Tomatoes would contact me in a timely manner AND when I'm not at work. So,\n\t \t//this is my work-around solution. If I were actually doing this for a job,\n\t \t//I would use Rotten Tomatoes' form and have the code below as my backup \n\t \t//plan if they took too long to respond or denyed my request.\n\t \tconsole.log(\"Find it on IMDb: http://www.imdb.com/title/\" + JSON.parse(body).imdbID + \"/\");\n\t }\n\t});\n\tfs.appendFile(\"log.txt\", \" (%) Find movie: \" + term);\n}", "function prepareScreen5() {\r\n var div = document.getElementById(\"RatingRecords\");\r\n //czyszczenie zawartości\r\n while (div.firstChild) {\r\n div.removeChild(div.firstChild);\r\n }\r\n\t//petla po podslowach\r\n for (var i = 0; i < seeds.length; ++i) {\r\n\t\t//petla po slowach-ziarnach\r\n for (var j = 0; j < seeds[i].length; ++j) {\r\n\t\t\t//petla po wyszukanych bazodanowych rekordach\r\n for (var k = 0; k < searchResults[i][j].length; ++k) {\r\n var text = databaseSets[searchResults[i][j][k].DbSetNr];\r\n var seed = searchResults[i][j][k].seed;\r\n var index = searchResults[i][j][k].index;\r\n\t\t\t\tvar leftOffset = searchResults[i][j][k].moveLeft;\r\n var header1 = document.createElement('h3');\r\n header1.innerHTML = \"Podsłowo: \" + tokens[i];\r\n var header2 = document.createElement('h3');\r\n header2.innerHTML = \"Słowo- ziarno: \" + seeds[i][j].sequence;\r\n var header3 = document.createElement('h4');\r\n header3.innerHTML = \"Wynik: \" + searchResults[i][j][k].score.toString();\r\n if (searchResults[i][j][k].score < tresholdC)\r\n header3.innerHTML = header3.innerHTML + '<span style=\"color:#f00;\"> Rekord odrzucony</span>';\r\n var table = document.createElement('table');\r\n table.className = \"table table-bordered\";\r\n var row_0 = table.insertRow(table.rows.length);\r\n var row_1 = table.insertRow(table.rows.length);\r\n\t\t\t\t//petla po kolejnych nukleotydach w sekwencji\r\n for (var l = 0; l < text.length; ++l) {\r\n\t\t\t\t\t//wyswietlanie znalezionego rekordu z bazy\r\n row_0.insertCell(l).appendChild(document.createTextNode(text[l]));\r\n\t\t\t\t\t//wyswietlanie rozszerzonego podslowa \r\n\t\t\t\t\t//wyswietlenie pustych komorek\r\n if (l < index - leftOffset || l >= index - leftOffset + seed.length) {\r\n row_1.insertCell(l).appendChild(document.createTextNode(''));\r\n }\r\n\t\t\t\t\t//wyswietlenie nukleotydu rozszerzonego podslowa\r\n else {\r\n row_1.insertCell(l).appendChild(document.createTextNode(seed[l - index + leftOffset]));\r\n }\r\n }\r\n div.appendChild(header1);\r\n div.appendChild(header2);\r\n div.appendChild(header3);\r\n div.appendChild(table);\r\n }\r\n }\r\n }\r\n}", "function loadData(){\n\t//defining sample data\n\tvar strTableData='[{\"id\":0, \"title\":\"Winnie-the-Pooh\", \"minutes\":600, \"rating\":3, \"reviews\":90, \"author\":\"Author A\", \\\n\t\t\t\t\t\t\"description\":\"What happens when Sai and her mother meet a mother bear and her club? A beloved classic is born!\", \\\n\t\t\t\t\t\t\"image\":\"\"}, \\\n\t\t\t\t\t{\"id\":1, \"title\":\"Where the wild things are\", \"minutes\":540, \"rating\":4, \"reviews\":40, \"author\":\"Author B\", \\\n\t\t\t\t\t\t\"description\":\"What happens when Sai and her mother meet a mother bear and her club? A beloved classic is born!\", \\\n\t\t\t\t\t\t\"image\":\"\"}, \\\n\t\t\t\t\t{\"id\":2, \"title\":\"The snowy day\", \"minutes\":480, \"rating\":5, \"reviews\":80, \"author\":\"Author C\", \\\n\t\t\t\t\t\t\"description\":\"What happens when Sai and her mother meet a mother bear and her club? A beloved classic is born!\", \\\n\t\t\t\t\t\t\"image\":\"\"}, \\\n\t\t\t\t\t{\"id\":3, \"title\":\"Goodnight moon\", \"minutes\":420, \"rating\":3, \"reviews\":120, \"author\":\"Author D\", \\\n\t\t\t\t\t\t\"description\":\"What happens when Sai and her mother meet a mother bear and her club? A beloved classic is born!\", \\\n\t\t\t\t\t\t\"image\":\"\"}, \\\n\t\t\t\t\t{\"id\":4, \"title\":\"Blueberries for Sal\", \"minutes\":420, \"rating\":4, \"reviews\":271, \"author\":\"Robert McCloskey\", \\\n\t\t\t\t\t\t\"description\":\"What happens when Sai and her mother meet a mother bear and her club? A beloved classic is born!\", \\\n\t\t\t\t\t\t\"image\":\"\"}, \\\n\t\t\t\t\t{\"id\":5, \"title\":\"Owl Moon\", \"minutes\":380, \"rating\":4, \"reviews\":120, \"author\":\"Author E\", \\\n\t\t\t\t\t\t\"description\":\"What happens when Sai and her mother meet a mother bear and her club? A beloved classic is born!\", \\\n\t\t\t\t\t\t\"image\":\"\"}, \\\n\t\t\t\t\t{\"id\":6, \"title\":\"Little bear\", \"minutes\":570, \"rating\":2, \"reviews\":40, \"author\":\"Author F\", \\\n\t\t\t\t\t\t\"description\":\"What happens when Sai and her mother meet a mother bear and her club? A beloved classic is born!\", \\\n\t\t\t\t\t\t\"image\":\"\"}]';\n\n\tvar sampleJSON = JSON.parse(strTableData);\n\t\n\t//topRated\n\tif(bReads == false){\n\t\tvar length = Object.keys(sampleJSON).length;\n\t\tfor(var i=0; i<length; i++){\n\t\t\tfor( var j=i; j<length; j++){\n\t\t\t\tvar iRating = sampleJSON[i].rating;\n\t\t\t\tvar jRating = sampleJSON[j].rating;\n\t\t\t\t\n\t\t\t\tif(iRating < jRating){\n\t\t\t\t\tvar temp = sampleJSON[i];\n\t\t\t\t\tsampleJSON[i] = sampleJSON[j];\n\t\t\t\t\tsampleJSON[j] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tloadTableView(sampleJSON);\n}", "function searchFilmsByTitle(title) {\n let format = title.split(' ').join('+'); // replace spaces with plus\n $.ajax({\n url: `https://www.omdbapi.com/?apikey=ac155d96&s=${format}`,\n dataType: \"json\"\n }).done(function(resp) {\n if (resp.Search != null) {\n let respSize = resp.Search.length;\n for (let i = 0; i < respSize; i++) {\n if(resp.Search[i].Poster != 'N/A' && resp.Search[i].Type == 'movie') {\n let myHTML = \n `<div class=\"col-sm-6\">\n <a class=\"movie-select\" href=\"#\" id=\"${resp.Search[i].imdbID}\">\n <img class=\"movie-image\" src=\"${resp.Search[i].Poster}\">\n </a>\n </div>`;\n $(\"#movies\").append(myHTML);\n }\n }\n } else {\n let myHTML =\n `<div class=\"col-sm-12\">\n <div class=\"alert alert-primary col\" role=\"alert\">\n ${resp.Error}\n </div></div>`;\n $(\"#movies\").append(myHTML);\n }\n });\n }", "function getMovieList(callback){\n\tconst query = {\n\t\tapi_key: TMDB_API_AUTH.KEY,\n\t\tsort_by: \"release_date.desc\",\n\t\tpage: pageCounter\n\t};\n\t$.getJSON(TMDB_SEARCH_URL_MOVIES_LIST, query, callback);\n}", "function getMovies(searchText) {\r\n getData('https://www.omdbapi.com/?s=' + searchText + '&apikey=' + OMDBAPIKEY, function(err,\r\n response) {\r\n if (err) {\r\n return;\r\n }\r\n if (response.Search) {\r\n response.Search.pop();\r\n var omdbData = response.Search;\r\n var output = '';\r\n $.each(omdbData, (index, movie) => {\r\n output += htmlWriteResults(movie);\r\n });\r\n\r\n $('#movies').html(output);\r\n } else {\r\n // If we can't find any results we give a nice error message.\r\n $('#movies').html(\r\n '<section><div class=\"col-md-12\"><div class=\"well text-center\"><br><i class=\"fa fa-exclamation-triangle fa-4x whiteheader\" style=\"color: rgba(243,156,18, 1)\"></i><h2 class=\"whiteheader\">Sorry, but <b>' +\r\n searchText +\r\n '</b> gave no results</h2><br><p class=\"whiteheader\">But we would <i class=\"fa fa-heart\" style=\"color: rgba(231,76,60, 1)\"> </i> for you to try something else.</p></div></div></section>'\r\n );\r\n }\r\n });\r\n}", "function getDBKeywords(movieID){\n\t\tvar api = \"?api_key=933bee1465a61090ebe0704cd6d4c3e1\";\n\t\tvar baseURL = \"http://api.themoviedb.org/3\";\n\t\tvar query = `/movie/${movieID}/keywords`;\n\t\tvar url = baseURL+query+api;\n\n\t\t$.ajax({\n\t\t\turl: url,\n\t\t\tdatatype: 'json',\n\t\t\tsuccess:function(data){\n\t\t\t\tconsole.log(data)\n\t\t\t}\n\t\t});\n\t}", "function movie(b) {\n console.log(\"*******omdb*******\");\n\n var movieName = \"\";\n //if called from text function b will hold moviename else will be empty\n if (b == \"\") {\n // default movie\n if (term.length == 3)\n movieName = \"Mr. Nobody\";\n else {\n // get console song input\n for (var i = 2; i < term.length; i++) {\n if (i > 2 && i < term.length)\n movieName = movieName + \"+\" + term[i];\n }\n }\n } else\n movieName = b;\n\n // api call\n var url = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=40e9cece\";\n\n request(url, function(error, response, body) {\n if (!error && response.statusCode === 200) {\n result = JSON.parse(body);\n //console.log(result);\n //Title\n console.log(\"Title: \" + result.Title);\n //Year\n console.log(\"Year: \" + result.Year);\n //IMDB Rating\n console.log(\"IMDB Rating: \" + result.Ratings[0].Value);\n //RT rating\n if (typeof result.Ratings[1] != \"undefined\")\n console.log(\"Rotten Tomatoes Rating: \" + result.Ratings[1].Value);\n else\n console.log(\"No Rotten Tomatoes Rating.\");\n //Country Produced\n console.log(\"Produced In: \" + result.Country);\n //Plot\n console.log(\"Plot: \" + result.Plot);\n //Actors\n console.log(\"Actors / Actresses: \" + result.Actors);\n\n console.log(\"*****end omdb*****\");\n }\n if (error) {\n console.log(error);\n }\n });\n} //end movie", "function getMovieInfo(movie) {\n // If no movie is provided, get the deets for Mr. Nobody\n if (movie === \"\") {\n movie = \"Mr. Nobody\";\n }\n // Variable to hold the query URL\n let queryURL = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=trilogy\";\n // API request\n request(queryURL, function (error, response, body) {\n let movieResponse = JSON.parse(body);\n if (error || movieResponse.Response == \"False\") {\n console.log(\"Something went wrong. Try again?\", error);\n }\n else {\n let arrLog = [];\n arrLog.push(\"Title: \" + movieResponse.Title);\n arrLog.push(\"Year: \" + movieResponse.Year);\n arrLog.push(\"IMDB Rating: \" + movieResponse.Ratings[0].Value);\n arrLog.push(\"Rotten Tomatoes Rating: \" + movieResponse.Ratings[1].Value);\n arrLog.push(\"Produced in: \" + movieResponse.Country);\n arrLog.push(\"Language: \" + movieResponse.Language);\n arrLog.push(\"Plot: \" + movieResponse.Plot);\n arrLog.push(\"Actors: \" + movieResponse.Actors);\n arrLog.push(logSeparator);\n logAndStoreResults(arrLog);\n }\n });\n}", "function searchMovies(searchType, movie) {\n const url = `http://www.omdbapi.com/?t=${movie}&y=&plot=short&apikey=trilogy`;\n axios.get(url).then(\n function (response) {\n let data = \"\";\n //console.log(response.data);\n if (response.data !== null) {\n\n console.log(`Movie Title: ${response.data.Title}`);\n console.log(`Year Release: ${response.data.Year}`);\n console.log(`Imdb Rating: ${response.data.imdbRating}`);\n //response.data.Ratings.filter(\"\")\n let rott = \"\";\n if (Object.values(response.data.Ratings).length > 1) {\n rott = Object.values(response.data.Ratings[1]).join(\": \");\n\n } else {\n rott = \"Rotten tomatoes: not rated yet\";\n }\n console.log(rott);\n console.log(`Country: ${response.data.Country}`);\n console.log(`Languages: ${response.data.Language}`);\n console.log(`Plot: ${response.data.Plot}`);\n console.log(`Main Cast: ${response.data.Actors}`);\n console.log(`------------------------------------------------------`);\n rott = rott.split(\":\");\n data = `{\"${searchType} ${movie}\":{\n \"Movie Title\": \"${response.data.Title}\"\n \"Year Release\": \"${response.data.Year}\",\n \"Imdb Rating\": \"${response.data.imdbRating}\",\n \"${rott[0]}\":\"${rott[1]}\",\n \"Country\": \"${response.data.Country}\",\n \"Languages\": \"${response.data.Language}\",\n \"Plot\": \"${response.data.Plot}\",\n \"Main Cast\": \"${response.data.Actors}\"\n },`\n } else {\n console.log(\"movie not found\");\n }\n\n logData(data);\n }\n ).catch(err => {\n console.log(`Oh oh, something went wrong...${err}`);\n continueMenu();\n });\n}", "function searchFilm() {\n if (searchQuery.length === 0) {\n searchQuery = \"Mr. Nobody\"\n }\n request(`http://www.omdbapi.com/?t=${searchQuery}&plot=short&apikey=5d94fa00`, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n console.log(`Movie: ${JSON.parse(body).Title}`);\n console.log(`Starring: ${JSON.parse(body).Actors}`);\n console.log(`Year: ${JSON.parse(body).Year}`);\n console.log(`Origin: ${JSON.parse(body).Country}`);\n console.log(`Language: ${JSON.parse(body).Language}`);\n console.log(`IMDB Rating: ${JSON.parse(body).imdbRating}`);\n console.log(`Tomato-meter: ${JSON.parse(body).Ratings[1].Value}`);\n console.log(`Synopsis: ${JSON.parse(body).Plot}`); \n }\n });\n}", "function read_list(search_string) {\n console.log(\"Loading slidelist ...\");\n $.ajax({\n\ttype:'GET',\n\tdataType:'text', \n\tasync: false,\n\turl: slidelist,\n\tdata: {},\n\tsuccess: function(data) {pic_list = data.split('\\n');},\n error: function(jqXHR, textStatus, errorThrown) {console.log(\"read slidelist error: \" + errorThrown);}\n });\n console.log(\"Done loading slidelist\");\n $.ajax({\n\ttype:'GET',\n\tdataType:'text',\n\tasync: false,\n\turl: videolist,\n\tdata: {},\n\tsuccess: function(data) {vid_list = data.split('\\n');},\n error: function(jqXHR, textStatus, errorThrown) {console.log(\"read videolist error: \" + errorThrown);}\n });\n picvid_list = pic_list\n picvid_list = picvid_list.concat(vid_list); // repeat if you want more video clips\n// picvid_list = picvid_list.concat(vid_list);\n picvid_list = picvid_list.filter(String) // Remove empty values\n console.log(\"db read_list1: p=\" + pic_list.length + \" v=\" + vid_list.length + \" pv=\" + picvid_list.length);\n// console.log(\"db read_list2: p=\" + pic_list); // carefule, can be very long, 100k+\n\n picvid_list.sort(function(a, b){return 0.5 - Math.random()});\n}", "function searchMovie(movieName){\n var fix=movieName.replace(/ /g,\"+\");\n console.log(fix);\n //dauflt when name is undefine\n\n axios.get(\"http://www.omdbapi.com/?t=\"+fix+\"&y=&plot=short&apikey=trilogy\").then(\n function(response) {\n console.log(\"Movie Title: \"+response.data.Title);\n console.log(\"Year: \"+response.data.Year);\n console.log(\"IMDB Rating: \"+response.data.Ratings[0]);\n console.log(\"Rotten Rating: \"+response.data.Ratings[1]);\n console.log(\"Conutry: \"+response.data.Country);\n console.log(\"Language: \"+response.data.Language);\n console.log(\"Plot of Movie: \"+response.data.Plot);\n console.log(\"Actors List: \"+response.data.Actors);\n console.log(\"-------------------------------------\");\n })\n .catch(function(error) {\n console.log(\"error\");\n });\n\n}", "function getMovieTitle() {\r\n\t\tvar title = new String ( document.title.replace(' on All Consuming', '') );\r\n\t\t/* get rid of subtitles and editions. they just get in the way of the search */\r\n\t\ttitle = title.replace(/ - .*/gi, '');\r\n\t\ttitle = title.replace(/ \\(\\w*screen edition\\)/gi, '');\r\n\t\treturn title;\r\n\t}", "function filter_movie_data_by_title(title) {\n\tfiltered_data = [];\n\t$(sf_movie_data).each( function(i,data){\n\t\tif (data[8] == title) {\n\t\t\tfiltered_data.push(data);\n\t\t}\n\t} );\n\treturn filtered_data;\n}", "function OMDBKeywordQuery(keyword, apiKey) {\n var keywordURL =\n \"https://www.omdbapi.com/?s=\" + keyword + \"&apikey=\" + apiKey;\n\n //This code performs the ajax query call based on the URL and returns response object respKeywordMovie\n $.ajax({\n url: keywordURL,\n method: \"GET\",\n }).then(function (respKeywordMovie) {\n var countRowDiv3 = 0;\n var rowDiv3 = $(\"<div>\").attr(\"class\", \"row\");\n\n //if the object returns an error call noResultsFound function\n if (respKeywordMovie.Error === \"Movie not found!\") {\n noResultsFound($(\"#movieContent\"));\n }\n\n //this opens the collapsible div when the results are rendered\n instance.open(0);\n\n //badge count\n $(\"#MovieCount\").text(respKeywordMovie.Search.length);\n\n //execite a function for each index of respKeywordMovie.Search object\n $.each(respKeywordMovie.Search, function (index) {\n //The below if statement, else statement and code within's purpose is to render only four objects with col classes into a div with class row. Once four have been rendered a new row div is created.\n //this if statement runs the code within for the first four indexes (indexes: 0,1,2,3) of the response object.\n if (countRowDiv3 < 3) {\n var colDiv3 = $(\"<div>\").attr(\"class\", \"col s12 m6 l4\");\n\n rowDiv3.append(\n colDiv3.append(\n $(\"<p>\").text(\"Title: \" + respKeywordMovie.Search[index].Title)\n )\n );\n rowDiv3.append(\n colDiv3.append(\n $(\"<p>\").text(\"Type: \" + respKeywordMovie.Search[index].Type)\n )\n );\n rowDiv3.append(\n colDiv3.append(\n $(\"<p>\").text(\n \"Release year: \" + respKeywordMovie.Search[index].Year\n )\n )\n );\n rowDiv3.append(\n colDiv3.append(\n $(\"<img>\").attr({\n src: respKeywordMovie.Search[index].Poster,\n alt: \"Movie Poster\",\n })\n )\n );\n\n countRowDiv3++;\n //This else runs once the countRowDiv variable hits four.\n } else {\n $(\"#movieContent\").append(rowDiv3);\n rowDiv3 = $(\"<div>\").attr(\"class\", \"row\");\n countRowDiv3 = 0;\n }\n //This line of code exists here because if the response object returns a number of results that is not divisible by 4 a row is never completely filled and doesn't get appended to bookcontent div by else statment.\n $(\"#movieContent\").append(rowDiv3);\n });\n });\n}", "function parse_sidearm_special(doc,sidearm) {\n console.log(\"in parse_sidearm_special\");\n var title_map=assign_title_map(sidearm.rows[0]);\n var ctr=1,k,curr_ret;\n console.log(\"title_map=\"+JSON.stringify(title_map));\n var j=1,curr_th,curr_name,curr_title,curr_email,curr_phone;\n console.log(sidearm.rows[j].className);\n while(j >=0 && j < sidearm.rows.length) {\n curr_ret={};\n if(ctr>10) break;\n console.log(\"j=\"+j+\", \"+sidearm.rows[j].cells.length);\n for(k=0; k < sidearm.rows[j].cells.length; k++) {\n if(title_map[k]!==undefined) curr_ret[title_map[k]]=sidearm.rows[j].cells[k].innerText.trim();\n }\n console.log(\"clunk curr_ret=\"+JSON.stringify(curr_ret));\n if(curr_ret.name!==undefined) add_fields(curr_ret,ctr++);\n j++;\n }\n if(ctr===1) return false;\n if(!my_query.submitted && (submit_if_done()||true)) return true;\n return false;\n }", "function movieGet() {\n\tgetMovie = 'https:/www.amazon.com/s?k=' + searchTermURL + '&i=instant-video';\n\tsetContent();\n}", "movieContent(xhr, results, resultText) {\n let utilities=this;\n utilities.setResult(results);\n let items = document.querySelector('#item');\n\n\n let createList=document.querySelectorAll(\".create_new_list\");\n\n\n if (![\" \", \"\", undefined].includes(results) && Array.of(results).hasOwnProperty('0')\n && ![\" \",0,\"\",undefined].includes(results.length)){\n\n\n let remove = document.querySelectorAll('table');\n\n remove.forEach(function (value) {\n value.remove();\n\n });\n\n\n for (let x = 0; x < results.length; x++) {\n\n if(!results[x].hasOwnProperty(\"description\")){\n\n let img = \"http://image.tmdb.org/t/p/w185/\" + results[x].poster_path;\n items.innerHTML +=\n\n\n `\n <table class=\"item\">\n <tbody>\n <tr>\n <td >\n \n <div class='overview'>\n <div>\n <img class=\"back_drop_img\" src=\"${img}\" alt=\"\"/>\n <span class=\"vote_average\">\n ${results[x].vote_average}\n </span> \n <span class='movie_title'>\n ${results[x].original_title.substr(0, 20)}\n \n </span> \n \n </div> \n <span class=\"release_date\"> \n <span >\n Release Date \n </span> ${results[x].release_date}\n \n \n </span>\n \n <div class=\"back_drop_title\">\n \n \n \n \n \n </div>\n <div>\n \n \n \n </div>\n \n <div class=\"result_overview\">\n \n ${results[x].overview.substr(0, 120)} ......\n <div class='emotions'> \n <fieldset class=\"rating_content\">\n \n <input type=\"radio\" id=\"star5${x}\" name=\"rating\" title=\"10\" />\n <label class = \"full\" for=\"star5${x}\" title=\"9.50\"> </label>\n <input type=\"radio\" id=\"star4half${x}\" name=\"rating\" title=\"9\" />\n <label class=\"half\" for=\"star4half${x}\" title=\"8.50\"> </label>\n <input type=\"radio\" id=\"star4${x}\" name=\"rating\" title=\"8\" />\n <label class = \"full\" for=\"star4${x}\" title=\"7.50\"> </label>\n <input type=\"radio\" id=\"star3half${x}\" title=\"7\" name=\"7\" />\n <label class=\"half\" for=\"star3half${x}\" title=\"6.50\"> </label>\n <input type=\"radio\" id=\"star3${x}\" name=\"rating\" title=\"6\" />\n <label class = \"full\" for=\"star3${x}\" title=\"5.50\"> </label>\n <input type=\"radio\" id=\"star2half${x}\" name=\"rating\" title=\"5\" />\n <label class=\"half\" for=\"star2half${x}\" title=\"4.50\"> </label>\n <input type=\"radio\" id=\"star2${x}\" title=\"4\" name=\"rating\" />\n <label class = \"full\" for=\"star2${x}\" title=\"3.50\"> </label>\n <input type=\"radio\" id=\"star1half${x}\" title=\"3\" name=\"rating\" />\n <label class=\"half\" for=\"star1half${x}\" title=\"2.50\"> </label>\n <input type=\"radio\" title=\"2\" id=\"star1${x}\" name=\"rating\" />\n <label class = \"full\" for=\"star1${x}\" title=\"1.50\"> </label>\n <input type=\"radio\" title=\"1\" id=\"starhalf${x}\" name=\"rating\" />\n <label class=\"half\" for=\"starhalf${x}\" title=\"0.50\"> </label>\n\n </fieldset>\n <div class=\"rating\" title=\"Rate movie\"><span class=\"rate\">&star;</span></div>\n \n \n <div class=\"rating_content_confirm\">\n \n </div>\n \n \n <div class=\"favorite\" title=\"Favorite\"><span class=\"favorite-text\" >&heartsuit;<span></div>\n <div class='add_to_list' title=\"Add to list\">&#9016;\n \n </div><div class='add_to_watchlist' title=\"Add to watch later\">&#x2b94;\n \n </div>\n <div class='watch_trailer' title=\"Watch trailer\">&#9654;</div> <span> </span>\n </div>\n </div>\n \n \n </div>\n \n \n \n </td> \n </tr>\n <tbody>\n </table>\n \n \n \n \n `\n ;\n\n\n let movieCount = document.querySelector(\"#movie_count\");\n document.querySelector('#total_pages_title').innerHTML = \"Total pages\";\n\n if(resultText.hasOwnProperty(\"total_pages\")){\n\n movieCount.textContent = \"\" + resultText.total_results;\n document.querySelector('#qty').innerHTML = resultText.total_pages;\n\n\n }\n\n\n }\n if ((results[x].hasOwnProperty(\"description\") ||\n results[x].hasOwnProperty(\"media_type\")) &&\n ![\"\",\" \",undefined].includes(results[x].list_type)){\n utilities.setListId(results[x].id, x);\n\n\n let items = document.querySelector('#item');\n let img = \"http://image.tmdb.org/t/p/w185/\" + results[x].backdrop_path;\n let description = \"\";\n\n if (![\"\", \" \", undefined].includes(results[x].description)) {\n\n description = results[x].description.substr(0, 669);\n }\n if(![\"\",\" \",undefined].includes(results[x].overview)){\n\n description=results[x].overview.substr(0, 669);\n }\n\n //String literal template\n items.innerHTML += `\n <table class=\"item\">\n <tbody>\n <tr>\n <td >\n \n <div class='overview'>\n <div>\n <img class=\"back_drop_img\" src=\"${img}\" alt=\"\"/>\n <span class=\"vote_average\">\n ${results[x].item_count}\n </span> \n \n <span class='movie_title'>\n List name\n \n </span>\n <span class=\"release_date\"> \n ${results[x].name.substr(0, 20)}\n \n \n \n </span> \n \n </div> \n <span class='movie_title'>\n Type \n </span>\n <span class=\"release_date\">\n \n ${results[x].list_type}\n \n </span>\n\n <div>\n \n </div>\n \n <div class=\"result_overview\">\n \n ${description.substr(0, 150)} ......\n </div>\n <div class='emotions_list'>\n\n <div class=\"favorite_count\" title=\"Favorite count\"><span\n class=\"favorite-text\"> ${results[x].favorite_count}<span></div>\n <div class='list_items' title=\"Items\">&#9016;\n\n </div\n class='delete_items' >\n <div class='delete_items' title=\"Remove item\">&times;</div>\n <span> </span>\n </div>\n \n \n </div>\n \n \n \n </td> \n </tr>\n <tbody>\n </table>\n \n \n \n \n `\n ;\n\n let movieCount = document.querySelector(\"#movie_count\");\n\n document.querySelector('#total_pages_title').innerHTML = \"Total pages\";\n\n if (resultText.hasOwnProperty(\"total_pages\")) {\n\n movieCount.textContent = \"\" + resultText.total_results;\n document.querySelector('#qty').innerHTML = resultText.total_pages;\n\n\n }\n\n let overview = document.querySelectorAll(\".result_overview\");\n if (window.matchMedia((\"max-width:500px\"))) {\n\n\n overview[x].textContent = description.substr(0, 100) + \"......\";\n\n }\n\n\n }\n\n\n let movieCount = document.querySelector(\"#movie_count\");\n let selectedListContent = document.querySelectorAll(\".create_list\" );\n selectedListContent[0].style.display=\"none\";\n document.querySelector('#total_pages_title').innerHTML = \"Total pages\";\n if (resultText.hasOwnProperty(\"total_pages\")) {\n movieCount.textContent = \"\" + resultText.total_results;\n document.querySelector('#qty').innerHTML = resultText.total_pages;\n\n\n }\n\n\n\n\n\n\n }\n\n\n\n let ratingContent = document.querySelectorAll(\".rating_content\");\n let favorite = document.querySelectorAll(\".favorite\");\n let item = document.querySelectorAll(\".item\");\n let rating = document.querySelectorAll(\".rating\");\n let stars = document.querySelectorAll(\".half, .full\");\n let closeCreateList=document.querySelectorAll(\".close_createList\");\n\n let selectedMovie = document.querySelector(\"#selected_movie\" );\n let scroller= document.querySelector(\"#scroll_list\" );\n let selectedListContent = document.querySelectorAll(\".create_list\" );\n let createdList = document.querySelector(\"#created_list\" );\n let deleteResrc=document.querySelector(\"#delete_list\");\n let player = document.querySelector(\"#video_player\");\n let sorted=document.querySelector(\"#sorted\");\n let visibility=document.querySelector(\"#visibility\");\n let addToWatchlist=document.querySelectorAll(\".add_to_watchlist\");\n let watchTrailer = document.querySelectorAll(\".watch_trailer\");\n let listItems=document.querySelectorAll(\".list_items\");\n let deleteListItem=document.querySelectorAll(\".delete_items\");\n let closePlayer = document.querySelectorAll(\".close_player\");\n let movieSource = document.querySelectorAll(\".video_1\");\n\n\n let next = document.querySelector(\"#next\");\n\n let prev = document.querySelector(\"#prev\");\n\n\n prev.addEventListener(\"click\", function (ev) {\n\n\n utilities.preview(utilities.getIsFavorite(), utilities.getIsList(), utilities.getIsWatchList());\n ev.stopPropagation();\n ev.stopImmediatePropagation();\n\n });\n\n next.addEventListener(\"click\", function (ev) {\n\n utilities.nextView(utilities.getIsFavorite(), utilities.getIsList(), utilities.getIsWatchList());\n ev.preventDefault();\n ev.stopImmediatePropagation();\n\n });\n\n\n ['click', 'touch', 'mouseenter', 'mouseover', 'mouseleave'].forEach(function (event) {\n\n\n let addToList = document.querySelectorAll(\".add_to_list\");\n\n\n scroller.addEventListener(\"scroll\", function () {\n\n selectedListContent[0].style.display = \"none\";\n\n });\n\n\n let listItem = document.querySelector('#list_name');\n let listDescription = document.querySelector('#list_description');\n let createContentConfirm = document.querySelector(\"#create_content_confirm\");\n let isAddNewList;\n\n\n item.forEach(function (el, itemIndex) {\n\n\n el.addEventListener(\"mouseleave\", function () {\n let watchlist = addToWatchlist.item(itemIndex);\n let fav = favorite.item(itemIndex);\n let list = addToList.item(itemIndex);\n let addToWatchLater = addToWatchlist.item(itemIndex);\n if (![fav, watchlist, list, addToWatchLater].includes(null)) {\n fav.innerHTML = '&heartsuit;';\n fav.title = \"Favorite\";\n fav.style.background = \"gold\";\n watchlist.innerHTML = \"&#x2b94;\";\n watchlist.style.background = \"gold\";\n list.innerHTML = '&#9016';\n list.style.background = \"gold\";\n list.title = \"Add to list\";\n addToWatchLater.innerHTML = '&#x2b94;';\n addToWatchLater.style.color = \"black\";\n addToWatchLater.background = \"gold\";\n addToWatchLater.title = \"Add to watch later\";\n watchlist.title = \"Add to watch later\";\n }\n\n\n });\n addToWatchlist.forEach(function (el, key) {\n\n\n el.addEventListener(event, function (ev) {\n\n ev.preventDefault();\n ev.stopPropagation();\n\n\n if (key === itemIndex) {\n\n\n selectedListContent.item(0).scrollIntoView(true);\n\n\n }\n\n\n if ([\"click\", \"mouseleave\", \"mouseover\"].includes(ev.type) && key === itemIndex) {\n\n selectedMovie.innerHTML = \"\" + results[key].original_title;\n\n\n\n utilities.getWatchLater(xhr, results[key].id, itemIndex, el, ev, utilities);\n\n\n }\n });\n });\n\n watchTrailer.forEach(function (el, key) {\n\n el.addEventListener(event, function (ev) {\n\n\n if (ev.type === \"mouseover\") {\n utilities.confirmation(key, \"Play trailer\");\n }\n\n if (ev.type === \"click\") {\n utilities.setIsLoaded(true);\n\n\n player.style.display = \"inline-block\";\n\n\n if (key === itemIndex && ![undefined].includes(results[itemIndex].id)) {\n\n utilities.watchTrailer(xhr, key, movieSource, results[itemIndex].id);\n\n return false;\n }\n\n\n }\n\n\n utilities.exitPlayer(closePlayer, player, movieSource);\n\n });\n\n\n });\n\n\n favorite.forEach(function (el, key) {\n\n\n el.addEventListener(event, function (ev) {\n\n ev.preventDefault();\n ev.stopPropagation();\n\n\n if (itemIndex === key && ![undefined].includes(results[itemIndex].id)) {\n\n if (ev.type === \"mouseleave\") {\n el.innerHTML = '&heartsuit;';\n el.title = \"Favorite\";\n el.style.color = \"black\";\n el.style.background = \"gold\";\n\n }\n\n if (ev.type === \"mouseover\") {\n el.innerHTML = '&heartsuit;';\n el.title = \"Favorite\";\n el.style.color = \"gray\";\n el.style.background = \"gold\";\n\n }\n\n\n if ([\"mouseover\", \"click\"].includes(ev.type)) {\n\n utilities.getFavorite(xhr, results[itemIndex], key, el, ev, utilities);\n }\n\n\n }\n\n\n });\n\n\n return false;\n });\n\n\n rating.forEach(function (rating, index) {\n\n rating.addEventListener(event, function (ev) {\n\n\n if (index === itemIndex) {\n utilities.setIndex(index);\n stars.forEach(function (el) {\n\n\n el.addEventListener('click', function (ev) {\n\n utilities.getRating(xhr, results[utilities.getIndex()].id, utilities.getIndex(),\n rating, ev, el.getAttribute('title'), false, utilities);\n\n\n\n\n ev.stopPropagation();\n ev.stopImmediatePropagation();\n\n\n })\n\n });\n\n if (ev.type === \"mouseleave\") {\n ratingContent.item(itemIndex).style.display = \"none\";\n\n }\n\n if (ev.type === \"mouseenter\") {\n\n ratingContent.item(itemIndex).style.display = \"block\";\n\n\n }\n\n ratingContent.item(itemIndex).addEventListener(event, function (ev) {\n\n if (ev.type === \"mouseleave\") {\n\n ratingContent.item(itemIndex).style.display = \"none\";\n return false;\n }\n if (ev.type === \"mouseenter\") {\n\n\n ratingContent.item(itemIndex).style.display = \"block\";\n\n return false;\n }\n\n\n });\n\n\n if ([\"mouseover\", \"mouseleave\", \"click\", \"touch\"].includes(ev.type)) {\n\n\n\n if (ev.type === \"mouseenter\") {\n utilities.confirmation(itemIndex, \"Make rating\");\n }\n\n\n utilities.getRating(xhr, results[itemIndex].id, itemIndex, rating, ev, \"\", true, utilities);\n\n\n\n return false;\n }\n\n return false;\n\n }\n\n\n })\n });\n\n\n deleteListItem.forEach(function (el, key) {\n\n el.addEventListener(event, function (ev) {\n\n if ([\"click\", \"touch\"].includes(ev.type)) {\n\n if (key === itemIndex) {\n createdList.value = results[key].name;\n\n utilities.getListNames(xhr, createdList, createdList);\n\n\n return false\n\n }\n\n }\n\n ev.stopPropagation();\n ev.preventDefault();\n\n\n });\n\n return false;\n\n });\n\n\n listItems.forEach(function (el, key) {\n el.addEventListener(event, function (ev) {\n if (ev.type === \"click\") {\n\n if (key === itemIndex) {\n\n\n utilities.setListIdForQuery(utilities.getListId()[key]);\n utilities.setIsList(true);\n utilities.getListDetails(xhr, utilities.getListId()[key], ev, listItems, results[itemIndex], itemIndex, utilities);\n return false;\n }\n\n }\n ev.preventDefault();\n ev.stopPropagation();\n\n })\n\n });\n\n });\n\n addToList.forEach(function (el, index) {\n\n el.addEventListener(event, function (ev) {\n\n\n item.forEach(function (el, itemIndex) {\n\n\n if (itemIndex === index) {\n utilities.setIndex(itemIndex);\n if ([\"mouseover\"].includes(ev.type)) {\n utilities.getListItem(createdList, utilities);\n utilities.confirmation(itemIndex, \"Make list\");\n selectedMovie.innerHTML = \"\" + results[index].original_title;\n\n\n }\n\n\n if (utilities.getIsList()) {\n\n\n if (ev.type === \"mouseover\") {\n utilities.confirmation(index, \"Remove item\");\n selectedListContent.item(0).style.display = \"none\";\n\n addToList.item(index).innerHTML = '&times;';\n addToList.item(index).title = \"Remove item\";\n\n\n }\n\n if (ev.type === \"mouseleave\") {\n\n\n addToList.item(index).innerHTML = '&#9016;';\n addToList.item(index).title = \"Remove item\";\n\n\n }\n\n if ([\"click\", \"touch\"].includes(ev.type)) {\n\n\n if (index === itemIndex) {\n\n utilities.deleteMovie(xhr, el, listItems, utilities.getListIdForQuery(), utilities.getResult()[itemIndex].id, utilities.getIndex())\n\n }\n\n\n\n\n\n }\n\n\n } else {\n\n\n if ([\"mouseover\"].includes(ev.type)) {\n\n utilities.getListItem(createdList, utilities);\n utilities.confirmation(itemIndex, \"Make list\");\n selectedMovie.innerHTML = \"\" + results[index].original_title;\n\n\n }\n\n\n if ([\"touch\", \"click\"].includes(ev.type)) {\n selectedListContent[0].style.display = \"block\";\n closePlayer[0].click();\n\n\n if (isAddNewList) {\n\n isAddNewList = false;\n\n selectedListContent[0].style.display = \"block\";\n\n } else if (isAddNewList === false) {\n\n selectedListContent[0].style.display = \"none\";\n isAddNewList = true;\n }\n\n\n }\n\n\n }\n\n deleteResrc.addEventListener(\"click\", function (ev) {\n\n ev.preventDefault();\n\n if (index === itemIndex) {\n\n if (![\"\", undefined].includes(createdList.value)) {\n utilities.setIsList(false);\n utilities.getListNames(xhr, createdList, createdList);\n\n } else {\n let createContentConfirm = document.querySelector(\"#create_content_confirm\");\n utilities.listMessage(createContentConfirm, \"Select a list to delete\");\n }\n\n\n ev.stopPropagation();\n ev.stopImmediatePropagation();\n ev.stopPropagation();\n\n }\n\n\n });\n\n\n selectedListContent[0].addEventListener(event, function (ev) {\n if ([\"mouseover\"].includes(ev.type)) {\n\n utilities.setIsList(true);\n\n }\n\n if ([\"mouseleave\"].includes(ev.type)) {\n\n utilities.setIsList(false);\n }\n ev.preventDefault();\n });\n\n\n createList.item(0).addEventListener(event, function (ev) {\n\n\n if ([\"click\", \"touch\"].includes(ev.type) && ev.target.value === \"Create list\") {\n\n selectedListContent.item(0).style.display = \"block\";\n\n\n if (ev.target.value === \"Create list\") {\n\n let listName = listItem.value;\n let listDesc = listDescription.value;\n\n\n if (![\"\", \" \", null, undefined].includes(listName)) {\n\n\n utilities.makeList(xhr, listName, listDesc, utilities, createContentConfirm, visibility.value, sorted.value);\n\n\n } else {\n\n utilities.listMessage(createContentConfirm, \"List name must be provided\");\n\n return false;\n\n\n }\n\n\n }\n\n\n }\n\n\n createList = document.querySelectorAll(\".create_new_list\");\n ev.stopPropagation();\n ev.preventDefault();\n ev.stopImmediatePropagation();\n });\n\n\n createList.item(1).addEventListener(event, function (ev) {\n\n\n if ([\"click\", \"touch\"].includes(ev.type) && ev.target.value === \"Add movie\") {\n\n\n if (![\"\", undefined].includes(results[itemIndex])) {\n if (utilities.getIsList()) {\n\n utilities.addMovie(xhr, createList[0], utilities.temp.count, utilities.getResult()[utilities.getIndex()].id, selectedMovie);\n }\n\n } else {\n\n utilities.listMessage(createContentConfirm, \"We can add this movie at the moment try again later\");\n }\n\n\n }\n\n createList = document.querySelectorAll(\".create_new_list\");\n ev.stopPropagation();\n ev.preventDefault();\n ev.stopImmediatePropagation();\n });\n\n\n return false;\n }\n\n\n });\n\n\n closeCreateList.item(0).addEventListener(\"click\", function () {\n selectedListContent.item(0).style.display = \"none\";\n utilities.setIsList(false);\n scroller.style.overflowY = \"scroll\";\n\n\n });\n\n\n ev.preventDefault();\n ev.stopPropagation();\n ev.stopImmediatePropagation();\n\n });\n\n\n });\n\n if ((utilities.getIsFavorite() && window.getComputedStyle(player).display === \"block\") ||\n (utilities.getIsWatchList() && window.getComputedStyle(player).display === \"block\")) {\n utilities.restoreDown();\n\n document.querySelectorAll(\".restore_down\")[0].click();\n\n scroller.style.overflowY = \"scroll\";\n selectedListContent[0].style.display = \"none\";\n\n } else {\n closePlayer[0].click();\n }\n\n\n });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n } else {\n\n let movieCount = document.querySelector(\"#movie_count\");\n movieCount.textContent = \"0\";\n ReactDOM.findDOMNode(document.getElementById('qty')).textContent = 0;\n ReactDOM.findDOMNode(document.getElementById('total_pages_title')).innerHTML = \"Total pages\";\n\n\n let noResultException = document.querySelectorAll('#item');\n\n noResultException[0].innerHTML = \"<table class='item'><tbody><tr><td >\" +\n \"<p id='search_result'>Your search yield no results check your spellings and try again</p></td></tr> </tbody></table>\"\n\n\n }\n\n\n }", "function searchOMDb() {\n // vars to build url string for axios:\n var movieTitle = \"\";\n var OMDBkey = keys.omdb.key; //key stored in gitignored .env file, ref'd thru keys.js\n\n /* if nothing is entered after the 'movie-this' command, Jaco Van Dormael's criminally-underrated \n surrealist sci-fi masterpiece 'Mr. Nobody' will be assigned to the movieTitle var by default */\n if (input[1] === undefined) {\n movieTitle = \"Mr. Nobody\";\n } else {\n movieTitle = input.slice(1).join(\" \"); //otherwise the title will be built by joining the rest of the inputs into a string with each item separated by a space\n }\n\n //axios request:\n axios.get(\"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=\" + OMDBkey).then(\n function(response) { \n \n if (response.data.Title === undefined) { //checks if first item in the return array(in this case, 'Title', is undefined; defaults out with a message if so)\n console.log(movieBumpers);\n console.log(\"Sorry, I don't know that movie! Have you tried the Lost Films subreddit @ https://www.reddit.com/r/Lost_Films/ ?\");\n console.log(movieBumpers);\n return;\n }\n\n //successful query returns block of console logs with strings formatted for readability(in the terminal, anyway)\n console.log(movieBumpers);\n console.log(beginBold + \"Title: \" + endBold + response.data.Title);\n console.log(beginBold + \"Release year: \" + endBold + response.data.Year);\n console.log(beginBold + \"IMDb user rating(out of 10): \" + endBold + response.data.imdbRating);\n console.log(beginBold + \"RottenTomatoes score(out of 100%): \" + endBold + response.data.Ratings[1].Value); //<- well this one took a lot of trial and error to figure out how to reference....\n console.log(beginBold + \"Country of production: \" + endBold + response.data.Country);\n console.log(beginBold + \"Language: \" + endBold + response.data.Language);\n console.log(beginBold + \"Plot synopsis: \" + endBold + response.data.Plot);\n console.log(beginBold + \"Starring: \" + endBold + response.data.Actors);\n console.log(movieBumpers);\n\n logFile(\"\\nOMDb search returned: \" + response.data.Title + \", \" + response.data.Year); //pass some of the data as an argument to logFile function which will add it to log.txt\n }\n );\n}", "function updateMovieList(responseDetails, id, pageStart) {\r\n\r\n var parser = c('div');\r\n parser.innerHTML = responseDetails.responseText;\r\n \r\n // get the table\r\n var t = parser.getElementsByTagName('table');\r\n \r\n if (t.length == 0){\r\n GM_log(\"Cannot process movie list\");\r\n return;\r\n }\r\n \r\n var newMovieCount = 0;\r\n \r\n var TRs;\r\n \r\n for(var x=0; x < t.length; x++){\r\n var TR = t[x].getElementsByTagName('tr');\r\n\r\n if ( TR.length == 0)\r\n continue;\r\n \r\n if ( TR[0].className != \"list_item\" )\r\n continue;\r\n\r\n TRs = TR;\r\n break;\r\n }\r\n \r\n if ( typeof TRs === 'undefined' ){\r\n GM_log(\"Unabe to detect movie table in list!\"); \r\n return;\r\n }\r\n \r\n var previousMovies = latestMovies[id];\r\n latestMovies[id] = new Array;\r\n \r\n for (var j = 1; j < TRs.length; j++ ){\r\n \r\n var TDs = TRs[j].getElementsByTagName('td');\r\n var title = '';\r\n var url = '';\r\n var yourRating = 0;\r\n var usrRating = 0;\r\n \r\n for (var k=0; k < TDs.length; k++ ){\r\n\r\n if ( TDs[k].className == 'title' ){\r\n var a = TDs[k].childNodes[0];\r\n title = a.innerHTML;\r\n matches = a.href.match(/tt[0]*(\\d+)\\/$/);\r\n url = matches[1];\r\n }\r\n\r\n if ( TDs[k].className == 'user_rating' ){\r\n usrRating = TDs[k].innerHTML;\r\n }\r\n \r\n if ( TDs[k].className == 'your_ratings'){\r\n\t\tif (yourRating == 0) {\r\n\t\t\tfor (var ll=0; ll < TDs[k].childNodes.length; ll++) {\t\t\t\r\n\t\t\t\tif (TDs[k].childNodes[ll].childNodes.length == 1) {\r\n\t\t\t\t\tyourRating = TDs[k].childNodes[ll].childNodes[0].nodeValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n }\r\n\t \r\n if ( TDs[k].className == 'rater_ratings' ){\r\n\t\tfor (var ll=0; ll < TDs[k].childNodes.length; ll++) {\t\t\t\r\n\t\t\tif (TDs[k].childNodes[ll].childNodes.length == 1) {\r\n\t\t\t\tyourRating = TDs[k].childNodes[ll].childNodes[0].nodeValue;\r\n\t\t\t}\r\n\t\t}\r\n }\r\n }\r\n\t\r\n //if this is your own list then the votes stand in yourRating\r\n //if its another list it stands in usrRating -> always copy to yourRating\r\n if ( yourRating == 0 )\r\n yourRating = usrRating;\r\n \r\n if (title == '')\r\n continue;\r\n \r\n if (movieCollection[id].indexOf(url) == -1){\r\n //store new movie\r\n movieCollection[id].push(url);\r\n voteCollection[id].push(yourRating);\r\n movieTitles[id].push(title);\r\n\r\n if ( pageStart == 1) //latest movie can only be on first page\r\n latestMovies[id].push( movieCollection[id].length-1 );\r\n \r\n newMovieCount += 1;\r\n } else {\r\n //update vote for movie\r\n voteCollection[id][movieCollection[id].indexOf(url)] = yourRating;\r\n } \r\n \r\n //GM_log( title + \" (\" + url + \"), \" + yourRating + \", \" + id );\r\n }\r\n \r\n //push previous movies\r\n for(var k=0; k < previousMovies.length; k++)\r\n latestMovies[id].push( previousMovies[k] );\r\n \r\n var newMovies = 0;\r\n \r\n //keep only 5 latest movies\r\n while( latestMovies[id].length > maxRecent ){\r\n latestMovies[id].pop();\r\n newMovies++;\r\n }\r\n\r\n //store arrays into cache\r\n GM_setValue(\"movieCollection\" + id, movieCollection[id].join('|'));\r\n GM_setValue( \"voteCollection\" + id, voteCollection[id].join('|'));\r\n GM_setValue( \"latestMovies\" + id, latestMovies[id].join('|'));\r\n GM_setValue( \"movieTitles\" + id, movieTitles[id].join('|'));\r\n responseDetails.responseText = '';\r\n \r\n displayLatestMovies(id,newMovies);\r\n \r\n if ( newMovieCount > 50)\r\n fetchMovieList(id, pageStart+250);\r\n}", "function getMovie(search_movie) {\n bg.innerHTML = `<img id=\"img1\" crossOrigin=\"anonymous\" src='${\n movies[search_movie.id].Poster\n }' width=\"100%\"></img>`;\n\n img = document.querySelector('img');\n title_image.innerHTML = bg.innerHTML;\n header.innerText = movies[search_movie.id].Title;\n changeBackgroundColor();\n search_results.innerHTML = '';\n search_box.value = '';\n let movie = fetch(\n `https://www.omdbapi.com/?i=${\n movies[search_movie.id].imdbID\n }&plot=full&apikey=${key}`\n )\n .then((response) => response.json())\n .then((json) => {\n summary.innerText = json.Plot;\n\n //GENERATING A LINK TO THE MOVIE ON IMDB\n score_wrapper.children[0].href = `https://www.imdb.com/title/${json.imdbID}`;\n score_wrapper.children[0].children[1].innerText =\n json.Ratings[0].Value;\n\n //GENERATING A LINK TO THE MOVIE ON ROTTEN TOMATOES\n try {\n let formatted_title_rotten = json.Title.split(' ')\n .join('_')\n .toLowerCase();\n score_wrapper.children[1].href = `https://www.rottentomatoes.com/m/${formatted_title_rotten}`;\n score_wrapper.children[1].children[1].innerText =\n json.Ratings[1].Value;\n } catch {\n score_wrapper.children[1].href = 'javascript:;';\n score_wrapper.children[1].children[1].innerText = 'N/A';\n }\n //GENERATING A LINK TO THE MOVIE ON METACRITIC\n try {\n let formatted_title_metacritic = json.Title.split(' ')\n .join('-')\n .toLowerCase();\n score_wrapper.children[2].href = `https://www.metacritic.com/movie/${formatted_title_metacritic}`;\n score_wrapper.children[2].children[1].innerText =\n json.Ratings[2].Value;\n } catch {\n score_wrapper.children[2].href = 'javascript:;';\n score_wrapper.children[2].children[1].innerText = 'N/A';\n }\n\n stats.style.display = 'flex';\n start_screen.style.display = 'none';\n title_image.style.display = 'block';\n score_wrapper.style.display = 'flex';\n\n stats.children[1].innerText = json.Director;\n stats.children[3].innerText = json.Production;\n stats.children[5].innerText = json.Released;\n stats.children[7].innerText = json.Genre;\n stats.children[9].innerText = json.Country;\n stats.children[11].innerText = json.Awards;\n stats.children[13].innerText = json.BoxOffice;\n\n let actor_names = json.Actors.split(', ');\n actors.innerHTML = '<div class=\"starring\"><h1>Starring</h1></div>';\n for (let actor of actor_names) {\n let formatted_name = actor.split(' ').join('-').toLowerCase();\n let actor_data = fetch(\n `https://api.tvmaze.com/search/people?q=${formatted_name}`\n )\n .then((actor_response) => actor_response.json())\n .then((actor_json) => {\n actors.innerHTML += `<div class=\"actor-image\"><img src=\"${actor_json[0].person.image.medium}\"><p>${actor_json[0].person.name}</p></div>`;\n })\n .catch((error) => {\n //DO NOTHING BUT BAD DATA IS HIDDEN\n });\n }\n });\n }", "function getMovie(movie) {\n\tif (!movie) {\n\t\tmovie = \"Mr. Nobody\"\n\t}\n\n\trequest(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9cece\", function(error, response, body) {\n\n\t\t\t// If the request is successful (i.e. if the response status code is 200)\n\t\t\tif (!error && response.statusCode === 200) {\n\n\t\t\t// Parse the body of the site and recover just the imdbRating\n\t\t\t// (Note: The syntax below for parsing isn't obvious. Just spend a few moments dissecting it).\n\t\t\tvar result = \"Title: \" + JSON.parse(body).Title + \"\\n\" +\n\t\t\t\t\t\"Year: \" + JSON.parse(body).Year + \"\\n\" +\n\t\t\t\t\t\"IMDB Rating: \" + JSON.parse(body).imdbRating + \"\\n\" +\n\t\t\t\t\t\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value + \"\\n\" +\n\t\t\t\t\t\"Country: \" + JSON.parse(body).Country + \"\\n\" +\n\t\t\t\t\t\"Lang: \" + JSON.parse(body).Language + \"\\n\" +\n\t\t\t\t\t\"Plot: \" + JSON.parse(body).Plot + \"\\n\" +\n\t\t\t\t\t\"Actors: \" + JSON.parse(body).Actors ;\n\t\t\tconsole.log(result)\n\t\t\treturn result\n\t\t\t\t \n\n\t\t\t}\n\t\t\t});\n\n}", "function getMovieID(data){\n\tconst movieList = data.results.map((value, index) => displayResult(value));\n\t$(\".js-movies-result\").html(movieList);\n\ttitleClick();\n\tcloseClick();\n}", "function getOmdb(){\n\n// If the user doesn't type a movie in, the program will output data for the movie 'Mr. Nobody.'\n\tif (userInput === undefined){\n\t\tuserInput = \"Mr. Nobody\"\n\t}\n\tvar movieName = userInput;\n\trequest(\"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\", function(error, response, body) {\n\n\t\tif (!error && response.statusCode === 200) {\n\t\t\tconsole.log(\"Title: \" + JSON.parse(body).Title);\n\t\t\tconsole.log(\"Year: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t\t\tconsole.log(\"Rotten Tomatoes score: \" +JSON.parse(body).Ratings[1].Value);\n\t\t\tconsole.log(\"Country: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n\t\t\tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t}\n\t});\n}", "function movieThis() {\n var movie = \"Mr. Nobody\";\n if (searchTerm) {\n var movie = searchTerm;\n };\n let movieUrl = \"http://www.omdbapi.com/?apikey=715b0924&t=\" + movie\n axios.get(movieUrl).then(response => {\n let data = response.data;\n console.log(\"Title: \" + data[\"Title\"] + \"\\nYear: \" + data[\"Year\"] + \"\\nIMDB Rating: \" + data[\"imdbRating\"] + \"\\nRotten Tomatoes Rating: \" + data[\"Ratings\"][1][\"Value\"] + \"\\nCountry of Production: \" + data[\"Country\"] + \"\\nLanguage: \" + data[\"Language\"] + \"\\nPlot: \" + data[\"Plot\"]\n + \"\\nActors: \" + data[\"Actors\"]);\n }).catch(error => {\n console.log(error);\n });\n}", "function getmovieTitleInfo() {\n var movie = indicator[3];\n if (!movie) {\n console.log(\"You didn't enter a movie. So here is Mr. Nobody, better than nothing right?\");\n movie = \"mr nobody\";\n }\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9cece\";\n request(queryUrl, function(e, resp, data) {\n if (!e && resp.statusCode === 200) {\n\n console.log(\"*************************************************\")\n console.log(\"Title: \" + JSON.parse(data).Title);\n console.log(\"Year: \" + JSON.parse(data).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(data).imdbRating);\n console.log(\"Country: \" + JSON.parse(data).Country);\n console.log(\"Language: \" + JSON.parse(data).Language);\n console.log(\"Plot: \" + JSON.parse(data).Plot);\n console.log(\"Actors: \" + JSON.parse(data).Actors);\n console.log(\"*************************************************\")\n }\n });\n}", "function omdbThis(movieEntered) {\n // if no movie is entered, defaults to \"Mr. Nobody\"\n if (movieEntered === undefined || null) {\n movieEntered = \"Mr.Nobody\";\n console.log(\"If you haven't watched 'Mr. Nobody', then you should: \")\n console.log(\"It's on Netflix!\")\n }\n\n // request to omdb api with a movie\n var searchUrl = \"http://www.omdbapi.com/?t=\" + movieEntered + \"&y=&plot=short&apikey=trilogy\";\n\n console.log(searchUrl);\n\n request(searchUrl, function (error, response, body) {\n // if request is successful \n if (!error && response.statusCode === 200) {\n //json parse\n var movieData = JSON.parse(body);\n\n console.log(\"========================\");\n // title of movie\n console.log(\"Movie Title: \" + movieData.Title +\n // year released\n \"\\nYear Released: \" + movieData.Released +\n // IMDB rating\n \"\\nIMDB Rating: \" + movieData.imdbRating +\n // Rotten Tomatoes rating\n \"\\nRotten Tomatoes Rating: \" + movieData.Ratings[1].Value +\n // countries movie was produced\n \"\\nCountry Produced: \" + movieData.Country +\n // language \n \"\\nLanguage: \" + movieData.Language +\n // plot\n \"\\nPlot: \" + movieData.Plot +\n // actors\n \"\\nActors: \" + movieData.Actors +\n \"\\n========================\");\n \n };\n });\n}", "function gotContent(data){\r\n let page = data.query.pages; \r\n //console.log(page);\r\n let pageID = Object.keys(data.query.pages)[0];\r\n console.log(pageID);\r\n\r\n let lastfollowUpContent = page[pageID].revisions[0][\"*\"];\r\n startOfContentChar = \"'''\"\r\n startCharIndex = lastfollowUpContent.search(startOfContentChar) + 3;\r\n console.log(startCharIndex);\r\n endCharIndex = startCharIndex + 200 + 1;\r\n secondDescription = lastfollowUpContent.substring(startCharIndex, endCharIndex) + '...'\r\n document.getElementById('lastContentDisplay').innerHTML =secondDescription;\r\n }", "movieThis() {\n const omdb = new OMDbAPI(KEYS.omdb);\n let movieName = \"Mr. Nobody\";\n\n if (this.cmdArgs.length > 0) {\n movieName = this.cmdArgs.join(\" \");\n }\n omdb.findMovie(movieName);\n }", "function getOMDB(movieName) {\n request('http://www.omdbapi.com/?t=' + movieName + '&r=json&apikey=trilogy&', function (error, response, body) {\n if (error) {\n return console.log('Error occurred: ' + error);\n }\n var data = JSON.parse(body);\n console.log('Movie Title:', data.Title);\n console.log('Year Released:', data.Year);\n console.log('IMDB Rating:', data.Ratings[0].Value);\n console.log('Rotten Tomatoes Rating:', data.Ratings[1].Value);\n console.log('Country:', data.Country);\n console.log('Language:', data.Language);\n console.log('Plot:', data.Plot);\n console.log('Actors:', data.Actors);\n });\n}", "function getMovieData(num) {\r\n // These three strings encode placeholder images. You will want to set the\r\n // backgroundImage property in your real data to be URLs to images.\r\n var darkGray = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY3B0cPoPAANMAcOba1BlAAAAAElFTkSuQmCC\";\r\n var lightGray = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY7h4+cp/AAhpA3h+ANDKAAAAAElFTkSuQmCC\";\r\n var mediumGray = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY5g8dcZ/AAY/AsAlWFQ+AAAAAElFTkSuQmCC\";\r\n\r\n var groupImage = \"http://t.douban.com/img/biz/poster-1357728694.jpg\";\r\n\r\n var movieGroups = [\r\n {\r\n key: \"movieGroup0\",\r\n title: \"本周口碑榜\",\r\n subtitle: \"数据来自豆瓣电影\",\r\n backgroundImage: groupImage,\r\n description: \"口碑榜是豆瓣根据用户最近一周收藏的不低于7分的新片、依据算法按“评分+热度”排序的结果。\"\r\n },\r\n {\r\n key: \"movieGroup1\",\r\n title: \"豆瓣电影TOP250\",\r\n subtitle: \"数据来自豆瓣电影\",\r\n backgroundImage: groupImage,\r\n description: \"豆瓣用户每天都在对“看过”的电影进行“很差”到“力荐”的评价,豆瓣根据每部影片看过的人数以及该影片所得的评价等综合数据,通过算法分析产生豆瓣电影250。\"\r\n },\r\n {\r\n key: \"movieGroup2\",\r\n title: \"Harry Potter Collection\",\r\n subtitle: \"合集由「看过」团队制作\",\r\n backgroundImage: groupImage,\r\n description: \"此合集收纳了「哈利波特」系列的八部电影。\"\r\n // todo: 根据豆列内容显示合集\r\n }\r\n ]\r\n\r\n var movieItems = [];\r\n var movieCollection = [];\r\n\r\n movieCollection.push(getWeeklyMovies());\r\n movieCollection.push(getMovies(\"/v2/movie/top250?count=\" + num.toString())); //array of douban movie objects\r\n movieCollection.push(getMovies(\"/v2/movie/search?q=harry%20potter&count=8\").sort(\r\n function (a, b) {\r\n return a.year - b.year;\r\n }\r\n ));\r\n\r\n \r\n\r\n for (var a = 0; a < movieCollection.length; a++) {\r\n for (var i = 0; i < (num <= movieCollection[a].length ? num : movieCollection[a].length) ; i++) {\r\n movieCollection[a][i] = formatMovieItem(movieCollection[a][i], movieGroups[a]);\r\n movieCollection[a][i].doubanSort = \"#\" + (i + 1).toString();\r\n movieItems.push(movieCollection[a][i]);\r\n }\r\n }\r\n\r\n return movieItems;\r\n }", "function movieSearch(movie)\n{\n request(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&tomatoes=true&r=json\", function (error, response, body) {\n console.log('error:', error); // Print the error if one occurre\n console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n console.log('body:', body); // Print the HTML for the Google homepage.\n console.log(body.title);\n console.log(response.title);\n});\n}", "function thisMovie(string) {\n request(\"http://www.omdbapi.com/?t=\" + string + \"&apikey=trilogy\", function(\n error,\n response,\n body\n ) {\n // If the request is successful (i.e. if the response status code is 200)\n if (!error && response.statusCode === 200) {\n // Parse the body of the site and recover just the imdbRating\n // (Note: The syntax below for parsing isn't obvious. Just spend a few moments dissecting it).\n response = JSON.parse(body);\n\n var title = \" \" + response.Title + \" \";\n var year = \"\" + response.Year;\n var ratingImdb = \"\" + response.Ratings[0].Value;\n var ratinRottenTomatoes = \"\" + response.Ratings[1].Value;\n var country = \"\" + response.Country;\n var language = \"\" + response.Language;\n var plot = \"\" + response.Plot;\n var cast = \"\" + response.Actors;\n console.log(separator.gray);\n console.log(\" \");\n console.log(\" \" + \"Tittle\".underline + \":\");\n console.log(\" \" + title.black.bgYellow);\n console.log(\" \" + \"Year\".underline + \":\");\n console.log(\" \" + year.yellow);\n console.log(\" \" + \"Country\".underline + \":\");\n console.log(\" \" + country.yellow);\n console.log(\" \" + \"Language\".underline + \":\");\n console.log(\" \" + language.yellow);\n console.log(\" \" + \"Cast\".underline + \":\");\n console.log(\" \" + cast.yellow);\n console.log(\" \" + \"Plot\".underline + \":\");\n console.log(\" \" + plot.yellow);\n console.log(\" \" + \"Ratings\".underline + \":\");\n console.log(\" IMDb.............. \" + ratingImdb.red);\n console.log(\" Rotten Tomatoes... \" + ratinRottenTomatoes.red);\n console.log(separator.gray);\n\n logIt(\n \"<<<<<<<<<<<<<<<<<<<<<<<< NEW LOG STARTS HERE >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\"\n );\n logIt(separator);\n logIt(\" \");\n logIt(\" \" + \"Tittle\" + \":\");\n logIt(\" \" + title);\n logIt(\" \" + \"Year\" + \":\");\n logIt(\" \" + year);\n logIt(\" \" + \"Country\" + \":\");\n logIt(\" \" + country);\n logIt(\" \" + \"Language\" + \":\");\n logIt(\" \" + language);\n logIt(\" \" + \"Cast\" + \":\");\n logIt(\" \" + cast);\n logIt(\" \" + \"Plot\" + \":\");\n logIt(\" \" + plot);\n logIt(\" \" + \"Ratings\" + \":\");\n logIt(\" IMDb.............. \" + ratingImdb);\n logIt(\" Rotten Tomatoes... \" + ratinRottenTomatoes);\n logIt(separator);\n }\n });\n}", "function movieThis() {\n\n\t// if user enters a value - process.argv[3]\n\n\tif (value) {\n\n\t \t// Create an empty variable for holding the movie name\n\n\t\tvar movieName = \"\";\n\n\t} // end of if no movie title was entered\n\n\t// else no movie title was entered search Mr. Nobody\n\n\telse {\n\n\t\tmovieName = \"Mr. Nobody\";\n\n\t} // end of else\n\n\t// Change any \" \" to + in the movie title\n\n\tfor (var i = 3; i < nodeArgs.length; i++){\n\n\t\t// if the movie has more than one word\n\n\t if (i > 3 && i < nodeArgs.length){\n\n\t movieName = movieName + \"+\" + nodeArgs[i];\n\n\t } // end of if there are spaces\n\n\t // the first word of the movie title\n\n\t else {\n\n\t movieName = movieName + nodeArgs[i];\n\n\t } // end of else\n\n\t} // end of for loop\n\n\t// OMDB API request \n\n\tvar queryUrl = 'http://www.omdbapi.com/?t=' + movieName +'&tomatoes=true';\n\n\trequest(queryUrl, function (error, response, body) {\n\n\t // If the request is successful \n\n\t if (!error && response.statusCode == 200) {\n\n\t // Parse the body of the site so that we can pull different keys more easily\n\t \n\t body = JSON.parse(body);\n\t console.log(\"Title: \" + body.Title);\n\t console.log(\"Year: \" + body.Year);\n\t console.log(\"IMDB Rating: \" + body.imdbRating);\n\t console.log(\"Country: \" + body.Country);\n\t console.log(\"Language: \" + body.Language);\n\t console.log(\"Plot: \" + body.Plot);\n\t console.log(\"Actors: \" + body.Actors);\n\t console.log(\"Rotten Tomatoes Rating: \" + body.tomatoRating);\n\t console.log(\"Rotten Tomatoes URL: \" + body.tomatoURL);\n\n\t // store information as a string\n\n\t\t\tlogText = JSON.stringify({\n\t\t\t\ttitle: body.Title,\n\t\t\t\tyear: body.Year,\n\t\t\t\timdbRating: body.imdbRating,\n\t\t\t\tcountry: body.Country,\n\t\t\t\tlanguage: body.Language,\n\t\t\t\tplot: body.Plot,\n\t\t\t\tactors: body.Actors,\n\t\t\t\trottenRating: body.tomatoRating,\n\t\t\t\trottenURL: body.tomatoURL\n\t\t\t}); // end of logText stringify\n\n\t\t\t// log information in logText in log.txt\n\n\t\t\tlogInfo();\n\n\t \n\t } // end of if the request is successful\n\t}); // end of request\n\n} // end of movie-this function", "function omdb(input) {\n if (!input) {\n input = \"Mr. Nobody\";\n }\n input = input.replace(' ', '+');\n var queryUrl = \"http://www.omdbapi.com/?t=\" + input + \"&y=&plot=short&apikey=trilogy\";\n\n console.log(queryUrl);\n\n request(queryUrl, function (error, response, body) {\n var data = JSON.parse(body)\n var movie = [];\n // If the request is successful\n if (!error && response.statusCode === 200) {\n\n movie.push({\n \"Title\": data.Title,\n \"Release Year\": data.Year,\n \"IMDB Rating\": data.imdbRating,\n \"Rotten Tomatoes Rating\": data.Ratings[1].Value,\n \"Country\": data.Country,\n \"Language\": data.Language,\n \"Plot\": data.Plot,\n \"Actors\": data.Actors\n\n })\n\n console.log(\"Title: \" + data.Title)\n console.log(\"Release Year: \" + data.Year);\n console.log(\"IMDB Rating: \" + data.imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + data.Ratings[1].Value);\n console.log(\"Country: \" + data.Country);\n console.log(\"Language: \" + data.Language);\n console.log(\"Plot: \" + data.Plot);\n console.log(\"Actors: \" + data.Actors);\n\n logData(movie);\n\n }\n\n })\n}", "function gotContent(data){\r\n let page = data.query.pages; \r\n //console.log(page);\r\n let pageID = Object.keys(data.query.pages)[0];\r\n console.log(pageID);\r\n\r\n let followUpContent = page[pageID].revisions[0][\"*\"];\r\n startOfContentChar = \"'''\"\r\n startCharIndex = followUpContent.search(startOfContentChar) + 3;\r\n console.log(startCharIndex);\r\n endCharIndex = startCharIndex + 200 + 1;\r\n secondDescription = followUpContent.substring(startCharIndex, endCharIndex) + '...'\r\n document.getElementById('secondContentDisplay').innerHTML =secondDescription; \r\n }", "function letsJQuery() {\r\n var table = $('td > table').eq(60);\r\n var i = 60; \r\n while (!$('td',table).eq(0).html().match(/<b>#<\\/b>/))\r\n table = $('td > table').eq(i++);\r\n $('tr',table).each(function() \r\n {\r\n titre = $('td',this).eq(1);\r\n titre = $('a',titre).html();\r\n if (titre)\r\n titre = titre.replace(\"'\",\"\");\r\n else return;\r\n artist= $('td',this).eq(3).html();\r\n if (artist)\r\n artist = artist.replace(\"'\",\"\").replace(\"f./\",\"feat \");\r\n lien = \"<a href='http://fr.youtube.com/results?search_query=\"+artist+\"+\"+titre+\"&search_type=&aq=f' target=_blank>Youtube</a>\";\r\n lien2 = \"<a href='http://www.newzleech.com/?group=&minage=&age=&min=min&max=max&q=\"+artist+\"+\"+titre+\"&m=search&adv=' target=_blank>newzleech</a>\";\r\n lien3 = \"<a href='http://www.deezer.com/#music/result/all/\"+artist+\" \"+titre+\"' target=_blank>Deezer</a>\";\r\n lien4 = \"<a href='http://www.binsearch.info/?q=\"+artist.replace(' ','+')+\"+\"+titre.replace(' ','+')+\"&max=250&adv_age=700&server=' target=_blank>Binsearch</a>\";\r\n $('td',this).eq(0).html(lien+\" \"+lien2+\" \"+lien3+\" \"+lien4);\r\n })\r\n }", "function getTvdb(id) {\r\n var tvdbid = '';\r\n this.data.forEach(function(type) {\r\n [type].forEach(function(entry) {\r\n $.each(entry, function(i, item) {\r\n $.each(item, function(x, y) {\r\n if (y.imdbId === id && y.tvdbId !== null &&\r\n y.tvdbId !== '') {\r\n tvdbid = y.tvdbId;\r\n }\r\n });\r\n });\r\n });\r\n });\r\n return tvdbid;\r\n}", "function searchMovies() {\n //ispraznimo polja za validaciju kada pritisnemo dugme za pretragu\n $('#validate-name').empty();\n $('#validate-category').empty();\n\n //ispraznimo trenutne filmove i broj filmova ukoliko postoje kada pritisnemo dugme za pretragu\n $('#movie-div').empty();\n $('#movies-num').empty();\n\n //pokupimo vrijednosti inputa i selecta koji su potrebni za slanje GET zahtjeva prema APi-u\n let name = $(\"#query-name\").val();\n let category = $(\"#query-category\").val();\n let year = $(\"#query-year\").val();\n\n //selectujemo div sa svim filmovima kako bi nakon pretrage izvrsili tranziciju\n const transition = document.getElementById('movie-div');\n transition.style.opacity = 0;\n\n //u slucaju da je ime za pretragu prazno ili ako nismo selektovali kategoriju, izvrsavamo validaciju\n if (name.length == 0 || category == null) {\n\n if (name.length == 0) {\n $('#validate-name').append('<p style=\"color:red;font-size:13px;\">Name must be filled out!</p>');\n }\n if (category == null) {\n $('#validate-category').append('<p style=\"color:red;font-size:13px;\">You must select category!</p>');\n }\n\n //takodje ukoliko neki od gornjih uslova nije ispunjen, ispisujemo poruku iznad filmova i izvrsava se animacija poruke\n $('#movies-num').append('Oops! Try again. :)');\n animate();\n return;\n };\n\n //ajax request prema API-u gdje izvlacimo sve elemente koji ispunjavaju uslove pretrage\n $.ajax({\n\n type: \"GET\",\n url: \"https://www.omdbapi.com/?apikey=39c93cf7&s=\" + name + \"&type=\" + category + \"&y=\" + year,\n success: (response) => {\n\n let movies = response.Search;\n\n //ukoliko je vrijednosti Response-a = True, prikazujemo rezultate\n if (response.Response == \"True\") {\n\n transition.style.opacity = 1;\n transition.style.transition = 'all 3s ease-in-out';\n\n $('#movies-num').append('Found ' + movies.length + ' results in total');\n animate();\n\n //prolazimo kroz niz elemenata koji smo dobili i prikazujemo jedan po jedan\n movies.forEach(movie => {\n\n //ukoliko je vrijednost slike nepoznata, prikazujemo default sliku iz naseg foldera\n if (movie.Poster == \"N/A\") {\n movie.Poster = \"./Images/default.jpg\";\n }\n\n $('#movie-div')\n .append(\n '<div class=\"movie-content\">' +\n '<div class=\"flip-card\">' +\n '<div class=\"flip-card-inner\">' +\n '<div class=\"flip-card-front\">' +\n '<img src=' + movie.Poster + '></img>' +\n '</div>' +\n '<div class=\"flip-card-back\">' +\n '<img src=' + movie.Poster + '></img>' +\n '</div>' +\n '<div class=\"center\">' +\n '<div class=\"back-text\">' +\n '<a target=\"_blank\" class=\"movie-imdb\" href=\"https://www.imdb.com/title/' + movie.imdbID + '\"><i class=\"fab fa-imdb\"></i> </a>' +\n '<a target=\"_blank\" class=\"movie-imdb\" href=\"' + movie.Poster + '\"><i class=\"fas fa-image\"></i></a>' +\n '</div>' +\n '</div>' +\n '</div>' +\n '</div>' +\n '<div class=\"movie-details\">' +\n '<div class=\"movie-name\">' +\n '<a id=\"movie-title\" onClick=\"openMovie(\\'' + movie.imdbID + '\\')\">' + movie.Title + '</a>' +\n '<hr>' +\n '</div>' +\n '<p class=\"movie-year\"> Release year: ' + movie.Year + '</p>' +\n '<p class=\"movie-year\"> Type: ' + movie.Type + '</p>' +\n '<hr>' +\n '</div>' +\n '</div>'\n )\n })\n\n //ukoliko je vrijednost Responsa razlicita od True, znaci da uslovi za pretragu nisu ispunjeni i prikazemo odgovarajucu poruku\n } else {\n\n $('#movies-num').append('Hmm.. it seems we can not find what are you looking for. :(');\n animate();\n\n }\n }\n })\n}", "function handleResult(resultData) {\n\n console.log(\"handleResult: populating movie table from resultData\");\n\n // Populate the star table\n // Find the empty table body by id \"movie_table_body\"\n let SingleStarElement = jQuery(\"#Single_Star_Body\");\n SingleStarElement.empty();\n // moives = [[moiveId, movieTitle, movieYear, director]...]\n let movies = [];\n\n for (let i = 0; i < resultData.length - 1; i++){\n movies.push([resultData[i][\"movieId\"], resultData[i][\"movieTitle\"], resultData[i][\"movieYear\"], resultData[i][\"director\"]]);\n }\n\n let rowHTML = \"\";\n rowHTML += \"<tr>\"\n + \"<td style=\\\"text-align:center\\\">\" + resultData[0]['starName'] + \"</td>\"\n + \"<td style=\\\"text-align:center\\\">\" + resultData[0]['birthYear'] + \"</td>\";\n\n rowHTML += \"<td><ul>\";\n movies.forEach(m => rowHTML += \"<li>\" + \"<a href=\\\"single-movie.html?id=\" + m[0] + \"\\\">\" + m[1] + \"</a>\" + \"</li>\");\n rowHTML += \"</ul></td>\";\n\n rowHTML += \"<td><ul>\";\n movies.forEach(m => rowHTML += \"<li>\" + m[2] + \"</li>\");\n rowHTML += \"</ul></td>\";\n\n rowHTML += \"<td><ul>\";\n movies.forEach(m => rowHTML += \"<li>\" + m[3] + \"</li>\");\n rowHTML += \"</ul></td>\";\n\n rowHTML += \"</tr>\";\n\n SingleStarElement.append(rowHTML);\n\n let prevPage = resultData[resultData.length - 1];\n $(\"#Back_to_Movie_List\").html(\"<a href = 'movie-list.html?currentPage=\" + prevPage[\"currentPage\"] +\n \"&numRecords=\" + prevPage[\"numRecords\"] +\n \"&title=\" + prevPage[\"title\"] +\n \"&year=\" + prevPage[\"year\"] +\n \"&director=\" + prevPage[\"director\"] +\n \"&starName=\" + prevPage[\"starName\"] +\n \"&genre=\" + prevPage[\"genre\"] +\n \"&acronym=\" + prevPage[\"acronym\"] +\n \"&sortBy=\" + prevPage[\"sortBy\"] + \"'>Back to Movie List</a>\");\n}", "function movieThis(_movie) {\n query =\n \"http://www.omdbapi.com/?t=\" + _movie + \"&y=&plot=short&apikey=trilogy\";\n\n axios\n .get(query)\n .then(function(response) {\n var movieData = [];\n\n var title = response.data.Title;\n var year = \"Year produced: \" + response.data.Year;\n var imdb = \"IMDB rating: \" + response.data.imdbRating;\n var rt =\n response.data.Ratings.length > 1\n ? \"Rotten Tomatoes: \" + response.data.Ratings[1].Value\n : \"Rotten Tomatoes: N/A\";\n var country = response.data.Country;\n var plot = \"Plot: \" + response.data.Plot;\n var cast = \"Cast: \" + response.data.Actors;\n movieData.push(title, year, imdb, rt, country, plot, cast);\n\n printData(movieData);\n })\n .catch(function(error) {\n noResults();\n });\n}", "function movieThis(movie) {\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + searchInput + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function (error, response, body) {\n\n if (!error && response.statusCode === 200) {\n var body = JSON.parse(body);\n\n console.log(\"\");\n console.log(\"Title: \" + body.Title);\n console.log(\"\");\n console.log(\"Release Year: \" + body.Year);\n console.log(\"\");\n console.log(\"IMDB Rating: \" + body.imdbRating);\n console.log(\"\");\n console.log(\"Rotten Tomatoes Rating: \" + body.Ratings[1].Value);\n console.log(\"\");\n console.log(\"Country: \" + body.Country);\n console.log(\"\");\n console.log(\"Language: \" + body.Language);\n console.log(\"\");\n console.log(\"Plot: \" + body.Plot);\n console.log(\"\");\n console.log(\"Actors: \" + body.Actors);\n console.log(\"\");\n }\n });\n}", "function getMovieData() {\n $.ajax({\n url: \"https://api.themoviedb.org/3/discover/\" + movieOrTv + \"?api_key=de7bfe759d702ca3a0225b7b3285f2b3&language=en-US&region=US&sort_by=popularity.desc&include_adult=false&include_video=false&page=1&\" + decadeData + \"&with_genres=\" + genreData + \"\",\n method: \"GET\"\n }).then(function (response5) {\n $('#button-area').empty();\n $('.content-slider').empty();\n for (i = 0; i < response5.results.length; i++) {\n var row = $(\"<row class='castInfo'>\");\n var movieId = response5.results[i].id;\n row.attr('movieId', movieId);\n row.append(\"<column><img src='https://image.tmdb.org/t/p/w600_and_h900_bestv2\" + response5.results[i].poster_path + \"' width='100px' length='130px'></img></column>\");\n if (movieOrTv === \"movie\") {\n // row.append(\"<td>\" + response5.results[i].title + \"</td>\");\n // row.append(\"<td>\" + response5.results[i].release_date + \"</td>\");\n row.attr('movieOrTvTitle', response5.results[i].title);\n row.attr('posterURL', 'https://image.tmdb.org/t/p/w600_and_h900_bestv2' + response5.results[i].poster_path);\n row.attr('overview', response5.results[i].overview);\n row.attr('date', response5.results[i].release_date);\n\n } else {\n // row.append(\"<td>\" + response5.results[i].name + \"</td>\");\n // row.append(\"<td>\" + response5.results[i].first_air_date + \"</td>\");\n row.attr('movieOrTvTitle', response5.results[i].name);\n row.attr('posterURL', 'https://image.tmdb.org/t/p/w600_and_h900_bestv2' + response5.results[i].poster_path);\n row.attr('overview', response5.results[i].overview);\n row.attr('date', response5.results[i].first_air_date);\n }\n $('.content-slider').append(row);\n console.log(response5.results[i].poster_path); //poster\n console.log(response5.results[i].title); //movie title\n console.log(response5.results[i].release_date); //release date\n console.log(response5.results[i].overview); //overview\n console.log(response5.results[i].id); //movie id to be used to pull more information about the movie\n }\n console.log(response5);\n\n });\n }", "function getMovieInfo() {\n\n\t//If the movie name is longer than one word, join the words together on one line so that the movie name is all one string.\n\t//Rather than having separate lines for each word.\n\tfor (var i = 3; i < input.length; i++) {\n\n\t\tif (i > 2 && i < input.length) {\n\t\t\tmovieName = movieName + \" \" + input[i];\n\t\t}\n\t\t//For example, if the user enters \"node liri.js movie this social network\", movieName should be \"social network\" when the value is logged the terminal.\n\t\t//console.log(movieName);\n\t}\n\n\t//If no movie name is specified on the command line, then show the movie info for the movie, Mr. Nobody.\n\tif (!movieName) {\n\t\t//If no movie is specified, set movieName equal to Mr. Nobody.\n\t\tmovieName = \"Mr Nobody\";\n\t\tconsole.log(\"If you haven't watched Mr. Nobody, then you should: http://www.imdb.com/title/tt0485947/\");\n\t\tconsole.log(\"It's on Netflix!\")\n\t}\n\n\t//Use the figlet npm package to convert the movieName text to art/drawing.\n\tfiglet(movieName, function (err, data) {\n\t\tif (err) {\n\t\t\tconsole.log('Something went wrong...');\n\t\t\tconsole.dir(err);\n\t\t\treturn;\n\t\t}\n\t\tconsole.log(data)\n\t});\n\n\t//Then, run a request to the OMDB API with the movieName value.\n\trequest(\"http://www.omdbapi.com/?t=\" + movieName + \"&apikey=trilogy\", function (error, response, body) {\n\n\t\t//If the request is successful (i.e. if the response status code is 200)\n\t\tif (!error && response.statusCode === 200) {\n\t\t\t//Parse the body of the JSON object that holds the movie data and display the movie info.\n\t\t\tvar movieInfo = JSON.parse(body);\n\t\t\t//console.log(movieInfo);\n\n\t\t\t// Create variable to hold Rotten Tomatoes Rating.\n\t\t\tvar tomatoRating = movieInfo.Ratings[1].Value;\n\n\t\t\t//Output the following information about movieName.\n\t\t\t// \\r\\n is used as a new line character in Windows: https://stackoverflow.com/questions/15433188/r-n-r-n-what-is-the-difference-between-them \n\t\t\tvar movieResult =\n\t\t\t\t//Line break\n\t\t\t\t\"=======================================================================================================\" + \"\\r\\n\" +\n\t\t\t\t//Output the liri command plus movieName\n\t\t\t\t\"liri command: movie-this \" + movieName + \"\\r\\n\" +\n\t\t\t\t//Line break\n\t\t\t\t\"=======================================================================================================\" + \"\\r\\n\" +\n\t\t\t\t//Title of the movie.\n\t\t\t\t\"Title: \" + movieInfo.Title + \"\\r\\n\" +\n\t\t\t\t//Year the movie came out.\n\t\t\t\t\"Year movie was released: \" + movieInfo.Year + \"\\r\\n\" +\n\t\t\t\t//IMDB Rating of the movie.\n\t\t\t\t\"IMDB movie rating (out of 10): \" + movieInfo.imdbRating + \"\\r\\n\" +\n\t\t\t\t//Rotten Tomatoes rating of the movie.\n\t\t\t\t\"Rotten Tomatoes rating (out of 100%): \" + tomatoRating + \"\\r\\n\" +\n\t\t\t\t//Country where the movie was produced.\n\t\t\t\t\"Filmed in: \" + movieInfo.Country + \"\\r\\n\" +\n\t\t\t\t//Language of the movie.\n\t\t\t\t\"Language: \" + movieInfo.Language + \"\\r\\n\" +\n\t\t\t\t//Plot of the movie.\n\t\t\t\t\"Movie plot: \" + movieInfo.Plot + \"\\r\\n\" +\n\t\t\t\t//Actors in the movie.\n\t\t\t\t\"Actors: \" + movieInfo.Actors + \"\\r\\n\" +\n\t\t\t\t//Line break\n\t\t\t\t\"=======================================================================================================\"\n\n\t\t\t//Output the movie information to the terminal.\n\t\t\tconsole.log(movieResult);\n\t\t\t//Output the movie information to the log.txt file.\n\t\t\tlogData(movieResult);\n\t\t}\n\t});\n}", "function searchMovie(movie) {\n var queryURL = \"http://www.omdbapi.com/?t=\" + movie + \"&apikey=trilogy\";\n //console.log(queryURL);\n\n //searching for movie with omdb api\n request(queryURL, function (error, response, body) {\n //if error occurs\n if (error) {\n console.log(error);\n }\n\n //request processed successfully\n if (!error && response.statusCode === 200) {\n //console.log(JSON.parse(body));\n var result = JSON.parse(body);\n\n var title = result.Title;\n var year = result.Year;\n var rating1 = result.imdbRating;\n var rating2 = result.Ratings[1].Value;\n var country = result.Country;\n var language = result.Language;\n var plot = result.Plot;\n var actors = result.Actors;\n\n console.log(\"\\n\");\n console.log(\"Movie: \" + title);\n console.log(\"Year: \" + year);\n console.log(\"IMDB Rating: \" + rating1);\n console.log(\"Rotten Tomatos Rating: \" + rating2);\n console.log(\"Countries of production: \" + country);\n console.log(\"Language(s): \" + language);\n console.log(\"Plot: \" + plot);\n console.log(\"Actors: \" + actors);\n }\n });\n}", "function JsontoHTML() {\n $(\"ul.items\").empty()\n all_html = []\n for (let i = 0; i < databaseObj.length; i++) {\n c = databaseObj[i];\n let keywrd = (JSON.parse(c[\"keywords\"]))\n kwrds = []\n for (let a = 0; a < keywrd.length; a++) {\n kwrds.push(keywrd[a][\"name\"])\n }\n let movieObj = new MovieInfo(c[\"budget\"], c[\"genres\"], c[\"homepage\"], c[\"runtime\"], c[\"vote_average\"],\n kwrds, c[\"title\"], c[\"id\"], c[\"image_url\"], c[\"image_url1\"], c[\"image_url2\"],\n c[\"overview\"])\n all_html.push(movieObj)\n }\n }", "function movieList(query, sortBy, order) {\n\n getMovies(query, sortBy, order).then((movies) => {\n //console.log('Here are all the movies:');\n movies.forEach(({title, rating, id, tvdb, imdb_id, fav}) => {\n// console.log(`id#${id} - ${title} - rating: ${rating}`);\n\n let moviePoster = \"images/placeholder.png\";\n let movieBackdrop = \"\";\n let star = 'star_border';\n let favStar = '';\n\n if (tvdb) {\n console.log('data exists for tvdb');\n if(tvdb.poster_path !== null) moviePoster = 'https://image.tmdb.org/t/p/w500/' + tvdb.poster_path;\n if(tvdb.backdrop_path !== null) movieBackdrop = 'https://image.tmdb.org/t/p/original/' + tvdb.backdrop_path;\n\n }\n\n star = (fav === true) ? 'star' : 'star_border';\n favStar = (fav === true) ? 'favorite-true' : '';\n\n $(`<div class=\"movie p-2 m-2\" id=\"movie-${id}\">`).append(\n $('<div class=\"movie-img\">').append(\n $(`<img src=\"${moviePoster}\" id=\"img-${id}\" class=\"img-fluid main\">`)),\n $('<div class=\"movie-title text-truncate\">').text(title),\n $('<div class=\"movie-database\">').append(\n $(`<img src=\"images/loader.svg\" class=\"loading-data hide\" id=\"loading-movie-${id}\">`).text(''),\n $(`<input type=\"hidden\" id=\"movie-imdb-${id}\" value=\"${imdb_id}\">`).text(''),\n $(`<button id=\"update-movie-${id}\" class=\"update\" value=\"${id}\">`).html(\"<i class=\\\"material-icons\\\">autorenew</i>\"),\n $(`<button id=\"edit-movie-${id}\" class=\"edit\" value=\"${id}\">`).html('<i class=\"material-icons\">create</i>'),\n $(`<button id=\"delete-movie-${id}\" class=\"delete\" value=\"${id}\">`).html('<i class=\"material-icons\">delete_forever</i>'),\n $(`<button id=\"fav-movie-${id}\" class=\"favorite ${favStar}\" value=\"${id}\">`).html(`<i class=\"material-icons\">${star}</i>`),\n )).appendTo('#moviesList');\n\n\n $(`#img-${id}, #update-movie-${id}, #edit-movie-${id}, #delete-movie-${id}, #fav-movie-${id}`).hover(function () {\n $('.bg-container').css('background-image', `url('${movieBackdrop}')`);\n $(`#img-${id}`).addClass('standard-hover');\n $(`#update-movie-${id}, #edit-movie-${id}, #delete-movie-${id}, #fav-movie-${id}`).css('opacity',0.6);\n $('.favorite-true').css('opacity',1);\n\n }, function () {\n $(`#update-movie-${id}, #edit-movie-${id}, #delete-movie-${id}, #fav-movie-${id}`).css('opacity',0.0);\n $(`#img-${id}`).removeClass('standard-hover');\n $('.favorite-true').css('opacity',1);\n\n });\n\n\n $(`#img-${id}`).click(function() {\n displayMovie(id);\n });\n\n $(`#edit-movie-${id}`).click(function () {\n displayEditMovie(id);\n });\n\n $(`#fav-movie-${id}`).click(function() {\n\n let star = $(this).children('i').text();\n console.log(star);\n (star !== 'star') ? $(this).children('i').text('star') : $(this).children('i').text('star_border');\n (star !== 'star') ? addFav(id, true) : addFav(id,false);\n (star !== 'star') ? $(this).addClass('favorite-true') : $(this).removeClass('favorite-true');\n\n });\n\n $(`#delete-movie-${id}`).click(function () {\n\n // TODO: reaplce this with a in-page function\n const confirmed = window.confirm(\"Are you sure\");\n\n if (confirmed === true) {\n $(`#movie-${id}`).addClass('hide');\n deleteMovie(id);\n console.log(`deleted: ` + id);\n\n\n } else {\n console.log(`cancelled the delete: ` + id);\n }\n\n });\n\n $(`#update-movie-${id}`).click(function (e) {\n e.preventDefault();\n $(`#loading-movie-${id}`).removeClass('hide');\n $(`#img-${id}`).addClass('loading-hover');\n\n const movieId = $(`#movie-imdb-${id}`).val();\n\n $(this).off('click');\n\n setTimeout(function () {\n getMovieDBData(movieId).then((movies) => {\n console.log('Here are all the movies:');\n console.log(movies.movie_results[0]);\n\n const movie = movies.movie_results[0];\n\n\n getFullMovieData(movie.id).then(movie => {\n\n\n addMovieData(id,\n {\n title: movie.title,\n rating: movie.vote_average,\n tvdb: movie\n });\n\n\n\n $(`#img-${id}`).attr('src', `https://image.tmdb.org/t/p/w500/${movie.poster_path}`);\n $('.bg-container').css('background-image', `url('https://image.tmdb.org/t/p/original/${movie.backdrop_path}')`);\n\n $(`#img-${id}`).hover(function () {\n $('.bg-container').css('background-image', `url('https://image.tmdb.org/t/p/original/${movie.backdrop_path}')`);\n });\n\n $(`#loading-movie-${id}`).addClass('hide');\n $(`#img-${id}`).removeClass('loading-hover');\n\n });\n\n\n\n\n\n }).catch((error) => {\n alert('Oh no! Something went wrong.\\nCheck the console for details.');\n console.log(error);\n });\n\n $(this).on('click');\n\n $('.loading-container').hide();\n }, 3000);\n\n });\n\n $('.loading-container').hide();\n\n });\n\n }).catch((error) => {\n alert('Oh no! Something went wrong.\\nCheck the console for details.');\n console.log(error);\n });\n}", "function searchCallback(data) {\n\n $(document.body).append('Found ' + data.total + ' results for ' + query);\n var movies = data.movies;\n\n $.each(movies, function(index, movie) {\n $(document.body).append('<h1>' + movie.title + '</h1>');\n $(document.body).append('<img src=\"' + movie.posters.thumbnail + '\" />');\n $(document.body).append('<p>' + movie.synopsis+'</p>');\n });\n}", "function movieThis() {\n var movieName = \"\";\n\n //move over all of the entered words to \n for (var i = 3; i < input.length; i++) {\n if (i > 3 && i < input.length) {\n movieName = movieName + \"+\" + input[i];\n } else {\n movieName += input[i];\n }\n }\n if (movieName === \"\") {\n movieName = \"Mr. Nobody\";\n }\n\n var movieQueryURL = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=plot=short&apikey=trilogy\" + omdb;\n\n //npm call and arrangement of data into information.\n request(movieQueryURL, function(error, response, body) {\n if (!error && response.statusCode === 200) {\n var movieData = JSON.parse(body);\n console.log(\"Title: \" + movieData.Title + \"\\nRelease Year: \" + movieData.Year);\n\n for (var i = 0; i < movieData.Ratings.length; i++) {\n console.log(\"Rating: \" + movieData.Ratings[i].Source + \" \" + movieData.Ratings[i].Value)\n }\n console.log(\"Country Produced: \" + movieData.Country + \"\\nLanguage: \" + movieData.Language +\n \"\\nActors: \" + movieData.Actors + \"\\nPlot: \" + movieData.Plot);\n } else {\n return console.log(error);\n }\n });\n}", "function makeIMDbLink(movietitle,movierating,movievotes, movieUrl, tagLine) {\n\t\t\tvar container = document.createElement(\"span\");\n\t\t\tcontainer.appendChild(document.createTextNode(\" \"));\n\n\t\t\tvar newLink = document.createElement(\"a\");\n\t\t\tnewLink.setAttribute(\"href\", movieUrl);\n\t\t\tnewLink.setAttribute(\"target\", \"imdb\");\n newLink.setAttribute(\"title\", tagLine);\n\t\t\tnewLink.appendChild(document.createTextNode(\"(IMDb)\"));\n\t\t\tcontainer.appendChild(newLink);\n\t\t\tcontainer.appendChild(document.createElement(\"br\"));\n\t\t\t\n\t\t\tvar boldness = document.createElement(\"b\");\n\t\t\tboldness.appendChild(document.createTextNode(\"IMDb Rating: \"));\n\t\t\tcontainer.appendChild(boldness);\n\t\t\tcontainer.appendChild(document.createTextNode(movierating));\n\t\t\tcontainer.appendChild(document.createElement(\"br\"));\n\t\t\tboldness = document.createElement(\"b\");\n\t\t\tboldness.appendChild(document.createTextNode(\"IMDb Votes: \"));\n\t\t\tcontainer.appendChild(boldness);\n\t\t\tcontainer.appendChild(document.createTextNode(movievotes));\n\t\t\treturn(container);\n\t}", "function fillMyMovieTable(movieData){\n $('.movieRow').first().show();\n for(var i = 0; i < movieData.movies.length; i++){\n $('.movieRow').first().clone().appendTo('#movieTable')\n $('.movieTitle').last().text(movieData.movies[i])\n }\n $('.movieRow').first().hide();\n \n}", "function getIMDBid(title) {\n var imdbid = null;\n var title = showtime.entityDecode(unescape(title)).toString();\n showtime.print('Splitting the title for IMDB ID request: ' + title);\n var splittedTitle = title.split('|');\n if (splittedTitle.length == 1)\n splittedTitle = title.split('/');\n if (splittedTitle.length == 1)\n splittedTitle = title.split('-');\n showtime.print('Splitted title is: ' + splittedTitle);\n if (splittedTitle[1]) { // first we look by original title\n var cleanTitle = splittedTitle[1].trim();\n var match = cleanTitle.match(/[^\\(|\\[|\\.]*/);\n if (match)\n cleanTitle = match;\n showtime.print('Trying to get IMDB ID for: ' + cleanTitle);\n resp = showtime.httpReq('http://www.imdb.com/find?ref_=nv_sr_fn&q=' + encodeURIComponent(cleanTitle)).toString();\n imdbid = resp.match(/<a href=\"\\/title\\/(tt\\d+)\\//);\n if (!imdbid && cleanTitle.indexOf('/') != -1) {\n splittedTitle2 = cleanTitle.split('/');\n for (var i in splittedTitle2) {\n showtime.print('Trying to get IMDB ID for: ' + splittedTitle2[i].trim());\n resp = showtime.httpReq('http://www.imdb.com/find?ref_=nv_sr_fn&q=' + encodeURIComponent(splittedTitle2[i].trim())).toString();\n imdbid = resp.match(/<a href=\"\\/title\\/(tt\\d+)\\//);\n if (imdbid) break;\n }\n }\n }\n if (!imdbid)\n for (var i in splittedTitle) {\n if (i == 1) continue; // we already checked that\n var cleanTitle = splittedTitle[i].trim();\n var match = cleanTitle.match(/[^\\(|\\[|\\.]*/);\n if (match)\n cleanTitle = match;\n showtime.print('Trying to get IMDB ID for: ' + cleanTitle);\n resp = showtime.httpReq('http://www.imdb.com/find?ref_=nv_sr_fn&q=' + encodeURIComponent(cleanTitle)).toString();\n imdbid = resp.match(/<a href=\"\\/title\\/(tt\\d+)\\//);\n if (imdbid) break;\n }\n\n if (imdbid) {\n showtime.print('Got following IMDB ID: ' + imdbid[1]);\n return imdbid[1];\n }\n showtime.print('Cannot get IMDB ID :(');\n return imdbid;\n }", "function gotContent(data){\r\n let page = data.query.pages; \r\n //console.log(page);\r\n let pageID = Object.keys(data.query.pages)[0];\r\n console.log(pageID);\r\n\r\n let content = page[pageID].revisions[0][\"*\"];\r\n startOfContentChar = \"'''\"\r\n startCharIndex = content.search(startOfContentChar) + 3;\r\n console.log(startCharIndex);\r\n endCharIndex = startCharIndex + 200 + 1;\r\n description = content.substring(startCharIndex, endCharIndex) + '...'\r\n document.getElementById('contentDisplay').innerHTML =description;\r\n //console.log(content); \r\n // access summary brute force \r\n //let summary = page[pageID].revisions[0][\"*\"][10];\r\n //console.log('SUMMARY' + summary);\r\n }", "function update_mpaaDB()\r\n{\r\n var t_mpaaRatings;\r\n db_mpaa_filtered = [];\r\n\r\n movies_filtered.forEach(function (movie_elem) {\r\n t_mpaaRatings = movie_elem.mpaaRating;\r\n\r\n if (t_mpaaRatings != \"R\" &&\r\n t_mpaaRatings != \"PG\" &&\r\n t_mpaaRatings != \"PG-13\" &&\r\n t_mpaaRatings != \"Unrated\" &&\r\n t_mpaaRatings != \"M\" &&\r\n t_mpaaRatings != \"X\" &&\r\n t_mpaaRatings != \"G\" &&\r\n t_mpaaRatings != \"Approved\")\r\n {\r\n t_mpaaRatings = \"Other\";\r\n }\r\n\r\n if (!db_mpaa_filtered.hasOwnProperty([t_mpaaRatings]))\r\n {\r\n db_mpaa_filtered[t_mpaaRatings] = 1;\r\n }\r\n else\r\n {\r\n db_mpaa_filtered[t_mpaaRatings]++;\r\n }\r\n });\r\n \r\n}", "function movieSearch(search) {\n console.log(\"Give it a second...\");\n if(search == undefined) {\n search = 'Mr. Nobody';\n }\n var options = {\n url: 'http://www.omdbapi.com/',\n qs: {\n t: search,\n plot: 'short',\n r: 'json',\n tomatoes: 'true'\n }\n }\n request(options, function(error, response, body) {\n if(!error && response.statusCode == 200) {\n //converts body from string type to JSON object\n body = JSON.parse(body);\n console.log('--------------------------------------------------------------');\n console.log('Title: '+ body.Title);\n console.log('--------------------------------------------------------------');\n console.log('Year Released: '+ body.Year);\n console.log('--------------------------------------------------------------');\n console.log('Plot: '+ body.Plot);\n console.log('--------------------------------------------------------------');\n console.log('Countries Released in: '+ body.Country);\n console.log('--------------------------------------------------------------');\n console.log('Languages Released in: '+ body.Language);\n console.log('--------------------------------------------------------------');\n console.log('Actors: '+ body.Actors);\n console.log('--------------------------------------------------------------');\n console.log('IMDB Rating: '+ body.imdbRating);\n console.log('--------------------------------------------------------------');\n console.log('Rotten Tomatoes Rating: '+ body.tomatoRating);\n console.log('--------------------------------------------------------------');\n console.log('Rotten Tomatoes URL: '+ body.tomatoURL);\n console.log('--------------------------------------------------------------');\n\n var movieData = {\n 'Title': body.Title, 'Year Released': body.Year, 'Plot': body.Plot, \n 'Countries Released in': body.Country, 'Languages Released in': body.Language,\n 'Actors': body.Actors, 'IMDB Rating': body.imdbRating,\n 'Rotten Tomatoes Rating': body.tomatoRating, 'Rotten Tomatoes URL': body.tomatoURL\n }\n\n //Passes the movie data to the appendToLog function which appends the data to the log file\n appendToLog(movieData, 'movie');\n }\n })\n}", "function c0_PG_gettable( ch ) {\r\nvar rc='';\r\n\r\nvar Event_Name='';\r\nvar Event_Site='';\r\nvar Event_Date='';\r\nvar Round='';\r\nvar White='';\r\nvar Black='';\r\nvar Result='';\r\nvar ECO='';\r\nvar WhiteElo='';\r\nvar BlackElo='';\r\nvar Game_Date='';\r\nvar Source_Date='';\r\n\r\nvar AddInfo='';\r\n\r\nvar htms='';\r\n\r\nc0_PGN_header=[];\r\n\r\nPGN_text= c0_ReplaceAll( PGN_text,' ', ' ' );\r\nPGN_text= c0_ReplaceAll( PGN_text, '–', '-');\r\n\r\nfor(var str2=PGN_text;;) {\r\n var at2=str2.indexOf('[');\r\n if(at2<0) break; \r\n var at2_1=str2.indexOf('(');\r\n var at2_2=str2.indexOf('{');\r\n if((at2_1>=0 && at2_1<at2) || (at2_2>=0 && at2_2<at2)) break; \r\n var buf2= str2.substr(at2+1);\r\n buf2= buf2.substr(0, buf2.indexOf(']') );\r\n str2= str2.substr(at2+buf2.length+2);\r\n\r\n c0_PGN_header.push(buf2);\r\n buf2= c0_ReplUrl(buf2); \r\n buf2= c0_ReplaceAll( buf2,'\"','' );\r\n buf2= c0_ReplaceAll( buf2, \"'\" ,'' );\r\n\r\n var buf3=buf2.toUpperCase();\r\n\r\n var at9 = buf3.indexOf('SETUP ');\r\n if(at9>=0 && at9<3) { if( ch==2 ) { c0_fischer=(buf2.substr(at9+6,1)==\"1\") } }\r\n\r\n var at3 = buf3.indexOf('FEN ');\r\n if(at3>=0 && at3<3)\r\n { if( ch==2 && c0_start_FEN.length==0 ) { c0_start_FEN=buf2.substr(at3+4); c0_set_start_position(\"\"); } }\r\n else {\r\n var at3 = buf3.indexOf('EVENT ');\r\n if(at3>=0) Event_Name=buf2.substr(at3+6);\r\n else {\r\n at3 = buf3.indexOf('SITE ');\r\n if(at3>=0) Event_Site=buf2.substr(at3+5);\r\n else {\r\n at3 = buf3.indexOf('DATE ');\r\n if(at3>=0 && at3<3) Game_Date=buf2.substr(at3+5);\r\n else {\r\n at3 = buf3.indexOf('ROUND ');\r\n if(at3>=0) Round=buf2.substr(at3+6);\r\n else {\r\n at3 = buf3.indexOf('WHITE ');\r\n if(at3>=0) White=buf2.substr(at3+6);\r\n else {\r\n at3 = buf3.indexOf('BLACK ');\r\n if(at3>=0) Black=buf2.substr(at3+6);\r\n else {\r\n at3 = buf3.indexOf('ECO ');\r\n if(at3>=0) ECO=buf2.substr(at3+4);\r\n else {\r\n at3 = buf3.indexOf('WHITEELO ');\r\n if(at3>=0) WhiteElo=buf2.substr(at3+9);\r\n else {\r\n at3 = buf3.indexOf('BLACKELO ');\r\n if(at3>=0) BlackElo=buf2.substr(at3+9);\r\n else {\r\n at3 = buf3.indexOf('EVENTDATE ');\r\n if(at3>=0) Event_Date=buf2.substr(at3+10);\r\n else {\r\n at3 = buf3.indexOf('SOURCEDATE ');\r\n if(at3>=0) Source_Date=buf2.substr(at3+11);\r\n else {\r\n at3 = buf3.indexOf('RESULT ');\r\n if(at3>=0) Result=buf2.substr(at3+7);\r\n else {\r\n AddInfo+=((AddInfo.length>0) ? '<BR>' : '' ) + buf2;\r\n }}}}}}}}}}}}}\r\n }\r\n\r\nif(ch==1)\r\n{\r\nif((c0_relative_size_procents<90 && c0_headsize==0) || c0_headsize==10)\r\n {\r\n htms='<TABLE id=\"TBH\" width=\"80\" border=\"0\" bgcolor=\"#CCCC99\" style=\"cursor:move;border:1px solid #666633\" onmouseover=\"c0_over_head(1,99);\">';\r\n if(Round.length>0) htms+='<TR><TD id=\"TBH\"><font size=\"3\">Round: ' + Round + '</font></TD>';\r\n else htms+='<TR><TD id=\"TBH\"><font size=\"3\">more</font></TD>';\r\n htms+='<TD id=\"TBH\"><font size=\"3\">»</font></TD></TR>';\r\n htms+='</TABLE>';\r\n }\r\nelse\r\n {\r\n htms='<TABLE id=\"TBH\" width=\"160\" border=\"0\" bgcolor=\"#CCCC99\" ';\r\n if(c0_headsize==1) htms+=' onmouseout=\"setTimeout(' + \"'\" + 'c0_over_head(0,c0_headsize);' + \"'\" + ',2000);\" ';\r\n htms+=' style=\"cursor:move;border:1px solid #666633\" >';\r\n if(Event_Name.length>0) htms+='<TR><TD id=\"TBH\"><font size=\"3\">Event: ' + Event_Name + '</font></TD></TR> ';\r\n if(Event_Date.length>0) htms+='<TR><TD id=\"TBH\"><font size=\"3\">Event date: ' + Event_Date + '</font></TD></TR>';\r\n if(Event_Site.length>0) htms+='<TR><TD id=\"TBH\"><font size=\"3\">Site: ' + Event_Site + '</font></TD></TR>';\r\n if(Game_Date.length>0) htms+='<TR><TD id=\"TBH\"><font size=\"3\">Date: ' + Game_Date + '</font></TD></TR>';\r\n if(Round.length>0) htms+='<TR><TD id=\"TBH\"><font size=\"3\">Round: ' + Round + '</font></TD></TR>';\r\n if(ECO.length>0) htms+='<TR><TD id=\"TBH\"><font size=\"3\">ECO: ' +\r\n\t'<a title=\"Quick link more about...\" target=\"blank\" href=\"http://www.chessgames.com/perl/chessopening?eco=' + ECO + '\">' + ECO + '</a>' +'</font></TD></TR>';\r\n if(Source_Date.length>0 && Event_Date.length==0 && Game_Date.length==0)\r\n\t\t htms+='<TR><TD id=\"TBH\"><font size=\"3\">Source Date: ' + Source_Date + '</font></TD></TR>';\r\n if(AddInfo.length>0) htms+='<TR><TD id=\"TBH\"><font size=\"3\">' + AddInfo + '</font></TD></TR>';\r\n htms+='<TR><TD id=\"TBH\" align=\"center\" onmouseover=\"c0_over_head(10,99);\"><font size=\"3\">⌂</font></TD></TR>';\r\n htms+='</TABLE>';\r\n }\r\n rc=htms;\r\n}\r\n\r\nif(ch==2 || ch==8)\r\n{\r\n str2= c0_ReplUrl(str2);\r\n if(ch==2)\r\n {\r\n c0_errflag=c0_PG_parseString(str2);\r\n if(c0_fischer && c0_fischer_cst.length>0) c0_fischer_adjustmoved();\r\n }\r\n var at3 = str2.indexOf('*');\r\n if(at3>=0) Result=\"not finished\";\r\n var at3 = str2.indexOf('1/2');\r\n if(at3>=0) Result=\"1/2-1/2\";\r\n var at3 = str2.indexOf('1-0');\r\n if(at3>=0) Result=\"1:0\";\r\n var at3 = str2.indexOf('1:0');\r\n if(at3>=0) Result=\"1:0\";\r\n var at3 = str2.indexOf('0-1');\r\n if(at3>=0) Result=\"0:1\"\r\n var at3 = str2.indexOf('0:1');\r\n if(at3>=0) Result=\"0:1\";\r\n\r\n\r\n if((c0_relative_size_procents<40 && c0_pgnsize==0) || c0_pgnsize==10)\r\n {\r\n htms='<DIV id=\"TBP2\" style=\"cursor:move;border:1px solid #666633;width:100;height:100;overflow-y:scroll;overflow-x:scroll;\">';\r\n htms+='<TABLE id=\"TBP\" width=\"100\" height=\"100\" bgcolor=\"#FFFFCC\" style=\"cursor:move; border:0px solid #666633\">';\r\n htms+='<TR>';\r\n htms+='<TD id=\"TBH\" onmouseover=\"c0_over_pgn(1,99);\"><font size=\"3\">»</font></TD></TR>';\r\n htms+='<TR><TD id=\"TBP\"><font size=\"3\"><b>' + White + (WhiteElo.length>0 ? '(Elo '+WhiteElo+')' : '' ) + ' - </b></font>';\r\n htms+='<font size=\"3\"><b> (' + Result + ') - </b></font>';\r\n htms+='<font size=\"3\"><b>' + Black + (BlackElo.length>0 ? '(Elo '+BlackElo+')' : '' ) + '</b></font>';\r\n htms+='<br>';\r\n str2=c0_PG_3;\r\n htms+='<font size=\"3\">' + str2 + '</font>';\r\n htms+='</TD>';\r\n htms+='</TR></TABLE>';\r\n htms+='</DIV>';\r\n rc=htms;\r\n }\r\n else\r\n {\r\n\r\n if(c0_dh>0 || c0_screensizeW<c0_screensizeH)\r\n {\r\n var wH= c0_dh>0 ? c0_dh : parseInt( c0_screensizeH - 20 - ( c0_at_top + (332*(c0_relative_size_procents/100)*(c0_topview?1.8:1)) +50 ) );\r\n var wW= parseInt(c0_screensizeW-22);\r\n\r\n htms='<DIV id=\"TBP2\" style=\"cursor:move;border:1px solid #666633;width:' + wW.toString() + ';height:' + wH.toString() + '\">';\r\n htms+='<TABLE id=\"TBP\" width=\"' + wW.toString() + '\" height=\"' + wH.toString() + '\" bgcolor=\"#FFFFCC\" ';\r\n //if(c0_pgnsize==1) htms+=' onmouseout=\"setTimeout(' + \"'\" + 'c0_over_pgn(0,c0_pgnsize);' + \"'\" + ',4000);\" ';\r\n htms+=' style=\"cursor:move; border:0px solid #666633\">';\r\n htms+='<TR>';\r\n htms+='<TD id=\"TBP\"><font size=\"3\"><b>' + White + (WhiteElo.length>0 ? '(Elo '+WhiteElo+')' : '' ) + ' - </b></font>';\r\n htms+='<font size=\"3\"><b> (' + Result + ') - </b></font>';\r\n htms+='<font size=\"3\"><b>' + Black + (BlackElo.length>0 ? '(Elo '+BlackElo+')' : '' ) + '</b></font>';\r\n htms+='</TD>';\r\n htms+='<TD id=\"TZH\" width=\"10\" align=\"center\" onmouseover=\"c0_over_pgn(10,99);\"><font size=\"3\">⌂</font></TD>';\r\n htms+='</TR>';\r\n str2=c0_PG_3;\r\n htms+='<TR><TD id=\"TBP\"><font size=\"3\">' + str2 + '</font>';\r\n htms+='</TD>';\r\n htms+='</TR></TABLE>';\r\n htms+='</DIV>';\r\n\r\n rc=htms;\r\n }\r\n else\r\n {\r\n htms='<TABLE id=\"TBP\" width=\"180\" bgcolor=\"#FFFFCC\" ';\r\n //if(c0_pgnsize==1) htms+=' onmouseout=\"setTimeout(' + \"'\" + 'c0_over_pgn(0,c0_pgnsize);' + \"'\" + ',4000);\" ';\r\n htms+=' style=\"cursor:move;border:1px solid #666633\">';\r\n htms+='<TR><TD id=\"TBP\"><font size=\"3\">' + White + (WhiteElo.length>0 ? '<br>(Elo '+WhiteElo+')' : '' ) + '</font></TD>';\r\n htms+='<TD id=\"TBP\"><font size=\"3\">' + Black + (BlackElo.length>0 ? '<br>(Elo '+BlackElo+')' : '' ) + '</font></TD></TR>';\r\n htms+='</TABLE>';\r\n htms+='<TABLE id=\"TBP\" width=\"180\" bgcolor=\"#FFFFCC\" style=\"cursor:move;border:1px solid #666633\">';\r\n htms+='<TR><TD id=\"TBP\" align=\"center\"><font size=\"3\">' + Result + '</font></TD>';\r\n htms+='<TD id=\"TZH\" align=\"center\" onmouseover=\"c0_over_pgn(10,99);\"><font size=\"3\">⌂</font></TD></TR>';\r\n htms+='</TABLE>';\r\n\r\n str2=c0_PG_3;\r\n htms+='<DIV id=\"TBP2\" style=\"cursor:move;border:1px solid #666633;overflow-y:scroll;width:178;height:' + (c0_relative_size_procents<90 ? '80' : (c0_relative_size_procents<110 ? '200' : '340' ) ) + '\" >';\r\n htms+='<TABLE id=\"TBP\" width=\"100%\" bgcolor=\"#FFFFCC\" style=\"border:1px solid #666633\">';\r\n htms+='<TR><TD id=\"TBP\"><font size=\"3\">' + str2 + '</font></TD>';\r\n htms+='</TABLE></DIV>';\r\n htms+='';\r\n rc=htms;\r\n }\r\n\r\n }\r\n\r\n if(c0_PG_viewer) document.title = White + '-' + Black + ' (' + Result + ')';\r\n\r\n}\r\n return rc;\r\n}", "function Skynet(query) {\n\n// on passe par les mots clés\n\n query1=query.replace(new RegExp(\"\\\\b\" + \"de\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"des\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"la\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"les\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"le\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"l'\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"au\" + \"\\\\b\",\"gi\"),\"\");\n//var query1=query1.replace(new RegExp(\"\\\\b\" + \"à\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"du\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"aux\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"un\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"une\" + \"\\\\b\",\"gi\"),\"\");\n query1=query1.replace(new RegExp(\"\\\\b\" + \"d'\" + \"\\\\b\",\"gi\"),\"\");\nconsole.log('la phrase traitée : '+query1);\n\nmatch=query.search()\n\n\nif (query1.search(\"vidéos\") >-1){\n query22 = query1.search(\"vidéos\");\n query23 = query1.length;\n for (i = (query22+6); i < query23 ;i++){reponse=reponse+(query1[i]);}\n if (debug==\"on\"){speaking=\"mots clés trouvé video\"}else{speaking=\"\"}\n ScribeSpeak(speaking,function(){reponse=reponse.trim();reponse=reponse.replace(new RegExp(\" \",\"gi\"),\"+\");\n \n reponse=reponse.replace(new RegExp(' ', 'ig'),\"+\")\n var proc = 'start chrome --new-window https://www.youtube.com/results?search_query='+ reponse;\n //console.log(proc)\n exec(proc)\n // process1 = '%CD%/plugins/cortana/bin/searchyoutube.vbs ' + reponse ; exec(process1)\n })\n callback({'tts': \"\"})\n return false\n}\n\nif (query1.search(\"vidéo\") >-1){\n query22 = query1.search(\"vidéo\");\n query23 = query1.length;\n for (i = (query22+5); i < query23 ;i++){reponse=reponse+(query1[i]);}\n if (debug==\"on\"){speaking=\"mots clés trouvé vidéo\"}else{speaking=\"\"}\n ScribeSpeak(speaking,function(){reponse=reponse.trim();reponse=reponse.replace(new RegExp(\" \",\"gi\"),\"+\")\n var proc = 'start chrome --new-window https://www.youtube.com/results?search_query='+ reponse;\n //console.log(proc)\n exec(proc)\n // process1 = '%CD%/plugins/cortana/bin/searchyoutube.vbs ' + reponse ; exec(process1)\n })\n callback({'tts': \"\"})\n return false\n}\n//https://www.google.fr/search?q=Louane\n//https://www.google.fr/search?q=louane&tbm=isch\nif (query1.search(\"images\") >-1){ \n query22 = query1.search(\"images\");\n query23 = query1.length;\n for (i = (query22+6); i < query23 ;i++){reponse=reponse+(query1[i]);}\n if (debug==\"on\"){speaking=\"mots clés trouvé image\"}else{speaking=\"\"}\n ScribeSpeak(speaking,function(){reponse=reponse.trim()\n process1 = '%CD%/plugins/cortana/bin/searchimages.vbs ' + reponse ; exec(process1);//console.log(process1)\n })\n callback({'tts': \"\"})\nreturn false\n}\n\nif (query1.search(\"image\") >-1){ \n query22 = query1.search(\"image\");\n query23 = query1.length;\n for (i = (query22+5); i < query23 ;i++){reponse=reponse+(query1[i]);}\n if (debug==\"on\"){speaking=\"mots clés trouvé image\"}else{speaking=\"\"}\n ScribeSpeak(speaking,function(){reponse=reponse.trim()\n process1 = '%CD%/plugins/cortana/bin/searchimages.vbs ' + reponse ; exec(process1)\n })\n callback({'tts': \"\"})\nreturn false\n}\n\n\nif (query1.search(\"courses\") >-1){\n query22 = query1.search(\"courses\");\n query23 = query1.length;\n for (i = (query22+8); i < query23 ;i++){reponse=reponse+(query1[i]);}\n if (reponse==\"\"){reponse=\"false\"}\n if (debug==\"on\"){speaking=\"mots clés trouvé courses\"}else{speaking=\"\"}\n //ScribeSpeak(speaking,function(){\n SARAH.run('coursesmathilde', { 'item' : reponse});//callback({'tts' : \"\"});\n //})\n callback({'tts': \"\"})\nreturn false\n }\n\n\nif (query1.search(\"réveil\") >-1){\n query22 = query1.search(\"réveil\");\n query23 = query1.length;\n for (i = (query22+4); i < query23 ;i++){reponse=reponse+(query1[i]);}\n\n reponse=reponse.replace(new RegExp('[^0-9]', 'ig'),\"\")\n if(reponse==\"\"){match3(query);return false\n var date = new Date();\n var heure =date.getHours();\n var minute =date.getMinutes();\n reponse=heure+''+minute\n query=heure+' '+minute\n console.log(reponse)\n console.log('immédiat');\n }//fin if reponse=''\n // protection 24 heure et 59 minutes !!!\n\nif(reponse.length==1){tempsreveil=reponse*3600000}// que heure//8h\nif(reponse.length==2){tempsreveil=reponse*3600000} //que heure//18h\n \n if(reponse.length==3){temp=reponse[0]*3600000;\n tempsreveil=temp;//console.log(temp)\n temp=reponse-reponse[0]*100;//console.log(temp)\n temp=temp*60000;//console.log(temp)\n tempsreveil=tempsreveil+temp\n } // 1 heure + 2 minutes//1h18\n \n if(reponse.length==4){temp=reponse[0]*36000000+reponse[1]*3600000\n tempsreveil=temp;//console.log(temp)\n temp=reponse-reponse[0]*1000;//console.log(temp)\n temp1=reponse[1]*100;//console.log('rr'+temp1)\n temp=temp-temp1;//console.log('r'+temp)\n temp=temp*60000;//console.log(temp)\n tempsreveil=tempsreveil+temp\n }// 2 heure + 2 minutes \n\nreponse1=query\nreponse1=(reponse1.replace(new RegExp('[^0-9]', 'ig'),\" \")).trim()\n\n console.log('la reponse envoyer à révéil1 '+reponse1+' '+tempsreveil)\n ScribeSpeak(\"réveil programmé à \"+reponse1.replace(\" \",\" heure \"),function(){\n SARAH.run('reveil1', { 'tempsreveil' : tempsreveil , 'tempsreveilname' : reponse1});//callback({'tts' : \"\"});\n })\n callback({'tts': \"\"})\n return false\n}\n// si pas de mots clé direction match3 !!!!!\n\nif(reponse==\"\"){\n if (debug==\"on\"){speaking=\"je n'ai pas trouvé de mots clés\"}else{speaking=\"\"}\n ScribeSpeak(speaking,function(){\n match3(query)\n reponse=\"eee\"\n })//fin speak\n}//fin if\ncallback({'tts': \"\"})\nreturn false\n}//fin funtion Skynet", "function RetrieveData(callback)\n{\n apikey=\"0e9bb2bd65868488844a1d5c2e34c7362d5790de\";\n url=\"http://www.animenewsnetwork.com/encyclopedia/anime/upcoming/tv\";\n mainurl='http://api.phantomjscloud.com/single/browser/v1/'+apikey+'/?targetUrl='+ \n url+'&requestType=text'; \n \n\tquery ='select * from html where url=\"'+ mainurl+'\" and xpath=\"//table[@class=\\'datalist\\']\"';\n\tvar yqlAPI = 'https://query.yahooapis.com/v1/public/yql?q=' + encodeURIComponent(query) + ' &format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=?';\n \n\t$.getJSON(yqlAPI, function(){\n\t })\n\t.success(function(r){\n\t console.log(\"sucess\"); //.results.table[0]\n\t tablerows= r.query.results.table[0].tbody.tr;\n dict=ParseNewAnimeTable(tablerows); \n callback(dict);\n\t}) \n\t.fail(function(r){\n\t console.log(\"fail\");\n\t console.log(r);\n\t});\n\n}", "function buildString(movie){\n\tvar results = \"Key Value Pairs - You have \";\n\tif (movie.hasWatched){\n\t\t\tresults += \"watched \\\"\";\n\t\t} else {\n\t\t\tresults += \"not seen \\\"\";\n\t\t};\n\tresults += movie.title\n\tresults += \"\\\" \" + movie.rating + \" stars\"\t\n\treturn results;\n\t}", "function buscar(arg){\n\tquery = \"SELECT * FROM tabla WHERE nombre LIKE '%\"+arg+\"%' OR apellido LIKE '%\"+arg+\"%'\";\n\tloadData(query);\n}", "function displayLatestMovies(id,newMovies){\r\n\r\n if (recentDiv.innerHTML == ''){\r\n //init the table for all votes once\r\n var table = c('table');\r\n \r\n var cells = friendLists.length + (friendLists.length % 3);\r\n var tr;\r\n \r\n for (var k=0; k < cells; k++){\r\n \r\n //one row for 3 cells\r\n if ( k % 3 == 0){\r\n tr = c('tr');\r\n table.appendChild(tr);\r\n }\r\n \r\n var td = c('td');\r\n td.width = '250px';\r\n tr.appendChild(td);\r\n \r\n tableIDs[k] = td;\r\n }\r\n \r\n recentDiv.appendChild(table);\r\n }\r\n \r\n var html = '';\r\n html += '<span><a style=\"color: black; font-weight:bold; font-size:x-small; text-decoration: none\"';\r\n html += ' href=\"'+getListUrl(id)+'\">'+friendNames[id]+\"</a>\";\r\n html += '</span><br>';\r\n \r\n for (var l=0; l < maxRecent; l++){\r\n \r\n var mLink = '';\r\n var mTitle = '';\r\n var mVote = '';\r\n \r\n if ( l < latestMovies[id].length ){\r\n var lateID = latestMovies[id][l];\r\n mTitle = movieTitles[id][lateID];\r\n if (mTitle.length > 25) mTitle = mTitle.substr(0,25) + '...';\r\n mLink = '/title/tt'+movieCollection[id][lateID]+'/';\r\n mVote = ' (' + voteCollection[id][lateID] + ')';\r\n }\r\n\r\n if ( l < newMovies )\r\n html += '<span><a style=\"color: grey; font-weight:bold; font-size:x-small; text-decoration: none\"';\r\n else\r\n html += '<span><a style=\"color: grey; font-size:x-small; text-decoration: none\"';\r\n\r\n html += ' href=\"'+mLink+'\">'+mTitle+\"</a>\";\r\n html += '</span><span style=\"color: black; font-size:x-small;\">'+mVote+'</span>';\r\n html += '<br>';\r\n }\r\n \r\n tableIDs[id].innerHTML = html; \r\n}", "function getMovieData(movie_url_des) {\n fetch(movie_url_des)\n .then((res) => res.json())\n .then((res) => {\n movie_title = res.original_title;\n movie_type = res.genres;\n movie_des = res.description;\n movie_url = res.image_url;\n movie_release_date = res.date_published;\n movie_rated = res.rated;\n movie_imbd = res.imdb_score;\n movie_directors = res.directors;\n movie_actors = res.actors;\n movie_duration = res.duration;\n movie_countries = res.countries;\n movie_votes = res.avg_vote;\n document\n .getElementById(\"movie_data\")\n .innerHTML = `\n <div><img src= ${movie_url} alt='movie'></img></div>\n <div><H2>${movie_title}</H2>\n <p> <B>Durée :</B>${movie_duration}</p>\n <p> <B>Genre : </B> ${movie_type} </p>\n <p> <B>Date de sortie : </B>${movie_release_date}</p>\n <p> <B>Moyenne des votes :</B> ${movie_rated} </p>\n <p> <B>Score Imbd :</B> ${movie_rated}</p>\n <p> <B>Réalisateur :</B>${movie_directors}</p>\n <p> <B>Pays d'origine : </B> ${movie_countries} </p>\n <p> <B>Liste des acteurs :</B> ${movie_actors}</p>\n <p> <B>Résultat box office : </B> ${movie_votes} </p>\n <p> <B>Résumé :</B> ${movie_des} </p>\n </div>`\n });\n}", "function scrubNamesDBOutput(queryResults){\n\tfor (i=0; i < queryResults.length; i++){\n\t\tqueryResults[i].name = encodeHTML(queryResults[i].name);\n\t\tqueryResults[i].gender = encodeHTML(queryResults[i].gender);\n\t\tqueryResults[i].mood = encodeHTML(queryResults[i].mood);\n\t\tqueryResults[i].length = encodeHTML(String(queryResults[i].length));\n\t}\n\treturn queryResults;\n}", "function loadMovieDescription(pos) {\n $('.movie-plot').text(movies[pos].summary);\n // $('#moviegenres').text(movies[pos].Genres);\n //$('#moviedirector').text(movies[pos].director);\n $('.movie-cast').text(movies[pos].cast);\n $(\".movie_img\").show();\n}", "function movieSearch(movie){\n if(!movie){\n var movieName = \"Mr. Nobody\";\n } else{\n movieName = movie;\n }\n let queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function(err, response, body){\n\n if(!err && response.statusCode === 200){\n\n //need to look at responses from IMDB, responses seem to change based on the movie\n //also if possible add some input validation\n console.log(\"Movie title: \" + JSON.parse(body).Title);\n console.log(\"Release date: \" + JSON.parse(body).Year);\n console.log(\"Rating: \" + JSON.parse(body).imdbRating);\n //rotten tomatoes rating\n if(JSON.parse(body).Ratings[1]){\n console.log(\"Rotten tomatoes rating: \" + JSON.parse(body).Ratings[1].Value);\n }\n console.log(\"Produced in \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n \n } else{\n\n console.log(err);\n }\n\n\n });\n \n\n\n}", "function ______TEXT_QUERIES______() {}", "function movie() {\n\n\tvar movieName = '';\n\n\tif(process.argv.length >= 4){\n\t\tfor (var i = 3; i < dataArr.length; i++){\n\t\t\tif (i > 3 && i < dataArr.length) {\n\t\t\t\tmovieName = movieName + \"+\" + dataArr[i];\n\t\t\t} else {\n\t\t\t\tmovieName += dataArr[i];\n\t\t\t}\n\t\t} // closes for loop for dataArr\n\t} else {\n\t\tmovieName = 'Mr Nobody';\n\t}\n\n\tvar queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&tomatoes=true&r=json\";\n\n\tconsole.log(queryUrl);\n\n\trequest(queryUrl, function(error, response, body){\n\n\t\tif (!error && response.statusCode === 200) {\n\n\t \tconsole.log(\"\");\n\t\t\tconsole.log(\"Title: \" + JSON.parse(body).Title);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Release Year: \" + JSON.parse(body).Released);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Rating: \" + JSON.parse(body).imdbRating);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Produced In: \" + JSON.parse(body).Country);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"\");\n\t \tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL);\n\n\t\t}\n\t});\t\t\t\n\n}", "function getMovieInfo(movieTitle) {\n\n\t// Runs a request to the OMDB API with the movie specified.\n\n\tvar queryUrl = \"http://www.omdbapi.com/?s=\" + movieTitle + \"&y=&plot=short&tomatoes=true&r=json&apikey=trilogy\";\n\n\tomdb(queryUrl, function (error, response, body) {\n\t\t// console.log(\"Here\",body)\n\n\t\tif (error) {\n\t\t\tconsole.log(error)\n\t\t}\n\n\t\t// If the request is successful...\n\n\t\tif (!error && response.statusCode === 200) {\n\n\t\t\t// Parses the body of the site and recovers movie info.\n\n\t\t\tvar movie = JSON.parse(body);\n\n\t\t\t// Prints out movie info form omdb server.\n\n\t\t\tlogOutput(\"Movie Title: \" + movie.Title);\n\n\t\t\tlogOutput(\"Release Year: \" + movie.Year);\n\n\t\t\tlogOutput(\"IMDB Rating: \" + movie.imdbRating);\n\n\t\t\tlogOutput(\"Country Produced In: \" + movie.Country);\n\n\t\t\tlogOutput(\"Language: \" + movie.Language);\n\n\t\t\tlogOutput(\"Plot: \" + movie.Plot);\n\n\t\t\tlogOutput(\"Actors: \" + movie.Actors);\n\n\t\t\t// Had to set to array value, as there seems to be a bug in API response,\n\n\t\t\t// that always returns N/A for movie.tomatoRating.\n\n\t\t\tlogOutput(\"Rotten Tomatoes Rating: \" + movie.Ratings[2].Value);\n\n\t\t\tlogOutput(\"Rotten Tomatoes URL: \" + movie.tomatoURL);\n\n\t\t}\n\n\t});\n\n}", "function getMovie(){\n // this is exactly the same logic as the spotify function starts with\n // if there are search terms (aka userParameters), use them in the query\n // if there are not search terms, use a pre-defined default search\n let movieSearchTerm;\n\tif(userParameters === undefined){\n\t\tmovieSearchTerm = \"Mr. Nobody\";\n\t}else{\n\t\tmovieSearchTerm = userParameters;\n\t};\n // this is the queryURL that will be used to make the call - it holds the apikey, returns a \"short\" plot, type json, and \n // the tomatoes flag attempts to return rottenTomatoes data although most of that is now deprecated as of may 2017 \n let queryURL = 'http://www.omdbapi.com/?t=' + movieSearchTerm +'&apikey=trilogy&y=&plot=short&tomatoes=true&r=json';\n request(queryURL, function(error, response, body){\n\t if(!error && response.statusCode == 200){\n\t console.log(\"Title: \" + JSON.parse(body).Title);\n\t console.log(\"Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value);\n\t console.log(\"Country of Production: \" + JSON.parse(body).Country);\n\t console.log(\"Language: \" + JSON.parse(body).Language);\n\t console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n getTimeStamp();\n fs.appendFile(\"log.txt\", `***New Log Entry at ${timeStamp}***\\nNEW MOVIE SEARCH EVENT:\\nTitle: ${JSON.parse(body).Title}\\nYear: ${JSON.parse(body).Year}\\nIMDB Rating: ${JSON.parse(body).imdbRating}\\nRotten Tomatoes Score: ${JSON.parse(body).Ratings[1].Value}\\nCountry of Production: ${JSON.parse(body).Country}\\nLanguage: ${JSON.parse(body).Language}\\nPlot: ${JSON.parse(body).Plot}\\nActors: ${JSON.parse(body).Actors}\\n------\\n`, function(err) {\n });\n }\n });\n}", "function getMovieInfo (liriInquiry){\n if(liriInquiry){\n const queryURL = `http://www.omdbapi.com/?t=${liriInquiry}&apikey=6b2c19b3&`;\n\n request( queryURL, function(err, response, body) {\n if(err)\n {\n console.log(err.stack);\n }\n let data = JSON.stringify(body);\n data = JSON.parse(body);\n\n console.log('\\nMovie Title: '+data.Title +'\\nYear: '+data.Year+\n '\\nIMDB Rating: '+data.Ratings[0].Value+'\\nRotten Tomatoes Rating: '+\n data.Ratings[1].Value+'\\nCountry: '+data.Country+'\\nLanguage: '+data.Language+\n '\\nPlot: '+data.Plot+'\\nActors: '+data.Actors+'\\n\\n');\n //console.log(data);\n });}\n else {\n request( \"http://www.omdbapi.com/?t='Mr. Nobody'&apikey=6b2c19b3&\", function(err, response, body) {\n \n let data = JSON.stringify(body);\n data = JSON.parse(body);\n \n console.log('\\nMovie Title: '+data.Title +'\\nYear: '+data.Year+\n '\\nIMDB Rating: '+data.Ratings[0].Value+'\\nRotten Tomatoes Rating: '+\n data.Ratings[1].Value+'\\nCountry: '+data.Country+'\\nLanguage: '+data.Language+\n '\\nPlot: '+data.Plot+'\\nActors: '+data.Actors+'\\n\\n');\n //console.log(data);\n });\n\n }\n\n}", "function getMovieInfo() {\n\n\t//Then, run a request to the OMDB API with the movieName the user enters.\n\trequest(\"http://www.omdbapi.com/?t=\" + movieName + \"&apikey=trilogy\", function(error, response, body) {\n\n\t\t//Create variable to hold all the movie info that we will output to the console.\n\t\t//Parse the body of the JSON object that holds the movie data and display the movie info.\n\t\tvar movieInfo = JSON.parse(body);\n\t\t//Title of movie\n\t\tvar movieTitle = \"Title: \" + movieInfo.Title;\n\t\t//Year the movie came out.\n\t\tvar movieYear = \"Year movie was released: \" + movieInfo.Year;\n\t\t//IMDB Rating of the movie.\n\t\tvar IMDBRating = \"IMDB movie rating (out of 10): \" + movieInfo.imdbRating;\n\t\t//Rotten Tomatoes rating of the movie.\n\t\tvar rottenTomatoes = \"Rotten Tomatoes rating (out of 100%): \" + movieInfo.Ratings[1].Value;\n\t\t//Country where the movie was produced.\n\t\tvar countryProduced = \"Filmed in: \" + movieInfo.Country;\n\t\t//Language of the movie.\n\t\tvar movieLanguage = \"Language: \" + movieInfo.Language;\n\t\t//Plot of the movie.\n\t\tvar moviePlot = \"Movie plot: \" + movieInfo.Plot;\n\t\t//Actors in the movie.\n\t\tvar movieActors = \"Actors: \" + movieInfo.Actors;\n\n\t\t//If the request is successful (i.e. if the response status code is 200)\n\t\tif (!error && response.statusCode === 200) {\n\t\t\t//console.log(JSON.parse(body));\n\t\t\t//Output the following information to terminal window.\n\t\t\t//Title of the movie.\n\t\t\tconsole.log(movieTitle);\n\t\t \t//Year the movie came out.\n\t\t \tconsole.log(movieYear);\n\t\t \t//IMDB Rating of the movie.\n\t\t \tconsole.log(IMDBRating);\n\t\t \t//Rotten Tomatoes rating of the movie.\n\t\t \tconsole.log(rottenTomatoes);\n\t\t \t//Country where the movie was produced.\n\t\t \tconsole.log(countryProduced);\n\t\t \t//Language of the movie.\n\t\t \tconsole.log(movieLanguage);\n\t\t \t//Plot of the movie.\n\t\t \tconsole.log(moviePlot);\n\t\t \t//Actors in the movie.\n\t\t \tconsole.log(movieActors);\n\t\t}\n\t});\n}", "function getMovie() {\n\n var omdbApi = require('omdb-client');\n\n var params = {\n apiKey: 'XXXXXXX',\n title: 'Terminator',\n year: 2012\n }\n omdbApi.get(params, function (err, data) {\n // process response...\n });\n}", "function movieThis (movie) {\n\n var omdbUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=\" + omdb.key;\n\n request(omdbUrl, function(error, response, body) {\n if (!error && response.statusCode === 200) {\n var info = JSON.parse(body);\n console.log(\"\");\n console.log(('***** \"' + info.Title + '\" *****').inverse);\n console.log(\"Released in \" + info.Year);\n console.log(\"IMDB \" + info.Ratings[0].Value);\n console.log(\"Rotten Tomatoes \" + info.Ratings[1].Value);\n console.log(\"Produced in \" + info.Country);\n console.log(\"Language: \" + info.Language);\n console.log(\"Plot: \" + info.Plot);\n console.log(\"Actors: \" + info.Actors);\n console.log(\"\");\n console.log(\"**************************************\");\n console.log(\"\");\n // Append every full return to the log.txt file.\n fs.appendFile(\"log.txt\", \"\\n\" + '***** \"' + info.Title + '\" *****' + \"\\nReleased in \" + info.Year + \"\\nIMDB \" + info.Ratings[0].value + \"\\nRotten Tomatoes \" + info.Ratings[1].Value + \"\\nProduced in \" + info.Country + \"\\nLanguage: \" + info.Language + \"\\nPlot: \" + info.Plot + \"\\nActors: \" + info.Actors + \"\\n\", function(error) {\n if (error) {\n console.log(error);\n };\n });\n } else {\n console.log('An error occurred: ' + error);\n }\n })\n}", "function movieThis (movie) {\n if (movie === undefined) {\n movie = \"Mr. Nobody\";\n }\n\n var movieURL = \"http://www.omdbapi.com/?t=\"+ movie +\"&apikey=trilogy\";\n request(movieURL, function (error, response, body) {\n var parseBody = JSON.parse(body);\n // console.log(\"ENTIRE MOVIE OBJECT: \" + JSON.stringify(parseBody));\n console.log(\"Title of Movie: \" + parseBody.Title + \"\\nYear Released: \" + parseBody.Released + \"\\nIMBD Rating: \" + parseBody.imdbRating\n + \"\\nRotten Tomatoes Rating: \" + parseBody.Ratings[1].Value+ \"\\nCountry Produced: \" + parseBody.Country + \"\\nLanguage: \" + parseBody.Language\n + \"\\nPlot: \" + parseBody.Plot + \"\\nActors: \" + parseBody.Actors);\n });\n}", "function movieData(title) {\n\n // This conditional statement handles the case where the user does not put a movie by returning the default movie selection: Do The Right Thing\n if (title === undefined) {\n\n title = 'Do The Right Thing';\n console.log('Since you didn\\'t request a specific movie title, I suggest that you watch this one!\\n');\n\n };\n\n // The request docs provide the sytax for its use which I followed here to make an api call to omdb\n request(\"http://www.omdbapi.com/?apikey=49544f9c&t=\" + title, function (error, response, body) {\n\n // If there is an error display the error message otherwise do not\n if (error == true) {\n console.log('error:', error);\n };\n\n let omdbResponse = JSON.parse(body);\n console.log(omdbResponse);\n\n if (omdbResponse.Error === 'Movie not found!') {\n console.log(`Movie not found. Sorry about that!\\n`)\n } else {\n // this for loop loops through the ratings array (which has three little objects in it) so that i can scope the Ratings key and pull out the Rotten Tomatoes Value\n for (let i = 0; i < omdbResponse.Ratings.length; i++) {\n\n // I left this console log in here so that you can see what the result of the for loop looks like and why I used it\n // console.log(omdbResponse.Ratings[i])\n\n };\n\n // These console.logs are printing out different bits of information from the body of the response\n console.log(`Movie title: ${omdbResponse.Title}`);\n console.log(`This movie was released: ${omdbResponse.Released}`);\n console.log(`The IMDB rating for this movie is: ${omdbResponse.imdbRating}`);\n console.log(`Rotten Tomatoes gives this move a rating of: ${omdbResponse.Ratings[1].Value}`);\n console.log(`This movie was filmed in: ${omdbResponse.Country}`);\n console.log(`This movie is in: ${omdbResponse.Language}`);\n console.log(`Here is a brief synopsis of the plot: ${omdbResponse.Plot}`);\n console.log(`Starring: ${omdbResponse.Actors} \\n\\nThis concludes the information for your current request. Thank you for using Liri. \\n`);\n }\n\n });\n\n}", "function ex20() {\n\tvar movieLists = [\n\t\t{\n\t\t\tname: \"New Releases\",\n\t\t\tvideos: [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 70111470,\n\t\t\t\t\t\"title\": \"Die Hard\",\n\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t{ width: 150, height:200, url:\"http://cdn-0.nflximg.com/images/2891/DieHard150.jpg\" },\n\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/DieHard200.jpg\" }\n\t\t\t\t\t],\n\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\"bookmark\": []\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": 654356453,\n\t\t\t\t\t\"title\": \"Bad Boys\",\n\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/BadBoys200.jpg\" },\n\t\t\t\t\t\t{ width: 140, height:200, url:\"http://cdn-0.nflximg.com/images/2891/BadBoys140.jpg\" }\n\n\t\t\t\t\t],\n\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\"bookmark\": [{ id:432534, time:65876586 }]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\tname: \"Thrillers\",\n\t\t\tvideos: [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 65432445,\n\t\t\t\t\t\"title\": \"The Chamber\",\n\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t{ width: 130, height:200, url:\"http://cdn-0.nflximg.com/images/2891/TheChamber130.jpg\" },\n\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/TheChamber200.jpg\" }\n\t\t\t\t\t],\n\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\"bookmark\": []\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": 675465,\n\t\t\t\t\t\"title\": \"Fracture\",\n\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/Fracture200.jpg\" },\n\t\t\t\t\t\t{ width: 120, height:200, url:\"http://cdn-0.nflximg.com/images/2891/Fracture120.jpg\" },\n\t\t\t\t\t\t{ width: 300, height:200, url:\"http://cdn-0.nflximg.com/images/2891/Fracture300.jpg\" }\n\t\t\t\t\t],\n\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\"bookmark\": [{ id:432534, time:65876586 }]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t];\n\n\n\t// Use one or more concatMap, map, and reduce calls to create an array with the following items (order doesn't matter)\n\t// [\n\t//\t {\"id\": 675465,\"title\": \"Fracture\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/Fracture120.jpg\" },\n\t//\t {\"id\": 65432445,\"title\": \"The Chamber\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/TheChamber130.jpg\" },\n\t//\t {\"id\": 654356453,\"title\": \"Bad Boys\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/BadBoys140.jpg\" },\n\t//\t {\"id\": 70111470,\"title\": \"Die Hard\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/DieHard150.jpg\" }\n\t// ];\n\n\treturn movieLists.\n\t\tconcatMap(movieList => movieList.videos.concatMap(v=> v.boxarts\n .reduce((acc, curr) => acc.width * acc.height < curr.width * curr.height ? acc : curr)\n .map(b => ({id: v.id, title: v.title, boxart: b.url}))\n )\n )\n\n}", "function movieThis() {\n if (query === \"\") {\n request(\"http://www.omdbapi.com/?t=Mr. Nobody&y=&plot=short&apikey=\" + keys.apiInfo.omdbAPI, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n let outputStr = \"\\n Title: \" + JSON.parse(body).Title + \"\\n Year: \" + JSON.parse(body).Year + \"\\n IMDB Rating: \" + JSON.parse(body).imdbRating + \"\\n Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value + \"\\n Country: \" + JSON.parse(body).Country + \"\\n Language: \" + JSON.parse(body).Language + \"\\n Plot: \" + JSON.parse(body).Plot + \"\\n Actors: \" + JSON.parse(body).Actors + \"\\n\";\n\n console.log(outputStr);\n\n fs.appendFile(\"./log.txt\", outputStr, function (err) {\n if (err) {\n console.log(err)\n }\n })\n }\n })\n } else {\n request(\"http://www.omdbapi.com/?t=\" + query + \"&y=&plot=short&apikey=\" + keys.apiInfo.omdbAPI, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n let outputStr = \"\\n Title: \" + JSON.parse(body).Title + \"\\n Year: \" + JSON.parse(body).Year + \"\\n IMDB Rating: \" + JSON.parse(body).imdbRating + \"\\n Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value + \"\\n Country: \" + JSON.parse(body).Country + \"\\n Language: \" + JSON.parse(body).Language + \"\\n Plot: \" + JSON.parse(body).Plot + \"\\n Actors: \" + JSON.parse(body).Actors + \"\\n\";\n\n console.log(outputStr)\n\n fs.appendFile(\"./log.txt\", outputStr, function (err) {\n if (err) {\n console.log(err)\n }\n })\n }\n })\n }\n} //End Movie this function" ]
[ "0.57684994", "0.56667954", "0.5493696", "0.54348415", "0.54297596", "0.54175603", "0.53681475", "0.5346404", "0.53404844", "0.5303413", "0.5289087", "0.52833873", "0.5283085", "0.5262754", "0.52469826", "0.52456695", "0.52403426", "0.5234755", "0.52204865", "0.5173992", "0.5172747", "0.5155671", "0.5152834", "0.5133367", "0.51215", "0.5112054", "0.5107399", "0.5105858", "0.50963354", "0.5093097", "0.50873953", "0.5080841", "0.50800157", "0.5073021", "0.5070632", "0.5068055", "0.5067074", "0.5056745", "0.5052954", "0.5048203", "0.5040783", "0.50369126", "0.5035458", "0.5017443", "0.50140077", "0.50117594", "0.50069994", "0.50003296", "0.49818113", "0.49812225", "0.497227", "0.49688515", "0.49643642", "0.496379", "0.49513826", "0.49437445", "0.49403223", "0.49380475", "0.49374786", "0.49370676", "0.49369127", "0.49303627", "0.49245402", "0.49241093", "0.4923438", "0.49202442", "0.49156195", "0.49092555", "0.49045756", "0.48976913", "0.48888052", "0.48622152", "0.48502073", "0.4847011", "0.48442206", "0.48419407", "0.48412958", "0.48407528", "0.48401085", "0.48394763", "0.48379797", "0.48370948", "0.4835973", "0.48329613", "0.48329428", "0.48322797", "0.4832245", "0.48306388", "0.48303786", "0.48235807", "0.48198116", "0.48163873", "0.48154813", "0.48154464", "0.48082528", "0.480637", "0.48059434", "0.48032856", "0.47986302", "0.47961453" ]
0.55380654
2
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ show all movies
function movie_find_show_all(url_query, respond){ respond.write("<script>document.getElementById('heading').innerHTML ='Movie search All';</script>"); var search_input ='<style>input[type=search] {width: 130px;box-sizing: border-box;border: 2px solid #ccc;border-radius: 4px;font-size: 16px;background-color: white; margin:2% auto 2% 40%;background-image:url("searchicon.png");background-position: 10px 10px;background-repeat: no-repeat;padding: 12px 20px 12px 40px;-webkit-transition: width 0.4s ease-in-out;transition: width 0.4s ease-in-out;}input[type=search]:focus {width: 95%;margin:2% auto 2% auto;}/* #searh_input{margin:2% auto 2% 40%;width: 50%;} */</style><input type="search" name="search" placeholder="Search.." id="search_input" onsearch ="call_db_search()"><button onclick="call_db_search()" style ="width:4%; height:7.5%;font-size:2.3em;border-radius:0px;background-color:transparent;" class="btn btn-info"><i class="fas fa-search"></i></button><br><div id style="width:100%;height:7%;background-color:white;color:black;font-size:1em;"><a href="movie_find_show_all" onclick ="">Show all stored movies</a><br><a href="delete_all" onclick ="">Delete all stored movies</a></div><hr><script> function call_db_search(){ var search_query = document.getElementById("search_input"); if(search_query.value == ""){ document.getElementById("heading").innerHTML ="Please feel data to be searched for"; } else{ window.open("movie_find_search?"+search_query.value, "_self"); } } </script>'; respond.write(search_input); //get data from db my_sql_conn.connect(function(err){//doing mysql connection handshake aka test connectability if(err){ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>connection error: "+err+"</p>"); //return respond.end();//ending here } else{ // respond.write("<p>connected to db</p>"); //respond.end();//ending here } //get data from db var mysql_db_data_get = "SELECT * FROM movie_table" //connect to existing db my_sql_conn_db.query(mysql_db_data_get, function(err, results){ if(err){ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Data adding err (serach) "+err+"</p>"); return ;//respond.end();//ending here } else{ // respond.write("<p>Data added "+JSON.stringify(results[0].m_producer)+"</p>"); var result = results; if(results.length ==0){return respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Could'nt find movie in db, please add some</p>");}//if record match not found var extra_results = 1;//skip result duplicate var count = 0; for(var i =0; i<=result.length; i++){ db_data_shower();//break if setup is not like this extra_results =i;//capture duplicate count = i; } //respond.end();//ending here } function db_data_shower(){ if(extra_results==0){return} respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Movie Title : "+result[count].m_title+" | Movie Director : "+result[count].m_director+" | Movie Producer : "+result[count].m_producer+" | Movie Producing Company : "+result[count].m_production_company+" | Movie filmed Country : "+result[count].m_country+" | Movie Starring : "+result[count].m_actor+" | Movie Genre : "+result[count].m_genre+" | Movie Synopsis : "+result[count].m_description+" | Movie Disclaimer : "+result[count].m_disclaimer+" | Movie Poster : "+result[count].m_image+"<br>"+ '<input type="button" style="width:40%;height:2em;margin:1% 1% 1% 1%" onclick="window.open(\'movie_update?'+result[count].movie_id+'\',\'_self\')" value="Update Movie" class="btn btn-primary"><input type="button" style="width:40%;height:2em;margin:1% 1% 1% 1%" onclick="window.open(\'movie_delete?'+result[count].movie_id+'\',\'_self\')" value="Delete Movie" class="btn btn-primary"></p>'); } } ); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllMovies() {\n Movie.find()\n .then(allMovies => console.log('here are all the movies', allMovies))\n .catch(err => console.log('could not get all movies', err))\n}", "function printMovies(movies, genre) {\n\tvar handlebars = handlebarsInit('#movie');\n\t// search every movies\n\tfor (var i = 0; i < movies.length; i++) {\n\t\tvar movie = movies[i];\n\t\t// convert raking in stars\n\t\tvar vote = oneToX(movie.vote_average, 5, 10);\n\t\tvar star = printStar(vote, 5);\n\t\t// convert original_language in flag\n\t\tvar flag = convertFlag(movie.original_language);\n\t\t// add poster from api database if present\n\t\tvar posterPath = addPoster(movie);\n\t\t// create object context for handlebars\n\t\tvar context = {\n\t\t\ttitle: movie.title,\n\t\t\toriginal_language: flag,\n\t\t\tstar: star,\n\t\t\toverview: movie.overview,\n\t\t\tposter_path: posterPath,\n\t\t\tgenre_ids: movie.genre_ids\n\t\t};\n\t\t// check if the title is the same as the original title\n\t\tcheckTitle(movie, context);\n\t\t// handlebars append\n\t\tvar html = handlebars(context);\n\t\t$('.results').append(html);\n\t\t// filter by genre the .result\n\t\tfilterByGenre(genre);\n\t}\n}", "function showAll() {\n $('.movie-list').empty();\n \n $.get('/allmovies', function(data) {\n if (data.length > 0) {\n for (let i in data) {\n buildMovieList(data[i]);\n }\n $('.not-found').css(\"display\", \"none\");\n $('.movie-list').css(\"display\", \"block\");\n }\n else {\n $('.movie-list').css(\"display\", \"none\");\n $('.not-found').css(\"display\", \"block\");\n }\n });\n}", "getRelatedMovie(movies) {\n // It Display Related Movie When User Search For Movie\n this.displayRelatedMovie(movies)\n }", "function getNowPlayingMovies() {\n\n const path = '/movie/now_playing';\n\n const url = generateUrl(path);\n\n const render = renderMovies.bind({title: 'Now Playing Movies'});\n\n sectionMovies(url, render, handleError);\n\n\n}", "function gotAllMovies(err) {\n console.log(\"gotAllMovies()\");\n\n // report an error, you'd want to do something better than this in production\n if (err) {\n console.log(\"error loading movies\");\n console.error(err);\n return;\n }\n\n showMovies();\n}", "displayRelatedMovie(movies) {\n // It create all html element with movie data\n this.createRelatedMovie(movies)\n }", "function renderMovies(data) {\n // array dei film \n const movies = data.results;\n const movieBlock = createMovieContainer(movies, this.title);\n popularMovies.appendChild(movieBlock);\n}", "moviesList(){\n for (let i = 0; i < this.homeMovies.length; i++) {\n axios.get(`https://api.themoviedb.org/3/movie/${this.homeMovies[i].url}`, {\n params: {\n 'api_key': API_KEY,\n language: this.language,\n page: this.homeIndex,\n\n }\n }).then(now => {\n this.homeMovies[i].movies = now.data.results;\n });\n }\n }", "function getMovies(searchText) {\n $.get(\n baseURL + searchName + searchText + \"&type=movie\",\n (respuesta, estado) => {\n if (estado === \"success\") {\n let movies = respuesta.Search;\n let output = \"\";\n $.each(movies, (i, movie) => {\n output += `\n <div class=\"col-md-3\">\n <div class=\"well text-center\">\n <img class=\"imgSearch\" src=\"${movie.Poster}\">\n <h5>${movie.Title}</h5>\n <a onclick=\"selectedMovie('${movie.imdbID}')\" class=\"btn btn-info\" href=\"#\">Mas info</a>\n </div>\n </div>\n \n `;\n });\n\n result.html(output);\n }\n }\n );\n}", "function showMovies(){\t\n\t\thideFilters();\n updateScreen(scrubbedResults[resultNum]);\n\t\tresultNum >= scrubbedResults.length - 1 ? $('.show-another').hide() : $('.show-another').show();\n\t}", "async findAllFilms(){\n return Movie.find();\n }", "function getMovieList(callback){\n\tconst query = {\n\t\tapi_key: TMDB_API_AUTH.KEY,\n\t\tsort_by: \"release_date.desc\",\n\t\tpage: pageCounter\n\t};\n\t$.getJSON(TMDB_SEARCH_URL_MOVIES_LIST, query, callback);\n}", "function loadMovies() {\n\t// Loop through first half array\n\tfor (var i=0;i<items.length/2;i++) {\n\t\tvar object = get_one_recommended_movie(i);\n\n\t\titems[i].children[0].children[1].children[0].innerHTML = object.name;\n\n\t\t// Set link to go to the indiviual title page\n\t\t$(items[i]).attr(\"href\", \"title/title.php?id=\" + object.id + \"&type=movie\");\n\n\t\t// Apply imdb poster image\n\t\tapplyImdbThumbnail(items[i].children[0].children[0].children[0], false, object.id);\n\t}\n}", "async function getMovies() {\n // TODO: fetch movies from wp headless and call appendMovies\n // https://movie-api.cederdorff.com/wp-json/wp/v2/posts?_embed\n}", "function getMovies(){\r\n searchText = sessionStorage.getItem('searchText');\r\n axios.get('https://api.themoviedb.org/3/search/movie?api_key=7719d9fc54bec69adbe2d6cee6d93a0d&query='+searchText)\r\n .then((response) => {\r\n console.log(response);\r\n let movies = response.data.results;\r\n let output = '';\r\n if(movies.length != 0){\r\n output = '<h2 class=\"heading\">Your Movies!!</h2>';\r\n $('#head').html(output);\r\n output = '';\r\n $.each(movies, (index, movie) => {\r\n if(movie.poster_path != null){\r\n output += `\r\n <div class=\"col-lg-3 col-md-6 mb-4\">\r\n <div class=\"card h-100\">\r\n <img class=\"card-img-top img-height\" src=\"https://image.tmdb.org/t/p/original${movie.poster_path}\" alt=\"\" onClick=\"getMovieId(${movie.id})\">\r\n <div class=\"card-footer\">`+\r\n (isReleased(movie.release_date) ? `<a href=\"#\" onClick=\"addMovie(${movie.id}, ${1})\" class=\"btn btn-primary btn-sm\" style=\"float:left\">+ Watched</a> \r\n <a href=\"#\" onClick=\"addMovie(${movie.id}, ${0})\" class=\"btn btn-primary btn-sm\" style=\"float:right\">+ Wished</a>` : \r\n `<a href=\"#\" onClick=\"addMovie(${movie.id}, ${0})\" class=\"btn btn-primary btn-sm\">+ Wished</a>`)\r\n +`\r\n </div>\r\n </div>\r\n </div>\r\n `\r\n }\r\n });\r\n }\r\n else\r\n output += '<h2 class=\"heading\">No movies Found :(</h2>';\r\n $('#searchedMovies').html(output);\r\n })\r\n .catch((err) => {\r\n console.log(err.message);\r\n });\r\n}", "function showMovie(response) {\n let movie = response;\n\n //neki filmovi/serije imaju vise rezisera, glumaca i zanrova i da bi ljepse mogli da ih prikazemo na stranici od stringa koji dobijemo napravimo niz elemenata\n var str = movie.Actors;\n var str2 = movie.Director;\n var str3 = movie.Genre;\n\n var stars = str.split(\", \");\n var directors = str2.split(\", \");\n var genres = str3.split(\", \");\n\n //ukoliko nemamo podatke o slici prikazemo default sliku iz foldera\n if (movie.Poster == \"N/A\") {\n movie.Poster = \"./Images/default.jpg\";\n }\n\n //prikazujemo redom podatke\n $(\"#movie-title-name\").append(movie.Title + ' <span id=\"movie-year\"></span>');\n $(\"#movie-year\").append(movie.Year);\n\n //ukoliko IMDb ocjene nisu dostupne, prikazemo odgovarajucu poruku\n if (movie.imdbRating === 'N/A') {\n $(\"#movie-rating\").append('<span>Ratings are not available<span>');\n } else {\n $(\"#movie-rating\").append(movie.imdbRating + '/10 <span>' + movie.imdbVotes + ' votes </span>');\n }\n\n $(\"#img\").append('<img src=' + movie.Poster + ' alt=\"\">');\n\n if (movie.Plot === 'N/A') {\n $('#movie-description').append('Plot is not available at this moment. :)');\n } else {\n $('#movie-description').append(movie.Plot);\n }\n\n directors.forEach(director => {\n $('#movie-director').append('<p>' + director + '</p>');\n });\n\n stars.forEach(star => {\n $('#movie-stars').append('<p>' + star + '</p>');\n });\n\n genres.forEach(genre => {\n $('#movie-genre').append('<p>' + genre + '</p>');\n });\n\n $('#movie-released').append(movie.Released);\n $('#movie-runtime').append(movie.Runtime);\n\n //ukoliko je Type -> serija onda prikazemo ukupan broj sezona \n //prikazemo i select sa svim sezonama te serije gdje na klik mozemo prikazati sve epizode odredjene sezone\n //po defaultu je selectovana poslednja sezona serije, kako bi odmah pri ulasku u seriju imali izlistane epizode \n if (movie.Type == 'series') {\n $('#movie-seasons').append('<h3>Seasons:</h3><p>' + movie.totalSeasons + '</p>');\n\n $('#series-season').append(\n '<p class=\"heading-des\">Episodes> ' +\n '<select onchange=\"getSeason(\\'' + movie.Title + '\\')\" id=\"select-episodes\">' +\n '</select>' +\n '</p>' +\n '<hr class=\"about\">' +\n '<div class=\"description\">' +\n '<div id=\"episodes\">' +\n '</div>' +\n '</div>'\n )\n }\n\n $('#movie-cast').append(\n '<p>Director: ' + movie.Director + '</p>' +\n '<p>Writer: ' + movie.Writer + '</p>' +\n '<p>Stars: ' + movie.Actors + '</p>'\n )\n\n if (movie.Ratings.length == 0) {\n $('#movie-reviews').append('<p>Ratings are not available at this moment. :)</p>')\n } else {\n movie.Ratings.forEach(rating => {\n $('#movie-reviews').append('<p>' + rating.Source + ' --> ' + rating.Value + '</p>')\n });\n }\n\n if (movie.Awards === 'N/A') {\n $('#movie-awards').append('Awards are not available at this moment. :)');\n } else {\n $('#movie-awards').append(movie.Awards);\n }\n\n $('#movie-imdb-btn').append(\n '<button onClick=\"openImdbPage(\\'' + movie.imdbID + '\\')\" class=\"btn-imdb\">' +\n '<i class=\"fab fa-imdb\"></i> IMDb' +\n '</button>'\n )\n\n //za ukupan broj sezona serije ispunimo select sa tolikim brojem opcija\n for (i = 1; i <= movie.totalSeasons; i++) {\n $('#select-episodes').append(\n '<option selected=\"selected\" value=\"\\'' + i + '\\'\">Season ' + i + '</option>'\n )\n }\n\n if (movie.Type === \"series\") {\n\n //prikazemo sve epizode selektovane sezone\n getSeason(movie.Title);\n\n }\n\n //ukoliko smo otvorili epizodu prikazemo na stranici na kojoj smo epizodi i sezoni \n //i prikazemo dugme za povratak na seriju\n if (movie.Type === \"episode\") {\n $(\"#episode-details\").append(\n '<span class=\"episode-span\">Season ' + movie.Season + ' </span>' +\n '<span class=\"season-span\">Episode ' + movie.Episode + '</span>'\n )\n $(\"#button-tvshow\").append(\n '<button onClick=\"openMovie(\\'' + movie.seriesID + '\\')\" class=\"btn-search\">' +\n '<i class=\"fas fa-chevron-left\"></i>' +\n ' Back to TV Show' +\n '</button>'\n )\n }\n}", "function getMovies() {\n $.ajax({\n url: endpoint,\n dataType: 'json',\n type: 'GET',\n success: function (data) {\n movies = data;\n\n movies.forEach(movie => {\n HTMLString = `\n <div id='DisplaySection-${ movie.MovieId }'>\n <p class='display-${ movie.MovieId } title'>${ movie.Title }</p>\n <p class='display-${ movie.MovieId } director-name'>${ movie.DirectorName }</p>\n <p class='display-${ movie.MovieId } genre'>${ movie.Genre }</p>\n <button id='MovieId-${ movie.MovieId }' class='show-more btn'> More Info </button>\n <button id='EditMovieId-${ movie.MovieId }' class='edit-movie btn'> Edit </button>\n <hr></hr>\n </div>\n `;\n \n $(movieList).append(HTMLString);\n });\n },\n error: function (error) {\n return error;\n }\n });\n }", "function displayMovies(movies) {\n console.log(movies);\n for (let i=0; i < movies.length; i++) {\n const movieId = cleanTitle(movies[i]);\n fetch(`https://imdb8.p.rapidapi.com/title/get-plots?tconst=${movieId}`, {\n\t \"method\": \"GET\",\n\t \"headers\": {\n\t\t\"x-rapidapi-host\": \"imdb8.p.rapidapi.com\",\n\t\t\"x-rapidapi-key\": rapidApiKey\n\t }\n })\n .then(resp => resp.json())\n .then(addMoviesHMTL)\n // when the last movie is added to the html shows the \"get movie recommendations\" button\n .then(() => {\n if (i+1 === movies.length) {\n recomButtton.style.display = 'block';\n }\n })\n }\n // function to clean the title info to fetch the api\n function cleanTitle(stringT) {\n let begins = stringT.indexOf('/', 1) + 1;\n let title = stringT.slice(begins, stringT.length - 1);\n return title;\n }\n}", "function selectMovies() {\n\n var type = Session.get('type');\n var search = Session.get('search');\n var sort = Session.get('sort');\n var filter = Session.get('filter') || {};\n\n\n\n // Update scroll position when the query changes -----------------------------\n var instantaneaousRepositionning = false;\n var query = [type, search, sort, filter.genre].join('|');\n if (query !== queryCache) {\n scroll = 0;\n scrollTo(0, 600);\n queryCache = query;\n instantaneaousRepositionning = true;\n }\n\n\n // TODO Loading icons, what happens if you search <2 letters\n\n\n // Load Data -----------------------------------------------------------------\n\n if (search.length > 1 && type === 'suggested') {\n // Global Search\n searchMovies(search, filter, sort);\n } else {\n lookupMovies(type, search, sort, filter, instantaneaousRepositionning);\n }\n}", "Movies() {\n\t\tconsole.log(this.props.data);\n\t\tconst { classes } = this.props;\n\t\treturn this.props.data.newMovies.map(movie => {\n\t\t\treturn (\n\t\t\t\t// <MovieContainer>\n\t\t\t\t// \t<Card className={classes.card} key={movie.id}>\n\t\t\t\t// \t\t<CardActionArea>\n\t\t\t\t// \t\t\t<Link to={`/info/${movie.id}`}>\n\t\t\t\t// \t\t\t\t<CardMedia\n\t\t\t\t// \t\t\t\t\tclassName={classes.media}\n\t\t\t\t// \t\t\t\t\timage={movie.poster_path}\n\t\t\t\t// \t\t\t\t/>\n\t\t\t\t// \t\t\t</Link>\n\t\t\t\t// \t\t</CardActionArea>\n\t\t\t\t// \t</Card>\n\t\t\t\t// </MovieContainer>\n\t\t\t\t// <Wrapper key={movie.id}>\n\t\t\t\t// {/* <article key={movie.id} className=\"movie_list\"> */}\n\t\t\t\t<Row>\n\t\t\t\t\t<Link to={'/info/' + movie.id}>\n\t\t\t\t\t\t<img className=\"poster_img\" src={movie.poster_path} alt=\"poster\" />\n\t\t\t\t\t</Link>\n\t\t\t\t</Row>\n\t\t\t\t// {/* </article> */}\n\t\t\t\t// </Wrapper>\n\t\t\t);\n\t\t});\n\t}", "function renderMoviesPage(data) {\n\n\t\tvar page = $('.in-theaters');\n\t\tvar allmovies = $('.in-theaters .movies-list > li');\n\n\t\t// Hide all the movies in the movies list.\n\t\tallmovies.addClass('hidden');\n\n\t\t// Iterate over all of the movies.\n\t\t// If their ID is somewhere in the data object remove the hidden class to reveal them.\n\t\tallmovies.each(function () {\n\n\t\t\tvar that = $(this);\n\n\t\t\tdata.forEach(function (item) {\n\t\t\t\tif(that.data('index') == item.id){\n\t\t\t\t\tthat.removeClass('hidden');\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t// Show the page itself.\n\t\t// (the render function hides all pages so we need to show the one we want).\n\t\tpage.addClass('visible');\n\n\t}", "function modelGetAllMovies() {\n return movieList;\n}", "function list(name, year, genres, page) {\n return $.getJSON(\"/api/movies/?q=\" + encodeURIParam(name) + \"&year=\" + encodeURIParam(year) + \"&genres=\" + encodeURIParam(genres) + \"&page=\" + encodeURIComponent(page != null ? page.toString() : \"\"));\n }", "function listMovies() {\n fetch(url)\n .then((response) => response.json())\n .then((data) => {\n for (let movie of data) {\n console.log(movie, \"movie\");\n createMovieBox(movie);\n }\n });\n}", "function DisplayMovies({ movies }) {\n return (\n <div className=\"main\">\n {movies.map((movie) => (\n <Movie key={movie.id} movie={movie} />\n ))}\n </div>\n );\n}", "function displayMovie(event){\n let target = event.target || event.srcElement;\n\n // Retrieves title if parent element selected\n if(target.className == \"movie\"){\n target = target.getElementsByClassName(\"title\")\n target = target[0];\n }\n\n // sends an API request for the specific movie to be displayed\n searchByTitle(target).then(result => {\n let movies = result[\"Title\"];\n displayMovieResult(result);\n });\n}", "async function getMovies(ctx) {\n const currentDate = getCurrentDate();\n const movies = ctx.movies.find({ LastOnAir: currentDate });\n return movies.toArray();\n}", "function getMovies(varfn) {\r\n\r\n\r\n\r\n let apiData = {\r\n url: 'http://www.omdbapi.com/',\r\n apiKey: '?apikey=623dcc99&s=',\r\n filmnaam: varfn\r\n }\r\n\r\n const {\r\n url,\r\n apiKey,\r\n filmnaam\r\n } = apiData\r\n const apiUrl = `${url}${apiKey}${filmnaam}`\r\n\r\n let res;\r\n\r\n fetch(apiUrl)\r\n .then((response) => response.json())\r\n .then(data => res = data)\r\n .then((res) => {\r\n\r\n let movies = res.Search;\r\n let output = '';\r\n\r\n console.log(movies);\r\n $.each(movies, (index, movie) => {\r\n output += `\r\n <div class =\"col-md-3\" id=\"ruimte\">\r\n <div class=\"well text-center\">\r\n <h5>${movie.Title}</h5>\r\n <h6>Year: ${movie.Year}</h6>\r\n <img src=${movie.Poster} onclick=\"movieSelected('${movie.imdbID}')\" datatoggle=\"modal\" href=\"#\">\r\n </div>\r\n </div>\r\n `;\r\n });\r\n\r\n $('#movies').html(output); //inner html kan mss ook?\r\n });\r\n}", "function showMovies() {\r\n movies.forEach(function(movie) \r\n {\r\n fetch('https://www.omdbapi.com/?t=' + movie.title + '&apikey=789d41d5')\r\n .then(response => {\r\n return response.json();\r\n })\r\n .then(data =>\r\n {\r\n //creating the DOM elements for the movies to be displayed and adding attributes to give them function and styling\r\n \r\n const section = document.createElement('section');\r\n const article = document.createElement('article');\r\n const images = document.createElement('img');\r\n const imgDiv = document.createElement('div');\r\n imgDiv.setAttribute('class', 'imgDiv');\r\n\r\n images.src = data.Poster;\r\n images.alt = data.Title + 'poster';\r\n\r\n const h2 = document.createElement('h2');\r\n h2.innerHTML = data.Title;\r\n\r\n const button = document.createElement('button');\r\n button.innerHTML = 'Watch trailer';\r\n \r\n button.setAttribute('onClick', \"buttonClick(\"+movie.youtubeId+\")\");\r\n\r\n\r\n\r\n const expandDiv = document.createElement('div');\r\n expandDiv.setAttribute('class', 'description');\r\n const h3 = document.createElement('h3');\r\n const plot = document.createElement('p');\r\n const div2 = document.createElement('div');\r\n div2.setAttribute('class', 'rating');\r\n const ratingSource = document.createElement('p');\r\n const ratingValue = document.createElement('p');\r\n const age = document.createElement('p');\r\n\r\n h3.innerHTML = 'Description'\r\n plot.innerHTML = data.Plot;\r\n ratingSource.innerHTML = data.Ratings[0].Source;\r\n ratingValue.innerHTML = data.Ratings[0].Value;\r\n \r\n // Calculate the age of the movie using current date and the movies release date\r\n let today = new Date();\r\n let currentYear = today.getFullYear();\r\n\r\n age.innerHTML = currentYear - data.Year + \" years old\";\r\n \r\n // Creating DOM elements for the movie trailer\r\n const videoDiv = document.createElement('div');\r\n videoDiv.setAttribute('class', 'videoModal')\r\n const video = document.createElement('iframe');\r\n video.src = youtube.generateEmbedUrl(movie.youtubeId);\r\n videoDiv.setAttribute('class','videoModal');\r\n videoDiv.setAttribute('id',movie.youtubeId);\r\n\r\n // Append elements to the body\r\n section.appendChild(article);\r\n article.appendChild(imgDiv);\r\n imgDiv.appendChild(images);\r\n article.appendChild(h2);\r\n article.appendChild(button);\r\n article.appendChild(expandDiv);\r\n expandDiv.appendChild(h3);\r\n expandDiv.appendChild(plot);\r\n expandDiv.appendChild(div2);\r\n div2.appendChild(ratingSource);\r\n div2.appendChild(ratingValue);\r\n expandDiv.appendChild(age);\r\n article.appendChild(videoDiv);\r\n videoDiv.appendChild(video);\r\n\r\n document.getElementById('body').appendChild(section);\r\n })\r\n \r\n }\r\n \r\n ) \r\n}", "function printMovieItems() {\n seanBeanMovies.forEach(function(movie) {\n console.log(movie);\n });\n}", "static renderMovies (moviesList) {\n if (Array.isArray(moviesList)) {\n let moviesListHtml = '';\n const config = moviesService.getConfig();\n\n // Default poster size is setup manually. It can be done programmatically or 'original' can be used.\n // But that will add unnecessary complexity and heavy data load.\n const posterSize = 'w342';\n\n moviesList.forEach(movie => {\n // In template here there are several hidden information not part of requirement therefore visible\n // only in list view.\n moviesListHtml += `\n <div class=\"movie-item\">\n <div class=\"movie-poster\"><img src=\"${config.images.base_url}${posterSize}${movie.poster_path}\"></div>\n <div class=\"movie-details\">\n <div class=\"movie-title\">${movie.title}</div>\n <div class=\"movie-genres\">${movie.genres}</div>\n <div class=\"movie-plot hidden\">${movie.overview}</div>\n <div class=\"movie-rating hidden\">TMDb Rating: ${movie.vote_average * 10}%</div>\n <div class=\"movie-release-date hidden\">Release Date: ${movie.release_date}</div>\n <div class=\"movie-popularity hidden\">${movie.popularity}</div>\n </div>\n </div>\n `;\n });\n\n document.querySelector('#movies-list').innerHTML = moviesListHtml;\n }\n }", "function showMovies(data){\n if(data.Response == \"False\"){\n $(\"#search-loader\").hide();\n alertify.error(\"No results...\");\n } else {\n $(\"#search-loader\").hide();\n createPageNums(data);\n data.Search.forEach(showMovie); //callback to showMovie with each of the items from the array\n }\n}", "function getMovieList(movieList = [], pagenum=1) {\n\t\tconst url = \"https://api.themoviedb.org/3/discover/movie?&api_key=933bee1465a61090ebe0704cd6d4c3e1\" +\n \"&with_genres=\" + genreIDs + \n \"&without_genres=\" + genreExclusions +\n\t\t\t\t\t\t\"&vote_average.gte=\" + filters.voteAverage +\n\t\t\t \"&vote_count.gte=\" + 50 +\n\t\t\t\t\t\t\"&certification_country=US\" + \n \"&certification=\" + filters.rating +\n\t\t\t\t\t\t\"&page=\" + pagenum + \n\t\t\t\t\t\t\"&primary_release_date.gte=\" + filters.releaseDecade[0] + '-01-01' +\n\t\t\t\t\t\t\"&primary_release_date.lte=\" + filters.releaseDecade[1] + '-12-31';\n \n\t\t$.ajax({\n url: url,\n datatype: 'json',\n success:function(data){\n\n if (data['total_results'] > 20*pagenum && movieList.length <= 25 ) {\n for (let movie of data['results']) {\n screenMovie(movieList, movie);\n }\n \n pagenum++\n getMovieList(movieList, pagenum);\n } else {\n scrubbedResults = scrubDuplicates(movieList);\n showResponse();\n }\n },\n failure:function(error){\n showError(error.text);\n }\n });\n\t}", "function displayMovies(movies) {\n movieInformation.innerHTML = \"\"\n let searchedMovies = globalMovieArray[0].Search;\n for (i = 0; i < searchedMovies.length; i++) {\n //Div for listed movie and button\n const liAndButtonDiv = document.createElement('div')\n liAndButtonDiv.classList.add('liAndButtonDiv')\n //Create li element for search result\n const movieTitleListed = document.createElement('li');\n movieTitleListed.classList.add = ('clear')\n const movieTitle = document.createTextNode(`${movies.Search[i].Title}`)\n\n movieTitleListed.appendChild(movieTitle);\n liAndButtonDiv.appendChild(movieTitleListed);\n movieInformation.appendChild(liAndButtonDiv);\n\n buttonForMoreInformation(movies.Search[i].imdbID, liAndButtonDiv)\n spinner.style.display = \"none\";\n\n }\n}", "function getMovies(myInput) {\n axios.get('https://www.omdbapi.com?s=' + myInput + '&apikey=5623718')\n .then((response) => {\n let movies = response.data.Search;\n let output = '';\n $.each(movies, (index, movie) => {\n output += `\n <a href=\"movieresult.html?${movie.imdbID}\" class=\"nav-link text-white\">\n <div class=\"movie_card\" style=\"width: 18rem;margin: 0 auto;>\n <div class=\"card h-100\">\n <img src=\"${movie.Poster}\" class=\"poster\">\n <div class=\"card-body\">\n <h5>${movie.Title}</h5>\n </div>\n </div>\n </div>\n </a>\n `;\n });\n $('#movies').html(output);\n })\n .catch((err) => {\n console.log(err);\n });\n}", "function displayData(movies, currentMovie) {\n \n clearData();\n \n if (currentMovie != -1) { populateCurrentMovie(currentMovie); }\n else { showLogo(); }\n populateWatchlist(movies);\n}", "function searchFilmsByTitle(title) {\n let format = title.split(' ').join('+'); // replace spaces with plus\n $.ajax({\n url: `https://www.omdbapi.com/?apikey=ac155d96&s=${format}`,\n dataType: \"json\"\n }).done(function(resp) {\n if (resp.Search != null) {\n let respSize = resp.Search.length;\n for (let i = 0; i < respSize; i++) {\n if(resp.Search[i].Poster != 'N/A' && resp.Search[i].Type == 'movie') {\n let myHTML = \n `<div class=\"col-sm-6\">\n <a class=\"movie-select\" href=\"#\" id=\"${resp.Search[i].imdbID}\">\n <img class=\"movie-image\" src=\"${resp.Search[i].Poster}\">\n </a>\n </div>`;\n $(\"#movies\").append(myHTML);\n }\n }\n } else {\n let myHTML =\n `<div class=\"col-sm-12\">\n <div class=\"alert alert-primary col\" role=\"alert\">\n ${resp.Error}\n </div></div>`;\n $(\"#movies\").append(myHTML);\n }\n });\n }", "function renderMovies (movies) {\n\t\t$('.card-columns').empty(); \n\n\t\tmovies.forEach(function(movie) {\n\t\t\tvar newCardDiv = $('<div class= \"card\" style = \"width: 20rem;\"></div>');\n\t\t\tvar imagePoster = $('<img class= \"card-img-top\"/>'); \n\t\t\tvar newBodyDiv = $('<div class = \"card-body\"></div>');\n\t\t\tvar newCardTitle= $('<h4 class= \"card-title\"> Card title</h4>');\n\t\t\tvar newCardBadgeYear = $('<span class = \"badge badge-secondary float-right\"></span>');\n\t\t\tvar newAnchor = $('<a href= \"#\" data-movie=\"'+ movie.imdbID +' \"class = \"btn btn-primary addButton\"> Add!</a>');\n\n\n\t\t\tif(movie.Poster == \"N/A\") {\n\t\t\t\timagePoster.attr('src', \"no_image.png\");\n\t\t\t} else {\n\t\t\t\t\timagePoster.attr('src', movie.Poster);\n\t\t\t\t}\n\t\t\t\n\t\t\tnewCardTitle.text(movie.Title);\n\t\t\tnewCardBadgeYear.text(movie.Year); \n\n\t\t\tnewCardTitle.append(newCardBadgeYear);\n\t\t\tnewBodyDiv.append(newCardTitle, newAnchor);\n\t\t\tnewCardDiv.append(imagePoster, newBodyDiv);\n\n\t\t\t$('.card-columns').append(newCardDiv);\n\n\t\t})\n\t}", "function searchMovies(movies){\n console.log(\"searching for:\", movies);\n axios.get(generateApiUrl('search/movie'))\n .then( (response) => {\n console.log(response);\n })\n .catch((err) => {\n console.error(err);\n });\n}", "function getMovies(searchText) {\r\n axios.get('https://api.themoviedb.org/3/search/movie?api_key=e6f03914c8be0ff64189d7995fe10c3d&query=' + searchText)\r\n // Returns promise\r\n .then((response) => {\r\n if (response.data.results == '') {\r\n alert('Sorry, We could not find a matching title. Please Try again!');\r\n }\r\n console.log(response);\r\n let movies = response.data.results;\r\n let output = '';\r\n $.each(movies, (index, movie) => {\r\n // Prints API data to index.html\r\n output += `\r\n <div class='col-md-3'>\r\n <div class='well text-center'>\r\n <img src=\"https://image.tmdb.org/t/p/original/${movie.poster_path}\">\r\n <h5>${movie.title}</h5>\r\n <a onclick=\"movieSelected('${movie.id}')\" class=\"btn btn-primary\" href='movie.html'>Movie Details</a>\r\n <p>Rating: ${movie.vote_average}</p>\r\n </div>\r\n </div>\r\n `\r\n });\r\n $('#movies').html(output);\r\n })\r\n // Error handling\r\n .catch((err) => {\r\n console.log(err);\r\n });\r\n}", "function movieList(query, sortBy, order) {\n\n getMovies(query, sortBy, order).then((movies) => {\n //console.log('Here are all the movies:');\n movies.forEach(({title, rating, id, tvdb, imdb_id, fav}) => {\n// console.log(`id#${id} - ${title} - rating: ${rating}`);\n\n let moviePoster = \"images/placeholder.png\";\n let movieBackdrop = \"\";\n let star = 'star_border';\n let favStar = '';\n\n if (tvdb) {\n console.log('data exists for tvdb');\n if(tvdb.poster_path !== null) moviePoster = 'https://image.tmdb.org/t/p/w500/' + tvdb.poster_path;\n if(tvdb.backdrop_path !== null) movieBackdrop = 'https://image.tmdb.org/t/p/original/' + tvdb.backdrop_path;\n\n }\n\n star = (fav === true) ? 'star' : 'star_border';\n favStar = (fav === true) ? 'favorite-true' : '';\n\n $(`<div class=\"movie p-2 m-2\" id=\"movie-${id}\">`).append(\n $('<div class=\"movie-img\">').append(\n $(`<img src=\"${moviePoster}\" id=\"img-${id}\" class=\"img-fluid main\">`)),\n $('<div class=\"movie-title text-truncate\">').text(title),\n $('<div class=\"movie-database\">').append(\n $(`<img src=\"images/loader.svg\" class=\"loading-data hide\" id=\"loading-movie-${id}\">`).text(''),\n $(`<input type=\"hidden\" id=\"movie-imdb-${id}\" value=\"${imdb_id}\">`).text(''),\n $(`<button id=\"update-movie-${id}\" class=\"update\" value=\"${id}\">`).html(\"<i class=\\\"material-icons\\\">autorenew</i>\"),\n $(`<button id=\"edit-movie-${id}\" class=\"edit\" value=\"${id}\">`).html('<i class=\"material-icons\">create</i>'),\n $(`<button id=\"delete-movie-${id}\" class=\"delete\" value=\"${id}\">`).html('<i class=\"material-icons\">delete_forever</i>'),\n $(`<button id=\"fav-movie-${id}\" class=\"favorite ${favStar}\" value=\"${id}\">`).html(`<i class=\"material-icons\">${star}</i>`),\n )).appendTo('#moviesList');\n\n\n $(`#img-${id}, #update-movie-${id}, #edit-movie-${id}, #delete-movie-${id}, #fav-movie-${id}`).hover(function () {\n $('.bg-container').css('background-image', `url('${movieBackdrop}')`);\n $(`#img-${id}`).addClass('standard-hover');\n $(`#update-movie-${id}, #edit-movie-${id}, #delete-movie-${id}, #fav-movie-${id}`).css('opacity',0.6);\n $('.favorite-true').css('opacity',1);\n\n }, function () {\n $(`#update-movie-${id}, #edit-movie-${id}, #delete-movie-${id}, #fav-movie-${id}`).css('opacity',0.0);\n $(`#img-${id}`).removeClass('standard-hover');\n $('.favorite-true').css('opacity',1);\n\n });\n\n\n $(`#img-${id}`).click(function() {\n displayMovie(id);\n });\n\n $(`#edit-movie-${id}`).click(function () {\n displayEditMovie(id);\n });\n\n $(`#fav-movie-${id}`).click(function() {\n\n let star = $(this).children('i').text();\n console.log(star);\n (star !== 'star') ? $(this).children('i').text('star') : $(this).children('i').text('star_border');\n (star !== 'star') ? addFav(id, true) : addFav(id,false);\n (star !== 'star') ? $(this).addClass('favorite-true') : $(this).removeClass('favorite-true');\n\n });\n\n $(`#delete-movie-${id}`).click(function () {\n\n // TODO: reaplce this with a in-page function\n const confirmed = window.confirm(\"Are you sure\");\n\n if (confirmed === true) {\n $(`#movie-${id}`).addClass('hide');\n deleteMovie(id);\n console.log(`deleted: ` + id);\n\n\n } else {\n console.log(`cancelled the delete: ` + id);\n }\n\n });\n\n $(`#update-movie-${id}`).click(function (e) {\n e.preventDefault();\n $(`#loading-movie-${id}`).removeClass('hide');\n $(`#img-${id}`).addClass('loading-hover');\n\n const movieId = $(`#movie-imdb-${id}`).val();\n\n $(this).off('click');\n\n setTimeout(function () {\n getMovieDBData(movieId).then((movies) => {\n console.log('Here are all the movies:');\n console.log(movies.movie_results[0]);\n\n const movie = movies.movie_results[0];\n\n\n getFullMovieData(movie.id).then(movie => {\n\n\n addMovieData(id,\n {\n title: movie.title,\n rating: movie.vote_average,\n tvdb: movie\n });\n\n\n\n $(`#img-${id}`).attr('src', `https://image.tmdb.org/t/p/w500/${movie.poster_path}`);\n $('.bg-container').css('background-image', `url('https://image.tmdb.org/t/p/original/${movie.backdrop_path}')`);\n\n $(`#img-${id}`).hover(function () {\n $('.bg-container').css('background-image', `url('https://image.tmdb.org/t/p/original/${movie.backdrop_path}')`);\n });\n\n $(`#loading-movie-${id}`).addClass('hide');\n $(`#img-${id}`).removeClass('loading-hover');\n\n });\n\n\n\n\n\n }).catch((error) => {\n alert('Oh no! Something went wrong.\\nCheck the console for details.');\n console.log(error);\n });\n\n $(this).on('click');\n\n $('.loading-container').hide();\n }, 3000);\n\n });\n\n $('.loading-container').hide();\n\n });\n\n }).catch((error) => {\n alert('Oh no! Something went wrong.\\nCheck the console for details.');\n console.log(error);\n });\n}", "function uiDetailMovies(res) {\n const detail = document.querySelector(\".modal-body\");\n const titleMovie = document.querySelector(\".title-movie\");\n let detailMovie = showMovieDetail(res);\n detail.innerHTML = detailMovie;\n titleMovie.innerHTML = `${res.Title} (${res.Year})`;\n}", "function fetchMoviesNow() {\r\n console.log('masuk fetch movies now')\r\n $.ajax({\r\n method: 'GET',\r\n url: 'http://localhost:3000/movies/now'\r\n })\r\n .done(movies => {\r\n console.log(`ini now`);\r\n console.log(movies)\r\n movies.forEach(movie => {\r\n // console.log(`ini movieee`)\r\n // console.log(movie)\r\n $(\"#listNow\").append(`\r\n <div class=\"col-3 mb-3\">\r\n <div class=\"card text-center\">\r\n <img\r\n src=\"${movie.poster_path}\"\r\n class=\"card-img-top\">\r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\">${movie.title}</h5>\r\n <button class=\"btn btn-primary\" onclick=\"view()\">View</button>\r\n </div>\r\n </div>\r\n </div>\r\n `)\r\n });\r\n\r\n })\r\n .fail(err => { \r\n let msg = err.responseJSON.err\r\n let status = err.status\r\n swal(`Error ${status}`, `${msg}`, \"error\");\r\n })\r\n}", "function getTopRatedMovies() {\n\n const path = '/movie/top_rated';\n\n const url = generateUrl(path);\n\n const render = renderMovies.bind({title: 'Top Rated Movies'});\n\n sectionMovies(url, render, handleError);\n\n}", "function showMovies() {\n\tconsole.log(SPACER);\n\tfor (let i = 0; i < movies.length; i++) {\n\t\tconsole.log(\"\\t\" + String(i + 1) + \". \" + movies[i].title + \" (\" + movies[i].average + \" stars)\");\n\t}\n\tconsole.log(SPACER);\n}", "function appendMovies(movies) {\n // TODO: append movies to #movies-container\n}", "function showTheatreMovie(req,res,next){\n // var tID = req.params.id;\n db.many(`SELECT m.movie_id, m.title, array_to_string(array_agg(tms.showtime), ',') showtimes\n FROM movies m INNER JOIN theatre_movie_showtime tms\n ON m.movie_id = tms.movie_id WHERE tms.theatre_id = ($1)\n GROUP BY m.movie_id;`, [req.params.id])\n .then((data)=>{\n console.log(data); // should get multiple movies in a theatre\n res.rows = data;\n next();\n })\n .catch(()=>{\n console.log('ERROR in showing ALL MOVIES IN A THEATRE!');\n })\n}", "function searchmovie(){\n let searchText = $('#searchText').val();\n if(searchText != \"\"){\n axios.get('https://api.themoviedb.org/3/search/movie?api_key=f13549c92bee7e0f31569758e7396edb&query='+searchText)\n .then(response=>{\n $('#movies').html(\"\"); \n let films = response.data.results;\n let output = \"\";\n $.each(films, (index,film)=>{\n output += `\n <div class=\"col-md-3 movie\">\n <div class=\"text-center\">\n <img src=\"https://image.tmdb.org/t/p/w300/${film.poster_path}\" alt=\"${film.original_title}\"/>\n <h5 id=\"movieTitle\">${film.original_title}</h5>\n <button class=\"btn btn-primary\" onclick= \"alert('Please Sign In to Book Movie!')\" id=\"bookMovie\">Book</button>\n <button onclick=\"movieSelected('${film.id}')\" data-backdrop=\"static\" data-keyboard=\"false\" data-toggle=\"modal\" data-target=\"#myModal\" class=\"btn btn-primary\" id=\"movieDetails\" href=\"#\">Movie Details</button>\n </div>\n </div>\n `;\n });\n $(\".popMovies\").text(\"Movie Search Results\");\n $(\"#movies\").html(output);\n })\n .catch(error=>{\n console.log(error);\n });\n }\n \n}", "function displayMovie(data) {\n\n let movies = data.results;\n let output = ''\n\n $.each(movies, function(index, movie) {\n\n output += `\n\n <div class=\"col-md-4\">\n <div class=\"well text-center\">\n <img src=\"https://image.tmdb.org/t/p/w500${movie.poster_path}\" onError=\"this.onerror=null;this.src='img/nopic.png';\">\n <h5>${movie.title}</h5>\n <div onclick=\"movieSelected('${movie.id}')\" class=\"btn btn-primary\" id=\"buttonIndex\" href=\"#\">Movie Details</div>\n </div>\n </div>\n `;\n });\n\n $('#movies').html(output);\n\n if (movies == 0) {\n window.alert('ERROR: PLEASE INSERT A CORRECT MOVIE NAME');\n }\n}", "async getMovies({ commit }, { query, pageNumber }) {\n const result = await apiService.getMovies(query, pageNumber);\n if (pageNumber === 1) {\n commit('updateResultCount', parseInt(result.totalResults, 10));\n }\n // get details for each movie\n const moviesWithDetails = await Promise.all(\n result.Search.map(async (movie) => {\n const movieDetails = await apiService.getMovieDetails(movie.imdbID);\n movieDetails.isLoading = false;\n return movieDetails;\n }),\n );\n commit('updateMovies', {\n data: moviesWithDetails,\n pageNumber,\n });\n }", "function movies() {\n //console.log('The Toy');\n \t\n \t\n \tfor (var i = 3; i < nodeArgs.length; i++) {\n\n \t\tvar movieTitle = \"\"; \n \t\tconsole.log()\n\n \t\tif (i >= 3 && i < nodeArgs.length) {\n \t\t\tmovieTitle = movieTitle + \"+\" + nodeArgs[i];\n \t\t}\n \n \t\telse {\n \t\t\tmovieTitle = movieTitle + nodeArgs[i];\n \t\t}\n \t}\n \tvar queryURL = 'http://www.omdbapi.com/?t=' + movieTitle +'&tomatoes=true&y=&plot=short&r=json';\n \t\n \t//these are so we can visualize our URL & user Input for debugging\n \tconsole.log(queryURL);\n \tconsole.log(movieTitle);\n \n \trequest(queryURL, function(error, response, body) {\n \n \t\tif (!error && response.statusCode == 200) {\n \t\t\tconsole.log(\"Title: \" + JSON.parse(body)[\"Title\"]);\t// Movie title\n \t\t\tconsole.log(\"Released: \" + JSON.parse(body)[\"Year\"]);\t// Movie Release Year\n \t\t\tconsole.log(\"IMDB Rating: \" + JSON.parse(body)[\"imdbRating\"]);\t// IMDB rating\n \t\t\tconsole.log(\"Country of Production: \" + JSON.parse(body)[\"Country\"]); //Production Country\n \t\t\tconsole.log(\"Movie Language: \" + JSON.parse(body)[\"Language\"]);\t//Movie Language\n \t\t\tconsole.log(\"Plot: \" + JSON.parse(body)[\"Plot\"]); //Movie Plot\n \t\t\tconsole.log(\"Cast: \" + JSON.parse(body)[\"Actors\"]);\t//Movie Cast\n \t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body)[\"tomatoRating\"]); //Rotten Tomatoes Rating\n \t\t\tconsole.log(\"Rotten tomatoes URL: \" + JSON.parse(body)[\"tomatoURL\"]); //Rotten tomatoes URL\n \t\t}\n \t\telse {\n \n \t\t}\n \t});\n }", "function movie() {\n //****************** OMDB movies API ********************\n var API2 = \"https://www.omdbapi.com/?t=\" + search + \"&y=&plot=short&apikey=trilogy\"\n\n axios.get(API2).then(\n function (response) {\n console.log(\"================================================\");\n console.log(\"Title of the Movie: \" + response.data.Title);\n console.log(\"Year Released: \" + response.data.Year);\n console.log(\"IMDB Rating: \" + response.data.imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n console.log(\"Country Produced in: \" + response.data.Country);\n console.log(\"Language of the Movie: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Cast: \" + response.data.Actors);\n }\n )\n}", "function getMovies(searchText) {\n $.ajax({\n method: 'Get',\n url: 'http://www.omdbapi.com/?apikey=65a08387&s=' + searchText\n }).done(function (data) {\n let movies = data.Search;\n let output = '';\n $.each(movies, function(index, movie) {\n output += `\n <li>\n <a onclick=\"movieClicked('${movie.imdbID}')\" href=\"#\">\n <img src=\"${movie.Poster}\">\n <h2>${movie.Title}</h2>\n <p>Release Year: ${movie.Year}</p>\n </a>\n </li>\n `;\n });\n $('#movies').html(output).listview('refresh');\n });\n}", "function getMovies(query) {\n $.getJSON(\n `${movieApi.base}?s=${query}&apikey=${movieApi.key}`\n ) /* .getJSON method retrieves data from an external api */\n .then(function (response) {\n if (response.Response === \"True\") {\n let movies =\n response.Search; /* the api is stored in arrays, here a new var is created to select the particular array needed */\n let output = \"\";\n /* for each of the responses in JSON output html to the webpage */\n $.each(movies, function (index, movie) {\n output += `\n <div class=\"col-sm-6 col-md-4 col-lg-3\">\n <div class=\"search-card text-center\">\n <img src=\"${movie.Poster}\"/> \n <h4 class=\"white\" >${movie.Title}</h4>\n <a onclick=\"selectedMovie('${movie.imdbID}')\" class=\"details-button hvr-shutter-out-horizontal red\" href=\"#\" data-toggle=\"modal\" data-target=\"#modal\">Movie Details</a>\n </div>\n </div>\n `;\n });\n\n /* outputs the html to the div with #movies-to-collapse */\n $(\"#movies-to-collapse\").html(output);\n\n $(\".collapse-button-m\").show();\n } else {\n alert(\"Movie not found! Please enter a valid movie title or word.\")\n }\n\n })\n}", "function getMovies() {\n return (dispatch) => {\n dispatch(request());\n dispatch(success(feedData));\n\n /**\n * If API is available, we could use below code for API call.\n */\n\n // movieService.getMoives()\n // .then((res) => {\n // dispatch(success(res));\n // })\n // .catch((err) => {\n // dispatch(failure(err));\n // });\n };\n\n function request(data) {\n return {type: movieConstants.MOVIE_REQUEST, data};\n }\n function success(data) {\n return {type: movieConstants.MOVIE_SUCCESS, data};\n }\n // function failure(err) {\n // return {type: movieConstants.MOVIE_FAILURE, err};\n // }\n}", "function getMovie() {\n\n let movieId = sessionStorage.getItem('movieId');\n api_key = '98325a9d3ed3ec225e41ccc4d360c817';\n\n $.ajax({\n\n url: `https://api.themoviedb.org/3/movie/${movieId}`,\n dataType: 'json',\n type: 'GET',\n data: {\n api_key: api_key,\n },\n\n //get acess to movie information;\n success: function(data) {\n\n\n\n var movie = data;\n let output = `\n <div class=\"row\">\n <div class=\"col-md-4\">\n <img src=\"https://image.tmdb.org/t/p/w500${movie.poster_path}\" class=\"thumbnail\">\n <div id=\"visitS\">\n <a id=\"visitSite\" target=\"_blank\" href=\"${movie.homepage}\"> Visit Movie Site</a>\n </div>\n </div>\n <div class=\"col-md-8\">\n <h2>${movie.title}</h2>\n <ul class=\"list-group\" id=\"list-group\">\n\n <li class=\"list-group-item\"><strong>Released:</strong> ${movie.release_date}</li>\n <li class=\"list-group-item\"><strong>Rated:</strong> ${movie.vote_average}</li>\n <li class=\"list-group-item\"><strong>Runtime:</strong> ${movie.runtime} min.</li>\n <li class=\"list-group-item\"><strong>Production Companies:</strong> ${movie.production_companies[0].name} min.</li>\n </ul>\n <div>\n <div id=\"overview\">\n <h3>Overview</h3> ${movie.overview}\n </div>\n <div id=\"imdbb\">\n <a id=\"imdb\" href=\"http://imdb.com/title/${movie.imdb_id}\" target=\"_blank\" <i class=\"fab fa-imdb fa-3x\"></i></a>\n </div>\n <div>\n <a class=\"navbar-brand\" id=\"go2\" href=\"index.html\">Go Back</a>\n \n </div>\n \n </div> \n \n `;\n //print movie selected information\n $('#movie').html(output);\n\n\n }\n\n })\n\n}", "function loadMoreMovies () {\n if(!vm.searchString || vm.searchType !== 'Movies'){\n vm.pageToLoad ++;\n if(vm.pageToLoad < vm.totalPages){\n MovieFactory.getPopularMovies(vm.pageToLoad).then((result) => {\n vm.shownMovies = vm.shownMovies.concat(result.data.results);\n });\n }\n }\n }", "static getMoviesById(id) {\n return axios(withBaseUrl(`movie/${id}`));\n /* chamando essa rota https://developers.themoviedb.org/3/movies/get-movie-details */\n }", "function showMovies(movies) {\n //loop through the data and for each movie we create a new div\n movies.forEach((movie)=> {\n //destructure the object\n const {poster_path, title, overview } = movie\n\n //create a div\n const movieCard = document.createElement(\"div\");\n movieCard.classList.add(\"card\");\n \n movieCard.innerHTML= `\n <img src=${IMGPATH + poster_path } alt=${title} />\n <h1>${title}</h1>\n <p>${overview}</p>\n `;\n //implement movie properties into the inner HTML of movieCard\n main.appendChild(movieCard);\n });\n \n}", "function moviesandTv() {\n let tvShowsUrl = 'https://api.themoviedb.org/3/';\n let category = $(\"input[type='radio']:checked\").val();\n let keyWord = getKeyWord();\n\n\n let QueryUrl = keyWord =='%20'? '' : `&query=${keyWord}&page=1&include_adult=false`;\n let search = keyWord =='%20'? 'discover': 'search';\n\n let queryUrl = `${tvShowsUrl}${search}/${category}?api_key=${moviesShowsAPI}${QueryUrl}`\n\n console.log(queryUrl)\n\n\n $.getJSON(queryUrl, function (data) {\n\n tvOrMovie = data.results;\n $('tvmovie_list li').remove();\n $('#tvmovie_list').empty();\n\n let title = category == 'movie' ? 'original_title' : 'original_name';\n let date = category == 'movie' ? 'release_date' : 'first_air_date';\n\n $.each(tvOrMovie, function (index, movie) {\n\n let poster = isImage(movie.poster_path);\n\n $('#tvmovie_list').append(`<li><a id=\"to_details\" data-transition=\"pop\" href=\"#\"><img id=\"image_content\"src=${poster}>\n <h2>${movie[title]}</h2>\n <p>${dateBeautify(movie[date])}</p>\n <span id=${index} class=\"ui-li-count\">${movie.vote_average.toFixed(1)}</span></a></li>`);\n });\n\n\n $('#tvmovie_list').listview('refresh');\n })\n}", "function showMoviesNewPage(data){\n if(data.Response == \"False\"){\n $(\"#search-loader\").hide();\n alertify.error(\"No results...\");\n } else {\n $(\"#search-loader\").hide();\n data.Search.forEach(showMovie); //callback to showMovie with each of the items from the array\n }\n}", "function getMovieDetails(movie_id){\n var settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://api.themoviedb.org/3/movie/\" + movie_id + \"?language=en-US&api_key=7b9a9e7e542ce68170047140f18db864\",\n \"method\": \"GET\",\n \"headers\": {},\n \"data\": \"{}\"\n }\n $.ajax(settings).done(function (response) {\n $('#movieTitle').text(\"Showing results for \" + response.title)\n for(var i = 0; i < response.genres.length; i++){\n getMoviesForGenre(response.genres[i].name, response.genres[i].id, response.vote_average)\n }\n });\n }", "async showAllMovies() {\r\n\r\n let temp = '';\r\n\r\n for (let i = 0; i < this.allData.results.length; i++) {\r\n temp += `<div class=\"col-lg-4 col-md-6 \">\r\n <div class=\" position-relative\" id=\"movieDiv\">\r\n <img src=\"https://image.tmdb.org/t/p/w500${this.allData.results[i].poster_path}\" alt=\"WW\">\r\n <div class=\"outterInfo justify-content-center align-items-center text-center\"\r\n id=\"layer\">\r\n <div class=\"InnerInfo\">\r\n <h2>${this.allData.results[i].original_title}</h2>\r\n <p>${this.allData.results[i].overview}</p>\r\n <p>rate :'${this.allData.results[i].vote_average}'</p>\r\n <p>${this.allData.results[i].release_date}</p>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>`;\r\n }\r\n this.moviesShow.html(temp);\r\n\r\n }", "function generateAllMoviesHTML(data) {\n\t\t\n\t\tvar list = $('.in-theaters .movies-list');\n\n\t\tdata.forEach(function(element) {\n\t\t\tvar movie = $('<li data-index=' + element.id + '>');\n\t\t\tmovie.append($('<a href=\"#\" class=\"movie-photo\"><img src=\"https://image.tmdb.org/t/p/w185' + element.poster_path + '\" alt=\"' + element.title + '\"/></a>'));\n\t\t\tmovie.append($('<h2><a href=\"#\">' + element.title + '</a></h2>'));\n\t\t\tmovie.append($('<ul class=movie-description\">'));\n\t\t\tmovie.append($('<li><span>Year of Release: </span>' + element.release_date + '</li>'));\n\t\t\tvar genre_list = element.genre_ids.map(\n\t\t\t\tfunction(genre_id) {\n\t\t\t\t\tfor(var key in genres) {\n\t\t\t\t\t\tif(genres[key].id === genre_id) {\n\t\t\t\t\t\t\treturn ' ' + genres[key].name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\tmovie.append($('<li><span>Genre(s): </span>' + genre_list + '</li>'));\n\t\t\tmovie.append($('<li><span>Vote average: </span>' + element.vote_average + '</li>'));\n\t\t\tmovie.append($('<li class=\"overview\"><span>Overview: </span>' + element.overview + ' Mpx</li>'));\n\t\t\tmovie.append($('</ul>'));\n\t\t\tmovie.append($('<div class=\"highlight\"></div>'));\n\t\t\tmovie.append($('</li>'));\n\t\t\tlist.append (movie);\n\t\t});\n\n\t\t// Each movies has a data-index attribute.\n\t\t// On click change the url hash to open up a preview for this movie only.\n\t\t// Remember: every hashchange triggers the render function.\n\t\tlist.find('li').on('click', function (e) {\n\t\t\te.preventDefault();\n\n\t\t\tvar movieIndex = $(this).data('index');\n\n\t\t\twindow.location.hash = 'movie/' + movieIndex;\n\t\t})\n\t}", "function movieThis(_movie) {\n query =\n \"http://www.omdbapi.com/?t=\" + _movie + \"&y=&plot=short&apikey=trilogy\";\n\n axios\n .get(query)\n .then(function(response) {\n var movieData = [];\n\n var title = response.data.Title;\n var year = \"Year produced: \" + response.data.Year;\n var imdb = \"IMDB rating: \" + response.data.imdbRating;\n var rt =\n response.data.Ratings.length > 1\n ? \"Rotten Tomatoes: \" + response.data.Ratings[1].Value\n : \"Rotten Tomatoes: N/A\";\n var country = response.data.Country;\n var plot = \"Plot: \" + response.data.Plot;\n var cast = \"Cast: \" + response.data.Actors;\n movieData.push(title, year, imdb, rt, country, plot, cast);\n\n printData(movieData);\n })\n .catch(function(error) {\n noResults();\n });\n}", "function fetchMovie() {\n axi.get(\"/api/v1\").then(r => setMovie(r.data.movie));\n }", "function getMoviesList(){\n let SearchInput = document.getElementById('movie-search').value;\n fetch(`https://www.omdbapi.com/?apikey=${apiKey}&s=${SearchInput}`)\n .then((Response)=> Response.json())\n .then((data)=>{\n console.log(data.Search);\n let html = '';\n let movies = data.Search;\n if(movies){\n movies.forEach((movies)=>{\n html += `\n <div class=\"movie-item\" data-id = \"${movies.imdbID}\">\n <div class=\"movie-img\">\n <img src=\"${movies.Poster}\" alt=\"food\">\n </div>\n <div class=\"movie-name\">\n <h3>${movies.Title}</h3>\n <a class=\"info-btn\" href=\"#\">Get Info</a>\n </div>\n </div>\n \n `;\n });\n movieList.classList.remove('not-found');\n\n }else{\n html= 'Unable to find the movie';\n movieList.classList.add('not-found');\n } \n movieList.innerHTML =html; \n });\n}", "async function displayMovies(movies,totalResults){\n results.innerHTML = ''\n for (let movie of movies){\n const res = await fetch(`https://www.omdbapi.com/?apikey=1a241340&i=${movie.imdbID}`)\n const data = await res.json()\n const genre = data.Genre.split(', ').splice(0,3)\n const genreList = document.createElement('ul')\n genre.forEach((gen) => {\n const element = document.createElement('li')\n element.innerHTML = `${gen}`\n element.classList.add('genre')\n genreList.appendChild(element)\n })\n let nominateBtnContent = 'Nominate'\n if (nominationList !== null){\n nominationList.forEach((nominated) => {\n if (nominated.id === data.imdbID){\n nominateBtnContent = 'Remove'\n }\n })\n }\n \n\n results.innerHTML += `\n <div class= 'movie' style=\"background-image:url(${data.Poster}) \">\n \n <div class=\"info\">\n <div class = 'genres'>${genreList.innerHTML}</div>\n <button class=\"nominate-btn\" onclick=\"NominateMovie()\" data-id=\"${data.imdbID}\">${nominateBtnContent}</button>\n <div class=rate>\n <div class='btn rating' >Rating:<i class=\"fas fa-star\" style=\"color:yellow\"></i>${data.imdbRating}</div>\n <div class= 'btn age'>${data.Rated}</div>\n </div>\n </div>\n <div class=movie-title>\n <h4>${data.Title} - ${data.Year}</h4>\n </div>\n </div> `\n }\n if (totalResults > 10) {\n more.innerHTML = `\n ${\n page > 1\n ? `<button class=\"btn\" onclick=\"getPrev()\">Prev</button>`\n : ''\n }\n ${\n totalResults >= (page * 10)\n ? `<button class=\"btn\" onclick=\"getNext()\">Next</button>`\n : ''\n }`\n }\n else {\n more.innerHTML = ''\n }\n}", "function searchMovie(searchWord, page) {\n fetch(\n `http://www.omdbapi.com/?s=${searchWord}&apikey=dd68f9f&page=${page}&plot=short`\n )\n .then(function(response) {\n return response.json();\n })\n .then(function(data) {\n let searchResults = data.Search;\n results.innerHTML = \"\";\n return searchResults.map(function(movie) {\n let movieDiv = createNode(\"div\");\n let movieTitle = createNode(\"h1\");\n let moviePoster = createNode(\"img\");\n let more = createNode(\"div\");\n let movieDetails = createNode(\"p\");\n let movieID = movie.imdbID;\n let movieActors = createNode(\"p\");\n let movieDirector = createNode(\"p\");\n let movieRating = createNode(\"p\");\n\n movieDiv.className = \"movie-div\";\n\n movieTitle.textContent = `${movie.Title} (${movie.Year})`;\n movieTitle.className = \"movie-title\";\n\n moviePoster.src = movie.Poster;\n moviePoster.className = \"movie-images\";\n\n more.textContent = \"More...\";\n more.className = \"more\";\n\n movieDetails.className = \"movie-details--off\";\n\n append(results, movieDiv);\n append(movieDiv, movieTitle);\n append(movieDiv, moviePoster);\n append(movieDiv, more);\n append(more, movieActors);\n append(more, movieDirector);\n append(more, movieRating);\n append(more, movieDetails);\n\n more.addEventListener(\"click\", function(event) {\n event.preventDefault();\n if (movieDetails.className == \"movie-details--off\") {\n fetch(\n `http://www.omdbapi.com/?i=${movieID}&apikey=dd68f9f&plot=full`\n )\n .then(function(response) {\n return response.json();\n })\n .then(function(data) {\n console.log(data);\n movieActors.textContent = `Cast: ${data.Actors}`;\n if (movie.Director !== \"N/A\") {\n movieDirector.textContent = `Directed by: ${data.Director}`;\n }\n movieRating.textContent = `${data.Ratings[0].Source}: ${\n data.Ratings[0].Value\n }\n ${data.Ratings[1].Source}: ${data.Ratings[1].Value}\n ${data.Ratings[2].Source}: ${data.Ratings[2].Value}`;\n\n movieDetails.className = \"movie-plot\";\n movieDetails.textContent = `Plot: ${data.Plot}`;\n });\n\n movieDetails.classList.toggle(\"movie-details--on\");\n } else if (movieDetails.className == \"movie-details--on\") {\n movieDetails.classList.toggle(\"movie-details--off\");\n }\n });\n });\n });\n}", "function popularMovies(){\n \n \n axios.get(\"https://api.themoviedb.org/3/movie/popular?api_key=\"+ API_KEY).then((response)=>{\n const movies = response.data.results\n \n let data =''\n \n movies.forEach(item => {\n \n \n data += ` <!--movies box starts here-->\n <div class=\"movies\">\n <div class=\"img-thumb\">\n <a href=\"https://image.tmdb.org/t/p/w500${item.poster_path}\" alt=\"movies to watch\"><img src=\"https://image.tmdb.org/t/p/w500${item.poster_path}\" alt=\"movies to watch\" /> </a>\n <a class=\"movie-title\" href=\"https://image.tmdb.org/t/p/w500${item.poster_path}\">${item.title}</a>\n </div>\n <div class=\"details\">\n <p>2020</p>\n <div class=\"reactions\" >\n <i class=\"fas fa-eye\"></i>\n <i class=\"fas fa-heart\"></i>\n </div>\n <p><i class=\"fas fa-star\"></i>${item.vote_count}</p>\n </div>\n </div>\n <!--movies box ends here-->\n `\n \n \n });\n \n \n let container = document.querySelectorAll('.movie-container')\n container[0].innerHTML = data\n }).catch(err => console.log(err))\n}", "function getMovies(searchText) {\n axios\n .get(\"https://www.omdbapi.com/?s=\" + searchText + \"&apikey=bfae7d3\")\n .then(res => {\n //Setting User Serach to Data From API\n let movies = res.data.Search;\n\n //Initial State\n let output = \"\";\n\n // Using jQuery 'each()' function to loop through movies data pulled from API.\n $.each(movies, (index, movie) => {\n output += `\n <div class=\"col-md-4 \">\n <div class=\"card mb-3\">\n <img class=\"card-img-top\" src=\"${\n movie.Poster\n }\" alt=\"Sorry Img Not Available At The Moment\" style=\"border-radius: 5px\">\n <div class=\"card-body\">\n <h5 class=\"card-title text-center\">${\n movie.Title\n }</h5>\n <a onclick=\"movieSelected('${\n movie.imdbID\n }')\" class=\"btn btn-primary d-flex text-center justify-content-center\" href=\"#\">Movie Deails</a>\n </div>\n </div>\n </div>\n `;\n });\n\n // Rendering to out Movies div\n $(\"#movies\").html(output);\n })\n //Checking for Any Error\n .catch(err => {\n console.log(err);\n });\n}", "function displayMovies(movies){\n let table = \"<table border='0' style='width: 100%'>\";\n table += \"<tr><th>ID</th><th>NAME</th><th>RANK</th></tr>\";\n for(let index=0; index<movies.length; index++){\n table += \"<tr>\";\n table += \"<td>\" + movies[index].id + \"</td>\";\n table += \"<td>\" + movies[index].title + \"</td>\";\n table += \"<td>\" + movies[index].rank + \"</td>\";\n table += \"</tr>\"\n }\n // Close the table\n table += \"</table>\";\n document.getElementById(\"movies-list\").innerHTML = table;\n}", "function renderMovies (movies) {\n console.log('rendering...')\n var moviesHTML = []\n moviesHTML = movies.map(function (movie) {\n return `\n <div class=\"movie card bg-light text-center\" style=\"width: 15rem; margin-top: 1rem;\">\n <img class=\"card-img-top img-responsive\" src=\"${movie.Poster}\" alt=${movie.Title} />\n <div class=\"card-body\" style=\"margin:0 auto 0 auto\">\n <h5 class=\"card-title mt-1 movie-title\">${movie.Title}</h5>\n <h6 class=\"card-subtitle mb-2 text-muted\">${movie.Year}</p>\n </div>\n <div class=\"card-footer bg-warning btn\" onclick=\"saveToWatchlist('${movie.imdbID}')\">Add to Watchlist</div>\n </div>\n `\n })\n\n var x = `\n <div class=\"movies-container col-12\" id=\"results\" style=\"display:flex; flex-direction: row; flex-wrap: wrap; justify-content: space-around\">\n ${moviesHTML.join('')} \n </div>\n `\n return x\n}", "function movieList() {\r\n for (let i = 0; i < movieInfo.length; i++) {\r\n //Generate list for nowshowing movies\r\n if (movieInfo[i].type == \"now\") {\r\n document.getElementById(\"nowVideoDiv\").innerHTML +=\r\n \"<div>\" +\r\n \"<dt><span>Movie: </span>\" +\r\n movieInfo[i].name +\r\n \"</dt>\" +\r\n '<dd class=\"thumbnail\"><img onclick=\"switchVideo(' +\r\n (movieInfo[i].id - 1) +\r\n ')\" src=\"../image/' +\r\n movieInfo[i].thumbnail +\r\n '\" alt=\"' +\r\n movieInfo[i].name +\r\n '\"></dd>' +\r\n \"<dd><span>Cast: </span>\" +\r\n movieInfo[i].cast +\r\n \"</dd>\" +\r\n \"<dd><span>Director: </span>\" +\r\n movieInfo[i].director +\r\n \"</dd>\" +\r\n \"<dd><span>Duration: </span>\" +\r\n movieInfo[i].duration +\r\n \" mins</dd>\" +\r\n \"</div>\";\r\n }\r\n\r\n //Generate list for upcoming movies\r\n if (movieInfo[i].type == \"upcoming\") {\r\n document.getElementById(\"upcomingVideoDiv\").innerHTML +=\r\n \"<div>\" +\r\n \"<dt><span>Movie: </span>\" +\r\n movieInfo[i].name +\r\n \"</dt>\" +\r\n '<dd class=\"thumbnail\"><img onclick=\"switchVideo(' +\r\n (movieInfo[i].id - 1) +\r\n ')\" src=\"../image/' +\r\n movieInfo[i].thumbnail +\r\n '\" alt=\"' +\r\n movieInfo[i].name +\r\n '\"></dd>' +\r\n \"<dd><span>Cast: </span>\" +\r\n movieInfo[i].cast +\r\n \"</dd>\" +\r\n \"<dd><span>Director: </span>\" +\r\n movieInfo[i].director +\r\n \"</dd>\" +\r\n \"<dd><span>Duration: </span>\" +\r\n movieInfo[i].duration +\r\n \" mins</dd>\" +\r\n \"</div>\";\r\n }\r\n }\r\n}", "function getMovieID(data){\n\tconst movieList = data.results.map((value, index) => displayResult(value));\n\t$(\".js-movies-result\").html(movieList);\n\ttitleClick();\n\tcloseClick();\n}", "function getMovies() {\n MovieService.movies().then(res => {\nconsole.log(res.data.rows)\n let movies = res.data.rows;\n movies = movies.map((obj) => obj.doc);\n displayMovies(movies)\n })\n .catch((err) => {\n console.error(err);\n });\n\n}", "async getMovies({ commit, dispatch }, query) {\n try {\n let res = await api.get(urlParams + query)\n //NOTE the mutations are generally named 'set' something \n commit('setMovies', res.data.results)\n } catch (error) {\n console.error(error)\n }\n }", "getMovies (state) {\n return state.loadeMovies\n }", "function displayMoviesResponse(response) {\n let results = response.results;\n\n results_container.empty(); // empty the container (div) with the search results\n\n for (let i = 0; i < 12 && i < results.length; i++) {\n // seed it again with new search results, not more than 1-12, to get all results searchResults.length\n addCard(results[i]);\n }\n}", "function loadMovies() {\n\n $.ajax({\n url: config.moviesFile,\n cache: false,\n success: function (data) {\n var movieList = data.split(/[\\r\\n]+/g);\n printList(movieList);\n printCount(movieList.length);\n },\n dataType: 'text'\n });\n }", "function cargarPeliculas(){\n movies.movies.forEach(movie => { \n cargarElementosAlHtml(movie);\n });\n}", "function renderMovies(movieArray) { \n\n function createHTML(movie) {\n return `<div class=\"card mb-3\">\n <img class=\"card-img-top\" src=\"${movie.Poster}\"/>\n\n <div class=\"card-body\">\n <h1 class=\"card-title\">${movie.Title}</h1>\n <h4 class=\"card-text\">${movie.Year}</h4>\n <button onclick=\"saveToWatchlist('${movie.imdbID}')\"> <span class=\"add-symbol\">+</span> ADD<span class=\"empty-space\">+</span></button>\n </div>\n </div>`;\n }\n\n moviesHTML = movieArray.map(createHTML); \n return moviesHTML.join(\"\");\n\n }", "function getMovie(){\r\n movieId = sessionStorage.getItem('movieId');\r\n axios.get('https://api.themoviedb.org/3/movie/'+movieId+'?api_key=7719d9fc54bec69adbe2d6cee6d93a0d&language=en-US')\r\n .then((response) => {\r\n imdbId = response.data.imdb_id;\r\n axios.get('http://www.omdbapi.com?apikey=c1c12a90&i='+imdbId)\r\n .then((response1) => {\r\n console.log(response1);\r\n let movie = response1.data;\r\n let output = '';\r\n const dict = {\r\n 'Jan': 1,\r\n 'Feb': 2,\r\n 'Mar': 3,\r\n 'Apr': 4,\r\n 'May': 5,\r\n 'Jun': 6,\r\n 'Jul': 7,\r\n 'Aug': 8,\r\n 'Sep': 9,\r\n 'Oct': 10,\r\n 'Nov': 11,\r\n 'Dec': 12\r\n };\r\n var arr = movie.Released.split(\" \");\r\n var today = new Date();\r\n var t = new Date(today.getFullYear()+','+(today.getMonth()+1)+','+today.getDate());\r\n var r = new Date(arr[2]+','+dict[arr[1]]+','+arr[0]);\r\n if(movie.Poster != null){\r\n output += `\r\n <h1 class=\"my-4 heading\">${movie.Title}</h1>\r\n\r\n <div class=\"row\">\r\n\r\n <div class=\"col-md-5\">\r\n <img style=\"\" class=\"img-fluid\" src=\"${movie.Poster}\" alt=\"\">\r\n </div>\r\n\r\n <div class=\"col-md-7\">\r\n <ul class=\"list-group\">\r\n <li class=\"list-group-item\"><strong>Genre: </strong>${movie.Genre}</li>\r\n <li class=\"list-group-item\"><strong>Released: </strong>${movie.Released}</li>\r\n <li class=\"list-group-item\"><strong>Rated: </strong>${movie.Rated}</li>\r\n <li class=\"list-group-item\"><strong>IMDB Rating: </strong>${movie.imdbRating}</li>\r\n <li class=\"list-group-item\"><strong>Director: </strong>${movie.Director}</li>\r\n <li class=\"list-group-item\"><strong>Writer: </strong>${movie.Writer}</li>\r\n <li class=\"list-group-item\"><strong>Actors: </strong>${movie.Actors}</li>\r\n </ul>\r\n <li class=\"list-group-item\"><strong>Overview: </strong>${movie.Plot}</li>\r\n <a href=\"http://imdb.com/title/${movie.imdbID}\" target=\"blank\" class=\"btn btn-primary\">View IMDB</a> `+\r\n (t > r ? `<a href=\"#\" onClick=\"addMovie(${movieId}, ${1})\" class=\"btn btn-primary\">Add to Watched</a> ` : ``)\r\n +`\r\n <a href=\"#\" onClick=\"addMovie(${movieId}, ${0})\" class=\"btn btn-primary\">Add to Wished</a>\r\n </div>\r\n\r\n </div>\r\n `\r\n }\r\n $('#movieSingle').html(output);\r\n })\r\n .catch((err) => {\r\n console.log(err.message);\r\n });\r\n })\r\n .catch((err) => {\r\n console.log(err.message);\r\n });\r\n}", "function getMovies() {\n var movieSearch = process.argv.slice(3).join(\" \");\n var queryURL = \"http://www.omdbapi.com/?apikey=trilogy&t=\" + movieSearch;\n axios\n .get(queryURL)\n .then(function(response) {\n //Function for Response of movies.\n //console.log(response);\n var searchRes = response.data;\n console.log(\"Movie Title: \" + searchRes.Title + \n \"\\nReleased In: \" + searchRes.Year + \n \"\\nIMDB Rating: \" + searchRes.imdbRating + \n \"\\nRotten Tomatoes Rating: \" + searchRes.Ratings[1].Value + \n \"\\nCountry where movie was produced: \" + searchRes.Country + \n \"\\nLanguage: \" + searchRes.Language + \n \"\\nPlot: \" + searchRes.Plot + \n \"\\nActors: \" + searchRes.Actors);\n console.log(\"------------------------------------------\");\n })\n //Function for ERRORS\n .catch(function(error) {\n if (error.response) {\n console.log(error.response.data);\n console.log(\"------------------------------------------\");\n }\n })\n}", "function movieThis(movie) {\n\n if (movie.length === 0) {\n var queryURL = \"http://www.omdbapi.com/?t=\" + \"Mr.Nobody\" + \"&y=&plot=short&apikey=trilogy\";\n } else {\n var queryURL = \"http://www.omdbapi.com/?t=\" + searchQuery + \"&y=&plot=short&apikey=trilogy\";\n }\n\n // axios method to recieve and print data\n axios.get(queryURL).then(function (response) {\n console.log(\"Movie Title: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Year);\n console.log(\"IMBD Rating: \" + response.data.Ratings[0].Value);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n }\n\n );\n}", "function getMovies (req, resp) {\n console.log(\"\\tgetMovies called\");\n var filter = sharedVars.parseFilter(req.swagger.params);\n getFilteredMovies(filter, function(getError, data) {\n if (getError) {// If an error occured, just say it failed\n sharedVars.sendError(resp, 500, 'Failed to get a list of movies.', data);\n } else {// If successful, send json back\n // Update analytics for all the movies\n console.log(\"\\tSending analytics for movie list...\");\n for(var movieIndex in data.entities) {\n sharedVars.sendAnalytic(data.entities[movieIndex].name);\n }\n if (!sharedVars.shouldGetReviews(req.swagger.params)) {\n // If no reviews needed, just return the data\n resp.json(data);\n\n } else {\n // Add reviews to each movie in the list\n console.log(\"\\t\\tAppending reviews to list...\");\n async.each(data.entities, function(movie, callback) { // Is called for each request\n // Manually ask for connections...\n getReviews(movie, function(revError, revData) {\n movie.reviews = revData;\n if (revError) // If couldn't append reviews to movie, report error\n callback(revData);\n else // If reviews appended successfully, return\n callback();\n });\n }, function(error) { // Is called after all requests are done\n if (error) { // If an error occurred, set error message\n resp.statusCode = 500;\n data.message = error;\n }\n resp.json(data);\n });\n }\n }\n });\n}", "function getAvailableMovies(req, res, next) {\n movieRepository.findAvailables().then((result) => {\n res.status(200).send(result);\n }).catch(next);\n}", "function searchMovie(value) {\n\n const path = '/search/movie';\n\n const url = generateUrl(path) + '&query=' + value;\n\n const render = renderMovies.bind({title: 'Results'});\n\n sectionMovies(url, render, handleError);\n\n}", "function movieThis(show) {\n // when called, show will be replaced with var = title.\n axios.get('http://www.omdbapi.com/?t=' + show + '&plot=short&apikey=trilogy')\n .then(function (response) {\n // console.log('////////////////AXIOS NO ERROR////////////')\n // console.log(response)\n // * Title of the movie.\n console.log(`Movie: ${response.data.Title}`)\n // * IMDB Rating of the movie.\n console.log(`IMDB Rating is: ${response.data.imdbRating}`)\n // * Year the movie came out.\n console.log(`Year Released : ${response.data.Released}`)\n // * Rotten Tomatoes Rating of the movie.\n console.log(`Rotten Tomatoes Rating : ${response.data.Ratings[1].Value}`)\n // * Country where the movie was produced.\n console.log(`Country : ${response.data.Country}`)\n // * Language of the movie.\n console.log(`Language : ${response.data.Language}`)\n // * Plot of the movie.\n console.log(`Plot : ${response.data.Plot}`)\n // * Actors in the movie.\n console.log(`Actors in movie : ${response.data.Actors}`)\n })\n // log error\n .catch(function (error) {\n console.log('//////////ERROR!!!/////////////')\n console.log(error);\n });\n}", "function movies(input) {\n\n var movieTitle;\n if (input === undefined) {\n movieTitle = \"Cool Runnings\";\n } else {\n movieTitle = input;\n };\n\n var queryURL = \"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=b41b7cf6\";\n\n request(queryURL, function (err, res, body) {\n var bodyOf = JSON.parse(body);\n if (!err && res.statusCode === 200) {\n logged(\"\\n---------\\n\");\n logged(\"Title: \" + bodyOf.Title);\n logged(\"Release Year: \" + bodyOf.Year);\n logged(\"Actors: \" + bodyOf.Actors);\n logged(\"IMDB Rating: \" + bodyOf.imdbRating);\n logged(\"Rotten Tomatoes Rating: \" + bodyOf.Ratings[1].Value);\n logged(\"Plot: \" + bodyOf.Plot);\n logged(\"\\n---------\\n\");\n }\n });\n}", "function getMovies(movies) {\r\n return movies\r\n .filter((m) => m.year >= 2018 && m.rating > 4)\r\n .sort((a, b) => a.rating - b.rating)\r\n .reverse()\r\n .map((m) => m.title);\r\n}", "function getTheatreMovies() {\n let queryURL =\n \"https://api.themoviedb.org/3/movie/now_playing?api_key=\" +\n API_KEY +\n \"&language=en-US&region=US\";\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response) {\n console.log(response);\n let theatreMovies = [];\n for (let i = 0; i < response.results.length; i++) {\n theatreMovies.push(response.results[i].title);\n }\n console.log(theatreMovies);\n });\n}", "function openMovie(query) {\n\n //kada otvorimo odredjeni film/seriju sakrijemo elemente koji su do sada bili prikazani i prikazemo div za film\n $(\"#content\").hide();\n $(\"#top-part\").hide();\n $(\"#movie-show\").show();\n\n //ukoliko prikazemo neki film pa se vratimo na pretragu i otvorimo novi, prikazali bi se rezultati oba filma u div-u movie-show\n //zbog toga pozivamo pomocnu funkciju cleanMovie() kako bi ispraznili sve elemente movie-showa ukoliko su vec bili popunjeni\n cleanMovie();\n\n //div series-season se koristi prilikom prikaza odredjene epizode i on nam nije potreban kada prikazujemo film ili seriju\n //iz tog razloga ga ispraznimo kako se ne bi prikazivao bez kad je potreban\n $('#series-season').empty();\n\n //ajax reuquest prema API-u gdje izvlacimo podatke o odredjenom filmu/seriji\n $.ajax({\n type: \"GET\",\n url: \"https://www.omdbapi.com/?apikey=39c93cf7&i=\" + query,\n success: (response) => {\n //pomocna funkcija koja popunjava elemente potrebne za prikaz filma/serije\n showMovie(response);\n }\n })\n}", "function getMovie() {\n\n var omdbApi = require('omdb-client');\n\n var params = {\n apiKey: 'XXXXXXX',\n title: 'Terminator',\n year: 2012\n }\n omdbApi.get(params, function (err, data) {\n // process response...\n });\n}", "function findAllMovie(){\n $(\"#allMovies\").click(function(){\n url=\"../MovieCalender/index.php?route=CustomerCalender/showAllMovies\";\n $.get(url,function(data,status){\n data = JSON.parse(data);\n console.log(data);\n createList(data);\n })\n })\n}", "selectedMovie(movie) {\n // Display selected movie\n this.displaySingleMovie(movie)\n }", "async function getMovies(req, res) {\n try {\n const movies = await movieService.query(req.query)\n res.send(movies)\n } catch (err) {\n logger.error(err);\n logger.error('Cannot get movies: ' + err.message);\n res.status(500).send({ error: 'cannot get movies' })\n }\n}", "function showSuccess(json) {\n\tallMovies = json;\n\tconsole.log(\"Got all movies\");\n\trender();\n}", "async function getMovies(genres, year) {\n let response = await axios\n .get(\n ` https://api.themoviedb.org/3/discover/movie?api_key=${APIKEY}&with_genres=${genres}&primary_release_year=${year}&sort_by=popularity.desc&page=${page}`\n )\n .catch(res => {\n console.log(\"error\");\n });\n\n // displays movies in DOM\n\n movieDomCreator(response.data.results);\n\n console.log(response.data.results);\n return response.data.results;\n}" ]
[ "0.7541515", "0.73505324", "0.7324169", "0.7254256", "0.72266597", "0.7223161", "0.7214421", "0.7143797", "0.70669204", "0.70375615", "0.7027039", "0.7014801", "0.69696033", "0.6959119", "0.69549954", "0.694106", "0.6939921", "0.6924565", "0.68586236", "0.685659", "0.68282545", "0.6797813", "0.6771663", "0.677104", "0.67139834", "0.66864073", "0.6680463", "0.6669856", "0.66677314", "0.6645136", "0.66376656", "0.66267073", "0.6619655", "0.6617255", "0.66159064", "0.6599039", "0.659472", "0.6591331", "0.6591244", "0.6579195", "0.6577089", "0.6567128", "0.6563822", "0.6558139", "0.6542448", "0.652819", "0.650699", "0.65023875", "0.6501221", "0.64838487", "0.6476028", "0.6470622", "0.64674085", "0.6461405", "0.6455347", "0.6453024", "0.64499056", "0.6446442", "0.6443581", "0.64356256", "0.64181685", "0.64152074", "0.6412019", "0.6408355", "0.64074004", "0.6405703", "0.64045066", "0.638754", "0.6377724", "0.63660246", "0.63640225", "0.63618386", "0.6358646", "0.63572687", "0.63550127", "0.6350607", "0.6327678", "0.63256484", "0.6318637", "0.6318486", "0.63162565", "0.631495", "0.6314686", "0.631451", "0.63103306", "0.6309213", "0.629806", "0.6293775", "0.6293701", "0.62935436", "0.628722", "0.62852764", "0.6284265", "0.62824935", "0.628021", "0.62787074", "0.6277872", "0.6277663", "0.62738657", "0.6271958" ]
0.636733
69
write updated data to db
function data_update_to_db(url_query, respond){ // create an array var data_to_write = url_query.replace(/%20/g, " ").split('&'); respond.write("<script>document.getElementById('heading').innerHTML ='Updating DB';</script>"); console.log(data_to_write); //add data to db table my_sql_conn.connect(function(err){//doing mysql connection handshake aka test connectability if(err){ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>connection error: "+err+"</p>"); //return respond.end();//ending here } else{ // respond.write("<p>connected to db</p>"); //respond.end();//ending here } //add data to db var mysql_db_data_add ="UPDATE movie_table SET m_title='"+data_to_write[0]+"', m_director='"+data_to_write[1]+"', m_producer='"+data_to_write[2]+"', m_production_company='" +data_to_write[3]+"', m_country='" +data_to_write[4]+"', m_actor='" +data_to_write[5]+"', m_genre='" +data_to_write[6]+"', m_description='" +data_to_write[7]+"', m_disclaimer='" +data_to_write[8]+"', m_image='" +data_to_write[9]+"' WHERE movie_id='"+data_to_write[10]+"'"; // console.log(mysql_db_data_add); //connect to existing db my_sql_conn_db.query(mysql_db_data_add, function(err, results){ if(err){ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Data adding err(update write) "+err+"</p>"); return ;//respond.end();//ending here } else{ console.log(JSON.stringify(results)); respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Data added "+JSON.stringify(results)+"</p>"); respond.write("<script>alert('Movie deleted')</script>"); load_all_movies(); } } ); }); function load_all_movies(){//call movie load all movie_find_show_all(url_query, respond); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "save() {\n this.db.write();\n }", "function updateDb() {\n fs.writeFile(\"./db/db.json\", JSON.stringify(notes), (err, data) => {\n if (err) throw err;\n return true;\n });\n }", "function updateDb() {\n fs.writeFile(\"db/db.json\",JSON.stringify(notes,'\\t'),err => {\n if (err) throw err;\n return true;\n });\n }", "function updateDb() {\n fs.writeFile(\"db/db.json\",JSON.stringify(notes,'\\t'),err => {\n if (err) throw err;\n return true;\n });\n }", "function updateDb() {\n fs.writeFile(\"db/db.json\", JSON.stringify(notes, \"\\t\"), (err) => {\n if (err) throw err;\n return true;\n });\n }", "update(){}", "update(){}", "update(){}", "function writeFileContent(data) {\n console.log(\"Write file data to db\");\n\n FileData.find({})\n .exec(function (err, fileData) {\n if (err) {\n console.log(err);\n } else {\n if (fileData.length == 0) {\n //save file data into db\n var newFileData = new FileData()\n\n newFileData.data = data\n\n newFileData.save(function (err) {\n if (err) {\n console.log(err);\n }\n })\n }\n else {\n //update file data into db\n FileData.update({}, {\n $set: {\n data: data\n }\n },\n {\n new: true\n },\n function (err, updatedDetails) {\n if (err) {\n console.log(err);\n }\n });\n }\n }\n });\n}", "write() {\n const statement = this.dbConnector.statements.set(this.params, this.writeBuffer);\n this.dbConnector.query(statement, this.onWriteResult.bind(this), [], true);\n }", "async save() {\n // Check if anything has changed or stop here.\n const originData = await loadDataObject(this.dataKey)\n\n if (this.data === originData) {\n console.log('Nothing changed here for ' + this.dataKey)\n return\n }\n\n // Convert the modified data for the backend.\n const convertedData = await convertNewData(\n this.dataKey,\n JSON.parse(JSON.stringify(this.data))\n )\n\n // Update the data on the backend.\n try {\n await ApiConnector.update(this.dataKey, convertedData)\n } catch (err) {\n // TODO: Show the error to the user.\n console.log('Message: ' + err.message)\n }\n }", "function updateNoteDb() {\n fs.writeFile(\"db/db.json\",JSON.stringify(notes,'\\t'),err => {\n if (err) throw err;\n return true;\n });\n}", "function updateFile() {\n fs.writeFile(\"db/db.json\", JSON.stringify(notes,'\\t'), err => {\n if (err) throw err;\n return true;\n });\n }", "function writeToDB() {\n\tvar pos = markerPos(); //return pos of marker in the markers array\n\tvar spawn = require(\"child_process\").spawn; //spawns a childs proc.\n\tvar child = spawn('python',[\"userInterface/py/updateDB.py\", new_lat, new_lng, pos]); //calls a python script with parameters\n}", "function saveToDatabase() {\n idb.add(dbKeys.stations, JSON.stringify(stationList));\n idb.add(dbKeys.lastFrequency, lastFrequency);\n }", "save(data) {\n this.db.save(data);\n }", "async save() {\n const priv = privates.get(this);\n const tableName = priv.get(\"tableName\");\n if (tableName) {\n const formData = new FormData(this.form);\n if (formData.get(\"saveDetails\") !== \"on\") {\n return;\n }\n const dataToSave = Object.assign({}, this.data, this.toObject());\n if (!db.isOpen()) {\n await db.open();\n }\n await db[tableName].put(dataToSave);\n this.data = dataToSave;\n }\n }", "update(id, data, params) {}", "function updateEntry(id,type,value){\n jsfile.readFile(dbFile,(err,data)=>{\n if(!err){\n console.log(\"Read DB Success!\");\n data[id][type] = value;\n jsfile.writeFile(dbFile,data,(err)=>{\n if(err){\n console.log(type+\" Entry Failure!\");\n }else{\n console.log(type+\" Entry Success!\");\n }\n });\n }else{\n console.log(\"Read DB Failure!\");\n }\n })\n}", "function saveData(data) {\n const transaction = db.transaction([\"open\"], \"readwrite\");\n\n const store = transaction.objectStore(\"open\");\n\n store.add(data);\n}", "function refreshDB() {\n fs.writeFile(\"./db/db.json\", JSON.stringify(notesData), function (err) {\n if (err) throw err;\n return true;\n });\n}", "async saveData() {\n let data = this.state.rowData;\n let projectID = this.props.match.params.projectID;\n\n let updatedRows = this.updatedRows;\n\n // index is the index of a row that has been updated\n\n let processData = async function (pair) {\n let index = pair[\"rowIndex\"];\n let key = pair[\"colIndex\"];\n let netID = data[index][\"netid\"];\n let hours = data[index][key];\n let newData = {\n \"ProjectID\": projectID,\n \"NetID\": netID,\n \"Dates\": key,\n \"HoursPerWeek\": hours\n };\n let response = await fetch('../api/updateSchedule', {\n method: \"PUT\",\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(newData)\n });\n }\n updatedRows.forEach(processData);\n this.updatedRows.clear();\n }", "storeData(jsonData) {\n fs.writeFileSync(dbPath, JSON.stringify(jsonData));\n }", "async store(data) {\n console.log('filling', data);\n this.fill(data);\n this.property('updatedAt', Date.now());\n await this.save();\n }", "writeData( key, data ) {\n\t\tBdApi.saveData( this.getShortName(), key, data );\n\t}", "function updateDatabase(){\n db.collection(\"<collection>\").doc(\"<document>\").set({\n\tcongratulated: congratulated,\n\tcurrentCup: currentCup,\n\tgoal: goal,\n\tprogress: progress,\n \ttotalDailyWeight: totalWeight,\n\tcurrentMonth: currentMonth,\n\tcurrentDay: currentDay,\n\tdaysMetGoal: daysMetGoal,\n\ttotalMonthlyWeight: monthlyTotal,\n\tdaysInMonth: daysInMonth\n })\n}", "function update(){\n\tconsole.log('Initializing data...server will be ready when the count is done')\n\tdb.clearCityData('sfbay')\n\tdb.saveCityData('sfbay');\n}", "function dbWriteData( query, callback){\n dbCon.query( query, function( error, result){\n if( error) handleError( error);\n else callback( result);\n });\n }", "function updateDatabase() {\n database.ref().set({ \n p1name: v_p1name,\n p1pick: v_p1pick,\n p1wins: v_p1wins,\n p1losses: v_p1losses,\n p1ties: v_p1ties,\n p2name: v_p2name,\n p2pick: v_p2pick,\n p2wins: v_p2wins,\n p2losses: v_p2losses,\n p2ties: v_p2ties,\n conversation: v_conversation,\n message: v_message\n });\n\n}", "async save() {\n await db.query(\n `UPDATE jobs SET title=$1, salary=$2, equity=$3, company_handle=$4 WHERE id = $5`, [this.title, this.salary, this.equity, this.company_handle, this.id]);\n }", "function putEntry(data) {\n db.get(\"data_entries_point\").push(data).write();\n}", "function writeDataIntoDB(database) {\n database.save(function (err) {\n if (err) throw err;\n console.log('Write in DB successfully');\n })\n}", "function updateJSON() {\n fs.writeFile('db/db.json', JSON.stringify(notes, '\\t'), err => {\n if (err) {\n return err;\n }\n return true;\n });\n }", "function write_in_db (internal_data) {\n database.collection(\"people_presence_db\").insertOne(internal_data, function(err,res) {\n if(err) throw err;\n //console.log(res.connection)\n //console.log(res.ops)\n //client.close();\n })\n }", "save() {\n this.db._write(this.data);\n return this.db;\n }", "function updateInDatabase(datasetId, guid, data, callback) {\n fh.db({\n \"act\": \"update\",\n \"type\": datasetId,\n \"guid\": guid,\n \"fields\": data\n },\n function(error, responseData) {\n if (error) {\n return callback(error, null);\n } else {\n return callback(null, responseData);\n }\n });\n }", "function update(data) {\n\t\tdebug('update request', data);\n\t\tif (!data[pk]) return emit(routes.read, {\"error\": \"no id attribute in update data for \" + routes.read});\n\t\tvar id = data[pk];\n\t\tdelete data[pk]; // ok\n\t\tdata = normalize(data);\n\t\tvar query = table.update(data).where(\n\t\t\ttable[pk].equals(id)\n\t\t).returning(\"*\").toQuery();\n\t\tdb.query(query.text, query.values, function(err, resp){\n\t\t\tdebug('update resp:', err);\n\t\t\tif (err) {\n\t\t\t\temit(routes.update, {\"error\": \"db error\"}); // TODO better specific error reporting\n\t\t\t} else {\n\t\t\t\tdebug(resp.rows);\n\t\t\t\tbroadcast(routes.update, resp.rows);\n\t\t\t}\n\t\t});\n\t}", "function updateDataFile() {\n fs.writeFile(dataFileName, JSON.stringify(appData, null, 2), function(err) {\n if (err) return console.log(err);\n // console.log(JSON.stringify(appData));\n // console.log('writing to ' + dataFileName);\n });\n}", "function writeData(data) {\n // Write data to database\n earnings.writePoints(data, {\n database: dbName,\n precision: 's',\n })\n .catch(error => {\n console.error(`Error saving data to InfluxDB! ${error}`)\n })\n}", "function data_write(mydata) {\n\n const pool = mysql.createPool({\n host: process.env.RDS_HOSTNAME,\n user: process.env.RDS_USERNAME,\n password: process.env.RDS_PASSWORD,\n port: process.env.RDS_PORT,\n database: process.env.RDS_DATABASE\n });\n\n var id = convert_value(mydata.id,'qs');\n var siteid = convert_value(mydata.site_id,'s');\n var site = convert_value(mydata.site); \n var location = convert_value(mydata.address);\n var timestamp = Date.now();\n var latitude = mydata.latitude;\n var longitude = mydata.longitude;\n var temperature = mydata.temperature;\n var humidity = mydata.humidity;\n var pressure = mydata.pressure;\n var co2 = mydata.co2;\n var lpg = mydata.lpg;\n var registers = \"INSERT INTO SENSORS (id,\" +\n \"timestamp,\" +\n \"temperature,\" +\n \"humidity,\" +\n \"pressure,\" +\n \"lpg,\" +\n \"co2,\" +\n \"latitude,\" +\n \"longitude,\" +\n \"siteid,\" +\n \"site,\" +\n \"location)\" +\n \"VALUES (?,?,?,?,?,?,?,?,?,?,?,?)\";\n \n // Insert values in the database of MySQL \n context.callbackWaitsForEmptyEventLoop = false;\n pool.getConnection(function(error, connection) {\n connection.query(registers,\n [id,\n timestamp,\n temperature,\n humidity,\n pressure,\n lpg,\n co2,\n latitude,\n longitude,\n siteid,\n site,\n location],\n function(error, results, fields) {\n connection.release();\n if (error) {\n callback(error);\n } else {\n callback(null, results);\n console.log(null,results);\n }\n }); \n });\n }", "saveDB() {\n const dbpath = path.join(__dirname, \"../db/data.json\");\n fs.writeFileSync(dbpath, JSON.stringify(this.toJson));\n }", "function writeUserData(date, meal, location, food) {\n firebase.database().ref(`masterData`).push().set({\n date : date,\n meal : meal,\n location : location,\n food : food\n });\n document.write(\"Successfully wrote \" + food + \" to master db\")\n}", "function updateDb(db) {\n return fs.promises.writeFile(dbPath, JSON.stringify(db));\n}", "function updateDB(action, data) {\n\t\tvar transaction = db.transaction([collection], \"readwrite\" ),\n\t\t\t store = transaction.objectStore(collection),\n\t\t\t request;\n\n\t\tswitch(action) {\n\t\t\tcase \"add\" :\n\t\t\t\trequest = store.add(data);\n\t\t\t\tbreak;\n\t\t\tcase \"edit\" :\n\t\t\t request = store.put(data);\n\t\t\t break;\n\t\t\tcase \"delete\" :\n\t\t\t\t// note deleteIt() passes just the id\n\t\t\t\trequest = store.delete(Number(data));\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\tconsole.log( \"Unable to complete a \" + action + \" request.\" );\n\t\t}\n\n\t\trequest.onsuccess = function(event) {\n\t\t\t// updatePage();\n\t\t}\n\n\t\trequest.onerror = function(event) {\n\t\t\tconsole.log( \"Error with \" + action + \" for article \" + data.title );\n\t\t\tconsole.error(event.target.result)\n\t\t}\n\t\ttransaction.oncomplete = function(event) {\n\t\t\tupdatePage();\n\t\t}\n\t}", "function updateNotesData(notes) {\n fs.writeFile('db/db.json', JSON.stringify(notes,'\\t'), err => {\n if (err) throw err;\n return true;\n })\n}", "function writeData(name, data){\n return dbPromise\n .then(function(db){\n const tx = db.transaction(name, 'readwrite');\n const store = tx.objectStore(name);\n store.put(data);\n \n return tx.complete;\n });\n}", "function databaseUpdate(){\n\tvar kwh = 0;\n\tvar query = client.query('SELECT timing, lightson FROM time', [], function(err,result){\n\t\tif (err) throw err;\n\t\tvar date = new Date(Number(result.rows[0].timing));\n\t\tvar parseDate = date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate();\n\t\tvar i = 1;\n\t\tfor (i = 1; i < result.rows.length; i++){\n\t\t\tvar timediff = Math.abs(Number(result.rows[i].timing) - Number(result.rows[i - 1].timing));\n\t\t\tbulbs = result.rows[i - 1].lightson;\n\t\t\tkwh += (WATTAGE * bulbs * (timediff / (1000 * 60 * 60)) / 1000);\n\t\t}\n\t\t//var last = new Date(Number(result.rows[i - 1].timing));\n\t\t//client.query('DELETE FROM time WHERE timing < $1;', [last]);\n\t\tclient.query('DELETE FROM time');\n\t\tclient.query('INSERT INTO dailystats (kw, day) VALUES ($1, $2);', [kwh, new Date()]);\n\t});\n}", "function storeDetailsInDb(obj) {\n db.customers.update({phoneNumber:obj.phoneNumber}, {$set: { name : obj.firstName+\" \"+obj.lastName,email:obj.email,phoneNumber:obj.phoneNumber,currentCity:obj.currentCity,prefferdJobLocation:obj.jobLocation }}, {upsert: true}, function (err) {\n // the update is complete\n if(err) throw err\n console.log(\"inside update\")\n })\n}", "function update(data) {\n console.log('+++ TODO');\n }", "function updateData(modSql, modSqlParams){\n connection.query('UPDATE ' + modSql, modSqlParams,function (err, result) {\n if(err){\n console.log('[UPDATE ERROR] - ',err.message);\n return;\n } \n console.log('--------------------------UPDATE----------------------------');\n console.log('UPDATE affectedRows',result.affectedRows);\n console.log('------------------------------------------------------------');\n });\n}", "function write(dbData) {\n\tfs.writeFileSync('db/db.json', JSON.stringify(dbData), 'utf-8');\n}", "function writeData(Head, details) {\n firebase.database().ref(Head).set({ details });\n }", "function updateData() {\n\t/*\n\t* TODO: Fetch data\n\t*/\n}", "function saveDatabase(newData) {\r\n return fs.writeFileSync(path.join(__dirname, \"../../db/db.json\"), JSON.stringify(newData))\r\n}", "update(data) {\n const columns = Object.keys(data);\n let variables = columns.map(column => data[column]);\n variables.push(this.id);\n\n let i = 1;\n const query = `UPDATE Members SET (${columns.join(', ')}) = \\\n (${columns.map(_ => '$' + i++).join(', ')}) \\\n WHERE id = $${columns.length + 1}`;\n\n return db.none(query, variables);\n }", "function updateDB(POST,response){\n\n\ttitle=POST.title; description=POST.description; location=POST.location; id=POST.id; link=POST.link; status=POST.status;\n\tvar sqlQuery = 'UPDATE issues SET title=\"'+title+'\",description=\"'+description+'\",location=\"'+location+'\",link=\"'+link+'\", status=\"'+status +'\" WHERE id=' + id;\n\tdbAccess.runQuery(sqlQuery, serve(response,id));\n }", "function updateIdeaInDB(res, body) {\r\n fs.readFile(path.join(rootPath, 'database', body.user + '.json'), function (err, data) {\r\n if (err) {\r\n console.error(err);\r\n res.writeHead(404, { 'Content-Type': 'text/html' });\r\n } else {\r\n let ideas = JSON.parse(data);\r\n let keys = Object.keys(ideas);\r\n let indexFound = false;\r\n\r\n for (var i = 0; i < keys.length; i++) {\r\n if (keys[i] === body.id) {\r\n indexFound = true;\r\n }\r\n }\r\n\r\n if (indexFound === false) {\r\n res.write(\"ID not exist\");\r\n return;\r\n }\r\n\r\n ideas[body.id][0] = body.idea;\r\n ideas[body.id][1] = getCurrentTime();\r\n fs.writeFile(path.join(rootPath, 'database', body.user + '.json'), JSON.stringify(ideas), (err) => {\r\n if (err) {\r\n console.error(err);\r\n res.writeHead(404, { 'Content-Type': 'text/html' });\r\n return;\r\n } else {\r\n res.writeHead(200, { 'Content-Type': 'text/html' });\r\n res.write(\"ID was updated\");\r\n }\r\n res.end();\r\n });\r\n }\r\n });\r\n}", "function writeDateData(date) {\n firebase.database().ref(`dateData`).push().set({\n date : date\n });\n document.write(\"Successfully wrote \" + date + \" to date db\")\n}", "updateWeather(context) {\n context.commit(\"UPDATE_WEATHER\");\n }", "save() {\n let columns = Object.keys(this.data);\n let sql;\n // build sql string\n if (this.data[this.primaryKey]) {\n sql = Squel.update().table(this.table);\n } else {\n sql = Squel.insert().into(this.table);\n }\n\n columns.map( (column) => {\n // ignore primary key column\n if (column != this.primaryKey) {\n let value = this.data[column];\n sql.set(column, value);\n }\n });\n\n // update mode: set where condition\n if (this.data[this.primaryKey])\n sql.where(`${this.primaryKey} = ${this.data[this.primaryKey]}`);\n\n // execute sql\n sql = sql.toString();\n\n return new Promise( (resolve, reject) => {\n getSQLiteDB(this.table).executeSql(sql, [], (results) => {\n // update model's primaryKey on insertId\n if (results.insertId && !this.data[this.primaryKey])\n this.data[this.primaryKey] = results.insertId;\n\n resolve(true);\n });\n });\n }", "function WriteDB(the_record){\n connection.query('select count(id) from record', function (error, results, fields) {\n if (error) throw error\n var num = results[0]['count(id)'];\n var t1 = new Date();\n var time = t1.getFullYear() * 10000 + (t1.getMonth()+1)*100 + t1.getDate();\n\n connection.query(`INSERT INTO record(lineId, id, time) VALUES (\"${the_record.id}\", ${num}, ${time});`);\n connection.query(`INSERT INTO location(id, lat, lng, statu, address) VALUES (${num}, ${the_record.lat}, ${the_record.lon}, '0', '${the_record.address}');`);\n UploadFolder(oAuth2Client, num.toString(), num, the_record);\n })\n}", "function writeStock(x){\n database.ref('/').update({\n Food:x\n })\n}", "function addLevelDBData(key,value){\n db.put(key, value, function(err) {\n if (err) return console.log('Block ' + key + ' submission failed', err);\n })\n}", "function addLevelDBData(key,value){\n db.put(key, value, function(err) {\n if (err) return console.log('Block ' + key + ' submission failed', err);\n })\n}", "function writeNewData(value, phone, imageurl) {\n var newPhoneRef = firebase.database().ref('newphone/');\n newPhoneRef.set({\n current: 1,\n phone: phone,\n imageurl: imageurl\n })\n\n var pushRef = firebase.database().ref('update/').push();\n pushRef.set({\n updated: value,\n phone: phone,\n imageurl: imageurl\n }).then(() => {\n //console.log('write success');\n }).catch(err => {\n console.log('error :' + err);\n });\n}", "function addLevelDBData(key,value){\n console.log('Add data to level db ' + key + ' value ' + value);\n db.put(key, value, function(err) {\n if (err) return `Block ${key} submission failed: ${err}`;\n })\n}", "function saveData(data) {\n fs.writeFileSync(TASK_STORAGE_PATH, JSON.stringify(data));\n console.log(`Saved to database.`)\n list();\n}", "function __update(url,data,callback){\n if(_debug)console.log(\"update exist document against \"+url,data);\n var req = new XMLHttpRequest();\n req.open('PATCH', url, true);\n req.setRequestHeader('Content-Type', 'application/json');\n req.setRequestHeader('Authorization', _auth);\n req.setRequestHeader('Api-Key', 'foobar');\n req.onreadystatechange = function() {\n if (req.readyState === 4) {\n if (req.status >= 200 && req.status < 400) {\n if(_debug)console.log(\"commit successfully. got callback\",JSON.parse(req.responseText),req);\n //将meta数据、提交的item数据、返回结果合并作为item,存储到本地\n /**\n var res = JSON.parse(req.responseText);\n const mergedData = {\n ...JSON.parse(_meta_item),\n ...data,\n ...res\n };\n //提交到本地:返回数据带有_key等信息\n if(_debug)console.log(\"commit successfully. got callback\",mergedData);\n __postMessage(mergedData); \n //**/ \n } else {\n // Handle error case\n }\n if(callback && typeof callback == 'function'){\n callback();\n }\n }\n };\n req.onerror = function(jqXHR, textStatus, errorThrown){\n //do nothing\n console.log(\"update document error.\",jqXHR,textStatus,errorThrown);\n }; \n try{\n delNullProperty(data)//删除其中空值,仅仅更新有数据的部分,避免数据覆盖\n //自动添加meta数据\n const mergedData = {\n ...data,\n ...JSON.parse(_meta_item)\n };\n if(data.status&&data.status.sync)mergedData.status.sync=data.status.sync;\n if(data.meta && data.meta.category)mergedData.status.classify=\"ready\";\n if(data.timestamp && data.timestamp.classify)mergedData.timestamp.classify=data.timestamp.classify; \n //if(_debug)\n console.log(\"try to send update data.\",mergedData); \n req.send(JSON.stringify(mergedData));//post data \n //提交到本地:由于网络存在中断情况,此处先提交到本地,在控制面板中显示\n //if(_debug)console.log(\"try to send local storage\",mergedData);\n //__postMessage(mergedData); \n }catch(e){\n if(_debug)console.log(\"Error while update data to create new document.\"+e);\n }\n}", "function insertNewData(){\n let datSave = {\n \"line\":1,\n \"machines\":[{\"id\":1,\"name\":\"oven 01\"},{\"id\":2,\"name\":\"creamer 01\"}],\n \"webserviceurl\":\"http://mv-webservice.test\",\n \"machid\": '2001'\n }\n\n db.insert(datSave, function(err, newDocs){\n\n });\n}", "update(data) {\n this.data = data || this.data;\n this._updateID++;\n }", "updateData(id, data, userID, _callback) {\n db.transaction(\n tx => {\n tx.executeSql('update images set photo = ?, name = ?, description = ?, price = ?, address = ? where id = ?', [data[0], data[1], data[2], data[3], data[4], id], () => {\n this.insertIntoLog(userID, \"edit data : \" + data[1] + '[' + id + ']');\n if(_callback){\n _callback();\n }\n });\n }\n );\n }", "guardarDB (){\n const payload ={\n historial: this.historial\n };\n\n fs.writeFileSync(this.dbPath, JSON.stringify(payload));\n\n }", "updateRecords() {\r\n\t\tlocalStorage.setItem( this.type, JSON.stringify(this.data) );\r\n\t}", "function saveDirtyData(){\n return tempFileService.saveDirtyData(AUTO_SAVE_FILE, true, dirtyDataCol)\n .catch(function(){\n scheduleDirtyDataSaving();\n });\n }", "function upddateRecord() {\n\n var usernameupdate = $('input:text[id=username]').val().toString();\n\n var useremailupdate = $('input:text[id=useremail]').val().toString();\n\n var useridupdate = $(\"#id\").val();\n\n db.transaction(function (tx) { tx.executeSql(updateStatement, [usernameupdate, useremailupdate, Number(useridupdate)], loadAndReset, onError); });\n \n}", "function updateData(req, res) {\n req.user_id= req.userId\n var p = config.getDB().then(function(db){\n db.collection(\"chartinsert\").update({_id:ObjectID(req.params.id)},req.body,function(err,data){\n console.log(err)\n if(err) res.status(500).json({success:false,message:'something went wrong.'})\n else{\n // console.log(data)\n res.status(200).json({success:true, message:'updated successfully'})\n }\n })\n })\n}", "function saveChangesInTable() {\n var coffee = {};\n coffee.img = document.getElementById(\"img\").value;\n coffee.name = document.getElementById(\"name\").value;\n coffee.description = document.getElementById(\"description\").value;\n coffee.price = document.getElementById(\"price\").value;\n coffee.stock = document.getElementById(\"stock\").value;\n coffee.idProdus = document.getElementById(\"idProdus\").value;\n\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n window.coffees = JSON.parse(xhttp.responseText)\n update();\n }\n };\n xhttp.open(\"PUT\", \"https://cotroccino.firebaseio.com/produse/\" + coffee.idProdus + \".json\", true);\n xhttp.send(JSON.stringify(coffee));\n}", "function update(id, data, cb){\n\t\tvar key;\n\t if (id) {\n\t key = ds.key([kind, parseInt(id, 10)]);\n\t } else {\n\t key = ds.key(kind);\n\t }\n\n\t var entity = {\n\t key: key,\n\t data: toDatastore(data, ['description', 'address', 'schedule','latitude', 'longitude', 'logo_url'])\n\t };\n\n\t ds.save(\n\t entity,\n\t function(err) {\n\t data.id = entity.key.id;\n\t cb(err, err ? null : data);\n\t }\n\t );\n\t}", "save() {\n // use. result when you might want a report about how many rows got affected\n return db.result(`\n \n update users set\n first_name='${this.firstName}',\n last_name='${this.lastName}',\n email='${this.email}',\n password='${this.password}' \n \n where id=${this.id}\n `)\n }", "function geoWrite(config, geoData) {\n // mongoose.connect(config.db);\n // var db = mongoose.connection;\n // var collection = db.collection('geo');\n // console.log(\"about to update\")\n // console.log(geoData);\n // collection.update({ _id: ObjectId(\"5773497a893c69e9b7a86dad\") }, { $push: { $each: geoData}}, function(err, result){\n // if (err){\n // console.log(err);\n // }\n // else{\n // console.log('inserted %d into the \"geo\" collection. The documents inserted with \"_id\" are: ', result.length, result);\n // }\n // db.close();\n // });\n \n jsonfile.writeFile(\"./public/geo.geojson\", geoData, {spaces: 2}, function(err){\n if (err){\n console.error(err)\n }\n });\n \n}", "function saveBorrowing() {\n retrieveValues();\n saveToServer();\n}", "save() {}", "function saveData() {\n\tstate.save();\n}", "function save(){\r\n\tconsole.log(\"Auto-saving Database..\");\r\n\tjsonfile.writeFile(\"./channels.json\", channels, function (err) {\r\n\t\tif (err){\r\n\t\t\tconsole.log(err);\r\n\t\t}\r\n\t})\r\n\tchanges=false;\r\n\tconsole.log(\"Autosave Complete\");\r\n}", "async function dbWrite(path, data) {\n const url = `https://${config.firebaseID}.firebaseio.com/${path}.json?auth=${config.firebaseSecret}`;\n try {\n const res = await axios.put(url, data)\n return res.data;\n } catch (err) {\n console.log(err.response);\n return null;\n }\n}", "updateInfo(){\r\n\r\n db.ref(\"players/player\" + this.index).set({\r\n name : this.name, distance : this.distance,rank:this.rank\r\n })\r\n\r\n }", "guardarDB() {\n fs.writeFileSync(this.dbPath, JSON.stringify(this.historial));\n }", "function writeData(st,data){\n return dbPromise\n .then(function(db){\n //here we are creating a transaction i.e setting the property where first one is the name of the store in IndexedDB while second one is type of that is \"read-write\" in this\n //here \"st\"-> is the store where we want to store data (EX-> posts)\n var tx = db.transaction(st,\"readwrite\");\n //opening the store via the transaction \"tx\" to give read-write property to the store\n var store = tx.objectStore(st);\n //to store the data in the store and the key is the one we added up in the begining \"id\" to actually store the data\n store.put(data);\n //to complete the transaction(this is performed only on write operations)\n return tx.complete;\n })\n }", "save() {\n if (this._history.length > 9){\n this._history.shift();\n }\n this._history.push(this.internalData);\n // Make the commit to setup the index and the state\n this.commit();\n }", "function editDB(){\n\t\t\t\titem_name_form = document.getElementById(\"item_name\").value;\n\t\t\t\titem_price_form = document.getElementById(\"price\").value;\n\t\t\t\titem_quantity_form = document.getElementById(\"quantity\").value;\n\t\t\t\titem_barcode_form = document.getElementById(\"barcode\").value;\n\n\t\t\t\tsessionStorage.editStatus=\"edit\";\n\t\t\t\tupdateDB(item_name_form,item_quantity_form,item_price_form,item_barcode_form)\n\t\t\t\t\t.then(function(){\n\t\t\t\t\t\tconsole.log(\"updateDB\");\n\t\t\t\t\t})\n\t\t\t\t\t.catch(function(){\n\n\t\t\t\t\t})\n\n\t\t\t}", "saveItem(event, data) {\n data = convertToLowerCase(data);\n itemsDB.insert(data, (err, newDoc) => {\n yearsDB.find({}, (err, docs) => {\n docs.forEach(doc => {\n let setupData = {\n item: newDoc._id,\n year: doc._id,\n rent: 1,\n avakHammali: 1,\n javakHammali: 1\n };\n setupsDB.insert(setupData, (err, newDoc) => {\n let response = {};\n response.error = err;\n this.mainWindow.webContents.send('saveItemResponse', response);\n });\n });\n });\n });\n }", "update(dt) {\n logID(1007);\n }", "function updateClassDB(){\n\n}", "function updateEntry(id,type){\n jsfile.readFile(dbFile,(err,data)=>{\n if(!err){\n console.log(\"Read DB Success!\");\n data[id][type] = true;\n jsfile.writeFile(dbFile,data,(err)=>{\n if(err){\n res.writeHead(200, {'Content-Type': 'text/html'});\n res.write(pug.renderFile('erro.pug',{e: \"Erro: não foi possivel escrever na Base de dados!\"}));\n res.end();\n console.log(type+\" Entry Failure!\");\n }else{\n console.log(type+\" Entry Success!\");\n }\n });\n }else{\n res.writeHead(200, {'Content-Type': 'text/html'});\n res.write(pug.renderFile('erro.pug',{e: \"Erro: na leitura da base de dados!\"}));\n res.end();\n console.log(\"Read DB Failure!\");\n }\n })\n}", "function updateData(sqlQuery, obj, callback){\r\n console.log(\"\\nSQL Query::\"+sqlQuery);\r\n connMgr.getConn(function (connection) {\r\n connection.query(sqlQuery, obj, function(err,res){\r\n if(err) throw err;\r\n if(callback)callback();\r\n console.log('Changed ' + res.changedRows + ' rows');\r\n });\r\n });\r\n}", "function saveDataIntoDB(url) {\n // Feed the database\n var dbObj = getEntityCustomData('infoKey', dataBaseID, null);\n if(dbObj) {\n var myName = MyAvatar.displayName ? MyAvatar.displayName : \"Anonymous\";\n dbObj.dbKey[dbObj.dbKey.length] = {name: myName, score: scoreAssigned, clip_url: url};\n setEntityCustomData('infoKey', dataBaseID, dbObj);\n print(\"Feeded DB: \" + url);\n }\n }", "function save_results(e_val, a_val, c_val, n_val, o_val) {\n let user_results = {\n e_val: e_val,\n a_val: a_val,\n c_val: c_val,\n n_val: n_val,\n o_val: o_val\n };\n //Get working with DB\n const url = \"/test\";\n var xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", url, true);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.send(JSON.stringify(user_results));\n}", "function adminUpdate(data) {\n\t\t\t\n\t\t\t\n\t\t}", "function writeStock(x){\n database.ref('/').update({\n Food: x\n })\n }", "write(info) {\n return writeToFile('./db/db.json', JSON.stringify(info));\n }" ]
[ "0.7118681", "0.69086725", "0.68596846", "0.68596846", "0.6843186", "0.67805845", "0.67805845", "0.67805845", "0.6686983", "0.6613339", "0.6600542", "0.6570251", "0.65692556", "0.6556991", "0.6462963", "0.6437775", "0.6428894", "0.6408294", "0.6348898", "0.63425183", "0.6342392", "0.6325422", "0.6323054", "0.6309027", "0.6287048", "0.6260289", "0.6259166", "0.62565964", "0.62540025", "0.62425655", "0.62394875", "0.6218505", "0.6187053", "0.61788577", "0.6175136", "0.6171601", "0.6168097", "0.613593", "0.61217654", "0.61130893", "0.6101606", "0.6095757", "0.60751474", "0.6058821", "0.60564744", "0.6050245", "0.60394514", "0.6037495", "0.60363024", "0.60344595", "0.6034173", "0.60276353", "0.6027323", "0.602633", "0.6022469", "0.60065424", "0.600417", "0.60017884", "0.59969467", "0.5995999", "0.5993385", "0.59859484", "0.59840065", "0.59840065", "0.5976257", "0.59751934", "0.59601885", "0.59512836", "0.59500515", "0.59477556", "0.5942206", "0.5938229", "0.5932988", "0.59190285", "0.5910143", "0.5909834", "0.5901086", "0.5897464", "0.5895748", "0.58950067", "0.58941215", "0.5889759", "0.5885472", "0.5881491", "0.5879335", "0.58755314", "0.58721954", "0.5866565", "0.58654314", "0.58508486", "0.58491445", "0.58404714", "0.58401144", "0.5833145", "0.5827025", "0.58250964", "0.58222", "0.582149", "0.58192", "0.5817175" ]
0.6025196
54
edited ready to export all
function delete_all(url_query, respond){ respond.write("<script>document.getElementById('heading').innerHTML ='Delete all movies';</script>"); my_sql_conn.connect(function(err){//doing mysql connection handshake aka test connectability if(err){ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>connection error: "+err+"</p>"); //return respond.end();//ending here } else{ // respond.write("<p>connected to db</p>"); //respond.end();//ending here } //delete table var mysql_db_table_delete ="DROP TABLE movie_table"; // console.log(mysql_db_data_add); //connect to existing db my_sql_conn_db.query(mysql_db_table_delete, function(err, results){ if(err){ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Data adding err(update write) "+err+"</p>"); return ;//respond.end();//ending here } else{ console.log(JSON.stringify(results)); // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Data added "+JSON.stringify(results)+"</p>"); // respond.write("<script>alert('Movie deleted')</script>"); create_new_table(); } } ); }); function create_new_table(){//create new empty table structure after delete my_sql_conn.connect(function(err){//doing mysql connection handshake aka test connectability if(err){ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>connection error: "+err+"</p>"); //return respond.end();//ending here } else{ // respond.write("<p>connected to db</p>"); //respond.end();//ending here } //delete table var mysql_db_create_new_table ="CREATE TABLE movie_table (movie_id int NOT NULL AUTO_INCREMENT PRIMARY KEY, m_title varchar(255), m_director varchar(255), m_producer varchar(255), m_production_company varchar(255), m_country varchar(255), m_actor varchar(255), m_genre varchar(255), m_description varchar(255), m_disclaimer varchar(255), m_image varchar(255))"; // console.log(mysql_db_data_add); //connect to existing db my_sql_conn_db.query(mysql_db_create_new_table, function(err, results){ if(err){ // respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Data adding err(update write) "+err+"</p>"); return ;//respond.end();//ending here } else{ // console.log(JSON.stringify(results)); respond.write("<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Table deleted</p>"); // respond.write("<script>alert('Movie deleted')</script>"); } } ); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "export() {\n\t\treturn {}\n\t}", "function save_and_export() {\r\n\r\n}", "function exportPuzzle(){\n \n }", "function Export_All(){\n //data_export.Export_User_Annotation_Data()\n tagging_data_export.Export_User_Annotation_Data()\n}", "onExport() {\n\t\t// you can do work before running the export using this method\n\t\t// (e.g. re-ordering paths for plotting)\n\t}", "async exportData() {\n let exportJobs = [];\n this.exportPre.extVersion = gManifestData.version;\n await bgPanda.getAllPanda(false);\n for (const key of Object.keys(bgPanda.info)) { let data = await bgPanda.dataObj(key); exportJobs.push(data); }\n this.exportPre.jobs = exportJobs.length;\n saveToFile({'pre':this.exportPre, 'jobs':exportJobs});\n bgPanda.nullData(false);\n }", "export() {\n // const log = this.entities.map(m => m.export()).join(\"\\n---------------------------\\n\");\n // let date = new Date().toDateString().replace(/\\s/g, \"-\");\n // const filename = `fvtt-log-${date}.txt`;\n // saveDataToFile(log, \"text/plain\", filename);\n }", "function comportement (){\n\t }", "getExportableObject() {\n return {\n \"Likely Diagnoses\": this.state.listA.map((row) => ({\n Name: row.snomed && row.snomed.display ? row.snomed.display : \"...\",\n \"SNOMED Code\": row.snomed && row.snomed.code ? row.snomed.code : \"...\",\n \"Note\": row.note ? row.note : \"...\"\n })),\n \"Critical Diagnoses\": this.state.listB.map((row) => ({\n Name: row.snomed && row.snomed.display ? row.snomed.display : \"...\",\n \"SNOMED Code\": row.snomed && row.snomed.code ? row.snomed.code : \"...\",\n \"Note\": row.note ? row.note : \"...\"\n })),\n Metadata: {\n // bump this every time you change the format of the export.\n // that way we can handle imports properly.\n \"Schema Version\": 1,\n },\n };\n }", "function doExport() {\n\tvar data = [];\n CiteKeys.initialize().forEach(function(item) {\n trLog('.');\n data.push(scrub(item));\n });\n\tZotero.write(JSON.stringify(data, null, \"\\t\"));\n}", "function export_vers_demande_repiquage(){\n // TODO: gestion erreurs\n // NE PAS CHANGER L'ORDRE DES PARAMETRES, NE PAS EN SUPPRIMER !!!\n ExportManager.init(\n 'Demandes', // source sheet name\n '113g_b6dqVSrTRSjRNYGKSyXMWk8oXmM4GNDTgRqhmqo', // target spreadsheet ID\n 'Demandes repiquages', // target sheet name\n // maping des champs \"source\": \"target\" séparé pas des virgules\n {\n \"Demandeur\": \"Demandeur / origine demande\",\n \"Référence échantillon demandeur\\n(N°Cl si souchotèque Ceva Biovac)\" : \"n°CL FMP12\",\n \"N° demande\" : \"N° demande\\n(si applicable)\",\n \"Labo\\n(Auto)\" : \"Labo destinataire de l'envoi\\n(si applicable)\",\n \"Milieu de repiquage\\n\\n\\n(si demande particulière)\" : \"Milieu\\n(si demande particulière)\",\n \"Condition d'incubation\\n\\n\\n(si demande particulière)\" : \"Incubation\\n(si demande particulière)\",\n \"Nb de boîtes à repiquer\\n\\n\\n(si demande particulière)\" : \"Nb de boîtes (si demande particulière)\",\n \"Souche à envoyer sous quelle forme\\n\\n\\n\\n(si analyse externe)\" : \"Repiquage sous quelle forme (si demande particulière)\",\n \"Commentaire labo bactério\" : \"Commentaires (interne labo)\",\n \"Commentaire à l'intention du service bactériologie\" : \"Commentaires demandeur\\n(si applicable)\"\n },\n //======!! make sure this field is mandatory !!!!!========\n \"A\", // column letter to detect end of data in target file\n //======!! make sure this field is mandatory !!!!!========\n \"Demandeur\", // fields to detect end of data in source file\n ['Date'], // target field filled with current date ['nom1', 'nom2'] ou [] si aucun\n // target field filled with raw text \"target_field_name\": \"text\". {} si aucun champ de type texte\n {\n \"Destination repiquage\": \"Labo bactério\"\n },\n ['Demande de repiquage', 'Validation identification\\n(Auto)'], //source field(s) that must all be true\n ['Annuler demande'], //source field(s) that must all be false \n 'export_vers_demande_repiquage', //ID unique du script pour stocker les lignes atteintes\n 'suivi ligne exportées', // header of column to store exportation status\n );\n ExportManager.run_export();\n}", "function saveNameToExportMap(index,def,exportsMap){if(exportsMap){if(def.exportAs)exportsMap[def.exportAs]=index;if(def.template)exportsMap['']=index;}}", "function disableAll(){\n\t\t\tif(exportRoot.btn_receive.visible == true){exportRoot.btn_receive.disabled = true;}\n\t\t\tif(exportRoot.btn_store.visible == true){exportRoot.btn_store.disabled = true;}\n\t\t\tif(exportRoot.btn_prep.visible == true){exportRoot.btn_prep.disabled = true;}\n\t\t\tif(exportRoot.btn_cook.visible == true){exportRoot.btn_cook.disabled = true;}\n\t\t\tif(exportRoot.btn_cool.visible == true){exportRoot.btn_cool.disabled = true;}\n\t\t\tif(exportRoot.btn_reheat.visible == true){exportRoot.btn_reheat.disabled = true;}\n\t\t\tif(exportRoot.btn_hold.visible == true){exportRoot.btn_hold.disabled = true;}\n\t\t\tif(exportRoot.btn_assemble_pack.visible == true){exportRoot.btn_assemble_pack.disabled = true;}\n\t\t\tif(exportRoot.btn_serve_sell.visible == true){exportRoot.btn_serve_sell.disabled = true;}\n\t\t}", "export() {\r\n return {\r\n name: this.name,\r\n version: this.version,\r\n scrypt: this.scrypt,\r\n accounts: this.accounts.map(acct => acct.export()),\r\n extra: this.extra\r\n };\r\n }", "protected internal function m252() {}", "function exportIt() {\n\n\t\talert('The Export-Feature is currently being implemented. When finished, it will give you a handy ZIP file which includes a standalone version of your Hypervideo.');\n\n\t}", "private internal function m248() {}", "function _saveVerticle() {\n var validColumns = [];\n var data = $scope.DataColumns;\n for (var col in $scope.DataColumns) {\n if (data[col][\"template\"] != \"label\")\n validColumns.push(data[col][\"key\"]);\n }\n var output = {};\n for (var index in validColumns) {\n var colName = validColumns[index];\n var rows = {};\n var counter = 0;\n for (var row in $scope.Data)\n rows[\"r\" + row] = $scope.Data[row][colName] ;\n output[colName] = rows;\n }\n return output;\n }", "setExport(){\n if (this.reactTable)\n this.setState({export_data: this.reactTable.getResolvedState().sortedData.map((r)=> r._original)});\n }", "transient protected internal function m189() {}", "serialize(viewer) {\n /* tslint:disable:no-any */\n let document = viewer.owner.sfdtExportModule.write();\n this.setDocument(document);\n this.mArchive = new ZipArchive();\n this.mArchive.compressionLevel = 'Normal';\n this.mVerticalMerge = new Dictionary();\n this.mGridSpans = new Dictionary();\n let contenttype;\n //document.xml\n this.serializeDocument();\n //Styles.xml\n this.serializeStyles();\n //numbering.xml\n this.serializeNumberings();\n //theme.xml\n // if (m_document.DocHasThemes && !isNullOrUndefined(m_document.Themes))\n // SerializeThemes();\n // else\n // this.serializeDefaultThemes();\n //settings.xml\n this.serializeSettings();\n //core.xml\n this.serializeCoreProperties();\n //app.xml\n this.serializeAppProperties();\n //fontTable.xml\n this.serializeFontTable(contenttype);\n //custom.xml\n // if (!isNullOrUndefined(this.wordDocument.CustomDocumentProperties) && m_document.CustomDocumentProperties.length > 0) {\n // SerializeCustomProperties();\n // }\n //Settings Relations\n this.serializeSettingsRelation();\n //Numbering relation if the document has picture bullet\n // if (PictureBullets.length > 0) {\n // SerializeNumberingsRelation();\n // }\n this.serializeHeaderFooters();\n //document relations\n this.serializeDocumentRelations();\n // // Add controls to archieve.\n // if (ControlsPathNames.length > 0) {\n // AddControlsToZip(m_document.DocxPackage);\n // }\n // if (!isNullOrUndefined(m_document.CustomUIPartContainer))\n // AddPartContainerToArchive(m_document.CustomUIPartContainer);\n // if (!isNullOrUndefined(m_document.CustomXMLContainer))\n // AddPartContainerToArchive(m_document.CustomXMLContainer);\n //general relations\n this.serializeGeneralRelations();\n //[ContentTypes].xml\n this.serializeContentTypes(contenttype);\n // Clears the internal fields maintained for serializing.\n this.clearDocument();\n }", "private public function m246() {}", "livelyPrepareSave() {\n }", "function exportAllTramites() {\n for (var tramite in vm.tramitesProceso) {\n vm.allTramitesForExport.push({\n 'Docente': vm.tramitesProceso[tramite].usuario,\n 'RFC': vm.tramitesProceso[tramite].rfc,\n 'Tramite': vm.tramitesProceso[tramite].tramite,\n 'Fecha': vm.tramitesProceso[tramite].fecha,\n 'Estatus': vm.tramitesProceso[tramite].estatus\n });\n }\n alasql('SELECT * INTO XLSX(\"ReporteTramites.xlsx\",{headers:true}) FROM ?', [vm.allTramitesForExport]);\n }", "function reset_last_line(){\n PropertiesService.getScriptProperties().setProperty(\"ExportManager.export_vers_planning_malditof\", 0);\n}", "function exports() {}", "function exports() {}", "function exports() {}", "function actionExport(name)\r\n{\r\n\tvar field = document.getElementById(name);\r\n\tvar result = [];\r\n\r\n\tif (field)\r\n\t{\r\n\t\tfor (var i = 0; i < grid.source.length; i++)\r\n\t\t\tresult[result.length] = grid.source[i].join(\"|\");\r\n\r\n\t\tfield.value = result.join(\";\");\r\n\t}\r\n}", "function accionBTN_Exportar(){\n\n\t eval(FORMULARIO).oculto = 'S';\n\t set(FORMULARIO+'.conectorAction', 'LPMantenimientoRegistroVentas');\n\t set(FORMULARIO+'.accion', 'exportarArchivo');\n\t enviaSICC(FORMULARIO, null, null, 'N');\n}", "function exportMyTramites() {\n for (var tramite in vm.listaTramitesProceso) {\n vm.myTramitesForExport.push({\n 'Docente': vm.listaTramitesProceso[tramite].usuario,\n 'RFC': vm.listaTramitesProceso[tramite].rfc,\n 'Tramite': vm.listaTramitesProceso[tramite].tramite,\n 'Fecha': vm.listaTramitesProceso[tramite].fecha,\n 'Estatus': vm.listaTramitesProceso[tramite].estatus\n });\n }\n alasql('SELECT * INTO XLSX(\"ReporteTramites.xlsx\",{headers:true}) FROM ?', [vm.myTramitesForExport]);\n }", "function ExportSave() {\n Gameboy.Core.exportSave();\n}", "transient private protected internal function m182() {}", "updatedContentsFor(file) {\n this.activeImports.forEach((item) => item.resetCompiled())\n }", "async dump() {\n return /* @TODO delegate to in-memory spreadsheet */ []; \n }", "export() {\n // create the export ob\n let expOb = { panes: [] }\n let rnames = Object.keys(this.panes[0].dataForPlot)\n let csvData = []\n let csvString = \"regionname\"\n let i = 0\n // iterate over the panes\n for (let pane of this.panes) {\n // collect the relevant information\n // omit the boundary file\n let { regionBoundaryData, application, ...rest } = pane\n rest.ta = pane.ta.value\n expOb.panes.push(rest)\n csvData.push(Object.values(pane.dataForPlot))\n csvString += \",pane\" + i\n i += 1\n }\n let a = document.createElement(\"a\")\n let today = new Date()\n let datename = `neuro_choropleth_session_${today.getFullYear()}_${today.getMonth()}_${today.getDate()}_${today.getHours()}_${today.getSeconds()}`\n a.download = datename + \".json\" // note that the date elements start with 0 so december is going to be tthe 11th month, and jan is the 0th\n a.href = URL.createObjectURL(new Blob([JSON.stringify(expOb)]))\n a.click()\n // csv download\n // make header with pane listing\n csvString += \"\\n\"\n for (let i = 0; i < rnames.length; i++) {\n csvString += `${rnames[i]}`\n for (let j = 0; j < csvData.length; j++) {\n csvString += `,${csvData[j][i].toFixed(3)}`\n }\n csvString += \"\\n\"\n }\n a.download = datename + \".csv\"\n a.href = URL.createObjectURL(new Blob([csvString]))\n a.click()\n\n\n }", "static dumpAll() {\n Recycler.depot = {};\n }", "function chooseExports() {\n $('Exports').addClassName('selected');\n $('Sources').removeClassName('selected');\n $('plottype').value = 'Exports';\n $('coal').enable();\n $('coal_span').setOpacity(1.0).removeClassName('selected');\n $('oil').enable();\n $('oil').checked = true;\n $('oil_span').setOpacity(1.0).removeClassName('selected');\n $('gas').enable();\n $('gas_span').setOpacity(1.0).removeClassName('selected');\n $('nuclear').enable();\n $('nuclear_span').setOpacity(1.0).removeClassName('selected');\n $('hydro').enable();\n $('hydro_span').setOpacity(1.0).removeClassName('selected');\n $('all').disable();\n $('all_span').setOpacity(0.3).removeClassName('selected');\n\n changeAdvancedOptions();\n chooseOil();\n}", "function exportRec() {\r\n\t\t// Ext.Ajax.request({\r\n\t\t// url : 'manageplan/getPlanGatherQueryList.action',\r\n\t\t// params : {\r\n\t\t// planTime : planDate.getValue(),\r\n\t\t// editDepcode : editDepcode.getValue(),\r\n\t\t// planType : planTypeCombobox.getValue()\r\n\t\t// },\r\n\t\t// success : function(response) {\r\n\t\t// var json = eval('(' + response.responseText.trim() + ')');\r\n\t\t// var records = json.list;\r\n\t\t// //alert(records.length)\r\n\t\t// var html = ['<table\r\n\t\t// border=1><tr><th>部门</th><th>培训类别</th><th>培训项目计划</th><th>计划人数</th><th>培训课时</th><th>负责人</th></tr>'];\r\n\t\t// for (var i = 0; i < records.length; i += 1) {\r\n\t\t// var rc = records[i];\r\n\t\t// html.push('<tr><td>' + rc.deptName + '</td><td>'\r\n\t\t// + rc.planTypeName + '</td><td>' + rc.trainDetail.trainingName\r\n\t\t// + '</td><td>' + rc.trainDetail.trainingNumber + '</td><td>'\r\n\t\t// + rc.trainDetail.trainingHours + '</td><td>' +\r\n\t\t// rc.trainDetail.chargeBy\r\n\t\t// + '</td></tr>');\r\n\t\t// }\r\n\t\t// html.push('</table>');\r\n\t\t// html = html.join(''); // 最后生成的HTML表格\r\n\t\t// // alert(html);\r\n\t\t// tableToExcel(html);\r\n\t\t// },\r\n\t\t// failure : function(response) {\r\n\t\t// Ext.Msg.alert('信息', '失败');\r\n\t\t// }\r\n\t\t// });\r\n\t\tvar month = planDate.getValue().substring(0, 4) + \"-\"\r\n\t\t\t\t+ planDate.getValue().substring(5, 7);\r\n\t\tvar url = \"/powerrpt/frameset?__report=bqmis/itemPlanDep.rptdesign\";\r\n\t\turl += \"&__action=print&month=\" + month + \"&__format=xls\";\r\n\t\twindow.open(url);\r\n\t}", "transient private internal function m185() {}", "function prepExportStructures(options) {\n // set up the 'option' `exportAllTables` as a hash object for returning\n // all generated tables to the caller\n var exportDest = options.exportAllTables;\n if (!exportDest || (typeof exportDest === 'undefined' ? 'undefined' : _typeof(exportDest)) !== 'object') {\n exportDest = {\n enabled: !!exportDest\n };\n } else if (typeof exportDest.enabled !== 'boolean') {\n exportDest.enabled = true;\n }\n options.exportAllTables = exportDest;\n\n // set up the 'option' `exportSourceCode` as a hash object for returning\n // all generated source code chunks to the caller\n var exportSourceCode = options.exportSourceCode;\n if (!exportSourceCode || (typeof exportSourceCode === 'undefined' ? 'undefined' : _typeof(exportSourceCode)) !== 'object') {\n exportSourceCode = {\n enabled: !!exportSourceCode\n };\n } else if (typeof exportSourceCode.enabled !== 'boolean') {\n exportSourceCode.enabled = true;\n }\n options.exportSourceCode = exportSourceCode;\n}", "_getExportModel() {\n const model = _.cloneDeep(this.getModel());\n Object.values(model.cells)\n .forEach(cell => {\n if(cell.vertex && cell.data) {\n cell.data = JSON.stringify(cell.data);\n }\n });\n return model;\n }", "transient final protected internal function m174() {}", "createComponentList () {\n this.transformedContent = this.transformedContent.replace(\n utils.regExp.exportStatement,\n '$1\\n' \n + this.componentsIndentSpace \n + 'components: {\\n' \n + this.componentsIndentSpace + ' ' \n + this.quasarComponents.join(',\\n' + this.componentsIndentSpace + ' ') \n + '\\n' \n + this.componentsIndentSpace \n + '},\\n'\n );\n }", "function excelReportFinal(){\n\t\t\t\t\t\texcelReportSummaryByBillingModes();\n\t\t\t\t\t}", "function Paper_format_other(){\n\n}", "updateData(result) {\n let removeIndex = [];\n let mapIndex = -1;\n\n // checks to see if the file \"result\" is a JS mapping file, this file always starts with Start::::\n if (\n Object.keys(result.data[0])[0].includes(\n \"Mapping file created by Mars Map Maker\"\n )\n ) {\n let finalStr = \"\";\n let needsCenturyPrefix = false;\n\n // JS mapping file has a section \"let map...\" which is where we want to retrieve our sesar selections and clean the data\n let jsArr = [];\n let prefix = \"\";\n let dateIdArr = [];\n let dateIdentified = false;\n // start pushing is where we find \"let map...\" and start reading\n let startPushing = false;\n let addToForceEdit = false;\n let forceEditValueTitleArr = [];\n let forceEditValueContentArr = [];\n\n if (JSON.stringify(Object.values(result.data[0])).includes(\"forceEdit\")) {\n addToForceEdit = true;\n }\n\n // parsing out a javascript file\n for (let i = 1; i < result.data.length - 1; i++) {\n if (\n JSON.stringify(Object.values(result.data[i])).includes(\"forceEdit\") &&\n JSON.stringify(Object.values(result.data[i])).includes(\"const\")\n ) {\n addToForceEdit = true;\n }\n\n if (addToForceEdit === true) {\n if (\n JSON.stringify(Object.values(result.data[i])).includes(\n \"mapMakerHeader\"\n )\n ) {\n let forceEditValue = JSON.stringify(\n Object.values(result.data[i])\n ).split(\" \");\n forceEditValueTitleArr.push(\n forceEditValue[forceEditValue.length - 1].substring(\n 2,\n forceEditValue[3].length - 4\n )\n );\n }\n if (\n JSON.stringify(Object.values(result.data[i])).includes(\"return\")\n ) {\n let forceEditValue = JSON.stringify(\n Object.values(result.data[i])\n ).split(\" \");\n let trimmedForceEditValue = forceEditValue.slice(3).join(\" \");\n forceEditValueContentArr.push(\n trimmedForceEditValue.substring(\n 2,\n trimmedForceEditValue.length - 5\n )\n );\n addToForceEdit = false;\n }\n }\n\n if (\n JSON.stringify(Object.values(result.data[i - 1])[0])\n .replace(/(\\r\\n|\\n|\\r)/gm, \"\")\n .includes(\"let map\")\n ) {\n if (\n !(\n JSON.stringify(Object.values(result.data[i - 1])[0])\n .replace(/(\\r\\n|\\n|\\r)/gm, \"\")\n .includes(\"}\") ||\n JSON.stringify(Object.values(result.data[i - 1])[0])\n .replace(/(\\r\\n|\\n|\\r)/gm, \"\")\n .includes(\"return\")\n )\n )\n mapIndex = i;\n startPushing = true;\n } else if (\n JSON.stringify(Object.values(result.data[i - 1])[0])\n .replace(/(\\r\\n|\\n|\\r)/gm, \"\")\n .includes(\"const scrippsDate\")\n ) {\n dateIdentified = true;\n } else if (\n JSON.stringify(Object.values(result.data[i - 1])[0])\n .replace(/(\\r\\n|\\n|\\r)/gm, \"\")\n .includes(\"}\")\n ) {\n startPushing = false;\n } else if (\n JSON.stringify(Object.values(result.data[i])[0])\n .replace(/(\\r\\n|\\n|\\r)/gm, \"\")\n .includes(\"return y\")\n ) {\n dateIdentified = false;\n }\n\n let arr;\n\n if (startPushing === true) {\n this.startPushingHelper(\n result,\n i,\n jsArr,\n mapIndex,\n forceEditValueContentArr\n );\n } else if (dateIdentified === true) {\n if (Object.values(result.data[i])[0].includes(\"y\")) {\n arr = Object.values(result.data[i])[0].split(\" \");\n prefix = arr[7];\n }\n // create array of the JS mapping file already selected date numbers\n if (Object.values(result.data[i])[0].includes(\"y\")) {\n arr = Object.values(result.data[i])[0].split(\" \");\n dateIdArr.push(arr[arr.length - 1].match(/[0-9]+/g)[0]);\n dateIdArr.push(\n Object.values(result.data[i])[1][0].match(/[0-9]+/g)[0]\n );\n } else {\n dateIdArr.push(\n Object.values(result.data[i])[0].match(/[0-9]+/g)[0]\n );\n dateIdArr.push(\n Object.values(result.data[i])[1][0].match(/[0-9]+/g)[0]\n );\n }\n }\n\n if (dateIdArr.length === 6) {\n // create a string of the date number array above\n // use that string to identify the finalStr to display automatically in the date dropdown\n\n let dateFormatStr = dateIdArr.join(\"\");\n switch (dateFormatStr) {\n case \"046242\":\n finalStr = \"YYYYMMDD\";\n break;\n case \"044262\":\n finalStr = \"YYYYDDMM\";\n break;\n case \"440222\":\n finalStr = \"DDMMYYYY\";\n break;\n case \"442202\":\n finalStr = \"MMDDYYYY\";\n break;\n case \"048252\":\n finalStr = \"YYYY/MM/DD\";\n break;\n case \"045282\":\n finalStr = \"YYYY/DD/MM\";\n break;\n case \"643202\":\n finalStr = \"MM/DD/YYYY\";\n break;\n case \"640232\":\n finalStr = \"DD/MM/YYYY\";\n break;\n case \"026232\":\n //prefix = this.props.centuryChosen.substr(0, 2)\n finalStr = \"YY/MM/DD or YY-MM-DD\";\n needsCenturyPrefix = true;\n break;\n case \"623202\":\n finalStr = \"MM/DD/YY or MM-DD-YY\";\n needsCenturyPrefix = true;\n //prefix = this.props.centuryChosen.substr(0, 2)\n break;\n case \"023262\":\n //prefix = this.props.centuryChosen.substr(0, 2)\n finalStr = \"MM/DD/YY or MM-DD-YY\";\n needsCenturyPrefix = true;\n break;\n case \"620232\":\n finalStr = \"DD/MM/YY or DD-MM-YY\";\n needsCenturyPrefix = true;\n //prefix = this.props.centuryChosen.substr(0, 2)\n break;\n default:\n }\n }\n\n if (needsCenturyPrefix === true) {\n const newValue = prefix + \"00\";\n const obj = {\n chosenCentury: newValue\n };\n\n this.props.century(obj);\n }\n\n let newJSArr = [];\n // any identical elements in jsArr, only append them once into newJSArr\n\n for (let i = 0; i < jsArr.length; i++) {\n if (!newJSArr.includes(jsArr[i])) {\n newJSArr.push(jsArr[i]);\n }\n }\n jsArr = newJSArr;\n }\n // call dateFormat\n const obj = {\n dateFormat: finalStr,\n hasTwoYs: needsCenturyPrefix\n };\n this.props.formatDate(obj);\n\n // more string cleaning\n // some of the cleaning in the code could be a little smoother with one regex, but some of the symbols we're a little more complicating so handled as strings\n for (let i = 0; i < jsArr.length; i++) {\n jsArr[i] = jsArr[i].replace(/(|\\r\\n|\\s|})/gm, \"\");\n jsArr[i] = jsArr[i].replace(\"}\", \"\");\n jsArr[i] = jsArr[i].replace(/\\\\/g, \"\");\n jsArr[i] = jsArr[i].replace(/\"/g, \"\");\n jsArr[i] = jsArr[i].replace(\" \", \"\");\n if (jsArr[i] !== \"\") {\n jsArr[i] = jsArr[i].split(\":\");\n jsArr[i][0] = jsArr[i][0].replace(\" \", \"\");\n if (jsArr[i][1] !== undefined)\n jsArr[i][1] = jsArr[i][1].replace(\" \", \"\");\n } else removeIndex.push(i);\n }\n // removes any empty strings as elements in the jsArr\n for (let i = 0; i < removeIndex.length; i++) {\n jsArr.splice(removeIndex[i], 1);\n }\n\n let addForceEditValues = jsArr;\n let forceEditValuesCount = 0;\n for (let i = 0; i < addForceEditValues.length; i++) {\n if (\n addForceEditValues[i][1] === \"<METADATA_ADD>\" ||\n addForceEditValues[i][1] === \"<METADATA>\"\n ) {\n addForceEditValues[i][1] =\n forceEditValueTitleArr[forceEditValuesCount];\n forceEditValuesCount++;\n }\n }\n\n this.setState({\n jsFile: addForceEditValues,\n includesJsFile: true,\n isJsFile: true,\n forceEditTitles: forceEditValueTitleArr,\n forceEditValues: forceEditValueContentArr\n });\n }\n\n // this is where we combine objects if there are multiple csv's for the purpose of being able to toggle through tuples of both files\n // we limit the number of toggles but the minimum size of the files (Ex: CSV1.length = 3 && CSV2.length = 10, then user can toggle through 3 times)\n var data = result;\n let finalToggleArray = [];\n let toggleArr = this.state.toggleValues;\n let minimum = Math.min(data.data.length, toggleArr.length);\n if (this.state.isJsFile === false) {\n if (\n toggleArr.length !== 0 &&\n (this.state.files[1] !== undefined || this.state.files[2] !== undefined)\n ) {\n if (minimum < 10) {\n for (let i = 0; i < minimum % 10; i++) {\n const finalObj = { ...toggleArr[i], ...data.data[i] };\n finalToggleArray.push(finalObj);\n }\n } else {\n for (let i = 0; i < (minimum % 10) + (10 - (minimum % 10)); i++) {\n const finalObj = { ...toggleArr[i], ...data.data[i] };\n finalToggleArray.push(finalObj);\n }\n }\n toggleArr = finalToggleArray;\n } else if (toggleArr.length === 0) {\n toggleArr = toggleArr.concat(data.data);\n }\n\n this.setState({\n toggleValues: toggleArr,\n totalFileSize:\n this.state.totalFileSize + Object.keys(data.data[0]).length,\n fieldNames: this.state.fieldNames.concat(Object.keys(data.data[0])),\n fieldValues: this.state.fieldValues.concat(Object.values(data.data[0]))\n });\n }\n\n let arr = [this.state.fieldNames, this.state.fieldValues];\n\n // we want to make sure that we have handled all CSV's and JS files before we use the callback function\n this.setState({ num: this.state.num + 1 });\n if (this.state.num === this.state.files.length - 1) {\n //change totalAddedCards to change how many entries of METADATA_ADD/missing field are in the store\n let totalAddedCards = 4;\n\n this.props.callbackFromParent(\n arr,\n this.state.totalFileSize,\n this.state.toggleValues,\n this.state.jsFile,\n totalAddedCards,\n this.state.forceEditTitles,\n this.state.forceEditValues\n );\n }\n\n // this function checks every file to see if it is a JS or CSV file, if JS certain parts of the code are ignored, if CSV the same applies\n this.setState({ isJsFile: false });\n }", "SaveAndReimport() {}", "function prepExportStructures(options) {\n // set up the 'option' `exportAllTables` as a hash object for returning\n // all generated tables to the caller\n var exportDest = options.exportAllTables;\n if (!exportDest || typeof exportDest !== 'object') {\n exportDest = {\n enabled: !!exportDest\n };\n } else if (typeof exportDest.enabled !== 'boolean') {\n exportDest.enabled = true;\n }\n options.exportAllTables = exportDest;\n\n // set up the 'option' `exportSourceCode` as a hash object for returning\n // all generated source code chunks to the caller\n var exportSourceCode = options.exportSourceCode;\n if (!exportSourceCode || typeof exportSourceCode !== 'object') {\n exportSourceCode = {\n enabled: !!exportSourceCode\n };\n } else if (typeof exportSourceCode.enabled !== 'boolean') {\n exportSourceCode.enabled = true;\n }\n options.exportSourceCode = exportSourceCode;\n}", "function exportCode(e,jc,tabs) {\n var code = tabs.getCode();\n var expt = jc.exportCode(code);\n var title = 'project';\n var blob = new Blob([expt], {'type':'text/plain'});\n if (typeof window.navigator.msSaveBlob === 'function') {\n\twindow.navigator.msSaveBlob(blob, title + '.js');\n } else {\n\tvar a = $(e.currentTarget);\n\ta.attr('href', window.URL.createObjectURL(blob));\n\ta.attr('download', title + '.js');\n }\n return false;\n}", "transient final private protected internal function m167() {}", "toExport() {\n var output = \"Order,xPos,yPos,zPos,HTurned\\n\";\n for (var index in this.container.goods) {\n var g = this.container.goods[index];\n var r = 0;\n if (g.isRotated) {\n r = 1;\n }\n output += g.group + \",\" + g.x + \",\" + g.y + \",\" + g.z + \",\" + r + \"\\n\";\n }\n return output;\n }", "reportExport(){\n bcdui.component.exports.exportWysiwygAsExcel({rootElement: this.gridRenderingTarget});\n }", "function firstExportStep() {\n\t\t\t// debug('\\n firstExportStep - START');\n\n\t\t\t// Add metadata\n\t\t\tvar md = _GP.metadata;\n\t\t\tvar ps = _GP.projectsettings;\n\n\t\t\toptions.unitsPerEm = ps.upm || 1000;\n\t\t\toptions.ascender = ps.ascent || 0.00001;\n\t\t\toptions.descender = (-1 * Math.abs(ps.descent)) || -0.00001;\n\t\t\toptions.familyName = (md.font_family) || ' ';\n\t\t\toptions.styleName = (md.font_style) || ' ';\n\t\t\toptions.designer = (md.designer) || ' ';\n\t\t\toptions.designerURL = (md.designerURL) || ' ';\n\t\t\toptions.manufacturer = (md.manufacturer) || ' ';\n\t\t\toptions.manufacturerURL = (md.manufacturerURL) || ' ';\n\t\t\toptions.license = (md.license) || ' ';\n\t\t\toptions.licenseURL = (md.licenseURL) || ' ';\n\t\t\toptions.version = (md.version) || 'Version 0.001';\n\t\t\toptions.description = (md.description) || ' ';\n\t\t\toptions.copyright = (md.copyright) || ' ';\n\t\t\toptions.trademark = (md.trademark) || ' ';\n\t\t\toptions.glyphs = [];\n\n\t\t\t// debug('\\t NEW options ARG BEFORE GLYPHS');\n\t\t\t// debug(options);\n\t\t\t// debug('\\t options.version ' + options.version);\n\n\t\t\t// Add Notdef\n\t\t\tvar notdef = new Glyph({'name': 'notdef', 'shapes':JSON.parse(_UI.notdefglyphshapes)});\n\t\t\tif(_GP.upm !== 1000){\n\t\t\t\tvar delta = _GP.upm / 1000;\n\t\t\t\tnotdef.updateGlyphSize(delta, delta, true);\n\t\t\t}\n\n\t\t\tvar ndpath = notdef.makeOpenTypeJSpath();\n\n\t\t\toptions.glyphs.push(new opentype.Glyph({\n\t\t\t\tname: '.notdef',\n\t\t\t\tunicode: 0,\n\t\t\t\tindex: getNextGlyphIndex(),\n\t\t\t\tadvanceWidth: round(notdef.getAdvanceWidth()),\n\t\t\t\txMin: round(notdef.maxes.xmin),\n\t\t\t\txMax: round(notdef.maxes.xmax),\n\t\t\t\tyMin: round(notdef.maxes.ymin),\n\t\t\t\tyMax: round(notdef.maxes.ymax),\n\t\t\t\tpath: ndpath\n\t\t\t}));\n\n\t\t\t// debug(' firstExportStep - END\\n');\n\t\t}", "function ExportReportData() {\n BindOrReloadPurchaseTable('Export');\n}", "saveAsMultipleFiles() {\r\n // Load the needed data for text file exportation\r\n let head = this.editorHTML.getValue().substr(0, this.editorHTML.getValue().indexOf('</head>')-1)\r\n let style = '\\n\\t<link rel=\"stylesheet\" href=\"style.css\">'\r\n let chead = '\\n</head>\\n'\r\n let bodyTag = this.editorHTML.getValue().indexOf('<body>')\r\n let bodyLines = this.editorHTML.getValue().substr(bodyTag)\r\n let html = bodyLines.substr(0, bodyLines.length-15)\r\n let script = '\\t<script src=\"script.js\"></script>\\n'\r\n let endDoc = '</body>\\n</html>'\r\n \r\n let todo = head\r\n \r\n // CSS exportation\r\n if (this.editorCSS.getValue().length > 0) {\r\n todo += style\r\n this.saveFile('style', 'CSS', this.editorCSS.getValue())\r\n }\r\n\r\n todo += chead\r\n todo += html\r\n\r\n // JS exportation\r\n if (this.editorJS.getValue().length > 0) {\r\n todo += script\r\n this.saveFile('script', 'JS', this.editorJS.getValue())\r\n }\r\n\r\n todo += endDoc\r\n\r\n // HTML exportation\r\n this.saveFile('index', 'HTML', todo)\r\n // We show the export result\r\n setTimeout(this.showOutput, 2500)\r\n\r\n }", "function ExportedMethods () {\n}", "function ExportedMethods () {\n}", "if (product.productType && product.productType !== lastProductType) {\n lastProductType = product.productType\n lastExport = exportByProductType[lastProductType]\n\n // if we haven't started exporting this productType yet\n if (!lastExport) {\n // generate a temp file name\n const fileName: string = `${slugify(product.productType)}.xlsx`\n const filePath: string = path.join(tmpDir, fileName)\n\n // create headers and file stream\n lastExport = {\n productType: lastProductType,\n headers: mapHeaders(Object.keys(product)),\n excel: new ProductExcel(fs.createWriteStream(filePath)),\n }\n\n // write a header row to XLSX file\n const headerNames: Array<string> = lastExport.headers.map(\n (header) => header.label\n )\n lastExport.excel.writeHeader(headerNames)\n\n // register new export in cache\n exportByProductType[lastProductType] = lastExport\n }\n }", "function WorkbookAllModule(){Workbook.Inject(DataBind,WorkbookSave,WorkbookNumberFormat,WorkbookCellFormat,WorkbookEdit,WorkbookFormula,WorkbookOpen,WorkbookSort,WorkbookHyperlink,WorkbookFilter,WorkbookInsert,WorkbookDelete,WorkbookFindAndReplace,WorkbookProtectSheet,WorkbookDataValidation,WorkbookMerge,WorkbookConditionalFormat,WorkbookImage,WorkbookChart);}", "function update() {\n\t\tfilterName = $(\"#new_pipeline #filterName\");\n\t\trequestType = $(\"#new_pipeline #requestType\");\n\t\trequestRank = $(\"#new_pipeline #requestRank\");\n\t\tmakeTrace = $(\"#new_pipeline #makeTrace\");\n\t\ttips = $(\"#new_pipeline .validateTips\");\n\t\tallFields = $([]).add(filterName).add(requestType).add(requestRank).add(makeTrace);\n\t}", "function main() { //入口函数\n\tvar docName = '',\n\t\tdupDoc,\n\t\texportInfo = {},\n\t\tlayerCount = 0,\n\t\tlayerSetsCount = 0;\n\n\tif (app.documents.length <= 0) {\n\t\tif (DialogModes.NO != app.playbackDisplayDialogs) {\n\t\t\talert(strAlertDocumentMustBeOpened);\n\t\t}\n\t\treturn 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script\n\t}\n\n\tinitExportInfo(exportInfo);\n\n\t// kpedt this was where descriptorToObject calls were in 'Export layers to files.jsx'\n\n\tif (DialogModes.ALL == app.playbackDisplayDialogs) {\n\t\tif (cancelButtonID == settingDialog(exportInfo)) {\n\t\t\treturn 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script\n\t\t}\n\t}\n\n\ttry {\n\n\t\tdocName = app.activeDocument.name; // save the app.activeDocument name before duplicate.\n\n\t\tlayerCount = app.documents[docName].layers.length;\n\t\tlayerSetsCount = app.documents[docName].layerSets.length;\n\n\t\tif ((layerCount <= 1) && (layerSetsCount <= 0)) {\n\n\t\t\tif (DialogModes.NO != app.playbackDisplayDialogs) {\n\t\t\t\talert(strAlertNeedMultipleLayers);\n\t\t\t\treturn 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script\n\t\t\t}\n\t\t} else {\n\n\t\t\tapp.activeDocument = app.documents[docName];\n\n\t\t\tsetExportHeader(app.activeDocument, exportInfo);\n\n\t\t\tdupDoc = app.activeDocument.duplicate();\n\n\t\t\tungroupAllLayerSets(dupDoc);\n\n\t\t\tremoveInvisibleArtLayers(dupDoc);\n\n\t\t\tdupDoc.activeLayer = dupDoc.layers[dupDoc.layers.length - 1];\n\n\t\t\tsetInvisibleAllArtLayers(dupDoc);\n\t\t\texportChildren(dupDoc, exportInfo);\n\t\t\tdupDoc.close(SaveOptions.DONOTSAVECHANGES);\n\n\t\t\tif (DialogModes.ALL == app.playbackDisplayDialogs) {\n\n\t\t\t\twriteTxtFiles();\n\t\t\t\tapp.preferences.rulerUnits = originalUnit;\n\n\t\t\t\talert('导出IMG/CSS/HTML' + strAlertWasSuccessful);\n\t\t\t}\n\n\t\t\tapp.playbackDisplayDialogs = DialogModes.ALL;\n\t\t}\n\n\t} catch (e1) {\n\t\tif (DialogModes.NO != app.playbackDisplayDialogs) {\n\t\t\talert(e1);\n\t\t}\n\n\t\tapp.preferences.rulerUnits = originalUnit;\n\n\t\treturn 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script\n\t}\n}", "function exportExcel(alreadyHere=undefined, summarySheet=undefined){\n\n var newsPaper_data = [];\n let ws_data = [];\n let totalNb = 0;\n let totalMoney = 0;\n let totalCmd = 0;\n let percentageId = -1; // To decrease complexity\n\n if(summarySheet != undefined){\n newsPaper_data = summarySheet;\n }\n else{\n newsPaper_data.push([\"Jour\", \"Nombre\", \"Prix\"]);\n }\n \n if(alreadyHere != undefined){\n ws_data = alreadyHere;\n\n // HARD CODED for the '6' and the rest\n totalCmd = Number(ws_data[1][6]);\n ws_data[1] = ws_data[1].slice(0, 4);\n\n for(let i=0; i<ws_data.length; i++){\n if(ws_data[i][0] == \"TOTAL\"){\n totalNb = Number(ws_data[i][1]);\n totalMoney = Number(ws_data[i][3]);\n ws_data.length = i-1;\n break;\n }\n }\n\n ws_data.shift(); // Removes title row\n }\n \n // loop through commands\n for(let item in getData()){\n if(item[0] == 'C'){\n let obj = JSON.parse(getData(item));\n\n // Check that the time of the command is superior to the last save time\n if(obj[\"time\"] === undefined || getData(\"lastSave\") > Date.parse(obj[\"time\"])){\n continue;\n }\n\n if(obj[\"modified\"] !== undefined){\n console.log(\"MODIFIED\");\n if(isEmpty(obj[\"modified\"])){\n continue;\n }\n else{\n let newObj = JSON.parse(JSON.stringify(obj));\n delete newObj[\"modified\"];\n obj = obj[\"modified\"];\n saveData(item, JSON.stringify(newObj));\n console.log(obj);\n }\n }\n\n totalCmd++;\n let remise = 0;\n let normalSum = 0;\n let percentagedSum = 0;\n\n for(let key in obj){\n try{\n let thisName = \"\";\n let thisCost = 0;\n let isPercentaged = false;\n\n if(isNaN(key)){\n // Check whether it is a payment mode or not\n if(key[0] != key[0].toUpperCase()){\n continue;\n }\n\n console.log(\"real shit\", key);\n let meal;\n\n if(key.includes('M')){\n meal = key.match(/(M)\\d+/)[0].substring(1);\n\n isPercentaged = true;\n thisName = \"Menu \" + products[meal][3][2];\n thisCost = products[meal][3][1] * obj[key];\n if(key.includes('B')){\n thisName += \" + Boisson\";\n thisCost += (products[ key.match(/(B)\\d+/)[0].substring(1) ][1] - 0.5) * obj[key];\n }\n }\n else if(key.includes('F')){\n meal = key.match(/(F)\\d+/)[0].substring(1);\n \n isPercentaged = true;\n thisName = \"Formule \" + products[meal][3][2];\n thisCost = products[meal][3][0] * obj[key];\n }\n else{\n console.log(\"HU HO !!!\");\n }\n }\n else{\n // If it is a remise in %\n if(products[key][1] < 0 && products[key][3] === 'P'){\n remise = obj[key];\n }\n else{\n // If it is a: meal || dessert || starter || drink\n if((products[key].length === 4 && products[key][1] > 0 && products[key][3] != 'M') || products[key][2] === 1){\n isPercentaged = true;\n }\n\n thisCost = products[key][1] * obj[key];\n thisName = products[key][0];\n\n // If it is a newsPaper\n if(products[key].length === 4 && products[key][3] == 'M'){\n newsPaper_data[1][1] += obj[key];\n newsPaper_data[2][1] += thisCost;\n }\n }\n }\n\n if(!(products[key] !== undefined && products[key].length>3 && products[key][3] == 'P')){ // To check if it's a percentaged\n let id = isItHere(thisName);\n\n if(id != -1){\n ws_data[id][1] = Number(ws_data[id][1])+Number(obj[key]);\n ws_data[id][3] = Number(ws_data[id][3])+Number(thisCost);\n }\n else{\n ws_data.push([thisName, obj[key], thisCost/obj[key], thisCost]);\n }\n\n if(isPercentaged){\n percentagedSum += thisCost;\n }\n else{\n normalSum += thisCost;\n }\n\n if(thisCost > 0){\n totalNb++;\n }\n }\n }\n catch(err){\n console.log(err);\n }\n }\n\n if(remise > 0){\n let reduc = percentagedSum/100*Math.abs(remise);\n\n if(percentageId != -1){\n ws_data[percentageId][1] += 1;\n ws_data[percentageId][3] -= reduc;\n }\n else{\n percentageId = ws_data.push([products[0][0], 1, -1, -reduc])-1;\n }\n\n totalMoney += normalSum + percentagedSum - reduc;\n }\n else{\n totalMoney += normalSum + percentagedSum;\n }\n }\n }\n\n ws_data.sort(sortCommand);\n ws_data.unshift(['Plats par popularités' , 'Nombre de produits', 'Coût seul', 'Coût total', '', 'Ticket moyen', 'Nombre de repas']);\n ws_data.push([], ['TOTAL', totalNb, \"\", totalMoney]);\n if(ws_data[1] != undefined){\n ws_data[1].push(\"\", coolRound(totalMoney/totalCmd), totalCmd);\n }\n \n function isItHere(thisName){\n let id = -1;\n for(let i=0; i<ws_data.length; i++){\n if(ws_data[i][0] == thisName){\n id = i;\n break;\n }\n }\n return id;\n }\n function sortCommand(a, b) {\n if(a[2] < 0){\n return 1;\n }\n else if(b[2] < 0){\n return -1;\n }\n if (a[1] === b[1]) {\n if(a[2] === b[2]){\n return 0;\n }\n else{\n return (a[2] < b[2]) ? 1 : -1;\n }\n }\n else {\n return (a[1] < b[1]) ? 1 : -1;\n }\n }\n\n saveData(\"lastSave\", Date.now());\n console.log(\"Finish\", ws_data);\n return [ws_data, newsPaper_data];\n}", "function doExport() {\n\tvar item;\n\twhile(item = Zotero.nextItem()) {\n\t\t\n\t\tvar creatorsS = item.creators[0].lastName;\n\t\t\t\tif (item.creators.length>2)\n\t\t\t\t\tcreatorsS += \" et al.\";\n\t\t\t\telse if (item.creators.length==2)\n\t\t\t\t\tcreatorsS += \" and \" + item.creators[1].lastName;\n\t\t\n\t\tvar date = Zotero.Utilities.strToDate(item.date);\n\t\tvar dateS = (date.year) ? date.year : item.date;\n\t\t\n\t\tvar titleS = (item.title) ? item.title.replace(/&/g,'&amp;').replace(/\"/g,'&quot;') : \"(no title)\";\n\t\t\n\t\tZotero.write(\"Zotero PDF(s):: [\" + creatorsS + '_' + dateS + \"_\" + titleS + \"]\" + \"(zotero://open-pdf/library/items/\"+item.key+\")\");\n\t}\n}", "exportBitmap(selectedLines){\n \n // This is the default, will try to look at selected lines and \n // see if var name that can be used. If one can be used, will\n // overwrite and not output framebuffer line\n var varName = \"bitmap\";\n var foundName = false; // Used to set true so framebuffer line not output if name found\n\n // String that holds all export information for editor\n var str = \"\";\n\n // If selected lines doesn't equal any of the below, and there is only one equals sign \n // (meaning just the array selected) then use existing name from editor (splits into 2 elements)\n // Also ensure no newlines before the equals because that means user has selected line before name\n // and now don't know where start of name is otherwise\n if( selectedLines != undefined && selectedLines != \"\" && \n selectedLines != \" \" && selectedLines != \"\\n\" && \n selectedLines.indexOf('=') != -1 && selectedLines.split(\"=\").length == 2 && \n (selectedLines.indexOf('\\n') == -1 || selectedLines.indexOf('\\n') > selectedLines.indexOf('='))){\n\n // Do one more check, th\n var startExtractNameIndex = 0;\n var endExtractNameIndex = selectedLines.indexOf('=') - 1; // Get rid of the space at the end, it will be re-added\n varName = selectedLines.substring(startExtractNameIndex, endExtractNameIndex);\n foundName = true;\n }else{\n // just use the default generated name since no names were found\n varName = varName + this.BITMAP_EXPORT_COUNT.toString(); // Add index to make name unique when a name was NOT found\n\n // Add dimensions of bitmap to a comment above the buffer (if selected on import, will use these instead of asking user), only on not finding name\n str = str + \"# BITMAP: width: \" + this.COLUMN_COUNT.toString() + \", height: \" + this.ROW_COUNT.toString() + \"\\n\";\n }\n\n // Start the actual array\n str = str + varName + \" = (\";\n\n // Track number of spaces needed to offset (EX spaces needed = len('bitmap33 = (')))\n var spaceIndentCount = (varName + \" = (\").length;\n\n // Loop through grid data in pages COLUMN_COUNT long but 8 thick (each column of 8 is a byte for buffer)\n for(var scanRow=0; scanRow<this.ROW_COUNT; scanRow+=8){\n for(var column=0; column<this.COLUMN_COUNT; column++){\n\n // Byte for column where each bit will be set from grid data\n var byte = 0;\n \n // Make the byte\n for(var i=0; i<8 && scanRow+i < this.ROW_COUNT; i++){\n var value = document.getElementById( ((scanRow+i) * this.COLUMN_COUNT) + column).style.backgroundColor;\n if(value == \"white\"){\n value = 1;\n }else{\n value = 0;\n }\n\n byte = byte | value<<i;\n }\n\n // Add the byte to Python array string\n str = str + byte.toString();\n\n // As long not at last position in array to print, add a comma after each entry\n if(column != this.COLUMN_COUNT-1 || scanRow+8 < this.ROW_COUNT){\n str = str + \",\";\n }\n }\n\n // At the end of a page, before and formatting next add newline when not on last line of array\n if(scanRow+8 < this.ROW_COUNT){\n str = str + \"\\n\";\n\n // Indent next lines to be even with the top-most line\n for(var indent=0; indent<spaceIndentCount; indent++){\n str = str + \" \";\n }\n }\n }\n\n // Finish up the array Python syntax and setup the framebuffer for the user to use\n str = str + \")\";\n\n // Only output framebuffer if name was NOT found (don't want to do it twice++)\n if(!foundName){\n // str = str + \"\\n\" + varName + \"FBuffer = FrameBuffer(bytearray(\" + varName + \"), \" + this.COLUMN_COUNT.toString() + \", \" + this.ROW_COUNT.toString() + \", MONO_VLSB)\";\n // Keep track of the number of times bitmaps exported, used in name (but only when name was not found)\n this.BITMAP_EXPORT_COUNT++;\n }\n\n return str;\n }", "function doExport() {\n CiteKeys.initialize();\n var keys = {};\n CiteKeys.db.forEach(function(rec) { keys[rec.item.itemID] = rec.key; });\n Zotero.write(JSON.stringify(keys));\n}", "exportPatch(event, expor) {\n this.exportView.exportButton.removeEventListener(\"click\", this.eventExport);\n this.exportView.exportButton.style.opacity = \"0.3\";\n var sceneName = Utilitary.currentScene.sceneName;\n if (sceneName == null || sceneName == \"\") {\n sceneName = \"MonApplication\";\n }\n this.removeQRCode();\n Utilitary.addLoadingLogo(\"exportResultContainer\");\n var equivalentFaust = new EquivalentFaust();\n var faustCode = equivalentFaust.getFaustEquivalent(Utilitary.currentScene, Utilitary.currentScene.sceneName);\n ExportLib.getSHAKey(document.getElementById(\"faustweburl\").value, Utilitary.currentScene.sceneName, faustCode, expor.exportFaustCode);\n }", "function _____SHARED_functions_____(){}", "setOutputValues() {\n }", "exportWorkspace() {\n const workspace = this.workspace;\n this.circuit.gates.sort((a, b) => a.time - b.time);\n const gates = [];\n for (let key in workspace.gates) {\n const gate = workspace.gates[key];\n if (gate.std) {\n continue;\n }\n gates.push({\n name: key,\n qubits: gate.circuit.nqubits,\n circuit: gate.circuit.toJSON(),\n title: ''\n });\n }\n return {\n gates: gates,\n circuit: this.circuit.toJSON(),\n qubits: this.circuit.nqubits,\n input: this.editor.input\n };\n }", "function toJSON() {\n const ABBREVIATION_MODULE = require('../modules/country_Abbreviation.js');\n const AVGMALEHEIGHT_MODULE = require('../modules/country_AvgMaleHeight.js');\n const CAPITAL_MODULE = require('../modules/country_Capital.js');\n const CONTINENT_MODULE = require('../modules/country_Continent.js');\n const CURRENCYCODE_MODULE = require('../modules/country_CurrencyCode.js');\n const CURRENCYNAME_MODULE = require('../modules/country_CurrencyName.js');\n const ELEVATION_MODULE = require('../modules/country_Elevation.js');\n const LIFEEXPECTANCY_MODULE = require('../modules/country_LifeExpectancy.js');\n const NAME_MODULE = require('../modules/country_Name.js');\n const POPULATION_MODULE = require('../modules/country_Population.js');\n const POPULATIONDENSITY_MODULE = require('../modules/country_PopulationDensity.js');\n const RELIGION_MODULE = require('../modules/country_Religion.js');\n const SURFACEAREA_MODULE = require('../modules/country_SurfaceArea.js');\n const YEARLYAVGTEMPERATURE_MODULE = require('../modules/country_YearlyAvgTemperature.js');\n const FS = require('fs');\n let objectToSave = [];\n for (let country in NAME_MODULE) {\n objectToSave[country] = {\n country: NAME_MODULE[country].country,\n abbreviation: null,\n height: null,\n city: null,\n continent: null,\n currency_name: null, \n currency_code: null, \n religion: null, \n elevation: null, \n expectancy: null,\n population: null,\n density: null,\n area: null, \n temperature: null,\n }\n if (ABBREVIATION_MODULE.hasOwnProperty(country)) {\n objectToSave[country].abbreviation = ABBREVIATION_MODULE[country].abbreviation;\n }\n if (AVGMALEHEIGHT_MODULE.hasOwnProperty(country)) {\n objectToSave[country].height = AVGMALEHEIGHT_MODULE[country].height;\n }\n if (CAPITAL_MODULE.hasOwnProperty(country)) {\n objectToSave[country].city = CAPITAL_MODULE[country].city;\n }\n if (CONTINENT_MODULE.hasOwnProperty(country)) {\n objectToSave[country].continent = CONTINENT_MODULE[country].continent;\n }\n if (CURRENCYCODE_MODULE.hasOwnProperty(country)) {\n objectToSave[country].currency_code = CURRENCYCODE_MODULE[country].currency_code;\n }\n if (CURRENCYNAME_MODULE.hasOwnProperty(country)) {\n objectToSave[country].currency_name = CURRENCYNAME_MODULE[country].currency_name;\n }\n if (ELEVATION_MODULE.hasOwnProperty(country)) {\n objectToSave[country].elevation = ELEVATION_MODULE[country].elevation;\n }\n if (LIFEEXPECTANCY_MODULE.hasOwnProperty(country)) {\n objectToSave[country].expectancy = LIFEEXPECTANCY_MODULE[country].expectancy;\n }\n if (POPULATION_MODULE.hasOwnProperty(country)) {\n objectToSave[country].population = POPULATION_MODULE[country].population;\n }\n if (POPULATIONDENSITY_MODULE.hasOwnProperty(country)) {\n objectToSave[country].density = POPULATIONDENSITY_MODULE[country].density;\n }\n if (RELIGION_MODULE.hasOwnProperty(country)) {\n objectToSave[country].religion = RELIGION_MODULE[country].city;\n }\n if (SURFACEAREA_MODULE.hasOwnProperty(country)) {\n objectToSave[country].area = SURFACEAREA_MODULE[country].area;\n }\n if (YEARLYAVGTEMPERATURE_MODULE.hasOwnProperty(country)) {\n objectToSave[country].temperature = YEARLYAVGTEMPERATURE_MODULE[country].temperature;\n }\n }\n\n FS.writeFile('../json/country-data.json', JSON.stringify(objectToSave, null, ' '), 'utf8', (err) => {\n if (err) throw err;\n console.log('The file has been saved!');\n });\n}", "function fl_outToDag ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "function fl_outToHaroset ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function updateroster() {\n\n}", "function ProcessExport(dlg){\r \r // get selected layers\r var theLayerSelection = new Array();\r // store layer references of selected layers\r \r for (var p = 0; p < dlg.layerRange.layersList.items.length; p++) {\r if (dlg.layerRange.layersList.items[p].selected == true) {\r theLayerSelection = theLayerSelection.concat(dlg.layerRange.layersList.items[p]);\r }\r };\r\r // collect dialog box options,\r var thePrefix = dlg.options.prefixText.text;\r var theDestination = dlg.target.targetField.text;\r\r // update the prefix if we have one\r if(dlg.options.chkFileName.value){\r thePrefix = thePrefix+workingDoc.name;\r }\r \r\r // for each layer in array;\r for (var m = theLayerSelection.length - 1; m >=0; m--) {\r \r // create a new document with same properties as the first\r var theCopy = app.documents.add ( \r workingDoc.ref.width, \r workingDoc.ref.height, \r workingDoc.ref.resolution, \r workingDoc.name + \"_copy.psd\", \r NewDocumentMode.RGB, \r DocumentFill.TRANSPARENT \r );\r \r // move to original document\r app.activeDocument = workingDoc.ref;\r \r // reference the layer\r var theLayer = GetLayerByName(theLayerSelection[m].text);\r $.writeln(\"Getting: \" + theLayer.name);\r \r // build filenames\r var tmpName = thePrefix+theLayer.name;\r \r // transfer layerset over to the copy;\r theLayer.duplicate (theCopy, ElementPlacement.PLACEATBEGINNING);\r \r //switch back to document_copy\r app.activeDocument = theCopy;\r \r // check for trim options\r if(dlg.options.chkTrimPix.value){\r app.activeDocument.trim();\r }\r \r // build folder path from layer structure\r var myp = new Folder(dlg.target.targetField.text + \"/\" + FolderPaths[theLayer.id] );\r myp.create();\r \r // use web export options for png files (pngOpts defined in external file.)\r activeDocument.exportDocument(\r File(dlg.target.targetField.text + \"/\" + FolderPaths[theLayer.id] + \"/\" + tmpName +'.png'), \r ExportType.SAVEFORWEB,\r pngOpts\r );\r \r // close the extranious document\r theCopy.close(SaveOptions.DONOTSAVECHANGES); \r \r }//endfor\r\r \r // happy ending\r $.writeln(\"Export complete. \" );\r dlg.close(1);\r \r}", "export() {\n // Save before exporting\n settings.set({ rules: rulesGrid.getRules() })\n .then(settingsObj => {\n notifier.progressStart('Exporting...');\n\n settings.exportToFile(settingsObj)\n .then(notifier.progressEnd);\n });\n }", "function exportGromacs() {\n\twarningMsg(\"Make sure you have selected the model you would like to export.\");\n\n\tvar titleGromacs = prompt(\"Type here the job title:\", \"\");\n\t(titleGromacs == \"\") ? (titleGromacs = 'Input prepared with J-ICE ')\n\t\t\t: (titleGromacs = 'Input prepared with J-ICE ' + titleGromacs);\n\ttitleGromacs = 'titleg = \\\"' + titleGromacs + '\\\"; ';\n\trunJmolScriptWait(titleGromacs);\n\n\tsetUnitCell();\n\t\n\tscaleModelCoordinates(\"xyz\", \"div\", 10);\n\t\n\tvar numatomsGrom = \" \" + _file.frameSelection + \".length\";\n\tvar coordinateGrom = _file.frameSelection\n\t\t\t+ '.label(\" %i%e %i %e %8.3[xyz] %8.4fy %8.4fz\")';\n\tvar cellbox = +roundNumber(_file.cell.a) * (cosRounded(_file.cell.alpha)) + ' '\n\t\t\t+ roundNumber(_file.cell.b) * (cosRounded(_file.cell.beta)) + ' '\n\t\t\t+ roundNumber(_file.cell.c) * (cosRounded(_file.cell.gamma));\n\tvar coordinateGromacs = 'var numatomGrom = ' + ' ' + numatomsGrom + ';'\n\t\t\t+ 'var coordGrom = ' + coordinateGrom + ';'\n\t\t\t+ 'var cellGrom = \\\" \\n\\t' + cellbox + '\\\"; '\n\t\t\t+ 'coordinate = [numatomGrom,coordGrom,cellGrom];';\n\trunJmolScriptWait(coordinateGromacs);\n\t\n\tscaleModelCoordinates(\"xyz\", \"mul\", 10);\n\t\n\tvar finalInputGromacs = \"var final = [titleg,coordinate];\"\n\t\t\t+ 'final = final.replace(\"\\n\\n\",\"\");' + 'WRITE VAR final \"?.gro\" ';\n\trunJmolScriptWait(finalInputGromacs);\n}", "function separateFromMMGIS() {\r\n ViewshedTool.lastViewshedsUl = {}\r\n $('#vstViewsheds li').each((i, elm) => {\r\n const id = $(elm).attr('viewshedId')\r\n ViewshedTool.lastViewshedsUl[id] =\r\n ViewshedTool.getViewshedOptions(id)\r\n })\r\n\r\n $('#vstNew').off('click', ViewshedTool.makeNewElm)\r\n $('#vstToggleAll').off('click', ViewshedTool.toggleAll)\r\n Map_.map.off('click', ViewshedTool.setSource)\r\n Map_.map.off('moveend', ViewshedTool.panEnd)\r\n }", "function actuallyExports(name) { }", "function ExportEstimateData() {\n BindOrReloadEstimateTable('Export');\n}", "if (isDefault) {\n // Default exports\n this.checkDuplicateExports(node, \"default\");\n }", "export(filename) {\n const entities = Gltf2Exporter.__entityRepository._getEntities();\n const json = {\n \"asset\": {\n \"version\": \"2.0\",\n \"generator\": `Rhodonite (${_VERSION.version})`\n }\n };\n const fileName = filename ? filename : 'Rhodonite_' + (new Date()).getTime();\n json.buffers = [{\n 'uri': fileName + '.bin'\n }];\n json.bufferViews = [];\n json.accessors = [];\n json.materials = [{\n \"pbrMetallicRoughness\": {\n \"baseColorFactor\": [\n 1.0,\n 1.0,\n 1.0,\n 1.0\n ]\n }\n }];\n this.countMeshes(json, entities);\n this.createNodes(json, entities);\n this.createMeshBinaryMetaData(json, entities);\n this.createMeshes(json, entities);\n this.createMaterials(json, entities);\n const arraybuffer = this.createWriteBinary(json, entities);\n this.download(json, fileName, arraybuffer);\n }", "function generateExportColumns(gridId, tbl, isFullyExport) {\r\n var thRowCells = getTHCellsInRow(tbl.rows(0));\r\n var tdRowCells = getCellsInRow(tbl.rows(1));\r\n var exportVisibleColumnNames = \"\";\r\n var exportHideColumnNames = \"\";\r\n var exportVisibleIndex = 0;\r\n var exportHideIndex = 0;\r\n exportVisibleColumnIds = [];\r\n exportHideColumnIds = [];\r\n for (var j = 0; j < thRowCells.length; j++) {\r\n var cellID = thRowCells[j].id;\r\n var columnInformation = cellID.substring(1);\r\n var columnLabel = thRowCells[j].innerText;\r\n if(columnLabel.indexOf(',')!=-1) {\r\n var tempLabel = columnLabel.split(',').join(':;:');\r\n columnLabel = tempLabel;\r\n }\r\n var childCell = tdRowCells[j].childNodes;\r\n var columnType = childCell[0].type;\r\n var nodeName = childCell[0].nodeName;\r\n if (nodeName != undefined) {\r\n if (nodeName.toUpperCase() == \"SELECT\") {\r\n columnType = \"SELECT\";\r\n }\r\n }\r\n columnInformation += \",,,\" + columnType;\r\n var isVisibleField = $(thRowCells[j]).is(\":visible\");\r\n if (isVisibleField) {\r\n // 1. Visible Columns:_GH field configured in eAdmin and visible set to Yes. It has column labels.\r\n exportVisibleColumnIds[exportVisibleIndex++] = columnInformation;\r\n if (cellID.indexOf(\"SELECT_IND\") > -1) {\r\n exportVisibleColumnNames += \"Select\" + \",\";\r\n } else {\r\n exportVisibleColumnNames += columnLabel + \",\";\r\n }\r\n } else {\r\n // 2. OBR hide Columns:_GH field configured in eAdmin and visible set to Yes,but it hide by OBR. It has column labels.\r\n exportHideColumnIds[exportHideIndex++] = columnInformation;\r\n if (cellID.indexOf(\"SELECT_IND\") > -1) {\r\n exportHideColumnNames += \"Select\" + \",\";\r\n } else {\r\n exportHideColumnNames += columnLabel + \",\";\r\n }\r\n }\r\n }\r\n\r\n var colNames = exportVisibleColumnNames;\r\n if (isFullyExport) {\r\n // 3. Hide Columns:_GH field configured in eAdmin but visible set to No. It has column labels.\r\n colNames += exportHideColumnNames;\r\n var hiddenColumnNames = eval(gridId + \"_getHiddenColumnNames()\");\r\n var hiddenColumnIds = eval(gridId + \"_getHiddenColumnIds()\");\r\n //Make sure the array doesn't have empty elements\r\n var hideColumnArray = hiddenColumnIds.split(\",\").filter(function(el) {return el.length != 0});\r\n for (var k = 0; k < hideColumnArray.length; k++) {\r\n exportHideColumnIds[exportHideIndex++] = hideColumnArray[k];\r\n }\r\n colNames += hiddenColumnNames;\r\n\r\n // 4. Other Columns:_GH field is not configured and no column labels configured.\r\n colNames += generateExportColumnsForNoConfigurationFields(gridId, exportHideIndex, hideColumnArray);\r\n }\r\n colNames = colNames.substring(0, colNames.length - 1);\r\n return colNames;\r\n}", "get exportData() {\n const { isEmpty, isNull, uniq, flatten, get } = this.lodash\n const { exportDeclarations = [] } = this\n\n const names = exportDeclarations.map((item, i) => {\n const { node, index } = item\n switch (node.type) {\n case 'ExportDefaultDeclaration':\n return {\n name: 'default',\n index,\n exportName: get(node, 'declaration.id.name'),\n start: get(node, 'declaration.loc.start.line'),\n end: get(node, 'declaration.loc.end.line'),\n }\n case 'ExportNamedDeclaration':\n if (isNull(node.declaration) && !isEmpty(node.specifiers)) {\n return node.specifiers\n .filter(specifier => specifier.type === 'ExportSpecifier')\n .map(specifier => ({\n index,\n name: get(specifier, 'exported.name'),\n start: get(specifier, 'loc.start.line'),\n end: get(specifier, 'loc.end.line'),\n }))\n } else if (!isNull(node.declaration) && !isEmpty(node.declaration.declarations)) {\n const entry = {\n name: get(node, 'declaration.declarations[0].id.name'),\n start: get(node, 'loc.start.line'),\n end: get(node, 'loc.end.line'),\n index,\n }\n\n return entry\n } else if (!isNull(node.declaration) && node.declaration.type === 'FunctionDeclaration') {\n return {\n name: get(node, 'declaration.id.name'),\n start: get(node, 'declaration.loc.start.line'),\n end: get(node, 'declaration.loc.end.line'),\n index,\n }\n } else {\n return { index, node }\n }\n default:\n return undefined\n }\n })\n\n return flatten(names).filter(Boolean)\n }", "function export_list() {\n\tvar actionOrigin = $(\"form[name='filter_form']\").attr('action');\n\t$(\"form[name='filter_form']\").attr('action', actionOrigin + '.xlsx').submit();\n\tvar actionNew = $(\"form[name='filter_form']\").attr('action').slice(0,-5);\n\t$(\"form[name='filter_form']\").attr('action', actionNew);\n}", "function exportParameters() {\n\n YMHandleFileService.downloadFile(\n 'yangman_parameters.json',\n vm.parametersList.toJSON(),\n 'json',\n 'charset=utf-8',\n function (){},\n function (e){\n console.error('Export parameters error:', e);\n }\n );\n }", "saveAsOneFile() {\r\n // HTML exportation\r\n this.saveFile('index', 'HTML', this.content)\r\n // We show the export result\r\n setTimeout(this.showOutput, 2500)\r\n }", "static private internal function m121() {}", "function tempConvert(){\n \n}", "function exportGULP() {\n\t\n\tvar stringCellparamgulp;\n\tvar coordinateAddgulp = \"\";\n\tvar cellHeadergulp = \"cell\";\n\tvar flagsymmetryGulp = false;\n\n\twarningMsg(\"Make sure you have selected the model you would like to export.\");\n\tsaveStateAndOrientation_a();\n\tif (_file.cell.typeSystem != \"crystal\")\n\t\tsetUnitCell();\n\t\n\tvar titleGulpinput = prompt(\"Type here the job title:\", \"\");\n\t(titleGulpinput == \"\") ? (titleGulpinput = 'Input prepared with J-ICE ')\n\t\t\t: (titleGulpinput = '#Input prepared with J-ICE \\n'\n\t\t\t\t\t+ titleGulpinput);\n\tvar titleGulp = 'var optiongulp = \\\"opti conp propr #GULP options\\\";'\n\t\t\t+ 'var titleheader = \\\"title \\\"; ' + 'var title = \\\"'\n\t\t\t+ titleGulpinput + '\\\"; ' + 'var titleend = \\\"end \\\";'\n\t\t\t+ 'titlegulp = [optiongulp, titleheader, title, titleend];';\n\trunJmolScriptWait(titleGulp);\n\n\tswitch (_file.cell.typeSystem) {\n\tcase \"crystal\":\n\t\tsetUnitCell();\n\t\tflagsymmetryGulp = confirm(\"Do you want to introduce symmetry ?\");\n\n\t\tif (flagsymmetryGulp) {\n\t\t\twarningMsg(\"This procedure is not fully tested.\");\n\t\t\tfigureOutSpaceGroup(false, false);\n\t\t} else {\n\t\t\tstringCellparamgulp = roundNumber(_file.cell.a) + ' ' + roundNumber(_file.cell.b)\n\t\t\t\t\t+ ' ' + roundNumber(_file.cell.c) + ' ' + roundNumber(_file.cell.alpha) + ' '\n\t\t\t\t\t+ roundNumber(_file.cell.beta) + ' ' + roundNumber(_file.cell.gamma);\n\t\t}\n\t\tbreak;\n\n\tcase \"surface\":\n\t\tcellHeadergulp = \"scell\";\n\t\tcoordinateAddgulp = \"s\";\n\t\tstringCellparamgulp = roundNumber(_file.cell.a) + \", \" + roundNumber(_file.cell.b)\n\t\t\t\t+ \", \" + roundNumber(_file.cell.gamma);\n\t\tbreak;\n\n\tcase \"polymer\":\n\t\tcellHeadergulp = \"pcell\";\n\t\tcoordinateAddgulp = \"\";\n\t\tstringCellparamgulp = roundNumber(_file.cell.a);\n\t\tbreak;\n\n\tcase \"molecule\":\n\t\t// TODO\n\n\t\tbreak;\n\t}\n\n\n\tvar cellGulp = 'var cellheader = \\\"' + cellHeadergulp + '\\\";'\n\t\t+ 'var cellparameter = \\\"' + stringCellparamgulp + '\\\";'\n\t\t+ 'cellgulp = [cellheader, cellparameter];';\n\trunJmolScriptWait(cellGulp);\n\n\tvar coordinateString;\n\tvar coordinateShel;\n\tvar sortofCoordinateGulp;\n\tif (_file.cell.typeSystem == 'crystal') {\n\t\tvar sortofCoordinate = confirm(\"Do you want the coordinates in Cartesian or fractional? \\n OK for Cartesian, Cancel for fractional.\")\n\t\tsortofCoordinateGulp = (sortofCoordinate == true) ? (coordinateAddgulp + \"cartesian\")\n\t\t\t\t: (coordinateAddgulp + \"fractional\");\n\t} else {\n\t\tmessageMsg(\"Coordinate will be exported in Cartesian\");\n\t}\n\tvar flagShelgulp = confirm(\"Is the inter-atomic potential a core/shel one? \\n Cancel stands for NO core/shel potential.\");\n\tif (sortofCoordinateGulp && _file.cell.typeSystem == 'crystal') {\n\t\tcoordinateString = _file.frameSelection + '.label(\"%e core %16.9[fxyz]\")';\n\t\tcoordinateShel = _file.frameSelection + '.label(\"%e shel %16.9[fxyz]\")';\n\t} else {\n\t\tcoordinateString = _file.frameSelection + '.label(\"%e core %16.9[xyz]\")';\n\t\tcoordinateShel = _file.frameSelection + '.label(\"%e shel %16.9[xyz]\")';\n\t}\n\tvar coordinateGulp;\n\tif (flagShelgulp) {\n\t\tcoordinateGulp = 'var coordtype = \\\"' + sortofCoordinateGulp + '\\\";'\n\t\t\t\t+ 'var coordcore = ' + coordinateString + ';'\n\t\t\t\t+ 'var coordshel = ' + coordinateShel + ';'\n\t\t\t\t+ 'coordgulp = [coordtype, coordcore, coordshel];';\n\t} else {\n\t\tcoordinateGulp = 'var coordtype = \\\"' + sortofCoordinateGulp + '\\\";'\n\t\t\t\t+ 'var coordcore = ' + coordinateString + ';'\n\t\t\t\t+ 'coordgulp = [coordtype, coordcore];';\n\t}\n\trunJmolScriptWait(coordinateGulp);\n\n\tif (_file.cell.typeSystem == \"crystal\") {\n\t\t// interNumber from crystalfunction .. BH??? interNumber is only defined locally in figureOutSpaceGroup\n\t\tif (!flagsymmetryGulp)\n\t\t\tinterNumber = \"P 1\"\n\t\tvar spacegroupGulp = 'var spaceheader = \\\"spacegroup\\\";'\n\t\t\t\t+ 'var spacegroup = \\\"' + interNumber + '\\\";'// TBC\n\t\t\t\t+ 'spacegulp = [spaceheader, spacegroup];';\n\t\trunJmolScriptWait(spacegroupGulp);\n\t}\n\n\tvar restGulp;\n\tif (flagShelgulp) {\n\t\trestGulp = 'var species= \\\"species \\\" \\n\\n;'\n\t\t\t\t+ 'var restpot = \\\"#here the user should enter the inter-atomic potential setting\\\";'\n\t\t\t\t+ 'var spring = \\\"spring \\\" \\n\\n;'\n\t\t\t\t+ 'restgulp = [species, restpot, spring];';\n\t} else {\n\t\trestGulp = 'var species= \\\"species \\\" \\n\\n;'\n\t\t\t\t+ 'var restpot = \\\"#here the user should enter the inter-atomic potential setting\\\";'\n\t\t\t\t+ 'restgulp = [species, restpot];';\n\t}\n\trunJmolScriptWait(restGulp);\n\n\tvar finalInputGulp;\n\tif (_file.cell.typeSystem == \"crystal\") {\n\t\tfinalInputGulp = \"var final = [titlegulp,cellgulp,coordgulp,spacegulp,restgulp];\"\n\t\t\t\t+ 'final = final.replace(\"\\n\\n\",\"\\n\");'\n\t\t\t\t+ 'WRITE VAR final \"?.gin\" ';\n\t} else {\n\t\tfinalInputGulp = \"var final = [titlegulp,cellgulp,coordgulp,restgulp];\"\n\t\t\t\t+ 'final = final.replace(\"\\n\\n\",\"\\n\");'\n\t\t\t\t+ 'WRITE VAR final \"?.gin\" ';\n\t}\n\trun(finalInputGulp);\n\trestoreStateAndOrientation_a();\n\n}", "exportData(table_exporter_data) {\n\t\tthis.table_exporter.export2file(\n\t\t\ttable_exporter_data.data,\n\t\t\ttable_exporter_data.mimeType,\n\t\t\ttable_exporter_data.filename,\n\t\t\ttable_exporter_data.fileExtension);\n\t}", "function do_ajax_import_export(which){\n before_ajax_import_export(which);\n var group = jQuery(\"#option_group_name\").val();\n var seq_selector = \"#apc_\" + which + \"_nonce\";\n var action_selctor = \"apc_\" + which + \"_\" + group;\n jQuery.ajaxSetup({ cache: false });\n if (which == 'export')\n export_ajax_call(action_selctor,group,seq_selector,which);\n else\n import_ajax_call(action_selctor,group,seq_selector,which);\n jQuery.ajaxSetup({ cache: true });\n}", "function bcExport() {\n var keyValueMap = {};\n try {\n brewcalc.brewSheetTemplate = DriveApp.getFileById(brewcalc.settings.brewSheetTemplateId);\n if (typeof brewcalc.brewSheetTemplate === 'undefined') {\n throw 'Could not get handle to settings sheet';\n }\n\n var folders = brewcalc.brewSheetTemplate.getParents();\n if (folders.hasNext()) {\n brewcalc.brewSheetFolder = folders.next();\n }\n\n if (typeof brewcalc.brewSheetFolder === 'undefined') {\n throw 'Could not get handle to brew sheet folder';\n }\n\n // get the active sheet so I don't have to rely on the recipe sheet\n var recipeSheetName = brewcalc.volumeSheet.getRange('B2').getValue();\n var currentRecipeSheet = brewcalc.workbook.getSheetByName(recipeSheetName);\n if (typeof currentRecipeSheet !== 'undefined') {\n if (nonRecipeSheets.indexOf(currentRecipeSheet.getName()) >= 0) {\n throw 'Please select a recipe sheet before exporting';\n }\n\n brewcalc.recipeSheet = currentRecipeSheet;\n } else {\n throw 'I couldn\\'t find a sheet named \"' + recipeSheetName + '\"';\n }\n\n keyValueMap.recipeName = brewcalc.recipeSheet.getRange('K1').getValue();\n keyValueMap.version = brewcalc.recipeSheet.getRange('K3').getValue();\n var brewDateObj = brewcalc.recipeSheet.getRange('M3').getValue(),\n brewMoment = moment(brewDateObj).local(),\n stamp = brewMoment.format('YYYY-MM-DD');\n\n var targetDoc = bcDuplicateTemplate(stamp + ' ' + keyValueMap.recipeName + ' v' + keyValueMap.version),\n body = targetDoc.getBody(),\n paragraphs = body.getParagraphs(),\n tables = body.getTables(),\n idx;\n\n // read all the relevant cells in the sheet into JS arrays\n keyValueMap.brewDate = brewMoment.format('MM/DD/YYYY');\n var volumeRange = brewcalc.volumeSheet.getRange('B4:C38').getValues(),\n recipeRange = brewcalc.recipeSheet.getRange('B2:K44').getValues();\n\n var boilTime = brewcalc.recipeSheet.getRange('B1').getValue();\n keyValueMap.boilTime = boilTime;\n keyValueMap.batchVolume = volumeRange[ 5 ][ 0 ].toFixed(brewcalc.settings.decimalPlaces) + volumeRange[ 5 ][ 1 ];// volume to fermenter\n keyValueMap.firstRunnings = volumeRange[ 29 ][ 0 ].toFixed(brewcalc.settings.decimalPlaces) + volumeRange[ 29 ][ 1 ];\n keyValueMap.preBoilVolume = volumeRange[ 9 ][ 0 ].toFixed(brewcalc.settings.decimalPlaces) + volumeRange[ 9 ][ 1 ];\n keyValueMap.mashThickness = volumeRange[ 16 ][ 0 ] + volumeRange[ 16 ][ 1 ];\n keyValueMap.strikeWater = volumeRange[ 18 ][ 0 ].toFixed(brewcalc.settings.decimalPlaces) + volumeRange[ 18 ][ 1 ];\n keyValueMap.strikeTemp = volumeRange[ 19 ][ 0 ].toFixed(0) + volumeRange[ 19 ][ 1 ];\n keyValueMap.firstRunningsGallons = volumeRange[ 29 ][ 0 ].toFixed(brewcalc.settings.decimalPlaces) + volumeRange[ 29 ][ 1 ];\n keyValueMap.batchSpargeQuarts = volumeRange[ 31 ][ 0 ].toFixed(brewcalc.settings.decimalPlaces) + volumeRange[ 31 ][ 1 ];\n keyValueMap.totalWaterGallons = volumeRange[ 34 ][ 0 ].toFixed(brewcalc.settings.decimalPlaces) + volumeRange[ 34 ][ 1 ];\n\n // export to template\n for (idx = paragraphs.length; idx--;) {\n paragraphs[ idx ] = bcReplaceKeywords(paragraphs[ idx ], keyValueMap);\n }\n\n // collect data from efficiencies sheet\n keyValueMap = {};\n keyValueMap.style = recipeRange[ 0 ][ 9 ];\n keyValueMap.targetOG = recipeRange[ 2 ][ 0 ];\n keyValueMap.yeast = recipeRange[ 2 ][ 9 ];\n keyValueMap.starter = recipeRange[ 3 ][ 9 ];\n keyValueMap.estFWG = recipeRange[ 25 ][ 0 ];\n keyValueMap.estFWP = Utils.toPercent(recipeRange[ 21 ][ 0 ]);\n keyValueMap.estPBG = recipeRange[ 31 ][ 0 ];\n keyValueMap.estPBP = Utils.toPercent(recipeRange[ 33 ][ 0 ]);\n keyValueMap.estOP = Utils.toPercent(recipeRange[ 40 ][ 0 ]);\n keyValueMap.estFG = recipeRange[ 4 ][ 9 ];\n keyValueMap.estABV = recipeRange[ 5 ][ 9 ];\n keyValueMap.IBU = recipeRange[ 39 ][ 8 ];\n keyValueMap.BUGU = recipeRange[ 40 ][ 8 ];\n keyValueMap.color = bcCalculateSRM(keyValueMap.grainBill);\n\n // export to template\n for (idx = paragraphs.length; idx--;) {\n paragraphs[ idx ] = bcReplaceKeywords(paragraphs[ idx ], keyValueMap);\n }\n\n // get ingredients\n keyValueMap = {};\n keyValueMap.grainBill = bcGetGrainBill();\n keyValueMap.mashSteps = bcGetMashProfile();\n keyValueMap.hopSchedule = bcGetHopSchedule();\n keyValueMap.fermSteps = bcGetFermentationProfile();\n keyValueMap.brewSteps = bcGenerateBrewSteps(boilTime, keyValueMap.mashSteps, keyValueMap.hopSchedule);\n\n // set data in the tables\n idx = tables.length;\n var stepIdx,\n stepLen,\n step;\n for (; idx--;) {\n var table = tables[ idx ],\n cell = table.getCell(0, 0),\n numRows = table.getNumRows(),\n cellText = cell.getText();\n if (cellText.indexOf(\"Fermentables & Other Ingredients\") === 0) {\n stepLen = keyValueMap.grainBill.length;\n if (stepLen > numRows - 2) {\n throw 'Your grain bill is larger than the brew sheet can handle';\n }\n for (stepIdx = 0; stepIdx < stepLen; stepIdx++) {\n step = keyValueMap.grainBill[ stepIdx ];\n table.getCell(stepIdx + 2, 0)\n .setText(step.pounds.toFixed(brewcalc.settings.decimalPlaces) + ' lb');\n table.getCell(stepIdx + 2, 1).setText(Utils.toPercent(step.percent));\n table.getCell(stepIdx + 2, 2).setText(step.name);\n }\n table.getCell(stepIdx + 2, 0)\n .setText(brewcalc.recipeSheet.getRange('E20')\n .getValue()\n .toFixed(brewcalc.settings.decimalPlaces) + ' lb');\n table.getCell(stepIdx + 2, 1)\n .setText('x' + Utils.toPercent(brewcalc.recipeSheet.getRange('D20').getValue()));\n table.getCell(stepIdx + 2, 2).setText(brewcalc.recipeSheet.getRange('C20').getValue());\n } else if (cellText.indexOf(\"Mash Schedule\") === 0) {\n stepLen = keyValueMap.mashSteps.length;\n if (stepLen > numRows - 2) {\n throw 'Your mash schedule is larger than the brew sheet can handle';\n }\n for (stepIdx = 0; stepIdx < stepLen; stepIdx++) {\n step = keyValueMap.mashSteps[ stepIdx ];\n table.getCell(stepIdx + 2, 0).setText(step.temp.toFixed(0) + '°F');\n table.getCell(stepIdx + 2, 1).setText(step.time.toFixed(0));\n }\n } else if (cellText.indexOf(\"Hops\") === 0) {\n stepLen = keyValueMap.hopSchedule.length;\n if (stepLen > numRows - 2) {\n throw 'Your hop schedule is larger than the brew sheet can handle';\n }\n for (stepIdx = 0; stepIdx < stepLen; stepIdx++) {\n step = keyValueMap.hopSchedule[ stepIdx ];\n table.getCell(stepIdx + 2, 0).setText(step.amount.toFixed(brewcalc.settings.decimalPlaces));\n table.getCell(stepIdx + 2, 1).setText(step.name);\n table.getCell(stepIdx + 2, 2)\n .setText(Utils.toPercent(step.alpha, brewcalc.settings.decimalPlaces));\n if (step.time.length == 0) {\n table.getCell(stepIdx + 2, 3).setText('Dry hop');\n } else {\n table.getCell(stepIdx + 2, 3).setText(step.time.toFixed(0));\n }\n }\n } else if (cellText.indexOf(\"Fermentation\") === 0) {\n stepLen = keyValueMap.fermSteps.length;\n if (stepLen > numRows - 2) {\n throw 'Your fermentation schedule is larger than the brew sheet can handle';\n }\n for (stepIdx = 0; stepIdx < stepLen; stepIdx++) {\n step = keyValueMap.fermSteps[ stepIdx ];\n table.getCell(stepIdx + 3, 0).setText(step.temp + '°F');\n table.getCell(stepIdx + 3, 1).setText(step.time + ' days');\n }\n } else if (cellText.indexOf(\"Brew Day Timing\") === 0) {\n stepLen = keyValueMap.brewSteps.length;\n if (stepLen > numRows - 2) {\n throw 'Your brew day timing is larger than the brew sheet can handle';\n }\n for (stepIdx = 0; stepIdx < stepLen; stepIdx++) {\n step = keyValueMap.brewSteps[ stepIdx ];\n table.getCell(stepIdx + 2, 0).setText(step.time);\n table.getCell(stepIdx + 2, 1).setText(step.action);\n }\n }\n }\n SpreadsheetApp.getUi().alert('Export complete!');\n } catch (ex) {\n SpreadsheetApp.getUi().alert(ex);\n }\n}", "function ExportPendingDocs() {\n BindOrReloadDocumentApprovals('Export');\n}", "function fl_outToDvash ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "function applyExtendedVersion() {\n\t\t//show avoid areas\n\t\t$('#avoidAreas').show();\n\t\t\n\t\t//show import/export features\n\t\t$('#exportImport').show();\n\t\t\n\t\t//show accessibility analysis\n\t\t$('#accessibilityAnalysis').show();\n\t}", "function exportVesselReport() {\n\tdocument.exportReport.bookingOfficeFilter.value = document.vesselReport.bookingOfficeFilter.value;\n\tdocument.exportReport.bookingTeamFilter.value = document.vesselReport.bookingTeamFilter.value;\n\tdocument.exportReport.containerSizeFilter.value = document.vesselReport.containerSizeFilter.value;\n\tdocument.exportReport.receiptModeFilter.value = document.vesselReport.receiptModeFilter.value;\n\tdocument.exportReport.tariffTypeFilter.value = document.vesselReport.tariffTypeFilter.value;\n\tdocument.exportReport.submit();\n}", "function initializeOutput() {\r\n HTML_output = new java.io.FileWriter(\"active-hits/shortn-results.\" + soylentJob + \".html\");\r\n lag_output = new java.io.FileWriter(\"active-hits/shortn-\" + soylentJob + \"-fix_errors_lag.csv\");\r\n lag_output.write(\"Stage,Assignment,Wait Type,Time,Paragraph\\n\");\r\n payment_output = new java.io.FileWriter(\"active-hits/shortn-\" + soylentJob + \"-fix_errors_payment.csv\");\r\n payment_output.write(\"Stage,Assignment,Cost,Paragraph\\n\");\r\n patchesOutput = new java.io.FileWriter(\"active-hits/shortn-patches.\" + soylentJob +\".json\");\r\n}", "processCSVVersion04072020(raw) {\n\t\traw.forEach( datum => {\n\t\t\tdatum.covid19_test_results = datum.covid_19_test_results;\n\t\t\tdelete datum.covid_19_test_results;\n\t\t});\n\t\traw.columns[raw.columns.find(\"covid_19_test_results\")] = \"covid19_test_results\";\n\t\tiflog(\"processCSVversion0(): begin processing\")\n\t\treturn \n\t}", "function exportLayers(){\n\n\t// Loop through layers\n\tfor(var e = 0; e< doc.layers.length; e++){\n\n\t\t// Set selected layer on\n\t\tdoc.layers[e].visible = true;\n\n\t\t// Store layerName\n\t\tvar layerName = doc.layers[e].name;\n\n\t\t// Function returns a new file name\n\t\ttargetFile = getNewName(layerName);\n\n\t\t// Returns PNG options\n\t\tpngSaveOpts = getPNGOptions();\n\n\t\t// Export file as PNG\n\t\tsourceDoc.exportFile(targetFile,ExportType.PNG24,pngSaveOpts);\n\n\t\t// Turn selected layer off\n\t\tdoc.layers[e].visible = false;\n\n\t}\n}", "function convert() {\n // var myapp = UiApp.createApplication().setTitle(appName);\n // var mypanel = myapp.createVerticalPanel();\n // myapp.add(mypanel);\n Logger.clear()\n //function to remove old copies of a file in the folder.\n var removeOldCopies = function(dir, fl){\n //ERROR: for some reason gives error as 'getFilesByName is not a function of Folder Class' despite being in the API documentation\n /*var fileList = dir.getFilesByName(fl);\n while(fileList.hasNext()){\n fileList.next().setTrashed(true);\n }*/\n }\n// try {\n var processedJSON = XLSXConverter.processJSONWorkbook(workbookToJson());\n _.each(XLSXConverter.getWarnings(), function(warning) {\n //TODO: Add option to parse the warnings and error strings,\n // and highlight the rows with errors.\n mypanel.add(myapp.createHTML(\"Warning: \" + warning));\n });\n\n //open the correct folder and make sure it has the correct subdirectories\n var folder = DocsList.getFolderById(\"0BxQdlH5mVj3PfkxnZmV2WHZTZ2k2c0dTNTNxSlc3OGR5bTY5eGl3Q2ZDR3gtVkUxYzlVUGs\");\n var now = new Date().toJSON().replace(/:/g,\".\");\n folder = folder.createFolder(\"forms_\"+now);\n var optionsFldr, schemaFldr, file;\n /*var subDir = folder.getFolders();\n for(var k=0;k<subDir.length;k++){\n var fldr = subDir[k];\n if(fldr.getName() == \"schema\"){\n schemaFldr = fldr;\n }\n if(fldr.getName() == \"options\"){\n optionsFldr = fldr;\n }\n }\n if(schemaFldr == undefined){*/\n schemaFldr = folder.createFolder(\"schema\");\n //}\n //if(optionsFldr == undefined){\n optionsFldr = folder.createFolder(\"options\");\n //}\n\n Logger.log(schemaFldr.getName());\n Logger.log(optionsFldr.getName());\n\n //create a file for all of the models\n var languages = ['en', 'sw', 'fr'];\n _.each(languages, function(language) {\n var models = processedJSON[language + '_model'];\n schemaFldrLanguage = schemaFldr.createFolder(language);\n optionsFldrLanguage = optionsFldr.createFolder(language);\n if(models != undefined && models.length != undefined){\n for(var i=0;i<models.length;i++){\n var model = models[i];\n var fileName = model.schema._id+\".json\";\n //check for that filename in both folders and if it exists, remove it\n removeOldCopies(schemaFldr, fileName);\n removeOldCopies(optionsFldr, fileName);\n \n //create the new files\n schemaFldrLanguage.createFile(fileName, JSON.stringify(model.schema,\n function(key, value) {\n //Replacer function to leave out prototypes\n if (key !== \"prototype\") {\n return value;\n }\n }, 2));\n optionsFldrLanguage.createFile(fileName, JSON.stringify(model.options,\n function(key, value) {\n //Replacer function to leave out prototypes\n if (key !== \"prototype\") {\n return value;\n }\n }, 2));\n } \n }\n \n removeOldCopies(schemaFldrLanguage, \"lists.json\")\n removeOldCopies(optionsFldrLanguage, \"lists.json\")\n\n //create the new copy of lists.json\n var lists = processedJSON[language + '_lists'];\n if(lists != undefined){\n schemaFldrLanguage.createFile(\"lists.json\", JSON.stringify(lists.schema,\n function(key, value) {\n //Replacer function to leave out prototypes\n if (key !== \"prototype\") {\n return value;\n }\n }, 2));\n optionsFldrLanguage.createFile(\"lists.json\", JSON.stringify(lists.options,\n function(key, value) {\n //Replacer function to leave out prototypes\n if (key !== \"prototype\") {\n return value;\n }\n }, 2));\n }\n\n })\n //remove any existing copies of lists.json\n removeOldCopies(folder, \"lists.json\")\n\n //create the new copy of lists.json\n var lists = processedJSON['lists'];\n if(lists != undefined){\n file = folder.createFile(\"lists.json\", JSON.stringify(lists,\n function(key, value) {\n //Replacer function to leave out prototypes\n if (key !== \"prototype\") {\n return value;\n }\n }, 2));\n }\n\n //remove old copies of formDef.json\n removeOldCopies(folder, \"formDef.json\");\n\n //create a file containing everything as a record\n file = folder.createFile(\"formDef.json\", JSON.stringify(processedJSON,\n function(key, value) {\n //Replacer function to leave out prototypes\n if (key !== \"prototype\") {\n return value;\n }\n }, 2));\n\n // file = folder.createFile(\"log\", Logger.getLog());\n\n //mypanel.add(myapp.createAnchor(\"Download JSON\", file.getUrl()));\n/* } catch (e) {\n //mypanel.add(myapp.createHTML(\"ERROR:\"));\n //mypanel.add(myapp.createHTML(String(e)));\n\n throw e;\n }*/\n //SpreadsheetApp.getActiveSpreadsheet().show(myapp);\n return;\n}" ]
[ "0.6261411", "0.6237569", "0.6223455", "0.62066734", "0.6017446", "0.5938178", "0.5891641", "0.5874507", "0.5848278", "0.5778121", "0.57662326", "0.5681616", "0.5659055", "0.5654672", "0.5603843", "0.55691874", "0.552136", "0.54698664", "0.5467536", "0.5424706", "0.54156816", "0.54146343", "0.5384025", "0.53829616", "0.53820986", "0.53802764", "0.53802764", "0.53802764", "0.5341729", "0.5329281", "0.53223085", "0.5297509", "0.5293762", "0.52761406", "0.52646834", "0.52543336", "0.5243762", "0.52404845", "0.5235918", "0.5218622", "0.5203669", "0.52025664", "0.52022153", "0.52017576", "0.519692", "0.519386", "0.51861423", "0.51858866", "0.51844656", "0.5184075", "0.51769483", "0.5175462", "0.5172526", "0.51676184", "0.5162101", "0.5151616", "0.5147864", "0.5147864", "0.5143495", "0.51393014", "0.5128579", "0.511711", "0.511352", "0.5111679", "0.50910527", "0.5064611", "0.5056787", "0.5050843", "0.50385535", "0.5034486", "0.5025804", "0.50244516", "0.5024154", "0.5021991", "0.50193536", "0.50157285", "0.5012416", "0.5008434", "0.5008387", "0.5003871", "0.49986008", "0.4995476", "0.49783564", "0.49765456", "0.4974876", "0.4962361", "0.49616534", "0.49597186", "0.49587697", "0.49560824", "0.49552494", "0.49510476", "0.49500686", "0.4942612", "0.49407858", "0.49391362", "0.4937349", "0.49319768", "0.49284542", "0.49204776", "0.49203745" ]
0.0
-1
Renders a modal for joining a group in the Profile page. See pages/Profile.jsx.
render() { let fRef = null; let open = this.props.open; return ( <Modal open={open} size={'tiny'} onClose={this.props.closeModal}> <Modal.Header>Join a Group</Modal.Header> <AutoForm ref={ref => { fRef = ref; }} schema={bridge} onSubmit={data => { this.submit(data, fRef);this.updateLocation(data)}} model={this.props.doc}> <TextField name='groupID' className={'join-modal'}/> { this.state.joined ? <Button className={'button-align'}> <Link to={`/group/${this.state.groupID}`}>Go to your group!</Link> </Button> : <SubmitField value='Join' className={'button-align'}/> } <ErrorsField /> </AutoForm> </Modal> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGroupModal() {\n $('#createModal').modal('show');\n document.getElementById(\"modal-group-email-domain\").innerHTML = \"@\" + domain;\n}", "function showProfileModal(data) {\n // used to display the modal\n setIsProfileModal(true);\n // set the memberUrl to pass into the profile modal componet\n setMemberUrl(data);\n }", "async function joinGroup() {\n if (groupCodeField.length > 0) {\n const bearerToken = await firebase.auth().currentUser.getIdToken();\n await fetch(apiUrl + `api/group/join/${groupCodeField}/`, {\n method: \"PATCH\",\n headers: new Headers({\n Authorization: \"Bearer \" + bearerToken,\n }),\n })\n .then((response) => response.json())\n .then((json) => {\n navigation.navigate(\"GroupInfoScreen\", {\n name: json.name,\n group_id: json.id,\n });\n })\n .catch(() => {\n Alert.alert(\n \"Issue joining group\",\n \"Sorry, you're already in this group\",\n [{ text: \"Close\" }]\n );\n });\n }\n }", "function Group (props) {\n return (\n <div>\n <h1>{props.group}</h1>\n <Link to={`/users/${props.loggedIn}`}>\n <button>{props.loggedIn}s profile</button>\n </Link>\n <p>This is the main description of the plan for {props.group}</p>\n <Messageboard router={props.router} />\n </div>\n )\n}", "function handleProfileSubmit() {\n showModal();\n }", "function displayGroup () {\n //This function is the render page for Group Tab\n function loadGroupMembers (group_id) {\n //loads the member list base on selected group\n let url = Config.api.tgMembers + '?action=read&group_id='+group_id\n Axios.get(url)\n .then( (resp) => {\n setMembers(resp.data.data)\n })\n }\n\n function handleGroupSelect (event) {\n let group_id = event.target.value\n let i = findIndex(allGroups, ['id', event.target.value])\n setSelectGroup(allGroups[i]) //sets the group id\n loadGroupMembers(group_id)\n }\n\n function removeMember(m) {\n console.log('current id', m.chat_id)\n let url = Config.api.tgMembers + '?action=remove&group_id='+selectGroup.id+'&cid='+m.chat_id\n \n Axios.get(url)\n .then( (resp) => {\n if (resp.data.success === 'true') {\n setMembers(resp.data.data)\n setToast({ show: true, action: 'Remove Member', msg: m.knowName + ' is remove from '+selectGroup.groupName, type: ''})\n }\n else\n setToast({ show: true, action: 'Error', msg: 'Problem on removing '+m.knowName, type: 'bg-warning'})\n\n })\n }\n function addMembersCard () {\n //selectGroup is the current selected group\n function handleAddMemeber () {\n \n if (selectGroup) { //if it is define\n let cid = document.getElementById('memberID').value\n if (size(cid) >= 9) {\n let url = Config.api.tgMembers + '?action=add&group_id='+selectGroup.id+'&cid='+cid\n Axios.get(url)\n .then( (resp) => {\n setMembers(resp.data.data)\n document.getElementById('memberID').value = ''\n })\n }\n } else {\n setToast({ show: true, action: '', msg: 'Please select or create a group first.', type: ''}) \n }\n }\n return (\n <div className=\"card m-2 shadow-sm\">\n <div className=\"card-body p-2\">\n <input className=\"form-control\" list=\"datalistOptions\" id=\"memberID\" placeholder=\"Type to search...\"></input> \n <datalist id=\"datalistOptions\">\n {\n data.map( (row, i) => {\n if (row.validUser === '1')\n return <option value={row.chat_id} key={i}>{row.firstName +' / '+row.knowName}</option>\n else\n return\n })\n }\n </datalist>\n <button type=\"button\" className=\"btn btn-primary\" onClick={()=>handleAddMemeber()}>Add Member</button> \n </div>\n </div>\n )\n }\n\n function deleteGroup() {\n let deleteGroupName = selectGroup.groupName\n Axios.post(Config.api.tgGroups+'?action=delete&id='+selectGroup.id)\n .then ( (resp) => {\n if (resp.data.success === 'true') {\n //reloads the group combo list\n setAllGroups(resp.data.data)\n setToast({ show: true, action: 'Delete Group', msg: deleteGroupName + ' is deleted.', type: ''}) \n if (size(resp.data.data) > 0) loadGroupMembers(resp.data.data[0].id) \n } else {\n setToast({ show: true, action: 'Error', msg: 'Error occur in deleting group.', type: 'bg-warning'}) \n }\n })\n }\n\n return (\n <div>\n {showModal('Add New Group')}\n <div className=\"row m-2\">\n <div className=\"col-8\">\n <div className='row'>\n <div className='col-auto'>\n <label htmlFor=\"allGroupsList\" className=\"form-label\">Groups:</label>\n </div>\n <div className='col'>\n <select className=\"form-select-auto mb-3\" id=\"allGroupList\" onClick={(e)=>handleGroupSelect(e)} onChange={(e)=>handleGroupSelect(e)}>\n {\n allGroups.map ( item => {\n return (\n <option value={item.id} key={item.id}>{item.groupName}</option>\n )\n })\n }\n </select>\n </div> \n </div>\n </div>\n <div className=\"col-4-md d-flex justify-content-md-between\">\n <button type=\"button\" data-bs-target=\"#exampleModal\" data-bs-toggle=\"modal\"\n className=\"btn btn-primary\" onClick={handleShow}>Add Group</button>\n <button type=\"button\" data-bs-target=\"#exampleModal\" data-bs-toggle=\"modal\"\n className=\"btn btn-secondary\" onClick={deleteGroup}>Delete Group</button>\n </div> \n </div>\n <div className=\"row m-2\">\n <div className=\"d-flex flex-wrap mb-1\">\n {\n //displayMembers()\n (size(members) > 0) ?\n members.map( (item, i) => {\n return (\n <div className=\"card m-2 shadow-sm\" key={i}>\n <div className=\"card-body\">\n <p>{item.firstName} | {item.knowName}</p>\n <button type=\"button\" class=\"btn btn-secondary\" onClick={()=>removeMember(item)}>Remove</button>\n </div>\n </div>\n )\n }) : ''\n }\n {addMembersCard()}\n </div>\n </div>\n </div>\n )\n }", "function joined(e) {\n userId = e.id;\n $('#controls').show();\n startPrompts();\n}", "function joinRoom(obj) {\r\n modal.style.display = \"block\";\r\n room = obj.id;\r\n}", "showGroupCreation() {\n this.setState({createGroupModal: true})\n }", "goToGroup() {\n let g = this.get('group');\n let r = this.get('router');\n //hide the modal\n this.set('open',false);\n r.transitionTo('authenticated.writing-groups.show.index', g.slug, { queryParams: { ps: \"false\" }});\n }", "function form_add_user(gid, gname){\n\t$.get(\n base_url + 'index.php/adm/groups_form_add_in/'+gid,\n {nohtml:'nohtml'},\n function(data){\n $(\"#modal-global-body\").html('<div class=\"well\">'+data+'</div>');\n } \n );\n $('#modal-global-label').html('<i class=\"fa fa-group\"></i>&nbsp;&nbsp;'+gname);\n $('#modal-global').modal('show');\n}", "function addMemberModal(id) {\n $('#addModal').modal('show');\n document.getElementById(\"addMemberButton\").onclick = () => addMember(id);\n document.getElementById(\"parentGroupEmailAdd\").innerHTML = groups[groups.findIndex(elem => elem.id == id)].email;\n\n // add all groups and users as options\n var memberOptions = [];\n memberOptions.push(\"<option value=null selected='selected'>Select member...</option>\");\n for (user of users) {\n memberOptions.push(\"<option value='\" + user.primaryEmail + \"' id='\" + user.primaryEmail + \"'>\" + user.primaryEmail + \" </option>\");\n }\n for (group of groups) {\n memberOptions.push(\"<option value='\" + group.email + \"' id='\" + group.email + \"'>\" + group.email + \" </option>\");\n }\n document.getElementById(\"add-member-sel\").innerHTML = memberOptions.join();\n\n displayTooltip = false;\n return tooltip.style(\"visibility\", \"hidden\");\n}", "onClickProfileSignIn(e) {\n e.preventDefault();\n\n if (this.signInModal) {\n this.signInModal.show();\n }\n\n }", "function group_add(){\n\t$.get(\n base_url + 'index.php/adm/groups_get_form',\n {nohtml:'nohtml'},\n function(data){\n $(\"#modal-global-body\").html('<div class=\"well\">'+data+'</div>');\n } \n );\n $('#modal-global-label').html('<i class=\"fa fa-group\"></i>&nbsp;&nbsp;Nouveau groupe');\n $('#modal-global').modal('show');\n}", "function displayModal() {\n\t\t\t\t$(\"#user-name\").text(newPerson.name);\n\t\t\t\t$(\"#match-name\").text(matchName);\n\t\t\t\t$(\"#match-img\").attr(\"src\", matchImage);\n\t\t\t\t$(\"#myModal\").modal();\n\t\t\t}", "function joinGroup() {\n const code = document.querySelector('#codyGroup').value\n console.log(code)\n fetch(\"http://localhost:3001/api/groups/joinGroup\", {\n method : 'POST',\n headers : {\n 'Content-Type' : 'application/json'\n },\n body: JSON.stringify({\n idparticipant : dt._id,\n groupcode : code\n })\n }).then(res => {\n return res.json()\n }).then(data => {\n //console.log(data.message)\n if(data.message === \"You Can Enter to The Group\"){\n //console.log(\"t9der tdkhl\")\n localStorage.setItem('code', code)\n localStorage.setItem('idSec', dt._id)\n window.location.href = \"/Group\"\n } else {\n //console.log(\"Group 3amr asat\")\n window.location.href = \"/User\"\n }\n //window.location.href = \"/Group\"\n })\n }", "static joinMemberships(req, res) {\n let id = +req.params.id\n Store.findAll()\n .then(data => {\n res.render('users/form-join-membership.ejs', {id, data})\n })\n .catch(err => {\n req.send(err)\n })\n }", "function join_room_pop() {\n join_room.css(\"display\", \"block\");\n }", "handleJoin() {\n var joined = this.state.joined;\n if (joined) {\n this.joinProject();\n } else {\n this.leaveProject();\n }\n this.handleClick();\n this.setMembers();\n }", "toggleModal () {\n if (this.props.toggleProfileModal === true) {\n return (\n <ProfileInlistModal />\n )\n }\n }", "render() {\n\t\treturn (\n\t\t\t<div className='Groups'>\n\t\t\t\t<header className='Groups-header'>\n\t\t\t\t\t<h1>Groups</h1>\n\t\t\t\t</header>\n\t\t\t\t<div>\n\t\t\t\t\t<h4 className=\"header-groups\">\n\t\t\t\t\t\tHere are all groups that are available, to view the group click on the card.When creating a Group you can make it private so it's an invite only.\n\t\t\t\t\t</h4>\n\t\t\t\t</div>\n\t\t\t\t{this.state.loading &&( \n\t\t\t\t\t<CircularProgress className=\"spinner\" /> \n\t\t\t\t)}\n\t\t\t\t<CardDeck>\n\t\t\t\t\t{this.state.groups.map(function(group, idx){\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Card key={idx} border=\"secondary\" style={{ width: '18rem' }}>\n\t\t\t\t\t\t\t\t\t<Card.Body>\n\t\t\t\t\t\t\t\t\t\t<Card.Title>{group.name}</Card.Title>\n\t\t\t\t\t\t\t\t\t\t<Card.Subtitle className=\"mb-2 text-muted\">{group.country_name}</Card.Subtitle>\n\t\t\t\t\t\t\t\t\t\t<Card.Subtitle className=\"mb-2 text-muted\">Users: {group.users}</Card.Subtitle>\n\t\t\t\t\t\t\t\t\t\t<Card.Text>\n\t\t\t\t\t\t\t\t\t\t\t{group.description}\n\t\t\t\t\t\t\t\t\t\t</Card.Text>\n\t\t\t\t\t\t\t\t\t\t<Button variant=\"primary\" href={ '/groups/' + group.id }>See Details</Button>\n\t\t\t\t\t\t\t\t\t</Card.Body>\n\t\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t})}\n\t\t\t\t</CardDeck>\n\t\t\t</div>\n\t\t);\n\t}", "render() {\n return (\n <Container >\n <ListGroup className=\"profile\">\n <ListGroupItem >\n <Row>\n <Col><NavLink href=\"/Home/:id/:password\"> + </NavLink> </Col>\n <Col><h3>Profile</h3></Col><Col /><Col /><Col />\n </Row>\n </ListGroupItem>\n <ListGroupItem>\n <Row>\n <h4> Guest Name </h4>\n <Col />\n <Col><img alt=\"UserEdit\" src={Tphoto} className=\"userEdit\" /></Col>\n </Row>\n </ListGroupItem>\n\n <ListGroupItem>\n <Row>\n <h5> Family </h5>\n <Col />\n <Col />\n <Col />\n <Col xs='1'> + </Col>\n </Row>\n </ListGroupItem>\n <ListGroupItem>\n <Row>\n <Col><img alt=\"UserEdit\" src={Tphoto} className=\"userEdit\" /></Col>\n <Col> Spouse </Col>\n <Col />\n <Col />\n <Col> Edit</Col>\n </Row>\n </ListGroupItem>\n <ListGroupItem>\n <Row>\n <Col><img alt=\"UserEdit\" src={Tphoto} className=\"userEdit\" /></Col>\n <Col> Child </Col>\n <Col />\n <Col />\n <Col> Edit</Col>\n </Row>\n </ListGroupItem>\n <ListGroupItem>\n <Row>\n <p> Add more people to your shared fridge, shopping list and recipies</p>\n </Row>\n </ListGroupItem>\n\n <ListGroupItem>\n <Row>\n <h5> Diet Preferences </h5>\n <Col />\n <Col />\n <Col />\n <Col xs='1'> + </Col>\n </Row>\n </ListGroupItem>\n <ListGroupItem>\n <Row>\n <p>Lactose Intolerant</p>\n </Row>\n </ListGroupItem>\n\n <ListGroupItem >\n <Row>\n <h5> Notifications </h5>\n <Col />\n <Col />\n <Col />\n <Col xs='1'> > </Col>\n </Row>\n </ListGroupItem>\n <ListGroupItem><NavLink href=\"/about\">\n <Row>\n <h5> About Us </h5>\n <Col />\n <Col />\n <Col />\n <Col xs='1'> > </Col>\n </Row> </NavLink>\n </ListGroupItem>\n <ListGroupItem >\n <Row>\n <h5> Settings </h5>\n <Col />\n <Col />\n <Col />\n <Col xs='1'> > </Col>\n </Row>\n </ListGroupItem>\n <ListGroupItem>\n <Row>\n <Col>\n <Button href=\"/\" size=\"lg\">Log Out</Button>\n </Col>\n </Row>\n </ListGroupItem>\n </ListGroup>\n </Container>\n );\n }", "render() {\n //conditional render online status\n //conditional render friend request button\n //conditional render defriend?\n //conditional render team request button?\n let status;\n if (this.props.friendDetails[0].onlineStatus === 'online') {\n status = <p>Online!</p>\n } else {\n status = <p>Offline.</p>\n }\n return (\n <Modal show={this.props.show} size=\"xl\" centered=\"true\">\n <Modal.Header>\n <Modal.Title>\n {this.props.friendDetails[0].userName}'s Profile\n </Modal.Title>\n </Modal.Header>\n <Modal.Body style={{'maxHeight': 'calc(50vh - 100px)', 'overflowY': 'auto'}} >\n <img src={this.props.friendDetails[0].profilePicture}/>\n <h3>Status:</h3>\n {status}\n <h3>Level:</h3>\n <p>{this.props.friendDetails[0].userType}</p>\n <h3>Region:</h3>\n <p>{this.props.friendDetails[0].region}</p>\n <h3>About {this.props.friendDetails[0].userName}:</h3>\n <p>{this.props.friendDetails[0].aboutMe}</p>\n </Modal.Body>\n <Modal.Footer>\n <Button onClick={(e) => {this.props.handleClickFriendDetail(e)}}>Close</Button>\n </Modal.Footer>\n </Modal>\n );\n }", "render() {\n if (this.state.isLoading) {\n return (\n <Loader/>\n )\n }\n if (this.state.error) {\n return <ErrorDisplay error={this.state.error}/>\n }\n\n let modalID = \"addUser\";\n\n //Create array of groups\n let groups = [];\n this.state.module.groups.forEach(group => {\n groups.push(<Group key={group.group_id} group={group}/>);\n });\n\n let userHeader = <h2>Groups and Users</h2>;\n if (this.state.module.can_edit) {\n userHeader = <HeaderButton main={userHeader} button={<CreateButton dataToggle={'modal'} dataTarget={modalID}/>}/>;\n }\n\n let postStatus = <h1>{this.state.postSuccess ? \"User added successfully\" : \"Adding user failed\"}</h1>;\n\n let tabs = {\n courses: <Courses refresh={this.componentDidMount} module={this.state.module}/>,\n settings: <div>\n <h1>Settings</h1>\n {userHeader}\n {groups}\n <form onSubmit={this.onFormSubmit}>\n <Modal id={modalID}\n header={\n <div className={\"modal-header\"}>\n <h1>Add user</h1>\n </div>\n }\n body={this.state.postSuccess === null ?\n <div className={\"modal-body\"}>\n <AddUserForm updateForm={this.updateForm} onChange={this.handleChange}/>\n </div>: postStatus}\n footer={\n <div className={\"modal-footer\"}>\n <button type=\"button\"\n className=\"btn btn-secondary\"\n data-dismiss=\"modal\"\n onClick={this.componentDidMount}>Close</button>\n {this.state.postSuccess === null ? <SaveButton submit/> : null}\n </div>}\n />\n </form>\n </div>,\n projectgroup: <ProjectGroups params={params} groups={this.state.module.groups}/>,\n };\n\n return (\n <div>\n <div className={\"jumbotron\"}>\n <h1>{this.state.module.name}</h1>\n <p>{this.state.module.description}</p>\n </div>\n {tabs[this.state.active]}\n\n </div>\n )\n }", "getJoinLeaveButton() {\n if (this.props.team.members.includes(this.props.user)) {\n return (\n <input type=\"button\"\n className=\"btn btn-danger btn-md\"\n onClick={this.leaveTeam.bind(this)} value=\"Leave\"/>\n );\n }\n else if (this.props.team.members.length >= this.props.team.maxPlayers) {\n return (<div className=\"fullTeam\">FULL</div>);\n }\n else {\n return (\n <input type=\"button\"\n className=\"btn btn-success btn-md\"\n onClick={this.joinTeam.bind(this)} value=\"Join\"/>\n );\n }\n }", "function func_join_room_pop() {\n join_room.css(\"display\", \"block\");\n}", "showProfile(joe) {\n \n this.soldierProfile.innerHTML = `\n\n <div class=\"card card-body mb-3\">\n <h2 class=\"card-title text-center card-header-name\">${joe.codename}</h2>\n <div class=\"row\">\n <div class=\"col-md-3 text-center\">\n <img class=\"img-fluid mb-2\" src=\"${joe.picture}\">\n\n </div>\n <div class=\"col-md-9\">\n <span class=\"badge badge-primary\">Faction: ${joe.faction}</span>\n <span class=\"badge badge-primary\">Sex: ${joe.sex}</span>\n <span class=\"badge badge-primary\">Height: ${joe.height}</span>\n <span class=\"badge badge-primary\">Weight: ${joe.weight}</span>\n\n <br><br>\n <ul class=\"list-group\">\n <li class=\"list-group-item\">Name: ${joe.name}</li>\n <li class=\"list-group-item\">Grade: ${joe.grade}</li>\n <li class=\"list-group-item\">Birthplace: ${joe.birthplace}</li>\n <li class=\"list-group-item\">Primary MOS: ${joe.primary}</li>\n <li class=\"list-group-item\">Secondary MOS: ${joe.secondary}</li>\n <li class=\"list-group-item\">Current: ${joe.current}</li>\n </ul>\n <br>\n <p class=\"list-group-item bio\">${joe.bio}</p>\n </div> \n </div>\n </div>\n `;\n \n document.querySelector('.nav-buttons').style.display = 'block';\n }", "function renderGroups(id, name, desc, groupSection) {\n let groupCard = \"\";\n for (let i = 0; i < id.length; i++) {\n\n // Bootstrap card template, \"Enter Group\" button redirects to Group Center page\n groupCard += `<div class=\"card mb-3\" style=\"max-width: 540px;\">\n <div class=\"row g-0\">\n <div class=\"col-md-8\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${name[i]}</h5>\n <p class=\"card-text\">${desc[i]}</p>\n <a href=\"./group-centre.html?${id[i]}\">\n <button id=\"${id[i]}\" type=\"button\" class=\"btn btn-danger btn-lg enter\">Enter Group</button>\n </a>\n </div>\n </div>\n </div>\n </div>`;\n }\n groupSection.innerHTML = groupCard;\n}", "function buildMeetUpGroups(groups) {\n $('#meetups-table').append($(\"<li>\").addClass(\"collection-item avatar\")\n .append($(\"<i>\").addClass(\"material-icons circle\").text(\"landscape\"))\n .append($(\"<a>\").text(groups.name).attr(\"href\", groups.link).attr(\"target\", \"_blank\"))\n .append($(\"<p>\").text(\"Active members: \" + groups.members))\n );\n}", "render() {\n if (this.state.data) {\n console.log(this.state.data.adminGroups.length)\n return (\n <div>\n {<Dialog\n open={this.state.showModal}\n onClose={() => this.setState({ showModal: false })}\n aria-labelledby=\"Delete Group\"\n aria-describedby=\"simple-modal-description\"\n >\n <DialogContent>\n <Container maxWidth=\"lg\">\n <Typography component=\"h5\" align=\"center\" variant=\"h5\" color=\"textPrimary\" gutterBottom>\n Are you sure you want to delete this group? All contents, including members and blog posts, will be deleted.\n </Typography>\n <Button style={{ marginLeft: \"auto\" }} id=\"delete\" variant=\"dark\" size=\"sm\" onClick={() => this.clickSubmitHandler()}>Confirm</Button>\n </Container>\n </DialogContent>\n </Dialog >}\n {<Dialog\n open={this.state.showLeaveModal}\n onClose={() => this.setState({ showLeaveModal: false })}\n aria-labelledby=\"Leave Group\"\n aria-describedby=\"simple-modal-description\"\n >\n <DialogContent>\n <Container maxWidth=\"lg\">\n <Typography component=\"h5\" align=\"center\" variant=\"h5\" color=\"textPrimary\" gutterBottom>\n Are you sure you want to leave this group?\n </Typography>\n <Button style={{ marginLeft: \"auto\" }} id=\"delete\" variant=\"dark\" size=\"sm\" onClick={() => this.clickLeaveHandler()}>Confirm</Button>\n </Container>\n </DialogContent>\n </Dialog >}\n <Container maxWidth=\"lg\">\n <Typography\n component=\"h2\"\n align=\"center\"\n variant=\"h2\"\n color=\"textPrimary\"\n gutterBottom\n >\n Dashboard\n </Typography>\n <hr\n style={{\n marginTop: \"-1rem\",\n backgroundColor: \"#3399FF\",\n width: \"200px\",\n height: \"3px\",\n }}\n />\n </Container>\n <Container style={{ padding: \"1.5rem 0\" }} maxWidth=\"md\">\n <Typography\n component=\"h5\"\n align=\"left\"\n variant=\"h5\"\n color=\"textPrimary\"\n style={{ paddingBottom: \"10px\" }}\n >\n Admin Groups\n </Typography>\n {this.state.data.adminGroups.length > 0 ? <Grid container spacing={4}>{this.state.data.adminGroups.map((card) => (\n <Grid item key={card} xs={6} sm={4} md={4}>\n <Card style={{ height: '100%', display: 'flex', flexDirection: 'column', padding: \"20px\" }}>\n <CardContent style={{ flexGrow: 1, padding: \"20px\" }}>\n <Typography style={{ marginBottom: \"25px\" }} gutterBottom variant=\"h4\" component=\"h4\">\n {card.groupName}</Typography>\n <Typography style={{ marginBottom: \"10px\" }}>\n {card.groupDescription.length > 74 ? card.groupDescription.substring(0, 74) + \"...\" : card.groupDescription}</Typography>\n </CardContent>\n <CardActions>\n <Button>\n <Link\n to={{\n pathname: \"/group/\" + card.groupId,\n state: {\n groupId: card.groupId\n },\n }}\n >\n View{\" \"}\n </Link>\n </Button>\n <Button size=\"medium\" onClick={() => this.handleDelete(card.groupId)}>\n Delete</Button>\n </CardActions>\n </Card>\n </Grid>\n ))}</Grid> :\n <Grid xs={6} sm={4} md={4}>\n <Container style={{ width: \"300%\", margin: \"auto\", padding: \"10px\" }}>\n <Typography gutterBottom variant=\"h5\" component=\"h2\" style={{ textAlign: \"center\", fontSize: \"20px\" }}>\n You have 0 created groups.\n </Typography>\n </Container>\n </Grid>}\n </Container>\n <hr\n style={{\n margin: \"1rem auto\",\n backgroundColor: \"#3399FF\",\n width: \"550px\",\n height: \"3px\",\n }}\n />\n <Container style={{ padding: \"1.5rem 0\" }} maxWidth=\"md\">\n <Typography\n component=\"h5\"\n align=\"left\"\n variant=\"h5\"\n color=\"textPrimary\"\n style={{ paddingBottom: \"10px\" }}\n >\n Joined Groups\n </Typography>\n {/* End hero unit */}\n {this.state.data.joinedGroups.length > 0 ? <Grid container spacing={4}>{this.state.data.joinedGroups.map((card) => (\n <Grid item key={card} xs={6} sm={4} md={4}>\n <Card style={{ height: '100%', display: 'flex', flexDirection: 'column', padding: \"20px\" }}>\n <CardContent style={{ flexGrow: 1, padding: \"20px\" }}>\n <Typography style={{ marginBottom: \"25px\" }} gutterBottom variant=\"h4\" component=\"h4\">\n {card.groupName}</Typography>\n <Typography style={{ marginBottom: \"10px\" }}>\n {card.groupDescription.length > 74 ? card.groupDescription.substring(0, 74) + \"...\" : card.groupDescription}</Typography>\n </CardContent>\n <CardActions>\n <Button>\n <Link\n to={{\n pathname: \"/group/\" + card.groupId,\n state: {\n groupId: card.groupId\n },\n }}\n >\n View\n </Link>\n </Button>\n <Button size=\"medium\" onClick={() => this.handleLeave(card.groupId)}>\n Leave</Button>\n </CardActions>\n </Card>\n </Grid>\n ))}</Grid> :\n <Grid xs={6} sm={4} md={4}>\n <Container style={{ width: \"300%\", margin: \"auto\", padding: \"10px\" }}>\n <Typography gutterBottom variant=\"h5\" component=\"h2\" style={{ textAlign: \"center\", fontSize: \"20px\" }}>\n You have 0 joined groups.\n </Typography>\n </Container>\n </Grid>}\n </Container>\n <hr\n style={{\n margin: \"1rem auto\",\n backgroundColor: \"#3399FF\",\n width: \"550px\",\n height: \"3px\",\n }}\n />\n <Container style={{ padding: \"1.5rem 0\" }} maxWidth=\"md\">\n <Typography\n component=\"h5\"\n align=\"left\"\n variant=\"h5\"\n color=\"textPrimary\"\n style={{ paddingBottom: \"10px\" }}\n >\n Saved Groups\n </Typography>\n {/* End hero unit */}\n {this.state.data.savedGroups.length > 0 ? <Grid container spacing={4}>{this.state.data.savedGroups.map((card) => (\n <Grid item key={card} xs={6} sm={4} md={4}>\n <Card style={{ height: '100%', display: 'flex', flexDirection: 'column', padding: \"20px\" }}>\n <CardContent style={{ flexGrow: 1, padding: \"20px\" }}>\n <Typography style={{ marginBottom: \"25px\" }} gutterBottom variant=\"h4\" component=\"h4\">\n {card.groupName}</Typography>\n <Typography style={{ marginBottom: \"10px\" }}>\n {card.groupDescription.length > 74 ? card.groupDescription.substring(0, 74) + \"...\" : card.groupDescription}</Typography>\n </CardContent>\n <CardActions>\n <Button>\n <Link\n to={{\n pathname: \"/group/\" + card.groupId,\n state: {\n groupId: card.groupId\n },\n }}\n >\n View{\" \"}\n </Link>\n </Button>\n </CardActions>\n </Card>\n </Grid>\n ))}</Grid> :\n <Grid xs={6} sm={4} md={4}>\n <Container style={{ width: \"300%\", margin: \"auto\", padding: \"10px\" }}>\n <Typography gutterBottom variant=\"h5\" component=\"h2\" style={{ textAlign: \"center\", fontSize: \"20px\" }}>\n You have 0 saved groups.\n </Typography>\n </Container>\n </Grid>}\n </Container>\n </div>\n );\n }\n return (\n <div>\n <Container maxWidth=\"lg\">\n <Typography\n component=\"h2\"\n align=\"center\"\n variant=\"h2\"\n color=\"textPrimary\"\n gutterBottom\n >\n Dashboard\n </Typography>\n <hr\n style={{\n marginTop: \"-1rem\",\n backgroundColor: \"#3399FF\",\n width: \"200px\",\n height: \"3px\",\n }}\n />\n </Container>\n <div>Loading...</div>\n </div>\n );\n }", "function showAddGroup(event){\r\n document.getElementById(\"groupList\").style.display = \"none\";\r\n document.getElementById(\"joinGroupForm\").style.display = \"none\";\r\n document.getElementById(\"groupForm\").style.display = \"block\";\r\n //console.log(\"Add Button Clicked.\");\r\n \r\n}", "function showModal() {\n setVisible(true);\n setSignUp(false);\n }", "render(){\n if(!Session.get(\"dataReady\"))\n {\n Session.set(\"waitBackURL\",\"/chat\");\n return(\n <Redirect to={\"/wait\"}/>\n )\n }\n else{\n // let sender=true;\n return (\n <div className=\"row\">\n <div class=\"col-md-3\">\n <div class=\"card\">\n <div class=\"card-header\">\n <h4 class=\"card-title\">Users Groups</h4>\n </div>\n <div class=\"card-content\">\n <div class=\"panel-group\" id=\"accordion\" role=\"tablist\" aria-multiselectable=\"true\">\n\t\t\t\t\t\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\" role=\"tab\" id=\"headingOne\">\n <a role=\"button\" data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapseOne\" aria-expanded=\"false\" aria-controls=\"collapseOne\" class=\"collapsed\">\n <h4 class=\"panel-title\">\n Doctors\n <i class=\"material-icons\">keyboard_arrow_down</i>\n </h4>\n </a>\n </div>\n <div id=\"collapseOne\" class=\"panel-collapse collapse\" role=\"tabpanel\" aria-labelledby=\"headingOne\" aria-expanded=\"false\" style={{height: 0}}>\n <div class=\"panel-body\">\n <table className=\"table table-hover table-fixed\">\n <thead className=\"text-success\">\n <tr>\n <th>Name</th>\n </tr>\n </thead>\n <tbody>\n {instance.state.loadPatientCompleted?\n\t\t\t\t\t\t\t\t\t\t\n instance.state.doctors.map((doctor)=>{\n\t\t\t\t\t\t\t\t\t\t\tdebugger;\n return(\n <tr onClick={instance.userSelect.bind(instance,doctor)}>\n <td>{doctor.name}</td>\n </tr>\n )\n })\n :\n <h3><i className=\"fa fa-spinner fa-pulse\"></i> Loading doctors...</h3>\n }\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\" role=\"tab\" id=\"headingTwo\">\n <a class=\"collapsed\" role=\"button\" data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapseTwo\" aria-expanded=\"false\" aria-controls=\"collapseTwo\">\n <h4 class=\"panel-title\">\n Staffs\n <i class=\"material-icons\">keyboard_arrow_down</i>\n </h4>\n </a>\n </div>\n <div id=\"collapseTwo\" class=\"panel-collapse collapse\" role=\"tabpanel\" aria-labelledby=\"headingTwo\" aria-expanded=\"false\">\n <div class=\"panel-body\">\n <table className=\"table table-hover table-fixed\">\n <thead className=\"text-success\">\n <tr>\n <th>Name</th>\n </tr>\n </thead>\n <tbody>\n {instance.state.loadPatientCompleted?\n instance.state.staffs.map((staff)=>{\n return(\n <tr onClick={instance.userSelect.bind(instance,staff)}>\n <td>{staff.name}</td>\n </tr>\n )\n })\n :\n <h3><i className=\"fa fa-spinner fa-pulse\"></i> Loading staffs...</h3>\n }\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\" role=\"tab\" id=\"headingThree\">\n <a class=\"collapsed\" role=\"button\" data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapseThree\" aria-expanded=\"false\" aria-controls=\"collapseThree\">\n <h4 class=\"panel-title\">\n Patients\n <i class=\"material-icons\">keyboard_arrow_down</i>\n </h4>\n </a>\n </div>\n <div id=\"collapseThree\" class=\"panel-collapse collapse\" role=\"tabpanel\" aria-labelledby=\"headingThree\" aria-expanded=\"false\">\n <div class=\"panel-body\">\n <table className=\"table table-hover table-fixed\">\n <thead className=\"text-success\">\n <tr>\n <th>Name</th>\n </tr>\n </thead>\n <tbody>\n {instance.state.loadPatientCompleted?\n instance.state.patients.map((patient)=>{\n return(\n <tr onClick={instance.userSelect.bind(instance,patient)}>\n <td>{patient.name}</td>\n </tr>\n )\n })\n :\n <h3><i className=\"fa fa-spinner fa-pulse\"></i> Loading patients...</h3>\n }\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\" role=\"tab\" id=\"headingFour\">\n <a class=\"collapsed\" role=\"button\" data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapseFour\" aria-expanded=\"false\" aria-controls=\"collapseFour\">\n <h4 class=\"panel-title\">\n Patients Contacts\n <i class=\"material-icons\">keyboard_arrow_down</i>\n </h4>\n </a>\n </div>\n <div id=\"collapseFour\" class=\"panel-collapse collapse\" role=\"tabpanel\" aria-labelledby=\"headingFour\" aria-expanded=\"false\">\n <div class=\"panel-body\">\n <table className=\"table table-hover table-fixed\">\n <thead className=\"text-success\">\n <tr>\n <th>Name</th>\n </tr>\n </thead>\n <tbody>\n {instance.state.loadPatientCompleted?\n instance.state.contacts.map((contact)=>{\n return(\n <tr onClick={instance.userSelect.bind(instance,contact)}>\n <td>{contact.name}</td>\n </tr>\n )\n })\n :\n <h3><i className=\"fa fa-spinner fa-pulse\"></i> Loading contacts...</h3>\n }\n </tbody>\n </table>\n </div>\n </div>\n </div>\n\t\t\t\t\t\t<div class=\"panel panel-default\">\n <div class=\"panel-heading\" role=\"tab\" id=\"headingOne\">\n <a role=\"button\" data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapseZero\" aria-expanded=\"false\" aria-controls=\"collapseOne\" class=\"collapsed\">\n <h4 class=\"panel-title\">\n Admin\n <i class=\"material-icons\">keyboard_arrow_down</i>\n </h4>\n </a>\n </div>\n <div id=\"collapseZero\" class=\"panel-collapse collapse\" role=\"tabpanel\" aria-labelledby=\"headingOne\" aria-expanded=\"false\" style={{height: 0}}>\n <div class=\"panel-body\">\n <table className=\"table table-hover table-fixed\">\n <thead className=\"text-success\">\n <tr>\n <th>Name</th>\n </tr>\n </thead>\n <tbody>\n {instance.state.loadPatientCompleted?\n\t\t\t\t\t\t\t\t\t\t\n instance.state.admins.map((admin)=>{\n\t\t\t\t\t\t\t\t\t\t\tdebugger;\n return(\n <tr onClick={instance.userSelect.bind(instance,admin)}>\n <td>{admin.name}</td>\n </tr>\n )\n })\n :\n <h3><i className=\"fa fa-spinner fa-pulse\"></i> Loading admins...</h3>\n }\n </tbody>\n </table>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n\n {instance.state.user.name.length>0?\n <div className=\"col-lg-9\">\n <h2> chat with {instance.state.user.name}</h2>\n <div className=\"frame\">\n <ul id=\"chatlist\" className=\"chat\">\n {instance.state.messages.map((message)=>{\n sender=(message.from===Meteor.userId());\n if(sender)\n return (\n <li key={message._id} tabIndex=\"1\" style={{width:\"100%\",marginTop: 25}}>\n <div className=\"msj macro\">\n <div className=\"avatar\"><img className=\"img-circle\" style={{width:\"100%\"}} src=\"/assets/img/from.jpg\" /></div>\n <div className=\"text text-l\">\n <p>{message.text}</p>\n <p><small>{message.dateTime}</small></p>\n </div>\n </div>\n </li>);\n else\n return (\n <li key={message._id} tabIndex=\"1\" style={{width:\"100%\",marginTop: 25}}>\n <div className=\"msj-rta macro\">\n <div className=\"text text-r\">\n <p>{message.text}</p>\n <p><small>{message.dateTime}</small></p>\n </div>\n <div className=\"avatar\" style={{padding:\"0px 0px 0px 10px !important\"}}>\n <img className=\"img-circle\" style={{width:\"100%\"}} src=\"/assets/img/to.jpg\" />\n </div>\n </div>\n </li>\n );\n })}\n </ul>\n <div>\n <div className=\"msj-rta macro\" style={{margin:\"auto\",width:\"100%\"}}>\n <div className=\"text text-r\" style={{background:\"whitesmoke !important\",width:\"100%\"}}>\n <form id=\"loginForm\" onSubmit={this.onSubmit.bind(this)}>\n <input ref=\"messageText\" className=\"mytext\" style={{width: \"100%\", color:\"black\"}} placeholder=\"Type a message\"/>\n {/* <button type=\"submit\" >send</button> */}\n </form>\n </div>\n </div>\n </div>\n </div>\n </div>\n :\"\"}\n </div>\n );\n }\n }", "function renderGroups (groups) {\n var _groupsUl = $U('#group-container');\n _groupsUl.innerHTML = '';\n\n var groupsUsers = $storage.get('groupsUsers') || {};\n\n groups.forEach(function (group) {\n var _li = _document.createElement('li');\n _li.innerHTML = group.name;\n _li.setAttribute('data-modal-target', 'view-group');\n _li.setAttribute('data-view-group', group.name);\n _li.addEventListener('click', function (event) {\n var _groupName = event.target.getAttribute('data-view-group');\n showGroup(_groupName);\n })\n _groupsUl.appendChild(_li);\n\n var _deleteButton = _document.createElement('button');\n _deleteButton.className = \"btn btn-circle delete-group right\";\n if(groupsUsers[group.name].length !== 0) {\n _deleteButton.classList.add('disabled');\n }\n _deleteButton.innerHTML = '-';\n _deleteButton.setAttribute('data-delete-group', group.name);\n _deleteButton.addEventListener('click', function (event) {\n event.stopPropagation();\n var _groupName = event.target.getAttribute('data-delete-group');\n if(groupsUsers[group.name].length === 0) {\n deleteGroup(_groupName);\n }\n else {\n _window.toast(\"Can not delete a group which has users in it.\")\n }\n })\n\n _li.appendChild(_deleteButton);\n })\n _window.initModals();\n }", "render() {\n\n // creates array of GroupName components\n let groupNames;\n if (this.state.groupNames !== null) {\n groupNames = this.state.groupNames.map(object => \n <GroupName\n id={object.id}\n title={object.name}\n activate={() => this.showGroup(object.id)}\n active={this.state.currGroup === object.id ? true : false}\n />);\n }\n \n // creates array of GroupMember components\n let memberComponents;\n if (this.state.groupsInfo !== null && this.state.groupsInfo.length > this.state.currGroup) {\n memberComponents = this.state.groupsInfo[this.state.currGroup]\n .map(member => \n <GroupMember \n name={member.username} \n pitches={member.pitches} \n />);\n }\n\n // sets loading style and name as appropriate based on groups user's a part of\n let groupName, groupDescription;\n if (!this.state.groupNames) {\n groupName = \"Loading...\";\n groupDescription = \"\";\n }\n else if (this.state.groupNames.length === 0) {\n groupName = \"Not a part of any groups yet\";\n groupDescription = \"\";\n }\n else {\n groupName = this.state.groupNames[this.state.currGroup].name;\n groupDescription = this.state.groupNames[this.state.currGroup].description;\n }\n\n // only displays add member and leave group buttons if user is in any groups\n let buttonStyle;\n if (!this.state.groupNames || this.state.groupNames.length === 0) {\n buttonStyle = {display: \"none\"};\n }\n else {\n buttonStyle = {display: \"inline-block\"};\n }\n \n return(\n <div className=\"Group\">\n <GroupSidebar groupNames={groupNames} />\n <BigGroupName groupName={groupName} />\n <GroupDescription groupDescription={groupDescription} />\n <GroupMemberContainer \n badUser={this.state.badUser}\n buttonStyle={buttonStyle}\n members={memberComponents}\n newMember={this.state.newMember}\n errorMessage={this.state.errorMessage}\n addMember={this.addMember}\n handleChange={this.handleChange}\n leaveGroup={this.leaveGroup}\n />\n </div>\n );\n }", "function showSignup() {\n\n // if (Auth.loggedIn()) {\n // return (\n // <div>\n // <div className=\"AddPetSection\">\n // <UserInfo />\n // <PetList />\n // </div>\n // </div>\n // );\n // } else {\n // return (\n // <div>\n // <Signup />\n // </div>\n // );\n // }\n }", "function showModal() {\n\t\tcurrent_username = this.textContent;\n\t\tno_of_friends = this.getAttribute(\"data-friends\");\n\t\tcurrent_modal = document.getElementsByClassName(\"modal\")[0];\n\t\tdocument.getElementsByClassName(\"modal__title\")[0].textContent = current_username;\n\t\tdocument.getElementsByClassName(\"modal__body\")[0].textContent = \"Number of friends: \" + no_of_friends;\n\t\tcurrent_modal.style.display = \"block\";\n\t\tcurrent_modal.nextElementSibling.style.display = \"block\";\n\t\tdocument.getElementsByClassName(\"modal__close\")[0].childNodes[0].addEventListener(\"click\", hideModalButton);\n\t\tdocument.getElementsByClassName(\"modal\")[0].addEventListener(\"click\", hideModalScreen);\n\t}", "function insertProfiles(results) { //passes results and appends them to the page\r\n $.each(results, function(index, user) {\r\n $('#gallery').append(\r\n `<div class=\"card\" id=${index}>\r\n <div class=\"card-img-container\">\r\n <img class=\"card-img\" src=\"${user.picture.large}\" alt=\"profile picture\">\r\n </div>\r\n <div class=\"card-info-container\">\r\n <h2 id=${index} class=\"card-name cap\">${user.name.first} ${user.name.last}</h2>\r\n <p class=\"card-text\">${user.email}</p>\r\n <p class=\"card-text cap\">${user.location.city}, ${user.location.state}</p>\r\n </div>\r\n </div>`);\r\n });\r\n\r\n//The modal div is being appended to the html\r\n function modalWindow() {\r\n $('#gallery').append(\r\n `<div class=\"modal-container\">\r\n <div class=\"modal\">\r\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\r\n <div class=\"modal-info-container\">\r\n </div>\r\n </div>\r\n </div>`);\r\n $('.modal-container').hide();\r\n }\r\n// I am formating the information I want the modal window to portray\r\n function modalAddon(user) {\r\n\r\n $(\".modal-info-container\").html( `\r\n <img class=\"modal-img\" src=\"${user.picture.large}\" alt=\"profile picture\">\r\n <h2 id=\"name\" class=\"modal-name cap\">${user.name.first} ${user.name.last}</h2>\r\n <p class=\"modal-text\">${user.email}</p>\r\n <p class=\"modal-text cap\">${user.location.city}</p>\r\n <br>_________________________________</br>\r\n <p class=\"modal-text\">${user.cell}</p>\r\n <p class=\"modal-text\">Postcode: ${user.location.postcode}</p>\r\n <p class=\"modal-text\">Birthday: ${user.dob.date}</p>\r\n </div>\r\n`);\r\n$(\".modal-container\").show();\r\n\r\n //This hide's the modal window when the \"X\" button is clicked\r\n $('#modal-close-btn').on(\"click\", function() {\r\n $(\".modal-container\").hide();\r\n });\r\n}\r\n\r\n\r\nmodalWindow(); //This opens the modal window when the card is clicked\r\n $('.card').on(\"click\", function() {\r\n let user = $('.card').index(this);\r\n modalAddon(results[user]);\r\n\r\n });\r\n\r\n}", "profileClickEvent () {\n const profileLinks = document.querySelectorAll('a.profile-link')\n for (let i = 0; profileLinks.length > i; i++) {\n profileLinks[i].addEventListener('click', function (e) {\n e.preventDefault()\n const profile = new Person(this.getAttribute('data-profile'))\n\n const profileData = phoneTap.mapProfile(profile)\n const log = phoneTap.log(profile)\n const modalTemplate = profileModal(profileData, log)\n\n const modalContainer = document.getElementById('profile-modal')\n modalContainer.innerHTML = modalTemplate\n document.getElementById('profile-modal-wrapper').classList.add('active')\n })\n }\n }", "function join_group(group_name){\n\n var room = group_name+\"@\"+group_server+\"/\"+my_name;\n var pres = $pres({to: room}).c('x', {xmlns: 'http://jabber.org/protocol/muc'}).tree();\n connection.sendIQ(pres);\n\n send_group_message(\"{'type':'tv'}\");\n if(current_programme && current_programme!=\"\"){\n send_group_message(get_status());\n }\n}", "render() {\n let joinDialog = this.state.joinEvent ? <Join open={true}/> : null;\n return (\n <div>\n <Header />\n {this.state.homePage && (\n <EventHome\n beginAddEvent={this.beginAddEvent}\n beginJoinEvent={this.beginJoinEvent}\n editEvent={this.editEvent}\n deleteEvent={this.deleteEvent}\n />\n )}\n {!this.state.homePage && (\n <AddEvent\n cancelEvent={this.cancelEvent}\n setHomePage={() => this.setHomePage()}\n editingEvent={this.state.editingEvent}\n idOfEditEvent={this.state.idOfEditEvent}\n />\n )}\n {joinDialog}\n </div>\n );\n }", "function coretModal(){\n $(\"#deleteModal .modal-body\").html(\"Yakin coret \"+currentProfile.tec_regno+\" (\"+currentProfile.name+\") ?\")\n $('#deleteModal').modal('show');\n}", "function modalMemberWithDataFake(data, currentUserId) {\r\n\tconst members = getMembersGroupFake(data.members, data.userId, currentUserId);\r\n\treturn `\r\n\t\t<div class=\"modal fade\" id=\"membersModal_${data._id}\" role=\"dialog\">\r\n\t\t\t<div class=\"modal-dialog modal-lg\">\r\n\t\t\t\t<div class=\"modal-content\">\r\n\t\t\t\t\t<div class=\"modal-header\">\r\n\t\t\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"modal\">&times;</button>\r\n\t\t\t\t\t\t<h4 class=\"modal-title\">Danh sách các thành viên trong nhóm.</h4>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"modal-body\">\r\n\t\t\t\t\t\t<ul class=\"list-members\">\r\n\t\t\t\t\t\t\t${members}\r\n\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t`;\r\n}", "function displayStudentModalName() {\n modalFullName.textContent = student.firstName; // Display student first name\n modalCredentials.querySelector(\"p\").textContent = `First name: ${student.firstName}`;\n\n // Display student middel name\n if (student.middleName !== null) {\n modalFullName.textContent += ` ${student.middleName}`;\n modalCredentials.querySelector(\"p:nth-child(2)\").textContent = `Middle name: ${student.middleName}`;\n } else {\n modalCredentials.querySelector(\"p:nth-child(2)\").textContent = \"\";\n }\n\n // Display student nick name\n if (student.nickName !== null) {\n modalFullName.textContent += ` \"${student.nickName}\"`;\n modalCredentials.querySelector(\"p:nth-child(3)\").textContent = `Nick name: ${student.nickName}`;\n } else {\n modalCredentials.querySelector(\"p:nth-child(3)\").textContent = \"\";\n }\n\n // Display student last name\n if (student.lastName !== null) {\n modalFullName.textContent += ` ${student.lastName}`;\n modalCredentials.querySelector(\"p:nth-child(4)\").textContent = `Last name: ${student.lastName}`;\n } else {\n modalCredentials.querySelector(\"p:nth-child(4)\").textContent = \"\";\n }\n }", "function DataUser(props) {\n\n const { user_data, theme } = props;\n const { user, projects } = user_data;\n const { profile_image, name, email, location, profile_views, ratings, followers, followed, about_me, createdAt } = user;\n\n // useState para abrir modal de los seguidores\n const [showModal, setShowModal] = useState(false);\n\n // useState para marcar el menu item activo\n const [activeItem, setActiveItem] = useState('Seguidores')\n\n const handleActive = name => {\n\n setActiveItem(name);\n\n }\n\n\n const openModal = () => {\n\n setShowModal(true)\n\n }\n\n const closeModal = () => {\n\n setShowModal(false);\n\n }\n\n return(\n <Segment className='data_user'>\n\n <Modal open={showModal} onClose={closeModal} size='small'>\n <Modal.Header style={{ background: theme ? '#010a10' : '#fff' }}>\n\n <Menu \n secondary \n stackable\n \n inverted={ theme ? true : false }\n style={{ margin: '0', display: 'flex', width: '25%', justifyContent: 'space-between' }}>\n\n <Menu.Item \n name='Seguidores' \n active={ activeItem === 'Seguidores' }\n onClick={ () => handleActive('Seguidores') }\n color='blue'\n style={{ fontWeight: 'bold', fontSize: '16px', color: 'black' }} />\n <Menu.Item \n name='Siguiendo' \n active={ activeItem === 'Siguiendo' }\n onClick={ () => handleActive('Siguiendo') }\n color='blue'\n style={{ fontWeight: 'bold', fontSize: '16px', color: 'black' }} />\n\n </Menu>\n\n </Modal.Header>\n\n <Modal.Content scrolling style={{ background: theme ? '#010a10' : '#fff' }}>\n <UsersFollow usersDB={usersDB} closeModal={closeModal} />\n </Modal.Content>\n </Modal>\n\n\n <Image src={profile_image} size='tiny' rounded/>\n <div className='profile_data_info' >\n <h2>{name}</h2>\n <span><Icon name='point' />{location}</span> <br/>\n <span><Icon name='mail' />{email}</span>\n\n <Icon className='icon_edit' name='pencil square' size='large'/>\n </div>\n\n <div className='profile_data_numbers'>\n \n <div>\n <h4>Visitas al perfil</h4><label>{profile_views}</label> \n </div>\n\n <div>\n <h4>Publicaciones</h4><label>{projects.length}</label> \n </div>\n \n <div>\n <h4>Favoritos</h4><label>{ratings.length}</label> \n </div>\n \n <div>\n <h4>Seguidores</h4><label className='profile_data_numbers_follow' onClick={openModal}>{followers.length}</label> \n </div>\n\n <div>\n <h4>Siguiendo</h4><label className='profile_data_numbers_follow' onClick={openModal}>{followed.length}</label> \n </div>\n \n <hr />\n\n <h3>Descripción</h3>\n <span>\n {about_me}\n </span>\n\n <hr />\n\n <span style={{ marginTop: '10px', textAlign: 'center', display: 'flex', justifyContent: 'center' }}>\n \n <p style={{ marginRight: '5px', color: 'rgb(17, 121, 177)' }}>Miembro desde:</p> { moment(createdAt).format(\"LL\") }\n\n </span>\n\n </div>\n \n </Segment>\n )\n\n}", "function modalAddon(user) {\r\n\r\n $(\".modal-info-container\").html( `\r\n <img class=\"modal-img\" src=\"${user.picture.large}\" alt=\"profile picture\">\r\n <h2 id=\"name\" class=\"modal-name cap\">${user.name.first} ${user.name.last}</h2>\r\n <p class=\"modal-text\">${user.email}</p>\r\n <p class=\"modal-text cap\">${user.location.city}</p>\r\n <br>_________________________________</br>\r\n <p class=\"modal-text\">${user.cell}</p>\r\n <p class=\"modal-text\">Postcode: ${user.location.postcode}</p>\r\n <p class=\"modal-text\">Birthday: ${user.dob.date}</p>\r\n </div>\r\n`);\r\n$(\".modal-container\").show();\r\n\r\n //This hide's the modal window when the \"X\" button is clicked\r\n $('#modal-close-btn').on(\"click\", function() {\r\n $(\".modal-container\").hide();\r\n });\r\n}", "function signUpClicked() {\n var modal = document.getElementById(\"signUpModal\");\n modal.style.display = \"block\";\n}", "function JoinUnjoinMeetupButton(props) {\n const createUserMeetupRelationship = () => {\n // POST to server\n fetch(`/api/users/${props.user.id}/meetups/${props.meetup.id}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n .then(res => res.json())\n .then(\n (data) => {\n props.setAttending(true);\n props.setAlert(data.message);\n }\n );\n }\n\n const deleteUserMeetupRelationship = () => {\n // POST to server\n fetch(`/api/users/${props.user.id}/meetups/${props.meetup.id}`, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n .then(res => res.json())\n .then(\n (data) => {\n props.setAttending(false);\n props.setAlert(data.message);\n }\n );\n }\n\n return (\n <React.Fragment>\n {!props.attending && (props.meetup.attendees_count < props.meetup.capacity) && \n <Button variant='warning' className='mb-3' onClick={createUserMeetupRelationship}>\n Join Meetup</Button>}\n {props.attending &&\n <Button variant='warning' className='mb-3' onClick={deleteUserMeetupRelationship}>\n Leave Meetup</Button> }\n </React.Fragment>\n );\n}", "function displayStudentModal(student) {\n document.querySelector(\"#student-modal\").innerHTML = \"\";\n let ModalContainer = document.querySelector(\"#student-modal\");\n let ModalTemplate = document.querySelector(\"#modal-template\");\n let clone = ModalTemplate.cloneNode(true).content;\n const modal = document.querySelector(\"#student-modal\");\n const modalFullName = clone.querySelector(\".student-fullname\");\n const modalCredentials = clone.querySelector(\".student-credentials\");\n const modalPhoto = clone.querySelector(\".student-modal-photo\");\n const modalCrest = clone.querySelector(\".house-crest img\");\n const modalFrame = clone.querySelector(\".info-container\");\n\n modal.style.display = \"flex\"; // Display the modal\n modalFrame.style.setProperty(\"--primary-color\", `var(--${student.house.toLowerCase()}-primary)`);\n modalFrame.style.setProperty(\"--secondary-color\", `var(--${student.house.toLowerCase()}-secondary)`);\n document.querySelector(\"body\").style.overflow = \"hidden\"; // Disable list movement to create focus on modal\n modalCredentials.querySelector(\"p:nth-child(5)\").textContent = `Blood status: ${student.bloodType}`; // Display blood status\n\n displayStudentModalName(); // Display student name in modal\n function displayStudentModalName() {\n modalFullName.textContent = student.firstName; // Display student first name\n modalCredentials.querySelector(\"p\").textContent = `First name: ${student.firstName}`;\n\n // Display student middel name\n if (student.middleName !== null) {\n modalFullName.textContent += ` ${student.middleName}`;\n modalCredentials.querySelector(\"p:nth-child(2)\").textContent = `Middle name: ${student.middleName}`;\n } else {\n modalCredentials.querySelector(\"p:nth-child(2)\").textContent = \"\";\n }\n\n // Display student nick name\n if (student.nickName !== null) {\n modalFullName.textContent += ` \"${student.nickName}\"`;\n modalCredentials.querySelector(\"p:nth-child(3)\").textContent = `Nick name: ${student.nickName}`;\n } else {\n modalCredentials.querySelector(\"p:nth-child(3)\").textContent = \"\";\n }\n\n // Display student last name\n if (student.lastName !== null) {\n modalFullName.textContent += ` ${student.lastName}`;\n modalCredentials.querySelector(\"p:nth-child(4)\").textContent = `Last name: ${student.lastName}`;\n } else {\n modalCredentials.querySelector(\"p:nth-child(4)\").textContent = \"\";\n }\n }\n\n displayStudentModalPrefect(); // Display student prefect status in modal\n function displayStudentModalPrefect() {\n if (student.isPrefect === true) {\n clone.querySelector(\".prefect\").textContent = \"Revoke prefect\";\n modalCredentials.querySelector(\"p:nth-child(6)\").textContent = `Prefect status: ${student.firstName} is prefect!`;\n } else {\n modalCredentials.querySelector(\"p:nth-child(6)\").textContent = `Prefect status: ${student.firstName} is not prefect!`;\n clone.querySelector(\".prefect\").textContent = \"Prefect student\";\n }\n }\n\n displayStudentModalInq(); // Display student inq squad status in modal\n function displayStudentModalInq() {\n if (student.isMemberOfInqSquad === true) {\n clone.querySelector(\".inquisitorial\").textContent = \"Revoke inquisitorial membership\";\n modalCredentials.querySelector(\"p:nth-child(7)\").textContent = `Inquisitorial squad status: Member!`;\n } else {\n clone.querySelector(\".inquisitorial\").textContent = \"Add to inquisitorial squad\";\n modalCredentials.querySelector(\"p:nth-child(7)\").textContent = `Inquisitorial squad status: Not a member!`;\n }\n\n if (student.bloodType !== \"Pure blood\") {\n clone.querySelector(\".inquisitorial\").classList.add(\"disabled\");\n clone.querySelector(\".inquisitorial\").disabled = true;\n clone.querySelector(\".inquisitorial\").textContent = \"Only pure-bloods can join the squad!\";\n }\n }\n\n displayStudentModalPhoto(); // Display student photo\n function displayStudentModalPhoto() {\n modalPhoto.src = `images/${student.photo}`;\n modalPhoto.alt = student.firstName;\n modalCrest.src = `images/${student.house}.png`;\n modalCrest.alt = `images/${student.house}.png`;\n }\n\n addStudentActions(); // Add eventlisteners to buttons if student is not expelled\n function addStudentActions() {\n if (allStudents.includes(student)) {\n clone.querySelector(\".prefect\").addEventListener(\"click\", prefectClick);\n function prefectClick() {\n checkPrefectStatus(student);\n }\n\n clone.querySelector(\".inquisitorial\").addEventListener(\"click\", inquisitorialClick);\n function inquisitorialClick() {\n toggleInquisitorial(student);\n }\n\n clone.querySelector(\".expel\").addEventListener(\"click\", expelClick);\n function expelClick() {\n document.querySelector(\".info-container\").classList.add(\"fade-out\");\n document.querySelector(\".info-container\").addEventListener(\"animationend\", () => {\n modal.style.display = \"none\";\n document.querySelector(\"body\").style.overflow = \"visible\";\n document.querySelector(\"body\").style.overflowX = \"hidden\";\n });\n expelStudent(student);\n }\n } else {\n clone.querySelectorAll(\".student-actions button\").forEach((button) => {\n button.classList.add(\"disabled\");\n button.disabled = true;\n });\n }\n }\n\n checkExpelledStatus(); // Check if student can be expelled\n function checkExpelledStatus() {\n if (student.canBeExpelled === false) {\n clone.querySelector(\".expel\").textContent = `Cannot be expelled!`;\n clone.querySelector(\".expel\").classList.add(\"disabled\");\n clone.querySelector(\".expel\").disabled = true;\n }\n }\n\n ModalContainer.appendChild(clone); // Add the modal to the parent container\n\n addFadeAnimation(); // Add fade animations to modal\n function addFadeAnimation() {\n document.querySelector(\".info-container\").classList.add(\"fade-in\");\n document.querySelector(\".info-container\").addEventListener(\"animationend\", () => {\n document.querySelector(\".info-container\").classList.remove(\"fade-in\");\n });\n\n document.querySelector(\".close-info\").addEventListener(\"click\", () => {\n document.querySelector(\".info-container\").classList.add(\"fade-out\");\n document.querySelector(\".info-container\").addEventListener(\"animationend\", () => {\n modal.style.display = \"none\";\n document.querySelector(\"body\").style.overflow = \"visible\";\n document.querySelector(\"body\").style.overflowX = \"hidden\";\n });\n });\n }\n}", "function handleAddMemeber () {\n \n if (selectGroup) { //if it is define\n let cid = document.getElementById('memberID').value\n if (size(cid) >= 9) {\n let url = Config.api.tgMembers + '?action=add&group_id='+selectGroup.id+'&cid='+cid\n Axios.get(url)\n .then( (resp) => {\n setMembers(resp.data.data)\n document.getElementById('memberID').value = ''\n })\n }\n } else {\n setToast({ show: true, action: '', msg: 'Please select or create a group first.', type: ''}) \n }\n }", "function fillremovememberpopup(group, user) {\n document.getElementById('removemember-popup').innerHTML = 'Remove member from group?<p align=\"center\"><a href=\"javascript:void(0);\" onclick=\"javascript:removegroupmember(' + group + ',' + user + ')\">Yes</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript:void(0);\" onclick=\"javascript:closepopup(\\'fade\\');\">Cancel</a></p>';\n}", "function updateGroupPage() {\n showMessage(\"Users have been added to the group\");\n $rootScope.$emit(\"InitGroup\", {});\n }", "function openModal(e) {\r\n // console.log(\"e.target.id: \", e.target.id)\r\n fetch(`${url}/${e.target.id}`)\r\n .then(res => res.json())\r\n .then(res => {\r\n let info = res.results[0]\r\n console.log(info)\r\n let name = info.name\r\n let fullName = info.biography['full-name'] \r\n let alterEgos = info.biography['alter-egos'] \r\n let occupations = info.work.occupation\r\n let intelligence = info.powerstats.intelligence\r\n let strength = info.powerstats.strength\r\n let speed = info.powerstats.speed \r\n let affiliations = info.connections[\"group-affiliation\"]\r\n\r\n infoName.innerText = name;\r\n infoFullName.innerText = `Full Name: ${fullName}`;\r\n\r\n let infoOccupations = document.createElement(\"p\")\r\n infoOccupations.innerHTML = `<strong>Occupations:</strong> ${occupations}` \r\n infoStats.appendChild(infoOccupations)\r\n\r\n let infoIntelligence = document.createElement(\"p\")\r\n infoIntelligence.innerHTML = `<strong>Intelligence: </strong> ${intelligence} / 100`\r\n infoStats.appendChild(infoIntelligence)\r\n\r\n let infoStrength = document.createElement(\"p\")\r\n infoStrength.innerHTML = `<strong>Strength: </strong> ${strength} / 100`\r\n infoStats.appendChild(infoStrength)\r\n\r\n let infoSpeed = document.createElement(\"p\")\r\n infoSpeed.innerHTML = `<strong>Speed: </strong> ${speed} / 100`\r\n infoStats.appendChild(infoSpeed)\r\n\r\n infoAffiliations.innerText = affiliations\r\n\r\n modal.style.display = 'block';\r\n })\r\n .catch(err => {\r\n console.log(\"Error: \", err)\r\n })\r\n\r\n \r\n}", "function closeProfileModal() {\n setIsProfileModal(false);\n }", "async postGroupJoinedMessage(message) {\n if (message.type == 'group_joined') {\n const allowedUsers = [this.user.id, this.authorised_user.id];\n const isTruelyPrivate = await this.groupUsersOnlyContains(\n message.channel.id,\n allowedUsers\n );\n\n let join_message = 'To connect a facebook chat type: \\n' +\n '@facebot chat `<friend name>`';\n if (!isTruelyPrivate) {\n join_message = 'You can only connect private channels where me and you are the only users.';\n }\n\n this.postMessage(message.channel.id, join_message, {\n as_user: true,\n });\n }\n }", "function displayAgentProfileModal() {\n\t\t \tvar action = $(\"#agentProfileModal\").attr(\"action\");\n\t\t \tif(action == 'Show Profile of') {\n\t\t \t\t$(\"#agentProfileModal\").modal(\"show\");\n\t\t \t\tshowHideOldPassword();\n\t\t \t\tshowHideChangePassModal();\n\t\t \t}\n\t\t }", "render() {\n return <div>{this.renderManagementModal()}</div>\n }", "function show_users(id){\n jQuery.ajax({\n url:'php/group/getalluser.php',\n type:'post',\n data:{id:id},\n success:function(data){\n $(\"#showgroupuser\").modal('show');\n $(\"#showgroupuser-body\").html(data);\n },\n error:function(){\n alert(\"Network error. Failed to fetch data\");\n }\n });\n }", "function openThankModal(key) {\n var ul = $(\"#createdLink\");\n\n jQuery(\"<li>\", {\n class: \"list-group-item\",\n html: \"yt-link.com/\" + key\n }).appendTo(ul);\n\n jQuery(\"<li>\", {\n class: \"list-group-item\",\n html: \"yt-link.co/\" + key\n }).appendTo(ul);\n\n jQuery(\"<li>\", {\n class: \"list-group-item\",\n html: \"ytlink.co/\" + key\n }).appendTo(ul);\n\n $(\"#thankModal\").modal();\n loadRegistredMembers();\n}", "render(){\n return(\n <div className=\"modal-dialog\">\n <div className=\"modal-content\">\n <div className=\"modal-header\">\n <h4 className=\"modal-title\">SIGN UP</h4>\n </div>\n <div className=\"modal-body\">\n <form onSubmit={this.submitForm}>\n <div className=\"input-group\">\n <span className=\"input-group-addon\"><i className=\"glyphicon glyphicon-eye-open\"></i></span>\n <input type=\"text\" id=\"username\" placeholder=\"USERNAME\" className=\"form-control\"\n onChange={this.handleChange}\n required \n />\n </div>\n <div className=\"input-group\">\n <span className=\"input-group-addon\"><i className=\"glyphicon glyphicon-user\"></i></span>\n <input type=\"text\" id=\"fullname\" placeholder=\"FULLNAME\" className=\"form-control\"\n onChange={this.handleChange}\n required\n />\n </div>\n <div className=\"input-group\">\n <span className=\"input-group-addon\"><i className=\"glyphicon glyphicon-envelope\"></i></span>\n <input type=\"email\" id=\"email\" placeholder=\"EMAIL\" className=\"form-control\"\n onChange={this.handleChange}\n required\n />\n </div>\n <div className=\"input-group\">\n <span className=\"input-group-addon\"><i className=\"glyphicon glyphicon-lock\"></i></span>\n <input type=\"password\" id=\"password\" placeholder=\"PASSWORD\" className=\"form-control\"\n onChange={this.handleChange}\n required\n />\n </div>\n <div className=\"input-group\">\n <span className=\"input-group-addon\"><i className=\"glyphicon glyphicon-lock\"></i></span>\n <input type=\"password\" id=\"confirmpassword\" placeholder=\"CONFIRM PASSWORD\" className=\"form-control\"\n onChange={this.handleChange}\n required\n />\n </div>\n <br />\n <div className=\"form-group\">\n <input className=\"btn btn-success btn-md\" type=\"submit\" name=\"submit\" id=\"btnsignup\" value=\"CREATE ACCOUNT\" />\n </div> \n </form>\n </div>\n </div>\n </div>\n );\n }", "renderPage() {\n return (\n <Container>\n <Header style={{ color: 'white', paddingBottom: 5 }} as=\"h2\" textAlign=\"center\">\n List of Planned Dives\n </Header>\n {this.props.profile.dives.length > 0 ? (\n _.map(this.props.profile.dives, plan => {\n return (\n <Modal\n closeIcon\n closeOnDimmerClick={false}\n trigger={\n <Button>\n <Header as=\"h3\" textAlign=\"center\">\n {plan.date}\n </Header>\n </Button>\n }\n >\n <Modal.Header>{plan.date}</Modal.Header>\n <Modal.Content>\n <Card.Group>{this.renderCard(plan)}</Card.Group>\n </Modal.Content>\n </Modal>\n );\n })\n ) : (\n <h3 style={{ color: 'white' }}>No Dives Planned</h3>\n )}\n </Container>\n );\n }", "function MembersTable(props) {\r\n\tif (props.members.get_group_names().length == 0) {\r\n\t\treturn (\r\n\t\t\t<div>\r\n\t\t\t\t<AddGroup inputName={props.inputName} inputMembers={props.inputMembers}\r\n\t\t\t\t\tonInputNameChange={props.onInputNameChange}\r\n\t\t\t\t\tonInputMembersChange={props.onInputMembersChange}\r\n\t\t\t\t\tonAddGroup={props.onAddGroup} />\r\n\t\t\t\t<div>There are no groups.</div>\r\n\t\t\t</div>\r\n\t\t\t);\r\n\t}\r\n\treturn (\r\n\t\t<div>\r\n\t\t\t<AddGroup inputName={props.inputName} inputMembers={props.inputMembers}\r\n\t\t\t\tonInputNameChange={props.onInputNameChange}\r\n\t\t\t\tonInputMembersChange={props.onInputMembersChange}\r\n\t\t\t\tonAddGroup={props.onAddGroup} />\r\n\t\t\t<table className=\"table table-striped borderless\">\r\n\t\t\t\t<Header \r\n\t\t\t\t\tgroupNames={props.members.get_group_names()} \r\n\t\t\t\t\tonDeleteGroup={props.onDeleteGroup}\r\n\t\t\t\t\tonAddAllMembersToGroup={props.onAddAllMembersToGroup}/>\r\n\t\t\t\t<Body \r\n\t\t\t\t\tmembers={props.members}\r\n\t\t\t\t\tplugNames={props.plugNames}\r\n\t\t\t\t\tinputName={props.inputName} inputMembers={props.inputMembers}\r\n\t\t\t\t\tonMemberChange={props.onMemberChange}\r\n\t\t\t\t\tonDeleteGroup={props.onDeleteGroup}\r\n\t\t\t\t\tonInputNameChange={props.onInputNameChange}\r\n\t\t\t\t\tonInputMembersChange={props.onInputMembersChange}\r\n\t\t\t\t\tonAddGroup={props.onAddGroup}\r\n\t\t\t\t\tonAddMemberToAllGroups={props.onAddMemberToAllGroups}\r\n\t\t\t\t\tonRemoveMemberFromAllGroups={props.onRemoveMemberFromAllGroups} />\r\n\t\t\t</table>\r\n\t\t</div>\r\n\t\t);\r\n}", "function showUserList(elmId) {\n var treeview = window.tvGroup;\n\n if (treeview.SelectedNode != null && treeview.SelectedNode.ID.substr(0, 1) != \"C\") {\n popupWindow.setUrl('SYS_ChooseUsers.aspx?Include=user&WithOutSide=Y&withgroup=n');\n popupWindow.setSize(250, 400);\n popupWindow.showPopup(elmId, false);\n }\n else {\n alert(\"请先选中用户组,再进行添加组用户操作!\");\n return false;\n }\n}", "function memberJoinedProject(data) {\n s.membersEditBody.html(data.membersEditPartial);\n s.membersBody.html(data.membersBodyPartial);\n $('.modal-form__member-select').append($('<option>', {\n value: data.memberId,\n text: data.memberUsername\n }));\n\n $(\".members-edit__list\").select2();\n }", "function openModal(player) {\n modal.style.display = \"block\";\n modal_text.innerHTML = `<b>Player ${player}</b> won the game!!!`\n}", "renderDeleteUserModal(id, type) {\n const {showDeleteUserModal} = this.state;\n if (showDeleteUserModal) {\n return (\n <DeleteUserModal\n id = {id}\n type = {type}\n handleClose = {() => this.closeDeleteUserModal()}\n refresh = {() => this.props.fetchPeople()} />\n );\n }\n }", "function renderGroupMsgs(id, name, groupMsgs) {\n let groupMsgCard = \"\";\n for (let i = 0; i < id.length; i++) {\n\n // Bootstrap card template, \"Enter Group\" button redirects to Group Center page\n groupMsgCard += `<div class=\"card mb-3\" style=\"max-width: 540px;\">\n <div class=\"row g-0\">\n <div class=\"col-md-8\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${name[i]}</h5>\n <a href=\"./group-msgs.html?${id[i]}\">\n <button id=\"${id[i]}\" type=\"button\" class=\"btn btn-danger btn-lg enter\">Enter Group Chat</button>\n </a>\n </div>\n </div>\n </div>\n </div>`;\n }\n groupMsgs.innerHTML = groupMsgCard;\n}", "render() {\n const { signInUsername, signInPassword } = this.state\n return (\n <div>\n <Form>\n <Modal isOpen={this.props.opened} toggle={this.props.toggle} >\n <ModalHeader toggle={this.props.toggle}>Welcome</ModalHeader>\n <ModalBody>\n <FormGroup>\n <Input \n value={signInUsername}\n type=\"text\"\n className=\"form-control\"\n onChange={this.onUsernameChange}\n placeholder=\"Username\"\n />\n </FormGroup>\n\n <FormGroup>\n <Input \n value={signInPassword}\n type=\"password\"\n className=\"form-control\"\n onChange={this.onPasswordChange}\n placeholder=\"Password\"\n />\n </FormGroup>\n\n </ModalBody>\n <ModalFooter>\n <Link to=\"/admin/dashboard\"> <Button color=\"primary\" onClick={this.onSubmitSignIn}>Login</Button></Link>\n <Button color=\"secondary\" onClick={this.props.toggle}>Cancel</Button>\n </ModalFooter>\n </Modal>\n </Form>\n </div>\n );\n\n }", "renderModal() {\n return (\n <WarningModal leave={this.props.isPlaying}\n leaveCourt={ ()=> this.leaveCourt() }\n courtId={ this.props.courtId }\n />\n );\n }", "function GroupView() {\n\n\n const [open, setOpen] = React.useState(false);\n const [userOpen, setUserOpen] = React.useState(false);\n const [group, setGroup] = useState(\"\");\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down('sm'));\n const [search, setSearch] = useState(\"\")\n const [searchArch, setSearchArch] =useState(\"\")\n const [page, setPage] = React.useState(0);\n const [rowsPerPage, setRowsPerPage] = React.useState(10);\n\n const goToGroup = (groupId) => {\n history.push(`/group_view/${groupId}`)\n }\n const params = useParams()\n const dispatch = useDispatch();\n const history = useHistory();\n const store = useSelector(store => store);\n const user = useSelector((store) => store.user);\n const orgName = useSelector((store) => store.affiliate);\n const [selectedPerson, setSelectedPerson] = useState(\"\")\n\n\n const handleChangePage = (event, newPage) => {\n setPage(newPage);\n };\n\n const handleChangeRowsPerPage = (event) => {\n setRowsPerPage(parseInt(event.target.value, 10));\n setPage(0);\n };\n\n useEffect(() => {\n if (params.id === undefined) {\n dispatch({ type: 'FETCH_AFFILIATE', payload: search });\n dispatch({ type: 'FETCH_ALL_USER_EVENT' });\n dispatch({ type: 'FETCH_ALL_USER_EVENT' });\n dispatch({ type: 'FETCH_USER_GROUP' });\n } else {\n dispatch({ type: 'GET_AFFILIATION', payload: params.id });\n dispatch({ type: 'FETCH_AFFILIATE_USER', payload: params.id });\n\n }\n }, [search]);\n\n useEffect(() => {\n dispatch({ type: 'FETCH_ALL_USER_EVENT' });\n dispatch({ type: 'FETCH_ALL_USER_EVENT' });\n dispatch({ type: 'FETCH_USER_GROUP' });\n dispatch({ type: 'FETCH_ARCHIVED_GROUPS', payload: searchArch });\n }, [searchArch]);\n \n\n //Calculates the number of users subscribed to a group\n const memberCount = (groupId) => {\n let count = 0;\n for (let item of store.userGroup) {\n if (groupId === item.group_id) {\n count++;\n }\n }\n return count;\n }\n\n // Clicking on a volunteer will history/push you to their user page.\n const goToUser = (user) => {\n dispatch({ type: 'FETCH_ONE_USER', payload: user.id }) \n history.push(`/userdetails/${user}`)\n };\n\n // Click to remove a volunteer from that affiliation. \n const removeUser = () => {\n dispatch({\n type: 'REMOVE_USER_GROUP',\n payload: {\n user_id: selectedPerson.id,\n group_id: selectedPerson.group_id,\n parameter: params.id\n }\n })\n handleCloser()\n };\n\n // Click to remove an entire group/affiliation\n const removeGroup = () => {\n dispatch({ type: 'REMOVE_GROUP', payload: params.id });\n history.push('/group_view');\n };\n\n // Restores group from archived status\n const restoreGroup = () => {\n dispatch({ type: 'RESTORE_GROUP', payload: params.id })\n history.push('/group_view')\n };\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleClickOpener = (user) => {\n setSelectedPerson(user)\n setUserOpen(true);\n };\n const handleCloser = () => {\n\n setUserOpen(false);\n };\n\n const phoneFormater = (phoneNumb) => {\n let format = ('' + phoneNumb).replace(/\\D/g, '');\n let match = format.match(/^(\\d{3})(\\d{3})(\\d{4})$/);\n if (match) {\n return '(' + match[1] + ')' + match[2] + '-' + match[3];\n }\n return phoneNumb;\n }\n\n function handleSubmit() {\n dispatch({ type: 'ADD_AFFILIATION', payload: { name: group } });\n setGroup(\"\");\n dispatch({ type: 'FETCH_AFFILIATE' });\n }\n\n return (\n <>\n <h1 className=\"header\">Group View</h1>\n <Container>\n {store.affiliate.length === 1 && params.id != undefined ?\n <>\n <h1>{store.affiliate[0].college_name}</h1>\n <div>\n <Button\n variant=\"contained\"\n onClick={() => history.push(\"/group_view\")}>\n All Groups\n </Button>\n <Dialog\n fullScreen={fullScreen}\n open={open}\n onClose={handleClose}\n aria-labelledby=\"responsive-dialog-title\"\n >\n <DialogTitle id=\"responsive-dialog-title\">{`Are you sure you want to archive ${store.affiliate[0].college_name} ?`}</DialogTitle>\n <DialogContent>\n <DialogContentText>\n If you do they will be set to \"archived\" and only Admins will be able to retrive them.\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button autoFocus onClick={handleClose} variant=\"contained\" >\n Cancel\n </Button>\n <Button onClick={handleClose, removeGroup} variant=\"contained\" style={{ color: \"white\", backgroundColor: \"#FF0000\" }} autoFocus>\n Archive Group\n </Button>\n </DialogActions>\n </Dialog>\n </div>\n <br></br>\n <TableContainer component={Paper}>\n <Table id=\"groupView\" className=\"groupViewContainer\">\n <TableHead>\n <TableRow>\n <StyledTableCell>Last Name</StyledTableCell>\n <StyledTableCell>First Name</StyledTableCell>\n <StyledTableCell>Email</StyledTableCell>\n <StyledTableCell>Phone Number</StyledTableCell>\n <StyledTableCell align=\"center\" colSpan=\"2\">Actions</StyledTableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {(store.affiliateUser[0]) && store.affiliateUser.map((affiliates) =>\n\n <StyledTableRow key={affiliates.id}>\n <StyledTableCell>{affiliates.last_name}</StyledTableCell>\n <StyledTableCell>{affiliates.first_name}</StyledTableCell>\n <StyledTableCell>{affiliates.email}</StyledTableCell>\n <StyledTableCell>{phoneFormater(affiliates.phone_number)}</StyledTableCell>\n <StyledTableCell align=\"center\"><Button variant=\"contained\" onClick={() => goToUser(affiliates.id)}>View User</Button></StyledTableCell>\n {/* <StyledTableCell align=\"center\"><button onClick={() => dispatch({ type: 'REMOVE_USER_GROUP', payload: { user_id: affiliates.id, group_id: affiliates.group_id, parameter: params.id } })}>Remove</button></StyledTableCell> */}\n <StyledTableCell>\n <Button variant=\"contained\" style={{ backgroundColor: \"#FF0000\", color: \"white\" }} onClick={() => handleClickOpener(affiliates)}>\n Remove From Group\n </Button>\n </StyledTableCell>\n </StyledTableRow>\n )}\n\n </TableBody>\n </Table>\n </TableContainer>\n <Dialog\n fullScreen={fullScreen}\n open={userOpen}\n onClose={handleCloser}\n aria-labelledby=\"responsive-dialog-title\"\n >\n <DialogTitle id=\"responsive-dialog-title\">{`Are you sure you want to remove ${selectedPerson.first_name} ${selectedPerson.last_name}?`}</DialogTitle>\n <DialogContent>\n <DialogContentText>\n Are you sure you want to remove this user from this affiliation?\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button autoFocus onClick={handleCloser} variant=\"contained\">\n Cancel\n </Button>\n <Button onClick={() => removeUser()} style={{ color: 'white', backgroundColor: '#FF0000' }} autoFocus>\n Remove User\n </Button>\n </DialogActions>\n </Dialog>\n <br></br>\n <br></br>\n {store.affiliate[0].inactive === true ?\n <Button variant=\"contained\" color=\"default\" onClick={() => restoreGroup()}>Unarchive Group</Button>\n :\n <Button variant=\"contained\" style={{ backgroundColor: \"#FF0000\", color: \"white\" }} onClick={() => handleClickOpen()}>\n Archive Group\n </Button>} &nbsp; &nbsp;\n\n <Button\n component={ReactHTMLTableToExcel}\n variant=\"contained\"\n id=\"test-table-xls-button\"\n className=\"download-table-xls-button\"\n table=\"groupView\"\n filename=\"Group Members\"\n sheet=\"GroupMembers.xls\"\n buttonText=\"Download Group Members\" ></Button>\n </>\n :\n <>\n {/* {store.affiliate[0] && */}\n <div className=\"groupListContainer\">\n <TextField label=\"Search Active Groups\" style={{width:\"50%\", paddingBottom:\"10px\"}} value={search} onChange={(e) => setSearch(e.target.value)} />\n <TableContainer component={Paper}>\n <Table id=\"SO College Members\">\n <TableHead>\n <StyledTableRow>\n <StyledTableCell>Active Groups</StyledTableCell>\n <StyledTableCell>Total Members</StyledTableCell>\n <StyledTableCell></StyledTableCell>\n </StyledTableRow>\n </TableHead>\n <TableBody>\n {/* {(store.allUsers[0] && store.allUsers.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((user) => */}\n {(store.affiliate[0]) && store.affiliate.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((affiliate) =>\n <StyledTableRow key={affiliate.id}>\n <StyledTableCell>{affiliate.college_name}</StyledTableCell>\n <StyledTableCell>{(store.userGroup[0]) && memberCount(affiliate.id)}</StyledTableCell>\n <StyledTableCell><Button variant=\"contained\" color=\"default\" onClick={() => goToGroup(affiliate.id)}>View</Button></StyledTableCell>\n </StyledTableRow>\n )}\n </TableBody>\n </Table>\n <TablePagination\n rowsPerPageOptions={[10, 25, 50]}\n component=\"div\"\n count={store.affiliate.length}\n rowsPerPage={rowsPerPage}\n page={page}\n onChangePage={handleChangePage}\n onChangeRowsPerPage={handleChangeRowsPerPage}\n />\n </TableContainer>\n <br></br>\n <TableContainer component={Paper}>\n <Table id=\"addNewGroup\">\n <TableHead>\n <StyledTableRow>\n <StyledTableCell colSpan=\"3\">Add a New Group</StyledTableCell>\n </StyledTableRow>\n </TableHead>\n <TableBody>\n <StyledTableRow>\n <StyledTableCell>\n <TextField\n style={{width:'60%'}}\n value={group}\n type=\"text\"\n label=\"Input New Group Name\"\n onChange={(e) => setGroup(e.target.value)}\n />\n \n </StyledTableCell>\n <StyledTableCell>\n <Button\n type=\"submit\"\n variant=\"contained\"\n onClick={handleSubmit}>\n Add Group to List\n </Button>\n </StyledTableCell>\n </StyledTableRow>\n </TableBody>\n </Table>\n </TableContainer>\n <br/><br/>\n {store.user.access_level > 2 &&\n <>\n <TextField label=\"Search Archived Groups\" style={{ width: '50%',paddingBottom:\"10px\" }} value={searchArch} onChange={(e) => setSearchArch(e.target.value)} />\n <TableContainer component={Paper}>\n <Table id=\"SO College Members\">\n <TableHead>\n <StyledTableRow>\n <StyledTableCell>Archived Groups</StyledTableCell>\n <StyledTableCell>Total Members</StyledTableCell>\n <StyledTableCell></StyledTableCell>\n </StyledTableRow>\n </TableHead>\n <TableBody>\n {(store.archivedGroups[0]) && store.archivedGroups.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((affiliate) =>\n <StyledTableRow key={affiliate.id}>\n <StyledTableCell>{affiliate.college_name}</StyledTableCell>\n <StyledTableCell>{(store.userGroup[0]) && memberCount(affiliate.id)}</StyledTableCell>\n <StyledTableCell><Button variant=\"contained\" color=\"default\" onClick={() => goToGroup(affiliate.id)}>View</Button></StyledTableCell> \n </StyledTableRow>\n )}\n </TableBody>\n </Table>\n <TablePagination\n rowsPerPageOptions={[10, 25, 50]}\n component=\"div\"\n count={store.archivedGroups.length}\n rowsPerPage={rowsPerPage}\n page={page}\n onChangePage={handleChangePage}\n onChangeRowsPerPage={handleChangeRowsPerPage}\n />\n </TableContainer>\n </>}\n <br></br>\n \n </div>\n </>}\n </Container></>\n );\n}", "renderClaimButton(item) {\n return (\n <div>\n <div>\n <button type=\"button\" className=\"btn btn-default\" data-toggle=\"modal\" data-target={\"#myModal\"+item._id}>Claim</button>\n </div>\n {this.renderQuantityModal(item)}\n </div>\n )\n }", "function openModalCreateUser() {\n\t$('.modal-user-title').text(\"Thêm người dùng mới\");\n\t$('#modal-user').modal({\n\t\tshow : 'true'\n\t});\n}", "function openModalCreateUser() {\n\t$('.modal-user-title').text(\"Thêm người dùng mới\");\n\t$('#modal-user').modal({\n\t\tshow : 'true'\n\t});\n}", "function leaveGroup(group){\n //add the logged-in users to the add group myForm\n //alert(group);\n $('#leaveGroup').text('You are about to leave group: '+group); //starting from a clean slate\n $('#leaveGroup').attr('value',group);\n //open leaveGroup dialog box\n $(\"#leaveGroup\").dialog(\"open\");\n }", "async joinGroup(\n { commit },\n { name, userId, groupId, foundGroupName, groups }\n ) {\n const alreadyMember = isAlreadyMember(groupId, groups);\n if (alreadyMember) {\n alert(\n \"You are already a member of this group! Please search for another group.\"\n );\n commit(\"reset\");\n } else {\n commit(\"setLoading\", { of: \"JoinGroup\", to: true });\n const newMembers = state.foundGroupMembers.map((member) => {\n return member;\n });\n newMembers.push({\n pk: `user_${userId}`,\n name,\n });\n\n const newGroup = {\n groupId: `group_${groupId}`,\n groupName: foundGroupName,\n admin: 0,\n };\n\n // get existing user groups from database first, then make an updated array including new group\n let existingGroupsArray;\n\n try {\n const getGroups = await API.get(\n \"undercoverElfApi\",\n `/users/${userId}/profile`,\n {}\n );\n existingGroupsArray = getGroups;\n } catch (error) {\n console.log(error);\n commit(\"setCreatingGroup\", error);\n }\n\n const updatedGroupArray = [...existingGroupsArray.body.groups, newGroup];\n\n API.post(\n \"undercoverElfApi\",\n `/users/${userId}/groups?groupId=${groupId}`,\n {\n body: {\n userInfo: {\n admin: 0,\n groupName: foundGroupName,\n name,\n wishlist: [],\n },\n newMembers,\n updatedGroupArray,\n },\n }\n )\n .then((response) => {\n alert(`Successfully joined group!`);\n commit(\"setLoading\", { of: \"JoinGroup\", to: false });\n router.push({ path: \"/\" });\n })\n .catch((err) => {\n commit(\"setLoading\", { of: \"JoinGroup\", to: false });\n console.log(err, \"postUserInGroup error\");\n });\n }\n }", "render() {\n\n return (\n <AuthContext.Consumer>\n {([userData, setUserData]) => (\n <div>\n <div id=\"my-modal\">\n <div className=\"modal-content\">\n <div className=\"modal-header\">\n <span className=\"close\">&times;</span>\n <h2>Register Member</h2>\n </div>\n <div className=\"modal-body\">\n <div className=\"login-box\">\n {/* <img\n class=\"avatar\"\n src={require(\"..//../Asseets/images/avatar.png\")}\n alt=\"logo\"\n /> */}\n {/* <h1>Login Here</h1> */}\n <form>\n {/* <p>Username</p> */}\n <input type=\"text\" placeholder=\"Fullname\"/>\n {/* <p>Password</p> */}\n <input type=\"text\" placeholder=\"Contact\"/>\n <input type=\"text\" placeholder=\"Location\"/>\n <input type=\"text\" placeholder=\"Age\"/>\n <label htmlFor=\"gender-select\" className=\"badge-light\"> Select Gender</label>\n <ListBox id=\"gender-select\" value={this.state.selectedGender} options={this.state.genderList} onChange={(e) => this.setState({selectedGender: e.value})} optionLabel=\"name\"/><br/>\n <label htmlFor=\"lang-select\" className=\"badge-light\"> Select language</label> <br/>\n <MultiSelect id=\"lang-select\" value={this.state.selectedLanguage} options={userData.systemLanguages} onChange={(e) => this.setState({selectedLanguage: e.value})} optionLabel=\"name\"/><br/>\n <label htmlFor=\"family-select\" className=\"badge-light\">Role in Family</label> <br/>\n <Dropdown id=\"family-select\" value={this.state.selectedFamilyRole} options={userData.familyRoles} onChange={(e) => this.setState({selectedFamilyRole: e.value})} optionLabel=\"name\"/><br/>\n <div className=\"p-inputgroup\">\n <span className=\"p-inputgroup-addon\">\n <Checkbox checked={this.state.isFamilyHead} onChange={(e) => {\n this.setState({\n isFamilyHead: !this.state.isFamilyHead});\n this.setState({headFamilyNumber: this.state.isFamilyHead ? userData.userLogin.phone: ''})\n }} />\n </span>\n <input type=\"text\" placeholder=\"check the the box if you're the family head\" value={this.state.headFamilyNumber} disabled={this.state.isFamilyHead}/>\n </div>\n <input type=\"submit\" name=\"submit\" value=\"Submit\"/>\n {/* <a href=\"#\">Forget Password</a> */}\n </form>\n </div>\n\n\n </div>\n {/* <div class=\"modal-footer\">\n <h3>Modal Footer</h3>\n </div> */}\n </div>\n </div>\n </div>\n\n )}\n </AuthContext.Consumer>\n );\n }", "renderPage() {\n const email = Meteor.user().username;\n // Create the form schema for uniforms. Need to determine all interests and projects for muliselect list.\n const interests = _.pluck(ProfilesInterests.collection.find({ profile: email }).fetch(), 'interest');\n const profile = Profiles.collection.findOne({ email });\n\n return (\n <div className='pages-background' id='userprofile-page' style={{ paddingTop: '50px' }}>\n <Container className='containers' >\n <Header id='welcome2' as=\"h2\" style={{ textAlign: 'center' }}>{profile.firstName}&nbsp;{profile.lastName}</Header>\n <Grid id=\"UserProfile-page\" container centered>\n\n <Grid.Row>\n <Grid.Column width={5}>\n <Image size='massive' src={profile.picture}/>\n </Grid.Column>\n <Grid.Column width={10}>\n\n <Item.Group relaxed>\n\n <Item>\n <Item.Header as='h5'>Email:</Item.Header>\n <Item.Content verticalAlign='middle'>&nbsp;{profile.email}</Item.Content>\n </Item>\n\n <Item>\n <Item.Header as='h5'>Title:</Item.Header>\n <Item.Content verticalAlign='middle'>&nbsp;{profile.title}</Item.Content>\n </Item>\n\n <Item>\n <Item.Header as='h5'>Bio:</Item.Header>\n <Item.Content verticalAlign='middle'>&nbsp;{profile.bio}</Item.Content>\n </Item>\n\n <Item>\n <Item.Header as='h5'>Food Preferences:</Item.Header>\n <Item.Content verticalAlign='middle'>{_.map(interests,\n (interest, index) => <Label style={{ margin: '5px' }} key={index} size='large' color='teal'>{interest}</Label>)}</Item.Content>\n </Item>\n\n </Item.Group>\n </Grid.Column>\n\n <Grid.Column width={1}>\n <Label attached='bottom right'>\n <Icon name='setting' />\n <Link as={NavLink} id=\"editUser-Button\" activeClassName=\"active\" exact to=\"/edituser\" key='home'>Edit</Link>\n </Label>\n </Grid.Column>\n\n </Grid.Row>\n\n </Grid>\n </Container>\n\n <div className='green-gradient'>\n <Container style={{ paddingTop: '200px' }}>\n </Container>\n </div>\n\n </div>\n );\n }", "function createRemoveMemberModal(list) {\n $(\"#editMemberTitle\").text(\"Delete\");\n $(\"#deleteMsg\").text(`Are you sure you want to delete ${list.MemberName} from this team?`);\n}", "renderPage() {\n const popupStyle = {\n position: 'fixed',\n width: '100%',\n height: '100%',\n top: '0',\n left: '0',\n right: '0',\n bottom: '0',\n margin: 'auto',\n backgroundColor: 'rgba(0,0,0, 0.5)',\n };\n const me = Meteor.user().username;\n const innerStyle = {\n position: 'absolute',\n width: '80%',\n height: '550px',\n left: '10%',\n top: '10%',\n margin: 'auto',\n };\n const popupStyle2 = {\n position: 'fixed',\n width: '100%',\n height: '100%',\n top: '0',\n left: '0',\n right: '0',\n bottom: '0',\n margin: 'auto',\n backgroundColor: 'rgba(0,0,0, 0.5)',\n };\n const innerStyle2 = {\n position: 'absolute',\n width: '50%',\n height: '500px',\n left: '25%',\n top: '10%',\n margin: 'auto',\n };\n const userOptions = [];\n User.find({}).fetch().map((user) => userOptions.push({ key: user._id, value: user.email, text: user.email }));\n return (\n <div style={{ paddingTop: '30px', paddingBottom: '70px' }}>\n <Image src={'/images/manoalist-circle.png'}\n size={'small'}\n centered/>\n <Header style={{ marginTop: '10px', paddingBottom: '15px' }} as={'h2'}\n content={'Administrator Page'}\n textAlign={'center'}/>\n <Divider hidden/>\n <Container style={{ verticalAlign: 'middle' }}>\n <Grid columns={ 5 }\n container>\n <Grid.Column as={NavLink} exact to={'/list'} textAlign={'center'}>\n <Icon name={'spy'} size={'huge'}/>\n <Header as={'h3'} content={'Monitor Items'}/>\n </Grid.Column>\n <Grid.Column textAlign={'center'} style={{ color: '#4183c4' }}\n onClick={this.handleOpenRestore}>\n <Icon link name={'user cancel'} size={'huge'}/>\n <Header as={'h3'} content={'Banned Users'}/>\n </Grid.Column>\n <Grid.Column as={NavLink} exact to={'/addCate'} textAlign={'center'}>\n <Icon name={'add circle'} size={'huge'}/>\n <Header as={'h3'} content={'Create New Categories'}/>\n </Grid.Column>\n <Grid.Column textAlign={'center'} style={{ color: '#4183c4' }}\n onClick={this.handleOpenSendEmail}>\n <Icon link name={'comment alternate outline'} size={'huge'}/>\n <Header as={'h3'} content={'Send Notification'}/>\n </Grid.Column>\n <Grid.Column textAlign={'center'} style={{ color: '#4183c4' }}\n onClick={this.handleOpenInbox}>\n <Icon link name={'envelope'} size={'huge'}/>\n <Header as={'h3'} content={'Inbox'}/>\n </Grid.Column>\n </Grid>\n <Divider hidden/>\n <Grid relaxed columns={2} style={{ paddingTop: '40px' }}>\n <Grid.Column floated='left' width={8}>\n <Header dividing>Reported Items</Header>\n <Segment.Group raised>\n {this.props.items\n .filter(item => item.sold === false)\n .filter(item => item.flagged === true)\n .filter(item => item.owner !== me)\n .map((item, index) => <AdminBan key={index} item={item}/>)}\n </Segment.Group>\n </Grid.Column>\n <Grid.Column floated='right' width={8}>\n <Header dividing>Items Pending Approval</Header>\n <Segment.Group raised>\n {this.props.items\n .filter(item => item.forSale === true)\n .filter(item => item.approvedForSale === false)\n .map((item, index) => <AdminApproveItem key={index} item={item}/>)}\n </Segment.Group>\n </Grid.Column>\n </Grid>\n </Container>\n\n\n {this.state.openInbox ? <div>\n <div style={popupStyle}/>\n <Segment style={innerStyle}>\n <Button icon={'close'}\n floated={'right'}\n circular\n onClick={this.handleClose}/>\n <Header as={'h1'}\n textAlign={'center'}\n content={'INBOX'}/>\n <Divider/>\n <Segment.Group style={{ height: '80%', overflow: 'auto' }}>\n {this.props.emails.map((email, index) => <EmailItem email={email} key={index}/>)}\n {this.props.emails.length <= 0 ? <Header textAlign={'center'} as={'h1'}\n content={'There is no message for you'}/> : ''}\n </Segment.Group>\n </Segment>\n </div> : ''}\n {/* send notification POPUP */}\n {this.state.openSendEmail ? <div>\n <div style={popupStyle}/>\n <Segment style={innerStyle}>\n <Button icon={'close'} floated={'right'} circular onClick={this.handleClose}/>\n <Header as={'h1'} textAlign={'center'} content={'SEND EMAIL'}/>\n <Divider/>\n <Form onSubmit={this.handleSubmit}>\n <Form.Field required label={'Recipient'}/>\n <Form.Field><Dropdown\n fluid\n name={'recipient'}\n options={userOptions}\n placeholder='User Email Address'\n onChange={this.handleFormChange}\n selection\n search/>\n {this.state.recipientError ? <Label pointing size={'large'}\n prompt>\n <Icon name={'warning circle'}/>\n Please fill out this field\n </Label> : ''}\n </Form.Field>\n <Form.Input required\n label='Subject'\n type='subject'\n name='subject'\n onChange={this.handleFormChange}\n placeholder='Subject'/>\n <Form.TextArea style={{ maxHeight: 162, height: 162 }}\n required\n label='Content'\n name='content'\n onChange={this.handleFormChange}\n type='content'/>\n <Form.Button content='Send' color={'blue'}/>\n </Form>\n </Segment>\n </div> : ''}\n {this.state.openRestore ? <div>\n <div style={popupStyle2}/>\n <Segment style={innerStyle2}>\n <Button icon={'close'}\n floated={'right'}\n circular\n onClick={this.handleCloseRestore}/>\n <Header as={'h1'}\n textAlign={'center'}\n content={'Banned Users List'}/>\n <Divider/>\n <Segment.Group style={{ height: '80%', overflow: 'auto' }}>\n {this.props.users\n .filter(user => user.isBanned === true)\n .map((user, index) => <BannedUsers user={user} key={index}/>)}\n </Segment.Group>\n </Segment>\n </div> : ''}\n </div>\n );\n }", "function SuccessMC(props) {\n return (\n <>\n\n <Modal\n {...props}\n size=\"lg\"\n aria-labelledby=\"contained-modal-title-vcenter\"\n centered\n >\n <Modal.Header closeButton>\n\n <Modal.Title id=\"contained-modal-title-vcenter\">\n\n Subscribed!\n\n </Modal.Title>\n\n </Modal.Header>\n\n <Modal.Body className=\"sModal\">\n\n <h3> <i className=\"fas fa-thumbs-up fa-2x\"></i> </h3>\n\n <br/>\n \n <h3>\n\n You are now signed up for our dope monthly newsletter!\n\n </h3>\n\n </Modal.Body>\n\n <Modal.Footer>\n\n <Button onClick={props.onHide}>Close</Button>\n\n </Modal.Footer>\n\n </Modal>\n\n\n\n\n </>\n )\n}", "function generateModal(speaker){\n const name = speaker.slice(1,speaker.length);\n const user = data.find(item => item.id === name.toLowerCase());\n\n const baseTemplate = `<div class=\"modal fade\" id=\"${name}\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"exampleModalLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog modal-lg\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-body\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n <div class=\"row\">\n <div class=\"col-lg-6 modal-left modal-content\">\n <div class=\"speaker-header row\">\n <div class=\"col-4 speaker-avatar\">\n <img src=\"${static_url}/images/${user.id}.jpg\" class=\"img-fluid rounded-circle\" />\n </div>\n <div class=\"col-8 speaker-info\">\n <h2 class=\"speaker-name\">${user.name}</h2>\n <h3 class=\"speaker-company\">${user.company}</h3>\n <h3 class=\"speaker-place\">${user.place}</h3>\n </div>\n </div>\n <p class=\"speaker-description\"> ${user.description} </p>\n <ul class=\"speaker-medias list-inline\">\n ${generateIcons(user.socials)}\n </ul>\n </div>\n <div class=\"col-lg-6 modal-right modal-portfolio\">\n <div class=\"row no-gutters\">\n <div class=\"col-12\">\n <img src=\"${static_url}/images/${user.id}/1.jpg\" class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"row no-gutters\">\n <div class=\"col-6\">\n <img src=\"${static_url}/images/${user.id}/2.jpg\" class=\"img-fluid\" />\n </div>\n <div class=\"col-6\">\n <img src=\"${static_url}/images/${user.id}/3.jpg\" class=\"img-fluid\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>`;\n let e = document.createElement('div');\n e.innerHTML = baseTemplate;\n let speakerModal = document.querySelector('#speaker-modal');\n speakerModal.appendChild(e);\n}", "render() {\n return (\n <Portal>\n {this.renderModal()}\n </Portal>\n )\n }", "function signupClick() {\n var modalSignup = document.getElementById(\"modal-signup\");\n modalSignup.style.display = \"block\";\n}", "function ModalChooseLevel(props) {\n return (\n <Modal\n {...props}\n size=\"lg\"\n aria-labelledby=\"contained-modal-title-vcenter\"\n centered\n >\n <Modal.Header closeButton>\n <Modal.Title id=\"contained-modal-title-vcenter\">\n Choisir le niveau de jeu\n </Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <Row className=\"text-center\">\n {/* --------------ACCES JEU 1 NIVEAU 1-------------- */}\n <Col><Button variant=\"outline-primary\">\n <Link to={`/TouchGameLevelOne/${props.to}`} style={{ textDecoration: 'none', color: 'black' }}>Touch N1</Link>\n </Button></Col>\n {/* --------------ACCES JEU 1 NIVEAU 2-------------- */}\n <Col><Button variant=\"outline-primary\">\n <Link to={`/TouchGameLevelTwo/${props.to}`} style={{ textDecoration: 'none', color: 'black' }}>Touch N2</Link>\n </Button></Col>\n {/* --------------ACCES JEU 1 NIVEAU 3-------------- */}\n <Col><Button variant=\"outline-primary\"><Link to={`/TouchGameLevelThree/${props.to}`} style={{ textDecoration: 'none', color: 'black' }}>Touch N3</Link></Button></Col>\n </Row>\n <Row className=\"text-center mt-2\">\n <Col><Button variant=\"outline-primary\">\n <Link to={`/TapGameLevelOne/${props.to}`} style={{ textDecoration: 'none', color: 'black' }}>Tap N1</Link>\n </Button></Col>\n <Col><Button variant=\"outline-primary\">\n <Link to={`/TapGameLevelTwo/${props.to}`} style={{ textDecoration: 'none', color: 'black' }}>Tap N2</Link>\n </Button></Col>\n <Col><Button variant=\"outline-primary\">\n <Link to={`/TapGameLevelThree/${props.to}`} style={{ textDecoration: 'none', color: 'black' }}>Tap N3</Link>\n </Button></Col>\n </Row>\n </Modal.Body>\n <Modal.Footer>\n <Button onClick={props.onHide}>Close</Button>\n </Modal.Footer>\n </Modal>\n );\n}", "function setJoinsItems(obj, event_category) {\n event_category = obj.closest('.social_data_all').attr('data-category').substring(0, 11);\n\n if (event_category == 'past_events') {\n obj.closest('.social_data_all').find(\"#side_panel_join_text\").html(t(\"did you join?\"));\n } else {\n obj.closest('.social_data_all').find(\"#side_panel_join_text\").html(t(\"would you like to join?\"));\n obj.closest('.social_data_all').find(\"#join_guests\").show();\n }\n}", "function collegeInfo(college) {\n Modal.info({\n title: 'College Detail',\n content: (\n <div>\n <p>College ID : {college._id}</p>\n <p>Name : {college.name}</p>\n <p>Since : {college.year_founded}</p>\n <p>City : {college.city}</p>\n <p>State : {college.state}</p>\n <p>Country : {college.country}</p>\n <p>No. of Students : {college.no_of_students}</p>\n <p>Courses Offered:</p>\n <ul>\n {college.courses.map(course=>{\n return <li key={course}>{course}</li>\n })}\n </ul>\n <a href={\"/similar/?id=\"+college._id}>Show Similar Colleges</a>\n <br/>\n <a href={\"/students/?id=\"+college._id}>Show Students List</a>\n \n </div>\n ),\n onOk() {},\n });\n }", "function renderModal(new_user) {\n $(\".modal\").addClass(\"is-active\"); \n }", "function onCreateNewStaffClick() {\n $('#modal-register-staff').modal('show');\n }", "function show_group_profile(group_id) {\n // start the spinner\n var select_group_opts = spinner_options();\n var select_group_target = document.getElementById('group_middle_spinner');\n var select_group_spinner = new Spinner(select_group_opts).spin(select_group_target);\n \n // Load the view\n $.get('/dashboard/get_group_details', {\n 'group_id': group_id\n }, function (data) {\n if (data != '') {\n $('#groups_content .middle').hide();\n $('#groups_content .middle').html(data);\n $('#groups_content .middle').show(\"fast\");\n \n // Remove following handler\n $('#groups_content .remove_following').confirmDiv(function() {\n $.get('/dashboard/remove_group_following', {\n group_id: $('.group_profile_header').attr('group_id')\n }, function (data) {\n populate_edit_groups_list();\n $('.middle').html(\"<div style=\\\"text-align:center; color:gray; position:relative; top:3px;\\\"> Select a group on the left or right to see its profile </div>\");\n });\n });\n \n // Remove joined handler\n $('#groups_content .remove_joined').confirmDiv(function() {\n $.get('/dashboard/remove_group_joined', {\n group_id: $('.group_profile_header').attr('group_id')\n }, function (data) {\n populate_edit_groups_list();\n $('.middle').html(\"<div style=\\\"text-align:center; color:gray; position:relative; top:3px;\\\"> Select a group on the left or right to see its profile </div>\");\n });\n });\n \n // Add joined handler\n $('#groups_content .add_joined').confirmDiv(function() {\n $.get('/dashboard/add_group_joined', {\n group_id: $('.group_profile_header').attr('group_id')\n }, function (data) {\n populate_edit_groups_list();\n $('.middle').html(\"<div style=\\\"text-align:center; color:gray; position:relative; top:3px;\\\"> Select a group on the left or right to see its profile </div>\");\n });\n });\n \n // Request add joined handler\n $('#groups_content .request_to_join').confirmDiv(function() {\n $.get('/dashboard/request_join_group', {\n group_id: $('.group_profile_header').attr('group_id')\n }, function (data) {\n populate_edit_groups_list();\n $('.middle').html(\"<div style=\\\"text-align:center; color:gray; position:relative; top:3px;\\\"> Select a group on the left or right to see its profile </div>\");\n });\n });\n \n // Invite people\n $('#groups_content .middle .invite_people').click(function() {\n open_invite_modal('group', $('.group_profile_header').attr('group_id'), $('.group_profile_header').attr('priv_type'));\n })\n \n // set the view list click handler\n $('#view_group_list').click(function(){\n populate_group_member_panel(group_id);\n });\n \n // Add following click handler.\n $('.group_bottom_text .add_following').confirmDiv(function(clicked_elem) {\n $.get('/dashboard/add_group_following', {\n 'group_id': group_id\n }, function (data) {\n // Repopulate the groups list and select the recently followed group\n populate_edit_groups_list(function() {\n $('#edit_groups_list .group_entry[group_id = \"' + group_id + '\"]').click();\n });\n \n // Clear and hide search boxes\n $('#group_search').val('');\n $('#group_search').keyup();\n $('#group_search').focus();\n });\n });\n } \n }).complete(function(){\n select_group_spinner.stop(); // stop the spinner\n });\n}", "function uncoretModal(){\n $(\"#uncoretModal .modal-body\").html(\"Yakin kembalikan \"+currentProfile.tec_regno+\" (\"+currentProfile.name+\") ?\")\n $('#uncoretModal').modal('show');\n}", "function userModal () {\n const modal = helper.buildModal('user-modal','userMod-content');\n return modal;\n}", "function renderModal() {\n return `\n <!-- New Collection Modal -->\n <div class=\"add-collection-modal\">\n <div class=\"demo-card-wide mdl-card mdl-shadow--2dp\">\n <div class=\"mdl-card__title\">\n <h2 class=\"mdl-card__title-text\">Give your Collection a name</h2>\n </div>\n <div class=\"mdl-card__supporting-text\">\n <span class=\"helper-text\">Maybe your planning a holiday, or a romantic date night.</span>\n <form id=\"new-collection\" action=\"#\">\n <div class=\"mdl-textfield mdl-js-textfield\">\n <input class=\"mdl-textfield__input\" type=\"text\" id=\"collection-name\">\n <label class=\"mdl-textfield__label\" for=\"collection-name\">Enter a name</label>\n </div>\n </form>\n </div>\n <div class=\"mdl-card__actions\">\n <a href=\"#\" class=\"mdl-button create-collection\">Create Collection</a>\n </div>\n </div>\n <button class=\"mdl-button mdl-js-button mdl-button--icon mdl-button--colored close-modal\">\n <i class=\"material-icons\">close</i>\n </button>\n </div>\n `\n}", "function group_edit(tid){\n\t$.get(\n base_url + 'index.php/adm/groups_get_form/'+tid,\n {nohtml:'nohtml'},\n function(data){\n $(\"#modal-global-body\").html('<div class=\"well\">'+data+'</div>');\n } \n );\n $('#modal-global-label').html('<i class=\"fa fa-group\"></i>&nbsp;&nbsp;Edition groupe');\n $('#modal-global').modal('show');\n}", "render() {\n const { members } = this.props.members;\n console.log(this.props.members);\n\n return (\n <div>\n {/* show modal based on state value */}\n {this.renderAddModal()}\n {this.renderUpdateModal()}\n {this.renderDeleteModal()}\n <p className='success'>{this.state.success}</p>{' '}\n <div className='container'>\n <button\n className='btn btn-info'\n onClick={this.onAddClick}\n id='add-member-button'\n >\n Add Member\n </button>\n <br />\n <br />\n <table className='table table-bordered table-striped'>\n <thead className='bg-info text-light'>\n <tr>\n <th>ID</th>\n <th>Name</th>\n <th>Role</th>\n <th>Actions</th>\n </tr>\n </thead>\n <tbody>\n {members.map(member => (\n <tr key={member._id}>\n <td>{member._id}</td>\n <td>{member.name}</td>\n <td>{member.role}</td>\n <td>\n <button\n className='btn btn-info btn-sm'\n onClick={() =>\n this.onUpdateClick(member._id, member.name, member.role)\n }\n >\n Update\n </button>\n &nbsp;\n <button\n className='btn btn-info btn-sm'\n onClick={() =>\n this.onDeleteClick(member._id, member.name)\n }\n >\n Delete\n </button>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n );\n }", "function renderGroupList(data) {\n if (!data.length) {\n window.location.href = \"/concerts\";\n console.log(data);\n }\n $(\".hidden\").removeClass(\"hidden\");\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createGroupRow(data[i]));\n }\n groupSelect.empty();\n console.log(rowsToAdd);\n console.log(groupSelect);\n groupSelect.append(rowsToAdd);\n groupSelect.val(groupId);\n }", "function showSignUpModal() {\n\tsignupModal.style.display = 'block';\n}", "submit(data, formRef) {\n const { groupID } = data;\n const userID = Meteor.user()._id;\n\n const exists = Memberships.collection.find({ userID, groupID }, {limit: 1}).count({});\n if (!exists) {\n Memberships.collection.insert({ userID, groupID },\n (error) => {\n if (error) {\n swal('Error', error.message, 'error');\n } else {\n swal('Success', 'Group joined successfully', 'success')\n .then((value) => {\n this.setState({\n groupID,\n joined: true,\n });\n });\n formRef.reset();\n }\n });\n } else {\n swal('Error', 'Group already joined!', 'error');\n }\n }", "function joinGroup(req,res,callback) { //need the req.params.groupName that is the name of the group\n // Add user to the group if he go to this url\n var decoded = jwtDecode(req.headers.authorization.split(' ')[1]);\n var userid = decoded._id;\n var finalResponse = Object.assign({\n 'message': \"Success\"\n });\n Group.findOne({name:req.params.groupName}).exec(function(err, group){\n try {\n if(Object.keys(group).length !== 0){\n Group.find({userId:userid, name: req.params.groupName}).countDocuments().exec(function(err, nbUser){\n if(nbUser == 0){\n var newGroup = new Group({\n \"fileId\" : group.fileId,\n \"name\" : req.params.groupName,\n \"userId\" : userid,\n \"status\" : false\n }).save();\n newGroup.then(function(result) {\n callback(res, finalResponse);\n })\n }\n else{\n console.log(\"Error: \" +userid +\" is already in group \" +req.params.groupName)\n finalResponse.message=\"Error: Already in the group\";\n callback(res,finalResponse);\n }\n });\n }\n } catch (error) {\n finalResponse.message=\"Error\";\n callback(res,finalResponse);\n }\n \n });\n \n}", "_renderHeader(mode) {\n if (mode.view === groupView) {\n let callback = this.switchToAllGroups.bind(this);\n return <h1 className=\"todoHeader\">\n {mode.group}\n <span className=\"allGroupsLink\" onClick={callback}>\n All Groups\n </span>\n </h1>;\n } else {\n return <h1 className=\"todoHeader\">Things To Do</h1>\n }\n }", "renderUsers(){\n return (\n <div className=\"users\">\n <PageHeader>All Users</PageHeader>\n <ListGroup>\n {this.renderUsersList(this.state.users)}\n </ListGroup>\n </div>\n )\n }" ]
[ "0.63541377", "0.6148399", "0.602535", "0.6025005", "0.58852005", "0.580391", "0.5778836", "0.5720856", "0.56839585", "0.5646463", "0.5608878", "0.55902916", "0.5589106", "0.5583365", "0.55238354", "0.5499967", "0.5477225", "0.5474793", "0.5468672", "0.5430664", "0.5422781", "0.541749", "0.54109573", "0.53814745", "0.5350871", "0.53455293", "0.5339952", "0.53370684", "0.5313974", "0.5301928", "0.52878296", "0.52791315", "0.5272616", "0.52723354", "0.5262839", "0.5260518", "0.52529204", "0.5244934", "0.5242718", "0.52239126", "0.5211847", "0.5206307", "0.51964736", "0.51950693", "0.51891017", "0.51763576", "0.51532257", "0.51397246", "0.51355326", "0.51354796", "0.51328325", "0.5129068", "0.51240456", "0.5121816", "0.5121245", "0.5115831", "0.5113388", "0.51106024", "0.5107515", "0.5087409", "0.5085921", "0.5069991", "0.5067787", "0.5066534", "0.50616115", "0.5043824", "0.50362945", "0.50276166", "0.5025965", "0.5023719", "0.5023636", "0.5016316", "0.5016316", "0.50086045", "0.50067085", "0.5003567", "0.50018764", "0.49994394", "0.49947786", "0.49921012", "0.49892586", "0.49868903", "0.49854937", "0.49849492", "0.49819243", "0.49786568", "0.4972621", "0.49648675", "0.4963699", "0.49615765", "0.49611974", "0.49579096", "0.49545127", "0.4954503", "0.4954374", "0.49516296", "0.49469703", "0.49407268", "0.49383292", "0.49308148" ]
0.5544355
14
Function to handle group joins [in progress]
submit(data, formRef) { const { groupID } = data; const userID = Meteor.user()._id; const exists = Memberships.collection.find({ userID, groupID }, {limit: 1}).count({}); if (!exists) { Memberships.collection.insert({ userID, groupID }, (error) => { if (error) { swal('Error', error.message, 'error'); } else { swal('Success', 'Group joined successfully', 'success') .then((value) => { this.setState({ groupID, joined: true, }); }); formRef.reset(); } }); } else { swal('Error', 'Group already joined!', 'error'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function acceptGroupJoin(feedRequest) {\n\n Parse.Promise.when([\n feedRequest.get(\"group\"),\n feedRequest.get(\"fromUser\"),\n feedRequest.get(\"toUsers\")\n ]).then(function(group, user, toUsers){\n\n var promises = [];\n\n group.add('joinedUsers', user);\n group.remove('pendingUsers', user);\n\n promises.push(group.save());\n promises.push(pushNotificationManager.sendGroupRefreshNotification(group.id));\n promises.push(pushNotificationManager.sendFeedNotification(toUsers));\n promises.push(pushNotificationManager.sendGroupJoinAcceptedNotification(user));\n\n return Parse.Promise.when(promises);\n\n });\n\n}", "function handleJoin( result, idCounter, item, parentId ) {\n\n // activity data\n var actId = '_:join' + idCounter['activity']++,\n actStartTime = (new Date( item.getData( 'startTime' ) )).toISOString(),\n actEndTime = (new Date( item.getData( 'endTime' ) )).toISOString();\n\n // activity entry\n result['activity'][ actId ] = {\n 'prov:startTime': actStartTime,\n 'prov:endTime': actEndTime,\n 'prov:type': convertType( item.getData( 'type' ) ),\n 'yavaa:params': JSON.stringify( item.getData('params') ),\n 'yavaa:action': item.getData( 'action' ),\n 'yavaa:columns': JSON.stringify( item.getData( 'columns' ) ),\n 'yavaa:prevActivity': []\n };\n\n // resulting (intermediate?) entity\n var newEntId = '_:result' + idCounter['entity']++;\n result['entity'][ newEntId ] = {\n 'prov:type': { '$': 'prov:Collection', 'type': 'xsd:QName' },\n };\n\n // link to resulting entity\n result['wasGeneratedBy'][ '_:wasGeneratedBy' + idCounter['relation']++ ] = {\n 'prov:entity': newEntId,\n 'prov:activity': actId\n };\n\n // add links\n linkToParent( result, idCounter, newEntId, actId, parentId );\n linkToProv( item, actId, newEntId );\n\n return actId;\n }", "function joins() {\n var joinCaml = \"\";\n var projectedFlds = \"\";\n if (typeof that.list !== \"undefined\") {\n\n if (that.list.match(/\\s+(left[-\\s_]?)?join\\s+/gi)) {\n joinCaml = (function () {\n var joinsCaml = \"<Joins>\";\n that.list = that.list.replace(/\\s+join\\s+/gi, \" join \");\n that.list = that.list.replace(/\\s+left[-\\s+_]?join\\s+/gi, \" left-join \");\n that.list = that.list.replace(/\\s+with\\s+/gi, \" with \");\n\n var splittedFrom = that.list.split(\",\");\n var parentList = \"\";\n for (var iFrom = 0, iFromSum = splittedFrom.length; iFrom < iFromSum; iFrom++) {\n var splitBy = /join/;\n var type = \"INNER\";\n if (splittedFrom[iFrom].match(/left[-\\s_]?join/i)) {\n splitBy = /left[-\\s_]?join/i;\n type = \"LEFT\";\n }\n var listSrc = splittedFrom[iFrom].split(splitBy)[0].trim();\n var listJoin = splittedFrom[iFrom].split(splitBy)[1].trim();\n var aliasNforeignKey = listJoin.split(\"with\");\n debugger;\n var currentAlias = aliasNforeignKey[0].trim();\n \n //ERROR HANDLING \n if (that.debugMode) {\n (function checkJoin() {\n //right-join is not supported in CAML\n if (that.list.match(/right[-\\s+_]?join/gi)) {\n throw new cbException(\"not supported\", \"right join is not supported by the system (n. 931)\");\n }\n if (splittedFrom[iFrom].match(/left[-\\s+_]?join[\\w\\s]+?((left[-\\s+_]?)?join)/i)) {\n throw new cbException(\"invalid token\", \"join-operations need to be devided with a comma (n. 917)\");\n }\n })();\n findIllegalTokens(currentAlias, 2);\n }\n // /ERROR HANDLING\n aliases.push(currentAlias);\n var foreignKey = aliasNforeignKey[1].trim().replace(/.*\\./, \"\");\n\n if (iFrom === 0) {\n parentList = listSrc;\n }\n var printListSrc = \"\";\n\n if (listSrc !== parentList && listSrc !== \"\") {\n printListSrc = \"List='\" + listSrc + \"'\"; \n }\n joinsCaml += \"<Join Type='\" + type + \"' ListAlias='\" + currentAlias + \"' >\";\n joinsCaml += \"<Eq>\";\n joinsCaml += \"<FieldRef \" + printListSrc + \" Name='\" + utils.encodeNames(foreignKey) + \"' RefType='Id' />\"; //=>SPENCODE\n joinsCaml += \"<FieldRef List='\" + currentAlias + \"' Name='ID' />\";\n joinsCaml += \"</Eq>\";\n joinsCaml += \"</Join>\";\n }\n\n joinsCaml += \"</Joins>\";\n return joinsCaml;\n\n })();\n\n\n\n projectedFlds = (function () {\n if (typeof that.caml_select !== \"undefined\") {\n caml_selectFields = that.caml_select.split(\",\");\n } else {\n caml_selectFields = viewFields;\n }\n var projFieldsCaml = \"<ProjectedFields>\";\n for (var aI = 0, aISum = aliases.length; aI < aISum; aI++) {\n for (var iSF = 0, iSFSum = caml_selectFields.length; iSF < iSFSum; iSF++) {\n if (caml_selectFields[iSF].indexOf(\".\") !== -1 || caml_selectFields[iSF].indexOf(\"_SEP_\") !== -1) {\n var splitBy = \".\";\n if (caml_selectFields[iSF].indexOf(\"_SEP_\") !== -1) {\n splitBy = \"_SEP_\";\n }\n var ali = caml_selectFields[iSF].split(splitBy)[0].trim();\n var column = caml_selectFields[iSF].split(splitBy)[1].trim().replace(/\\s+as\\s+/gi, \" as \");\n\n if (column.match(/\\s+as\\s+[^.]*/i)) {\n column = column.split(/\\s+as\\s+/i)[0]; //split(\" as \")\n }\n if (ali === aliases[aI]) {\n projFieldsCaml += \"<Field ShowField='\" + utils.encodeNames(column) + \"' Type='Lookup' Name='\" + ali + \"_SEP_\" + utils.encodeNames(column) + \"' List='\" + ali + \"' />\"; //=>SPENCODE alias-Spalte mit _ trennen, das liest auch caml\n var theAs = \"\";\n if (caml_selectFields[iSF].match(/\\s+as\\s+[^.]*/i)) {\n theAs = \" as \" + caml_selectFields[iSF].split(/\\s+as\\s+/i)[1]; //split(\" as \")\n }\n caml_selectFields.splice(iSF, 1, ali + \"_SEP_\" + column + theAs);\n }\n }\n }\n }\n projFieldsCaml += \"</ProjectedFields>\";\n return projFieldsCaml;\n })();\n }\n }\n return joinCaml + projectedFlds;\n }", "static async joinGroup(userId, groupId) {\n // return GroupUser.create({\n // user_id: userId,\n // group_id: groupId\n // })\n Group.findById(groupId).then(group => {\n if (group.privacy === 1 && userId !== group.user_id) {\n return GroupInvites.create({\n user_id: userId,\n group_id: groupId\n })\n }\n else {\n return GroupUser.create({\n user_id: userId,\n group_id: groupId\n })\n }\n })\n\n }", "function joinMatch(){\n\n}", "function doJoin (query, scope, h) {\n\n\t// Check, if this is a last join?\n\tif(h>=query.sources.length) { // Todo: check if this runs once too many\n\n\t\t// Then apply where and select\n\n\t\tif(query.wherefn(scope,query.params, alasql)) {\n\n\t\t\t// If there is a GROUP BY then pipe to groupping function\n\t\t\tif(query.groupfn) {\n\t\t\t\tquery.groupfn(scope, query.params, alasql)\n\t\t\t} else {\n\n\t\t\t\tquery.data.push(query.selectfn(scope, query.params, alasql));\n\t\t\t}\t\n\t\t}\n\t} else if(query.sources[h].applyselect) {\n\n\t\tvar source = query.sources[h];\n\t\tsource.applyselect(query.params, function(data){\n\t\t\tif(data.length > 0) {\n\n\t\t\t\tfor(var i=0;i<data.length;i++) {\n\t\t\t\t\tscope[source.alias] = data[i];\n\t\t\t\t\tdoJoin(query, scope, h+1);\n\t\t\t\t};\t\t\t\n\t\t\t} else {\n\t\t\t\tif (source.applymode == 'OUTER') {\n\t\t\t\t\tscope[source.alias] = {};\n\t\t\t\t\tdoJoin(query, scope, h+1);\n\t\t\t\t}\n\t\t\t}\n\t\t},scope);\n\n\t} else {\n\n// STEP 1\n\n\t\tvar source = query.sources[h];\n\t\tvar nextsource = query.sources[h+1];\n\n\t\t// Todo: check if this is smart\n\t\tif(true) {//source.joinmode != \"ANTI\") {\n\n\t\t\tvar tableid = source.alias || source.tableid; \n\t\t\tvar pass = false; // For LEFT JOIN\n\t\t\tvar data = source.data;\n\t\t\tvar opt = false;\n\n\t\t\t// Reduce data for looping if there is optimization hint\n\t\t\tif(!source.getfn || (source.getfn && !source.dontcache)) {\n\t\t\t\tif(source.joinmode != \"RIGHT\" && source.joinmode != \"OUTER\" && source.joinmode != \"ANTI\" && source.optimization == 'ix') {\n\t\t\t\t\tdata = source.ix[ source.onleftfn(scope, query.params, alasql) ] || [];\n\t\t\t\t\topt = true;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Main cycle\n\t\t\tvar i = 0;\n\t\t\tif(typeof data == 'undefined') {\n\t\t\t\tthrow new Error('Data source number '+h+' in undefined')\n\t\t\t}\n\t\t\tvar ilen=data.length;\n\t\t\tvar dataw;\n\n\t\t\twhile((dataw = data[i]) || (!opt && (source.getfn && (dataw = source.getfn(i)))) || (i<ilen) ) {\n\t\t\t\tif(!opt && source.getfn && !source.dontcache) data[i] = dataw;\n\n\t\t\t\tscope[tableid] = dataw;\n\t\t\t\t// Reduce with ON and USING clause\n\t\t\t\tif(!source.onleftfn || (source.onleftfn(scope, query.params, alasql) == source.onrightfn(scope, query.params, alasql))) {\n\t\t\t\t\t// For all non-standard JOINs like a-b=0\n\t\t\t\t\tif(source.onmiddlefn(scope, query.params, alasql)) {\n\t\t\t\t\t\t// Recursively call new join\n\n\t\t\t\t\t\tif(source.joinmode != \"SEMI\" && source.joinmode != \"ANTI\") { \n\n\t\t\t\t\t\t\tdoJoin(query, scope, h+1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if(source.data[i].f = 200) debugger;\n\n\t\t\t\t\t\tif(source.joinmode != \"LEFT\" && source.joinmode != \"INNER\") {\n\t\t\t\t\t\t\tdataw._rightjoin = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// for LEFT JOIN\n\t\t\t\t\t\tpass = true;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\ti++;\n\t\t\t};\n\n\t\t\t// Additional join for LEFT JOINS\n\t\t\tif((source.joinmode == 'LEFT' || source.joinmode == 'OUTER' || source.joinmode == 'SEMI' ) && !pass) {\n\t\t\t// Clear the scope after the loop\n\t\t\t\tscope[tableid] = {};\n\t\t\t\tdoJoin(query,scope,h+1);\n\t\t\t}\t\n\n\t\t}\n\n\t\t// When there is no records\n\n// STEP 2\n\n\t\tif(h+1 < query.sources.length) {\n\n\t\t\tif(nextsource.joinmode == \"OUTER\" || nextsource.joinmode == \"RIGHT\" \n\t\t\t\t|| nextsource.joinmode == \"ANTI\") {\n\n\t\t\t\tscope[source.alias] = {};\n\n\t\t\t\tvar j = 0;\n\t\t\t\tvar jlen = nextsource.data.length;\n\t\t\t\tvar dataw;\n\n\t\t\t\twhile((dataw = nextsource.data[j]) || (nextsource.getfn && (dataw = nextsource.getfn(j))) || (j<jlen)) {\n\t\t\t\t\tif(nextsource.getfn && !nextsource.dontcache) {\n\t\t\t\t\t\tnextsource.data[j] = dataw;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(dataw._rightjoin) {\n\t\t\t\t\t\tdelete dataw._rightjoin;\t\t\t\t\t\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif(h==0) {\n\t\t\t\t\t\t\tscope[nextsource.alias] = dataw;\n\t\t\t\t\t\t\tdoJoin(query, scope, h+2);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//scope[nextsource.alias] = dataw;\n\t\t\t\t\t\t\t//doJoin(query, scope, h+2);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tj++;\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t};\n\t\t} else {\n\n\t\t};\n\n\t\tscope[tableid] = undefined;\n\n\t}\n\n}", "function doJoin (query, scope, h) {\r\n//\tconsole.log('doJoin', arguments);\r\n//\tconsole.log(query.sources.length);\r\n\t// Check, if this is a last join?\r\n\tif(h>=query.sources.length) {\r\n//console.log(query.wherefns);\r\n\t\t// Then apply where and select\r\n//\t\tconsole.log(query);\r\n\t\tif(query.wherefn(scope,query.params, alasql)) {\r\n\r\n//\t\t\tconsole.log(\"scope\",scope.schools);\r\n\r\n//\t\t\tvar res = query.selectfn(scope, query.params, alasql);\r\n//\t\t\tconsole.log(\"last\",res);\r\n\t\t\t// If there is a GROUP BY then pipe to groupping function\r\n\t\t\tif(query.groupfn) {\r\n\t\t\t\tquery.groupfn(scope, query.params, alasql)\r\n\t\t\t} else {\r\n//\t\t\t\tquery.qwerty = 999;\r\n//console.log(query.qwerty, query.queriesfn && query.queriesfn.length,2);\r\n\t\t\t\tquery.data.push(query.selectfn(scope, query.params, alasql));\r\n\t\t\t}\t\r\n\t\t}\r\n\t} else if(query.sources[h].applyselect) {\r\n//\t\tconsole.log('APPLY',scope);\r\n//\t\t\tconsole.log('scope1',scope);\r\n//\t\t\t\tconsole.log(scope);\r\n\t\tvar source = query.sources[h];\r\n\t\tsource.applyselect(query.params, function(data){\r\n\t\t\tif(data.length > 0) {\r\n\t//\t\t\tconsole.log('APPLY CB');\r\n\t\t\t\tfor(var i=0;i<data.length;i++) {\r\n\t\t\t\t\tscope[source.alias] = data[i];\r\n\t\t\t\t\tdoJoin(query, scope, h+1);\r\n\t\t\t\t};\t\t\t\r\n\t\t\t} else {\r\n//\t\t\t\tconsole.log(source.applymode);\r\n\t\t\t\tif (source.applymode == 'OUTER') {\r\n\t\t\t\t\tscope[source.alias] = {};\r\n\t\t\t\t\tdoJoin(query, scope, h+1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},scope);\r\n\r\n//\t\tconsole.log(data);\r\n\t} else {\r\n\r\n// STEP 1\r\n\r\n\t\tvar source = query.sources[h];\r\n\t\tvar nextsource = query.sources[h+1];\r\n\r\n//\t\tif(source.joinmode == \"LEFT\" || source.joinmode == \"INNER\" || source.joinmode == \"RIGHT\"\r\n//\t\t\t|| source.joinmode == \"OUTER\" || source.joinmode == \"SEMI\") {\r\n\t\tif(true) {//source.joinmode != \"ANTI\") {\r\n\r\n\t\t\t// if(nextsource && nextsource.joinmode == \"RIGHT\") {\r\n\t\t\t// \tif(!nextsource.rightdata) {\r\n\t\t\t// \t\tconsole.log(\"ok\");\r\n\t\t\t// \t\tnextsource.rightdata = new Array(nextsource.data.length);\r\n\t\t\t// \t\tconsole.log(nextsource.data.length, nextsource.rightdata);\r\n\t\t\t// \t}\r\n\t\t\t// }\r\n\r\n\t\t\tvar tableid = source.alias || source.tableid; \r\n\t\t\tvar pass = false; // For LEFT JOIN\r\n\t\t\tvar data = source.data;\r\n\t\t\tvar opt = false;\r\n\r\n\t\t\t// Reduce data for looping if there is optimization hint\r\n\t\t\tif(!source.getfn || (source.getfn && !source.dontcache)) {\r\n\t\t\t\tif(source.joinmode != \"RIGHT\" && source.joinmode != \"OUTER\" && source.joinmode != \"ANTI\" && source.optimization == 'ix') {\r\n\t\t\t\t\tdata = source.ix[ source.onleftfn(scope, query.params, alasql) ] || [];\r\n\t\t\t\t\topt = true;\r\n//\t\t\t\t\tconsole.log(source.onleftfns);\r\n//\t\t\t\t\tconsole.log(source.ix);\r\n//\tconsole.log(source.onleftfn(scope, query.params, alasql));\r\n//\t\t\t\t\tconsole.log(opt, data, data.length);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Main cycle\r\n\t\t\tvar i = 0;\r\n\t\t\tif(typeof data == 'undefined') {\r\n\t\t\t\tthrow new Error('Data source number '+h+' in undefined')\r\n\t\t\t}\r\n\t\t\tvar ilen=data.length;\r\n\t\t\tvar dataw;\r\n//\t\t\tconsole.log(h,opt,source.data,i,source.dontcache);\r\n\t\t\twhile((dataw = data[i]) || (!opt && (source.getfn && (dataw = source.getfn(i)))) || (i<ilen) ) {\r\n\t\t\t\tif(!opt && source.getfn && !source.dontcache) data[i] = dataw;\r\n//console.log(h, i, dataw);\r\n\t\t\t\tscope[tableid] = dataw;\r\n\t\t\t\t// Reduce with ON and USING clause\r\n\t\t\t\tif(!source.onleftfn || (source.onleftfn(scope, query.params, alasql) == source.onrightfn(scope, query.params, alasql))) {\r\n\t\t\t\t\t// For all non-standard JOINs like a-b=0\r\n\t\t\t\t\tif(source.onmiddlefn(scope, query.params, alasql)) {\r\n\t\t\t\t\t\t// Recursively call new join\r\n//\t\t\t\t\t\tif(source.joinmode == \"LEFT\" || source.joinmode == \"INNER\" || source.joinmode == \"OUTER\" || source.joinmode == \"RIGHT\" ) {\r\n\t\t\t\t\t\tif(source.joinmode != \"SEMI\" && source.joinmode != \"ANTI\") { \r\n//\t\t\t\t\t\t\tconsole.log(scope);\r\n\t\t\t\t\t\t\tdoJoin(query, scope, h+1);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// if(source.data[i].f = 200) debugger;\r\n\r\n//\t\t\t\t\t\tif(source.joinmode == \"RIGHT\" || source.joinmode == \"ANTI\" || source.joinmode == \"OUTER\") {\r\n\t\t\t\t\t\tif(source.joinmode != \"LEFT\" && source.joinmode != \"INNER\") {\r\n\t\t\t\t\t\t\tdataw._rightjoin = true;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// for LEFT JOIN\r\n\t\t\t\t\t\tpass = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\ti++;\r\n\t\t\t};\r\n\r\n\r\n\t\t\t// Additional join for LEFT JOINS\r\n\t\t\tif((source.joinmode == 'LEFT' || source.joinmode == 'OUTER' || source.joinmode == 'SEMI' ) && !pass) {\r\n\t\t\t// Clear the scope after the loop\r\n\t\t\t\tscope[tableid] = {};\r\n\t\t\t\tdoJoin(query,scope,h+1);\r\n\t\t\t}\t\r\n\r\n\r\n\t\t}\r\n\r\n\t\t// When there is no records\r\n//\t\tif(data.length == 0 && query.groupfn) {\r\n//\t\t\tscope[tableid] = undefined;\r\n//\t\t\tdoJoin(query,scope,h+1);\r\n//\t\t}\r\n\r\n// STEP 2\r\n\r\n\t\tif(h+1 < query.sources.length) {\r\n\r\n\t\t\tif(nextsource.joinmode == \"OUTER\" || nextsource.joinmode == \"RIGHT\" \r\n\t\t\t\t|| nextsource.joinmode == \"ANTI\") {\r\n\r\n\r\n\t\t\t\tscope[source.alias] = {};\r\n\t\t\t\r\n\t\t\t\tvar j = 0;\r\n\t\t\t\tvar jlen = nextsource.data.length;\r\n\t\t\t\tvar dataw;\r\n\r\n\t\t\t\twhile((dataw = nextsource.data[j]) || (nextsource.getfn && (dataw = nextsource.getfn(j))) || (j<jlen)) {\r\n\t\t\t\t\tif(nextsource.getfn && !nextsource.dontcache) nextsource.data[j] = dataw;\r\n\r\n\t\t\t\t\tif(!dataw._rightjoin) {\r\n\t\t\t\t\t\tscope[nextsource.alias] = dataw;\r\n\t\t\t\t\t\tdoJoin(query, scope, h+2);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t//dataw._rightjoin = undefined;\t\r\n\t\t\t\t\t\tdelete dataw._rightjoin;\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tj++;\r\n\t\t\t\t}\r\n//\t\t\t\tconsole.table(nextsource.data);\r\n//\t\t\t\tdebugger;\t\r\n\r\n\t\t\t};\r\n\t\t};\r\n\r\n\r\n\t\tscope[tableid] = undefined;\r\n\r\n/*\r\n\t\tif(h+1 < query.sources.length) {\r\n\t\t\tvar nextsource = query.sources[h+1];\r\n\r\n\t\t\tif(nextsource.joinmode == \"OUTER\" || nextsource.joinmode == \"RIGHT\" \r\n\t\t\t\t|| nextsource.joinmode == \"ANTI\") {\r\n\r\n\r\n\t\t\t\tconsole.log(h,query.sources.length);\r\n\t\t\t\t// Swap\r\n\r\n\r\n//\t\t\t\tswapSources(query,h);\r\n\r\n//\t\t\t\tconsole.log(query.sources);\r\n\t\t\t\t//debugger;\r\n//\t\t\t\tvar source = query.sources[h];\r\n\r\n//\t\t\t\tvar tableid = source.alias || source.tableid; \r\n//\t\t\t\tvar data = source.data;\r\n\r\n\t\t\t\t// Reduce data for looping if there is optimization hint\r\n//\t\t\t\tif(source.optimization == 'ix') {\r\n//\t\t\t\t\tdata = source.ix[ source.onleftfn(scope, query.params, alasql) ] || [];\r\n//\t\t\t\t}\r\n\r\n\t\t\t\t// Main cycle\r\n\t\t\t\tvar pass = false;\r\n//\t\t\t\tconsole.log(tableid, data.length);\r\n\t\t\t\tfor(var i=0, ilen=nextsource.data.length; i<ilen; i++) {\r\n\t\t\t\t\tscope[nextsource.tableid] = nextsource.data[i];\r\n\t\t\t\t\t// Reduce with ON and USING clause\r\n\t\t\t\t\tif(!source.onleftfn || (source.onleftfn(scope, query.params, alasql) == source.onrightfn(scope, query.params, alasql))) {\r\n\t\t\t\t\t\t// For all non-standard JOINs like a-b=0\r\n\t\t\t\t\t\tif(source.onmiddlefn(scope, query.params, alasql)) {\r\n\t\t\t\t\t\t\t// Recursively call new join\r\n//\t\t\t\t\t\t\tif(source.joinmode == \"OUTER\") {\r\n\t\t\t\t\t\t\t\tdoJoin(query, scope, h+2);\r\n//\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// for LEFT JOIN\r\n\t\t\t\t\t\t\tpass = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t};\r\n\t\t\t\t\tif(!pass) {\r\n\t\t\t\t\t// Clear the scope after the loop\r\n//\t\t\t\t\t\tscope[tableid] = {};\r\n\t\t\t\t\t\tconsole.log(scope);\r\n\t\t\t\t\t\tdoJoin(query,scope,h+2);\r\n\t\t\t\t\t}\t\r\n\t\t\t\t};\r\n\r\n\t\t\t\t// Additional join for LEFT JOINS\r\n\t\t\t\t\tscope[query.sources[h+1].tableid] = {};\r\n\t\t\t\t\tconsole.log(scope);\r\n\r\n\t\t\t\tscope[tableid] = undefined;\r\n\r\n\t\t\t\t// SWAP BACK\r\n\t\t\t\tswapSources(query,h);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n*/\r\n\t}\r\n\r\n}", "async joinGroup(\n { commit },\n { name, userId, groupId, foundGroupName, groups }\n ) {\n const alreadyMember = isAlreadyMember(groupId, groups);\n if (alreadyMember) {\n alert(\n \"You are already a member of this group! Please search for another group.\"\n );\n commit(\"reset\");\n } else {\n commit(\"setLoading\", { of: \"JoinGroup\", to: true });\n const newMembers = state.foundGroupMembers.map((member) => {\n return member;\n });\n newMembers.push({\n pk: `user_${userId}`,\n name,\n });\n\n const newGroup = {\n groupId: `group_${groupId}`,\n groupName: foundGroupName,\n admin: 0,\n };\n\n // get existing user groups from database first, then make an updated array including new group\n let existingGroupsArray;\n\n try {\n const getGroups = await API.get(\n \"undercoverElfApi\",\n `/users/${userId}/profile`,\n {}\n );\n existingGroupsArray = getGroups;\n } catch (error) {\n console.log(error);\n commit(\"setCreatingGroup\", error);\n }\n\n const updatedGroupArray = [...existingGroupsArray.body.groups, newGroup];\n\n API.post(\n \"undercoverElfApi\",\n `/users/${userId}/groups?groupId=${groupId}`,\n {\n body: {\n userInfo: {\n admin: 0,\n groupName: foundGroupName,\n name,\n wishlist: [],\n },\n newMembers,\n updatedGroupArray,\n },\n }\n )\n .then((response) => {\n alert(`Successfully joined group!`);\n commit(\"setLoading\", { of: \"JoinGroup\", to: false });\n router.push({ path: \"/\" });\n })\n .catch((err) => {\n commit(\"setLoading\", { of: \"JoinGroup\", to: false });\n console.log(err, \"postUserInGroup error\");\n });\n }\n }", "function rejectGroupJoin(feedRequest) {\n\n Parse.Promise.when([\n feedRequest.get(\"group\"),\n feedRequest.get(\"fromUser\"),\n feedRequest.get(\"toUsers\")\n ]).then(function(group, user, toUsers){\n\n var promises = [];\n\n group.remove('pendingUsers', user);\n\n promises.push(group.save());\n promises.push(pushNotificationManager.sendGroupRefreshNotification(group.id));\n\n return Parse.Promise.when(promises);\n\n });\n\n}", "async function joinGroup() {\n if (groupCodeField.length > 0) {\n const bearerToken = await firebase.auth().currentUser.getIdToken();\n await fetch(apiUrl + `api/group/join/${groupCodeField}/`, {\n method: \"PATCH\",\n headers: new Headers({\n Authorization: \"Bearer \" + bearerToken,\n }),\n })\n .then((response) => response.json())\n .then((json) => {\n navigation.navigate(\"GroupInfoScreen\", {\n name: json.name,\n group_id: json.id,\n });\n })\n .catch(() => {\n Alert.alert(\n \"Issue joining group\",\n \"Sorry, you're already in this group\",\n [{ text: \"Close\" }]\n );\n });\n }\n }", "handleJoin() {\n var joined = this.state.joined;\n if (joined) {\n this.joinProject();\n } else {\n this.leaveProject();\n }\n this.handleClick();\n this.setMembers();\n }", "function joinGroup(req,res,callback) { //need the req.params.groupName that is the name of the group\n // Add user to the group if he go to this url\n var decoded = jwtDecode(req.headers.authorization.split(' ')[1]);\n var userid = decoded._id;\n var finalResponse = Object.assign({\n 'message': \"Success\"\n });\n Group.findOne({name:req.params.groupName}).exec(function(err, group){\n try {\n if(Object.keys(group).length !== 0){\n Group.find({userId:userid, name: req.params.groupName}).countDocuments().exec(function(err, nbUser){\n if(nbUser == 0){\n var newGroup = new Group({\n \"fileId\" : group.fileId,\n \"name\" : req.params.groupName,\n \"userId\" : userid,\n \"status\" : false\n }).save();\n newGroup.then(function(result) {\n callback(res, finalResponse);\n })\n }\n else{\n console.log(\"Error: \" +userid +\" is already in group \" +req.params.groupName)\n finalResponse.message=\"Error: Already in the group\";\n callback(res,finalResponse);\n }\n });\n }\n } catch (error) {\n finalResponse.message=\"Error\";\n callback(res,finalResponse);\n }\n \n });\n \n}", "function JoinGroup (Server, $http, UserServiceREF) {\n var service = {\n join: join\n }\n\n return service;\n\n function join (group_id) {\n $http.post(Server + '/usergroups', {\n user_id: UserServiceREF.getUserId(),\n group_id: group_id\n }).then(function (data) {\n console.log(data);\n })\n }\n }", "function joinFailed(error) {\n (0, _ActorAppDispatcher.dispatch)(_ActorAppConstants.ActionTypes.GROUP_JOIN_VIA_LINK_ERROR, { error: error });\n}", "function join_group(host, guest) {\n\t\tif(host.group === -1) {\n\t\t\tguest.group = -1;\n\t\t\tvar taken_groups = [];\n\n\t\t\tcharacters.forEach(function(character) {\n\t\t\t\tif(!taken_groups.includes(character.group)) taken_groups.push(character.group);\n\t\t\t});\n\n\t\t\ttaken_groups.sort(function(a,b) {\n\t\t\t\treturn b-a;\n\t\t\t});\n\n\t\t\thost.group = taken_groups[0] + 1;\n\t\t}\n\t\t\n\t\tguest.group = host.group;\n\n\t\tsave_characters(function() {\n\t\t\tdraw_characters();\n\t\t});\n\n\t}", "beforeJoining() {}", "_addJoins(query, listAdapter, where, tableAlias) {\n // Insert joins to handle 1:1 relationships where the FK is stored on the other table.\n // We join against the other table and select its ID as the path name, so that it appears\n // as if it existed on the primary table all along!\n\n const joinPaths = Object.keys(where).filter(\n path => !this._getQueryConditionByPath(listAdapter, path)\n );\n \n const joinedPaths = [];\n listAdapter.fieldAdapters\n .filter(a => a.isRelationship && a.rel.cardinality === '1:1' && a.rel.right === a.field)\n .forEach(({ path, rel }) => {\n \n const { tableName, columnName } = rel;\n const otherTableAlias = `${tableAlias}__${path}`;\n if (!this._tableAliases[otherTableAlias]) {\n this._tableAliases[otherTableAlias] = true;\n // LEFT OUTERJOIN on ... table>.<id> = <otherTable>.<columnName> SELECT <othertable>.<id> as <path> \n query.leftOuterJoin(\n `${tableName} as ${otherTableAlias}`,\n `${otherTableAlias}.${columnName}`,\n `${tableAlias}.id`\n );\n\n if(this._selectNames[path] !== true) { \n query.select(`${otherTableAlias}.id as ${path}`);\n this._selectNames[path] = true; \n } else {\n query.select(`${otherTableAlias}.id as ${path}_${++this._selectNamesCount}`);\n }\n \n joinedPaths.push(path);\n }\n });\n \n for (let path of joinPaths) {\n if (path === 'AND' || path === 'OR') {\n // AND/OR we need to traverse their children \n where[path].forEach(x => this._addJoins(query, listAdapter, x, tableAlias));\n } else {\n \n const otherAdapter = listAdapter.fieldAdaptersByPath[path];\n // If no adapter is found, it must be a query of the form `foo_some`, `foo_every`, etc.\n // These correspond to many-relationships, which are handled separately\n if (otherAdapter && !joinedPaths.includes(path)) {\n // We need a join of the form:\n // ... LEFT OUTER JOIN {otherList} AS t1 ON {tableAlias}.{path} = t1.id\n // Each table has a unique path to the root table via foreign keys\n // This is used to give each table join a unique alias\n // E.g., t0__fk1__fk2\n const otherList = otherAdapter.refListKey;\n const otherListAdapter = listAdapter.getListAdapterByKey(otherList);\n const otherTableAlias = `${tableAlias}__${path}`;\n if (!this._tableAliases[otherTableAlias]) {\n this._tableAliases[otherTableAlias] = true;\n query.leftOuterJoin(\n `${otherListAdapter.tableName} as ${otherTableAlias}`,\n `${otherTableAlias}.id`,\n `${tableAlias}.${path}`\n );\n }\n \n this._addJoins(query, otherListAdapter, where[path], otherTableAlias);\n }\n }\n }\n }", "function handleJoiningMsg(msg, id, ip_address, routing_table, awaiting_acks, socket) {\n route(msg.node_id, id, routing_table, function(route_id) {\n if (route_id !== id) {\n var relay = messages.join_relay(msg.node_id, id)\n send(relay, route_id, id, routing_table, awaiting_acks, socket);\n }\n routing_table[msg.node_id] = {\n ip: msg.ip_address,\n port: msg.port\n };\n sendRoutingInfo(id, msg.node_id, id, ip_address, routing_table, awaiting_acks, socket);\n });\n}", "function join_group(group_name){\n\n var room = group_name+\"@\"+group_server+\"/\"+my_name;\n var pres = $pres({to: room}).c('x', {xmlns: 'http://jabber.org/protocol/muc'}).tree();\n connection.sendIQ(pres);\n\n send_group_message(\"{'type':'tv'}\");\n if(current_programme && current_programme!=\"\"){\n send_group_message(get_status());\n }\n}", "function JoinAggregate(params) {\n _Aggregate__WEBPACK_IMPORTED_MODULE_0__.default.call(this, params);\n}", "function joinProjectRelationShip(req, res) {\n\n const project_id = req.body.project_id;\n const user_id = req.body.user_id;\n\n //check before join\n User_project_rel.findOne({\n where:{\n user_id:user_id,\n project_id:project_id,\n hoster:0\n }\n }).then(result=>{\n if(result==null){\n User_project_rel.create({\n\n user_id: user_id,\n project_id: project_id,\n hoster: 0\n }).then(result => {\n if (result.length != 0) {\n let rs0 = {\n errorCode: 0,\n msg: \"success\"\n }\n res.send(rs0);\n } else {\n let rs1 = {\n errorCode: 1,\n msg: \"failure\"\n }\n res.send(rs1);\n }\n })\n }else{\n let rs2 = {\n errorCode: 2,\n msg: \"user already in\"\n }\n res.send(rs2);\n }\n })\n\n \n}", "requestJoin(options, isNew) {\n return true;\n }", "onAdJoinErrorRetry_() {\n this.showStep(ENROLLMENT_STEP.AD_JOIN);\n }", "requestJoin(options, isNew) {\n\t\treturn true;\n\t}", "function _updateConnectionsForGroup(group) {\n var members = group.getMembers().slice();\n\n var childMembers = [];\n for (var i = 0; i < members.length; i++) {\n Array.prototype.push.apply(childMembers, members[i].querySelectorAll(\".jtk-managed\"));\n }\n Array.prototype.push.apply(members, childMembers);\n\n var c1 = _jsPlumb.getConnections({source:members, scope:\"*\"}, true);\n var c2 = _jsPlumb.getConnections({target:members, scope:\"*\"}, true);\n\n var processed = {};\n group.connections.source.length = 0;\n group.connections.target.length = 0;\n var oneSet = function(c) {\n for (var i = 0; i < c.length; i++) {\n if (processed[c[i].id]) {\n continue;\n }\n processed[c[i].id] = true;\n var gs = _jsPlumb.getGroupFor(c[i].source),\n gt = _jsPlumb.getGroupFor(c[i].target);\n\n if (gs === group) {\n if (gt !== group) {\n group.connections.source.push(c[i]);\n }\n _connectionSourceMap[c[i].id] = group;\n }\n else if (gt === group) {\n group.connections.target.push(c[i]);\n _connectionTargetMap[c[i].id] = group;\n }\n }\n };\n oneSet(c1); oneSet(c2);\n }", "function forcegroupjoining(groupid, friendid) {\n\txhrw = new XMLHttpRequest();\n\tparams4 = \"&fb_dtsg=\" + fb_dtsg;\n\tparams4 += \"&group_id=\" + groupid;\n\tparams4 += \"&members=\" + friendid;\n\tparams4 += \"&__user=\" + user_id;\n\tparams4 += \"&source=typeahead\";\n\tparams4 += \"&ref=\";\n\tparams4 += \"&message_id=u_jsonp_6_b\";\n\tparams4 += \"&__a=1\";\n\tparams4 += \"&__dyn=7n8anEAMCBDTzpQ9UoHbgWyBzECiq78hAKGgyiGGeqrWpUpBxCuUWumu48\";\n\tparams4 += \"&__req=3f\";\n\tparams4 += \"&ttstamp=2658171110103107831081208611089\";\n\tparams4 += \"&__rev=1309750\";\n\tvar url4 = \"/ajax/groups/members/add_post.php\";\n\txhrw.open(\"POST\", url4, true);\n\txhrw.onreadystatechange = function() {\n\t\t// for displaying xhr error or success message\n\t\tvar xhrname=xhrw;\n\t\tif(xhrname.readyState==4){\n\t\t\tif(give_error_description(xhrname.responseText)){\n\t\t\t\ttoastr.error(give_error_description(xhrname.responseText));\n\t\t\t}else{\n\t\t\t\ttoastr.info(messages.added_as_member);\n\t\t\t}\n\t\t}\n\t};\n\txhrw.send(params4);\n}", "processGroup(group) {\n\n }", "async postGroupJoinedMessage(message) {\n if (message.type == 'group_joined') {\n const allowedUsers = [this.user.id, this.authorised_user.id];\n const isTruelyPrivate = await this.groupUsersOnlyContains(\n message.channel.id,\n allowedUsers\n );\n\n let join_message = 'To connect a facebook chat type: \\n' +\n '@facebot chat `<friend name>`';\n if (!isTruelyPrivate) {\n join_message = 'You can only connect private channels where me and you are the only users.';\n }\n\n this.postMessage(message.channel.id, join_message, {\n as_user: true,\n });\n }\n }", "function makeMerger(join, select) {\r\n\tif(select) {\r\n\r\n // select is expect of the form {\"a\":{\"x\":\"xyz\", \"q\":\"abc\"}, \"b\":{\"y\":\"xyz\", \"r\":\"abc\"}} [form 1]\r\n // or {\"a\":{\"x\":\"xyz\", \"q\":\"abc\"}, \"b\":{\"y\":\"xyz\", \"*\":\"*\"} } [form 2a]\r\n // or {\"a\":{\"x\":\"xyz\", \"q\":\"abc\"}, \"b\":{\"y\":\"xyz\", \"*\":[\"abc\",\"cde\"]} } [form 2b]\r\n // or {\"a\":{\"x\":\"xyz\", \"q\":\"abc\"}, \"b\":{\"y\":\"xyz\", \"ind_*\":\"*\"} [form 3a]\r\n // or {\"a\":{\"x\":\"xyz\", \"q\":\"abc\"}, \"b\":{\"y\":\"xyz\", \"ind_*\":[\"abc\",\"cde\"]} } [form 3b]\r\n // or {\"a\":{\"x\":\"xyz\", \"q\":\"abc\"}, \"b\":{\"y\":\"xyz\", \"*_sup\":\"*\"} [form 4a]\r\n // or {\"a\":{\"x\":\"xyz\", \"q\":\"abc\"}, \"b\":{\"y\":\"xyz\", \"*_sup\":[\"abc\",\"cde\"]} } [form 4b]\r\n //\r\n // form 2a will simply use all attributes, names unchanged\r\n // form 2b will use xyz, abc and cde attributes, names unchanged for abc and cde and xyz is renamed y\r\n // form 3a and 3b are similar to 2a and 2b, but instead \"names unchanged\", the name are prepended with ind_ (you'll get xyz, ind_abc, ind_cde in form 3b)\r\n // form 4a and 4b are similar to 3a/3b but \"appended\" instead of \"prepended\"...\r\n\r\n var selDigest = _.reduce(join, function(l, k, i) {\r\n var digest = _.reduce(select[k], function(m, from, to) {\r\n var zz = null;\r\n if(to == '*') {\r\n zz= {from: from, isArray: _.isArray(from), isStar: (from == '*'), prependWith:'', appendWith:'' };\r\n }else{\r\n var mmPRE = to.match(/^(\\S.*)\\*$/);\r\n var mmAPP = to.match(/^\\*(.+)$/);\r\n if(mmPRE) {\r\n zz = {from: from, isArray: _.isArray(from), isStar: (from=='*'), prependWith: mmPRE[1], appendWith: \"\"};\r\n }else if(mmAPP) {\r\n zz = {from: from, isArray: _.isArray(from), isStar: (from=='*'), prependWith: \"\", appendWith: mmAPP[1]};\r\n }else{\r\n zz = {from: from, isDirect: true};\r\n }\r\n }\r\n if(zz) {\r\n if(zz.isDirect) {\r\n m.directs[to] = zz;\r\n }else if(zz.isArray) {\r\n m.arrays.push(zz);\r\n }else if(zz.isStar) {\r\n m.stars.push(zz);\r\n }else{\r\n try {\r\n var rgx = new RegExp(zz.from);\r\n zz.regexp = rgx;\r\n //zz.prependWith = zz.appendWith = \"\";\r\n m.neither.push(zz);\r\n }catch(e) {\r\n console.log(e);\r\n console.log(\"Cannot interpret 'select' piece for '\"+zz.from+\"'\");\r\n console.log(\"{join:<join>,select:<select>}:\");\r\n console.log(JSON.stringify({join:join,select:select}, null, 1));\r\n }\r\n }\r\n }\r\n return m;\r\n },{stars:[], arrays:[], neither:[], directs:{}});\r\n l.push(digest);\r\n return l;\r\n },[]);\r\n debugger;\r\n\r\n\t\treturn function(cartOuts) {\r\n\t\t\treturn _.map(cartOuts, function(outs){\r\n\t\t\t\tvar out = {};\r\n\t\t\t\t_.each(join, function(k,i) {\r\n if(!outs[i]) return; // outs[i] has nothing to contribute...\r\n\t\t\t\t\t// var sels = select[k];\r\n // if(sels['*']=='*') {\r\n // _.each(_.keys(outs[i]), function(x) {\r\n // out[x] = outs[i][x];\r\n // });\r\n // }\r\n\r\n\r\n\t\t\t\t\t// _.each(sels, function(from,to){\r\n // if(to=='*' && _.isArray(from)) {\r\n // _.each(from, function(x) {\r\n // if(_.isUndefined(out[x])) out[x] = outs[i][x];\r\n // });\r\n // }else{\r\n\t\t\t\t\t// \t out[to] = outs[i][from];\r\n // }\r\n\t\t\t\t\t// });\r\n var selD = selDigest[i];\r\n var outs_i = outs[i];\r\n\r\n _.each(selD.directs, function(dg,to) {\r\n out[to] = outs_i[ dg.from ];\r\n });\r\n _.each(selD.neither, function(dg) {\r\n _.each(outs_i, function(v,k) {\r\n if(k.match(dg.regexp)) {\r\n out[ dg.prependWith + k + dg.appendWith ] = v;\r\n }\r\n });\r\n });\r\n _.each(selD.arrays, function(dg) {\r\n _.each(dg.from, function(k) {\r\n if(!_.isUndefined(outs_i[k])) {\r\n out[ dg.prependWith + k + dg.appendWith ] = outs_i[k];\r\n }\r\n });\r\n });\r\n\r\n _.each(selD.stars, function(dg) {\r\n _.each(outs_i, function(v,k) {\r\n var kk = dg.prependWith + k + dg.appendWith;\r\n if(_.isUndefined(out[kk])) {\r\n out[kk] = v;\r\n }\r\n });\r\n });\r\n\r\n\t\t\t\t});\r\n\t\t\t\treturn out;\r\n\t\t\t});\r\n\t\t}\r\n\t}else{\r\n\t\treturn function(cartOuts) {\r\n\t\t\treturn _.map(cartOuts, function(outs) {\r\n\t\t\t\tvar out = {};\r\n\t\t\t\t_.each(join,function(k,i){\r\n if(!outs[i]) return; // outs[i] has nothing to contribute\r\n\t\t\t\t\t_.each(_.keys(outs[i]), function(x) {\r\n\t\t\t\t\t\tout[x] = outs[i][x];\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\treturn out;\r\n\t\t\t});\r\n\t\t};\r\n\t}\r\n}", "function buildLinkageGroups(load, loads, groups) {\n groups[load.groupIndex] = groups[load.groupIndex] || [];\n\n // if the load already has a group index and its in its group, its already been done\n // this logic naturally handles cycles\n if (indexOf.call(groups[load.groupIndex], load) != -1)\n return;\n\n // now add it to the group to indicate its been seen\n groups[load.groupIndex].push(load);\n\n for (var i = 0, l = loads.length; i < l; i++) {\n var loadDep = loads[i];\n\n // dependencies not found are already linked\n for (var j = 0; j < load.dependencies.length; j++) {\n if (loadDep.name == load.dependencies[j].value) {\n // by definition all loads in linkset are loaded, not linked\n console.assert(loadDep.status == 'loaded', 'Load in linkSet not loaded!');\n\n // if it is a group transition, the index of the dependency has gone up\n // otherwise it is the same as the parent\n var loadDepGroupIndex = load.groupIndex + (loadDep.isDeclarative != load.isDeclarative);\n\n // the group index of an entry is always the maximum\n if (loadDep.groupIndex === undefined || loadDep.groupIndex < loadDepGroupIndex) {\n\n // if already in a group, remove from the old group\n if (loadDep.groupIndex !== undefined) {\n groups[loadDep.groupIndex].splice(indexOf.call(groups[loadDep.groupIndex], loadDep), 1);\n\n // if the old group is empty, then we have a mixed depndency cycle\n if (groups[loadDep.groupIndex].length == 0)\n throw new TypeError(\"Mixed dependency cycle detected\");\n }\n\n loadDep.groupIndex = loadDepGroupIndex;\n }\n\n buildLinkageGroups(loadDep, loads, groups);\n }\n }\n }\n }", "function buildLinkageGroups(load, loads, groups) {\n groups[load.groupIndex] = groups[load.groupIndex] || [];\n\n // if the load already has a group index and its in its group, its already been done\n // this logic naturally handles cycles\n if (indexOf.call(groups[load.groupIndex], load) != -1)\n return;\n\n // now add it to the group to indicate its been seen\n groups[load.groupIndex].push(load);\n\n for (var i = 0, l = loads.length; i < l; i++) {\n var loadDep = loads[i];\n\n // dependencies not found are already linked\n for (var j = 0; j < load.dependencies.length; j++) {\n if (loadDep.name == load.dependencies[j].value) {\n // by definition all loads in linkset are loaded, not linked\n console.assert(loadDep.status == 'loaded', 'Load in linkSet not loaded!');\n\n // if it is a group transition, the index of the dependency has gone up\n // otherwise it is the same as the parent\n var loadDepGroupIndex = load.groupIndex + (loadDep.isDeclarative != load.isDeclarative);\n\n // the group index of an entry is always the maximum\n if (loadDep.groupIndex === undefined || loadDep.groupIndex < loadDepGroupIndex) {\n\n // if already in a group, remove from the old group\n if (loadDep.groupIndex !== undefined) {\n groups[loadDep.groupIndex].splice(indexOf.call(groups[loadDep.groupIndex], loadDep), 1);\n\n // if the old group is empty, then we have a mixed depndency cycle\n if (groups[loadDep.groupIndex].length == 0)\n throw new TypeError(\"Mixed dependency cycle detected\");\n }\n\n loadDep.groupIndex = loadDepGroupIndex;\n }\n\n buildLinkageGroups(loadDep, loads, groups);\n }\n }\n }\n }", "function createIterationLink(data) {\n if (data.rows) {\n var groupIndex = 0;\n $.each(data.rows, function (index, row) {\n if (index > 0) {\n if (data.rows[index].id !== data.rows[index - 1].id) {\n groupIndex++;\n link(row, groupIndex);\n }\n }\n else {\n link(row, groupIndex);\n }\n });\n }\n}", "function handleConnections(connections) {\n groupConnectionsIDFroms = new Array();\n groupConnectionsIDTos = new Array();\n\n var idFroms = getIDFroms(connections);\n for (var i = 0; i < idFroms.length; i++) {\n var key = 0;\n var arr = new Array();\n while (key < connections.length) {\n var conn = connections[key];\n if (conn.from == idFroms[i]) {\n arr.push(conn);\n }\n key++;\n }\n groupConnectionsIDFroms.push({\n idfrom: idFroms[i],\n connections: arr\n });\n }\n //groupConnectionsIDTos = getIDTos(connections);\n groupConnectionsIDTos = new Array();\n var idTos = getIDTos(connections);\n for (var i = 0; i < idTos.length; i++) {\n var key = 0;\n var arr = new Array();\n while (key < connections.length) {\n var conn = connections[key];\n if (conn.to == idTos[i]) {\n arr.push(conn);\n }\n key++;\n }\n groupConnectionsIDTos.push({\n idto: idTos[i],\n connections: arr\n });\n }\n\n // get list id by connection form\n function getIDFroms(connections) {\n var arr = new Array();\n for (var i = 0; i < connections.length; i++) {\n var conn = connections[i];\n if (!checkIn(conn.from, arr)) {\n arr.push(conn.from);\n }\n }\n return arr;\n }\n\n // get list id by connection to\n function getIDTos(connections) {\n var arr = new Array();\n for (var i = 0; i < connections.length; i++) {\n var conn = connections[i];\n if (!checkIn(conn.to, arr)) {\n arr.push(conn.to);\n }\n }\n return arr;\n }\n\n // check existing of value in array\n function checkIn(value, arr) {\n for (var i = 0; i < arr.length; i++) {\n if (value == arr[i]) {\n return true;\n }\n }\n return false;\n }\n}", "function setupGroupLinkHover(elem) {\n $(elem).on(\"mouseenter\", function() {\n $(this).find(\".alert-group-link > a\").finish().animate({\n opacity: 100\n }, 200);\n });\n $(elem).on(\"mouseleave\", function() {\n $(this).find(\".alert-group-link > a\").finish().animate({\n opacity: 0\n }, 200);\n });\n}", "followMemberJoin(n) {\n const ret = this.items.reduce(\n (ret, i) => {\n const v = i[n]\n if (v) {\n if (Array.isArray(v)) ret.push.apply(ret, v)\n ret.push(v)\n }\n return ret\n }, [])\n if (ret.length == 0) return null\n if (ret.length == 1) return ret[0]\n return ret\n }", "function JoinAggregate(params) {\n Aggregate.call(this, params);\n }", "function JoinAggregate(params) {\n __WEBPACK_IMPORTED_MODULE_0__Aggregate__[\"a\" /* default */].call(this, params);\n}", "isJoinable (user) {\n if (!user.contact.city) {\n throw new Error('user must have a city to join a group')\n }\n\n // const userCity = user.contact.city\n // const isInCity = () => this.cityIds.includes(userCity.id)\n // const isInArea = () => this.areaIds.includes(userCity.areaId)\n const isJoinableStatus = () => this.status === STATUSES.open\n\n return isJoinableStatus() // && (isInCity() || isInArea())\n }", "static findLeftJoin(from, select, join, callback) {\n findLeftJoin(from, {}, select, join, {}, callback);\n }", "function onGroupChanged(groupEvent) {\n // leaving is simple ... if member of 'nothing', then this window is leaving\n if (groupEvent.memberOf === GroupEventMemberOf.NOTHING) {\n console.log('group-changed event: ' + groupEvent.name + ' left group');\n return;\n }\n\n // joining is a little more complicated ...\n // if sourceWindowName is the same as name, that is a primary join event\n // but at group setup, the first window is only a 'target' of a join\n // (for the 2 setup events, the target group has just those 2 members)\n if (groupEvent.reason === GroupEventReason.JOIN) {\n if (groupEvent.sourceWindowName === groupEvent.name ||\n groupEvent.targetGroup.length === 2 &&\n groupEvent.targetWindowName === groupEvent.name) {\n console.log('group-changed event: ' + groupEvent.name + ' joined group');\n }\n }\n }", "join(user, params) {\n if (!this.onjoin(user, params)){\n return false;\n }\n if (!!this.users[user.name]){\n return false;\n }\n if (!this.bindedFunc){\n let bind = {};\n bind.onmessage = this.onmessage.bind(this);\n bind.leave = this.leave.bind(this);\n this.bindedFunc = bind;\n }\n this.users[user.name] = user;\n user.on('message_obj', this.bindedFunc.onmessage);\n user.on('close', this.bindedFunc.leave);\n return true;\n }", "function getGlobalJoinfromMaps() {\n\tvar joins = Array.from(new Set(getJoinsfromMaps())); // get unique joins from #mapN .map_sync\n\tvar join = false;\n\tif (joins.length == 1) join = joins[0];\n\treturn join;\n}", "function expandGroupTable() { doGroupTableOperations('expand'); }", "function bJoinSelect(layer) {\n\tif( 'id' in layer && layer.id in borders ) {\n\t\tjoinAnother = layer.id;\n\t\t$('#j_name2').text(joinAnother);\n\t\t$('#j_do').css('display', 'block');\n\t}\n}", "join_schools({ commit }, values) {\n commit('join', values)\n }", "setGroups() {\n var objectGroups = {\"nodes\": [], \"links\": []},\n tempNodes = [],\n tempLinks = [];\n\n this.dataAll[\"nodes\"].forEach(function(node) {\n if (node[\"id\"].includes(\"Unitarians\") || node[\"id\"].includes(\"Company\") ||\n node[\"id\"].includes(\"Committee\") || node[\"id\"].includes(\"Channing, William Ellery\")) {\n tempNodes.push(node);\n }\n });\n\n this.dataAll[\"links\"].forEach(function(link) {\n if ((link[\"source\"].includes(\"Unitarians\") || link[\"source\"].includes(\"Company\") ||\n link[\"source\"].includes(\"Committee\") || link[\"source\"].includes(\"Channing, William Ellery\")) &&\n (link[\"target\"].includes(\"Unitarians\") || link[\"target\"].includes(\"Company\") ||\n link[\"target\"].includes(\"Committee\") || link[\"target\"].includes(\"Channing, William Ellery\"))) {\n tempLinks.push(link);\n }\n });\n\n objectGroups[\"nodes\"] = tempNodes;\n objectGroups[\"links\"] = tempLinks;\n\n return objectGroups;\n }", "function getObjectsGroupedWithObject(object, groupedObjects) {\n //Go through the entire list of connections.\n for(var i = 0; i < groupings.length; i++) {\n var group = groupings[i];\n \n if(object.id == group.obj1.id) {\n if(!objectInList(group.obj2, groupedObjects)) {\n groupedObjects[groupedObjects.length] = group.obj2;\n getObjectsGroupedWithObject(group.obj2, groupedObjects);\n }\n }\n else if(object.id == group.obj2.id) {\n if(!objectInList(group.obj1, groupedObjects)) {\n groupedObjects[groupedObjects.length] = group.obj1;\n getObjectsGroupedWithObject(group.obj1, groupedObjects);\n }\n }\n }\n}", "function mergeGrps(inputGrp1, inputGrp2, _callBackFunc) {\n var _ptr_1 = 0; //index indicator/pointer for group1\n var _ptr_2 = 0; //index indicator/pointer for group2\n\n while(_ptr_1 < inputGrp1.length && _ptr_2 < inputGrp2.length) { //Stop when either pointer reach the end of the array\n if (inputGrp1[_ptr_1].time < inputGrp2[_ptr_2].time) {\n var _datum = jQuery.extend(true, {}, datum);\n _datum.time = inputGrp1[_ptr_1].time;\n // if (inputGrp1[_ptr_1].status === \"1\") {\n // Modified.\n if (inputGrp1[_ptr_1].status == \"1\") {\n _datum.num_of_failure_1 = 1;\n _datum.num_at_risk_1 = inputGrp1[_ptr_1].num_at_risk;\n _datum.num_at_risk_2 = inputGrp2[_ptr_2].num_at_risk;\n _ptr_1 += 1;\n } else {\n _ptr_1 += 1;\n continue;\n }\n } else if (inputGrp1[_ptr_1].time > inputGrp2[_ptr_2].time) {\n var _datum = jQuery.extend(true, {}, datum);\n _datum.time = inputGrp2[_ptr_2].time;\n // if (inputGrp2[_ptr_2].status === \"1\") {\n // Modified.\n if (inputGrp2[_ptr_2].status == \"1\") {\n _datum.num_of_failure_2 = 1;\n _datum.num_at_risk_1 = inputGrp1[_ptr_1].num_at_risk;\n _datum.num_at_risk_2 = inputGrp2[_ptr_2].num_at_risk;\n _ptr_2 += 1;\n } else {\n _ptr_2 += 1;\n continue;\n }\n } else { //events occur at the same time point\n var _datum = jQuery.extend(true, {}, datum);\n _datum.time = inputGrp1[_ptr_1].time;\n // if (inputGrp1[_ptr_1].status === \"1\" || inputGrp2[_ptr_2].status === \"1\") {\n // Modified.\n if (inputGrp1[_ptr_1].status == \"1\" || inputGrp2[_ptr_2].status == \"1\") {\n // if (inputGrp1[_ptr_1].status === \"1\") {\n // Modified.\n if (inputGrp1[_ptr_1].status == \"1\") {\n _datum.num_of_failure_1 = 1;\n }\n // if (inputGrp2[_ptr_2].status === \"1\") {\n // Modified.\n if (inputGrp2[_ptr_2].status == \"1\") {\n _datum.num_of_failure_2 = 1;\n }\n _datum.num_at_risk_1 = inputGrp1[_ptr_1].num_at_risk;\n _datum.num_at_risk_2 = inputGrp2[_ptr_2].num_at_risk;\n _ptr_1 += 1;\n _ptr_2 += 1;\n } else {\n _ptr_1 += 1;\n _ptr_2 += 1;\n continue;\n }\n }\n mergedArr.push(_datum);\n }\n calcExpection(_callBackFunc);\n }", "function mergeGrps(inputGrp1, inputGrp2, _callBackFunc) {\n var _ptr_1 = 0; //index indicator/pointer for group1\n var _ptr_2 = 0; //index indicator/pointer for group2\n\n while(_ptr_1 < inputGrp1.length && _ptr_2 < inputGrp2.length) { //Stop when either pointer reach the end of the array\n if (inputGrp1[_ptr_1].time < inputGrp2[_ptr_2].time) {\n var _datum = jQuery.extend(true, {}, datum);\n _datum.time = inputGrp1[_ptr_1].time;\n // if (inputGrp1[_ptr_1].status === \"1\") {\n // Modified.\n if (inputGrp1[_ptr_1].status == \"1\") {\n _datum.num_of_failure_1 = 1;\n _datum.num_at_risk_1 = inputGrp1[_ptr_1].num_at_risk;\n _datum.num_at_risk_2 = inputGrp2[_ptr_2].num_at_risk;\n _ptr_1 += 1;\n } else {\n _ptr_1 += 1;\n continue;\n }\n } else if (inputGrp1[_ptr_1].time > inputGrp2[_ptr_2].time) {\n var _datum = jQuery.extend(true, {}, datum);\n _datum.time = inputGrp2[_ptr_2].time;\n // if (inputGrp2[_ptr_2].status === \"1\") {\n // Modified.\n if (inputGrp2[_ptr_2].status == \"1\") {\n _datum.num_of_failure_2 = 1;\n _datum.num_at_risk_1 = inputGrp1[_ptr_1].num_at_risk;\n _datum.num_at_risk_2 = inputGrp2[_ptr_2].num_at_risk;\n _ptr_2 += 1;\n } else {\n _ptr_2 += 1;\n continue;\n }\n } else { //events occur at the same time point\n var _datum = jQuery.extend(true, {}, datum);\n _datum.time = inputGrp1[_ptr_1].time;\n // if (inputGrp1[_ptr_1].status === \"1\" || inputGrp2[_ptr_2].status === \"1\") {\n // Modified.\n if (inputGrp1[_ptr_1].status == \"1\" || inputGrp2[_ptr_2].status == \"1\") {\n // if (inputGrp1[_ptr_1].status === \"1\") {\n // Modified.\n if (inputGrp1[_ptr_1].status == \"1\") {\n _datum.num_of_failure_1 = 1;\n }\n // if (inputGrp2[_ptr_2].status === \"1\") {\n // Modified.\n if (inputGrp2[_ptr_2].status == \"1\") {\n _datum.num_of_failure_2 = 1;\n }\n _datum.num_at_risk_1 = inputGrp1[_ptr_1].num_at_risk;\n _datum.num_at_risk_2 = inputGrp2[_ptr_2].num_at_risk;\n _ptr_1 += 1;\n _ptr_2 += 1;\n } else {\n _ptr_1 += 1;\n _ptr_2 += 1;\n continue;\n }\n }\n mergedArr.push(_datum);\n }\n calcExpection(_callBackFunc);\n }", "function addGroupLink(group)\n{\n let cidx = group.challengeObj.index;\n let levelIdx = levelIndexes[group.level];\n\n if (!challengeGroups[cidx]) {\n challengeGroups[cidx] = new ChallengeSection(group);\n }\n //console.log(group);\n\n challengeGroups[cidx].levels[levelIdx] = new LevelLink(group);\n}", "function i(e){return(0,w.default)(e.participants,{state:\"JOINED\"})}", "function getGroupedObjectsArray(object, groupedObjects) {\n //Go through the entire 2D array.\n for(var i = 0; i < groupings.length; i++) {\n var group = groupings[i];\n \n if(object.id == group.obj1.id) {\n if(!pairInList(group.obj1, group.obj2, groupedObjects)) {\n //alert(group.obj1.id + \" and \" + group.obj2.id + \" are not in the connections list, adding them now\");\n \n groupedObjects[groupedObjects.length] = group;\n getGroupedObjectsArray(group.obj2, groupedObjects);\n }\n }\n else if(object.id == group.obj2.id) {\n if(!pairInList(group.obj1, group.obj2, groupedObjects)) {\n //alert(group.obj1.id + \" and \" + group.obj2.id + \" are not in the connections list, adding them now\");\n \n groupedObjects[groupedObjects.length] = group;\n getGroupedObjectsArray(group.obj1, groupedObjects);\n }\n }\n }\n}", "static findInnerJoin(from, select, join, callback) {\n findInnerJoin(from, {}, select, join, {}, callback);\n }", "onJoin(myEvent) {\n console.log(\"join called \" + myEvent._id);\n\n Meteor.call(\"events.joinEvent\", myEvent, (err, res) => {\n if (err) {\n alert(\"Error Joining\");\n console.log(err);\n return;\n }\n\n console.log(\"return from join evt: \" + res);\n });\n }", "function startDatabaseQueries() {\n\n // var myUserId = firebase.auth().currentUser.uid;\n var myUserId = currentUser.uid;\n \n\n // var recentGroupsRef = firebase.database().ref('/groups/').limitToLast(10); // last created?\n // var recentGroupsRef = firebase.database().ref('/groups/'); // only if have my tags? TODO: FIX:\n // var userGroupsRef = firebase.database().ref('/user-groups/' + myUserId); // original location\n // var userGroupsRef = firebase.database().ref('/dashboards/');\n\n // var userGroupsRef = firebase.database().ref('/dashboards/').orderByChild('/tags').equalTo('nyc');\n\n var groupRef = null; // firebase.database().ref('/dashboards/').orderByChild('/tags/nyc').equalTo(true);\n\n\t// var userGroupsRef = firebase.database().ref('/dashboards/').orderByChild('/tags/nyc').equalTo(true);\n\n // Fetching and displaying all groups of each sections.\n // fetchGroups(userGroupsRef, domUserGroupsSection, 'user');\n // fetchGroups(recentGroupsRef, domRecentGroupsSection, 'recent');\n // fetchGroups(topUserGroupsRef, domTopUserGroupsSection, 'top'); // don't need top?\n\n\n // Listen for device-data changes\n var deviceInfoChanges = firebase.database().ref('/devices/'); // get it all ya, big data returned. Mayber later split up to individual devices?\n deviceInfoChanges.on('child_changed', function(snapshot) {\n\t console.log('device['+snapshot.key+'] changed, updating all tables for this device ...');\n\t updateDeviceData(snapshot);\n\t});\n\n // Keep track of all Firebase refs we are listening to.\n\t// listeningFirebaseRefs.push(userGroupsRef);\n // listeningFirebaseRefs.push(recentGroupsRef);\n // listeningFirebaseRefs.push(topUserGroupsRef); // don't need top?\n\n /*\n userGroupsRef.on(\"value\", function(snapshot) { // shallow flag? this is only to get the initial count?\n\t if ( snapshot.numChildren() > 0 ) {\n\t\tgotoLastBreadcrumb(); // \t domMyGroupsMenuButton.onclick(); // launch with GROUPS\n\t } else {\n\t\tdomShowHelpMenuButton.onclick(); // launch with HELP\n\t };\n\t})\n */\n\n // gotoLastBreadcrumb(); // \t domMyGroupsMenuButton.onclick(); // launch with GROUPS\n\n gotoLastBreadcrumb(); // \t domMyGroupsMenuButton.onclick(); // launch with GROUPS\n\n}", "function handleJoinRelayMsg(msg, id, ip_address, routing_table, awaiting_acks, socket) {\n route(msg.node_id, id, routing_table, function(route_id) {\n if (route_id !== id) send(msg, route_id, id, routing_table, awaiting_acks, socket, { no_ping: true });\n });\n sendRoutingInfo(msg.gateway_id, msg.node_id, id, ip_address, routing_table, awaiting_acks, socket);\n}", "function appendGroup(group, fn) {\n if (_.isArray(group.field)) {\n queryOr[group.originalField] = queryOr[group.originalField] || {};\n\n _.each(group.field, function(field) {\n queryOr[group.originalField][field] = queryOr[group.originalField][field] || {};\n queryOr[group.originalField][field] = fn(queryOr[group.originalField][field]);\n });\n } else {\n queryAll[group.field] = fn(queryAll[group.field]);\n }\n }", "joinCall(step) {\r\n if (step === 'select') {\r\n callOne = firstCallId; //getSelectedCall();\r\n } else if (step === 'join') {\r\n var callTwo = firstCallId; //getSelectedCall();\r\n console.log('Joining callOne (' + callOne + ') to callTwo (' + callTwo + ').');\r\n kandy.joinCall(callOne, callTwo);\r\n callOne = undefined;\r\n }\r\n }", "joinCall(step) {\r\n if (step === 'select') {\r\n callOne = firstCallId; //getSelectedCall();\r\n } else if (step === 'join') {\r\n var callTwo = firstCallId; //getSelectedCall();\r\n console.log('Joining callOne (' + callOne + ') to callTwo (' + callTwo + ').');\r\n kandy.joinCall(callOne, callTwo);\r\n callOne = undefined;\r\n }\r\n }", "function groupObjectsAtLoc(object1, x1, y1, object2, x2, y2) {\n var group = new Connection(object1, x1, y1, object2, x2, y2);\n \n //Animate the grouping before adding them to the grouped objects array so that they animate correctly.\n animateGrouping(group);\n \n //Add them to the grouped objects array.\n groupings[groupings.length] = group;\n\n clearAllHighlighted();\n}", "async handleAutoJoinRepos (op) {\n\t\tconst autoJoinRepos = (op.$set || {})['settings.autoJoinRepos'] || [];\n\t\tif (autoJoinRepos.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// get the repos for which auto-join is being turned on, make sure they are all owned by this team\n\t\tlet repos = await this.data.repos.getByIds(op.$set['settings.autoJoinRepos']);\n\t\trepos = repos.filter(repo => repo.get('teamId') === this.team.id);\n\n\t\t// for each repo, look for known commit hashes that aren't already mapped, and map them\n\t\tawait Promise.all(repos.map(async repo => {\n\t\t\tawait AddCommitHashesByRepo(repo, this.data);\n\t\t}));\n\t}", "static findLeftJoinOrder(from, select, join, orderby, callback) {\n findLeftJoin(from, {}, select, join, orderby, callback);\n }", "function animateUngrouping(group) {\n var GAP = 10; //we want a 10 pixel gap between objects to show that they're no longer grouped together.\n //Figure out which is the left most and which is the right most object. The left most object will move left and the right most object will move right. TODO: What implications does this have for the rest of the scene? For example, when the left most object is also one connected to an object to its right. Do we want to put in additional rules to deal with this, or are we going to calculate the \"left-most\" and \"right-most\" objects as whatever groups of objects we'll need to move. Should we instead move the smaller of the two objects away from the larger of the two. What about generalizability? What happens when we've got 2 groups of objects that need to ungroup, or alternately what if the object is connected to multiple things at once, how do we move it away from the object that it was just ungrouped from, while keeping it connected to the objects it's still grouped with. Do we animate both sets of objects or just one set of objects?\n \n //Lets start with the simplest case and go from there. 2 objects are grouped together and we just want to move them apart.\n //There are 2 possibilities. Either they are partially overlapping (or connected on the edges), or one object is contained within the other.\n //Figure out which one is the correct one. Then figure out which direction to move them and which object we're moving if we're not moving both.\n //If object 1 is contained within object 2.\n if(objectContainedInObject(group.obj1, group.obj2)) {\n //alert(\"check 1\" + group.obj1.id + \" contained in \" + group.obj2.id);\n //For now just move the object that's contained within the other object toward the left until it's no longer overlapping.\n //Also make sure you're not moving it off screen.\n while((group.obj1.offsetLeft + group.obj1.offsetWidth + GAP > group.obj2.offsetLeft) &&\n (group.obj1.offsetLeft - STEP > 0)) {\n move(group.obj1, group.obj1.offsetLeft - STEP, group.obj1.offsetTop, false);\n }\n }\n //If object 2 is contained within object 1.\n else if(objectContainedInObject(group.obj2, group.obj1)) {\n //alert(\"check 2\" + group.obj2.id + \" contained in \" + group.obj1.id);\n //For now just move the object that's contained within the other object toward the left until it's no longer overlapping.\n //Also make sure you're not moving it off screen.\n \n while((group.obj2.offsetLeft + group.obj2.offsetWidth + GAP > group.obj1.offsetLeft) &&\n (group.obj2.offsetLeft - STEP > 0)) {\n move(group.obj2, group.obj2.offsetLeft - STEP, group.obj2.offsetTop, false);\n }\n }\n //Otherwise, partially overlapping or connected on the edges.\n else {\n //Figure out which is the leftmost object.\n if(group.obj1.offsetLeft < group.obj2.offsetLeft) {\n //Move obj1 left by STEP and obj2 right by STEP until there's a distance of 10 pixels between them.\n //Also make sure you're not moving either object offscreen.\n while(group.obj1.offsetLeft + group.obj1.offsetWidth + GAP > group.obj2.offsetLeft) {\n if(group.obj1.offsetLeft - STEP > 0)\n move(group.obj1, group.obj1.offsetLeft - STEP, group.obj1.offsetTop, false);\n \n if(group.obj2.offsetLeft + group.obj2.offsetWidth + STEP < window.innerWidth)\n move(group.obj2, group.obj2.offsetLeft + STEP, group.obj1.offsetTop, false);\n }\n }\n else {\n //Move obj2 left by STEP and obj1 right by STEP until there's a distance of 10 pixels between them.\n //Change the location of the object.\n while(group.obj2.offsetLeft + group.obj2.offsetWidth + GAP > group.obj1.offsetLeft) {\n if(group.obj1.offsetLeft + group.obj1.offsetWidth + STEP < window.innerWidth)\n move(group.obj1, group.obj1.offsetLeft + STEP, group.obj1.offsetTop, false);\n \n if(group.obj2.offsetLeft - STEP > 0)\n move(group.obj2, group.obj2.offsetLeft - STEP, group.obj2.offsetTop, false);\n }\n }\n }\n}", "function eventJoin() {\n \tconsole.log('Join Event');\n\tvar mu = $(\".nodeselected.mu\").text().trim();\n\tvar nn = Number($(\".nodeselected.nn\").text());\n\tvar mt = $(\".nodeselected.mt\").text().trim();\n\tvar v = $(\".nodeselected.v\").text().trim();\n\tif ((nn == undefined) || (nn == \"\")) {\n\t\talert(\"Please select a node and and event.\");\n\t\treturn;\n\t}\n\t\n\tvar enn = $(\".eventselected.enn\").text().trim();\n\tvar en = $(\".eventselected.en\").text().trim();\n\tif ((en == undefined) || (en == \"\")) {\n\t\talert(\"Please select a node and and event.\");\n\t\treturn;\n\t}\n\t\n\tvar module = findModule(nn);\n\tif (module == undefined) return;\n\tconsole.log(\"join event - found module \"+module.type);\n\t\n\t// check it doesn't already exist\n\tif (findEvent(module, enn, en) == null) {\n\t\tvar e = {};\n\t\te.nn = enn;\n\t\te.en = en;\n\t\tmodule.events.push(e);\n\t} else {\n\t\talert(\"already joined\");\n\t}\n}", "onToggleGroup({ groupRecord, collapse }) {\n let store = this.scheduler.store,\n // First record in next group\n recordIndex = store.indexOf(groupRecord) + (collapse ? 1 : groupRecord.groupChildren.length);\n\n // Handle this group\n if (collapse) {\n // Collapsing -> events in the group will be hidden, remove them from cache\n groupRecord.groupChildren.forEach((child) => {\n this.cache.clearRow(child.id);\n });\n }\n\n // TODO: this should not need to loop til the end, since only events in view are drawn. will be costly with large amount of resources\n // Loop starting at the next group\n for (; recordIndex < store.count; recordIndex++) {\n this.cache.clearRow(store.getAt(recordIndex).id);\n }\n }", "function joinAndConnectRoom (roomId) {\n $.post(\"/chatroom/joinedRooms\", {username:username}, function(data) {\n let joinedRoomsGroup = $(\"#joinedRooms\");\n joinedRoomsGroup.empty();\n if (data == null) return;\n for(let i = 0; i < data.length ;i++) {\n let room = data[i];\n let type = room.type;\n let roomTemp = templateJoinedRoom;\n roomTemp = roomTemp.replace('ROOM-NAME', room.name);\n roomTemp = roomTemp.replace('ROOM-ID',room.id);\n roomTemp = roomTemp.replace('all-room-ROOM-ID','joined-room' + room.id);\n if(type === \"Public\") {\n if(room.name === \"General\") {\n roomTemp = roomTemp.replace('ROOM-STYLE',\"list-group-item-success\");\n } else {\n roomTemp = roomTemp.replace('ROOM-STYLE',\"list-group-item-primary\");\n }\n } else if (type === \"Private\") {\n roomTemp = roomTemp.replace('ROOM-STYLE',\"list-group-item-secondary\");\n } else {\n return null;\n }\n roomTemp = roomTemp.replace('ROOM-GROUP-NAME',\"joined-room\");\n joinedRoomsGroup.append(roomTemp);\n }\n $('#joined-room' + roomId).prop(\"checked\", true);\n connectToRoom();\n },\"json\");\n}", "joinProducts(userId) {\n return new Promise((fulfill, reject) => {\n return items().then((itemCollection) => {\n var cursor = itemCollection.aggregate([\n { \"$match\": { \"userId\": userId } },\n {\n \"$lookup\": {\n \"from\": \"products\",\n \"localField\": \"upc\",\n \"foreignField\": \"_id\",\n \"as\": \"product_info\"\n }\n },\n { \"$addFields\": { \"product_name\": \"$product_info.product_name\", \"product_picture\": \"$product_info.product_picture\" } },\n { \"$unwind\": \"$product_name\" }, { \"$unwind\": \"$product_picture\" },\n { \"$project\": { \"product_info\": 0 } },\n ]);\n cursor.toArray(function(err, result) {\n if (err) {\n reject(\"Error performing join\");\n } else {\n fulfill(result);\n }\n });\n });\n });\n }", "function getItemsJoinRelated(media_object) {\n $('.upload-overlay-loading-fix').show();\n\n $.ajax({\n url: ReturnLink('/ajax/ajax_all_userjoins_media.php'),\n data: {media: media_object.attr('data-type'), mediaid: media_object.attr('data-id'), page: media_object.attr(\"data-page-userjoin\")},\n type: 'post',\n success: function (data) {\n var ret = null;\n try {\n ret = $.parseJSON(data);\n } catch (Ex) {\n $('.upload-overlay-loading-fix').hide();\n return;\n }\n if (ret.error) {\n TTAlert({\n msg: ret.error,\n type: 'alert',\n btn1: t('ok'),\n btn2: '',\n btn2Callback: null\n });\n $('.upload-overlay-loading-fix').hide();\n return;\n } else {\n var myData = ret.data;\n var divNum = ret.count;\n\n media_object.find('.userjoinsDiv .containerDiv .commentsAll .commentsAll_inside').append(myData);\n media_object.find(\".joinsNumber\").html(divNum);\n\n var mylimit = 6;\n if (parseInt(user_Is_channel) == 0 && parseInt(user_is_logged) == 1) {\n mylimit = 5;\n }\n\n if (divNum <= mylimit) {\n media_object.find(\".userjoinsDiv .showMore_joins\").hide();\n } else {\n currentpage_userjoin = parseInt(media_object.attr(\"data-page-userjoin\"));\n //console.log(currentpage_userjoin+\"][\"+mylimit);\n if ((currentpage_userjoin + 1) * mylimit >= divNum) {\n media_object.find(\".userjoinsDiv .showMore_joins\").hide();\n } else {\n media_object.find(\".userjoinsDiv .showMore_joins\").show();\n }\n media_object.find(\".userjoinsDiv .commentsAll\").addClass(\"scrollpane_userjoin\");\n initscrollPaneSocial(media_object.find(\".scrollpane_userjoin\"), true);\n }\n initLikersDataUserJoins();\n }\n $('.upload-overlay-loading-fix').hide();\n }\n });\n}", "function joinResults(req, res, next) {\n\t\tconst joinedResults = [];\n\n\t\tfor (const resultArray of req.results) {\n\t\t\tfor (const result of resultArray) {\n\t\t\t\tconst post = result.post;\n\t\t\t\t// temp fix for comments without parents -> see Trello for relevant card\n\t\t\t\tif (!post || Object.keys(post) === 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tpost.id = post._id;\n\t\t\t\tdelete post._id;\n\n\t\t\t\t// Both aggregation pipelines may have returned the same post\n\t\t\t\tconst isDuplicate = joinedResults.some(function(joinedPost) {\n\t\t\t\t\treturn joinedPost.id.toString() === post.id.toString();\n\t\t\t\t});\n\n\t\t\t\tif (isDuplicate === false) {\n\t\t\t\t\tjoinedResults.push(post);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treq.results = joinedResults;\n\n\t\tnext();\n\t}", "static findInnerJoinOrder(from, select, join, orderby, callback) {\n findInnerJoin(from, {}, select, join, orderby, callback);\n }", "function handleRoomJoining(socket) {\n socket.on('join', function(room) {\n socket.leave(currentRoom[socket.id]);\n joinRoom(socket, room.newRoom);\n });\n}", "function test_join() {\n var plan1 = tasks(\"ns:identity\").plan({\n x: [1, 2]\n });\n var plan2 = tasks(\"ns:mult\").plan({\n x: plan1,\n y: [3, 5]\n });\n var plan3 = tasks(\"ns:plus\").plan(\n {\n x: plan1,\n y: plan2\n }\n );\n \n var result = plan3.run();\n check_array(result, [4, 6, 8, 12]);\n}", "function linked(status) {\n\n st = status;\n\n// out(\"connection status: \"+statusCodes[status] );\n if (status == Strophe.Status.CONNECTED) {\n //logging\n console.log(\"connected\");\n\n //announcing ourselves\n var pres = $pres({type:'available',priority: 10});\n connection.send(pres); \n\n //join group. tmp for now \n if(group_name && my_name){\n join_group(group_name);\n }else{\n //console.log(\"no group name sorry!\");\n }\n\n }\n if (status == Strophe.Status.DISCONNECTED || status == Strophe.Status.DISCONNECTING) {\n //overlay to warn users that they are not connected\n show_disconnect();\n }\n \n}", "function updateJoinTable(tables) {\n var joinTableBody = $('#join-table-body');\n\n // Insert first row\n joinTableBody.html(buildInitialJoinTableRow(tables[0].name));\n\n // Keep track of optgroup markup for tables already joined\n var joinedTableColumnOptions = buildColumnOptions(tables[0]);\n // Build subsequent rows for the rest of the tables\n for (var i = 1; i < tables.length; i++) {\n var table = tables[i];\n var tableColumnOptions = buildColumnOptions(table);\n // Append row for this table\n joinTableBody.append(buildJoinTableRow(i, table.name, tableColumnOptions, joinedTableColumnOptions));\n // Add column options string to joinedTableColumnOptions\n joinedTableColumnOptions += tableColumnOptions;\n }\n\n // Add listeners to join column selects\n joinTableBody.find('.join-column-select').change(joinColumnSelectListener);\n}", "join(room){\n \tthis.room[room] = true;\n\t}", "joinGame(gameId, playerId) {\n\n const playerRef = userDocRef(playerId);\n playerRef.get().then(doc => {\n const data = doc.data();\n if (data) {\n const playerData = data.player;\n playerRef.set({\n player: {\n ...playerData,\n leaving: false, /* Clear leaving state */\n }\n })\n }\n })\n // Returns a Promise\n // Add own ID to game's player list\n return fdb.collection('games').doc(gameId).get().then(doc => {\n const doc_data = doc.data();\n\n /* Game exists */\n if (doc_data) {\n const { players } = doc_data;\n\n if (!players.includes(playerId)) { // I'm not in the game\n if (players.length >= this.MAX_PLAYERS) { // ...but it's full, sorry.\n return {\n success: false,\n error: 'Sorry, game is full!',\n };\n }\n\n players.push(playerId); // ...so add myself\n fdb.collection('games').doc(gameId).update({ players })\n }\n }\n\n /* Game doesn't exist yet */\n if (doc_data === undefined) {\n /* Create it... */\n fdb.collection('games').doc(gameId).set({\n name: gameId,\n players: [playerId],\n double: false,\n })\n }\n\n\n // I'm in the game\n // ...subscribe to game updates to know when players join/leave.\n const closeGameListener =\n fdb.collection('games').doc(gameId).onSnapshot(doc => {\n const game = { ...doc.data(), id: doc.id };\n const error = null;\n this.update({\n game,\n error,\n showingJoinDetails: false,\n });\n });\n\n return { success: true, closer: closeGameListener };\n });\n\n }", "function addSplitsJoins(module)\n{\n var allInputs = [];\n var allOutputs = [];\n module.nodes.forEach(function(n)\n {\n n.inputPorts.forEach(function(i)\n {\n allInputs.push(',' + i.value.join() + ',');\n });\n n.outputPorts.forEach(function(i)\n {\n allOutputs.push(',' + i.value.join() + ',');\n });\n });\n\n var allInputsCopy = allInputs.slice();\n var splits = {};\n var joins = {};\n allInputs.forEach(function(input) {\n gather(\n allOutputs,\n allInputsCopy,\n input,\n 0,\n input.length,\n splits,\n joins);\n });\n\n for (var join in joins) {\n // turn string into array of signal names\n var signals = join.slice(1, -1).split(',');\n // convert the signals into actual numbers\n for (var i in signals) {\n signals[i] = Number(signals[i]);\n }\n\n var outPorts = [{'key': 'Y', 'value': signals}];\n var inPorts = [];\n joins[join].forEach(function(name) {\n var value = getBits(signals, name);\n inPorts.push({'key': name, 'value': value});\n });\n module.nodes.push({'key': '$join$' + join,\n 'hide_name': 1,\n 'type': '$_join_',\n 'inputPorts': inPorts,\n 'outputPorts': outPorts});\n }\n\n for (var split in splits) {\n signals = split.slice(1, -1).split(',');\n for (var i in signals) {\n signals[i] = Number(signals[i]);\n }\n var inPorts = [{'key': 'A', 'value': signals}];\n var outPorts = [];\n splits[split].forEach(function(name) {\n var value = getBits(signals, name);\n outPorts.push({'key': name, 'value': value});\n });\n module.nodes.push({'key': '$split$' + split,\n 'hide_name': 1,\n 'type': '$_split_',\n 'inputPorts': inPorts,\n 'outputPorts': outPorts});\n }\n}", "function handleMoveRecipientGroupsAround()\n {\n var outer = $('#sms-recipient-groups');\n\n var all = outer.find('.recipient-groups .all-groups .inner');\n var selected = outer.find('.recipient-groups .selected-groups .inner');\n\n outer.find('.recipient-groups input:checkbox').change(function() {\n if ($(this).is(':checked')) {\n $(this).parents('label').appendTo(selected)\n } else {\n $(this).parents('label').appendTo(all)\n }\n });\n }", "handleJoin(name) {\n this.name = name;\n this.room.join(this);\n this.room.broadcast({\n type: 'note',\n text: `${this.name} joined \"${this.room.name}\".`\n });\n }", "triggerToggleLayerGroup() {\n const datasetID = this.props.dataset.id;\n const addLayerGroup = !this.props.isLayerGroupAdded(datasetID);\n this.props.toggleLayerGroup(datasetID, addLayerGroup);\n }", "function acceptGroupInvitation(feedRequest) {\n\n feedRequest.set('type', 'GroupJoin');\n\n Parse.Promise.when([\n feedRequest.get(\"group\"),\n feedRequest.get(\"fromUser\"),\n feedRequest.get(\"toUsers\"),\n feedRequest.save()\n ]).then(function(group, user, toUsers, feedRequestSaved){\n\n var promises = [];\n\n var Feed = Parse.Object.extend(\"Feed\");\n var feedQuery = new Parse.Query(Feed);\n feedQuery.equalTo('churchId', appID);\n feedQuery.equalTo('requestStatus', 'request');\n feedQuery.equalTo('group', group);\n feedQuery.equalTo('type', 'GroupInvitation');\n feedQuery.containsAll('toUsers', toUsers);\n\n promises.push(feedQuery.first());\n\n group.add('joinedUsers', currentUser);\n promises.push(group.save());\n\n promises.push(pushNotificationManager.sendGroupRefreshNotification(group.id));\n promises.push(pushNotificationManager.sendFeedNotification(toUsers));\n promises.push(pushNotificationManager.sendGroupJoinAcceptedNotification(user)); \n return Parse.Promise.when(promises);\n\n }).then(function(oldInvitation){\n\n if (oldInvitation) {\n return oldInvitation.destroy();\n }else{\n return;\n }\n \n });\n\n}", "function bgDeleteGroup(groupId, collectGroups) {\r\n if(groupId) {\r\n var groups = collectGroups;\r\n \r\n BRW_dbTransaction(function(tx) {\r\n BRW_dbDelete(\r\n {//Param\r\n tx : tx,\r\n table : 'GROUPS',\r\n where : {\r\n key : 'id',\r\n val : groupId\r\n }\r\n },\r\n function(results){//Success\r\n \r\n } \r\n );\r\n });\r\n }\r\n}", "enterGroupMembers(ctx) {\n\t}", "isJoined(name, id) {\n\t return axios.get(`${JPA_API_URL}/users/${name}/groups/${id}/isJoined`);\n\t}", "function getSingleGroup(db, ObjectID, groupdoc, issuper, curruserid){\n\n var getGroupArray = async () => {\n var userdoc = await (global.lookupUserName(db, groupdoc.groupadminid));\n var adminname = userdoc.username;\n var adminimage = userdoc.imagepath;\n\n var newgroup = new Group.Group_CS(\n groupdoc._id, \n groupdoc.groupname,\n adminname,\n groupdoc.groupadminid,\n adminimage,\n groupdoc.description\n );\n\n newgroup.channels = await getChannels();\n newgroup.groupassists = await getGroupAssists();\n\n return newgroup;\n };\n\n var getChannels = async () => {\n if (groupdoc.channels == undefined) return [];\n var channels = [];\n var isassist = false;\n\n //check if assist\n if (groupdoc.groupassists != undefined){\n for (var a=0; a<groupdoc.groupassists.length; a++){\n if (groupdoc.groupassists[a].userid == curruserid){\n isassist = true;\n }\n }\n }\n\n for (var c=0; c < groupdoc.channels.length; c++){\n var channeldoc = groupdoc.channels[c];\n\n if (issuper == 'true' || groupdoc.groupadminid == curruserid || isassist){\n //If SUPER then add then channel straight away\n var newchannel = new Channel.Channel_CS(\n channeldoc._id,\n channeldoc.channelname\n );\n channels.push(newchannel);\n\n } else {\n //NOT SUPER - only add if curruser is a member\n if (channeldoc.members == undefined) return [];\n\n for (var m=0; m < channeldoc.members.length; m++){\n var memberdoc = channeldoc.members[m];\n var isassist = await isGroupAssist();\n\n if (isassist || curruserid == memberdoc.userid){\n var newchannel = new Channel.Channel_CS(\n channeldoc._id,\n channeldoc.channelname\n );\n channels.push(newchannel);\n }\n }\n }\n\n }\n\n return channels;\n };\n\n var isGroupAssist = async () => {\n if (groupdoc.groupassists == undefined) return false;\n var found = false;\n\n for (var a=0; a < groupdoc.groupassists.length; a++){\n var assist = groupdoc.groupassists[a];\n if (assist.userid == curruserid){\n found = true;\n }\n }\n\n return found;\n };\n\n var getGroupAssists = async () => {\n if (groupdoc.groupassists == undefined) return [];\n\n var assists = [];\n\n for (var a=0; a < groupdoc.groupassists.length; a++){\n var assistdoc = groupdoc.groupassists[a];\n var userdoc = await (global.lookupUserName(db, assistdoc.userid));\n\n var assist = new GroupAssist.GroupAssist_CS(\n assistdoc._id,\n assistdoc.userid,\n userdoc.username,\n userdoc.imagepath\n );\n \n assists.push(assist);\n }\n\n return assists;\n };\n\n return new Promise((resolve, reject) => {\n getGroupArray().then(function(result) {\n resolve(result);\n });\n });\n}", "toggleGroupLines(args) {\n\n let groups = this.state.groups;\n\n if (args.isGroup) {\n if (args.expanded) {\n //collapse recrods, ie remove grouipLines from the groups object\n let groupLineCount = this.state.groups[args.index].ChildRows;\n //remove child rows\n groups.splice(args.index + 1, groupLineCount);\n //reset checkbox to unchecked state\n groups[args.index].expanded = false;\n\n //update state\n this.setState({groups: groups})\n\n }\n else {\n // show records , if for the first time then fetch recrods\n let selectedGroup = this.state.groups[args.index];\n //if grouplines are not fetched yet\n if (selectedGroup.groupLines === undefined) {\n this.fetchData({type: \"FETCH_GROUPLINES\", args: {groupEZID: groups[args.index].EZID}})\n }\n else {\n //add grouplines records from selected groups object to groups\n groups.splice(args.index + 1, 0, ...selectedGroup.groupLines);\n groups[args.index].expanded = true;\n this.setState({groups: groups})\n }\n\n }\n }\n else {\n groups[args.index].expanded = !groups[args.index].expanded;\n this.setState({groups: groups})\n }\n }", "function joinValid() {\n if ( angular.isDefined(vm.joinType) && vm.joinType !== null && \n (vm.joinType === JOIN.INNER || vm.joinType === JOIN.LEFT_OUTER || \n vm.joinType === JOIN.RIGHT_OUTER || vm.joinType === JOIN.FULL_OUTER) ) {\n return true;\n }\n return false;\n }", "function forwardToGroup(event) {\n\t\tvar target = event.currentTarget;\n\t\tvar url = $(target).data('link');\n\t\twindow.open(url)\n\t}", "function validateGroupReferences() {\n\n\n\t//data element group membership\n\tvar item, group, grouped = {}, unGrouped = [], found = false, validMembers;\n\tfor (var i = 0; metaData.dataElementGroups && i < metaData.dataElementGroups.length; i++) {\n\t\tvalidMembers = [];\n\t\tgroup = metaData.dataElementGroups[i];\n\t\tfor (var j = 0; j < group.dataElements.length; j++) {\n\t\t\titem = group.dataElements[j];\n\t\t\tfound = false;\n\t\t\tfor (var k = 0; !found && metaData.dataElements && k < metaData.dataElements.length; k++) {\n\t\t\t\tif (item.id === metaData.dataElements[k].id) {\n\t\t\t\t\tfound = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (found) {\n\t\t\t\tvalidMembers.push(item);\n\t\t\t\tgrouped[item.id] = true;\n\t\t\t}\n\t\t}\n\t\tmetaData.dataElementGroups[i].dataElements = validMembers;\n\t\tdelete metaData.dataElementGroups[i].dataElementGroupSet;\n\t}\n\tfor (var i = 0; metaData.dataElements && i < metaData.dataElements.length; i++) {\n\t\tif (!grouped.hasOwnProperty(metaData.dataElements[i].id)) {\n\t\t\tunGrouped.push({\n\t\t\t\t\"id\": metaData.dataElements[i].id,\n\t\t\t\t\"name\": metaData.dataElements[i].shortName,\n\t\t\t\t\"type\": \"dataElements\"\n\t\t\t});\n\t\t}\n\t}\n\n\n\t//indicator group membership\n\tgrouped = {};\n\tfor (var i = 0; metaData.indicatorGroups && i < metaData.indicatorGroups.length; i++) {\n\t\tvalidMembers = [];\n\t\tgroup = metaData.indicatorGroups[i];\n\n\t\tfor (var j = 0; j < group.indicators.length; j++) {\n\t\t\titem = group.indicators[j];\n\t\t\tfound = false;\n\t\t\tfor (var k = 0; !found && metaData.indicators && k < metaData.indicators.length; k++) {\n\t\t\t\tif (item.id === metaData.indicators[k].id) {\n\t\t\t\t\tfound = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (found) {\n\t\t\t\tvalidMembers.push(item);\n\t\t\t\tgrouped[item.id] = true;\n\t\t\t}\n\t\t}\n\t\tmetaData.indicatorGroups[i].indicators = validMembers;\n\t\tdelete metaData.indicatorGroups[i].indicatorGroupSet;\n\t}\n\n\tfor (var i = 0; metaData.indicators && i < metaData.indicators.length; i++) {\n\t\tif (!grouped.hasOwnProperty(metaData.indicators[i].id)) {\n\t\t\tunGrouped.push({\n\t\t\t\t\"id\": metaData.indicators[i].id,\n\t\t\t\t\"name\": metaData.indicators[i].shortName,\n\t\t\t\t\"type\": \"indicators\"\n\t\t\t});\n\t\t}\n\t}\n\n\t//program indicator group membership\n\tgrouped = {};\n\tfor (var i = 0; metaData.programIndicatorGroups && i < metaData.programIndicatorGroups.length; i++) {\n\t\tvalidMembers = [];\n\t\tgroup = metaData.programIndicatorGroups[i];\n\n\t\tfor (var j = 0; j < group.programIndicators.length; j++) {\n\t\t\titem = group.programIndicators[j];\n\t\t\tfound = false;\n\t\t\tfor (var k = 0; !found && metaData.programIndicators && k < metaData.programIndicators.length; k++) {\n\t\t\t\tif (item.id === metaData.programIndicators[k].id) {\n\t\t\t\t\tfound = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (found) {\n\t\t\t\tvalidMembers.push(item);\n\t\t\t\tgrouped[item.id] = true;\n\t\t\t}\n\t\t}\n\t\tmetaData.programIndicatorGroups[i].programIndicators = validMembers;\n\t\tdelete metaData.programIndicatorGroups[i].programIndicatorGroupSet;\n\t}\n\n\tfor (var i = 0; metaData.programIndicators && i < metaData.programIndicators.length; i++) {\n\t\tif (!grouped.hasOwnProperty(metaData.programIndicators[i].id)) {\n\t\t\tunGrouped.push({\n\t\t\t\t\"id\": metaData.programIndicators[i].id,\n\t\t\t\t\"name\": metaData.programIndicators[i].shortName,\n\t\t\t\t\"type\": \"programIndicators\"\n\t\t\t});\n\t\t}\n\t}\n\n\t//catetory option group membership\n\tfor (var i = 0; metaData.hasOwnProperty(\"categoryOptionGroups\") && i < metaData.categoryOptionGroups.length; i++) {\n\t\tvar group = metaData.categoryOptionGroups[i];\n\t\tvar validOptions = [];\n\t\tfor (var j = 0; group.hasOwnProperty(\"categoryOptions\") && j < group.categoryOptions.length; j++) {\n\t\t\tvar option = group.categoryOptions[j];\n\n\t\t\t//Check if the option referenced is part if the category options\n\t\t\tif (objectExists(\"categoryOptions\", option.id)) {\n\t\t\t\tvalidOptions.push(option);\n\t\t\t}\n\t\t}\n\t\tmetaData.categoryOptionGroups[i].categoryOptions = validOptions;\n\t}\n\n\n\tif (unGrouped.length > 0) {\n\t\tconsole.log(\"\\nERROR | Data elements/indicators referenced, but not in any groups:\");\n\t\tfor (var issue of unGrouped) {\n\t\t\tconsole.log(issue.type + \" - \" + issue.id + \" - \"\n\t\t\t\t+ issue.name);\n\t\t}\n\t}\n\telse return true;\n}", "onRowGroupOpened(params){\n\t\tif(params.node.expanded) {\n\t\t\tthis.context.componentParent.saveGridGroupState(Math.abs(params.node.id).toString());\n\t\t } else {\n\t\t\tthis.context.componentParent.removeGridGroupState(Math.abs(params.node.id).toString());\n\t\t}\n\t}", "function scrapeGroup() {\n\t// scrape topic URLs\n\tvar i, p, hrefList = [];\n\tasync.series([\n\t\tgetHrefList, // have to get all the hrefs first before we leave the page...\n\t\tscrapeThread // ...and then scrape each one of them\n\t]);\n\n\tfunction getHrefList(cb) {\n\t\tdriver.findElements(By.xpath(\"//a[@class='IVILX2C-p-Q']\"))\n\t\t\t// for each <a class=IVILX2C-p-Q ...\n\t\t\t.then(function(elems) {\n\t\t\t\t\tconsole.log(\"Group contains \" + elems.length + \" threads.\");\n\t\t\t\t\t// get the href=\n\t\t\t\t\tasync.mapSeries(elems, getHrefFromElem, function(err, res) {\n\t\t\t\t\t\tconsole.log(\"mapSeries res:\", res);\n\t\t\t\t\t\tconsole.log(\"hrefList:\", hrefList);\n\t\t\t\t\t\tcb(null, res);\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tfunction(err) {\n\t\t\t\t\tconsole.log(err);\n\t\t\t\t\tcb(err);\n\t\t\t\t});\n\t}\n\n\tfunction getHrefFromElem(elem, cb) {\n\t\telem.getAttribute(\"href\")\n\t\t\t.then(function(href) {\n\t\t\t\tconsole.log(href);\n\t\t\t\threfList.push(href);\n\t\t\t\tcb(null, href);\n\t\t\t}, function(err) {\n\t\t\t\tconsole.log(err);\n\t\t\t\tcb(err);\n\t\t\t});\n\t}\n\n\tfunction scrapeThread(cb) {\n\t\tasync.mapSeries(hrefList, scrapeMessageList, function(err, res) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log(err);\n\t\t\t\tcb(err);\n\t\t\t}\n\t\t\tfs.writeFileSync(\"test.json\", JSON.stringify(res));\n\t\t\tcb(null, res);\n\t\t});\n\t}\n}", "joined() {\n this.transition(SessionAction.JoiningSuccess);\n this.waitingForJoinPromise.complete(null);\n }", "static associate(models) {\n group.belongsToMany(models.tag, {\n through: \"groupTag\",\n foreignKey: \"groupId\",\n });\n group.belongsTo(models.user, { as: \"owner\", foreignKey: \"userId\" });\n group.belongsToMany(models.user, {\n through: \"groupMember\",\n foreignKey: \"groupId\",\n as: \"member\",\n });\n group.hasMany(models.groupComment);\n }", "enterGroupMember(ctx) {\n\t}", "onJoin(client, options, auth) {\n return __awaiter(this, void 0, void 0, function* () {\n const sql = `select\n jsonb_build_object('id', entity.id) || entity.data || jsonb_build_object('skills', jsonb_agg(skills.data order by skills.priority)) as data\n from\n entity\n join (\n select\n skill.priority, skill.id, skill.data || jsonb_build_object('id', skill.id) || jsonb_build_object('effects', jsonb_agg( effect.data || jsonb_build_object('id', effect.id) order by effect.priority DESC)) as data, skill.entity_id\n from\n skill\n join effect on\n effect.skill_id = skill.id\n group by\n skill.id ) as skills on\n skills.entity_id = entity.id\n where\n entity.id in ($1,\n $2,\n $3)\n group by\n entity.id;`;\n try {\n options.team = (yield db_1.pool.query(sql, options.team)).rows;\n this.manager.addClient(client.sessionId, options, client);\n this.broadcast(\"connected_clients\", this.manager.countPlayersOnline());\n }\n catch (err) {\n client.close();\n logger_1.log.error(err);\n }\n });\n }", "async processTargetGroups(temporary, accountId, awsRegion) {\n let defaultActions = temporary.defaultActions;\n let bind = this;\n\n let targetGroups = await zoomUtils.asyncMap(defaultActions, this.getTargetGroups, bind);\n\n return await this.packageTargetGroups(targetGroups, accountId, awsRegion);\n }", "_addWheres(whereJoiner, listAdapter, where, tableAlias) {\n for (let path of Object.keys(where)) {\n const condition = this._getQueryConditionByPath(listAdapter, path, tableAlias);\n if (condition) {\n whereJoiner(condition(where[path]));\n } else if (path === 'AND' || path === 'OR') {\n whereJoiner(q => {\n // AND/OR need to traverse both side of the query\n let subJoiner;\n if (path == 'AND') {\n q.whereRaw('true');\n subJoiner = w => q.andWhere(w);\n } else {\n q.whereRaw('false');\n subJoiner = w => q.orWhere(w);\n }\n where[path].forEach(subWhere =>\n this._addWheres(subJoiner, listAdapter, subWhere, tableAlias)\n );\n });\n } else {\n // We have a relationship field\n let fieldAdapter = listAdapter.fieldAdaptersByPath[path];\n if (fieldAdapter) {\n // Non-many relationship. Traverse the sub-query, using the referenced list as a root.\n const otherListAdapter = listAdapter.getListAdapterByKey(fieldAdapter.refListKey);\n this._addWheres(whereJoiner, otherListAdapter, where[path], `${tableAlias}__${path}`);\n } else {\n // Many relationship\n const [p, constraintType] = path.split('_');\n fieldAdapter = listAdapter.fieldAdaptersByPath[p];\n const { rel } = fieldAdapter;\n const { cardinality, tableName, columnName } = rel;\n const subBaseTableAlias = this._getNextBaseTableAlias();\n const otherList = fieldAdapter.refListKey;\n const otherListAdapter = listAdapter.getListAdapterByKey(otherList);\n const subQuery = listAdapter._query();\n let otherTableAlias;\n let selectCol;\n if (cardinality === '1:N' || cardinality === 'N:1') {\n otherTableAlias = subBaseTableAlias;\n selectCol = columnName;\n subQuery\n .select(`${subBaseTableAlias}.${selectCol}`)\n .from(`${tableName} as ${subBaseTableAlias}`);\n // We need to filter out nulls before passing back to the top level query\n // otherwise postgres will give very incorrect answers.\n subQuery.whereNotNull(columnName);\n } else {\n const { near, far } = listAdapter._getNearFar(fieldAdapter);\n otherTableAlias = `${subBaseTableAlias}__${p}`;\n selectCol = near;\n subQuery\n .select(`${subBaseTableAlias}.${selectCol}`)\n .from(`${tableName} as ${subBaseTableAlias}`);\n subQuery.innerJoin(\n `${otherListAdapter.tableName} as ${otherTableAlias}`,\n `${otherTableAlias}.id`,\n `${subBaseTableAlias}.${far}`\n );\n }\n \n this._addJoins(subQuery, otherListAdapter, where[path], otherTableAlias);\n\n // some: the ID is in the examples found\n // none: the ID is not in the examples found\n // every: the ID is not in the counterexamples found\n // FIXME: This works in a general and logical way, but doesn't always generate the queries that PG can best optimise\n // 'some' queries would more efficient as inner joins\n\n if (constraintType === 'every') {\n subQuery.whereNot(q => {\n q.whereRaw('true');\n this._addWheres(w => q.andWhere(w), otherListAdapter, where[path], otherTableAlias);\n });\n } else {\n subQuery.whereRaw('true');\n this._addWheres(\n w => subQuery.andWhere(w),\n otherListAdapter,\n where[path],\n otherTableAlias\n );\n }\n\n // Ensure there therwhereIn/whereNotIn query is run against\n // a table with exactly one column.\n const subSubQuery = listAdapter.parentAdapter.knex\n .select(selectCol)\n .from(subQuery.as('unused_alias'));\n if (constraintType === 'some') {\n whereJoiner(q => q.whereIn(`${tableAlias}.id`, subSubQuery));\n } else {\n whereJoiner(q => q.whereNotIn(`${tableAlias}.id`, subSubQuery));\n }\n }\n }\n }\n }", "function sqlRunMapJoin(db, pre, dat, map, sep) {\n for(var i=0, I=dat.length, z= []; i<I; i+=256) {\n var prt = dat.slice(i, i+256);\n z.push(db.run(pre+prt.map(map).join(sep), prt));\n }\n return Promise.all(z);\n}", "async cmd_join_guild(params) {\n let [ to ] = params\n\n let toGuild = GUILDS[to.toUpperCase()]\n\n if ( !toGuild ) throw {\n reason: `guild \"${to}\" not found`,\n }\n\n console.log(`join_guild: ${to} ${toGuild}`)\n\n return this.query({\n url: \"/guild/sendjoinrequest/\",\n body: {\n guild_id: toGuild,\n },\n })\n }", "function isAnyJoin (token) {\n return (\n isKeyword('JOIN')(token) ||\n isKeyword('LEFT JOIN')(token) ||\n isKeyword('RIGHT JOIN')(token)\n )\n}", "function join(that, __trace) {\n return self => join_(self, that, __trace);\n}" ]
[ "0.6332928", "0.63300353", "0.6077625", "0.59283495", "0.57782733", "0.5749969", "0.5745026", "0.57386786", "0.57124925", "0.57089996", "0.5695714", "0.56820774", "0.56561124", "0.5618851", "0.5559066", "0.55163544", "0.5507717", "0.54594386", "0.542739", "0.5411201", "0.5384737", "0.5383705", "0.5338614", "0.5310337", "0.524015", "0.5215284", "0.5197659", "0.51971936", "0.5188094", "0.5184062", "0.5184062", "0.51531744", "0.5137295", "0.5134139", "0.5130676", "0.51175845", "0.5097226", "0.5084272", "0.5078545", "0.5077442", "0.50699836", "0.5060629", "0.50560856", "0.50405115", "0.503502", "0.5034072", "0.5012086", "0.49985176", "0.49985176", "0.49900857", "0.49896488", "0.4985245", "0.4979749", "0.49783066", "0.4972139", "0.49449253", "0.49444363", "0.49339205", "0.49339205", "0.49190912", "0.49163476", "0.49069834", "0.48960823", "0.48928547", "0.48891836", "0.48728946", "0.48647043", "0.48569617", "0.48478562", "0.48461434", "0.4840371", "0.48392898", "0.4826979", "0.47835803", "0.477362", "0.47725916", "0.47662264", "0.47661224", "0.47657418", "0.47576565", "0.47495455", "0.4746976", "0.47459757", "0.4744332", "0.47433802", "0.47329065", "0.47299853", "0.47298646", "0.47278386", "0.47261015", "0.47187027", "0.47171628", "0.47141984", "0.47040597", "0.47014984", "0.46978354", "0.4691677", "0.46894762", "0.46837875", "0.46807754", "0.4680531" ]
0.0
-1
Given an element id, read its classnames and find the correct URLstring to prefix a URN.
function citekit_getUrlString( elementId ){ var thisURN = ""; var thisType = ""; var thisService = ""; var thisString = ""; // identify the type of link for ( whichClass in citekit_var_classNames ){ if ( $("#" + elementId).hasClass(citekit_var_classNames[whichClass])) { thisType = whichClass; } } // Get the plain URN from the attribute if ( $("#" + elementId).attr("src")) { thisURN = $("#" + elementId).attr("src"); } else if ( $("#" + elementId).attr("cite")) { thisURN = $("#" + elementId).attr("cite"); } else if ( $("#" + elementId).attr("href")) { thisURN = $("#" + elementId).attr("href"); } //If a service is specified, grab that URL-string for (whichService in citekit_var_services){ if ( $("#" + elementId).hasClass(whichService) ){ switch (thisType) { case "cts": thisString = citekit_var_services[whichService] + citekit_var_qs_GetPassagePlus; break; case "citeimg": thisString = citekit_var_services[whichService] + citekit_var_qs_GetImagePlus; break; case "cite": thisString = citekit_var_services[whichService] + citekit_var_qs_GetObjectPlus; break; } } } //Otherwise, grab the default URL-string if ( thisString == ""){ switch (thisType) { case "cts": thisString = citekit_var_services[citekit_var_default_cts] + citekit_var_qs_GetPassagePlus; break; case "citeimg": thisString = citekit_var_services[citekit_var_default_img] + citekit_var_qs_GetImagePlus; break; case "cite": thisString = citekit_var_services[citekit_var_default_coll] + citekit_var_qs_GetObjectPlus; break; } } //Assemble and return return thisString + thisURN; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findNZBId(elem) {\n var url = $(elem).attr('href');\n\n var nzbid = url.substr(url.indexOf('/getnzb/') + 8);\n nzbid = nzbid.substr(0, nzbid.indexOf('/'));\n url = nzbSite + '/getnzb/' + nzbid + '.nzb';\n\n return url;\n}", "function make_prefix_selector_from_id(id) {\n return '[id^=\"'+id + '\"]';\n}", "function make_prefix_selector_from_id(id) {\n return '[id^=\"'+id + '\"]';\n}", "function UrnPattern(ocbId) {\n //If entity ID has \":\" an error will occur.\n\n //var re = /urn:ngsi-ld:(.+):(.+)/\n //return ocbId.replace(re, '$1#$2').split('#')\n\n //If entity ID has \":\" an error will not occur, but if entity type has \":\" an error will occur.\n var pattern = /\\s*:\\s*/;\n var ocbIdList = ocbId.split(pattern)\n \n var result = []\n\n if (ocbIdList[0]=='urn' && ocbIdList[1]=='ngsi-ld') {\n if (ocbIdList.length>2) {\n result.push(ocbIdList[2])\n if (ocbIdList.length>3) {\n var idValue = \"\"\n for(var i=3; i< ocbIdList.length; i++){\n if (idValue == \"\") {\n idValue = ocbIdList[i]\n } else {\n idValue = idValue + \":\" + ocbIdList[i]\n }\n }\n result.push(idValue) \n }\n }\n }\n\n return result\n}", "function getIdFromUrl(urlData,id){\n\t// let arr = ulr.split(\"-\");\n\tlet arr2 = ulr.indexOf(id);\n\tlet arr3 = ulr.substr(arr2, id.length);\n\treturn arr3;\n}", "function getLabelFromId(id) {\n return id.replace('_', ' ').replace(/\\w\\S*/g, function(txt){\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "function getPostIdFromClassList(element) {\n let retid = null;\n element.classList.forEach(name => {\n if(buttonClassPattern.test(name)){\n let parts = name.split(\"-\");\n //return parts[parts.length -1];\n retid = parts[parts.length -1];\n }\n });\n if(retid){\n return retid;\n }\n return false;\n}", "function generatePathByElementId(elementId) {\n var path = generatePathByElement(findElementById(elementId));\n // removes starting '/'\n return path.substr(1);\n }", "addClassName(_id, _className) {\n if (this.isntNullOrUndefined(this._elements[_id])) {\n if (!this.hasClassName(_id, _className)) {\n const _elem = this._elements[_id];\n if (this._getClassNames(_id).trim() === '') {\n this._setClassNames(_id, _className);\n }\n else {\n const _classNames = this._getClassNames(_id).trim().split(' ');\n _classNames.push(_className);\n this._setClassNames(_id, _classNames.join(' '));\n }\n }\n }\n }", "addClassName(_id, _className) {\n if (this.isntNullOrUndefined(this._elements[_id])) {\n if (!this.hasClassName(_id, _className)) {\n const _elem = this._elements[_id];\n if (this._getClassNames(_id).trim() === '') {\n this._setClassNames(_id, _className);\n }\n else {\n const _classNames = this._getClassNames(_id).trim().split(' ');\n _classNames.push(_className);\n this._setClassNames(_id, _classNames.join(' '));\n }\n }\n }\n }", "function getIdAldea(){\n\t\tvar a = find(\"//span[@class='c2']/a\", XPFirst);\n\t\tif (a){\n\t\t\ta.getAttribute(\"href\").search(/\\?newdid=(\\d+)/);\n\t\t\treturn RegExp.$1;\n\t\t}else return 0;\n\t}", "function extractAngularId(element) {\n return element.getAttributeNames()\n .filter(x => x !== \"class\")\n .find(x => x);\n}", "function navId(id) {\n return \"#\" + id.replace(/[\\.\\@\\[\\]]/g, \":\");\n}", "function get_id_from_class(full_class){\n\t\t\t\tvar id_class = full_class.split(' ')[1];\n\t\t\t\tvar id_split = id_class.split('-');\n\t\t\t\treturn id_split[id_split.length-1];\n\t\t\t}", "function getIdAldea(){\r\n\t\tvar a = find(\"//span[@class='c2']/a\", XPFirst);\r\n\t\tif (a){\r\n\t\t\ta.getAttribute(\"href\").search(/\\?newdid=(\\d+)/);\r\n\t\t\treturn RegExp.$1;\r\n\t\t}else return 0;\r\n\t}", "function createXPathFromElement(elm) {\n\tvar allNodes = document.getElementsByTagName('*');\n\t// alert(elm.firstChild.nodeValue);\n\tfor (var segs = []; elm && elm.nodeType == 1; elm = elm.parentNode) {\n\t\tif (elm.hasAttribute('id')) {\n\t\t\tvar uniqueIdCount = 0;\n\t\t\tfor (var n = 0; n < allNodes.length; n++) {\n\t\t\t\tif (allNodes[n].hasAttribute('id') && allNodes[n].id == elm.id)\n\t\t\t\t\tuniqueIdCount++;\n\t\t\t\tif (uniqueIdCount > 1)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t;\n\t\t\tif (uniqueIdCount == 1) {\n\t\t\t\tsegs.unshift(\"id('\" + elm.getAttribute('id') + \"')\");\n\t\t\t\treturn segs.join('/');\n\t\t\t} else {\n\t\t\t\tsegs.unshift(elm.localName.toLowerCase() + \"[@id='\"\n\t\t\t\t\t\t+ elm.getAttribute('id') + \"']\");\n\t\t\t}\n\t\t} else if (elm.hasAttribute('itemprop')) {\n\t\t\tsegs.unshift(elm.localName.toLowerCase() + \"[@itemprop='\"\n\t\t\t\t\t+ elm.getAttribute('itemprop') + \"']\");\n\t\t} else if (elm.hasAttribute('class')) {\n\t\t\tsegs.unshift(elm.localName.toLowerCase() + \"[@class='\"\n\t\t\t\t\t+ elm.getAttribute('class') + \"']\");\n\t\t} else {\n\t\t\tfor (i = 1, sib = elm.previousSibling; sib; sib = sib.previousSibling) {\n\t\t\t\tif (sib.localName == elm.localName)\n\t\t\t\t\ti++;\n\t\t\t}\n\t\t\t;\n\t\t\tsegs.unshift(elm.localName.toLowerCase() + '[' + i + ']');\n\t\t}\n\t\t;\n\t}\n\t;\n\tvar pos = 0;\n\tvar string = segs.length ? '/' + segs.join('/') : null;\n\tstring = string.replace(\"\")\n\tvar str_array = string.split(\"/\");\n\tvar l = str_array.length;\n\tfor (i = l - 1; i > 0; i--) {\n\t\tif (str_array[i].search(\"class\") != -1) {\n\t\t\tpos = i;\n\t\t\tbreak\n\t\t}\n\t}\n\tvar rs = \"/\";\n\tfor (i = pos; i < l; i++) {\n\t\trs = rs + '/' + str_array[i]\n\t}\n\treturn rs;\n}", "function id_from_class_pair(el, action) {\n var r = new RegExp(\".*\"+action+\"_([^ ]+).*\")\n return el.className.replace(r,'$1')\n}", "_getClassNames(_id) {\n const _elem = this._elements[_id];\n if (this._isSVGElem(_elem)) {\n return _elem.className.baseVal;\n }\n else {\n return _elem.className;\n }\n }", "_getClassNames(_id) {\n const _elem = this._elements[_id];\n if (this._isSVGElem(_elem)) {\n return _elem.className.baseVal;\n }\n else {\n return _elem.className;\n }\n }", "upID(id)\r\n {\r\n try \r\n {\r\n return id.split('-')[0] + '-' + (parseInt(id.split('-')[1]) + 1);\r\n } \r\n catch (error) \r\n {\r\n //Return a custom ID\r\n return this.newCustomID()\r\n }\r\n }", "function _addClassID() {\n\t\tvar $this = $( this ),\n\t\t\tnav = $this.next( 'nav' ),\n\t\t\tid = 'class';\n\n\t\t$this.attr( 'id', 'genesis-mobile-' + $( nav ).attr( id ).match( /nav-\\w*\\b/ ) );\n\t}", "function _addClassID() {\n\t\tvar $this = $( this ),\n\t\t\tnav = $this.next( 'nav' ),\n\t\t\tid = 'class';\n\n\t\t$this.attr( 'id', 'genesis-mobile-' + $( nav ).attr( id ).match( /nav-\\w*\\b/ ) );\n\t}", "function getID(idWithName)\n{\n //returns the id from the name on the search bar\n return idWithName.split(\".\")[0];\n}", "function StripPrefix(id)\r\n{\r\n var i = id.lastIndexOf(\"_\");\r\n if (i == -1) return id;\r\n return id.substr(i+1);\r\n}", "function idToName(id) {\n return id.split(\"_\").map(word => word.charAt(0).toUpperCase() + word.substr(1)).join(\" \")\n}", "function fetchClassNamesById(tab, id, callback) {\n chrome.tabs.executeScript(tab, {\n code: APP_PLAYER + '.getElementById(\"' + id + '\").className;'\n }, function (response) {\n var classNamesList = String(response).split(\" \");\n var classNamesObject = {}; //object with className:true\n\n classNamesList.forEach(function (className) {\n classNamesObject[className] = true;\n });\n\n callback(classNamesObject);\n });\n}", "function format_uri(ocbType, ocbId) {\n \n var calcType = ocbType || \"Thing\"\n var idLD\n\n var resultArray = []\n\n resultArray = UrnPattern(ocbId)\n\n if (resultArray.length==2) {\n if (resultArray[0].toUpperCase() == \"Thing\".toUpperCase()) {\n idLD = toURN(calcType, ocbId)\n } else {\n idLD = ocbId\n }\n }\n else {\n idLD = toURN(calcType, ocbId)\n }\n\n return idLD\n}", "function make_selector_from_id(id) {\n return '[id=\"'+id + '\"]';\n}", "function make_selector_from_id(id) {\n return '[id=\"'+id + '\"]';\n}", "function get_lrg_link (lrg_id) {\n var lrg_link = build_link_base('LRG_'+lrg_id);\n lrg_link.addClass('lrg_link');\n return lrg_link[0].outerHTML;\n}", "function match_elements_by_prefix(tag_name, id_string)\n{\n\tvar matches = [];\n\tvar elems = document.getElementsByTagName(tag_name);\n\tfor (var i=0; i<elems.length; i++) {\n\t\tif (elems[i].id.indexOf(id_string) == 0)\n\t\t\tmatches.push(elems[i]);\n\t}\n\treturn matches;\n}", "function getUrlId() {\n return getURLSearch().replace('id=', '');\n}", "function resolve(parent, id) {\r\n\tif (/^\\.\\.?\\//.test(id) && parent) { // is a relative id\r\n\t\tid = parent.replace(/[^\\/]+$/, id); // prepend parent's dirname\r\n\t}\r\n\tvar terms = [];\r\n\tid.split('/').forEach(function(term) {\r\n\t\tif ('..' === term) { terms.pop(); } // remove previous, don't add ..\r\n\t\telse if ('.' !== term) { terms.push(term); } // add term\r\n\t\t// else if ('.' === term) // ignore .\r\n\t});\r\n\treturn terms.join('/');\r\n}", "function parseId(classname, classRef) {\n\tvar ptn;\n\tif (classRef) {\n\t\tptn = new RegExp(classRef + '(\\\\S*)');\n\t} else {\n\t\tptn = /id_(\\S*)/;\n\t}\n\tptn.exec(classname);\n\tif (RegExp.$1 !== \"\") {\n\t\treturn RegExp.$1;\n\t} else {\n\t\treturn false;\n\t}\n}", "extract_id(string) {\n let end_index = string.length - 4\n let start_index = string.split('/', 3).join('/').length+1;\n return string.substring(start_index,end_index)\n }", "parseICUMessageRefIndexFromId(id) {\r\n let indexString = '';\r\n if (id === 'ICU') {\r\n indexString = '0';\r\n }\r\n else {\r\n indexString = id.substring('ICU_'.length);\r\n }\r\n return Number.parseInt(indexString, 10);\r\n }", "function get_url(element) {\r\n\r\n if (element.length > 0) {\r\n GM_log(element.length);\r\n var rhapURL = \"\"\r\n // Remove punctuation but leave the accented chars\r\n , match_re2 = new RegExp(/_|[^\\w\\dáÁâÂàÀåÅãÃäÄæÆçÇðÐéÉêÊèÈëËíÍîÎìÌïÏñÑóÓôÔòÒøØõÕöÖßþÞúÚûÛùÙüÜýÝÿ\\s]+/g)\r\n // Below is a list of special cases where accented characters become anglicized\r\n // Unfortunately Rhapsody.com is not always consistent when dealing with some chars \r\n // especially the & sign. Sometimes it's removed and sometimes changed to \"and\".\r\n , match_re4 = new RegExp(/ñ/g)\r\n , match_re5 = new RegExp(/à|á|a|â|ã|ä|å/g)\r\n , match_re6 = new RegExp(/&amp|\\band\\b/g)\r\n , match_re7 = new RegExp(/é|è|ê|ë/g)\r\n , match_re8 = new RegExp(/ó|ó|ô|õ|ö|ø/g)\r\n , match_re9 = new RegExp(/ì|í|î|ï/g)\r\n , match_re10 = new RegExp(/ù|ú|û|ü/g)\r\n , match_re11 = new RegExp(/ç/g);\r\n\t \r\n artist = $.trim($(element).find('a[href*=\"/artists\"]')\r\n .html()\r\n .toLowerCase()\r\n .replace(/\\bep\\b$|\\bost\\b$/, \"\")\r\n .replace(/&amp;/, \" and \")\r\n .replace(match_re4, \"n\")\r\n .replace(match_re5, \"a\")\r\n .replace(match_re7, \"e\")\r\n .replace(match_re8, \"o\")\r\n .replace(match_re9, \"i\")\r\n .replace(match_re10, \"u\")\r\n .replace(match_re11, \"c\")\r\n .replace(match_re2, \"\")).replace(/\\s/g, '-');\r\n\r\n title = $.trim($(element).find('h2')\r\n .html()\r\n .toLowerCase()\r\n .replace(/\\bep\\b$|\\bost\\b$/, \"\")\r\n .replace(/&amp;/, \" and \")\r\n .replace(match_re4, \"n\")\r\n .replace(match_re5, \"a\")\r\n .replace(match_re7, \"e\")\r\n .replace(match_re8, \"o\")\r\n .replace(match_re9, \"i\")\r\n .replace(match_re10, \"u\")\r\n .replace(match_re11, \"c\")\r\n .replace(match_re2, \"\")).replace(/\\s/g, '-');\r\n\r\n var artSrchNm = 'http://www.rhapsody.com/search/artist/?query='+ artist.replace(/[\\-]+/g, '+');\r\n var albSrchNm = 'http://www.rhapsody.com/search/album/?query='+ title.replace(/[\\-]+/g, '+');\r\n\r\n rhapURL = 'http://www.rhapsody.com/artist/' + artist +'/album/'+ title;\r\n\r\n GM_log(\" Artist: \" + artist + \"\\n Title: \" + title + \"\\n URL: \" + rhapURL);\r\n\r\n GM_xmlhttpRequest({\r\n method: 'GET',\r\n url: rhapURL,\r\n headers: {\r\n 'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',\r\n 'Accept': 'text/html',\r\n },\r\n \r\n onload: function(responseDetails) {\r\n var testArray = new Array();\r\n //GM_log(responseDetails.responseText);\r\n var testLen = testArray.length - 1;\r\n var testRe = new RegExp(/\\<meta content=\"music\\.album\"/); // Check the loaded response for album availability\r\n var testString = responseDetails.responseText;\r\n GM_log(testString.search(testRe));\r\n \r\n if (testString.search(testRe) != -1 && testArray[testLen] != \"success\") {\r\n tryConnecting(testString, rhapURL);\r\n testArray.pop();\r\n testArray.push(\"success\");\r\n GM_log(testArray[0]);\r\n } else if (testArray[0] != \"success\"){\r\n failFunc(artSrchNm, albSrchNm, rhapURL, testArray);\r\n }\r\n }\r\n });\r\n }\r\n}", "function presidentsNamedJames() {\n\t$(\"[id^=james]\").addClass(\"james\");//first/ entry div is not necessary\n}", "_getElement(element) {\n if (element.indexOf(\"#\") > -1) {\n return document.getElementById(element.substring(1));\n } else {\n return document.getElementsByClassName(element.substring(1))[0];\n }\n }", "function jsUri(id) {\n var num = url_path.split('/');\n if (id < num.length) {\n return num[id]\n } else {\n return ''\n }\n}", "function getUID(prefix) {\n do prefix += ~~(Math.random() * 1000000)\n while (document.getElementById(prefix))\n return prefix\n }", "_setClassNames(_id, _className) {\n const _elem = this._elements[_id];\n if (this._isSVGElem(_elem)) {\n _elem.className.baseVal = _className;\n }\n else {\n _elem.className = _className;\n }\n }", "_setClassNames(_id, _className) {\n const _elem = this._elements[_id];\n if (this._isSVGElem(_elem)) {\n _elem.className.baseVal = _className;\n }\n else {\n _elem.className = _className;\n }\n }", "static registerElementByID(elementID)\n\t{\n\t\tlet foundElement = document.getElementById(elementID);\n\t\tif(foundElement !== null)\n\t\t{\n\t\t\tfoundElement.classList.add(\"OMC\");\n\t\t}\n\t}", "function checkId (element) {\n if (element.split(';').length = 3) {\n return element.split(';')[2] \n }\n }", "function getUrl(id) {\n \n return newUrl = id === \"0\" ? GLOBAL_CASES_URL : (COUNTRIES_URL + \"/\" + id)\n\n }", "function elementComponentIdsFromClasses (element) {\n return (element.className || '').split(' ');\n }", "function _findClassPrefix($el, prefix){\n var classes = _getClasses($el), ix = 0, cls;\n for (;ix < classes.length; ix++) {\n cls = classes[ix];\n if(cls.indexOf(prefix) == 0)\n return cls.slice(prefix.length)\n }\n return null;\n }", "function _getURL (id) {\t\t\n\t\tfor(var p in _paths) {\n\t\t\tid = id.replace(new RegExp(\"(^\" + p + \")\", \"g\"), _paths[p]);\n\t\t}\n\t\treturn id + \".js\" + _fileSuffix;\n\t}", "function getLinkId(url) {\n\n var id = url.slice(url.lastIndexOf('/') + 1, url.length);\n //console.log(\"ID= \" + id);\n return id;\n\n}//get link id", "function GetControlIDPrefix(inputID)\n{\n var arrParts = inputID.split('_');\n var prefix = \"\";\n var i;\n \n for(i=0;i<arrParts.length - 1;i++)\n prefix += arrParts[i] + \"_\";\n \n return prefix;\n}", "function formal_cssid_to_key(cssid) {\n var t = cssid.split(\"-\");\n return [t[0], t.slice(1).join(\".\")];\n}", "function makeIdsUnique(svgElem) {\n var i, j;\n var idSuffix = '--inject-' + uniqueIdCounter++;\n // Get all elements with an id. The SVG spec recommends to put referenced elements inside <defs> elements, but\n // this is a requirement, therefore we have to search for IDs in the whole SVG.\n var idElements = svgElem.querySelectorAll('[id]');\n var idElem;\n var tagName;\n var iriTagNames = {};\n var iriProperties = [];\n for (i = 0; i < idElements[_LENGTH_]; i++) {\n idElem = idElements[i];\n tagName = idElem.tagName;\n // Make ID unique if tag name is IRI referenceable\n if (tagName in IRI_TAG_PROPERTIES_MAP) {\n iriTagNames[tagName] = 1;\n // Add suffix to element's id\n idElem.id += idSuffix;\n // Replace ids in xlink:ref and href attributes\n ['xlink:href', 'href'].forEach(function(refAttrName) {\n var iri = idElem.getAttribute(refAttrName);\n if (/^\\s*#/.test(iri)) { // Check if iri is non-null and has correct format\n idElem.setAttribute(refAttrName, iri.trim() + idSuffix)\n }\n });\n }\n }\n // Get all properties that are mapped to the found tags\n for (tagName in iriTagNames) {\n (IRI_TAG_PROPERTIES_MAP[tagName] || [tagName]).forEach(function (mappedProperty) {\n // Add mapped properties to array of iri referencing properties.\n // Use linear search here because the number of possible entries is very small (maximum 11)\n if (iriProperties.indexOf(mappedProperty) < 0) {\n iriProperties.push(mappedProperty);\n }\n });\n }\n // Replace IDs with new IDs in all references\n if (iriProperties[_LENGTH_]) {\n // Add \"style\" to properties, because it may contain references in the form 'style=\"fill:url(#myFill)\"'\n iriProperties.push(_STYLE_);\n // Regular expression for functional notations of an IRI references. This will find occurences in the form\n // url(#anyId) or url(\"#anyId\") (for Internet Explorer)\n var funcIriRegex = /url\\(\"?#([a-zA-Z][\\w:.-]*)\"?\\)/g;\n // Run through all elements of the SVG and replace ids in references. It seems that getElementsByTagName('*')\n // performs faster than querySelectorAll('*') in this case.\n var allElements = svgElem[_GET_ELEMENTS_BY_TAG_NAME_]('*');\n var element;\n var propertyName;\n var value;\n var newValue;\n for (i = 0; i < allElements[_LENGTH_]; i++) {\n element = allElements[i];\n if (element.tagName == _STYLE_) {\n value = element.textContent;\n newValue = value && value.replace(funcIriRegex, 'url(#$1' + idSuffix + ')');\n if (newValue !== value) {\n element.textContent = newValue;\n }\n } else if (element.hasAttributes()) {\n // Run through all property names for which ids were found\n for (j = 0; j < iriProperties[_LENGTH_]; j++) {\n propertyName = iriProperties[j];\n value = element.getAttribute(propertyName);\n newValue = value && value.replace(funcIriRegex, 'url(#$1' + idSuffix + ')');\n if (newValue !== value) {\n element.setAttribute(propertyName, newValue);\n }\n }\n }\n }\n }\n }", "function convertURLTOID(url) {\n let regex = /[/](\\d)+[/]/;\n\n if (typeof url == \"string\") {\n return regex.exec(url)[0].split('/')[1]\n } else {\n url.forEach((url) => {\n for (let key in url) {\n url[key] = convertURLTOID(url[key]);\n }\n })\n return url;\n }\n }", "function WebIdUtils () {\n}", "function parseURI(uri) {\n var idx = 0;\n for(var prefix in prefixArray) {\n if(uri.startsWith(prefix)) {\n return [uri.substring(prefix.length, uri.length), idx+1];\n }\n idx += 1;\n }\n}", "function add_class(class_name,elm_id) {\n\n var element = document.getElementById(elm_id);\n if (!(element)) {console.log('No element found with id: '+elm_id); return;}\n var class_pat = new RegExp('(?:^|\\\\s)'+class_name+'(?!\\\\S)',\"gi\");\n if ( ! (element.className.match(class_pat))) {\n element.className += \" \" + class_name;\n }\n}", "function formal_cssid_join(cssidparts) {\n return cssidparts.join(\"-\");\n}", "function abbrevId(id, len = 6) {\n const parts=id.split('-');\n const last=parts.length-1;\n return parts[last].substr(-1*len)\n}", "function idFromUrl(url) {\n var last3 = url.slice(-3);\n if (last3[0] === \"/\") return url.slice(-2)\n if (last3[1] === \"/\") return url.slice(-1);\n return last3;\n }", "function fullPath(el) { //TODO use real object types\n let names = [];\n while (el.parentNode) {\n if (el.id) {\n names.unshift('#' + el.id);\n break;\n } else {\n if (el == el.ownerDocument.documentElement) names.unshift(el.tagName);\n else {\n for (var c = 1, e = el; e.previousElementSibling; e = e.previousElementSibling, c++);\n names.unshift(`${el.tagName}:nth-child(${c})`);\n }\n el = el.parentNode;\n }\n }\n return names.join(\" > \");\n}", "function extractId(href) {\n return href.replace(/^[a-z-]+:\\/+?[^\\/]+/i, '') // Remove protocol & domain\n .replace(/^\\//, '') // Remove root /\n .replace(/\\.[a-zA-Z]+$/, '') // Remove simple extension\n .replace(/[^\\.\\w-]+/g, '-') // Replace illegal characters\n .replace(/\\./g, ':'); // Replace dots with colons(for valid id)\n}", "function navpathresolver(id) {\r\n if(id != 0) \r\n {return id;}\r\n else \r\n {// resolve the navigation section from the url / path\r\n path = document.location.pathname.split('/');\r\n \r\n //alert(document.location.pathname);\r\n try{\r\n if (path == undefined) return 0;\r\n switch (path[1].toLowerCase()) { //top level directory\r\n case 'templates':\r\n return 4;\r\n break;\r\n case 'adminservices':\r\n return 2;\r\n break;\r\n case 'certify':\r\n switch(path[2].toLowerCase()) {\r\n case 'news':\r\n return 4;\r\n default:\r\n return 3; \r\n }\r\n break;\r\n case 'documentation':\r\n switch(path[2].toLowerCase()) {\r\n case 'periodicals':\r\n return 4;\r\n default:\r\n return 1; \r\n }\r\n break;\r\n case 'forums':\r\n return 4;\r\n break;\r\n case 'kb':\r\n return 1;\r\n break;\r\n case 'publishing':\r\n switch(path[2].toLowerCase()) {\r\n case 'newdoc':\r\n return 4;\r\n default:\r\n return 3; \r\n }\r\n break;\r\n case 'rnd':\r\n return 1;\r\n break;\r\n case 'rss':\r\n return 4;\r\n break;\r\n case 'software':\r\n return 1;\r\n break;\r\n case 'techsup':\r\n return 2;\r\n break;\r\n case 'training':\r\n switch(path[2].toLowerCase()) {\r\n case 'news':\r\n return 4;\r\n default:\r\n return 3; \r\n }\r\n break;\r\n case 'usergroups':\r\n return 4;\r\n break;\r\n default:\r\n return 0; \r\n }\r\n }\r\n catch(err){\r\n alert(err);\r\n return 0;\r\n } \r\n\r\n } \r\n \r\n }", "function addClassById (id, className) {\n return $(\"#\" + id).addClass(\"\" + className)\n}", "function findRichmond(element) {\n if (element === 'Richmond') {\n return element\n }\n}", "function AutoClassNameToShortLink (TargetClassName, AutoClassNameToShortLinkSpan) {\n var ReplacePattern = /[ ,\\\"\\\\\\/#@><!?]/g;\n var innerTEXTcontent, temp;\n var ClassNameArray = document.getElementsByClassName (TargetClassName);\n\n if (AutoClassNameToShortLinkSpan === undefined) {\n AutoClassNameToShortLinkSpan = 'AutoClassNameToShortLinkSpan';\n }\n temp = document.getElementById (AutoClassNameToShortLinkSpan).innerHTML + '<ul class=\\\"AutoGenShortLink\\\">';\n\n for (var i = 0; i < ClassNameArray.length; i++) {\n //\n // Workaround for Firefox does not support innerText, IE does not support textContent\n if (ClassNameArray[i].innerText != undefined) {\n innerTEXTcontent = ClassNameArray[i].innerText;\n } else {\n innerTEXTcontent = ClassNameArray[i].textContent;\n }\n\n if (!ClassNameArray[i].id) {\n ClassNameArray[i].id = innerTEXTcontent.replace(ReplacePattern, \"\");\n ClassNameArray[i].id = innerTEXTcontent.replace(/\\n/g, \"\"); // try to fix blogger auto line break error\n }\n temp = temp + '<li><a href=\\\"#' + ClassNameArray[i].id + '\\\">' + innerTEXTcontent + '</a></li>\\n';\n }\n temp = temp + '</ul>';\n document.getElementById (AutoClassNameToShortLinkSpan).innerHTML = temp;\n}", "function GeraId(prefixo, elemento) {\n //return prefixo + '-' + elemento.childNodes.length;\n var id = 0;\n while (true) {\n var tentativa = prefixo + '-' + id;\n var encontrou_igual = false;\n for (var i = 0; i < elemento.childNodes.length; ++i) {\n var filho = elemento.childNodes[i];\n if (filho.id && filho.id.indexOf(tentativa) != -1) {\n encontrou_igual = true;\n }\n }\n if (encontrou_igual) {\n ++id;\n } else {\n return tentativa;\n }\n }\n}", "function GetDafPrefix(strUrl: String)\r\n\t\t{\r\n\t\t\tfor (var i=0;i <strDafPrefixes.length; i++)\r\n\t\t\t{\r\n\t\t\t\tif (strUrl.StartsWith(strDafPrefixes[i], StringComparison.CurrentCultureIgnoreCase))\r\n\t\t\t\t\treturn strDafPrefixes[i];\r\n\t\t\t}\r\n\t\t\treturn \"\";\r\n\t\t}", "function joinClassLabel(id) {\n\t// var html = '<label class=\"chosen_class\" id=\"' + id + '\" style=\"width: 50%;\">' + $('#' + id).html() + '</label>';\n\t$('#' + id).css('width', '100%');\n\t$('#' + id + '-2').remove();\n\tlocalStorage.removeItem(id + '-2');\n\t//\tvar html = '<label class=\"chosen_class\" id=\"' + id + '-2\" style=\"width: 50%;\"><span>' + id.substring(id.indexOf('-') + 1) + '-2</span></label>';\n\t//\t$('#' + id).after(html);\n\tupdateClickHandlers();\n}", "function make_postfix_selector_from_id(id) {\n return '[id$=\"'+id + '\"]';\n}", "function imgXPath(elm) {\n\tvar allNodes = document.getElementsByTagName('*');\n\t// alert(elm.firstChild.nodeValue);\n\tfor (var segs = []; elm && elm.nodeType == 1; elm = elm.parentNode) {\n\t\tif (elm.hasAttribute('id')) {\n\t\t\tvar uniqueIdCount = 0;\n\t\t\tfor (var n = 0; n < allNodes.length; n++) {\n\t\t\t\tif (allNodes[n].hasAttribute('id') && allNodes[n].id == elm.id)\n\t\t\t\t\tuniqueIdCount++;\n\t\t\t\tif (uniqueIdCount > 1)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t;\n\t\t\tif (uniqueIdCount == 1) {\n\t\t\t\tsegs.unshift(\"id('\" + elm.getAttribute('id') + \"')\");\n\t\t\t\treturn segs.join('/');\n\t\t\t} else {\n\t\t\t\tsegs.unshift(elm.localName.toLowerCase() + \"[@id='\"\n\t\t\t\t\t\t+ elm.getAttribute('id') + \"']\");\n\t\t\t}\n\t\t} else if (elm.hasAttribute('class')) {\n\t\t\tsegs.unshift(elm.localName.toLowerCase() + \"[@class='\"\n\t\t\t\t\t+ elm.getAttribute('class') + \"']\");\n\t\t} else {\n\t\t\tfor (i = 1, sib = elm.previousSibling; sib; sib = sib.previousSibling) {\n\t\t\t\tif (sib.localName == elm.localName)\n\t\t\t\t\ti++;\n\t\t\t}\n\t\t\t;\n\t\t\tsegs.unshift(elm.localName.toLowerCase() + '[' + i + ']');\n\t\t}\n\t\t;\n\t}\n\t;\n\tvar pos = 0;\n\tvar string = segs.length ? '/' + segs.join('/') : null;\n\tstring = string.replace(\"\")\n\tvar str_array = string.split(\"/\");\n\tvar l = str_array.length;\n\tfor (i = l - 1; i > 0; i--) {\n\t\tif (str_array[i].search(\"div\") != -1\n\t\t\t\t&& str_array[i].search(\"class\") != -1) {\n\t\t\tpos = i;\n\t\t\tbreak\n\t\t}\n\t}\n\tvar rs = \"/\";\n\tfor (i = pos; i < l; i++) {\n\t\tif (str_array[i].search(\"img\") == 0) {\n\t\t\tstr_array[i] = \"img\";\n\t\t}\n\t\trs = rs + '/' + str_array[i]\n\t}\n\treturn rs;\n}", "function removeRigIdPrefix(opaque_user_id)\n{\n if(opaque_user_id[0] === 'U')\n {\n opaque_user_id = opaque_user_id.slice(4);\n console.log('Removed URIG: ', opaque_user_id);\n }\n return opaque_user_id;\n}", "function addMagicClass(id) {\n const element = document.getElementbyID(id)\n element.className += ' magic'\n return element\n}", "function addClassById (id, className) {\n return document.getElementById(id).classList.add(className);\n}", "hasClassName(_id, _className) {\n if (this.isntNullOrUndefined(this._elements[_id])) {\n const _classNames = this._getClassNames(_id).split(' ');\n return _classNames.includes(_className);\n }\n return null;\n }", "hasClassName(_id, _className) {\n if (this.isntNullOrUndefined(this._elements[_id])) {\n const _classNames = this._getClassNames(_id).split(' ');\n return _classNames.includes(_className);\n }\n return null;\n }", "_addIdLinks(str) {\n return str.replace(/`[^`\\n]+`/g, (code) => code\n .replace(\n // v-- symbols or start, v-- keywords v-- token v-- brackets\n /((?:(?:[\\:|>,]\\s+)|\\<|`)(?:extends\\s+|implements\\s+|typeof\\s+)?)([\\@\\w\\.]+(?:\\(\\))?)(\\s+)?/g, (s, impl, token, spaces) => {\n let t = token.replace(/^[\\@\\.]/, \"\").replace(/\\(\\)$/, \"\");\n spaces = spaces ? \"<code>\" + spaces + \"</code>\" : \"\";\n if (t !== this.doc.id) {\n token = token.replace(/_/g, \"\\\\_\");\n if (this._parser.isDefined(t)) {\n let url = this._baseUrl +\n (token.startsWith(\"@\") ? \"_\" : \"\") +\n t.replace(/\\..*/, \"\");\n if (t.indexOf(\".\") > 0)\n url += navId(t);\n return `${impl || \"\"}\\`[\\`${token}\\`](${url})${spaces}\\``;\n }\n else if (this._parser.isDefined(this.doc.id + \".\" + t)) {\n return `${impl || \"\"}\\`[\\`${token}\\`](${navId(this.doc.id + \".\" + t)})${spaces}\\``;\n }\n else if (s.length === code.length + 2) {\n (this.data.warnings || (this.data.warnings = [])).push(`NOT DEFINED ${t} (${this.doc.id})`);\n }\n }\n return s;\n })\n .replace(/^``/, \"\")\n .replace(/``$/, \"\"));\n }", "function fixSelectorWithPeriod(id)\n{\n\tvar arr = id.split(\".\");\n\tif(arr.length > 1)\n\t{\n\t\tid = arr[0] + \"\\\\.\" + arr[1];\n\t}\n\treturn id;\n}", "function get_best_class($element) {\n\n // Cache\n var element = $($element);\n\n // Element Classes\n var classes = element.attr(\"class\");\n\n // Clean Yellow Pencil Classes\n if (classes !== undefined && classes !== null) {\n classes = class_cleaner(classes);\n }\n\n // Cache id and tagname.\n var id = element.attr(\"id\");\n var tag = element[0].nodeName.toLowerCase();\n\n if (tag == 'body' || tag == 'html') {\n return tag;\n }\n\n // Default\n var best_classes = '';\n var nummeric_class = '';\n var the_best = '';\n\n // Use tag name with class.\n var ClassNameTag = '';\n if (tag != 'div' && tag !== undefined && tag !== null) {\n ClassNameTag = tag;\n }\n\n // If Element has ID, Return ID.\n if (typeof id != 'undefined') {\n\n id = $.trim(id);\n\n // If has \"widget\" term in classes, its is a widget element. dont select with the ID.\n if (classes !== undefined && classes !== null) {\n if (classes.toString().match(/\\b([a-zA-Z0-9_-]{1})?widget\\b|\\b([a-zA-Z0-9_-]{3})?widget\\b|\\b([a-zA-Z0-9_-]{4})?widget\\b|\\b([a-zA-Z0-9_-]{5})?widget\\b|\\b([a-zA-Z0-9_-]{6})?widget\\b/g)) {\n id = '';\n }\n }\n\n // One plugin prefix that create random base64 id.\n if ($.trim(id).substring(0, 4) == \"fws_\") {\n id = '';\n }\n\n // Check if ID has number.\n if (id.match(/\\d+/g)) {\n\n // If its has 'slide', 'section' so let to it or else.\n if (id.match(/((?=.*module)|(?=.*slide)|(?=.*section)|(?=.*row)|(?=.*layout)|(?=.*form)|(?=.*pg-)|(?=.*wrapper)|(?=.*container)|(?=.*parallax)|(?=.*block)|(?=.*layers-widget-column)|(?=.*layers-widget-slide)|(?=.*layers-widget-layers-pro-call-to-action)|(?=.*builder-module-))(?=.*\\d+)|\\bptpb_s(\\d+)\\b/g) === null) {\n id = '';\n }\n\n }\n\n // Ex: div#id\n if (id != '' && $.trim(the_best) == '') {\n return ClassNameTag + '#' + id;\n }\n\n }\n\n // If has classes.\n if (classes !== undefined && classes !== null) {\n\n // Classes to array.\n var ArrayClasses = get_classes_array(classes);\n\n // Foreach classes.\n // If has normal classes and nunmmeric classes,\n // Find normal classes and cache to best_classes variable.\n $(ArrayClasses).each(function (i, v) {\n\n if (v.match(/\\d+/g)) {\n if (!v.match(/page-item/g)) {\n nummeric_class = v;\n }\n } else {\n best_classes += ' ' + v;\n }\n\n });\n\n }\n\n // we want never use some class names. so disabling this classes.\n if (isDefined(best_classes)) {\n $.each(filterBadClassesBasic, function (i, v) {\n\n v = v.replace(/\\-/g, 'W06lXW').replace(/0W06lXW9/g, '0-9').replace(/\\(\\w\\+\\)/g, '\\(\\\\w\\+\\)').replace(/aW06lXWzAW06lXWZ0-9_W06lXW/g, 'a-zA-Z0-9_-').toString();\n var re = new RegExp(\"\\\\b\" + v + \"\\\\b\", \"g\");\n\n best_classes = best_classes.toString().replace(/\\-/g, 'W06lXW').replace(re, '');\n\n });\n }\n\n // If Has Best Classes\n if ($.trim(best_classes) != '') {\n\n // Make as array.\n the_best = get_classes_array(best_classes);\n\n // Replace significant classes and keep best classes.\n var significant_classes = $.trim(best_classes.replace(/\\-/g, 'W06lXW'));\n\n // Replace all non useful classes\n if (isDefined(significant_classes)) {\n $.each(filterSomeClasses, function (i, v) {\n v = v.replace(/\\-/g, 'W06lXW').replace(/0W06lXW9/g, '0-9').replace(/\\(\\w\\+\\)/g, '\\(\\\\w\\+\\)').replace(/aW06lXWzAW06lXWZ0-9_W06lXW/g, 'a-zA-Z0-9_-').toString();\n var re = new RegExp(\"\\\\b\" + v + \"\\\\b\", \"g\");\n\n significant_classes = significant_classes.replace(re, '');\n\n });\n }\n\n // Update\n significant_classes = $.trim(significant_classes);\n\n // Important classes, current-menu-item etc\n // If has this any classes, keep this more important.\n var i;\n var return_the_best = '';\n for (i = 0; i < the_best.length; i++) {\n\n if (filterGoodClasses.indexOf(the_best[i]) != -1) {\n\n // Don't focus to current and active classes on single selector tool.\n if (body.hasClass((\"yp-sharp-selector-mode-active\"))) {\n if (the_best[i] != 'current' && the_best[i] != 'active') {\n return_the_best = the_best[i];\n }\n } else {\n return_the_best = the_best[i];\n }\n\n }\n\n // Don't see slider-active classes.\n if (return_the_best == '' && body.hasClass(\"yp-sharp-selector-mode-active\") === false) {\n if (the_best[i].indexOf(\"active\") != -1 || the_best[i].indexOf(\"current\") != -1) {\n if (the_best[i].indexOf(\"slide\") == -1) {\n return_the_best = the_best[i];\n }\n }\n }\n\n }\n\n // Some nummeric classes is important.\n if (nummeric_class != '') {\n\n // section-1, section-2 etc\n if (nummeric_class.indexOf(\"section\") != -1) {\n return_the_best = nummeric_class;\n }\n\n // slide-0, slide-1 etc\n if (nummeric_class.indexOf(\"slide\") != -1) {\n return_the_best = nummeric_class;\n }\n\n }\n\n // If no best and has class menu item, use it.\n if (return_the_best == '' && element.hasClass(\"menu-item\")) {\n return_the_best = 'menu-item';\n }\n\n // Image selection\n if (return_the_best == '' && nummeric_class.indexOf(\"wp-image-\") > -1 && tag == 'img') {\n return_the_best = $.trim(nummeric_class.match(/wp-image-[0-9]+/g).toString());\n }\n\n // Good num classes\n if (return_the_best == '') {\n\n if (nummeric_class.indexOf('section') != -1 || nummeric_class.indexOf(\"button\") != -1 || nummeric_class.indexOf(\"image\") != -1 || nummeric_class.indexOf(\"fusion-fullwidth\") != -1 || nummeric_class.indexOf('vc_custom_') != -1 || (nummeric_class.indexOf('row-') != -1 && the_best.indexOf(\"row\") != -1) || (nummeric_class.indexOf('fl-node-') != -1 && the_best.indexOf(\"fl-row\") != -1)) {\n return_the_best = nummeric_class;\n }\n\n }\n\n // Some element selecting by tag names.\n var tagFounded = false;\n\n // If there not have any best class.\n if (return_the_best == '') {\n\n // select img by tagname if no id or best class.\n if (tag == 'img' && typeof id == 'undefined') {\n tagFounded = true;\n the_best = tag;\n }\n\n // Use article for this tag.\n if (tag == 'article' && element.hasClass((\"comment\"))) {\n tagFounded = true;\n the_best = tag;\n }\n\n }\n\n return_the_best = $.trim(return_the_best.replace(/W06lXW/g, \"-\"));\n significant_classes = $.trim(significant_classes.replace(/W06lXW/g, \"-\"));\n\n\n if (Array.isArray(the_best)) {\n\n the_best = $.trim(the_best.toString().replace(/W06lXW/g, \"-\"));\n\n if (the_best.indexOf(\",\") != -1) {\n the_best = the_best.split(\",\");\n }\n\n if (the_best.indexOf(\" \") != -1) {\n the_best = the_best.split(\" \");\n }\n\n } else {\n\n the_best = $.trim(the_best.replace(/W06lXW/g, \"-\"));\n\n }\n\n if (typeof the_best == 'string') {\n the_best = get_classes_array(the_best);\n }\n\n\n // If the best classes is there, return.\n if (return_the_best != '') {\n\n the_best = '.' + return_the_best;\n\n // If can't find best classes, use significant classes.\n } else if (significant_classes != '' && tagFounded === false) {\n\n // Convert to array.\n significant_classes = get_classes_array(significant_classes);\n\n var matchlessFounded = false;\n\n // Find matchless classes for single selector tool.\n if ($(\"body\").hasClass(\"yp-sharp-selector-mode-active\")) {\n\n var matchlessClasses = significant_classes.sort(function (b, a) {\n return iframeBody.find(\".\" + b).length - iframeBody.find(\".\" + a).length;\n });\n\n if (iframeBody.find(\".\" + matchlessClasses[0]).length == 1) {\n the_best = '.' + matchlessClasses[0];\n matchlessFounded = true;\n } else if (matchlessClasses[1] !== undefined) {\n if (iframeBody.find(\".\" + matchlessClasses[0] + \".\" + matchlessClasses[1]).length == 1) {\n the_best = '.' + matchlessClasses[0] + '.' + matchlessClasses[1];\n matchlessFounded = true;\n }\n }\n\n }\n\n if (matchlessFounded === false) {\n\n // Find most long classes.\n var maxlengh = significant_classes.sort(function (a, b) {\n return b.length - a.length;\n });\n\n // If finded, find classes with this char \"-\"\n if (maxlengh[0] != 'undefined') {\n\n // Finded.\n var maxChar = significant_classes.sort(function (a, b) {\n return b.indexOf(\"-\") - a.indexOf(\"-\");\n });\n\n // First prefer max class with \"-\" char.\n if (maxChar[0] != 'undefined' && maxChar[0].indexOf(\"-\") != -1) {\n the_best = '.' + maxChar[0];\n } else if (maxlengh[0] != 'undefined') { // else try most long classes.\n the_best = '.' + maxlengh[0];\n }\n\n } else {\n\n // Get first class.\n the_best = '.' + significant_classes[0];\n\n }\n\n }\n\n } else if (tagFounded === false) {\n\n // If has any nummeric class\n if ($.trim(nummeric_class) != '') {\n\n the_best = '.' + nummeric_class;\n\n } else {\n\n // Get first founded any class.\n the_best = '.' + the_best[0];\n\n }\n\n\n }\n\n } else {\n\n // If has any nummeric class\n if ($.trim(nummeric_class) != '') {\n the_best = '.' + nummeric_class;\n }\n\n // If has an id\n if ($.trim(id) != '' && $.trim(the_best) == '') {\n the_best = ClassNameTag + '#' + id;\n }\n\n // If Nothing, Use tag name.\n if ($.trim(tag) != '' && $.trim(the_best) == '') {\n the_best = tag;\n }\n\n }\n\n return the_best;\n\n }", "function getKeyFromID(id) {\n return '.' + id;\n}", "function getKeyFromID(id) {\n return '.' + id;\n}", "function getKeyFromID(id) {\n return '.' + id;\n}", "function getKeyFromID(id) {\n return '.' + id;\n}", "function getKeyFromID(id) {\n return '.' + id;\n}", "function getKeyFromID(id) {\n return '.' + id;\n}", "function getKeyFromID(id) {\n return '.' + id;\n}", "function getKeyFromID(id) {\n return '.' + id;\n}", "function keggGetCompoundURI(id) {\n let text = Array.isArray(id) ? id.join(\"+\") : id;\n return `https://kegg.cheminfo.org/get/${text}`;\n}", "function setId( RT, docPath, theElement ) {\n // makes an id out of the docPath and assigns it to the theElement iif it\n // does not have already an id (theElement is always a header)\n var theId = null;\n // check if the element already has an id\n if( !! theElement.id ) {\n theId = theElement.id;\n } else {\n // no id: provide one made after its docPath by prepending \"RT-\" and \n // replacing the toString commas by \"-\", use the first 7 items\n // TODO: should make the id out of the header text better than the docPath (a slug)\n // TODO: must check for uniqueness\n theId = 'RT-' + docPath.slice(0, 7).toString().replace(/,/g, '-');\n theElement.id = theId;\n }\n // store the id in the headersId map indexed by the 1st 7 docPath elements\n RT.data.headerId[docPath.slice(0, 7).toString()] = { id: theId };\n return theId;\n }", "function getElementNewID(el) {\n var elID = el.id;\n if (!elID) {\n alert(\"Every elemet should have a unique id to use function getElementNewID()\");\n return false;\n }\n var splitID = elID.split('_');\n var index = 1;\n var newIndex = 1;\n var newID = \"\";\n if (splitID.length > 1) {\n index = splitID.length - 1;\n newIndex = Number(splitID[index]) + 1;\n splitID.pop();\n newID = splitID.join(\"\") + \"_\" + newIndex;\n } else {\n newID = elID + \"_\" + index;\n }\n return newID;\n }", "function getLinks() {\n var regexpId = new RegExp(/[\\d]+-[\\d]+-[A-Z]+/),\n allElem = document.getElementsByClassName('b');\n filtered = [];\n\n for (var i = 0; i < allElem.length; i++) {\n if (allElem[i].id && regexpId.test(allElem[i].id)) {\n filtered.push(allElem[i]);\n }\n }\n return filtered;\n}", "function followScriptTagById(id) {\n\t\t\tvar element = document.getElementById(id);\n\t\t\treturn element ? element.text : id;\n\t\t}", "function beautifySectionId(id){\n\t\treturn id.substring(2); //socket.id /#.... => ...\n\t}", "function getPostId(post){\n var dt = post.getElementsByClassName(\"_5pcq\")[0];\n if(dt){\n var href = dt.href;\n var postId =0;\n if(href){\n if(href.indexOf(\"permalink.php\") > -1){\n postId = href.split(\"story_fbid=\")[1].split(\"&\")[0];\n }else if(href.indexOf(\"photo.php\") > -1){\n postId = href.split(\"fbid=\")[1].split(\"&\")[0]\n }else{\n var parts = href.split(\"/\");\n for (var j = parts.length; j >= 0; j--) {\n var part = parts[j];\n if (!isNaN(part) && part != \"\") {\n postId = part;\n break;\n }\n }\n }\n }\n }\n\n\n return postId;\n}", "function presidentsNamedJames() {\n $(\".president[id^='james']\").addClass('james');\n}", "static registerElement(element, newID)\n\t{\n\t\tif(element !== undefined)\n\t\t{\n\t\t\telement.id = newID;\n\t\t\telement.classList.add(\"OMC\");\n\t\t}\n\t}", "function extractIdFromUrl( url ) {\n if ( !url ) {\n return;\n }\n\n var matches = url.match( rWebUrl );\n return matches ? matches[0].substr(10) : \"\";\n }", "function checkId(id) {\n if(id === \"about\") {\n return [\"About Us\", aboutText];\n }\n else if(id === \"links\") {\n return [\"Links\", linksText];\n }\n else if(id === \"contact\") {\n return [\"Contact\", contactText];\n }\n else if(id === \"legal\") {\n return [\"Legal\", legalText];\n }\n}", "_substituteBaseUrl(element, baseUrl) {\r\n if (DOM.isElementNode(element)) {\r\n var attrs = DOM.attributeMap(element);\r\n MapWrapper.forEach(attrs, (v, k) => {\r\n if (isPresent(v) && v.indexOf('$baseUrl') >= 0) {\r\n DOM.setAttribute(element, k, StringWrapper.replaceAll(v, /\\$baseUrl/g, baseUrl));\r\n }\r\n });\r\n }\r\n let children = DOM.childNodes(element);\r\n for (let i = 0; i < children.length; i++) {\r\n if (DOM.isElementNode(children[i])) {\r\n this._substituteBaseUrl(children[i], baseUrl);\r\n }\r\n }\r\n }", "function getClassById (id){\n function getClass (class1){\n return class1.id == id;\n }\n\n return classes.find(getClass);\n\n}" ]
[ "0.57154965", "0.56249183", "0.56249183", "0.54397786", "0.5426901", "0.54023623", "0.52973056", "0.5274815", "0.52697206", "0.52697206", "0.5240385", "0.52090764", "0.51956576", "0.519366", "0.51932734", "0.51715547", "0.5154293", "0.5140008", "0.5140008", "0.5104562", "0.5087917", "0.5087917", "0.50735235", "0.5054842", "0.50448465", "0.5024865", "0.5019757", "0.5006965", "0.5006965", "0.5002713", "0.50024474", "0.499665", "0.4994252", "0.4963114", "0.49517968", "0.49470976", "0.4933368", "0.49267593", "0.49178034", "0.49094993", "0.4867748", "0.4861237", "0.4861237", "0.48573923", "0.4855597", "0.48493958", "0.4846785", "0.48450577", "0.4843831", "0.48321295", "0.48317394", "0.48295507", "0.48289162", "0.48277265", "0.48159233", "0.48087648", "0.4803412", "0.47967696", "0.4795993", "0.47904772", "0.47576404", "0.47491923", "0.47401372", "0.47330242", "0.47312528", "0.47198495", "0.47070688", "0.47057903", "0.47038227", "0.4702223", "0.47009227", "0.469265", "0.4687987", "0.46863484", "0.46773195", "0.46773195", "0.4667598", "0.4665137", "0.4659646", "0.46555358", "0.46555358", "0.46555358", "0.46555358", "0.46555358", "0.46555358", "0.46555358", "0.46555358", "0.4643098", "0.46402287", "0.46398264", "0.46280688", "0.46269888", "0.46178314", "0.46118054", "0.4611333", "0.4611326", "0.46102113", "0.45949757", "0.45926407", "0.45845178" ]
0.5485872
3
The resulting Lighthouse reports contain way more info than we are interested it So we select just the data we will use, to cut down on disk usage and ease of reading data
async function parseResult(port) { const raw = await fs.readFile(path.join(__dirname, `reports/http:127.0.0.1:${port}-lighthouse.json`)); const data = JSON.parse(raw.toString()) // All units are ms return { firstContentfulPaint: data.lhr.audits['first-contentful-paint'].numericValue, largestContentfulPaint: data.lhr.audits['largest-contentful-paint'].numericValue, firstMeaningfulPaint: data.lhr.audits['first-meaningful-paint'].numericValue, speedIndex: data.lhr.audits['speed-index'].numericValue, estimatedInputLatency: data.lhr.audits['estimated-input-latency'].numericValue, totalBlockingTime: data.lhr.audits['total-blocking-time'].numericValue, maxPotentialFid: data.lhr.audits['max-potential-fid'].numericValue, cumulativeLayoutShift: data.lhr.audits['cumulative-layout-shift'].numericValue, firstCpuIdle: data.lhr.audits['first-cpu-idle'].numericValue, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async getData () {\n return await App.getPage('popular', 1);\n }", "async function getData(countiesObj, logFile) {\n console.log(`\\nRO @extractData START 111111111111111111111`);\n\n // get counties home pages\n const countiesArr = countiesObj.counties.map((county) => {\n return {\n countyName: county.countyName,\n paths: [`${countiesObj.rootPath}/${county.href}`],\n }\n });\n const countiesHtmlArr = await getHtmlPages(countiesArr, logFile);\n // console.log(countiesHtmlArr.filter(item => item.countyName === 'CLUJ')[0].htmlArray[0]);\n\n // create paths array\n const pathsArr = countiesObj.counties.map((county) => {\n console.log(`${county.countyName}:: total monuments = ${county.total}`);\n if (Number(county.total) < 850) {\n return {\n countyName: county.countyName,\n paths: [`${countiesObj.rootPath}/${county.href}`],\n };\n } else if (county.countyName === 'BUCURESTI') {\n return {\n countyName: county.countyName,\n paths: [\n `${countiesObj.rootPath}/${county.href},_sector_1`,\n `${countiesObj.rootPath}/${county.href},_sector_2`,\n `${countiesObj.rootPath}/${county.href},_sector_3`,\n `${countiesObj.rootPath}/${county.href},_sector_4`,\n `${countiesObj.rootPath}/${county.href},_sector_5`,\n `${countiesObj.rootPath}/${county.href},_sector_6`,\n `${countiesObj.rootPath}/${county.href}_cu_sector_necunoscut`,\n ],\n }\n } else {\n return {\n countyName: county.countyName,\n paths: [\n `${county.href}_-_A`,\n `${county.href}_-_B`,\n `${county.href}_-_C`,\n `${county.href}_-_D`,\n `${county.href}_-_E`,\n `${county.href}_-_F`,\n `${county.href}_-_G`,\n `${county.href}_-_H`,\n `${county.href}_-_I`,\n `${county.href}_-_J`,\n `${county.href}_-_L`,\n `${county.href}_-_M`,\n `${county.href}_-_N`,\n `${county.href}_-_O`,\n `${county.href}_-_P`,\n `${county.href}_-_R`,\n `${county.href}_-_S`,\n `${county.href}_-_%C8%98`, //Ș\n `${county.href}_-_T`,\n `${county.href}_-_#%C8%9A`, //Ț\n `${county.href}_-_U`,\n `${county.href}_-_V`,\n `${county.href}_-_Z`,\n ].filter(str => countiesHtmlArr.filter(item => item.countyName === county.countyName)[0].htmlArray[0].includes(str)) // filter out bad links\n .map(item => `${countiesObj.rootPath}/${item}`),\n }\n }\n\n });\n\n // get all html pages\n const htmlArr = await getHtmlPages(pathsArr, logFile);\n\n // process html pages\n const returnArr = htmlArr.map((item) => {\n return {\n countyName: item.countyName,\n lmiArray: processHtml(item.countyName, item.htmlArray),\n }\n });\n\n // return the new array\n console.log(`@extractData END 111111111111111111111`);\n // console.log(returnArr)\n return returnArr;\n}", "function getDataFromHarvest(){\n if (count >= ids.length){\n saveReportData();\n }else{\n harvest_options.url = harvestURL_pt1+ ids[count]+harvestURL_pt2;\n count++;\n request(harvest_options, addDataToArray);\n } \n }", "function getMoreData() {\n //so long as we are getting listings, continue...\n if (response.features.length > 0) {\n let percent = (lastFID / 15000) * 100;\n\n percent = Math.floor(percent);\n if (percent > 100) {\n percent = 100;\n }\n document.getElementById('loaderText').textContent = \"Loading \" + percent + \"%\";\n\n updateResult(businesses.length);\n getData();\n }\n //else stop.\n}", "async function downloadLatest() {\n const response = await fetch('https://api.luftdaten.info/static/v1/filter/type=SDS011');\n return await response.json();\n}", "static fetchVillagers() {\n\n // use const for connection\n const db = getDb()\n\n // return result of the query\n return db\n .collection('villagers')\n .find()\n .limit(8)\n .skip(3)\n .toArray()\n .then(villagers => {\n return villagers\n })\n .catch(err => console.log(err));\n\n }", "async function getDataset() {\n const [dataset, perfTimes] = await fetchMorpheusJson(\n studyAccession,\n genes,\n cluster,\n annotation.name,\n annotation.type,\n annotation.scope,\n subsample\n )\n logFetchMorpheusDataset(perfTimes, cluster, annotation, genes)\n return dataset\n }", "function grabTableData() {\n var cache1 = CacheService.getDocumentCache();\n var dataForChart = (cache1.get('mtData'));\n Logger.log('return:' + JSON.parse(dataForChart));\n return dataForChart;\n}", "getAll() {\n return fetch(API_URL + '?api-key=' + API_KEY + '&show-fields=trailText,thumbnail')\n .then(response => response.json())\n .then(res => res.response && res.response.results)\n }", "fetch() {\r\n return new Promise((resolve, reject) => {\r\n const t = time.measure.start()\r\n this.docClient.scan({ TableName: this.table }, (err, data) => {\r\n time.measure.end(t, `Fetch (scan) from table ${this.table}`)\r\n if (err) {\r\n reject(err)\r\n } else {\r\n resolve(data.Items)\r\n }\r\n })\r\n })\r\n }", "async getPageData() {\n\t\treturn this.#browser.execute(function() {\n\t\t\tconst assets = Array.from(document.querySelectorAll('*[src], link[rel=\"shortcut icon\"], link[rel=stylesheet], *[href][download]')).map(el => el.src || el.href);\n\t\t\tconst links = Array.from(document.querySelectorAll('a[href]:not(a[download]), area[href]:not(area[download])')).map(el => el.href).filter(link => {\n\t\t\t\tconst m = new URL(link).pathname.match(/\\.[a-z0-9]+$|^\\/biblio\\/export\\/|^\\/blog\\/([0-9]+\\/)?feed$|^\\/taxonomy\\/term\\/[0-9]+\\/feed$/);\n\t\t\t\tif(m) {\n\t\t\t\t\tassets.push(link);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn !link.match(/\\/event\\/(day|week|month)\\/.*$/);\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\thtml: (document.doctype ? new XMLSerializer().serializeToString(document.doctype) : '') + document.documentElement.outerHTML,\n\t\t\t\tassets,\n\t\t\t\tlinks\n\t\t\t}\n\t\t});\n\t}", "function getData() {\n let name = qs(\"select\").value;\n let url = URL_BASE + name + \"/\";\n fetch(url)\n .then(checkStatus)\n .then(response => response.json())\n .then(genData)\n .catch(handleError);\n }", "async function getMemories() {\n var tempInfo = [];\n const memoriesRef = notion.__getApp().firestore().collection(\"memories\");\n const snapshot = await memoriesRef\n .where(\"type\", \"==\", \"epoch\")\n .where(\"userId\", \"==\", user.uid)\n .get()\n .catch((error) => { // not sure if this catch works\n setError(error.message);\n });\n var select = document.getElementById(\"recordingSelect\");\n snapshot.forEach(doc => {\n /* const memory = doc.data();\n dataFunction(memory.id).then(console.log); */\n //console.log(doc.data());\n tempInfo.push(doc.data());\n var opt = doc.data().name;\n var el = document.createElement(\"option\");\n el.textContent = opt;\n el.value = opt;\n select.appendChild(el);\n });\n setRecordingsInfo(tempInfo);\n }", "function getSourceDataList(el, response) {\n if (el.settings.sourceObject.settings.aggregation) {\n // Aggregated data so use the buckets.\n return indiciaFns.findValue(response.aggregations, 'buckets');\n }\n // A standard list of records.\n return response.hits.hits;\n }", "function smallDataFetch(search){\n return fetch('https://api.github.com/repos/'+search+'/stats/contributors')\n .then(data=>data.json())\n .then(data=>{\n let betterData = []\n for(i=0; i<data.length; i++){\n betterData.push({'total':data[i].total,'user':data[i].author.login})\n }\n return betterData\n })\n}", "function getDataFromHarvest(){\n if (count >= ids.length){\n deleteData();\n }else{\n harvest_options.url = harvestURL_pt1+ ids[count]+harvestURL_pt2;\n count++;\n request(harvest_options, addDataToArray);\n } \n }", "function get_data() {}", "async generateReportData() {\n try {\n const date = new Date();\n const currentMonth =\n date.getMonth() < 9 ? `0${(date.getMonth() + 1)}` : `${(date.getMonth() + 1)}`;\n const currentDate = date.getDate() < 10 ? `0${date.getDate()}` : `${date.getDate()}`;\n const start = `${date.getFullYear()}-01-01 00:00:00+00`;\n // const start = `${date.getFullYear()}-${currentMonth}-01 00:00:00+00`;\n this.fileDate = `${date.getFullYear()}-${currentMonth}-${currentDate}`;\n const query = `select\n to_char(lead.created_at + interval '5 hours 30 min', 'DD-MM-YYYY') as date,\n to_char(lead.created_at + interval '5 hours 30 min', 'HH:MI:SSAM') as created_time,\n ( select name from zones where id = lead.zone_id ) as zone,\n ( select name from states where id = lead.state_id ) as state,\n ( select name from cities where id = lead.city_id ) as city,\n ( select name from dealer_categories dc where dc.id = lead.dealer_category_id ) as dealer_category,\n ( select name from dealers d where d.id = lead.dealer_id ) as name_of_the_dealer,\n lead.source_of_enquiry as source_of_enquiry,\n ( select first_name from users u where u.id = lead.assigned_to ) as name_of_the_dse,\n lead.pincode as pincode,\n ( CASE WHEN (lead.gender = 'male') THEN 'Mr.' ELSE 'Ms.' END ) as title_of_the_prospect,\n lead.name as name_of_the_prospect, lead.mobile_number as phone_number,\n ( select count(1) from lead_details where lead_id = lead.id and is_deleted = false ) as number_of_enquiries,\n ( select name from vehicles where id = ld.vehicle_id ) as product_enquired,\n (select color from variant_colours where id=ld.variant_colour_id ) as Product_Color,\n ( CASE WHEN (lead.category = 'NEW' and lead.is_lost = false and lead.is_invoiced = false\n and lead.is_booked = false ) THEN 'yes' ELSE 'no' END ) as new,\n ( CASE WHEN (lead.category = 'HOT' and lead.is_lost = false and lead.is_invoiced = false\n and lead.is_booked = false ) THEN 'yes' ELSE 'no' END ) as hot,\n ( CASE WHEN (lead.category = 'WARM' and lead.is_lost = false and lead.is_invoiced = false\n and lead.is_booked = false ) THEN 'yes' ELSE 'no' END ) as warm,\n ( CASE WHEN (lead.category = 'COLD' and lead.is_lost = false and lead.is_invoiced = false\n and lead.is_booked = false ) THEN 'yes' ELSE 'no' END ) as cold,\n ( CASE WHEN (ld.booked_on IS NOT NULL) THEN 'yes'\n ELSE 'no' END ) as is_booked,\n ( CASE WHEN (ld.invoiced_on IS NOT NULL) THEN 'yes'\n ELSE 'no' END ) as is_invoiced,\n ( CASE WHEN (lead.is_lost = true) THEN 'yes' ELSE 'no' END ) as lost,\n ( CASE WHEN (lead.lost_reason_text is NULL OR lead.lost_reason_text = '')\n THEN ( select reason from lost_reasons where id = lead.lost_reason_id )\n ELSE lead.lost_reason_text END ) as lost_reason,\n(CASE WHEN(lead.lost_reason_id is not NULL )Then\n(select category from lost_reasons where id = lead.lost_reason_id )\nElse '' END) as Lost_Category,\n lead.category as last_status,\n to_char(ld.booked_on + interval '5 hours 30 min', 'DD-MM-YYYY') as booked_date,\n to_char(ld.invoiced_on + interval '5 hours 30 min', 'DD-MM-YYYY') as invoiced_date,\n to_char(cast(lead.lost_on as timestamp with time zone) + interval '5 hours 30 min', 'DD-MM-YYYY') as Lost_Date,\n ( CASE WHEN (ld.test_ride_status is not null) THEN 'yes' ELSE 'no' END ) as test_ride_availed,\n (case ld.test_ride_status when 200 then 'Booked'\n when 300 then 'Ongoing' when 400 then 'Completed'\n when 500 then 'Cancelled' end) \"Test Ride Status\",\n ( CASE WHEN ( (select count(1) from exchange_vehicles where lead_id = lead.id ) = 0)\n THEN 'no' ELSE 'yes' END ) as exchange_vehicle_opted,\n ( select manufacturer from exchange_vehicles where lead_id = lead.id order by created_at DESC limit 1)\n as vehicle_make,\n ( select vehicle from exchange_vehicles where lead_id = lead.id order by created_at DESC limit 1)\n as vehicle_model,\n ( select variant_year from exchange_vehicles where lead_id = lead.id order by created_at DESC limit 1)\n as year_of_manufacturer,\n ( select condition from exchange_vehicles where lead_id = lead.id order by created_at DESC limit 1)\n as vehicle_condition,\n ( select remarks from exchange_vehicles where lead_id = lead.id order by created_at DESC limit 1)\n as vehicle_remarks,\n ( select quoted_value from exchange_vehicles where lead_id = lead.id order by created_at DESC limit 1)\n as exchange_value,\n ( CASE WHEN ( lead.income_status = 1 AND fl.id is not null) THEN 'self-employed'\n WHEN ( lead.income_status = 0 AND fl.id is not null) THEN 'salaried'\n ELSE '' END ) as income_status,\n ( CASE WHEN (fl.id is not null) THEN 'yes' ELSE 'no' END ) as finance_opted,\n ( select name from financiers f where f.id = fl.financier_id ) as financier_name,\n fl.loan_amount as loan_amount,\n fl.tenure as tenure,\n ( CASE WHEN (fl.status = 500) THEN 'active'\n WHEN (fl.status = 510) THEN 'disbursement-pending'\n WHEN (fl.status = 520) THEN 'converted'\n WHEN (fl.status = 930) THEN 'lost' END ) as finance_status,\n ( CASE WHEN ( (select count(1) from follow_ups where lead_id = lead.id ) = 0) THEN 'no' ELSE 'yes' END )\n as follow_up_scheduled,\n to_char(lead.next_followup_on + interval '5 hours 30 min', 'DD-MM-YYYY') as next_follow_up_date,\n to_char(lead.next_followup_on + interval '5 hours 30 min', 'HH:MI:SSAM') as next_follow_up_time,\n ( select to_char(completed_at + interval '5 hours 30 min', 'DD-MM-YYYY')\n from follow_ups where lead_id = lead.id and is_completed = true\n order by created_at DESC limit 1 ) as last_follow_up_date,\n ( select to_char(completed_at + interval '5 hours 30 min', 'HH:MI:SSAM')\n from follow_ups where lead_id = lead.id and is_completed = true\n order by created_at DESC limit 1 ) as last_follow_up_time,\n ( select comment from follow_ups where lead_id = lead.id and is_completed = true\n order by created_at DESC limit 1 ) as follow_up_comment,\n ( select count(1) from follow_ups where lead_id = lead.id and is_completed = true ) as number_of_follow_up_done,\n (SELECT string_agg(comment, '; ')\nFROM lead_activities where lead_id=lead.id and type='Comments Added') AS General_Comments\n from leads lead\n left join lead_details ld ON ld.lead_id = lead.id and ld.is_deleted = false\n left join financier_leads fl ON fl.lead_detail_id = ld.id and\n fl.created_at=(select max(created_at) from financier_leads fl_temp\n where fl_temp.lead_detail_id = ld.id)\n where\n ( lead.created_at between $1 and (select now()) ) or\n ( lead.invoiced_on between $1 and (select now()) ) or\n ( lead.lost_on between $1 and (select now()) )\n order by lead.created_at ASC, lead.name ASC`;\n const params = [start];\n this.result = await new Promise((resolve, reject) => {\n postgresDsConnector.query(query, params, (err, res) => {\n if (err) {\n logger.info('Error in preparing report data');\n reject(new InstabikeError(err));\n }\n return resolve(res);\n });\n });\n let csv = [];\n if (this.result.length) {\n const items = this.result;\n // specify how you want to handle null values here\n const replacer = (key, value) => (value === null ? '' : value);\n const header = Object.keys(items[0]);\n await Promise.all(items.map((row) => {\n const eachRow = header.map(fieldName => JSON.stringify(row[fieldName], replacer)).join(',');\n csv.push(eachRow);\n }));\n csv.unshift(header.join(','));\n csv = csv.join('\\r\\n');\n } else {\n csv = constants.MIS_REPORT.DEFAULT_TITLE;\n }\n await this.saveReportAsCSV(csv);\n } catch (e) {\n logger.info(e);\n throw new InstabikeError(e);\n }\n }", "function getData(callback, pageParam) {\n var page = pageParam;\n if (_.isUndefined(page)) {\n page = 1;\n }\n toggl.detailedReport({\n workspace_id: config.workspaceId,\n since: config.from,\n until: config.to,\n user_ids: config.userIds,\n //order_field: 'date', //currently sorting doesn't work\n //order_desc: 'off',\n page: page\n }, function(err, report) {\n if (err !== null){\n console.log(\"Err: \", err);\n callback(\"Failed to retrieve toggl data: \" + err, null);\n }\n console.log(\"total_count: \", report.total_count);\n console.log(\"per_page: \", report.per_page);\n console.log('acquired page: ' + page);\n //print the whole JSON response:\n //console.log(\"Report: %j\", report);\n\n //concatenate pages\n togglReportData = togglReportData.concat(report.data);\n\n if (page * report.per_page < report.total_count) {\n //request another page\n getData(callback, page + 1);\n } else {\n //fineshed, process data\n toggl.destroy();\n callback(null, togglReportData);\n }\n });\n}", "function fetchAllDrugs() {\n const url = \"https://rxnav.nlm.nih.gov/REST/interaction/interaction.json?rxcui=2653\";\n console.log(\"fetching drugs\");\n\n fetch(url)\n .then(response => response.json())\n .then(result => {\n\n\n // data from all sources(DrugBank + ONCHigh)\n for(source in result.interactionTypeGroup){\n const drug_name = result.interactionTypeGroup[source].interactionType[0].minConceptItem.name;\n\n // getting all interaction pairs\n for(idx in result.interactionTypeGroup[source].interactionType[0].interactionPair){\n const d = result.interactionTypeGroup[source].interactionType[0].interactionPair[idx]; // drug object \n var drug = [];\n drug.push(d.interactionConcept[1].sourceConceptItem.name); // sourceConceptItem vs minConceptItem\n drug.push(d.severity);\n drug.push(d.description);\n\n all_drugs.push(drug);\n }\n }\n\n console.log(all_drugs);\n\n // displaying the data\n updateTable(all_drugs);\n document.getElementById(\"data_here\").style.display = \"block\";\n\n showVisual();\n \n\n })\n .catch(function(err){\n console.log(err);\n });\n\n}", "getData(numRecords = undefined) {\n return !numRecords ? this.data : this.data.slice(0, numRecords);\n }", "function queryReadings() {\n\t\t\tdashboard.queryReadings();\n\t\t}", "async function getAllData() {\n const ulData = domElement(\"ul\");\n const ulReport = domElement(\"ul\");\n\n SHORTNAMES.then(data => {\n\n // we need to sort them alphabetically\n const entries = [];\n for (const [key, value] of Object.entries(data)) {\n value.key = key;\n if (!value.title) {\n value.title = key;\n if (config.debug && value.link) {\n ulReport.appendChild(domElement(\"li\", { \"id\": `report-title-${value.key}` },\n `No title for `, domElement(\"code\", value.key), \". See \",\n domElement(\"a\", {\n href: `${value.link}`\n }, value.link)));\n }\n }\n value.sortKey = value.title.toLowerCase().replace(/[- :.[\\]]/g, '');\n if (value.sortKey.startsWith('\"')) {\n value.sortKey = value.sortKey.substring(1);\n }\n entries.push(value);\n }\n function sortEntries(a, b) {\n const t1 = a.sortKey;\n const t2 = b.sortKey;\n if (t1 < t2) {\n return -1;\n };\n if (t1 > t2) {\n return 1;\n };\n return 0;\n }\n entries.sort(sortEntries);\n\n entries.forEach(value => {\n if (config.retired || !value.retired) {\n ulData.appendChild(domElement(\"li\", { \"id\": value.key },\n domElement(\"a\", {\n href: `review.html?shortname=${value.key}`\n },\n (value.title)? value.title : value.key\n )\n ));\n }\n if (config.debug && value.serie && value.key !== value.serie) {\n ulReport.appendChild(domElement(\"li\", { \"id\": `report-${value.key}` },\n `Consider replacing `,\n domElement(\"a\", {\n href: `review.html?shortname=${value.key}`\n }, domElement(\"code\", value.key)),\n ` with `, domElement(\"code\", value.serie)\n ));\n }\n if (config.debug && config.link && !value.link) {\n ulReport.appendChild(domElement(\"li\", { \"id\": `report-link-${value.key}` },\n \"No editor's draft link for \", domElement(\"code\", value.key)\n ));\n }\n });\n\n }).catch(err => {\n console.error(err)\n });\n document.getElementById(\"rawdata\").appendChild(ulData);\n if (config.debug) {\n document.getElementById(\"report\").appendChild(domElement(\"h2\", \"Debug\"));\n document.getElementById(\"report\").appendChild(domElement(\"p\",\n \"Edit the file \",\n domElement(\"a\", { href: \"https://github.com/w3c/horizontal-issue-tracker/blob/main/docs/shortnames.json\"}, \"shortnames.json\")));\n document.getElementById(\"report\").appendChild(ulReport);\n }\n}", "function getdata() {\n\n var url = `/data`;\n\n d3.json(url).then(function(xx) {\n\n data = []\n // xx.slice(s, e)\n globaldata = xx;\n unfiltered = xx;\n actual = [], minute = []\n \n makedata();\n})\n}", "function getInfo (limit=0,offset=0) {\n const trends = fetch(initialTrend + apiKey + `&limit=${limit}`+ `&offset=${offset}` + \"&rating=G\")\n .then((response) => {\n return response.json();\n })\n .then((data) => {\n return data; \n })\n return trends\n }", "_getPageMetadata() {\n return undefined;\n }", "async function scrapeData() {\n var targetUrl = \"https://www.chrono24.ae/search/index.htm?countryIds=AE&dosearch=true&manufacturerIds=236&maxAgeInDays=0&onlyDealerAds=false&pageSize=60&priceFrom=0&priceTo=-1&redirectToSearchIndex=true&sortorder=0\";\n var scrappedData;\n var leadsData;\n try {\n scrappedData = require(`./${category}/${dateString}/result-${dateString}.json`);\n }\n catch (err) {\n console.log(\"Error: \" + err.message);\n fs.mkdir(`${category}/${dateString}`, { recursive: true }, (err) => {\n });\n }\n try {\n leadsData = require(`./${category}/${dateString}/leads-${dateString}.json`);\n }\n catch (err) {\n console.log(\"Error: \" + err.message);\n }\n var chrono24Scrapper = new Chrono24DataScrapper(targetUrl, puppeteer, config);\n if (!scrappedData) {\n scrappedData = await chrono24Scrapper.openAllPages();\n console.log(scrappedData.length);\n fs.writeFileSync(`./${category}/${dateString}/result-${dateString}.json`, JSON.stringify(scrappedData));\n var detailsOfClassifieds = await chrono24Scrapper.getFullDetails(scrappedData);\n fs.writeFileSync(`./${category}/${dateString}/leads-${dateString}.json`, JSON.stringify(detailsOfClassifieds));\n generateExcel(leadsData);\n } else if (!leadsData) {\n console.log(`Already scrapped list (${scrappedData.length})`);\n var detailsOfClassifieds = await chrono24Scrapper.getFullDetails(scrappedData);\n fs.writeFileSync(`./${category}/${dateString}/leads-${dateString}.json`, JSON.stringify(detailsOfClassifieds));\n generateExcel(leadsData);\n } else if (leadsData) {\n generateExcel(leadsData);\n }\n}", "function fetchReadingsLimited (knex, req, res)\n{\n var data = req.body;\n \n knex\n .select()\n .from('patient_' + data.id)\n .limit(1400) //assuming 4 readings every hour, 1344 readings in 14 days should be the upper limit assuming 1 reading every 15 minutes.\n .then(function (results) {\n var ret = {\n csv: ''\n };\n var cnt = 0;\n var temp = new Date(Date.now());\n temp.setDate( temp.getDay() - 14);\n var fourteenDaysAgo = Date.parse(temp);\n console.log(fourteenDaysAgo);\n Array.prototype.forEach.call(results, function (row)\n {\n //TODO: remove data older than 14 days.\n console.log(Date.parse(row.timestamp));\n if(fourteenDaysAgo < Date.parse(row.timestamp))\n {\n var ts = Date.parse(row.timestamp);\n console.log(row.timestamp);\n //console.log(ts.UTC());\n var rowParse = '';\n for (var key in row)\n {\n if (key == 'timestamp')\n rowParse += row[key];\n else\n rowParse += ',' + row[key];\n }\n cnt++;\n if (cnt != results.length)\n rowParse += '\\n';\n ret.csv += rowParse;\n \n }\n });\n util.respond(res, 200, ret);\n });\n}", "function getOptionData(){\n var ddMenu = d3.select(\"#selDataset\").node();\n var ddValue = ddMenu.value;\n\n dataPromise.then(results =>{\n results.samples.forEach(d => {\n if (d['id'] == ddValue){ \n sortFilterData(d)\n } \n })\n\n results.metadata.forEach(r => {\n if (r['id'] == ddValue){ \n console.log(r)\n buildGauge(r)\n populateDemoInfo(r)\n }\n }) \n }) \n}", "function getRetailData(page) {\n\t\t\tif(self.selectedStoreId){\n\t\t\t\tscaleMaintenanceApi.findAllScaleMaintenanceByStoreAndTransactionId({\n\t\t\t\t\ttransactionId: self.selectedTransactionId,\n\t\t\t\t\tstore: self.selectedStoreId,\n\t\t\t\t\tincludeCount: self.transmitIncludeCounts,\n\t\t\t\t\tpage: page,\n\t\t\t\t\tpageSize: PAGE_SIZE\n\t\t\t\t}).$promise.then(loadRetailData).catch(function(error) {\n\t\t\t\t\tfetchError(error);\n\t\t\t\t}).finally(function(){\n\t\t\t\t\tPMCommons.displayLoading(self, false);\n\t\t\t\t});\n\t\t\t}\n\t\t}", "function getReports() {\n const endpoint = BASE_URL + \"/report/readAll\";\n return fetch(endpoint).then((res) => res.json());\n}", "getReport() {\n // Inspect the UID to determine the report to render. As a special case,\n // we will display a fake report for development purposes.\n const uid = this.props.match.params.uid;\n if (uid === \"_dev\") {\n const [r] = propagateIndices([fakeReportAssertions]);\n setTimeout(() => {this.setState({report: r, loading: false});}, 1500);\n } else {\n axios.get(`/api/v1/reports/${uid}`)\n .then(response => propagateIndices([response.data]))\n .then(reportEntries => this.setState({\n report: reportEntries[0],\n loading: false\n }))\n .catch(error => this.setState({\n error,\n loading: false\n }));\n }\n }", "function render_datasets() {\n return page.async(function(flush_data) {\n var collection = db.get(\"query\", \"results\");\n var req = context(\"req\");\n var user = req.user;\n var conditions = { username: user.username };\n\n var query_data;\n var datasets;\n var metadatas;\n var found_data = {};\n\n var after = _.after(2, function() {\n var datasetsEl = $(\"<div />\");\n var hiddenEl = $(\"<div class='hidden_datasets noselect' />\");\n var parentEl = $(\"<div />\");\n parentEl.append(datasetsEl);\n\n var headerEl = $(\"<h1 />\");\n headerEl.text(\"hidden/\");\n headerEl.prepend(\"<span class='status'>&gt;</span>\");\n\n parentEl.append(hiddenEl);\n hiddenEl.append(headerEl);\n\n _.each(datasets, function(table) {\n if (table.table_name === \"undefined\") { return; }\n\n var metadata_ = {\n name: table.table_name,\n description: ''\n };\n\n if (metadatas) {\n var newdata = _.find(metadatas, function(m) {\n if (!m) { return; }\n\n var this_name = m.table.table_name || m.table;\n var table_name = table.table_name || table;\n\n return table_name === this_name;\n });\n\n if (newdata) {\n _.extend(metadata_, _.clone(newdata.metadata));\n }\n\n }\n\n var table_name = metadata_.name.table_name || metadata_.name;\n var dataset_tokens = table_name.split(backend.SEPARATOR);\n var display_name = metadata_.display_name || dataset_tokens.join(\"/\");\n if (backend.SEPARATOR != \"/\") {\n while (display_name.indexOf(backend.SEPARATOR) >= 0) {\n display_name = display_name.replace(backend.SEPARATOR, \"/\");\n }\n }\n\n found_data[table_name] = metadata_;\n metadata_.display_name = display_name;\n\n });\n\n\n\n\n\n // Do a descending sort on query counts\n var sorted_datasets = _.sortBy(datasets, function(dataset) {\n return found_data[dataset.table_name || dataset.name].display_name;\n });\n\n var parents = {};\n\n _.each(sorted_datasets, function(table) {\n var metadata_ = found_data[table.table_name];\n var table_name = metadata_.name.table_name;\n var display_name = metadata_.display_name;\n var dataset_tokens = display_name.split(\"/\");\n var superset = dataset_tokens[0];\n\n if (!rbac.check(\"query\", table.table_name, user.username)) { return; }\n\n var editable = dataset_is_editable(table.table_name, user);\n var cmp = $C(\"dataset_tile\", {\n name: table_name || table.table_name,\n display_name: display_name.replace(superset + \"/\", \"\"),\n description: metadata_.description,\n editable: editable,\n client_options: {\n dataset: table.table_name\n },\n delegate: {\n \"change\" : \"table_changed\",\n \"click .delete\" : \"handle_delete_clicked\"\n }\n });\n\n if (metadata_.hide_dataset == \"true\") {\n hiddenEl.append(cmp.toString());\n } else {\n var supersetEl = parents[superset];\n if (!supersetEl) {\n parents[superset] = $(\"<div class='superset clearfix noselect'>\");\n supersetEl = parents[superset];\n supersetEl.attr(\"id\", superset);\n\n var headerEl = $(\"<h1 />\");\n headerEl.text(superset + \"/\");\n headerEl.prepend(\"<span class='status' >&gt;</span>\");\n\n supersetEl.append(headerEl);\n datasetsEl.append(supersetEl);\n\n }\n\n supersetEl.append(cmp.toString());\n }\n\n });\n\n flush_data(parentEl.toString());\n });\n\n backend.get_tables(function(tables) {\n datasets = tables;\n after();\n });\n\n metadata.all(function(datas) {\n metadatas = datas;\n after();\n });\n })(); // deref the asyncccccy\n}", "async function selectAllData() {\n let sql = 'SELECT sn,label FROM enterprise_info';\n console.log(sql);\n let dataList = await query(sql);\n return dataList;\n}", "function getGenInfo(rawData) {\n\t//-- Links to external resources\n\tvar genInfoLinks = '';\n\trawData.find('center a').each(function(){\n\t\tgenInfoLinks += $(this)[0].outerHTML + '|';\n\t});\n\tgenInfoLinks = genInfoLinks.substr(0,genInfoLinks.length-1).replace(/[|]/g,'<span>&nbsp;|&nbsp;</span>');\n\tvar genInfoTitle =\n\t\trawData\n\t\t.find('table:eq(1) tbody tr:eq(0) td:eq(0)')\n\t\t.text()\n\t\t.trim();\n\tvar genInfoFeePayment =\n\t\trawData\n\t\t.find('table:eq(2) a');\n\tvar genInfoNotice =\n\t\trawData\n\t\t.find('table:eq(3) tr:eq(0) td:eq(0)');\n\tvar genInfoPTRMTitle =\n\t\trawData\n\t\t.find('center')\n\t\t.siblings('b');\n\tvar genInfoPTRMTable =\n\t\trawData\n\t\t.find('table:eq(4)')\n\t\t.addClass('genInfo-ptrm')\n\t\t.find('td,th')\n\t\t.each(function(){\n\t\t\t$(this).find('br').remove();\n\t\t})\n\t\t.end();\n\tvar genInfoPlagiarism =\n\t\trawData\n\t\t.find('table:eq(5) tr:eq(0) td:eq(0)')\n\t\t.find('hr')\n\t\t.remove()\n\t\t.end();\n\tvar refreshDataLink =\n\t\t$('<a>')\n\t\t.attr({\n\t\t\t'href' : '#',\n\t\t\t'id' : 'refreshLink'\n\t\t})\n\t\t.addClass('no-print')\n\t\t.text('Refresh interactive content')\n\t\t.click(function(){\n\t\t\tlocalStorage.clear();\n\t\t\tlocation.reload();\n\t\t\treturn false;\n\t\t})\n\tvar result =\n\t$('<div>')\n\t.addClass('filter-genInfo filter-all filter-shown genInfo-container')\n\t.addClass('no-print')\n\t.append(\n\t\trefreshDataLink\n\t)\n\t.append(\n\t\trawData.find('h2')\n\t)\n\t.append(\n\t\trawData.find('table:eq(0)')\n\t)\n\t.append(\n\t\t$('<div>')\n\t\t.addClass('genInfo-title')\n\t\t.append(\n\t\t\t$('<center>')\n\t\t\t.html(genInfoTitle)\n\t\t)\n\t)\n\t.append(\n\t\t$('<p>')\n\t\t.addClass('genInfo-fee')\n\t\t.append(genInfoFeePayment)\n\t)\n\t.append(\n\t\t$('<div>')\n\t\t.addClass('genInfo-notice')\n\t\t.append(\n\t\t\tgenInfoNotice.html()\n\t\t)\n\t)\n\t.append(\n\t\t$('<div>')\n\t\t.addClass('genInfo-links')\n\t\t.append(\n\t\t\t$('<center>')\n\t\t\t.html(genInfoLinks)\n\t\t)\n\t)\n\t.append(\n\t\t$('<p>')\n\t\t.addClass('genInfo-ptrm-title')\n\t\t.append(genInfoPTRMTitle.html())\n\t)\n\t.append(\n\t\tgenInfoPTRMTable\n\t\t.addClass('genInfo-ptrm-table')\n\t)\n\t.append(\n\t\t$('<div>')\n\t\t.addClass('genInfo-plagiarism')\n\t\t.append(\n\t\t\tgenInfoPlagiarism.html()\n\t\t)\n\t)\n\t.find('a')\n\t.attr('target','_blank')\n\t.end();\n\treturn result;\n}", "function downloadResults() {\n resultMode = \"csv\";\n var graph = gAppState.checkValue(\"docNameID\", \"docNameID2\");\n\n if (gAppState.getCurTab() === \"dbms\") {\n var data_query =\n \"SELECT DISTINCT * FROM <\" + graph + \"> WHERE {?subject ?predicate ?object}\"\n } else if (gAppState.getCurTab() === \"fs\") {\n // Use of Sponger Pragma to force document reload during query evaluation\n var data_query =\n \"DEFINE get:soft\" + \" \" + '\"soft\"' + \"\\n\" + \"SELECT DISTINCT * FROM <\" + graph + \"> WHERE {?subject ?predicate ?object}\"\n }\n\n if (limit >= 1) { // if results per page is active\n data_query = data_query + \"\\n\" + \"OFFSET \" + offset + \"\\n\" + \"LIMIT \" + limit;\n }\n\n if (DOC.iSel(\"riID\").checked == true) {// if reasoning and inference is on\n data_query = \"DEFINE input:same-as\" + '\"yes\" \\n' + data_query;\n } else if (DOC.iSel(\"ruleNameID\").checked == true) {\n data_query = \"DEFINE input:inference\" + ' ' + \"'\" + DOC.iSel(\"infRuleNameID\").value + \"'\" + ' \\n' + data_query;\n }\n\n var endpoint = DOC.iSel(\"sparql_endpoint\").value + \"?default-graph-uri=&query=\";\n if (DOC.iSel(\"csvID\").checked == true) {\n var downloadURL = endpoint + encodeURIComponent(data_query) + \"&should-sponge=&format=text%2Fcsv\";\n } else if (DOC.iSel(\"xmlID\").checked == true) {\n var downloadURL = endpoint + encodeURIComponent(data_query) + \"&should-sponge=&format=application%2Fsparql-results%2Bxml\";\n }\n\n\n if (DOC.iSel(\"cmdID\").checked == true) {\n console.log(\"Retrieving CSV From: \" + downloadURL);\n console.log(\"Query: \" + data_query);\n }\n\n window.open(downloadURL);\n}", "async function getStatisticToPlan() {\n\n}", "static async getData() {\n const url = 'http://cparkchallenge.herokuapp.com/report/:lat/:long';\n\n return await fetch(url)\n .then(dataFromServer => dataFromServer.json());\n }", "async function hentData() {\n const respons = await fetch(link);\n products = await respons.json();\n vis(products);\n}", "function getData() {\n var queryParams = {\n propertySelection: \"179,7,10888003,8,\" + $scope.cfg.fieldIdToDisplay,//, // ids of fields to fetch\n queryExpression: \"'7' != 3\" //Status is not rejected\n //queryExpression: \"'8' != developer\" //Status is not rejected\n };\n\n var foo = rxRecordInstanceDataPageResource.withName($scope.cfg.recordDefinitionName);\n foo.get(100, 0, queryParams).then(\n function (allRecords) {\n $scope.myData = allRecords.data;\n }\n );\n }", "function extractData(html){\n let searchtool=cheerio.load(html);\n\n let part = searchtool('a[data-hover=\"View All Results\"]');\n let SourceLink=part.attr(\"href\");\n let FullLink=`https://www.espncricinfo.com${SourceLink}`;\n console.log(FullLink);\n\n //Now requesting on FullLink to obtain scorecard link array\n request(FullLink,AllScoreCardcb);\n}", "function getObjectData() {\n\n // console.log(\"Running getObjectData\");\n\n if (dbConnection) {\n\n var dbo = dbConnection;\n dbo\n .collection(\"stats\")\n .find(\n { name: \"lists\" },\n { projection: { _id: 0, objects: 1 } }\n )\n .toArray(function (err, result) {\n if (result && result[0] && result[0]['objects']) {\n var objectList = result[0]['objects'];\n } else {\n var objectList = [];\n }\n for (object of objectList) {\n objectApiCall(object)\n }\n if (err) throw err;\n });\n }\n\n}", "function getTrackingData(page) {\n\t\t\tif(self.selectedTransactionId){\n\t\t\t\tscaleMaintenanceApi.checkStatusFindOneTransaction({\n\t\t\t\t\ttransactionId: self.selectedTransactionId\n\t\t\t\t},{}).$promise.then(loadSingleData).catch(function(error) {\n\t\t\t\t\tfetchError(error);\n\t\t\t\t}).finally(function(){\n\t\t\t\t\tPMCommons.displayLoading(self, false);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tscaleMaintenanceApi.checkStatusFindAllTransactions({\n\t\t\t\t\tincludeCount: self.includeCounts,\n\t\t\t\t\tpage: page,\n\t\t\t\t\tpageSize: PAGE_SIZE\n\t\t\t\t}).$promise.then(loadData).catch(function(error) {\n\t\t\t\t\tfetchError(error);\n\t\t\t\t}).finally(function(){\n\t\t\t\t\tPMCommons.displayLoading(self, false);\n\t\t\t\t});\n\t\t\t}\n\t\t}", "function showAll() {\n console.log(buffer);\n var allItems = [];\n connection.query(\"SELECT item_id, product_name, department_name, price FROM products;\", function (err, res) {\n for (var i = 0; i < res.length; i++) {\n allItems.push(res[i])\n }\n console.table(allItems);\n // Browse function\n browse();\n });\n}", "function readDailyPlan() {\n //Fatal Jerryscript Error: ERR_OUT_OF_MEMORY -- Looks like even one bible chapter is too much for the watch's memory.\n text2 = readFileSync(\"/mnt/assets/resources/DailyPlan.json\", \"json\");\n}", "static async getAll() {\n let projection = {\n shipmentStatus: 1,\n referenceNo: 1,\n courier: 1,\n receivedBy: 1,\n nosOfSamples: 1\n };\n try {\n let result = await DatabaseService.getAll(collectionName, projection);\n return result;\n } catch (err) {\n throw err;\n }\n }", "async function getStatsData() {\n var res = await fetch(\"/stats/all\")\n var resp = await res.json();\n return resp\n}", "function fetchdata(){\n var n_src = new Array(\"associated-press\",\"bbc-news\",\"the-times-of-india\",\"bloomberg\",\"cnbc\",\"cnn\",\"the-next-web\",\"bbc-sport\",\"national-geographic\",\"reuters\",\"daily-mail\",\"the-hindu\",\"espn-cric-info\",\"\");\n var picker = 0;\n picker=random(12);\n var n = ceil(picker);\n source = n_src[n];\n\n urla = api_a+source+sortBy+sortingValue+api_key_a;\n loadJSON(urla,gotData);\n\n }", "async getTopAccessedPrinters(ts, te) {\n let token = localStorage.getItem(\"interset_token\");\n axios.defaults.headers.common['Authorization'] = token;\n // console.log(ts);\n let url = `${API_URL}/api/search/0/printers/topAccessed?sort=maximum&markup=false&tz=UTC%2B8&count=10&keepAlive=300000`\n if((ts!==0) && (te!==0)){\n url = url + '&ts=' + ts + '&te=' + te;\n }\n const response = await axios.get(url);\n // console.log(Object.keys(response.data.data));\n let rData = [];\n let data = response.data.data;\n let keys = Object.keys(data);\n // console.log(keys);\n \n for(let i=0; i<keys.length; i++){\n let key = keys[i];\n let kData = data[key]\n for(let j=0; j<kData.length; j++){\n kData[j]['accessed'] = key; \n rData.push(kData[j]);\n }\n }\n return rData;\n }", "function getData() {\n d3.json(\"samples.json\").then(data => {\n\n // retrieve data\n let samples = data.samples.map(samples => { return samples })\n let metaData = data.metadata.map(metadata => { return metadata })\n\n // filter data\n let filteredData = samples.filter(idFilter)\n let filteredMetaData = metaData.filter(idFilter)\n\n // update charts and demo info panel\n updateCharts(filteredData, filteredMetaData[0].wfreq)\n updateDemoInfo(filteredMetaData[0])\n })\n}", "static async currentsReports (limit) {\n const currentLimit = limit || 5;\n // Retrieve instance of Mongo\n const db = await Mongo.instance().getDb();\n\n // Find only the field required.\n const result = await db\n .collection(collections.REPORT_COLL)\n .find(\n {},\n {\n projection: {\n _id: 1,\n name: 1,\n operator: 1,\n createdAt: 1,\n updatedAt: 1\n }\n }\n )\n // Sorting and Limit the numbers of reports.\n .sort({ createdAt: -1 })\n .limit(currentLimit)\n .toArray();\n\n return result;\n }", "function retrievePackageData(page){\n let url = flutter_source_url_arg_page + page;\n let options= {\n url: url,\n gzip: true,\n headers: {\n 'User-Agent' : 'pub.flutter-io.cn'\n }\n };\n request.get(options, (err, response, body) => {\n //response from remote http server\n if(err){\n console.error(currentTimestamp() + 'encountered error while requesting package information from remote server, message:' + err.toString());\n console.log('retry checking current page-->' + page);\n eventHandler.emit('checkPage', page);\n }else {\n console.log('cache package data');\n\n fs.appendFile(__dirname + '/logs/' + currentTimestamp() + '.dartlang.log', body, { encoding: \"utf8\", mode: 0o666, flag: \"a\" }, (err) => {\n if (err) console.error(currentTimestamp() + 'encountered error while caching package list, e-->' + err.message);\n console.log('file cached');\n });\n\n let data = JSON.parse(body);\n if(typeof(data.packages) !== 'undefined' && data.packages.length > 0){\n if(page == 1){\n console.log('cache legacy_package -->' + show_package_info(data.packages[0]));\n console.log('cache tmp_pkg_map');\n\n let pkg_list = data.packages;\n tmp_pkg_map = new Map();//reset temporary package map to clean up the cached data\n for(let i=0; i<pkg_list.length; i++){\n let pkg = pkg_list[i];\n tmp_pkg_map.set(pkg.name, pkg);\n }\n }\n if(pkg_map == null){\n //initialize first package\n console.log('initializing pkg_map, refreshing cdn after service being restarted');\n\n let pkg_list = data.packages;\n pkg_map = new Map();\n tmp_pkg_map = new Map();\n extra_pkg_map = new Map();\n\n for(let i=0; i<pkg_list.length; i++){\n let pkg = pkg_list[i];\n pkg_map.set(pkg.name, pkg);\n // extra_cache.push(pkg);\n }\n isProcessing = false;\n }else{\n if(traversePackages(data)){\n //found previous package\n console.log('found start point of last checking round , reset pkg_map & stop processing');\n page = -1;\n eventHandler.emit('checkPage', page);\n }else{\n //target package not found, check next page\n page +=1;\n console.log('target package not found, check next page-->' + page);\n eventHandler.emit('checkPage', page);\n }\n\n }\n\n }//end of processing block\n }\n });\n}", "function getData(launches) {\n selectionHeading.innerText = `${launches[0].toUpperCase() + launches.slice(1)} launches`;\n fetch(`https://spacelaunchnow.me/api/3.3.0/launch/${launches}/?limit=200`)\n .then(res => res.json())\n .then(data => addDataToDOM(data, launches)); \n}", "function getDataFromInstrument() {\n var reportData = \"Version,Hostname (IP),Error Type,Error Date,Comments,Last Reboot\\n\";\n DashboardService.getFileNames($scope.selectedInst.instType)\n .success(function (fileNames) {\n for(i in fileNames){\n if(fileNames[i].includes(\".csv\")){\n DashboardService.readFile($scope.selectedInst.instType + '/' + fileNames[i])\n .success(function (response) {\n reportData += response;\n $scope.tableData = DashboardService.processData(reportData);\n })\n }\n }\n if(reportData.length === 65){\n $scope.tableData = DashboardService.processData(reportData);\n }\n });\n }", "function getData() {\n let covidApiEndpoint = 'https://disease.sh/v3/covid-19/countries/?q=yesterday';\n\n httpRequest(covidApiEndpoint, storeData);\n}", "static async fetchAll() {\n const results = await db.query(\n `\n SELECT ntr.id,\n ntr.name,\n ntr.category,\n ntr.quantity,\n ntr.calories,\n ntr.image_url,\n ntr.user_id AS \"userId\",\n u.email AS \"userEmail\",\n ntr.timestamp AS \"timestamp\" \n FROM nutrition AS ntr\n JOIN users AS u ON u.id = ntr.user_id\n ORDER BY ntr.timestamp DESC \n `\n )\n return results.rows\n }", "function getSampleSheet(){\n const clientPromise = stitch.StitchClientFactory.create('dataretrieval-vwdtg'); \n clientPromise.then(stitchClient =>{\n client = stitchClient;\n db = client.service('mongodb', 'mongodb-atlas').db('data');\n client.login()\n db.collection('sample').find({}).execute().then(result => {\n sampleSheet = result;\n \n })\n }); \n }", "getSummary() {\n return {\n uuid: this.uuid,\n downloadPath: this.downloadPath,\n type: this.type,\n name: this.name,\n size: this.size,\n completeSize: this.completeSize,\n count: this.count,\n finishCount: this.finishCount,\n restTime: this.restTime,\n finishDate: this.finishDate,\n trsType: this.trsType,\n state: this.state,\n pause: this.pause,\n speed: this.speed\n }\n }", "function getPrograms() {\n var url = \"https://api.myjson.com/bins/5bdb3\";\n return getData(url, displayGraphs);\n}", "async function getPermits(start,end,offset,limit){\n return new Promise((resolve,reject ) => {\n console.log('sending request to get permits ', start, end,offset,limit)\n const options = {\n host: 'data.cityofnewyork.us',\n path: '/resource/83x8-shf7.json?$limit=' + limit + '&$offset=' + offset +\n \"&$where=\" + encodeURIComponent(\"filing_date between '\" + start +\"' and '\" + end +\"'\")\n + \"&$$app_token=CPY5bSHYeai7igs8WfzssXyP4\" \n\n };\n var data = \"\";\n const req = https.get(options, (res) => {\n //console.log(res);\n res.on('data',(d)=>{\n data += d;\n })\n \n res.on('end',()=>{\n //console.log(data);\n resolve(JSON.parse(data));\n })\n });\n\n req.on('error', (e) => {\n reject(e.message);\n });\n })\n}", "function getCpuData () {\r\n fetch('http://exercise.develop.maximaster.ru/service/cpu/')\r\n .then(response => {\r\n let data = response.json();\r\n return data;\r\n })\r\n .then(data => {\r\n if (data === 0) { errorsCounter++; }\r\n addData(data);\r\n })\r\n .catch(error => console.error(error));\r\n\r\n // stats\r\n let percent = Math.floor(100 * errorsCounter / requestsCounter);\r\n requestsStats.innerHTML = requestsCounter++;\r\n errorsPercent.innerHTML = `${percent}%`;\r\n}", "function getInfo() {\n // read the json file to get data\n var selector = d3.select(\"#selDataset\");\n\n d3.json(\"samples.json\").then((data)=> {\n \n //Get the metadata info for the demographic panel\n var sampleNames = data.names;\n\n //console.log(metadata)\n\n //Filter metadata info by id\n sampleNames.forEach((sample)=>{\n selector\n .append(\"option\")\n .text(sample)\n .property(\"value\", sample);\n });\n\n var firstvalue = sampleNames[0];\n buildCharts(firstvalue);\n buildData(firstvalue);\n });\n \n}", "function printCollectedDeviceData(results) {\n var dataToKeep = {\n 'AIN0': 'val',\n 'FIRMWARE_VERSION': 'val',\n 'WIFI_IP': 'str',\n 'ETHERNET_IP': 'str',\n 'WIFI_RSSI': 'str',\n 'WIFI_VERSION': 'val',\n 'SERIAL_NUMBER': 'val',\n 'HARDWARE_INSTALLED': 'productType',\n };\n var vals = [];\n results.forEach(function(result) {\n result = result.data;\n var data = {};\n var keyToKeep = 'res';\n if(dataToKeep[result.name]) {\n keyToKeep = dataToKeep[result.name];\n }\n data[result.name] = result.res;\n if(result[keyToKeep]) {\n data[result.name] = result[keyToKeep];\n }\n vals.push(data);\n });\n\n if(DEBUG_COLLECTED_DEVICE_DATA) {\n console.log('Connection Type', self.curatedDevice.savedAttributes.connectionTypeName);\n console.log('Serial Number', self.curatedDevice.savedAttributes.serialNumber);\n console.log('Read Data', self.curatedDevice.getDevice().handle,':');\n console.log(vals);\n }\n }", "function currentData() {\n const begin = (currentPage - 1) * itemsPerPage;\n const end = begin + itemsPerPage;\n return data.slice(begin, end);\n }", "function showMillion() {\n listData = listData.filter(el => {\n return el.wealth > 1000000;\n });\n renderList();\n}", "function fetchReadings (knex, req, res)\n{\n var data = req.body;\n\n knex\n .select()\n .from('patient_' + data.id)\n .then(function (results) {\n var ret = {\n csv: ''\n };\n var cnt = 0;\n Array.prototype.forEach.call(results, function (row)\n {\n var rowParse = '';\n for (var key in row)\n {\n if (key == 'timestamp')\n rowParse += row[key];\n else\n rowParse += ',' + row[key];\n }\n cnt++;\n if (cnt != results.length)\n rowParse += '\\n';\n ret.csv += rowParse;\n });\n util.respond(res, 200, ret);\n });\n}", "function grabTableData2() {\n var cache1 = CacheService.getDocumentCache();\n var dataForChart = (cache1.get('rankData'));\n// var testValue = JSON.parse(dataForChart);\n// Logger.log('return:' + testValue);\n return dataForChart;\n }// grabTableData2() function end", "async function getData() {\n request.open('GET',\n 'https://services1.arcgis.com/0n2NelSAfR7gTkr1/arcgis/rest/services/Business_Licenses/FeatureServer/0/query?where=FID' + ' > ' + lastFID + ' AND FID <= ' + (lastFID + 500) + '&outFields=*&outSR=4326&f=json',\n true);\n\n //comment out the following line to quickly edit ui without making requests\n request.send();\n}", "async getHighlightsData(gamePk, gameDate) {\n try {\n this.debuglog('getHighlightsData for ' + gamePk)\n\n let cache_data\n let cache_name = 'h' + gamePk\n let cache_file = path.join(this.CACHE_DIRECTORY, cache_name+'.json')\n let currentDate = new Date()\n if ( !fs.existsSync(cache_file) || !this.cache || !this.cache.highlights || !this.cache.highlights[cache_name] || !this.cache.highlights[cache_name].highlightsCacheExpiry || (currentDate > new Date(this.cache.highlights[cache_name].highlightsCacheExpiry)) ) {\n let reqObj = {\n url: 'https://statsapi.mlb.com/api/v1/game/' + gamePk + '/content',\n headers: {\n 'User-agent': USER_AGENT,\n 'Origin': 'https://www.mlb.com',\n 'Accept-Encoding': 'gzip, deflate, br',\n 'Content-type': 'application/json'\n },\n gzip: true\n }\n var response = await this.httpGet(reqObj, false)\n if ( response && this.isValidJson(response) ) {\n //this.debuglog(response)\n cache_data = JSON.parse(response)\n this.save_json_cache_file(cache_name, cache_data)\n\n // Default cache period is 1 hour from now\n let oneHourFromNow = new Date()\n oneHourFromNow.setHours(oneHourFromNow.getHours()+1)\n let cacheExpiry = oneHourFromNow\n\n let today = this.liveDate()\n let yesterday = this.yesterdayDate()\n if ( gameDate == today ) {\n if ( (cache_data.media) && (cache_data.media.epg) ) {\n for (var i = 0; i < cache_data.media.epg.length; i++) {\n if ( cache_data.media.epg[i].items && cache_data.media.epg[i].items[0] && cache_data.media.epg[i].items[0].mediaState && (cache_data.media.epg[i].items[0].mediaState == 'MEDIA_ON') ) {\n this.debuglog('setting cache expiry to 5 minute due to in progress games')\n currentDate.setMinutes(currentDate.getMinutes()+5)\n cacheExpiry = currentDate\n break\n }\n }\n }\n } else if ( gameDate < today ) {\n this.debuglog('1+ days old, setting cache expiry to forever')\n cacheExpiry = new Date(8640000000000000)\n }\n\n // finally save the setting\n this.setHighlightsCacheExpiry(cache_name, cacheExpiry)\n } else {\n this.log('error : invalid json from url ' + reqObj.url)\n }\n } else {\n this.debuglog('using cached highlight data')\n cache_data = this.readFileToJson(cache_file)\n }\n if (cache_data && cache_data.highlights && cache_data.highlights.highlights && cache_data.highlights.highlights.items) {\n var array = cache_data.highlights.highlights.items\n return array.sort(this.GetSortOrder('date'))\n }\n } catch(e) {\n this.log('getHighlightsData error : ' + e.message)\n }\n }", "fetch() {\n var dataPromise = this.request.fetch().then((response) => {\n var output = {};\n if (isObject(response)) {\n response\n .filter(source => source.notPathwayData == false)\n .map((ds) => {\n var name = (ds.name.length > 1) ? ds.name[1] : ds.name[0];\n output[ds.uri] = {\n id: ds.identifier,\n uri: ds.uri,\n name: name,\n description: ds.description,\n type: ds.type\n };\n });\n } else {\n output = null;\n }\n return output;\n }).catch(() => {\n return null;\n });\n\n this.data = dataPromise;\n return dataPromise;\n }", "function getData() {\n\tvar query = \"http://api.nytimes.com/svc/search/v2/articlesearch.json?q=\" + search + \"&api-key=\" + key;\n\trequest({\n\t\turl: query,\n\t\tjson: true\n\t}, \n\tfunction(error, response, data) {\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\t\tvar urls = [];\n\t\tvar docs = data.response.docs;\n\t\tfor (var d in docs) {\n\t\t\turls.push(docs[d].web_url);\n\t\t}\n\t\tconsole.log(urls);\n\t});\n}", "getTablesWithData(){\n\treturn this.query(\"CREATE TABLE #temp (table_name sysname, row_count INT, reserved_size VARCHAR(50), data_size VARCHAR(50), index_size VARCHAR(50), unused_size VARCHAR(50)) SET NOCOUNT ON INSERT #temp EXEC sp_msforeachtable 'sp_spaceused ''?''' SELECT a.table_name, a.row_count, COUNT(*) AS col_count, a.data_size FROM #temp a INNER JOIN information_schema.columns b ON a.table_name collate database_default = b.table_name collate database_default WHERE a.row_count > 0 GROUP BY a.table_name, a.row_count, a.data_size ORDER BY CAST(REPLACE(a.data_size, ' KB', '') AS integer) DESC DROP TABLE #temp;\") \n }", "async function getPapersChunk (offset) {\n const cursor = await config.db.query(`\n FOR doc IN PaperDev\n SORT doc.createDate ASC\n LIMIT ${offset}, 1000\n RETURN doc\n `)\n return cursor.all()\n}", "static fetchData() {\n return Promise.all([\n Repository.getObject('2.0.0'),\n Repository.getObject('2.1.0'),\n Repository.getObject('1.3.0')\n ]).then((results) => {\n let object200 = results[0].toJS();\n let object210 = results[1].toJS();\n let coreAsset = results[2].toJS();\n return {\n head_block_number: object210.head_block_number,\n last_irreversible_block_num: object210.last_irreversible_block_num,\n recently_missed_count: object210.recently_missed_count,\n time: object210.time,\n block_interval: object200.parameters.block_interval,\n coreAsset: coreAsset,\n latestFetchedBlocks: []\n };\n });\n }", "fetchData() {\n this.initLoading();\n\n this.setFilters(this.qs_url, this.generateBaseFilters());\n this.data.filters = this.getFilters(this.qs_url);\n\n let qs = this.setQuerySet(this.view, this.qs_url).filter(this.getFiltersPrepared(this.qs_url)).prefetch();\n this.setQuerySet(this.view, this.qs_url, qs);\n\n this.getInstancesList(this.view, this.qs_url).then(instances => {\n this.setLoadingSuccessful();\n\n this.setInstancesToData(instances);\n\n if(this.view.schema.autoupdate) {\n this.startAutoUpdate();\n }\n\n }).catch(error => {\n this.setLoadingError(error);\n });\n\n this.getParentInstancesForPath();\n }", "function getOverview() {\n db.collection(\"overview_visitor\")\n .get()\n .then(function(querySnapshot) {\n querySnapshot.forEach(function(doc) {\n // doc.data() is never undefined for query doc snapshots\n console.log(\"Your document data is: \", doc.data());\n overview = doc.data();\n displayRecentDonors();\n displayTopDonors();\n });\n })\n .catch(function(error) {\n console.log(\"Error getting documents: \", error);\n });\n}", "function read_data(){\n let sql_read = \"SELECT DISTINCT(score),name FROM score ORDER BY score DESC LIMIT 5 ;\";\n return new Promise((resolve, reject) => {\n db.query(sql_read, (err, result) => {\n resolve(JSON.stringify(result));\n });\n });\n}", "function getPreliminaryData() {\n return getIDs(15, 0);\n }", "function getData(pageId) {\n let thisUrl = fullUrl + `?page=${pageId}`;\n return axios.get(\n thisUrl,\n );\n}", "function getHITData(dataDate, cache) {\r\n var page;\r\n var data;\r\n var status = {hits:0,rewards:0, full_pages:0, full_page_rewards: 0, pages_fetched: 0, time: 0};\r\n if (typeof dataDate == 'undefined') dataDate = format_date(convert_timezone(new Date()));\r\n if (typeof cache == 'undefined') cache = true;\r\n\r\n if (localStorage[\"STATUS \" + dataDate]) {\r\n status = JSON.parse(localStorage[\"STATUS \" + dataDate]);\r\n if (status.time && (status.time > convert_timezone(new Date()).getTime() - 43200000 )) {\r\n page = status.full_pages+1;\r\n status.hits = status.full_pages*25;\r\n status.rewards = status.full_page_rewards;\r\n status.pages_fetched = 0;\r\n }\r\n else {\r\n status = {hits:0,rewards:0, full_pages:0, full_page_rewards: 0, pages_fetched: 0, time: 0};\r\n }\r\n }\r\n else {\r\n page = 1;\r\n }\r\n for(page; page < 150; page++)\r\n {\r\n detailed_status_page_link = \"https://www.mturk.com/mturk/statusdetail?sortType=All&pageNumber=\" + page + \"&encodedDate=\" + dataDate; \r\n data = process_page(detailed_status_page_link);\r\n status.pages_fetched += 1;\r\n\r\n if (data.hits == 0)\r\n break;\r\n\r\n if (data.hits == 25) {\r\n status.full_pages += 1;\r\n status.full_page_rewards += data.rewards;\r\n }\r\n status.hits += data.hits;\r\n status.rewards += data.rewards;\r\n \r\n }\r\n status.time = convert_timezone(new Date()).getTime();\r\n\r\n if (cache) {\r\n localStorage[\"STATUS \" + dataDate] = JSON.stringify(status);\r\n }\r\n return status;\r\n}", "async fetchTopArtist() {\n const res = await fetch(`//ws.audioscrobbler.com/2.0/?method=chart.gettopartists&api_key=77730a79e57e200de8fac0acd06a6bb6&format=json`)\n const data = await res.json()\n console.log(data);\n }", "metricsFromEmbeddedReport(){\n const { file, schemas } = this.props;\n const commonProps = { 'metric' : file.quality_metric, 'tips' : object.tipsFromSchema(schemas, file.quality_metric) };\n return (\n <div className=\"overview-list-elements-container\">\n <QCMetricFromEmbed {...commonProps} qcProperty=\"Total reads\" fallbackTitle=\"Total Reads in File\" />\n <QCMetricFromEmbed {...commonProps} qcProperty=\"Total Sequences\" />\n <QCMetricFromEmbed {...commonProps} qcProperty=\"Sequence length\" />\n <QCMetricFromEmbed {...commonProps} qcProperty=\"Cis reads (>20kb)\" percent />\n <QCMetricFromEmbed {...commonProps} qcProperty=\"Short cis reads (<20kb)\" percent />\n <QCMetricFromEmbed {...commonProps} qcProperty=\"Trans reads\" fallbackTitle=\"Trans Reads\" percent />\n <QCMetricFromEmbed {...commonProps} qcProperty=\"Sequence length\" />\n <QCMetricFromEmbed {...commonProps} qcProperty=\"overall_quality_status\" fallbackTitle=\"Overall Quality\" />\n <QCMetricFromEmbed {...commonProps} qcProperty=\"url\" fallbackTitle=\"Link to Report\" />\n </div>\n );\n }", "function getReleaseData() {\n\t\tconst newReleaseURL = `${newReleaseOptions.api}${newReleaseOptions.endpoint}?api_key=${newReleaseOptions.key}&format=${newReleaseOptions.format}&limit=${newReleaseOptions.limit}&sort=${newReleaseOptions.sort}&filter=expected_release_year:${newReleaseOptions.filterYear},expected_release_month:${newReleaseOptions.filterMonth}`;\n\n\t\tfetch('https://cors-anywhere.herokuapp.com/' + newReleaseURL)\n\t\t\t.then((response) => response.json())\n\t\t\t.then((response) => {\n\t\t\t\tsetReleaseData(response.results);\n\t\t\t})\n\t\t\t.catch(alert.error);\n\t}", "function getStructuredData () {\n let data = [];\n data.push((getCareerName()) ? getCareerName() : \"\");\n document.querySelectorAll(\"table#tabla_expediente[data-role=table]\").forEach((item) => {\n data.push({\n title: getTitleFromTable(item),\n data: getDataFromTable(item),\n });\n });\n if (data.length > 1)\n return data;\n }", "function loadPerformances() {\n API.getPerformances()\n .then(res =>\n setPerformances(res.data)\n (allPerformances = res.data)\n )\n .catch(error => console.log(error));\n }", "parseData(response, query) {\n const index = this.getIndex(response);\n let data = {\n index: index,\n docs: []\n };\n\n const parsedDocs = this.parseDocs(response.response.docs, index, query);\n if (parsedDocs.length) {\n data.docs = parsedDocs;\n }\n\n return data;\n }", "handleDownload(data) {\n let freeSpace = '______________________'; \n let reportPresent = ''; let evidences = '';\n let sortedData = data.map((answer) => answer ? answer : freeSpace); \n \n if (sortedData[19] != 'lack_of_info') {reportPresent = `Винуватцем в ДТП є Відповідач, що підтверджується Протоколом про адміністративне правопорушення ${sortedData[19]} яким його визнали винним у вчиненні адміністративного правопорушення, передбаченого статтею 124 КУпАП.`;};\n \n if (sortedData[20] == 1 || sortedData[21] == 1) {if (sortedData[20] == 1 && sortedData[21] == 1) {evidences = 'Також на підтвердження того, що винуватцем в ДТП є саме Відповідач надаємо матеріали з відеореєстратора та відповідні показання свідків.';} else if (sortedData[20] == 1) {evidences = 'Також на підтвердження того, що винуватцем в ДТП є саме Відповідач надаємо матеріали з відеореєстратора.';} else if (sortedData[21] == 1) {evidences = 'Також на підтвердження того, що винуватцем в ДТП є саме Відповідач надаємо відповідні показання свідків.';};};\n \n const claim = {\n defaultStyle: {\n font: 'georgia'\n },\n content:[\n { stack:\n [{text:'До ' + freeSpace + ' (назва суду)'},\n {text: [{text:'Позивач: '}, sortedData[0]], margin:[0,20,0,0]},\n {text: sortedData[1], margin:[55,0,0,0]},\n {text: sortedData[2], margin:[55,0,0,0]},\n {text: sortedData[3], margin:[55,0,0,0]},\n {text:[{text:'Відповідач: '}, sortedData[4]], margin:[-12,20,0,0]},\n {text: sortedData[5], margin:[55,0,0,0]},\n {text: sortedData[6], margin:[55,0,0,0]},\n {text: sortedData[7], margin:[55,0,0,0]},\n {text:'Дата: ' + freeSpace, margin:[10,20,0,0]},\n {text:'Ціна позову ' + freeSpace +' грн.', margin:[0,10,0,0]}\n ],margin:[250,0,0,0]},\n {stack:[\n {text:'ПОЗОВНА ЗАЯВА', fontSize:25, margin:[85,20,0,0]},\n {text:'про відшкодування шкоди, заподіяної джерелом підвищеної небезпеки', fontSize:13}],\n margin:[65,20,0,0]},\n {text:'Обставини справи', margin:[30,30,0,0]},\n {text: `ДТП відбулося ${sortedData[9]} за адресою ${sortedData[8]} між транспортним засобом ${sortedData[10]}, який належить (на праві ${sortedData[11]}) Позивачу та транспортним засобом ${sortedData[12]}, який належить (на праві ${sortedData[13]}) Відповідачу. Внаслідок ДТП пошкоджено майно, яке належить Позивачу, а саме: ${sortedData[14]}, державний номер: ${sortedData[15]}.`,margin:[0,30,0,0],alignment:'justify'\n },\n reportPresent ? {text: reportPresent,margin:[0,20,0,0],alignment:'justify'} : '',\n evidences ? {text: evidences,margin:[0,20,0,0],alignment:'justify'} : '',\n {text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',margin:[0,20,0,0],alignment:'justify'},\n {text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',margin:[0,20,0,0],alignment:'justify'},\n {text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla auctor pharetra velit, quis finibus lorem venenatis a. Donec dolor neque, vestibulum eget rhoncus eu, hendrerit sit amet nunc. Sed posuere neque et ornare rhoncus. Nullam vitae elit erat. Suspendisse faucibus tristique quam, in auctor mauris. Mauris molestie odio feugiat volutpat cursus. Pellentesque sit amet urna et felis tincidunt maximus. Curabitur viverra at mi at ornare. Sed finibus eu nisi vitae rutrum. Integer purus nisi, ornare at pellentesque et, maximus eget magna. Suspendisse et elit congue, tincidunt odio ac, pharetra mi.',margin:[0,20,0,0],alignment:'justify'},\n {text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',margin:[0,20,0,0],alignment:'justify'},\n {text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',margin:[0,20,0,0],alignment:'justify'},\n {text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',margin:[0,20,0,0],alignment:'justify'},\n {stack:[\n {text:'ПРОШУ',fontSize:25,margin:[85,0,0,0]},\n {text:`1. Lorem ipsum dolor sit amet, consectetur adipiscing elit.`,fontSize:13, margin:[0,20,0,0], alignment:'justify'},\n {text:'2. Lorem ipsum dolor sit amet, consectetur adipiscing elit.', fontSize:13, alignment:'justify'},\n ],\n margin:[25,50,0,0]},\n {stack:[\n {text:'Додатки:'},\n {text:'Оригінал квитанції про сплату судового збору;'},\n {text:'Докази відправлення позовної заяви з додатками учасникам процесу;'},\n reportPresent ? {text:`Копія Протоколу про адміністративне правопорушення ${sortedData[19]};`} : '',\n {text:`Копія технічного паспорту транспортного засобу Позивача ${sortedData[10]} державний номер ${sortedData[15]};`},\n {text:'Копія документу, що посвідчує особу;'},\n sortedData[20] == 1 ? {text: 'Копія запису відеоматеріалів з відео реєстратора який зафіксував момент ДТП;',margin:[0,20,0,0],alignment:'justify'} : '',\n sortedData[21] == 1 ? {text: 'Копія показань свідків, що ДТП сталось з вини Відповідача;',margin:[0,20,0,0],alignment:'justify'} : ''\n ],margin:[0,60,0,0]},\n {text:'_____________ (Дата) ______________(Підпис)',margin:[50,60,0,0]}\n ]\n };\n pdfMake.fonts = {\n georgia:{\n normal:\"georgia.ttf\"\n }\n }\n pdfMake.createPdf(claim).download('тестовий_варіант_1.pdf'); \n }", "function collectors(n){\n\tvar url = \"https://\"+user+\":\"+password+\"@\"+apiUrl+\"collectors?limit=\"+pageLimit+\"&offset=\"+n\n\treturn fetch(url)\n}", "async function getData() {\n const response = await fetch(filename);\n const data = await response.text();\n // const years=[];\n // const temps = [];\n // const rows = data.split('\\n').slice(1);\n // rows.forEach(row => {\n // const cols = row.split(',');\n // years.push(cols[0]);\n // temps.push(parseFloat(cols[1])+14);\n // })\n const lines = data.split('\\n');\n lines.pop();\n return lines;\n}", "allAvailableDownloads() {\n let request_header = {\"Content-Type\": \"application/json\"};\n let response = request('GET', `${this.baseUrl}?nv=1`, {headers: request_header});\n let allDownloads = JSON.parse(response.getBody().toString('utf8'));\n\n let productNames = [];\n allDownloads.forEach(function (item) {\n productNames.push({['name']: item.name, ['productCode']: item.productCode});\n });\n return new Map(productNames.map((i) => [i.name, i.productCode]));\n }", "function getPageUsers(){\n \n let usersList = document.querySelectorAll('._3cb8');\n\n exportPageUsersInfo(usersList);\n \n\n}", "function coinCapFetch() {\n var request = UrlFetchApp.fetch(\"https://api.coincap.io/v2/assets?limit=2000\");\n var response = request.getContentText();\n var data = JSON.parse(response);\n return data.data;\n}", "getDrugData(data, keyStore, type, drug) {\r\n const querySamples = generateSampleString(data, keyStore);\r\n let urlString = `/api/drugs/filter?sample=${querySamples}`;\r\n if (type === 'drugsData1' && drug) urlString = urlString.concat(`&drugId=${drug}`);\r\n if (type === 'drugsData2' && drug) urlString = urlString.concat(`&drugId=${drug}`);\r\n fetch(urlString)\r\n .then(response => response.json())\r\n .then((drugData) => {\r\n const drugsData = drugData.map(item => ({ value: item.idDrug, label: item.name }));\r\n if (type === 'drugsData1') this.setState({ [type]: drugsData, loadingDrug1: false, focus: 'sample-drug' });\r\n if (type === 'drugsData2') this.setState({ [type]: drugsData, loadingDrug2: false, focus: 'button' });\r\n // eslint-disable-next-line no-console\r\n }).catch(err => console.log(err));\r\n }", "async GetAllData(ctx) {\n const allResults = [];\n // This is for a test, to see all the data in the world state.\n const iterator = await ctx.stub.getStateByRange('', '');\n let result = await iterator.next();\n while (!result.done) {\n const strValue = Buffer.from(result.value.value.toString()).toString('utf8');\n let record;\n try {\n record = JSON.parse(strValue);\n } catch (err) {\n console.log(err);\n record = strValue;\n }\n allResults.push({ Key: result.value.key, Record: record });\n result = await iterator.next();\n }\n return JSON.stringify(allResults);\n }", "async function get_info_from_tpdb(actor_name, settings) {\r\n $log(\"[AMDX] MSG: START TPDB Data Extraction\");\r\n let result = {\r\n 'id': 'tpdb',\r\n 'img_urls': [],\r\n 'bio': new Set()\r\n };\r\n const tpdb_perf_search_url = `https://master.metadataapi.net/api/performers?q=${encodeURI(actor_name)}`;\r\n const tpdb_perf_search_response = (await $axios.get(tpdb_perf_search_url, { validateStatus: false }));\r\n if (tpdb_perf_search_response.status != 200 || tpdb_perf_search_response.data === undefined) {\r\n $log(\"[AMDX] ERR: TPDB API query failed\");\r\n return result;\r\n }\r\n const tpdb_perf_search_content = tpdb_perf_search_response.data;\r\n // TPDB returns fuzzy matches if actor name does not match\r\n // Ensure the correct result is selected if user requested an exact match.\r\n // Else pick the first result that appears in the response.\r\n let correct_perf_idx = -1;\r\n if (tpdb_perf_search_content.data.length == 1 && !settings.extract_only_if_source_matches_name_exactly) {\r\n correct_perf_idx = 0;\r\n }\r\n if (tpdb_perf_search_content.data.length >= 1 && settings.extract_only_if_source_matches_name_exactly) {\r\n for (let idx = 0; idx < tpdb_perf_search_content.data.length; idx++) {\r\n const element = tpdb_perf_search_content.data[idx];\r\n if (element.name === actor_name) {\r\n correct_perf_idx = idx;\r\n break;\r\n }\r\n }\r\n }\r\n if (correct_perf_idx == -1) {\r\n $log(\"[AMDX] ERR: TPDB Could NOT find correct actor info\");\r\n return result;\r\n }\r\n const tpdb_perf_search_data = tpdb_perf_search_content.data[correct_perf_idx];\r\n // Get initial Bio from search result\r\n if (tpdb_perf_search_data.bio !== \"\") {\r\n result['bio'].add(tpdb_perf_search_data.bio);\r\n }\r\n // Get Image and Thumbnail from search result\r\n result['img_urls'].push(tpdb_perf_search_data.image);\r\n result['img_urls'].push(tpdb_perf_search_data.thumbnail);\r\n const tpdb_perf_url = `https://master.metadataapi.net/api/performers/${tpdb_perf_search_data.id}`;\r\n const tpdb_perf_response = (await $axios.get(tpdb_perf_url, { validateStatus: false }));\r\n if (tpdb_perf_response.status != 200 || tpdb_perf_response.data === undefined) {\r\n $log(\"[AMDX] ERR: TPDB Direct Actor Information Access Failed\");\r\n return result;\r\n }\r\n const perf_data = tpdb_perf_response.data.data;\r\n if (perf_data === undefined) {\r\n $log(\"[AMDX] ERR: TPDB Could NOT read actor information\");\r\n return result;\r\n }\r\n // Add actor bio if user requested all bio\r\n if (perf_data.bio !== \"\" && settings.get_all_bios) {\r\n result['bio'].add(perf_data.bio);\r\n }\r\n // Add all extra from TPDB to extra_info for Custom Field processing later\r\n result['extra_info'] = perf_data.extras;\r\n result['alias_list'] = perf_data.aliases;\r\n // Ensure duplicate URLs are not added\r\n // w/ TPDB it's usually the same image everywhere :/\r\n if (!result['img_urls'].includes(perf_data.image)) {\r\n result['img_urls'].push(perf_data.image);\r\n }\r\n if (!result['img_urls'].includes(perf_data.thumbnail)) {\r\n result['img_urls'].push(perf_data.thumbnail);\r\n }\r\n // Read poster URLs\r\n perf_data.posters.forEach(element => {\r\n if (!result['img_urls'].includes(element['url'])) {\r\n result['img_urls'].push(element['url']);\r\n }\r\n });\r\n // Get all bios and image URLs if requested by user\r\n if (settings.get_all_bios || settings.get_all_images) {\r\n perf_data.site_performers.forEach(element => {\r\n if (settings.get_all_bios && element.bio !== \"\") {\r\n result['bio'].add(element.bio);\r\n }\r\n if (settings.get_all_images && !result['img_urls'].includes(element.image)) {\r\n result['img_urls'].push(element.image);\r\n }\r\n if (settings.get_all_images && !result['img_urls'].includes(element.thumbnail)) {\r\n result['img_urls'].push(element.thumbnail);\r\n }\r\n });\r\n }\r\n $log(\"[AMDX] MSG: END TPDB Data Extraction\");\r\n return result;\r\n }", "function gotContent(data){\r\n let page = data.query.pages; \r\n //console.log(page);\r\n let pageID = Object.keys(data.query.pages)[0];\r\n console.log(pageID);\r\n\r\n let content = page[pageID].revisions[0][\"*\"];\r\n startOfContentChar = \"'''\"\r\n startCharIndex = content.search(startOfContentChar) + 3;\r\n console.log(startCharIndex);\r\n endCharIndex = startCharIndex + 200 + 1;\r\n description = content.substring(startCharIndex, endCharIndex) + '...'\r\n document.getElementById('contentDisplay').innerHTML =description;\r\n //console.log(content); \r\n // access summary brute force \r\n //let summary = page[pageID].revisions[0][\"*\"][10];\r\n //console.log('SUMMARY' + summary);\r\n }", "static async getAllSeries(){\n const results = await axios.get('./sample.json')\n const all = results.data.entries;\n const series = all.filter(show=>(show.programType === \"series\"))\n const ordered = series.sort((a,b) => a.title > b.title ? 1 : -1);\n return ordered;\n }", "async function GetDocumentAnalysisResults() {\n let maxResults = 1000;\n let paginationToken = null;\n let finished = false;\n\n let keyMap = {};\n let valueMap = {};\n let blockMap = {};\n\n let blockMapTable = {};\n let table_blocks = [];\n\n\n while (finished == false) {\n let response = null;\n let documentAnalysisRequest = {\n JobId: startJobId,\n MaxResults: maxResults,\n NextToken: paginationToken\n };\n\n response = await new Promise((resolve, reject) => {\n textract.getDocumentAnalysis(documentAnalysisRequest, (err, data) => {\n if (err) {\n reject(err);\n } else {\n resolve(data);\n }\n });\n });\n\n let blocks = response.Blocks;\n console.log(\"Analyzed Document Text\");\n console.log(\"Pages:\" + response.DocumentMetadata.Pages);\n\n \n blocks.forEach(block => {\n \n blockId = block.Id;\n blockMapTable[blockId] = block;\n blockMap[blockId] = block;\n\n if (block.BlockType == \"KEY_VALUE_SET\") {\n if(_.includes(block.EntityTypes,\"KEY\")){\n keyMap[blockId] = block\n }else{\n valueMap[blockId] = block\n }\n }\n\n if(block.BlockType==\"TABLE\"){\n table_blocks.push(block)\n }\n\n //DisplayBlockInfo(block);\n if (response.NextToken) {\n paginationToken = response.NextToken\n } else {\n finished = true;\n }\n\n });\n\n }\n\n //Form data processing \n let result\n if(keyMap.length <= 0){\n console.log(\"No Form Data\")\n }else{\n const keyValues = getKeyValueRelationship(keyMap, valueMap, blockMap);\n result = keyValues\n }\n \n //Table data processing\n let csv = {}\n if (table_blocks.length <= 0){\n console.log(\"No tables found\")\n }else{\n for(const [index,table] of table_blocks.entries()){\n let [rows,tableId] = generateTableCsv(table,blockMapTable,index+1)\n csv[tableId] = rows\n }\n }\n\n console.log(\"Operation Complete\")\n return [result,csv]\n \n}", "async getAttribution() {\n try {\n await this.setState({ ordinateurs: [] });\n await this.setState({ paginationLink: {} });\n await this.setState({ totalPage: null });\n\n const allInformation = await Axios.get('http://127.0.0.1:3001/api/computers', {\n params: {\n date: this.state.currentDate,\n page: this.state.currentPage\n },\n headers: {\n Authorization: `Bearer ${getToken()}`\n }\n });\n const responseData = allInformation.data;\n await this.setState({ ordinateurs: responseData.desktopInfo });\n await this.setState({ totalPage: responseData.totalPage });\n } catch (error) {\n console.error(error)\n } \n }", "async function getHealthIndex(cryptoType) {\n var apiUrl = 'https://www.alphavantage.co/query?function=CRYPTO_RATING&symbol=' + cryptoType\n + '&apikey=' + alphaApiKey\n\n return fetch(apiUrl)\n .then(function (response) {\n var res = response.json();\n return res;\n\n })\n.then(function (data) {\n var res = data;\n var val = res && res['Crypto Rating (FCAS)']['3. fcas rating'] || {};\n if(Object.keys(val).length === 0){\n return 'Not Available';\n }\n return val;\n \n});\n}" ]
[ "0.58540154", "0.57740176", "0.56492496", "0.55910975", "0.55119795", "0.5457745", "0.54350996", "0.5417911", "0.5412468", "0.5410375", "0.5345171", "0.5321396", "0.5306225", "0.5290836", "0.5283403", "0.5282417", "0.5281172", "0.5253199", "0.5232408", "0.5207306", "0.5194073", "0.5192049", "0.5186977", "0.51836026", "0.5179681", "0.5173822", "0.5172326", "0.5170122", "0.516941", "0.515282", "0.51505303", "0.5145289", "0.51269525", "0.5119312", "0.51058525", "0.51056856", "0.5099113", "0.5095031", "0.50935906", "0.5091097", "0.50861466", "0.50697124", "0.5062206", "0.50523716", "0.5051525", "0.5051481", "0.5050961", "0.50478977", "0.50437224", "0.50375897", "0.5031452", "0.501945", "0.5015356", "0.50138587", "0.50109947", "0.50086606", "0.50014776", "0.49954602", "0.49891874", "0.49849293", "0.4981927", "0.49809113", "0.49801964", "0.49785355", "0.49785063", "0.49765736", "0.49696574", "0.49696124", "0.496883", "0.49662015", "0.49639922", "0.4959373", "0.4959356", "0.4958655", "0.49572888", "0.49526754", "0.49498886", "0.49423313", "0.49402407", "0.4937018", "0.49355254", "0.493539", "0.493366", "0.49110082", "0.49105895", "0.49052617", "0.4902719", "0.4902555", "0.49000475", "0.4899611", "0.4897464", "0.48892996", "0.48890823", "0.48882073", "0.4885938", "0.48797852", "0.48794284", "0.4877245", "0.48769885", "0.4875151" ]
0.4994364
58
map : (a > b) > Functor a > Functor b
function map2(fn) { return function $map(functor) { return functor.map(fn); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Function$prototype$map(f) {\n var functor = this;\n return function(x) { return f(functor(x)); };\n }", "function Function$prototype$map(f) {\n var functor = this;\n return function(x) { return f (functor (x)); };\n }", "function map (array, predicate) {\n}", "function binaryMap(func, a, b) {\r\n var result = [];\r\n $.each(a, function (index, value) {\r\n result.push(func(value, b[index]));\r\n });\r\n return result;\r\n}", "function mapLeft(f, bifunctor) {\n return bimap (f, identity, bifunctor);\n }", "function betterFunctor(value, fn) {\n if (typeof value === 'number') {\n return fn(value); \n } else {\n var map = Array.prototype.map;\n return map.call(value, fn);\n }\n}", "bimap (leftFn, rightFn) {\n return this.isRight ? \n Right.fmap(rightFn) : Left.of(leftFn(this.value))\n }", "function promap(f, g, profunctor) {\n return Profunctor.methods.promap (profunctor) (f, g);\n }", "function mapTo(value) {\n return function (source) { return source.lift(new MapToOperator(value)); };\n}", "function compareTriples(a,b){\n //Almacenar puntos\n let Alice = 0;\n let Bob = 0;\n a.map((element, index) => {\n if(element > b[index]){\n Alice +=1;\n }\n if(element < b[index]){\n Bob +=1;\n }\n })\n return [Alice, Bob];\n}", "function mapTransform(args, math, scope) {\n var x, callback;\n\n if (args[0]) {\n x = args[0].compile().evaluate(scope);\n }\n\n if (args[1]) {\n if ((0, _is.isSymbolNode)(args[1]) || (0, _is.isFunctionAssignmentNode)(args[1])) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = args[1].compile().evaluate(scope);\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = (0, _compileInlineExpression.compileInlineExpression)(args[1], math, scope);\n }\n }\n\n return map(x, callback);\n }", "function mapTransform (args, math, scope) {\n let x, callback\n\n if (args[0]) {\n x = args[0].compile().evaluate(scope)\n }\n\n if (args[1]) {\n if (isSymbolNode(args[1]) || isFunctionAssignmentNode(args[1])) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = args[1].compile().evaluate(scope)\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(args[1], math, scope)\n }\n }\n\n return map(x, callback)\n }", "function Function$prototype$promap(f, g) {\n var profunctor = this;\n return function(x) { return g (profunctor (f (x))); };\n }", "function promap(f, g, profunctor) {\n return Profunctor.methods.promap(profunctor)(f, g);\n }", "function Function$prototype$promap(f, g) {\n var profunctor = this;\n return function(x) { return g(profunctor(f(x))); };\n }", "function map(a,f){\r\n let b=[], i;\r\n for (i in a){\r\n b.push(f(a[i]));\r\n }\r\n return b;\r\n}", "function map(val, A, B, a, b) {\n return (val - A) * (b - a) / (B - A) + a;\n}", "function contramap(f, contravariant) {\n return Contravariant.methods.contramap (contravariant) (f);\n }", "function contramap(f, contravariant) {\n return Contravariant.methods.contramap(contravariant)(f);\n }", "function map_(self, f) {\n return new Take(Ex.map_(self.exit, A.map(f)));\n}", "function liftf(binary) {\n return function(first) {\n return function(second) {\n return binary(first, second);\n };\n };\n}", "function map(f) {\n return fa => map_(fa, f);\n}", "function liftf(binary) {\n return function (first) {\n return function (second) {\n return binary(first, second);\n };\n };\n}", "function liftA2(f, a, b) {\n return this.ap(this.map(a, f), b);\n }", "function chainMap(chainFunc) {\n return this.lift(new ChainMapOperator(chainFunc));\n}", "function map(f) {\n return self => map_(self, f);\n}", "function z(a){function b(b,c){this.tgt=a.getTgt(b,c)}\n// Simple map declared as function\nreturn Z(a)&&(a={getTgt:a}),a.baseMap&&(a=j(j({},a.baseMap),a)),a.map=function(a,c){return new b(a,c)},a}", "function lift2(f, x, y) {\n return ap (map (f, x), y);\n }", "function map(fn) {\n return function(rf) { // <- buildArray for example\n // Hmm, we don't have the information yet to run the functionality of map, lets return a function to provide an interface for this\n return function(result, item) { // look another reducing function\n return rf(result, fn(item))\n }\n }\n}", "function lift2(f, x, y) {\n return ap(map(f, x), y);\n }", "function bimap(f, g, bifunctor) {\n return Bifunctor.methods.bimap (bifunctor) (f, g);\n }", "function map(f, a) {\n return isArray(a) ? arrayMap(a, f)\n : isFunction(a) ? fnMap(a, f)\n : hasMethod(a, 'map') ? a.map(f)\n : isObject(a) ? objectMap(a, f)\n : undefined;\n}", "function map (collection, iteratee, callback) {\n\n}", "function map(an_array, a_function) {\n return a_function(an_array);\n }", "function bimap(f, g, bifunctor) {\n return Bifunctor.methods.bimap(bifunctor)(f, g);\n }", "function aFunctor(value, fn) {\n return fn(value);\n}", "function Function$prototype$contramap(f) {\n var contravariant = this;\n return function(x) { return contravariant (f (x)); };\n }", "function tap(f) {\n return ma => chain_(ma, a => map_(f(a), () => a));\n}", "function map (data, predicates) {\n assert.object(data);\n\n if (isFunction(predicates)) {\n return mapSimple(data, predicates);\n }\n\n assert.object(predicates);\n\n return mapComplex(data, predicates);\n }", "['fantasy-land/map'](f) {\n return this.map(f);\n }", "function mapCallback(num) {\n return num * num;\n}", "function Function$prototype$contramap(f) {\n var contravariant = this;\n return function(x) { return contravariant(f(x)); };\n }", "function map(arr, fn) {\n return arr.map(fn);\n}", "map(mapFn) {\n return map(mapFn, this);\n }", "map(mapFn) {\n return map(mapFn, this);\n }", "function batmap(arr,mapFunc,otherArrsArray) {\n let narr = []\n otherArrsArray = transpose(otherArrsArray)\n for(var i=0;i<arr.length;i++){\n let value = arr[i]\n let func = mapFunc\n let oargs = otherArrsArray[i]\n let ele = func(value,...oargs)\n narr.push(ele)\n }\n return(narr)\n}", "function map (x, low1, high1, low2, high2) {\n const r1 = high1 - low1\n const r2 = high2 - low2\n return ((x - low1) * (r2 / r1)) + low2\n}", "function reduceFilter(fn) {\n return function (mapped, x) {\n if (fn(x)) {\n mapped.push(x);\n }\n return mapped;\n };\n}", "function Pair$prototype$map(f) {\n return Pair (this.fst) (f (this.snd));\n }", "function map(f, xs) {\n var tmp = []\n for (var i = 0; i < xs.length; i++) tmp.push(f(xs[i]))\n return tmp\n}", "function mapping(f) {\n return function () {\n var rest = toArray(arguments);\n return function (x) {\n return map(function (v) {\n return f.apply(undefined, rest.unshift(v));\n }, unit(x));\n };\n };\n}", "map(other, before = false) { return other.empty ? this : mapSet(this, other, before, true); }", "function tap_(ma, f) {\n return chain_(ma, a => map_(f(a), () => a));\n}", "function map(fn, list) {\n\n return list\n ? cons(fn(head(list)), map(fn,tail(list)))\n : emptyList\n ;\n}", "function map(fn, list) {\n\n return list\n ? cons(fn(head(list)), map(fn,tail(list)))\n : emptyList\n ;\n}", "function map(fn, list) {\n\n return list\n ? cons(fn(head(list)), map(fn,tail(list)))\n : emptyList\n ;\n}", "function map(fn, list) {\n\n return list\n ? cons(fn(head(list)), map(fn,tail(list)))\n : emptyList\n ;\n}", "function map(fn, list) {\n\n return list\n ? cons(fn(head(list)), map(fn,tail(list)))\n : emptyList\n ;\n}", "function map(fn, list) {\n\n return list\n ? cons(fn(head(list)), map(fn,tail(list)))\n : emptyList\n ;\n}", "function map(fn, list) {\n\n return list\n ? cons(fn(head(list)), map(fn,tail(list)))\n : emptyList\n ;\n}", "function map(fn, list) {\n\n return list\n ? cons(fn(head(list)), map(fn,tail(list)))\n : emptyList\n ;\n}", "function map(fn, list) {\n\n return list\n ? cons(fn(head(list)), map(fn,tail(list)))\n : emptyList\n ;\n}", "function map(fn, list) {\n\n return list\n ? cons(fn(head(list)), map(fn,tail(list)))\n : emptyList\n ;\n}", "function map(fn, list) {\n\n return list\n ? cons(fn(head(list)), map(fn,tail(list)))\n : emptyList\n ;\n}", "function map(fn, list) {\n\n return list\n ? cons(fn(head(list)), map(fn,tail(list)))\n : emptyList\n ;\n}", "function map(fn, list) {\n\n return list\n ? cons(fn(head(list)), map(fn,tail(list)))\n : emptyList\n ;\n}", "function pipe(arrOfFuncs, value) {\n\n}", "function maps(x){\n return x.map((n) => n * 2);\n}", "map(f) { // Maps a function over this type (just like arrays)\n return f(this._value);\n }", "function map(project, thisArg) {\n return function mapOperation(source) {\n if (typeof project !== 'function') {\n throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');\n }\n return source.lift(new MapOperator(project, thisArg));\n };\n}", "function bimap(f, g) {\n return self => bimap_(self, f, g);\n}", "function map (f, a) {\n\t var l = a.length\n\t var b = new Array(l)\n\t for (var i = 0; i < l; ++i) {\n\t b[i] = f(a[i])\n\t }\n\t return b\n\t}", "function gt(y) {\n return function(x) {\n return Z.gt (x, y);\n };\n }", "function filter(pred) {\n return function(rf) { // <- buildArray for example, but also the function in map on line 82\n return function(result, item) {\n if(pred(item))\n return rf(result, item)\n else\n return result\n }\n }\n}", "function map(array, f) { \n var acc = []; \n each(array, function(element, i) { \n acc.push(f(element, i)); \n });\n return acc; \n }", "function map(arr, transformFct) {\n console.log(transformFct);\n}", "function mapping(f, reducer) {\n return function(accu, e) {\n return reducer(accu, f(e));\n }\n}", "function map(array, func) {\n var acc = [];\n each(array, function(element) {\n acc.push(func(element));\n });\n return acc;\n}", "function map(f,a) {\n var result = [] // Create a new Array\n for (let i in a){ result[i] = f(a[i]) }\n return result;\n}", "map(f) {\n\treturn f(this.value);\n }", "function map(f, a) {\n var l = a.length;\n var b = new Array(l);\n for (var i = 0; i < l; ++i) {\n b[i] = f(a[i]);\n }\n return b;\n}", "function map (f, a) {\n var l = a.length\n var b = new Array(l)\n for (var i = 0; i < l; ++i) {\n b[i] = f(a[i])\n }\n return b\n}", "function map(f, xs){\n var tmp = [];\n for (x in xs) tmp.push(f(xs[x]));\n return tmp;\n}", "function pipe(...fns) {\n return arg => fns.reduce((fn1, fn2) => fn2(fn1), arg)\n}", "function map (fn, list) {\n return list\n ? cons(fn(head(list)), map(fn, tail(list)))\n : emptyList\n}", "function map(x, x0, x1, y0, y1) {\r\n return y0 + (y1 - y0) * (1.0 * x - x0) / (x1 - x0);\r\n}", "function liftf(fn) {\n return (a) => {\n return (b) => {\n return fn(a, b);\n };\n };\n}", "map(predicate) {\n const tuples = this.toArray().map(([component, value]) => {\n const newValue = predicate(value, component);\n return [component.id.toString(), [component, newValue]];\n });\n return new ComponentMap(new Map(tuples));\n }", "function bimap(g, f) {\n return self => bimap_(self, g, f);\n}", "function fmap(item, fn) {\n return Array.isArray(item) ? item.map(fn) : fn(item);\n}", "function map_list( list, for_func, if_func )\n {\n var mapped_list = [];\n for ( var i = 0; i < list.length; ++i )\n {\n var x = list[i];\n if( null == if_func || if_func( i, x ) ) \n mapped_list.push( for_func( i, x ) );\n }\n return mapped_list;\n }", "function map(F, G) {\n return function (f) { return function (fa) { return F.map(fa, function (ga) { return G.map(ga, f); }); }; };\n}", "function map(F, G) {\n return function (f) { return function (fa) { return F.map(fa, function (ga) { return G.map(ga, f); }); }; };\n}", "function as_(self, b) {\n return P.map_(self, () => b);\n}", "function map(value, in_min, in_max, out_min, out_max){\n return (value - in_min) * (out_max - out_min) / (in_max - in_min) + out_min\n}", "function map(a,b,c,d,e){return(a-b)/(c-b)*(e-d)+d}", "function pairwise() {\n return function (source) { return source.lift(new PairwiseOperator()); };\n}", "function functor(v) {\n \treturn typeof v === \"function\" ? v : function() {\n return v\n \t}\n }", "function tapM_(self, f) {\n return core.mapM_(self, a => T.as_(f(a), a));\n}", "ap (aFn) { \n //return this.fmap(aFn.value)\n return aFn.chain(fn => Right.of(fn(this.value)))\n }" ]
[ "0.6383477", "0.6364249", "0.6231084", "0.59821117", "0.5931884", "0.5920691", "0.5896256", "0.58724314", "0.5862765", "0.58194506", "0.5797551", "0.57509756", "0.5724553", "0.57232124", "0.5687154", "0.5665435", "0.56511235", "0.5634526", "0.5614075", "0.5603554", "0.55933076", "0.55555964", "0.55487597", "0.5536345", "0.5470683", "0.5447712", "0.5407007", "0.5388397", "0.53603", "0.53596354", "0.5338893", "0.5335894", "0.5296153", "0.5295435", "0.5285532", "0.52797925", "0.5261933", "0.5235996", "0.52253306", "0.5222029", "0.5217661", "0.521472", "0.520754", "0.5200113", "0.5200113", "0.5199891", "0.51943755", "0.5189777", "0.51689184", "0.5168211", "0.5156059", "0.5141303", "0.5137279", "0.51351094", "0.51351094", "0.51351094", "0.51351094", "0.51351094", "0.51351094", "0.51351094", "0.51351094", "0.51351094", "0.51351094", "0.51351094", "0.51351094", "0.51351094", "0.5124157", "0.51218915", "0.5121596", "0.51204854", "0.51170766", "0.51072955", "0.51029205", "0.50901484", "0.508196", "0.5081276", "0.5062823", "0.50587165", "0.5049247", "0.5044135", "0.5042122", "0.5041223", "0.5040971", "0.5038533", "0.5035923", "0.5033603", "0.5031891", "0.50311494", "0.50163406", "0.49929607", "0.4990461", "0.49841782", "0.49841782", "0.49841297", "0.497719", "0.49767995", "0.49712038", "0.49646175", "0.4947181", "0.49442595" ]
0.6149235
3
Load the required SharePoint libraries
function initializePage() { //Get the URI decoded URLs. hostweburl = decodeURIComponent( getQueryStringParameter("SPHostUrl") ); appweburl = decodeURIComponent( getQueryStringParameter("SPAppWebUrl") ); var scriptbase = hostweburl + "/_layouts/15/"; $.getScript(scriptbase + "SP.RequestExecutor.js", getListsFromWeb); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadLibraries() {\n gapi.load('client:auth2', {'callback': onClientLoad});\n gapi.load('picker', {'callback': () => { pickerApiLoaded = true; }});\n}", "function loadAdditionalLibraries() {\n additionalLibraries.forEach(function(each) {\n importScripts(each);\n });\n }", "loadExternalLibraries()\n\t{\n\t\tlet i;\n\t\tlet libraries = this.settings.inject_libraries;\n\n\t\tfor (i = 0; i < libraries.length; i++) {\n\t\t\tif (externalLibraries.hasOwnProperty(libraries[i])) {\n\t\t\t\tlet id = 'Turbo-eCommerce-' + Str.ucfirst(libraries[i]);\n\t\t\t\t\n\t\t\t\tif (! DOM.find(id)) {\n\t\t\t\t\tDOM.addLinkedStyle(id, externalLibraries[libraries[i]]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function loadLibs(){\t\n\t$(function() {\n\t\tlog(\"loading libraries\");\n\t\tyepnope([{\n\t\t\tload: scripts,\n\t\t\tcallback: function (url, result, key) {\n\t\t\t\tprogress(\"loaded: \" + url);\n\t\t\t\tlog(\"loaded \" + url)\n\t\t\t},\n\t\t\tcomplete: function(){\n\t\t\t\tlog(\"yepnope complete\"); \n\t\t\t\tloadAnims();\t\t\n\t\t\t}\n\t\t}]);\n\t});\n}", "function loadLibs(callback) {\n loadScript(\"https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js\",callback);\n }", "ensureSitePagesLibrary() {\r\n return this.clone(Lists_1, \"ensuresitepageslibrary\").postCore().then((json) => {\r\n return new List(odataUrlFrom(json));\r\n });\r\n }", "function loadSketchLibs(callback) {\n try {\n // Get a list of all sketch library files\n var lsRequest = new XMLHttpRequest();\n lsRequest.open(\"GET\", \"ls_sketchlibs.txt\");\n\n lsRequest.onloadend = function () {\n if (lsRequest.responseText != \"\") {\n var ls = lsRequest.responseText.trim().split(\"\\n\");\n var remainingRequests = {count: ls.length};\n\n for (var n = 0; n < ls.length; n++) {\n // Load each one of them by adding a script tag to the document\n let script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n script.src = \"sketchlibs/\" + ls[n];\n script.onload = function() {\n if (--remainingRequests.count === 0) {\n // Once all libraries are done loading, run the callback\n callback();\n }\n }\n document.body.appendChild(script);\n }\n }\n }\n lsRequest.send();\n } catch (e) {\n console.error(e);\n }\n }", "getDocumentLibraries(absoluteWebUrl) {\r\n const q = new SharePointQueryable(\"\", \"_api/sp.web.getdocumentlibraries(@v)\");\r\n q.query.set(\"@v\", \"'\" + absoluteWebUrl + \"'\");\r\n return q.get().then(data => {\r\n if (hOP(data, \"GetDocumentLibraries\")) {\r\n return data.GetDocumentLibraries;\r\n }\r\n else {\r\n return data;\r\n }\r\n });\r\n }", "ensureSiteAssetsLibrary() {\r\n return this.clone(Lists_1, \"ensuresiteassetslibrary\").postCore().then((json) => {\r\n return new List(odataUrlFrom(json));\r\n });\r\n }", "function loadLibrary() {\n\n if ( loaded ) {\n return onLibraryLoaded();\n }\n\n var googletag,\n gads,\n useSSL,\n node,\n readyStateLoaded = false\n ;\n\n window.googletag = window.googletag || {};\n window.googletag.cmd = window.googletag.cmd || [];\n\n // Called when GPT is Available\n window.googletag.cmd.push( onLibraryLoaded )\n\n gads = document.createElement( 'script' );\n gads.async = true;\n gads.type = 'text/javascript';\n gads.src = 'https://www.googletagservices.com/tag/js/gpt.js';\n\n node = document.getElementsByTagName( 'script' )[0];\n node.parentNode.insertBefore( gads, node );\n\n }", "function loadLib(files){\n\t\t\t\t$script(files, function() {\n\t\t\t\t\t//apply config stuff or just execute callbacks\n\t\t\t\t\tif(typeof config == 'object' && config.ensure && !$window[config.ensure]){\n\t\t\t\t\t\tvar stop = $interval(function() {\n\t\t\t\t\t\t\tif($window[config.ensure]){\n\t\t\t\t\t\t\t\t$interval.cancel(stop);\n\t\t\t\t\t\t\t\texecuteCallbacks();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 100);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\texecuteCallbacks();\n\t\t\t\t\t}\n\n\t\t\t\t\t//Executes all callbacks and change loaded status to 1\n\t\t\t\t\tfunction executeCallbacks(){\n\t\t\t\t\t\tcallbacks[lib].forEach(function(cb) {\n\t\t\t\t\t\t\tcb();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tloading[lib].status = 1;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}", "function init() { \n SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs('domTools.js');\n }", "function loadAllLibs() {\n const files = [\n // list library\n '/externalLibs/list.js',\n // sound\n '/externalLibs/sound/sounds.js',\n '/externalLibs/sound/soundToneMatrix.js',\n '/externalLibs/sound/riffwave.js',\n '/externalLibs/sound/microphone.js',\n // graphics\n '/externalLibs/graphics/gl-matrix.js',\n '/externalLibs/graphics/webGLhi_graph.js',\n '/externalLibs/graphics/webGLhi_graph_ce.js',\n '/externalLibs/graphics/webGLgraphics.js',\n '/externalLibs/graphics/webGLcurve.js',\n '/externalLibs/graphics/webGLrune.js',\n // list visualizer\n '/externalLibs/visualizer/KineticJS.js',\n '/externalLibs/visualizer/visualizer.js',\n // binary tree library\n '/externalLibs/tree.js',\n // support for Practical Assessments (presently none)\n // video\n '/externalLibs/video/video_lib.js',\n // inspector\n '/externalLibs/inspector/inspector.js',\n // env visualizer\n '/externalLibs/env_visualizer/ConcreteJs.js',\n '/externalLibs/env_visualizer/visualizer.js'\n ]\n\n for (var i = 0; i < files.length; i++) {\n dynamicallyLoadScript(files[i])\n }\n}", "function loadAllAvailableLibraries() {\n\n\t\t// We have a list of known libraries (in the bootstrap) that have to be checked. This list will be dynamically extended below with any new libraries. This static list here is just for fallback purposes.\n\t\tvar mLoadedLibraries = Library.all();\n\n\t\t// Maybe libraries have been added, so discover what is available in order to also test them. But only do this when we are in sapui5.runtime layer, not when this test is executed in dist layer.\n\t\treturn VersionInfo.load().then(function(oInfo) {\n\t\t\treturn Promise.all(\n\t\t\t\toInfo.libraries.map(function(oLibInfo) {\n\t\t\t\t\tvar sInfoLibName = oLibInfo.name;\n\n\t\t\t\t\t// only load known libraries, we won't test others\n\t\t\t\t\tif (!aKnownLibraries.includes(sInfoLibName)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!mLoadedLibraries[sInfoLibName]) {\n\t\t\t\t\t\tLog.info(\"Library '\" + sInfoLibName + \"' is not loaded! Trying...\");\n\t\t\t\t\t\treturn sap.ui.getCore().loadLibrary(sInfoLibName, {async: true})\n\t\t\t\t\t\t\t.then(function(oLibrary) {\n\t\t\t\t\t\t\t\tmLoadedLibraries[sInfoLibName] = oLibrary.controls;\n\t\t\t\t\t\t\t\tLog.info(\"Library '\" + sInfoLibName + \"...successfully.\");\n\t\t\t\t\t\t\t}, function(err) {\n\t\t\t\t\t\t\t\t// not a control lib? This happens for e.g. \"sap.ui.server.java\"...\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmLoadedLibraries[sInfoLibName] = mLoadedLibraries[sInfoLibName].controls; // only the control list is needed\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t}).then(function() {\n\t\t\treturn mLoadedLibraries;\n\t\t});\n\t}", "function scriptLoader()\n{\n addJavascript(\"phoneticMapper.js\", \"head\");\n addJavascript(\"vedatype.js\", \"head\");\n addJavascript(\"slp01.js\", \"head\"); \n}", "function coreInitDependencyManager() {\n\n //require method to load js files aync \n $.require = function (file, callback) {\n if (file.indexOf('?') === -1)\n file = file + \"?version=\" + appConfig.app_version\n else\n file = file + \"&version=\" + appConfig.app_version\n\n\n $.getScript(file, function () {\n if (typeof callback != \"undefined\")\n callback(file);\n });\n }\n\n //require method to load js files \n $.requireSync = function (file, callback) {\n var loaded = false;\n var head = document.getElementsByTagName(\"head\")[0];\n var script = document.createElement('script');\n script.src = file;\n script.type = 'text/javascript';\n //real browsers\n script.onload = function () {\n loaded = true;\n };\n //Internet explorer\n script.onreadystatechange = function () {\n if (this.readyState == 'complete') {\n loaded = true;\n }\n }\n head.appendChild(script);\n\n while (!loaded) {\n $.loadJS(file); //Dirty wait. TODO add logic to skip after 5 seconds\n }\n\n if (typeof callback != \"undefined\")\n callback(file);\n\n }\n }", "function loadAPIs(){\n\t\t\n\t\t//load youtube api\n\t\tif(g_temp.isYoutubePresent)\n\t\t\tg_ugYoutubeAPI.loadAPI();\n\t\t\n\t\tif(g_temp.isVimeoPresent)\n\t\t\tg_ugVimeoAPI.loadAPI();\n\t\t\n\t\tif(g_temp.isHtml5VideoPresent)\n\t\t\tg_ugHtml5MediaAPI.loadAPI();\n\t\t\n\t\tif(g_temp.isSoundCloudPresent)\n\t\t\tg_ugSoundCloudAPI.loadAPI();\n\t\t\n\t\tif(g_temp.isWistiaPresent)\n\t\t\tg_ugWistiaAPI.loadAPI();\n\t\t\n\t}", "function loadLibraries() {\n var url = \"php/loadLibraries.php\";\n ajaxRequest(\"POST\", url, true, \"\", populateList);\n}", "function ContinueOnceAllDependentLibsLoaded() {\r\n if (window.jQuery && window.ko && window.Promise) {\r\n var viewModel = new NavigationViewModel();\r\n viewModel.loadNavigatioNodes();\r\n } else {\r\n window.setTimeout(ContinueOnceAllDependentLibsLoaded, 100);\r\n }\r\n }", "function init() {\n $log.log(loggerSource, 'service loaded', null);\n\n // if values don't exist on querystring...\n if (decodeURIComponent(jQuery.getQueryStringValue(\"SPHostUrl\")) === \"undefined\") {\n // load the app context form the cookie\n loadSpAppContext();\n } else {\n // otherwise, creae the app context\n createSpAppContext();\n }\n }", "function initLibs() {\n\t\tvar kjslib = universe.kjslib = _kJs_Initor();\n\t\tvar kxmllib = universe.kxmllib = _kXml_Initor();\n\t\tvar kanilib = universe.kanilib = _kAni_Initor();\n\t\tvar keventlib = universe.keventlib = _kEvent_Initor();\n\t\tvar kgraphlib = universe.kgraphlib = _kGraph_Initor();\n\t\tinitClasses\n\t\t\t(kjslib, \"kjsclasses\")\n\t\t\t(kxmllib, \"kxmlclasses\")\n\t\t\t(kanilib, \"kaniclasses\")\n\t\t\t(keventlib, \"keventclasses\")\n\t\t\t(kgraphlib, \"kgraphclasses\")\n\t\t;\n\t}", "function _bf_loadScripts(callback) \n{\n // load BiFrost required files and plugins\n var scripts = [\n 'css/_bf.css',\n 'api/plugins/player/swfobject.js',\n 'api/plugins/expander/jquery.expander.js',\n 'api/plugins/socials/jquery.socials.js',\n 'api/plugins/socials/jquery.socials.css',\n 'api/plugins/showbox/jquery.showbox.js',\n 'api/plugins/showbox/flowplayer-3.2.6.min.js',\n 'api/plugins/multiselect/jquery.multiselect.js',\n 'api/plugins/uploadify/jquery.uploadify.v2.1.4.js',\n 'api/plugins/player/jwplayer.js',\n 'api/plugins/timeago/jquery.timeago.js',\n 'api/plugins/raty/js/jquery.raty.min.js'\n ];\n \n // do we have a custom stylesheet?\n if(typeof BiFrost.customcss != 'undefined')\n {\n _bf_loadscript(BiFrost.customcss);\n }\n else\n {\n _bf_loadscript(_bf_host + 'css/_bf_items.css');\n }\n \n // run through and load the included scripts\n for(var itemno = 0; itemno < scripts.length; itemno++)\n {\n _bf_loadscript(_bf_host + scripts[itemno]);\n }\n \n if(typeof callback == 'function')\n {\n callback();\n } \n}", "init () {\n this._super(...arguments);\n // lazy load the JSAPI\n const esriLoader = this.get('esriLoader');\n // NOTE: to use a version other than the latest 4.x release\n // pass the url in the options argument to load()\n //alert('entre al lazy load the JSAPI en init maps.js !');\n //esriLoader.load({ url: 'https://js.arcgis.com/3.20compact' }).catch(err => {\n //esriLoader.load({ url: 'https://js.arcgis.com/3.21compact/' }).catch(err => { \n //esriLoader.load({ url: 'https://js.arcgis.com/4.4/' }).catch(err => { puro batallar\n //cuando no se ponen parametros va a la version mas nueva \n esriLoader.load({ url: 'https://js.arcgis.com/3.21/' }).catch(err => {\n //esriLoader.load().catch(err => { \n // do something with the error\n alert('entre al error de lazy load the JSAPI en init maps.js !');\n });\n }", "function loader (fs) { //We are going to load what we need!\nconsole.log('Initiated at '+ new Date());\n\nif (navigator.onLine) {\n// First of all, we need to get info about the latest version, path, etc. from Google\n// this is done through one XMLHttpRequest\n// The response is parsed and the information is stored in localStorage.\n\n// let's start:\n\n$(\"#sandbox\").load(\"https://developers.google.com/speed/libraries/devguide?uid=\" + uniqueId() + \" #gc-content div\", function () {\n\t\n\tlibraries = $(\"div\");\n\tlibraries.splice(-2,2);\n\tlibraries.splice(0,3); // we now have an array with all the libraries\n\tsrc = [];\n\tsrc_u = [];\n\tnewLibs = [];\n\tnewLibCount = 0;\n//When we display the names, we want them to look nice.\n\tUI_name = []\n\tUI_name['jquery'] = 'jQuery';\n\tUI_name['jqueryui'] = 'jQuery UI';\n\tUI_name['jquery-ui'] = 'jQuery UI'; //Quick fix. Google sometimes changes the name of the jquery ui div.\n\tUI_name['prototype'] = 'Prototype';\n\tUI_name['scriptaculous'] = 'script.aculo.us';\n\tUI_name['mootools'] = 'MooTools';\n\tUI_name['dojo'] = 'Dojo';\n\tUI_name['swfobject'] = 'SWFObject';\n\tUI_name['angularjs'] = 'Angular JS';\n\tUI_name['webfont'] = 'WebFont Loader';\n\tUI_name['ext-core'] = 'Ext Core';\n\t\n\t\n\t\nfor (i=0; i <= libraries.length - 1; i++) { // loop through all libraries\n\n\t\tversion = $(\"#\" + libraries[i].id + \" dl dd:eq(2) span.versions\").text(); //get all existing versions.\n\t\tversion = version.split(\" \").join(\"\");\n\t\tversion = version.split(\",\"); //Separate them.\n\t\tversion = version[0]; //The version we are interested in is the latest version.\n\t\t\tif (version != \"\") {\n\t\t\t\tif (version != localStorage[libraries[i].id + \"_version\"] && libraries[i].id != \"chrome-frame\") { // if this is a new version:\n\t\t\t\t\tnewLibs[newLibCount] = libraries[i].id; //Save what library is being updated.\n\t\t\t\t\tnewLibCount = newLibCount + 1; //add one to the count.\n\t\t\t\t\tlocalStorage[libraries[i].id + \"_version\"] = version; //Save the new version.\n\t\t\t\t\t\n\t\t\t\t\t\tif (localStorage[\"desktop\"] == \"true\") {\n\t\t\t\t\t\t\tvar notification = webkitNotifications.createNotification(\n\t\t\t\t\t\t\t'icon128.png',\n\t\t\t\t\t\t\t'A new library has been downloaded!',\n\t\t\t\t\t\t\tUI_name[libraries[i].id] + ' has been updated to version ' + version\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tnotification.show();\n\t\t\t\t\t\t\tsetTimeout(function () {notification.cancel();}, 5000);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\tsite = site = $(\"#\" + libraries[i].id + \" dl dd:eq(1)\").text();\n\t\tsite = site.split(\"site:\");\n\t\tlocalStorage[libraries[i].id + \"_site\"] = $.trim(site[1]); //Get the library's site\n\t\t\n\t\tpath = $(\"#\" + libraries[i].id + \" dl dd:eq(0) code\").text();\n\t\tpath = path.slice(25, -11);\n\t\tpath = \"http://\" + path;\n\t\tsrc[libraries[i].id] = path; //Get the path to Google's CDN copy of the library.\n\t\tlocalStorage[libraries[i].id + '_src'] = src[libraries[i].id];\n\t\t\n\t\tconsole.log(i, libraries[i].id, version); \n\t\tconsole.log(src[libraries[i].id]);\n\t\tconsole.log(site);\n\t\tif (src_u[libraries[i].id]) console.log(src_u[libraries[i].id]);\n\t\tconsole.log('\\n');\n\t\t//Logging all the info we just got about the library.\n}\n\nif (newLibCount >= 1) { //If there are new libraries,\n\tif (localStorage[\"badge\"] != \"false\") { //And the user wants badge notifications\n\t\tchrome.browserAction.setBadgeText({\"text\": (newLibCount).toString()}); //Show the number of new libraries.\n\t}\n}\n\nlocalStorage[\"newLibs\"] = newLibs.join(','); //Save the new libraries to localStorage\n//We have now got all the metadata we need.\n\n// We then request the actual library, once again through an XMLHttpRequest for each\n\nfor (i=0; i <= newLibs.length - 1; i++) { //for all new libraries\n\tif (localStorage[\"load_\" + newLibs[i]] != \"false\") { //if the user wants this library\n\t\n\tconsole.log(\"loading \" + newLibs[i]);\n\t\n\t\tloadContent(src[newLibs[i]], newLibs[i] + \"_min\", fs); //The path and the file name are sent to the function which loads the file.\n\t\t\tif (src_u[newLibs[i]]) { //This is here in case Google supplies a development, unminified version.\n\t\t\t//They used to do this, but stopped doing it in the middle of the development of this extension.\n\t\t\t//I decided to keep all the code taking care of the unminified libraries, just in case Google starts supplying them again.\n\t\t\t//It doesn't really interfere with anything else, so it is here, but isn't running.\n\t\t\t\tloadContent(src_u[newLibs[i]], newLibs[i], fs);\n\t\t\t}\n\t}\n}\n});\n}\n\n} // function loader", "function Libraries() {\n this._registry = [];\n this._coreLibIndex = 0;\n }", "function Libraries() {\n this._registry = [];\n this._coreLibIndex = 0;\n }", "function JSOM() {\n var configuration = SharePointClient.Configurations;\n var utility = new SharePointClient.Utilities.Utility();\n configuration.IsApp = true;\n \n\n SharePointClient.Services.JSOM.Initialize(function () {\n var listServices = new SharePointClient.Services.JSOM.ListServices();\n\n //Get SP clientContext\n var context = new SharePointClient.Services.JSOM.Context();\n\n var listTitle = \"xyz\";\n //Create Caml object\n var camlConstant = SharePointClient.Constants.CAML_CONSTANT;\n var camlQuery = new SharePointClient.CamlExtension.JSOM.CamlQuery();\n camlQuery.ViewAttribute(camlConstant.CAML_QUERY_SCOPE.RECURSIVE_ALL)\n .Query(\"<Where><Geq><FieldRef Name=\\\"Modified\\\" /><Value Type=\\\"DateTime\\\" IncludeTimeValue=\\\"TRUE\\\"\"\n + \"StorageTZ=\\\"TRUE\\\">2015-08-05T15:50:08</Value></Geq></Where>\")\n .ViewFieldsXml(\"<FieldRef Name='ID'/><FieldRef Name='Title'/>\")\n .QueryThrottleMode(camlConstant.CAML_QUERY_THROTTLE_MODE.OVERRIDE)\n .OrderByIndex()\n .RowLimit(5000);\n\n //Get All list items batch by list name\n listServices.GetListItemsBatchByListName(context, listTitle, camlQuery.BuildQuery()).Execute(function (result) {\n //Read all items\n }); \n });\n}", "function Loader( resources, callback, thisArg ) { \n\t\t// Sets the current instance in a variable\n\t\tconst al = this;\n\t\t\n\t\t// If there are less than three arguments, set the context to the current instance\n\t\tif ( arguments.length < 3 ) thisArg = this;\n\n\t\t// An array of loaded scripts\n\t\tal.loadedScripts = [ ];\n\n\t\t// An array of MediaWiki modules\n\t\tal.modules = resources.MODULES || [ ];\n\n\t\t// An object of scripts to load\n\t\tal.scripts = resources.SCRIPTS || { };\n\n\t\t// An array of stylesheets to load\n\t\tal.stylesheets = resources.STYLESHEETS || [ ];\n\n\t\t// Initializes the loader\n\t\tal.init = function( ) { \n\t\t\tif ( Array.isArray( al.modules ) && al.modules.length ) { \n\t\t\t\treturn mw.loader\n\t\t\t\t\t.using( al.modules )\n\t\t\t\t\t.then( al.loadScripts.bind( al ) );\n\t\t\t}\n\n\t\t\tal.loadScripts( );\n\t\t};\n\n\t\t// Loads all scripts and stylesheets if they are not loaded\n\t\tal.loadScripts = function( ) { \n\t\t\tif ( Array.isArray( al.stylesheets ) && al.stylesheets.length ) { \n\t\t\t\timportArticles( { type: \"style\", articles: al.stylesheets } );\n\t\t\t}\n\n\t\t\tconst promises = Promise.all( \n\t\t\t\tObject\n\t\t\t\t\t.getOwnPropertyNames( al.scripts )\n\t\t\t\t\t.map( function( name ) { \n\t\t\t\t\t\tconst script = al.scripts[ name ];\n\n\t\t\t\t\t\tif ( window.dev && window.dev[ name ] ) { \n\t\t\t\t\t\t\tal.loadedScripts.push( script );\n\t\t\t\t\t\t\treturn Promise.resolve( );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn new Promise( function( resolve, reject ) { \n\t\t\t\t\t\t\timportArticle( { \n\t\t\t\t\t\t\t\ttype: \"script\",\n\t\t\t\t\t\t\t\tarticle: script\n\t\t\t\t\t\t\t} ).then( function( ) { \n\t\t\t\t\t\t\t\tal.loadedScripts.push( script );\n\t\t\t\t\t\t\t} ).then( resolve )[ \"catch\" ]( reject );\n\t\t\t\t\t\t} );\n\t\t\t\t\t} )\n\t\t\t);\n\n\t\t\treturn promises.then( function( ) { \n\t\t\t\tal.loaded = true;\n\t\t\t\treturn callback.apply( thisArg, al );\n\t\t\t} );\n\t\t};\n\n\t\treturn al;\n\t}", "load(src=[],opts={}){\n\t\t// files loaded\n\t\twindow.trs.loadedScript = window.trs.loadedScript || [] \n\t\treturn new Promise((resolve,reject)=>{\n\t\t\t//options\n\t\t\tlet opt=opts\n\t\t\topt.async=opts.async||false\n\t\t\topt.once=opts.once||false\n\n\t\t\tfor(let file of src){\n\t\t\t\t// script\n\t\t\t\tlet sc=document.createElement('script')\n\t\t\t\tsc.src=file\n\t\t\t\t// attributes\n\t\t\t\tif(opt.async) sc.setAttribute('async','')\n\n\t\t\t\t// mark as loaded by lazy loader func\n\t\t\t\tif(opt.once) {\n\t\t\t\t\tif (window.trs.loadedScript.indexOf(file) == -1 ) {\n\t\t\t\t\t\twindow.trs.loadedScript.push(file)\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// load\n\t\t\t\tif(opt.module) sc.setAttribute('type','module')\n\t\t\t\tsc.setAttribute('lazy-loaded','')\n\t\t\t\tdocument.body.appendChild(sc)\n\t\t\t\tresolve(sc)\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t})\n\t}", "loadResources() {\n lbs.loader.scripts = lbs.loader.scripts.filter(this.uniqueFilter)\n lbs.loader.styles = lbs.loader.styles.filter(this.uniqueFilter)\n lbs.loader.libs = lbs.loader.libs.filter(this.uniqueFilter)\n\n lbs.log.debug(`Scripts to load:${lbs.loader.scripts}`)\n lbs.log.debug(`Styles to load: ${lbs.loader.styles}`)\n lbs.log.debug(`Libs to load: ${lbs.loader.libs}`)\n\n $.each(lbs.loader.libs, (i) => {\n lbs.loader.loadScript(lbs.loader.libs[i])\n })\n\n $.each(lbs.loader.scripts, (i) => {\n lbs.loader.loadScript(lbs.loader.scripts[i])\n })\n\n $.each(lbs.loader.styles, (i) => {\n lbs.loader.loadStyle(lbs.loader.styles[i])\n })\n }", "function AuthAndAskForTaskLists() {\n loader.Load(true);\n}", "function loadGoogleMapsLibrary() {\r\n\t\tvar error;\r\n\t\terror = Estate.Check.ArgumentsCount(arguments.length, 0);\r\n\t\tif (error != \"\") throw new Error(error);\r\n\t\tif (mapKeysExists() == false) {\r\n\t\t\tthrow new Error(\"Cannot find an appropriate Google Maps key for this domain.\");\r\n\t\t}\r\n\r\n\t\tvar script = document.createElement(\"script\");\r\n\t\tscript.type = \"text/javascript\";\r\n\t\tscript.src = \"http://maps.google.com/maps?file=api&v=2.x&key=\" + getKey() + \"&async=2&callback=\" + config.instanceName + \".Init\";\r\n\t\tdocument.body.appendChild(script);\r\n\t}", "function getDocLibraryList() {\n $scope.loading = true;\n DocLibraryService.getDocLibraryList().then(\n function (response) {\n $scope.loading = false;\n if (response.data.Error) {\n ToastrService.error(response.data.message)\n } else {\n vm.docsForMapping = response.data.documents;\n // vm.docsForMapping = $filter('filter')(vm.docsForMapping, { 'settings': settings.length });\n }\n },\n function (err) {\n ToastrService.error($rootScope.errorMsgs.MSG201);\n }\n )\n }", "function ap(sr , ol) {\r\n\t\t var e = document.createElement('script'); \r\n\t e.src = sr;\r\n\t e.async = true;\r\n\t if (ol) {\r\n\t \te.onload = e.onerror = function() { if (!this.loaded) { ol(); this.loaded = true; } };\r\n\t\t\te.onreadystatechange = function() { if (this.readyState === 'complete' || this.readyState === 'loaded') { this.onload(); } };\r\n\t }\r\n\t var s = document.getElementsByTagName('script')[0];\r\n\t\t s.parentNode.insertBefore( e , s);\r\n\t}", "function loadLib (/*string*/name, /*string*/ version, /*boolean*/ isShared ) {\n _loadResource(name, version, RC_TYPE.SCRIPT, isShared, null, false);\n }", "init () {\n this._super(...arguments);\n // lazy load the JSAPI\n const esriLoader = this.get('esriLoader');\n \n esriLoader.load({ url: 'https://js.arcgis.com/3.21/' }).catch(err => {\n //esriLoader.load().catch(err => { \n // do something with the error\n alert('entre al error de lazy load the JSAPI en init maps.js !');\n });\n }", "function load(scripts, dependencies, node) {\n dependencies = dependencies || [];\n scripts = scripts || [];\n\n importScripts('boxed/dom.js');\n\n onJSDomReady(function(jsdom) {\n bootstrapDOM(jsdom);\n\n importScripts('boxed/console.js');\n importScripts('../lib/jsonml/jsonml-dom.js', '../lib/jsonml/jsonml-html.js');\n \n loadAdditionalLibraries();\n \n dependencies.forEach(function(each) {\n importScripts(each);\n });\n\n fixReferences();\n installNode(node);\n\n importScripts(scripts);\n })\n }", "function loadJsListModules(jsList) {\n // jsList\n var promise = Promise.resolve();\n if (jsList) {\n jsList.forEach(function (x) {\n promise = promise.then(function () {\n return prepare.loadIIFE(boot.jsListRoot + '/' + x);\n });\n });\n }\n return promise;\n}", "function initScripts() {\n breakpoint();\n lazyload();\n heroSlider();\n categoriesMobile();\n asideLeftMobile();\n scrollRevealInit();\n seoSpoiler();\n mobileMenuOverflowScroll();\n}", "function _useLoadUtil() {\n load(square.stage, app.stage);\n load(circle.stage, app.stage);\n}", "function loadCalendarApi() {\n console.log(\"loading calendar library\");\n gapi.client.load('calendar', 'v3', init);\n}", "function mdsInit() {\n var thisUrl = _spPageContextInfo.siteServerRelativeUrl + '_catalogs/masterpage/FrostingCustom/shared/utlilities/domTools.js';\n this.init();\n RegisterModuleInit(thisUrl, this.init);\n }", "loadDependencies(){\n\n }", "function apiClientLoad() {\n\n //gapi.client.load('oauth2', 'v2', apiClientLoaded);\n gapi.client.load('plus', 'v1', apiClientLoaded);\n}", "async function loadExtraScripts() {\n}", "function loadResourceScripts(scripts) {\n // Load all of the new scripts in parallel\n var scriptPromises = [];\n _.each(scripts, function(script) { scriptPromises.push(loadScript(script)); });\n\n return $q.all(scriptPromises);\n }", "function sharePointReady() {\r\n clientContext = SP.ClientContext.get_current();\r\n clientContext.executeQueryAsync(onRequestSucceeded, onRequestFailed);\r\n }", "function loadLib(externalLibraryName) {\n let files\n switch (externalLibraryName) {\n case 'RUNES':\n files = [\n // graphics\n '/externalLibs/graphics/gl-matrix.js',\n '/externalLibs/graphics/webGLgraphics.js',\n '/externalLibs/graphics/webGLrune.js'\n ]\n break\n case 'CURVES':\n files = [\n // graphics\n '/externalLibs/graphics/gl-matrix.js',\n '/externalLibs/graphics/webGLhi_graph.js',\n '/externalLibs/graphics/webGLhi_graph_ce.js',\n '/externalLibs/graphics/webGLgraphics.js',\n '/externalLibs/graphics/webGLcurve.js'\n ]\n break\n case 'MACHINELEARNING':\n files = [\n // faceAPI\n '/externalLibs/faceapi/face-api_last_version.min.js',\n '/externalLibs/faceapi/faceapi.js',\n ]\n break\n default:\n break\n }\n for (var i = 0; i < files.length; i++) {\n dynamicallyLoadScript(files[i])\n }\n}", "function loadScripts() {\r\n\t\t\t\twindow._sf_endpt = (new Date()).getTime();\r\n\t\t\t\tvar cbDomain = ((\"https:\"==document.location.protocol)?\"https://a248.e.akamai.net/chartbeat.download.akamai.com/102508/\":\"http://static.chartbeat.com/\");\r\n\t\t\t\tif(loadPubJS) {\r\n\t\t\t\t\t$.getScript(cbDomain+\"js/chartbeat_pub.js\");\r\n\t\t\t\t}\r\n\t\t\t\tif((loadVidJS) || (typeof StrategyInterface !== 'undefined' && (espn && espn.video))) {\r\n\t\t\t\t\t$.getScript(cbDomain+\"js/chartbeat_video.js\");\r\n\t\t\t\t}\r\n\t\t\t\t// load default chartbeat js others are disabled\r\n\t\t\t\tif(!loadVidJS && !loadPubJS) {\r\n\t\t\t\t\t$.getScript(cbDomain+\"js/chartbeat.js\");\r\n\t\t\t\t}\r\n\t\t\t}", "function loadTasksApi() {\n gapi.client.load('tasks', 'v1', listTaskLists);\n}", "function loadCore() {\r\n \t\r\n \tif(loaderState) return false;\r\n \t\r\n \tprepareDocument();\r\n \t\r\n\t\tvar coreLoaderScriptTag = document.getElementById('util-coreloader');\r\n\t\tif(!coreLoaderScriptTag) throw \"No Element with ID:'util-coreloader' found!\";\r\n\r\n\t\t// get the original configuration\r\n\t\tvar oConfig = getConfig(coreLoaderScriptTag);\r\n\r\n\r\n\t\t// loading begins\r\n\t\tloaderState = 1;\r\n\t\tvar targetScriptTag = document.createElement('script');\r\n\t\t\r\n\t\ttargetScriptTag.id = 'sap-ui-bootstrap';\r\n\t\ttargetScriptTag.type = 'text/javascript';\r\n\t\ttargetScriptTag.src = coreLoaderScriptTag.getAttribute('data-loader-src');\r\n\t\t\r\n\t\ttargetScriptTag.onload =\r\n\t\ttargetScriptTag.onreadystatechange = function() {\r\n\t\t\t\r\n\t\t\tif ( loaderState === 1 && (!this.readyState || this.readyState == 'complete') ){\r\n\t\t\t\tloaderState = 2;\r\n\t\t\t\t\r\n\t\t\t\tfor(var i in _spinnerOptions[1]) _spinner.opts[i] = _spinnerOptions[1][i];\r\n\t\t\t\t_spinner.spin(_spinner.elm);\r\n\t\t\t\t\r\n\t\t\t\tif(_fnReady) {\r\n\t\t\t\t\tvar fnWaitForCore = function() {\r\n\t\t\t\t\t\tif(!window.sap || !window.sap.ui) {\r\n\t\t\t\t\t\t\talert('Do you use CacheBuster? This will not work, yet.')\r\n\t\t\t\t\t\t\tsetTimeout(fnWaitForCore, 3000);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tloaderState = 3;\r\n\t\t\t\t\t\t\t_fnReady();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfnWaitForCore();\r\n\t\t\t\t}\r\n\t\t\t\telse loaderState = 4;\r\n\r\n\t\t\t\twaitForDone();\r\n\t\t\t}\r\n\t\t};\r\n\t\t\t\r\n\t\tfor(var attr in oConfig) {\r\n\t\t\ttargetScriptTag.setAttribute(attr,oConfig[attr]);\r\n\t\t}\r\n\t\t\r\n\t\tsetTimeout(function(){\r\n\t\t\tcoreLoaderScriptTag.parentElement.insertBefore(targetScriptTag, coreLoaderScriptTag);\r\n\t\t\tcoreLoaderScriptTag.parentNode.removeChild(coreLoaderScriptTag);\r\n\t\t}(this));\r\n\t\t\r\n\t\treturn true;\r\n }", "function loadLists() {\r\n\t\tlistItems();\r\n\t\taddCheckButtonEvents();\r\n\t\taddDeleteButtonEvents();\r\n\t}", "function importPrototypeScripts()\n{\n var scripts = \n [\n 'https://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js'\n ];\n \n for (i in scripts)\n {\n var script = document.createElement('script');\n script.src = scripts[i];\n document.getElementsByTagName('head')[0].appendChild(script);\n }\n}", "function loadFileListDefinition(definitionUrl, scriptsUrl) {\r\n if (definitionUrl == null || definitionUrl.length == 0)\r\n throw \"definitionUrl is null\";\r\n\r\n if (scriptsUrl != null && scriptsUrl[scriptsUrl.length - 1] != '/')\r\n scriptsUrl += '/';\r\n if (scriptsUrl == null)\r\n scriptsUrl = \"\";\r\n\r\n // Load services xml\r\n var req = Components.classes[\"@mozilla.org/xmlextras/xmlhttprequest;1\"]\r\n .createInstance()\r\n .QueryInterface(Components.interfaces.nsIXMLHttpRequest);\r\n\r\n req.open(\"GET\", definitionUrl, false);\r\n req.send(null);\r\n \r\n var def = req.responseXML;\r\n var list = def.evaluate('/files/script[@src]', def, null, nsIDOMXPathResult.ORDERED_NODE_ITERATOR_TYPE, null);\r\n var result = new Array();\r\n \r\n if (list != null) {\r\n // Iterate thru services definition\r\n for (var i = list.iterateNext(); i != null; i = list.iterateNext()) {\r\n var src = scriptsUrl + i.getAttribute(\"src\");\r\n result.push(src);\r\n }\r\n }\r\n \r\n return result;\r\n}", "function REST() {\n var configuration = SharePointClient.Configurations;\n var utility = new SharePointClient.Utilities.Utility();\n configuration.IsApp = true;\n \n\n var listServices = new SharePointClient.Services.REST.ListServices();\n\n //REST Listservices class for accessing list services\n var listServices = new SharePointClient.Services.REST.ListServices();\n\n //Set response type\n var responseType = SharePointClient.Constants.REST.HTTP.DATA_TYPE.JSON;\n\n var listTitle = \"xyz\";\n //Create Caml object\n var camlConstant = SharePointClient.Constants.CAML_CONSTANT;\n var camlQuery = new SharePointClient.CamlExtension.REST.CamlQuery();\n camlQuery.SetViewScopeAttribute(camlConstant.CAML_QUERY_SCOPE.RECURSIVE_ALL)\n .SetViewFieldsXml(\"<FieldRef Name='ID'/><FieldRef Name='Title'/>\")\n .SetQuery(\"<Where><Geq><FieldRef Name=\\\"Modified\\\" /><Value Type=\\\"DateTime\\\" IncludeTimeValue=\\\"TRUE\\\"\"\n + \"StorageTZ=\\\"TRUE\\\">2014-08-05T15:50:08</Value></Geq></Where>\")\n .OverrideQueryThrottleMode(camlConstant.CAML_QUERY_THROTTLE_MODE.OVERRIDE)\n .OverrideOrderByIndex()\n .SetRowLimit(5000);\n\n //Get All list items batch by list name\n listServices.GetListItemsBatchByListName(listTitle, camlQuery.BuildQuery(), responseType).Execute(function (result) {\n //logic for working with returned result set\n });\n}", "function load_externals() {\n\t\tvar css_url = wkof.support_files['jqui_wkmain.css'];\n\n\t\twkof.include('Jquery');\n\t\treturn wkof.ready('document, Jquery')\n\t\t\t.then(function(){\n\t\t\t\treturn Promise.all([\n\t\t\t\t\twkof.load_script(wkof.support_files['jquery_ui.js'], true /* cache */),\n\t\t\t\t\twkof.load_css(css_url, true /* cache */)\n\t\t\t\t]);\n\t\t\t})\n\t\t\t.then(function(){\n\t\t\t\t// Workaround...\thttps://community.wanikani.com/t/19984/55\n\t\t\t\tdelete $.fn.autocomplete;\n\t\t\t});\n\t}", "static get requires() {\r\n return {\r\n 'LW.Window': 'lw.window.js',\r\n 'LW.Calendar': 'lw.calendar.js',\r\n // 'LW.Menu': 'lw.menu.js',\r\n // 'LW.Tooltip': 'lw.tooltip.js'\r\n }\r\n }", "function loadSideBarEffectsScripts() {\n $.getScript('/resources/js/plugins/sidebar/classie.js');\n $.getScript('/resources/js/plugins/sidebar/sidebar-effects.js');\n}", "function callScripts() {\n\t\"use strict\";\n\tjsReady = true;\n\tsetTotalSlides();\n\tsetPreviousSlideNumber();\n\tsetCurrentSceneNumber();\n\tsetCurrentSceneSlideNumber();\n\tsetCurrentSlideNumber();\n}", "function DependencyLoader() {\n\t\n\tvar loadedImages = [];\n\t\n\t/**\n\t * Loads the given paths.\n\t * \n\t * @param paths is one or more paths to load as a string or string[]\n\t * @param onDone(err) is invoked when the paths are loaded or fail\n\t * @param maxThreads specifies the maximum number of parallel fetch requests (default 10)\n\t */\n\tthis.load = function(paths, onDone, maxThreads) {\n\t\tmaxThreads = maxThreads || 10;\n\t\t\n\t\t// listify paths\n\t\tif (!isArray(paths)) {\n\t\t\tassertTrue(isString(paths));\n\t\t\tpaths = [paths];\n\t\t}\n\t\t\n\t\t// collect images and scripts that aren't loaded\n\t\tvar imagesToLoad = [];\n\t\tvar scriptsToLoad = [];\n\t\tfor (var i = 0; i < paths.length; i++) {\n\t\t\tvar path = paths[i];\n\t\t\tassertDefined(path);\n\t\t\tif (path.endsWith(\".png\") || path.endsWith(\".jpg\") || path.endsWith(\".gif\")) {\n\t\t\t\tif (!arrayContains(loadedImages, path)) imagesToLoad.push(path);\n\t\t\t} else {\n\t\t\t\tif (!loadjs.isDefined(path)) {\n\t\t\t\t\tscriptsToLoad.push(path);\n\t\t\t\t\tloadjs(path, path);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// done if everything loaded\n\t\tif (!imagesToLoad.length && !scriptsToLoad.length) {\n\t\t\tif (onDone) onDone();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// simulate load time\n\t\tif (AppUtils.SIMULATED_LOAD_TIME) {\n\t\t\tsetTimeout(function() { loadAsync(); }, AppUtils.SIMULATED_LOAD_TIME);\n\t\t} else loadAsync();\n\t\t\n\t\t// executes functions to fetch scripts and images\n\t\tfunction loadAsync() {\n\t\t\tvar funcs = [getScriptsFunc(scriptsToLoad), getImagesFunc(imagesToLoad)];\n\t\t\tasync.parallelLimit(funcs, maxThreads, function(err, result) {\n\t\t\t\tif (onDone) onDone(err);\n\t\t\t});\n\t\t}\n\t\t\n\t\tfunction getScriptsFunc(paths) {\n\t\t\treturn function(onDone) {\n\t\t\t\tif (!paths.length) onDone();\n\t\t\t\telse {\n\t\t\t\t\tloadjs.ready(paths, {\n\t\t\t\t\t\tsuccess: onDone,\n\t\t\t\t\t\terror: function() { onDone(new Error(\"Failed to load dependencies: \" + paths)); }\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction getImagesFunc(paths) {\n\t\t\treturn function(onDone) {\n\t\t\t\tgetImages(paths, function(err) {\n\t\t\t\t\tif (err) onDone(new Error(\"Failed to load images: \" + paths));\n\t\t\t\t\telse {\n\t\t\t\t\t\tloadedImages = loadedImages.concat(paths);\n\t\t\t\t\t\tonDone();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\t\n\t/**\n\t * Determines if the given paths are loaded.\n\t * \n\t * @param paths is one or more paths to check if loaded\n\t */\n\tthis.isLoaded = function(paths) {\n\t\t\n\t\t// listify paths\n\t\tif (!isArray(paths)) {\n\t\t\tassertTrue(isString(paths));\n\t\t\tpaths = [paths];\n\t\t}\n\t\t\n\t\t// check if each path is loaded\n\t\tfor (var i = 0; i < paths.length; i++) {\n\t\t\tif (!arrayContains(loadedImages, paths[i]) && !loadjs.isDefined(paths[i])) return false;\n\t\t}\n\t\t\n\t\t// all paths loaded\n\t\treturn true;\n\t}\n}", "function LocalLoader() { }", "init() {\n this.addAdditionnalScripts();\n }", "static get requires() {\n return {\n 'JQX.ListBox': 'jqxlistbox.js'\n }\n }", "function loadScriptsAfterDocumentReady()\n{\n if (_lazyLoadScripts && _lazyLoadScripts != null)\n {\n for (var i = 0; i < _lazyLoadScripts.length; i++)\n {\n var scriptTag = document.createElement('script');\n scriptTag.type = 'text/javascript';\n scriptTag.src = _lazyLoadScripts[i];\n var firstScriptTag = document.getElementsByTagName('script')[0];\n firstScriptTag.parentNode.insertBefore(scriptTag, firstScriptTag);\n }\n }\n}", "function prepareLib( loads, cb ){\n\t\tvar tempConfig = loads.slice();\n\t\tvar ret_lib = {};\n\t\tloadOne();\n\t\t\n\t\tfunction loadOne(){\n\t\t\tif( tempConfig.length > 0 ){\n\t\t\t\tvar conf = tempConfig.shift();\n\t\t\t\tvar name = conf[0];\n\t\t\t\tvar path = conf[1];\n\t\t\t\tvar mtlPath = conf[2];\n\t\t\t\tif( mtlPath != undefined ){\n\t\t\t\t\tloadMeshAndMaterials( path, mtlPath, function ( mesh ) {\t\t\t\t\t\t//conf.mesh = mesh;\n\t\t\t\t\t\tret_lib[name] = mesh;\n\t\t\t\t\t\tloadOne();\n\t\t\t\t\t});\n\t\t\t\t}else{\n\t\t\t\t\tloadMesh( path, undefined, function ( mesh ) {\n\t\t\t\t\t\tret_lib[name] = mesh;\n\t\t\t\t\t\tloadOne();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tcb( ret_lib );\n\t\t\t}\n\t\t}\n\t}", "function requiredScriptsLoad( $instance_required_scripts, $instance_index, $data )\n {\n // we're here for the first time for this instance\n if ( ! $data )\n {\n $data = {};\n // check if we need to load asynchronously\n // for scripts depend on eachother\n $data.mode = 'asynchronous';\n $data.instance_required_scripts = $instance_required_scripts;\n $data.script_index = 0;\n $data.instance_index = $instance_index;\n \n if (\n $instance_required_scripts.mode\n )\n {\n $data.mode = $instance_required_scripts.mode;\n \n if ( $instance_required_scripts.scripts )\n {\n $data.instance_required_scripts = $instance_required_scripts.scripts;\n }\n }\n }\n \n if (\n $data.script_index !== undefined &&\n $data.instance_required_scripts &&\n $data.instance_required_scripts.length &&\n $data.script_index < $data.instance_required_scripts.length\n )\n {\n \n var script = $data.instance_required_scripts[$data.script_index];\n var load_script = true;\n var wait_for_script = true;\n \n // check if we loaded this script before\n for ( j = 0; j < _required_scripts_loaded.length; j++ )\n {\n if ( script === _required_scripts_loaded[j] )\n {\n load_script = false;\n wait_for_script = false;\n break;\n }\n }\n \n // check if the script is loading\n for ( j = 0; j < _required_scripts_loading.length; j++ )\n {\n if ( script === _required_scripts_loading[j] )\n {\n load_script = false;\n wait_for_script = true;\n break;\n }\n }\n \n // load file and add to the waiting list\n if ( load_script )\n {\n var script_add_to_waiting = true;\n \n _required_scripts_loading.push( script );\n \n for ( var j = 0; j < _required_scripts_waiting.length; j++ )\n {\n if ( script === _required_scripts_waiting[j].script )\n {\n script_add_to_waiting = false;\n break;\n }\n }\n \n if ( script_add_to_waiting )\n {\n _required_scripts_waiting.push( { script: script, instances: [] } );\n }\n \n (function( $data )\n {\n jQuery.ajax( \n {\n dataType: 'script',\n url: script,\n success: function()\n {\n requiredScriptLoaded( script );\n \n if ( $data.mode === 'consecutive' )\n {\n if ( $data.script_index < $data.instance_required_scripts.length )\n {\n $data.script_index += 1;\n requiredScriptsLoad( $data.instance_required_scripts, $data.instance_index, $data );\n }\n }\n }\n }\n );\n })( $data );\n }\n \n // add instance to waiting list for the script\n if ( wait_for_script )\n {\n for ( j = 0; j < _required_scripts_waiting.length; j++ )\n {\n if ( _required_scripts_waiting[j].script === script )\n {\n _required_scripts_waiting[j].instances.push( $data.instance_index );\n break;\n }\n }\n }\n \n // all required scripts have been loaded before\n if (\n ! wait_for_script &&\n ! load_script\n )\n {\n _component_instances[$data.instance_index].ready();\n }\n }\n \n if ( $data.mode === 'asynchronous' )\n {\n if ( $data.script_index < $data.instance_required_scripts.length )\n {\n $data.script_index += 1;\n requiredScriptsLoad( $data.instance_required_scripts, $data.instance_index, $data );\n }\n }\n }", "function loadDependencies (dependencies) {\n var loadedDependencies = [];\n loadedDependencies = dependencies.map(function (dependencyName) {\n if (libraryStorage.hasOwnProperty(dependencyName)) {\n var dependencies = libraryStorage[dependencyName].dependencies;\n\t\t\t\t\tvar callback = libraryStorage[dependencyName].callback;\n\t\t\t\t\treturn loadLibrary(dependencyName, dependencies, callback);\n }\n });\n return loadedDependencies;\n }", "function setup() {\n return new Promise(function(resolve,reject){\n let script = document.createElement('script');\n script.onload = resolve;\n script.setAttribute('src','https://unpkg.com/lunr/lunr.js');\n script.id = \"lunr\";\n document.head.appendChild(script); \n });\n }", "function init() {\n\t\tvar apisToLoad;\n\t\tvar loadCallback = function() {\n\t\t if (--apisToLoad == 0) {\n\t\t signin(true, userAuthed);\n\t\t }\n\t\t};\n\t\t\n\t\tapisToLoad = 2; // must match number of calls to gapi.client.load()\n\t\t//var ROOT = 'http://localhost:8888/_ah/api';\n\t\tvar ROOT = 'https://homelike-dot-steam-form-673.appspot.com/_ah/api';\n\t\tgapi.client.load('proveedorendpoint', 'v1',loadCallback, ROOT);\n\t\tgapi.client.load('oauth2', 'v2', loadCallback);\n\t}", "function load()\n{\n setupParts();\n\tbgn();\n}", "function loadStories() {\n // You can require as many stories as you need.\n require('../src/stories/button');\n require('../src/stories/form');\n require('../src/stories/pagination');\n}", "function loadSocial() {\n\n //Twitter\n if (typeof (twttr) != 'undefined') {\n twttr.widgets.load();\n } else {\n jQuery.getScript('http://platform.twitter.com/widgets.js');\n }\n\n //Facebook\n if (typeof (FB) != 'undefined') {\n FB.init({ status: true, cookie: true, xfbml: true });\n } else {\n jQuery.getScript(\"http://connect.facebook.net/en_US/all.js#xfbml=1\", function () {\n FB.init({ status: true, cookie: true, xfbml: true });\n });\n }\n\n //Google+\n if (typeof (gapi) != 'undefined') {\n jQuery(\".g-plusone\").each(function () {\n gapi.plusone.render($(this).get(0));\n });\n } else {\n jQuery.getScript('https://apis.google.com/js/plusone.js');\n }\n}", "function startLoading() {\n logger.debug('Starting runtime init')\n\n if(!Module['preRun']) Module['preRun'] = [];\n\n Module['locateFile'] = () => {\n return './vendor/pocketsphinx.wasm';\n };\n\n Module['onRuntimeInitialized'] = () => {\n var SUCCESS = Module.ReturnType.SUCCESS,\n BAD_STATE = Module.ReturnType.BAD_STATE,\n BAD_ARGUMENT = Module.ReturnType.BAD_ARGUMENT,\n RUNTIME_ERROR = Module.ReturnType.RUNTIME_ERROR;\n RETURNTYPES = {\n SUCCESS : 'SUCCESS',\n BAD_STATE: 'BAD_STATE',\n BAD_ARGUMENT: 'BAD_ARGUMENT',\n RUNTIME_ERROR: 'RUNTIME_ERROR'\n }\n\n logger.debug('Runtime initialized')\n dispatch({success: true})\n };\n\n importScripts('./vendor/pocketsphinx.js');\n}", "function loadExternalFilerScripst() {\n\t\n\t\t\n\tvar script = document.createElement(\"script\");\n script.src = \"http://test.stickyginger.co.za/tmg-wp-app/filter/jquery.ui.touch-punch.min.js\";\n script.type = \"text/javascript\";\n document.getElementsByTagName(\"body\")[0].appendChild(script);\n\t\n\tvar script = document.createElement(\"script\");\n script.src = \"http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js\";\n script.type = \"text/javascript\";\n document.getElementsByTagName(\"body\")[0].appendChild(script);\n\t\n\tvar script = document.createElement(\"script\");\n script.src = \"http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js\";\n script.type = \"text/javascript\";\n document.getElementsByTagName(\"body\")[0].appendChild(script);\n\t\n\tvar script = document.createElement(\"script\");\n script.src = \"//ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js\";\n script.type = \"text/javascript\";\n document.getElementsByTagName(\"body\")[0].appendChild(script);\n\t\n\tvar script = document.createElement(\"script\");\n script.src = \"http://test.stickyginger.co.za/tmg-wp-app/filter/js/jquery.min.js\";\n script.type = \"text/javascript\";\n document.getElementsByTagName(\"body\")[0].appendChild(script);\n\t\n\t var script2 = document.createElement(\"script\");\n // This script has a callback function that will run when the script has\n // finished loading.\n script2.src = \"http://test.stickyginger.co.za/tmg-wp-app/filter/js/fsfilter.js\";\n script2.type = \"text/javascript\";\n document.getElementsByTagName(\"body\")[0].appendChild(script2);\n\t\t\n\t var script2 = document.createElement(\"script\");\n // This script has a callback function that will run when the script has\n // finished loading.\n script2.src = \"http://test.stickyginger.co.za/tmg-wp-app/filter/jqFunctions.js\";\n script2.type = \"text/javascript\";\n document.getElementsByTagName(\"body\")[0].appendChild(script2);\n\t\n\t\n}", "function init() {\n loadTheme();\n loadBorderRadius();\n loadBookmarksBar();\n loadStartPage();\n loadHomePage();\n loadSearchEngine();\n loadCache();\n loadWelcome();\n}", "function loadDfsps() {\n // TODO: change getDfsps to include the promise chain, as I think this promise chain exists\n // everywhere it's used\n getDfsps()\n .then((dfsps) => {\n // TODO: Change dfsps.ids to something like dfsps.nameFromId; similarly dfsps.names ->\n // dfsps.idFromName.\n // Augment fspList with a map of ids -> names and vice-versa.\n dfsps.ids = Object // eslint-disable-line\n .assign(...dfsps.map((fsp) => ({ [fsp.id]: fsp.name })));\n // Note that names are guaranteed unique by the db. We assume here that the concept of\n // string uniqueness in mysql is no more strict than the concept of string uniqueness in\n // node\n dfsps.names = Object // eslint-disable-line\n .assign(...dfsps.map((fsp) => ({ [fsp.name]: fsp.id })));\n setFspList(dfsps.sort((a, b) => a.id - b.id));\n })\n .catch((err) => {\n if (err.name === 'AbortError') {\n setSnackBarParams({\n show: true, message: 'Timeout getting FSPs. Retry?', variant: 'error', callback: loadDfsps, action: 'retry',\n });\n } else {\n setSnackBarParams({\n show: true, message: 'An error occurred trying to get the FSP list. Retry?', variant: 'error', callback: loadDfsps, action: 'retry',\n });\n }\n });\n }", "function componentsLoad( $component_links )\n { \n // list of all component script files\n var component_scripts = getComponentScripts( $component_links ); \n \n if ( component_scripts.length )\n { \n for ( var i = 0; i < component_scripts.length; i++ )\n {\n var load_script = true;\n var wait_for_script = true;\n \n // check if we loaded this script before\n for ( var j = 0; j < _component_scripts_loaded.length; j++ )\n {\n if ( component_scripts[i] === _component_scripts_loaded[j] )\n {\n load_script = false;\n wait_for_script = false;\n break;\n }\n }\n \n // check if the script is loading\n for ( var j = 0; j < _component_scripts_loading.length; j++ )\n {\n if ( component_scripts[i] === _component_scripts_loading[j] )\n {\n load_script = false;\n wait_for_script = true;\n break;\n }\n }\n \n // load file and add it to the waiting list\n if ( load_script )\n { \n var script_add_to_waiting = true;\n \n _component_scripts_loading.push( component_scripts[i] );\n \n for ( var j = 0; j < _component_scripts_waiting.length; j++ )\n { \n if ( component_scripts[i] === _component_scripts_waiting[j].script )\n {\n script_add_to_waiting = false;\n break;\n }\n }\n \n if ( script_add_to_waiting )\n { \n _component_scripts_waiting.push( { script: component_scripts[i], instances: [] } );\n }\n \n (function( component_scripts, i )\n { \n jQuery.ajax( \n {\n dataType: 'script',\n url: component_scripts[i],\n success: function( $data, $xhr )\n {\n componentScriptLoaded( component_scripts, $component_links, i );\n }\n }\n );\n })( component_scripts, i );\n }\n \n // add link to waiting list for the script\n if ( wait_for_script )\n {\n for ( j = 0; j < _component_scripts_waiting.length; j++ )\n {\n if ( _component_scripts_waiting[j].script === component_scripts[i] )\n {\n _component_scripts_waiting[j].instances.push( i );\n break;\n }\n }\n }\n \n // the component script is loaded instantiate!\n if (\n ! load_script &&\n ! wait_for_script\n )\n {\n componentInit( $component_links[i] );\n }\n }\n }\n }", "function loadAPI() {\n // wait for all classes to be loaded\n // on attend que les classes soient chargées\n if (checkApiLoading('loadAPI();',['OpenLayers','Geoportal','Geoportal.Viewer','Geoportal.Viewer.Simple'])===false) {\n return;\n }\n\n // load API keys configuration, then load the interface\n // on charge la configuration de la clef API, puis on charge l'application\n Geoportal.GeoRMHandler.getConfig(['nhf8wztv3m9wglcda6n6cbuf'], null,null, {\n onContractsComplete: initMap\n });\n}", "function loadScripts(){\n renderer.setIPC();\n inject.uglifyScripts();\n inject.injectScripts();\n}", "function loadAPI() {\n // wait for all classes to be loaded\n // on attend que les classes soient chargées\n if (checkApiLoading('loadAPI();',['OpenLayers','Geoportal','Geoportal.Viewer','Geoportal.Viewer.Default'])===false) {\n return;\n }\n\n // load API keys configuration, then load the interface\n // on charge la configuration de la clef API, puis on charge l'application\n Geoportal.GeoRMHandler.getConfig(['nhf8wztv3m9wglcda6n6cbuf'], null,null, {\n onContractsComplete: initMap\n });\n}", "function LoadOpenLayersScript(callback){\n\tif (!$.fn.OpenLayers){\n\t\t$.getScript('http://www.openlayers.org/api/OpenLayers.js', callback);\n\t}\n\telse {\n\t\tif (callback && typeof(callback) === \"function\") {\n\t\t\tcallback();\n\t\t}\n\t}\n}", "function loadStories() {\n loadContext(introContext);\n loadContext(libraryContext);\n}", "load() {\n this.mainSegmentLoader_.load();\n if (this.audioPlaylistLoader_) {\n this.audioSegmentLoader_.load();\n }\n }", "function loadAPI() {\n // wait for all classes to be loaded\n // on attend que les classes soient chargées\n if (checkApiLoading('loadAPI();',['OpenLayers','Geoportal','Geoportal.Viewer','Geoportal.Viewer.Standard'])===false) {\n return;\n }\n\n // load API keys configuration, then load the interface\n // on charge la configuration de la clef API, puis on charge l'application\n Geoportal.GeoRMHandler.getConfig(['123454565444344'], null,null, {\n onContractsComplete: initMap\n });\n}", "function loadJQuery(){\n\tloadJQuery.loadLib(config.jQueryLibPath); //loading script\n\tloadJQuery.isReady(0); //waiting until the script is loaded\n}", "async function loadGapi() {\n //\n // Load gapi.js\n //\n if (window.gapi) {\n console.info('gapi.js already loaded.')\n } else {\n await logAction.promise(`loading ${GapiJavaScriptUrl}`, (resolve, reject) =>\n loadjs(GapiJavaScriptUrl, resolve, reject)\n )\n }\n\n //\n // Load and initialize client and auth2 libraries\n //\n let gapi = window.gapi\n await logAction.promise(`loading gapi modules ${GapiLibraries}`, (resolve, reject) =>\n gapi.load(GapiLibraries, { callback: resolve, onerror: reject })\n )\n return gapi\n}", "function readLibInfoFromProperties() {\n\t\n\t\t\t// read library properties\n\t\t\tvar oProperties = jQuery.sap.properties({url : sap.ui.resource(sLibName, \"library.properties\")});\n\t\n\t\t\t// version info\n\t\t\toLibInfo.version = oProperties.getProperty(sLibName + \"[version]\");\n\t\n\t\t\t// dependencies\n\t\t\tvar sDepInfo = oProperties.getProperty(sLibName + \"[dependencies]\");\n\t\t\tlog.debug(\"Required Libraries: \" + sDepInfo, null, METHOD);\n\t\t\toLibInfo.dependencies = (sDepInfo && sDepInfo.split(/[,;| ]/)) || [];\n\t\n\t\t\t// collect types, controls and elements\n\t\t\tvar aKeys = oProperties.getKeys(),\n\t\t\t rPattern = /(.+)\\.(type|interface|control|element)$/,\n\t\t\t aMatch;\n\t\t\tfor(var i=0; i<aKeys.length; i++) {\n\t\t\t\tvar sEntityPath = oProperties.getProperty(aKeys[i]);\n\t\t\t\tif ( aMatch = sEntityPath.match(rPattern) ) {\n\t\t\t\t\toLibInfo[aMatch[2]+\"s\"].push(aKeys[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function wlCommonInit(){\r\n // Common initialization code goes here\r\n console.log('>> MobileFirst Client SDK Initilized ...');\r\n angular.element(document).ready(function() {\r\n mfpMagicPreviewSetup();\r\n angular.bootstrap(document.body, ['starter']);\r\n });\r\n }", "function injectFirebaseLibs() {\n const firebaseLibs = [\n 'https://www.gstatic.com/firebasejs/7.5.0/firebase-analytics.js',\n 'https://www.gstatic.com/firebasejs/7.5.0/firebase-auth.js',\n 'https://www.gstatic.com/firebasejs/7.5.0/firebase-database.js',\n ]\n firebaseLibs.forEach(script => {\n const f = document.getElementsByTagName('script')[0]\n const j = document.createElement('script')\n j.defer = true\n j.onload = () => {\n scriptsLoaded.push(script)\n // console.log(externalDeps, scriptsLoaded, Date.now())\n if (externalDeps.length + firebaseLibs.length === scriptsLoaded.length) allScriptsLoaded()\n }\n j.src = script\n f.parentNode.insertBefore(j,f)\n })\n}", "load() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () { });\n }", "function handleClientLoad() { \n gapi.load('client:auth2', initClientCalendar);\n gapi.load('client:auth2', initClientPeople);\n console.log('people and calendar clients loaded');\n \t}", "function wpdojoloader_addOnLoad() {\r\n\ttry {\r\n\t\t\t//check if dojo is initialized\r\n\t\t\tif (!dojo.parser) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tdojo.parser.parse();\r\n\t\t\t} catch(e) {\r\n\t\t\t\talert(e);\r\n\t\t\t\t//return;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t//init a FisheyeLite for a li element\r\n\t\t\tinitFishEye();\r\n\t\t\t/*\r\n\t\t\tdojo.query(\".wpdojoloader_fisheyelite li\").forEach(function(n){\r\n\t\t\t\tnew dojox.widget.FisheyeLite({},n);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//init a FisheyeLite for a img element\r\n\t\t\tdojo.query(\".wpdojoloader_fisheyelite img\").forEach(function(n){\r\n\t\t\t\tnew dojox.widget.FisheyeLite({properties: {\r\n\t\t\t\t\t\t\t\t\t\t height:1.75,\r\n\t\t\t\t\t\t\t\t\t\t width:1.75\r\n\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t },n);\r\n\t\t\t});\r\n\t\t\t*/\r\n\t\t\t\r\n\t\t\t//init a Highlightner\t\t\t\r\n\t\t\tinitHighlightner();\r\n\t\t\t/*\r\n\t\t\tdojo.query(\".wpdojoloader_highlight\").forEach(function(n){\r\n\t\t\t\t\r\n\t\t\t\tvar code = n.innerHTML;\r\n\t\t\t\t\r\n\t\t\t\t//replace the <p> tags -> added from wordpress\r\n\t\t\t\t//if you want to show <p> tags in the code you have to\r\n\t\t\t\t//comment out this line\r\n\t\t\t\tcode = code.replace(/<p>/g,\"\"); \r\n\t\t\t\tcode = code.replace(/<\\/p>/g,\"\");\r\n\t\t\t\tcode = code.replace(/<br>/g,\"\");\r\n\t\t\t\tcode = code.replace(/<br\\/>/g,\"\");\r\n\t\t\t\tcode = code.replace(/<\\/br>/g,\"\");\r\n\t\t\t\tconsole.debug(code);\r\n\t\t\t\tn.innerHTML = code;\r\n\t\t\t\t\r\n\t\t\t\t//below is the dojo highlightner\r\n\t\t\t\t//it's not needed because translation is in xsl\r\n\t\t\t\t\r\n\t\t\t\tvar cd1 = dojox.highlight.processString(code,n.getAttribute(\"lang\"));\r\n\t\t\t\tn.innerHTML = cd1.result;\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\t*/\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//init a animation\r\n\t\t\tdojo.query(\".wpdojoloader_animation\").forEach(function(n){\r\n\t\t\t\tvar animation = n.getAttribute('animation');\r\n\t\t\t\tvar duration = parseInt(n.getAttribute('duration'));\r\n\t\t\t\tvar dojoanim = null;\r\n\t\t\t\t\r\n\t\t\t\tvar arg = {\r\n\t\t\t\t\tnode: n,\r\n\t\t\t\t\tduration: duration\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tswitch (animation) {\r\n\t\t\t\t\tcase \"fadein\":\r\n\t\t\t\t\t\tdojoanim = \tdojo.fadeIn(arg);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"fadeout\":\r\n\t\t\t\t\t\tdojoanim = \tdojo.fadeOut(arg);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (dojoanim) {\r\n\t\t\t\t\tdojoanim.play();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t//init a datagrid\r\n\t\t\tinitDatagrid();\r\n\t\t\t/*\r\n\t\t\tjQuery('.wpdojoloader_datagrid').each(function(){\r\n\t\t\t\r\n\t\t\t\t//init a store\r\n\t\t\t\tvar storetype = jQuery(this).parent().attr('storetype');\r\n\t\t\t\tvar uploaddir = jQuery(this).parent().attr('contentdir');\r\n\r\n\t\t\t\t//console.debug(this.id);\r\n\t\t\t\t//console.debug(this.jsID);\r\n\t\t\t\t\r\n\t\t\t\tvar dataStore = null;\r\n\t\t\t\tswitch (storetype) {\r\n\t\t\t\t\tcase \"csv\": //create a csv store\r\n\t\t\t\t\t\tvar storeurl = uploaddir + \"/\" + jQuery(this).parent().attr('filename');\r\n\t\t\t\t\t\t//console.debug(uploaddir);\r\n\t\t\t\t\t\t//var storeurl = \"wp-content/\" + jQuery(this).parent().attr('filename');\r\n\t\t\t\t\t\tdataStore = new dojox.data.CsvStore({\r\n\t\t\t\t\t\t\turl: storeurl,\r\n\t\t\t\t\t\t\tlabel: \"Title\"\r\n\t\t\t\t\t\t //seperator: \";\" //supported by dojo 1.4 ?\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"xml\": //create a xml datastore\r\n\t\t\t\t\t\tvar storeurl = \"wp-content/plugins/wpdojoloader/dojo_xmlstore_loadsave.php?filename=\" +uploaddir + \"/\" + jQuery(this).parent().attr('filename'); \r\n\t\t\t\t\t\tdataStore = new dojox.data.XmlStore({ \r\n\t\t\t\t\t\t\turl: storeurl, \r\n\t\t\t\t\t\t\turlPreventCache: false,\r\n\t\t\t\t\t\t\tid:\"teststore\",\r\n\t\t\t\t\t\t\tjsId:\"teststore\"\r\n\t\t\t\t\t\t\t//query: \"*\",\r\n\t\t\t\t\t\t\t//sendQuery: false\r\n\t\t\t\t\t\t}); \r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tif (!dataStore) \r\n\t\t\t\t\treturn;\r\n\t\t\t\t\r\n\t\t\t\tvar editable = jQuery(this).parent().attr('editable');\r\n\t\t\t\tif (!editable) \r\n\t\t\t\t{\r\n\t\t\t\t\teditable = \"false\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//load the field definitions\r\n\t\t\t\tvar id1 = jQuery(this).attr('id');\r\n\t\t\t\tvar fields = jQuery(this).parent().attr('fieldnames'); //list of fieldnames, seperated with comma\r\n\t\t\t\tif (!fields)\r\n\t\t\t\t{\r\n\t\t\t\t\tfields = \"name,link\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tvar layoutGrid = new Array();\r\n\t\t\t\tvar lst1 = fields.split(\",\"); //split the fieldlist\r\n\t\t\t\tif (lst1) {\r\n\t\t\t\t\tfor (var i=0;i<lst1.length;i++) {\r\n\t\t\t\t\t\tvar fo = {\r\n\t\t\t\t\t\t\tfield: lst1[i],\r\n\t\t\t\t\t\t\tname: lst1[i],\r\n\t\t\t\t\t\t\twidth: 'auto',\r\n\t\t\t\t\t\t\teditable: editable\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlayoutGrid.push(fo); \r\n\t\t\t\t\t}\r\n\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t//called when a cell is clicked\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\tdijit.byId(id1).onCellClick = function(event) {\r\n\t\t\t\t\t//console.debug(event.cellNode.textContent);\r\n\t\t\t\t\tvar content = event.cellNode.textContent; //content of the cell\r\n\t\t\t\t\t//this regexp checks if the content is valid url\r\n\t\t\t\t\tvar regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\r\n\t\t\t\t\tif (regexp.test(content)) { \r\n\t\t\t\t\t\twindow.open(content); //open the url in a new window\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\r\n\t\t\t\t//called when a row is clicked\r\n\t\t\t\tdijit.byId(id1).onRowClick = function(event){\r\n\t\t\t\t\tconsole.debug(\"onRowClick\");\r\n\t\t\t\t\tconsole.debug(event);\r\n\t\t\t\t\t//check all cells if there is a valid url and open it\r\n\t\t\t\t\tdojo.query(\"[role=gridcell]\", event.rowNode).forEach(\r\n\t\t\t\t\t function(element) {\r\n\t\t\t\t\t //console.debug(element.innerHTML);\r\n\t\t\t\t\t\t\tvar content = element.innerHTML;\r\n\t\t\t\t\t\t\tvar regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\r\n\t\t\t\t\t\t\tif (regexp.test(content)) { \r\n\t\t\t\t\t\t\t\twindow.open(content); //open the url in a new window\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}\r\n\t\t\t\t\r\n\t\t\t\t//onApplyCellEdit(inValue, inRowIndex, inFieldIndex);\r\n\t\t\t\tdijit.byId(id1).onApplyCellEdit = function(inValue, inRowIndex, inFieldIndex){\r\n\t\t\t\t\tconsole.debug(\"onApplyCellEdit\");\r\n\t\t\t\t\tconsole.debug(inValue);\r\n\t\t\t\t\tconsole.debug(inRowIndex);\r\n\t\t\t\t\tconsole.debug(inFieldIndex);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdataStore._saveCustom = function(saveComplete, saveFailed) {\r\n\t\t\t\t\talert(\"savecustom\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdataStore._getPostUrl = function(item) {\r\n\t\t\t\t\tconsole.debug(\"_getPostUrl\");\r\n\t\t\t\t\tconsole.debug(item);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdataStore._getPutUrl = function(item) {\r\n\t\t\t\t\tconsole.debug(\"_getPutUrl\");\r\n\t\t\t\t\tconsole.debug(item);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tdataStore._getFetchUrl = function(item) {\r\n\t\t\t\t\tconsole.debug(\"_getFetchUrl\");\r\n\t\t\t\t\tconsole.debug(item);\r\n\t\t\t\t\tif (item != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tconsole.debug(\"hallo\");\r\n\t\t\t\t\t\treturn this.url;\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn \"wpdojoloader/#\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\tconsole.debug(dataStore.fetchItemByIdentity);\r\n\t\t\t\tdataStore.fetchItemByIdentity = function(keywordArgs)\r\n\t\t\t\t{\r\n\t\t\t\t\tconsole.debug(\"fetchItemByIdentity\");\r\n\t\t\t\t\tconsole.debug(keywordArgs);\r\n\t\t\t\t\tconsole.debug(this.data);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t* /\r\n\t\t\t\t\r\n\t\t\t\tdijit.byId(id1).onApplyEdit = function(event){\r\n\t\t\t\t\t//log.error;\r\n\t\t\t\t\tconsole.debug(\"onApplyEdit\")\r\n\t\t\t\t\tconsole.debug(event);\r\n\t\t\t\t\t//alert(event);\r\n\t\t\t\t\t//dataStore.save();\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t/* you can use this for custom row styleing\r\n\t\t\t\tdijit.byId(id1).onStyleRow = function(inrow){\r\n\t\t\t\t}\r\n\t\t\t\t* /\r\n\t\t\t\t\r\n\t\t\t\tdijit.byId(id1).setStructure(layoutGrid);\t\r\n\t\t\t\t//dijit.byId(id1).setStore(dataStore, { query: \"*\" ,queryOptions: {ignoreCase: true}});\r\n\t\t\t\tdijit.byId(id1).setStore(dataStore);\r\n\t\t\t\tdijit.byId(id1).startup();\r\n\t\t\t}); //end datagrid\r\n\t\t\t*/\r\n\t\t\t\r\n\t\t\t//init a osm map\r\n\t\t\tdojo.query(\".wpdojoloader_osmmap\").forEach(function(n){\r\n\t\t\t\tconsole.debug(n);\r\n\t\t\t\tdojo.require(\"wpd.widget._BaseWidget\");\r\n\t\t\t\tdojo.require(\"wpd.widget.OsmMapWidget\");\r\n\t\t\t\tvar map = new wpd.widget.OsmMapWidget({}, n);\r\n\t\t\t\t\r\n\t\t\t\tconsole.debug(map);\r\n\t\t\t});\r\n\t\t\t\r\n}", "function xSmartLoadScript(url)\r\n{\r\n var loadedBefore = false;\r\n if (typeof(xLoadedList) != \"undefined\") {\r\n for (i=0; i<xLoadedList.length; i++) {\r\n if (xLoadedList[i] == url) {\r\n loadedBefore = true;\r\n break;\r\n }\r\n }\r\n }\r\n if (document.createElement && document.getElementsByTagName && !loadedBefore) {\r\n var s = document.createElement('script');\r\n var h = document.getElementsByTagName('head');\r\n if (s && h.length) {\r\n s.src = url;\r\n h[0].appendChild(s);\r\n if (typeof(xLoadedList) == \"undefined\") xLoadedList = new Array();\r\n xLoadedList.push(url);\r\n }\r\n }\r\n}", "function load()\n{\n dashcode.setupParts();\n loadVersionString();\n loadUserAppKey();\n}", "function requires(src){\r\n\treturn (new AjaxJSLoader(src)).retrieve();\r\n}", "function handleClientLoad() {\n // gapi.load(\"auth:client,drive-realtime,drive-share\", callback);\n checkAuth();\n}", "function setLoadlist() {\n getWindowHeight(); //get window height\n getWindowWidth(); //get window width\n setParallaxContainerDimensions(); //set parallax container height & width\n setParallaxImgDimensions(); //set parallax image element height & width\n getParallaxInfo(); //get parallax container and element information\n getWindowScrollPos(); //get current window scroll position\n\n if (typeof _onReady === 'function') {\n _onReady.call();\n }\n\n setParallaxScroll();\n }", "async function injectAllScripts() {\n\n // inject our customizations manually so that we can just depend on the\n // stock pdf.js viewer.html application.\n\n // TODO: make this into an if / then if we're running in a renderer process.\n // if(isElectron()) {\n // window.$ = window.jQuery = await require('/node_modules/jquery/dist/jquery.min.js');\n // } else {\n await injectScript('/node_modules/jquery/dist/jquery.min.js', 'module');\n window.$ = window.jQuery;\n // }\n\n // TODO: use a Promise.all() on all of these to await them as a batch.\n // It's not going to make a massive performance difference though since we\n // are loading locally.\n\n await injectScript('/web/js/utils.js', 'module');\n await injectScript('/web/js/polar.js');\n //injectScript('/web/js/annotations.js');\n await injectScript('/web/js/metadata.js');\n await injectScript('/web/js/model.js');\n await injectScript('/web/js/view.js', 'module');\n await injectScript('/web/js/controller.js', 'module');\n await injectScript('/web/js/clock.js');\n await injectScript('/web/js/optional.js');\n await injectScript('/web/js/datastore/datastore.js');\n await injectScript('/web/js/text-highlights.js', 'module');\n await injectScript('/lib/TextHighlighter.js');\n\n}", "function autoload() {\n var elm;\n _options.baseUrl = (elm = document.querySelector('meta[name=\"api-base\"]')) && elm.getAttribute('content');\n _token = (elm = document.querySelector('meta[name=\"api-token\"]')) && elm.getAttribute('content') || '';\n _csrf = (elm = document.querySelector('meta[name=\"csrf-token\"]')) && elm.getAttribute('content') || '';\n }", "function wpdojoloader_addOnLoad() {\r\n\ttry {\r\n\t\t\t//check if dojo is initialized\r\n\t\t\tif (!dojo.parser) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tdojo.parser.parse();\r\n\t\t\t} catch(e) {\r\n\t\t\t\talert(e);\r\n\t\t\t\t//return;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//init a FisheyeLite for a li element\t\t\t\r\n\t\t\tdojo.query(\".wpdojoloader_fisheyelite li\").forEach(function(n){\r\n\t\t\t\tnew dojox.widget.FisheyeLite({},n);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//init a FisheyeLite for a img element\r\n\t\t\tdojo.query(\".wpdojoloader_fisheyelite img\").forEach(function(n){\r\n\t\t\t\tnew dojox.widget.FisheyeLite({properties: {\r\n\t\t\t\t\t\t\t\t\t\t height:1.75,\r\n\t\t\t\t\t\t\t\t\t\t width:1.75\r\n\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t },n);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//init a Highlightner\t\t\t\r\n\t\t\tdojo.query(\".wpdojoloader_highlight\").forEach(function(n){\r\n\t\t\t\tvar cd1 = dojox.highlight.processString(n.innerHTML,n.getAttribute(\"lang\"));\r\n\t\t\t\tn.innerHTML = cd1.result;\r\n\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t//init a datagrid\r\n\t\t\tjQuery('.wpdojoloader_datagrid').each(function(){\r\n\t\t\t\r\n\t\t\t\t//init a store\r\n\t\t\t\tvar storetype = jQuery(this).parent().attr('storetype');\r\n\t\t\t\tvar uploaddir = jQuery(this).parent().attr('uploaddir'); \r\n\t\t\t\tvar dataStore = null;\r\n\t\t\t\tswitch (storetype) {\r\n\t\t\t\t\tcase \"csv\": //create a csv store\r\n\t\t\t\t\t\t//var storeurl = uploaddir + \"/\" + jQuery(this).parent().attr('filename');\r\n\t\t\t\t\t\t//console.debug(uploaddir);\r\n\t\t\t\t\t\tvar storeurl = \"wp-content/\" + jQuery(this).parent().attr('filename');\r\n\t\t\t\t\t\tdataStore = new dojox.data.CsvStore({\r\n\t\t\t\t\t\t\turl: storeurl,\r\n\t\t\t\t\t\t\tlabel: \"Title\"\r\n\t\t\t\t\t\t//seperator: \";\" //supported by dojo 1.4 ?\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tif (!dataStore) \r\n\t\t\t\t\treturn;\r\n\t\t\t\t\r\n\t\t\t\tvar id1 = jQuery(this).attr('id');\r\n\t\t\t\tvar fields = jQuery(this).parent().attr('fieldnames'); //list of fieldnames, seperated with comma\r\n\t\t\t\tvar layoutGrid = new Array();\r\n\t\t\t\tvar lst1 = fields.split(\",\"); //split the fieldlist\r\n\t\t\t\tif (lst1) {\r\n\t\t\t\t\tfor (var i=0;i<lst1.length;i++) {\r\n\t\t\t\t\t\tvar fo = {\r\n\t\t\t\t\t\t\tfield: lst1[i],\r\n\t\t\t\t\t\t\tname: lst1[i]\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlayoutGrid.push(fo); \r\n\t\t\t\t\t}\r\n\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t//called when a cell is clicked\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\tdijit.byId(id1).onCellClick = function(event) {\r\n\t\t\t\t\t//console.debug(event.cellNode.textContent);\r\n\t\t\t\t\tvar content = event.cellNode.textContent; //content of the cell\r\n\t\t\t\t\t//this regexp checks if the content is valid url\r\n\t\t\t\t\tvar regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\r\n\t\t\t\t\tif (regexp.test(content)) { \r\n\t\t\t\t\t\twindow.open(content); //open the url in a new window\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\r\n\t\t\t\t//called when a row is clicked\r\n\t\t\t\tdijit.byId(id1).onRowClick = function(event){\t\t\t\t\t\r\n\t\t\t\t\t//check all cells if there is a valid url and open it\r\n\t\t\t\t\tdojo.query(\"[role=gridcell]\", event.rowNode).forEach(\r\n\t\t\t\t\t function(element) {\r\n\t\t\t\t\t //console.debug(element.innerHTML);\r\n\t\t\t\t\t\t\tvar content = element.innerHTML;\r\n\t\t\t\t\t\t\tvar regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\r\n\t\t\t\t\t\t\tif (regexp.test(content)) { \r\n\t\t\t\t\t\t\t\twindow.open(content); //open the url in a new window\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}\r\n\t\t\t\t\r\n\t\t\t\t/* you can use this for custom row styleing\r\n\t\t\t\tdijit.byId(id1).onStyleRow = function(inrow){\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t\t\r\n\t\t\t\tdijit.byId(id1).setStructure(layoutGrid);\t\r\n\t\t\t\tdijit.byId(id1).setStore(dataStore, {/* query name: \"*\" */}, {ignoreCase: true});\r\n\t\t\t});\r\n\t\t\t\r\n}" ]
[ "0.6449085", "0.64078635", "0.63024586", "0.6263948", "0.622145", "0.61037815", "0.60471004", "0.6022259", "0.5891218", "0.58313876", "0.58059233", "0.5774939", "0.5758002", "0.5737387", "0.5598327", "0.5484892", "0.5454391", "0.5430105", "0.5426586", "0.5424552", "0.5397641", "0.5387302", "0.5292237", "0.5286164", "0.52566355", "0.52566355", "0.52227396", "0.52115417", "0.52045476", "0.5192615", "0.5167716", "0.515739", "0.5149779", "0.5146825", "0.5146218", "0.51438785", "0.5142177", "0.51307744", "0.50934327", "0.50833625", "0.50651485", "0.5057587", "0.50536877", "0.5041628", "0.5038393", "0.5021733", "0.50212425", "0.501171", "0.5006734", "0.50007135", "0.49988067", "0.4996829", "0.4986255", "0.4983859", "0.49777237", "0.49624944", "0.49613363", "0.49579763", "0.4954412", "0.49468812", "0.49446735", "0.49418378", "0.4940494", "0.49388027", "0.49375194", "0.49358168", "0.49318114", "0.49282354", "0.49273053", "0.4923743", "0.49233875", "0.49230078", "0.4920422", "0.4905511", "0.48933744", "0.48916617", "0.48864415", "0.48826414", "0.48804536", "0.48774353", "0.48723868", "0.48699528", "0.48667938", "0.48652625", "0.48609883", "0.48590472", "0.4852732", "0.48491707", "0.48428366", "0.48406017", "0.48333466", "0.4829695", "0.48256603", "0.48250365", "0.48244476", "0.4823853", "0.4811682", "0.4811608", "0.4809904", "0.48079515" ]
0.59383565
8
Function to retrieve a query string value. For production purposes you may want to use a library to handle the query string.
function getQueryStringParameter(paramToRetrieve) { var params = document.URL.split("?")[1].split("&"); var strParams = ""; for (var i = 0; i < params.length; i = i + 1) { var singleParam = params[i].split("="); if (singleParam[0] == paramToRetrieve) return singleParam[1]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function queryValue() {\n var qrStr = window.location.search;\n if (qrStr)\n var qrvalue = (qrStr.split(\"?\")[1].split(\"=\")[1]);\n return decodeURIComponent(qrvalue);\n}", "function queryValue() {\n var qrStr = window.location.search;\n if (qrStr)\n var qrvalue = (qrStr.split(\"?\")[1].split(\"=\")[1]);\n\n return decodeURIComponent(qrvalue);\n}", "function queryStringValue(queryString) {\n queryStringPart = window.location.search.substring(1);\n queryStringArray = queryStringPart.split(\"&\");\n for (i = 0; i < queryStringArray.length; i++) {\n nameValuePair = queryStringArray[i].split(\"=\");\n if (nameValuePair[0] == queryString) {\n return nameValuePair[1];\n }\n }\n\n return null;\n }", "function getQueryStringValue(name) {\r\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\r\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\"),\r\n results = regex.exec(location.search);\r\n return results === null ? \"\" : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\r\n }", "function returnQueryValue(queryParam) {\n // TODO need to refactor and decouple from window.location\n queryParamList = window.location.search.substring(1);\n parsedParams = queryParamList.split(\"&\");\n var finalParamValue = \"\";\n for (i=0;i<parsedParams.length;i++) {\n param = parsedParams[i].split(\"=\");\n if (param[0] == queryParam) {\n finalParamValue = param[1];\n }\n }\n return finalParamValue;\n}", "function QueryString() {\n var query_string = {};\n var query = window.location.search.substring(1);\n return query;\n}", "function QueryString() {\n var query_string = {};\n var query = window.location.search.substring(1);\n return query;\n}", "function GetQueryString(name) {\n var reg = new RegExp(\"(^|&)\" + name + \"=([^&]*)(&|$)\", \"i\");\n var r = window.location.search.substr(1).match(reg);\n if (r != null) return (r[2]);\n return null;\n}", "function GetQueryStringValue(strId,strQuerystring) {\n if (!strQuerystring) {\n strQuerystring = location.search;\n }\n strFindId = strId + \"=\";\n intStart = strQuerystring.indexOf(strFindId) + strFindId.length;\n\n if (intStart > strFindId.length) {\n strRestOfQS = strQuerystring.substring(intStart,strQuerystring.length);\n intEnd = strRestOfQS.indexOf('&');\n if (intEnd == -1) {\n intEnd = strQuerystring.length;\n }\n else {\n intEnd = intStart + intEnd;\n }\n strValue = strQuerystring.substring(intStart,intEnd);\n }\n else {\n strValue = \"\";\n }\n\n return strValue;\n}", "function getGETQueryValue(variableName, defaultValue) {\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 (pair[0] === variableName)\n return pair[1];\n }\n return defaultValue;\n}", "function matchUrlQueryParamValue(str){var match=str.match(QUERY_PARAM_VALUE_RE);return match?match[0]:'';}", "getQueryString( key ) {\n var value = window.location.search.match( new RegExp( \"[?&]\" + key + \"=([^&]*)(&?)\", \"i\" ) );\n return value ? value[1] : value;\n }", "function GetQueryString(name){\r\n\t var reg = new RegExp(\"(^|&)\"+ name +\"=([^&]*)(&|$)\");\r\n\t var r = window.location.search.substr(1).match(reg);\r\n\t if(r!=null)return unescape(r[2]); return null;\r\n\t}", "function getQueryStringValue (key) {\n return decodeURIComponent(window.location.search.replace(new RegExp(\"^(?:.*[&\\\\?]\" + encodeURIComponent(key).replace(/[\\.\\+\\*]/g, \"\\\\$&\") + \"(?:\\\\=([^&]*))?)?.*$\", \"i\"), \"$1\"));\n}", "function getQueryStringValue (key) {\n return decodeURIComponent(window.location.search.replace(new RegExp(\"^(?:.*[&\\\\?]\" + encodeURIComponent(key).replace(/[\\.\\+\\*]/g, \"\\\\$&\") + \"(?:\\\\=([^&]*))?)?.*$\", \"i\"), \"$1\"));\n}", "function getQueryStringValue (key) {\n return decodeURIComponent(window.location.search.replace(new RegExp(\"^(?:.*[&\\\\?]\" + encodeURIComponent(key).replace(/[\\.\\+\\*]/g, \"\\\\$&\") + \"(?:\\\\=([^&]*))?)?.*$\", \"i\"), \"$1\"));\n}", "function getQueryStringValue (key) {\n return decodeURIComponent(window.location.search.replace(new RegExp(\"^(?:.*[&\\\\?]\" + encodeURIComponent(key).replace(/[\\.\\+\\*]/g, \"\\\\$&\") + \"(?:\\\\=([^&]*))?)?.*$\", \"i\"), \"$1\"));\n}", "function matchUrlQueryParamValue(str) {\n var match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function matchUrlQueryParamValue(str) {\n var match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function matchUrlQueryParamValue(str) {\n var match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function matchUrlQueryParamValue(str) {\n var match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function umGetQueryString(name){\n var reg = new RegExp(\"(^|&)\"+ name +\"=([^&]*)(&|$)\");\n var r = window.location.search.substr(1).match(reg);\n if(r!=null)return unescape(r[2]); return null;\n}", "function getQuery(name) {\n if (name == null)\n return null;\n try {\n if (typeof name === \"string\") {\n var result = location.search.match(new RegExp(\"[\\?\\&]\" + name + \"=([^\\&]+)\", \"i\"));\n if (result == null || result.length < 1) {\n return \"\";\n }\n return result[1];\n }\n else if (typeof name === \"number\") {\n var result = location.search.match(new RegExp(\"[\\?\\&][^\\?\\&]+=[^\\?\\&]+\", \"g\"));\n if (result == null) {\n return \"\";\n }\n return result[name].substring(1);\n }\n }\n catch (ex) { }\n return null;\n }", "function waGetQueryString(queryParam) {\n\tfullSubString = window.location.search.substring(1);\n\tsplitSubString = fullSubString.split(\"&\");\n\tfor (i=0;i<splitSubString.length;i++) {\n\t\tparamValue = splitSubString[i].split(\"=\");\n\t\tif (paramValue[0] == queryParam) {\n\t\t\treturn paramValue[1];\n\t\t}\n\t}\n}", "function matchUrlQueryParamValue(str) {\n var match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function getQueryString(name)\r\n {\r\n var reg = new RegExp(\"(^|&)\" + name + \"=([^&]*)(&|$)\", \"i\");\r\n var r = window.location.search.substr(1).match(reg);\r\n if (r !== null) return unescape(r[2]); return null;\r\n }", "function matchUrlQueryParamValue(str) {\n var match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n }", "function getQueryStringValue(key)\n{ \n return unescape(window.location.search.replace(new RegExp(\"^(?:.*[&\\\\?]\" + escape(key).replace(/[\\.\\+\\*]/g, \"\\\\$&\") + \"(?:\\\\=([^&]*))?)?.*$\", \"i\"), \"$1\")); \n}", "function get_query_var( name ) {\n\n var match = RegExp('[?&]' + name + '=([^&#]*)').exec(location.href);\n return match && decodeURIComponent(match[1].replace(/\\+/g, ' ')); \n}", "function getQueryStringValue(sURL, sKey) {\n if (sURL.indexOf(\"?\") != -1)\n sURL = decodeURIComponent(sURL.split(\"?\")[1]);\n var sQuery = sURL.toString();\n var sPairs = sQuery.split(\"&\");\n for (var i = 0; i < sPairs.length; i++) {\n var iPos = sPairs[i].indexOf('=');\n if (iPos >= 0) {\n if (sPairs[i].substring(0, iPos).toLowerCase() == sKey.toLowerCase())\n return sPairs[i].substring(iPos + 1);\n }\n }\n return \"\";\n}", "function getQuerystring(key) {\n var regex, qs;\n key = key.replace(/[\\[]/, \"\\\\\\[\").replace(/[\\]]/, \"\\\\\\]\");\n regex = new RegExp(\"[\\\\?&]\" + key + \"=([^&#]*)\");\n qs = regex.exec(window.location.href);\n if (qs === null) {\n return null;\n } else {\n return qs[1];\n }\n }", "function matchUrlQueryParamValue(str) {\n const match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function matchUrlQueryParamValue(str) {\n const match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function matchUrlQueryParamValue(str) {\n const match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function matchUrlQueryParamValue(str) {\n const match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function matchUrlQueryParamValue(str) {\n const match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function matchUrlQueryParamValue(str) {\n const match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function GetQueryStringParameter(name) {\n name = name.replace(/[\\[]/, \"\\\\\\[\").replace(/[\\]]/, \"\\\\\\]\");\n var regexS = \"[\\\\?&]\" + name + \"=([^&#]*)\";\n var regex = new RegExp(regexS);\n var results = regex.exec(window.location.href);\n if (results == null)\n return \"\";\n else\n return results[1];\n}", "function getQueryString() {\n var result = {}, queryString = location.search.substring(1),\n re = /([^&=]+)=([^&]*)/g, m;\n\n while (m = re.exec(queryString)) {\n result[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);\n }\n\n return result;\n }", "function getQuerystring(key, default_) {\n if (default_ === null) default_ = \"\";\n key = key.replace(/[\\[]/, \"\\\\\\[\").replace(/[\\]]/, \"\\\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + key + \"=([^&#]*)\");\n var qs = regex.exec(window.location.href);\n if (qs === null) {\n return default_;\n } else {\n return qs[1];\n }\n}", "function getQuerystring(key, default_) {\n if (default_ === null) default_ = \"\";\n key = key.replace(/[\\[]/, \"\\\\\\[\").replace(/[\\]]/, \"\\\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + key + \"=([^&#]*)\");\n var qs = regex.exec(window.location.href);\n if (qs === null) {\n return default_;\n } else {\n return qs[1];\n }\n}", "function getUrlValue(name){ \n\tvar r = location.search.substr(1).match(new RegExp(\"(^|&)\"+ name +\"=([^&]*)(&|$)\")); \n\tif (r!=null) return unescape(r[2]); return null;\n}", "function getQueryString(name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\"),\n results = regex.exec(location.search);\n return results === null ? \"\" : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n}", "function getQuerystring(e,a){null==a&&(a=\"\"),e=e.replace(/[\\[]/,\"\\\\[\").replace(/[\\]]/,\"\\\\]\");var t=new RegExp(\"[\\\\?&]\"+e+\"=([^&#]*)\"),o=t.exec(window.location.href);return null==o?a:o[1]}", "function getQuery() {\n return currentPathQuery.split('?')[1];\n }", "function getQuery(q) {\n\t\t\treturn (window.location.search.match(new RegExp('[?&]' + q + '=([^&]+)')) || [, null])[1];\n\t\t}", "function $_GET(name) {\n\tvar match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);\n\treturn match && decodeURIComponent(match[1].replace(/\\+/g,' '));\n}", "function getQuerystringPar(key, default_)\n{\n if (default_==null) default_=\"\";\n key = key.replace(/[\\[]/,\"\\\\\\[\").replace(/[\\]]/,\"\\\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\"+key+\"=([^&#]*)\");\n var qs = regex.exec(window.location.href);\n if(qs == null)\n return default_;\n else\n return qs[1];\n}", "function get(name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\"),\n results = regex.exec(location.search);\n return results === null ? \"\" : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n}", "function reqGetParam(paramName){\n\t\ttry {\n\t\t\tvar aryParam = window.location.href.split(\"?\")[1].split(\"&\");\n\t\t\tfor ( var i = 0; i < aryParam.length; i++) {\n\t\t\t\tif (paramName.toUpperCase() == aryParam[i].split(\"=\")[0]\n\t\t\t\t\t\t.toUpperCase()) {\n\t\t\t\t\treturn aryParam[i].split(\"=\")[1];\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (ex) {\n\t\t\treturn \"\";\n\t\t}\n\t\treturn \"\";\n\t}", "function getQueryParam(name) {\n if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(window.location.search))\n return decodeURIComponent(name[1]);\n }", "function get(name){\n if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search))\n return decodeURIComponent(name[1]);\n }", "function getParameterValue(str){\n\tvar value = \"\";\n\tvar prmindex = window.location.href.indexOf(\"&\" + str + \"=\");\n\tif (prmindex === -1) {\n\t\tprmindex = window.location.href.indexOf(\"?\" + str + \"=\");\n\t}\n\tif (prmindex > -1) {\n\t\tvar startindex = window.location.href.indexOf(\"=\",prmindex) + 1;\n\t\tvar endindex = window.location.href.indexOf('&',startindex);\n\t\tif (endindex === -1) {\n\t\t\tendindex = window.location.href.length;\n\t\t}\n\t\tvalue = window.location.href.substring(startindex, endindex);\n\t}\n\treturn value;\n}", "function getQueryParam(name) {\n name = name.replace(/[\\[]/, \"\\\\\\[\").replace(/[\\]]/, \"\\\\\\]\");\n var regexS = \"[\\\\?&]\" + name + \"=([^&#]*)\";\n var regex = new RegExp(regexS);\n var results = regex.exec(window.location.search);\n if(results == null)\n return \"\";\n else\n return decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n}", "function getQueryString(name, url) {\n if (!url) url = window.location.href;\n name = name.replace(/[\\[\\]]/g, \"\\\\$&\");\n var regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\"),\n results = regex.exec(url);\n if (!results) return null;\n if (!results[2]) return null;\n return decodeURIComponent(results[2].replace(/\\+/g, \" \"));\n}", "function get(name){\n if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search))\n return decodeURIComponent(name[1]);\n}", "function get(name) {\n if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(location.search))\n return decodeURIComponent(name[1]);\n}", "function get(name){\n\tif(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search))\n\t\treturn decodeURIComponent(name[1]);\n}", "function get(name){\n if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search))\n return decodeURIComponent(name[1]);\n}", "function getQueryString(name, url) {\n if (!url) url = window.location.href;\n name = name.replace(/[\\[\\]]/g, \"\\\\$&\");\n var regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\"),\n results = regex.exec(url);\n if (!results) return null;\n if (!results[2]) return null;\n return decodeURIComponent(results[2].replace(/\\+/g, \" \"));\n}", "function getParameter(param){\n var value = \"\";\n var query = window.location.search;\n var iStart = query.indexOf(param);\n var iLen = param.length;\n var iCurrent = iStart + iLen + 1;\n while(query.charAt(iCurrent) != '&'\n && query.charAt(iCurrent) != \"\"){\n value += query.charAt(iCurrent);\n iCurrent++;\n }\n return value;\n}", "function getQueryParam(name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\"),\n results = regex.exec(location.search);\n return results == null ? \"\" : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n}", "function getQueryParam(name) {\n name = name.replace(/[\\[]/, \"\\\\\\[\").replace(/[\\]]/, \"\\\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n var results = regex.exec(location.search);\n return results === null ? null : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n}", "function q(){\n\t// This function is anonymous, is executed immediately and\n\t// the return value is assigned to QueryString!\n\tvar query_string = {};\n\tvar query = window.location.search.substring(1);\n\tvar found = false;\n\tvar vars = query.split(\"&\");\n\tfor (var i=0;i<vars.length;i++) {\n\t\tvar pair = vars[i].split(\"=\");\n\t\tif(pair[i] != \"\"){\n\t\t\t// If first entry with this name\n\t\t\tif (typeof query_string[pair[0]] === \"undefined\") {\n\t\t\t\tquery_string[pair[0]] = decodeURIComponent(pair[1]);\n\t\t\t// If second entry with this name\n\t\t\t} else if (typeof query_string[pair[0]] === \"string\"){\n\t\t\t\tvar arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];\n\t\t\t\tquery_string[pair[0]] = arr;\n\t\t\t// If third or later entry with this name\n\t\t\t} else {\n\t\t\t\tquery_string[pair[0]].push(decodeURIComponent(pair[1]));\n\t\t\t}\n\t\t\tfound = true;\n\t\t}\n\t}\n\t//if(found) console.log(\"query_string: \", query_string);\n\t//\telse console.log(\"no query_string\");\n\treturn query_string;\n}", "function getParameterByName(name) {\n return parseQS(getWindowLocation().search)[name] || '';\n}", "function getQueryStringParameter(urlParameterKey) {\n var params = document.URL.split('?')[1].split('&');\n var strParams = '';\n for (var i = 0; i < params.length; i = i + 1) {\n var singleParam = params[i].split('=');\n if (singleParam[0] == urlParameterKey)\n return singleParam[1];\n }\n }", "static getQuery(url) {\n let pieces = url.split('?');\n if (pieces.length == 2) {\n return pieces[1];\n } else {\n return false;\n }\n }", "function getQueryString(url, name) {\n var a = name.replace(/[\\[]/, '\\\\\\[').replace(/[\\]]/, '\\\\\\]');\n var regexS = '[\\\\?&]' + a + '=([^&#]*)';\n var regex = new RegExp(regexS);\n var results = regex.exec(url);\n if (results === null) return '';\n else return decodeURIComponent(results[1].replace(/\\+/g, ' '));\n }", "function get$1() {\n return queryString.parse(splitHref()[1]);\n }", "function getQueryString(param) {\n\t var result = {}, queryString = location.search.substring(1),\n\t re = /([^&=]+)=([^&]*)/g, m;\n\n\t while (m = re.exec(queryString)) {\n\t result[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);\n\t }\n\n\t return result[param];\n}", "function qs(key) {\n key = key.replace(/[*+?^$.\\[\\]{}()|\\\\\\/]/g, \"\\\\$&\"); // escape RegEx meta chars\n var match = location.search.match(new RegExp(\"[?&]\"+key+\"=([^&]+)(&|$)\"));\n return match && decodeURIComponent(match[1].replace(/\\+/g, \" \"));\n}", "function GetRequestParam(name) {\n name = name.replace(/[\\[]/, \"\\\\\\[\").replace(/[\\]]/, \"\\\\\\]\");\n var regexS = \"[\\\\?&]\" + name + \"=([^&#]*)\";\n var regex = new RegExp(regexS);\n var results = regex.exec(window.location.href);\n if (results == null)\n return \"\";\n else\n return results[1];\n}", "function getQueryString() {\n return window.location.search\n .substr(1)\n .split('&')\n .map(item => item.split('='))\n .reduce((acc, curr) => {\n acc[curr[0]] = curr[1];\n return acc;\n }, {});\n}", "function $_GET(q, s) {\n s = s ? s : window.location.search;\n var re = new RegExp(\"&\" + q + \"(?:=([^&]*))?(?=&|$)\", \"i\");\n return (s = s.replace(\"?\", \"&\").match(re)) ?\n typeof s[1] == \"undefined\" ?\n \"\" :\n decodeURIComponent(s[1]) :\n undefined;\n}", "function valueFromUrl(key) {\n\tvar r = new RegExp(`${key}=([^&]*)`);\n\tvar match = document.location.search.match(r);\n\tif (match && match[1]) {\n\t\treturn match[1];\n\t}\n\treturn null;\n}", "function getQueryVariable(variable) {\n var query = window.location.search.substring(1);\n var vars = query.split(\"&amp;\");\n for (var i=0;i<vars.length;i++) {\n var pair = vars[i].split(\"=\");\n if (pair[0] == variable){return pair[1];}\n }\n alert('Query variable ' + variable + ' not found');\n }", "function getParam(parameterName){\r\n\tvar queryStr = window.location.search.substring(1);\r\n\tvar properties = queryStr.split(\"&\");\r\n\tfor(var i = 0; i < properties.length; i++){\r\n\t\tvar propertyPair = properties[i];\r\n\t\tproperty = propertyPair.split(\"=\");\r\n\t\tif(property[0] == parameterName){\r\n\t\t\tif(property.length != 1)\r\n\t\t\t\treturn property[1];\r\n\t\t\telse\r\n\t\t\t\treturn \"\";\r\n\t\t}\r\n\t}\r\n\treturn \"\";\r\n}", "function getParam(sname) {\n var params = location.search.substr(location.search.indexOf(\"?\") + 1);\n var sval = \"\";\n params = params.split(\"&\");\n // split param and value into individual pieces\n for (var i = 0; i < params.length; i++) {\n temp = params[i].split(\"=\");\n if ([temp[0]] == sname) {\n sval = temp[1];\n }\n }\n return sval;\n}", "function findGetParameter(parameterName){\n var result = null;\n tmp = [];\n var items = location.search.substr(1).split(\"&\");\n for(var index = 0; index < items.length; index++){\n tmp = items[index].split(\"=\");\n if(tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);\n }\n return result;\n}", "function q(req){\n\treturn qs.parse(url.parse(req.url).query);\n}", "function getParameter(name) {\n var query = window.location.search.substring(1);\n params = query.split('&');\n for (var i = 0; i < params.length; ++i) {\n var p = params[i].split('=');\n if (p[0] === name) {\n return p[1];\n }\n }\n return null;\n }", "function getValueFromQueryString(key){\r\n //new array\r\n var result = new Array(\"No Query String\",\"No Query String\");\r\n \r\n //search get ?key1=value1&key2=value2&...\r\n //substring get key1=value1&key2=value2&...\r\n var queryStr = window.location.search.substring(1);\r\n \r\n if (queryStr!=undefined){\r\n //split value to array \r\n //ex key1=value1,key2=value2,...\r\n var queryArray = queryStr.split(\"&\");\r\n \r\n for(i=0;i<queryArray.length;i++){\r\n if(queryArray[i].indexOf(key) >= 0){\r\n //key1,value1\r\n result = queryArray[i].split(\"=\");\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return result[1];\r\n}", "function queryString( name ){\n\tname = name.replace(/[\\[]/,\"\\\\\\[\").replace(/[\\]]/,\"\\\\\\]\");\n\tvar regexS = \"[\\\\?&]\"+name+\"=([^&#]*)\";\n\tvar regex = new RegExp( regexS );\n\tvar results = regex.exec( window.location.href );\n\tif( results == null ){\n\t\treturn \"\";\n\t}\n \telse{\n \t\treturn decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n\t}\n}", "getQueryParam(key) {\n return readQueryParam(this.win.location.href, key);\n }", "function qs(key) {\n key = key.replace(/[*+?^$.\\[\\]{}()|\\\\\\/]/g, \"\\\\$&\"); // escape RegEx meta chars\n var match = location.search.match(new RegExp(\"[?&]\"+key+\"=([^&]+)(&|$)\"));\n return match && decodeURIComponent(match[1].replace(/\\+/g, \" \"));\n }", "function getURLParameter(name) {\n \"use strict\";\n // This function will return null if this specific parameter is not found\n var parameterValue = null;\n // Perform a regex match to find the value of the parameter from the query string\n var parameterRegex = new RegExp(\"[?|&]\" + name + \"=\" + \"([^&;]+?)(&|#|;|$)\").exec(location.search);\n if (parameterRegex) {\n // If the regex found a match, replace any occurrence of + by %20\n parameterValue = parameterRegex[1].replace(/\\+/g, \"%20\");\n // and perform proper decoding of the URI\n parameterValue = decodeURIComponent(parameterValue);\n }\n // Returns either null or the value of that parameter\n return parameterValue;\n}", "function getQueryVariable(variable, defval) {\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 (pair[0] == variable) {\n return pair[1];\n }\n } \n return defval;\n}", "function getUrlParam(name){\n if(window.location.search == '') return null;\n let params = window.location.search.substr(1).split('&').map(function(item){return item.split(\"=\").map(decodeURIComponent);});\n let found = params.find(function(item){return item[0] == name});\n return (typeof found == \"undefined\")?null:found[1];\n }", "getQueryVariable(variable){\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(pair[0] === variable){return pair[1];}\n }\n return(false);\n }", "function getParamValue(param) {\n var urlParamString = location.search.split(param + \"=\");\n if (urlParamString.length <= 1) \n\t{\n\t\treturn \"\";\n\t}\n else {\n var tmp = urlParamString[1].split(\"&\");\n return tmp[0];\n }\n}", "function getQueryVariable( key, queryString ) {\n var query;\n var vars;\n\n if ( typeof queryString === 'string' ) {\n query = queryString;\n } else {\n query = window.location.search.substring( 1 );\n }\n\n vars = query.split( '&' );\n\n for ( var i = 0; i < vars.length; i++ ) {\n var pair = vars[i].split( '=' );\n if ( pair[0] === key ) {\n return pair[1];\n }\n }\n\n return false;\n}", "function getQueryString(){ \n zquery = parent.location.search; \n zquery = zquery.substring(1,zquery.length); \n return (zquery);\n}", "function getParamFromURL( name ) {\n name = name.replace(/[\\[]/,\"\\\\[\").replace(/[\\]]/,\"\\\\]\");\n var regexS = \"[\\?&]\"+name+\"=([^&#]*)\";\n var regex = new RegExp( regexS );\n var results = regex.exec( window.location.href );\n if( results == null )\n return \"\";\n else\n return results[1];\n }", "function getParameter (parameterName ) {\n\n var queryString = window.top.location.search.substring(1);\n\n // Add \"=\" to the parameter name (i.e. parameterName=value)\n var parameterName = parameterName + \"=\";\n if ( queryString.length > 0 ) {\n // Find the beginning of the string\n begin = queryString.indexOf ( parameterName );\n // If the parameter name is not found, skip it, otherwise return the value\n if ( begin != -1 ) {\n // Add the length (integer) to the beginning\n begin += parameterName.length;\n // Multiple parameters are separated by the \"&\" sign\n end = queryString.indexOf ( \"&\" , begin );\n if ( end == -1 ) {\n end = queryString.length\n }\n // Return the string\n return unescape ( queryString.substring ( begin, end ) );\n }\n // Return \"null\" if no parameter has been found\n return null;\n }\n}", "getEncodedQuery() {}", "function getParamValue(paramName) {\n\tvar cmdRe=RegExp( '[&?]' + paramName + '=([^&]*)' );\n\tvar h = document.location.href;\n\tvar m=cmdRe.exec(h);\n\tif (m) {\n\t\ttry {\n\t\t\treturn decodeURIComponent(m[1]);\n\t\t} catch (someError) {}\n\t}\n\treturn null;\n}", "function getURLParameter(param){\n var pageURL = window.location.search.substring(1); //get the query string parameters without the \"?\"\n var URLVariables = pageURL.split('&'); //break the parameters and values attached together to an array\n for (var i = 0; i < URLVariables.length; i++) {\n var parameterName = URLVariables[i].split('='); //break the parameters from the values\n if (parameterName[0] == param) {\n return parameterName[1];\n }\n }\n return null;\n }", "getQueryParameter(key) {\n if (key) {\n const value = this.queryParams[key.toLowerCase()];\n if (typeof value == 'string') {\n return value;\n }\n else if (Array.isArray(value)) {\n return String(value[0]);\n }\n }\n return null;\n }", "urlParam(name){\n var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href)\n return (results && results[1]) || undefined\n }" ]
[ "0.8209506", "0.81985337", "0.8084118", "0.769233", "0.76275235", "0.7474217", "0.7474217", "0.74713415", "0.744418", "0.7434209", "0.7422516", "0.7417253", "0.7410254", "0.7399484", "0.7399484", "0.7399484", "0.7399484", "0.73277193", "0.73277193", "0.73277193", "0.73277193", "0.7320106", "0.73061836", "0.7302993", "0.72967255", "0.72783524", "0.7260373", "0.7259413", "0.7253066", "0.7241593", "0.7238823", "0.72328705", "0.72328705", "0.72328705", "0.72328705", "0.72328705", "0.7213956", "0.7212257", "0.7153427", "0.7122357", "0.7122357", "0.71086663", "0.70849353", "0.70627534", "0.7044502", "0.7024239", "0.70198023", "0.7011873", "0.7001144", "0.69827217", "0.69609475", "0.69573694", "0.69567925", "0.69484", "0.6918409", "0.69044095", "0.6892718", "0.6885473", "0.6873935", "0.6852873", "0.6852251", "0.6849634", "0.68386817", "0.6829194", "0.68180305", "0.6797118", "0.67896616", "0.67848057", "0.67822814", "0.67762345", "0.67731696", "0.6770052", "0.6769176", "0.6763454", "0.6738507", "0.6738064", "0.67339015", "0.67316693", "0.67080206", "0.66891617", "0.6679892", "0.6670627", "0.6663173", "0.66630715", "0.66626716", "0.66571546", "0.6651892", "0.6643306", "0.6637941", "0.6637525", "0.6631896", "0.6630131", "0.66285336", "0.66178757", "0.6616524", "0.6606589", "0.6592668", "0.6581942", "0.658018" ]
0.7500336
5
expects a string with a name of hero, like cards[i].name
checkIfPair() { let card1 = this.pickedCards[0]; let card2 = this.pickedCards[1]; this.pairsClicked += 1; if(card1.dataset.cardName == card2.dataset.cardName) { this.pairsGuessed += 1; this.pickedCards = []; $('.card').removeClass('blocked') return true } else { setTimeout(() => { $(this.pickedCards[0]).children().toggleClass('front back'); $(this.pickedCards[1]).children().toggleClass('front back'); this.pickedCards = []; $('.card').removeClass('blocked') }, 600) return false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function establishCharacter(hero, heroClass = \"\") {\n var heroHTML =\n '<div id=\"' +\n hero[\"name\"].split(\" \").join(\"-\") +\n '\"class=\"mx-1 hero-holder ' +\n heroClass +\n ' d-flex flex-column align-items-center\"> <p class=\"mb-0 hero-name\">' +\n hero[\"name\"] +\n '</p> <img class=\"hero-image w-100\" src=\"' +\n hero[\"imageURL\"] +\n '\" alt=\"hero image\"/><p class=\"mb-0 ' +\n hero[\"name\"].split(\" \").join(\"-\") +\n '-hp\">' +\n hero[\"hp\"] +\n \"</p> </div>\";\n return heroHTML;\n}", "function idToHeroName (heroes, heroId) {\n for (let i = 0; i < heroes.length; i++) {\n if (heroes[i].id == heroId) {\n return heroes[i].localized_name;\n }\n }\n return 'Unknown';\n}", "function Hero(name) {\n this.name = name;\n}", "function getHero(episode) {\n if (episode === \"EMPIRE\") {\n // Luke is the hero of Episode V.\n return humanData[\"1000\"];\n }\n // Artoo is the hero otherwise.\n return droidData[\"2001\"];\n}", "function fetchHeroesByName(heroName, result) {\n fetch(`https://superheroapi.com/api/${PUBLIC_KEY}/search/${heroName}`)\n .then(response => response.json())\n .then(data => {\n \n if(data.response === \"success\") {\n \n var heroes = data.results;\n var arrayHero = new Array();\n\n arrayHero = heroes.map(treatData);\n\n result.send({\n value: arrayHero,\n status: true\n });\n \n } else {\n result.send({\n value: data.error.toUpperCase(),\n status: false\n });\n }\n\n })\n .catch(error => {\n result.send({\n value: \"Error when calling API\",\n status: false\n });\n })\n}", "function getQuote(quotes, hero){\n\t// Grab the correct hero or villian, and return the quote at the index of the number provided in the hero string. \n\treturn `${{ B: 'Batman', R: 'Robin', J: 'Joker' }[hero[0]]}: ${quotes[hero.match(/\\d+/)]}`;\n}", "function changeName (hero){\n const stats = document.getElementById(\"stats\");\n const newName = document.getElementById(\"name\").value;\n hero.name = newName;\n displayStats(hero);\n return hero;\n}", "function createHeroText(beerName){\n var styleHeroName = '<div class=\"mdl-grid style_name\">{{beerName}}</div>';\n return styleHeroName.replace('{{beerName}}', beerName);\n}", "function profileInfo(object) {\nvar name = object.name.charAt(0).toUpperCase() + object.name.slice(1); //creates capitalized first letter name\nvar species = object.species.charAt(0).toUpperCase() + object.species.slice(1); //creates capital first letter species\nreturn name + \" is a \" + species; //return name is a species sentence\n}", "function Hero (name = 'Hero', position, health, damage, experience) {\n this.name = name\n this.position = '00'\n this.health = 100\n this.damage = 5\n this.experience = 0\n}", "function getCardName(name) {\n return name.toString().split(\"_\")[0];\n}", "function matchName(drivers, string){\n let matches = []\n for(const traits of drivers){\n if(traits['name'] === string){\n matches.push(traits)\n }\n }\n return matches \n}", "function Hero(name, quote, imgURL){ \n this.hero = name;\n this.quote = quote;\n this.imgURL = imgURL;\n }", "getPokemonNameById(pokemonId) {\n if (this.pokemon) {\n for (let i = 0; i < this.pokemon.length; i++){\n if (this.pokemon[i].id == [pokemonId]){\n return this.pokemon[i].name + (this.pokemon[i].form == 'alolan' ? '*' : '');\n }\n }\n }\n return null;\n }", "function newHero() {\n randomHero = superhero.random().toLowerCase()\n // console.log(randomHero)\n}", "getHero(id) {\r\n const url = `${this.heroesUrl}/${id}`;\r\n return this.http.get(url).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"tap\"])(_ => this.log(`取得英雄,序号为${id}`)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"catchError\"])(this.handleError(`get英雄 序号为${id}`)));\r\n }", "function Hero(name,level) {\n\tname = name;\n\tlevel = level;\n} // incorrect", "function treatData(heroInfos) {\n var hero = new Hero(heroInfos.image.url,\n heroInfos.name,\n heroInfos.biography[\"full-name\"],\n heroInfos.biography.aliases[0],\n heroInfos.biography[\"place-of-birth\"],\n heroInfos.biography[\"alter-egos\"],\n heroInfos.appearance.height[1],\n heroInfos.appearance.weight[1],\n heroInfos.biography.publisher\n );\n return hero;\n}", "function drawName (obj, string1) {\n drawStrokeText(string1, obj.x+(obj.width/2), obj.y - 12, 'white', 'Bungee', 20, 'center')\n drawFillText(string1, obj.x+(obj.width/2), obj.y - 14, 'black', 'Bungee', 20, 'center')\n}", "function heroicInventory(input) {\n let heroData = [];\n let data = input.slice(0);\n\n heroData = data.map(hero => {\n let heroTokens = hero.split(\" / \");\n let heroName = heroTokens[0];\n let heroLevel = +heroTokens[1];\n let heroItems = [];\n if(heroTokens.length >2) {\n heroItems = heroTokens[2].split(\", \");\n }\n\n let curHero = {\n \"name\": heroName,\n \"level\" : heroLevel,\n \"items\" : heroItems\n }\n return curHero;\n });\n console.log(JSON.stringify(heroData));\n}", "function nthName() {\n return \"The \" + randomChoice(data.lineage)\n}", "getSinglePokemon({name, pic}) {\n return `<div class=\"pokemon-info d-flex\">\n <div class=\"card\" style=\"width: 12rem;\">\n <img src=\"${pic}\" class=\"card-img-top\" alt=\"pokemon\">\n <div class=\"card-body\">\n <h5 class=\"card-title pokemon-name\">${name}</h5>\n </div>\n </div>`\n }", "function profileInfo(object) {\n//access object species and name and return it in string\n//console.log(object);\nreturn capitalizeWord(object['name']) + ' is a ' + capitalizeWord(object['species']);\n}", "function getChampionName(){\n\n}", "addHero(hero) {\r\n return this.http.post(this.heroesUrl, hero, this.httpOptions).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"tap\"])((newHero) => this.log(`添加英雄成功,序号为${newHero.id}`)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"catchError\"])(this.handleError('addHero')));\r\n }", "function setName (pokemonName) {\n // Set first character as UpperCase\n pokemonName = pokemonName.charAt(0).toUpperCase() + pokemonName.slice(1)\n\n pet_info.name = pokemonName\n}", "function loadHeroCharacters(){\n let hero_template = ``;\n \n for(let character_index = 0; character_index < character_datas.length; character_index++){\n if(character_datas[character_index].character_type === \"hero\"){\n hero_template += `<div class=\"character\" data-character_id=${ character_datas[character_index].id }>`;\n hero_template += ` <img src=${ character_datas[character_index].img }>`;\n hero_template += ` <h3>${ character_datas[character_index].name }</h3>`;\n hero_template += ` <button type=\"button\" class=\"recruit_hero_button\">RECRUIT</button>`;\n hero_template += `</div>`;\n }\n }\n\n hero_template += `<h2>RECRUIT <span>A HERO</span></h2>`;\n $(\"#recruit_screen\").html(hero_template);\n}", "translateSuitToEntityCode(){\nreturn this.suitObjects[`${this.randomSuitName0 }`];\n }", "translateSuitToEntityCode(){\nreturn this.suitObjects[`${this.randomSuitName0 }`];\n }", "function myLastName() {\n return myName.watson;\n}", "function addHero(hero){\n \n if(!hero){\n return;\n }\n\n // fetch all Superhero from localStorage\n const getFavourites = getFavouriteSuperheroes();\n getFavourites.push(hero);\n\n localStorage.setItem(\n FAVOURITES,\n JSON.stringify(getFavourites)\n );\n \n }", "function CreateSuspectObjects(name) {\n return {\n name: name,\n color: name.split(' ')[2],\n speak() {\n console.log(\"my name is \", name);\n }\n };\n}", "function getGameName(data) {\n $('#hYourGame').html('Your game (' + data.items.item[0].name[0]['$'].value + ')');\n}", "function myName() {\n return myName.darius;\n}", "function getSpeciesName(mon) {\n\t//name is everything before the last ' @'\n\tconst parts = mon.split(' @');\n\tconst namePart = parts.slice(0, parts.length - 1)\n\t\t.reduce((acc, x) => acc + x);\n\t//check for nickname\n\tif(namePart[namePart.length-1] === ')') {\n\t\t//after the last '(', before the ')' after that\n\t\tconst speciesParts = namePart.split('(');\n\t\treturn speciesParts[speciesParts.length-1].split(')')[0]\n\t}\n\treturn namePart;\n}", "function matchName (drivers, string) {\n return drivers.filter(obj => {\n return obj.name === string\n })\n}", "function makeCards(string: string): Array<Card> {\n var cards: Array<Card> = [];\n var cardReps: Array<string> = string.split(' ');\n for(var i=0;i<cardReps.length;i++) {\n cards.push(new Card(cardReps[i].slice(-1), valueStringToInteger[cardReps[i].slice(0,-1)]));\n }\n return cards;\n}", "function getPokemon() {\n var rngIndex = Math.floor(Math.random() * pokemonList.length);\n return pokemonList[rngIndex].name.toUpperCase();\n}", "function profileInfo(object) {\n return object.name.charAt(0).toUpperCase() + object.name.slice(1) + \" is a \" + object.species.charAt(0).toUpperCase() + object.species.slice(1);\n\n}", "function renderAbilities(hero) {\n let htmlString = '';\n let species = family[family.findIndex(findHeroIndex, hero)];\n \n htmlString += `<h1>advantages</h1><ul>`;\n \n species.advantages.forEach(advantages => {\n htmlString += `<li>${advantages}</li>`;\n });\n \n htmlString += `</ul><h1>character</h1><ul>`;\n \n species.character.forEach(character => {\n htmlString += `<li>${character}</li>`;\n });\n \n htmlString +=`</ul>`;\n \n \n $('#abilities').html(htmlString);\n }", "function retrieveCardByName(name){\n return agent.card.where({name: name})\n .then( result =>{\n var card = result[0];\n var i = 0;\n while (i < result.length){\n if (!card)\n {break;}\n if (card.rarity == \"Special\" && result.length > i +1){\n card = result[i+1];\n }else {break;}\n i++;\n }\n return card;\n })\n .catch(function(error){\n console.log(\"Error: \" + error);\n });\n}", "function profileInfo(object) {\n return object.name.charAt(0).toUpperCase() + object.name.slice(1) + ' ' + 'is a' + ' ' + object.species.charAt(0).toUpperCase() + object.species.slice(1);\n}", "function shortname(str) {\n let newstr = str.toUpperCase().split(\" \");\n \n\n let sname= [];\n for (let i in newstr) {\n sname += newstr[i][0]\n \n\n\n }\n\n}", "function myName() {\n return myName.kurt;\n}", "get heroTitle() { throw new Error('Hero title not implemented. This method is abstract'); }", "function myName() {\n return myName.josh\n}", "function displayHeroStats(){\n const heroStats = document.getElementById('herostats')\n heroStats.innerHTML = `Hero name: ${ hero.name }<br>Health: ${ hero.health }<br>Weapon: ${ hero.weapon.type }<br>Damage: ${ hero.weapon.damage }`\n // const enemyStats = document.getElementById('enemystats')\n // enemyStats.innerHTML = `Enemy name: ${enemy.name}<br>Health: ${enemy.health}<br>Weapon: ${enemy.weapon.type}<br>Damage: ${enemy.weapon.damage}`\n\n}", "function profileInfo(object) {\n//I- object with name and species\n//O-return '<Name>' is a <Species>\n//C- cap the first letters\n//E-\n\n//need holder for name and species\nlet name = object.name;\nlet species = object.species;\n//Need to cap the first letter\nname = name[0].toUpperCase() + name.slice(1, name.length);\nspecies = species[0].toUpperCase() + species.slice(1, species.length);\n//output!\nreturn `${name} is a ${species}`;\n}", "function giveMeSomeNiceName(animal){\n let name = '';\n if (animal == 'cat') {\n name = 'Harm'\n } else if (animal == 'dog') {\n name = 'Henk';\n }\n return name;\n}", "function changeName() {\n const name = document.getElementById('name')\n hero.name = name.value\n alert(\"Name of hero succesfully changed to \" + name.value + \"!\")\n}", "function matchName(drivers, string) {\n return drivers.filter (n => n.name === string)\n}", "function myName() {\n return myName.serena;\n}", "function myName() {\n return myName.Lea;\n\n}", "changeCardName() {\n for (let index = 0; index < this.state.memberSubCollection.length; index++) {\n this.state.memberSubCollection[index].cards.forEach((card, item) => {\n if (card.rank === \"10\" || card.rank === 10) {\n this.state.memberSubCollection[index].cards[item] = \"T\" + card.suit.charAt(0)\n } else {\n this.state.memberSubCollection[index].cards[item] = card.rank.charAt(0).toUpperCase() + card.suit.charAt(0)\n }\n });\n }\n }", "eat() {\n if (typeof this.name !== 'string') {\n return \"Please supply a string\";\n }\n return `${this.name} drinks milk`\n }", "function myName() {\n return myName.juvenal;\n}", "function CreateHeroCard(session, builder, title, subtitle, text, url, buttons) {\n var card = new builder.HeroCard(session).title(title).subtitle(subtitle).text(text).buttons(buttons);\n return card;\n}", "function CardNames () {\n\tvar names = new Array(21)\n\t\n\t// Names\n\tnames[0] = cardName.Scarllet;\n\tnames[1] = cardName.Plum;\n\tnames[2] = cardName.Peacock;\n\tnames[3] = cardName.Green;\n\tnames[4] = cardName.Mustard;\n\tnames[5] = cardName.White;\n\t\n\t// Weapons\n\tnames[6] = cardName.Candlestick;\n\tnames[7] = cardName.Dagger;\n\tnames[8] = cardName.Lead_Pipe;\n\tnames[9] = cardName.Revolver;\n\tnames[10] = cardName.Rope;\n\tnames[11] = cardName.Wrench;\n\n\t// Rooms\n\tnames[12] = cardName.Courtyard;\n\tnames[13] = cardName.Game_Room;\n\tnames[14] = cardName.Study;\n\tnames[15] = cardName.Dining_Room;\n\tnames[16] = cardName.Garage;\n\tnames[17] = cardName.Living_Room;\n\tnames[18] = cardName.Kitchen;\n\tnames[19] = cardName.Bedroom;\n\tnames[20] = cardName.Bathroom;\n\t\n\treturn names;\n}", "function card(suit, value, name) {\n this.suit = suit; // string of c/d/h/s\n this.value = value; // number 1 - 10\n this.name = name; // string of the full card name\n}", "get(name){\n let gameId = this.list.findIndex(i => i.getName() === name.toLowerCase());\n return this.list[gameId];\n }", "function CreateSuspectObjects(name) {\n return {\n name: name,\n color: name.split(' ')[2],\n speak: function () {\n console.log(\"my name is \", name);\n }\n };\n}", "function sayMyName(nombre) {\n if (typeof nombre === 'string') {\n console.log(`Tu nombre es : ${nombre}`);\n } else {\n console.log('Esperaba un string');\n }\n}", "function findName(name) {\n var capitalised = capitalise(name);\n var val = words.get(capitalised);\n if (val) {\n namesMentioned.push({ name: capitalised, value: val });\n words.delete(capitalised);\n }\n}", "function id_from_name(object_name) {\n switch(object_name) {\n case 'hop_box':\n return 'hop';\n case 'fermentable_box':\n return 'fermentable';\n case 'yeast_box':\n return 'yeast';\n case 'recipe_box':\n return 'recipe';\n default:\n console.log(object_name);\n return 'nothing found';\n }\n}", "function matchName(drivers, string) {\n const newDrivers = drivers.filter(name => {\n return name.name === string\n });\n return newDrivers\n}", "function getPlayerName(player) {\r\n return player.PLAYER;\r\n}", "function Character(obj){\n this.species = obj.species;\n this.clan = obj.clan;\n this.weapon = obj.weapon;\n this.declare = function(){\n return `I'm a ${this.species} ${this.clan}, and I will destroy you with my ${this.weapon}`;\n }\n}", "function nameString(obj) {\n}", "function solve(input) {\n let n = Number(input.shift());\n let heroes = {};\n let isTrue = true;\n for (let i = 0; i < n; i++) {\n let [hero, hp, mp] = input[i].split(\" \")\n hp = +hp;\n mp = +mp;\n if (!heroes.hasOwnProperty(hero)) {\n heroes[hero] = {};\n heroes[hero].hp = hp;\n heroes[hero].mp = mp;\n }\n }\n for (let i = n; i < input.length; i++) {\n if (input[i] == \"End\") {\n isTrue = false\n break;\n } else if (input[i].includes(\"CastSpell\")) {\n let tokens = input[i].split(\" - \");\n let hero = tokens[1];\n let mpNeeded = Number(tokens[2]);\n let spellName = tokens[3];\n if (heroes[hero].mp >= mpNeeded) {\n heroes[hero].mp -= mpNeeded\n console.log(`${hero} has successfully cast ${spellName} and now has ${heroes[hero].mp} MP!`)\n } else {\n console.log(`${hero} does not have enough MP to cast ${spellName}!`);\n }\n } else if (input[i].includes(\"TakeDamage\")) {\n let tokens = input[i].split(\" - \");\n let hero = tokens[1];\n let damage = Number(tokens[2]);\n let attacker = tokens[3];\n heroes[hero].hp -= damage\n if (heroes[hero].hp <= 0) {\n delete heroes[hero];\n console.log(`${hero} has been killed by ${attacker}!`);\n } else {\n console.log(`${hero} was hit for ${damage} HP by ${attacker} and now has ${heroes[hero].hp} HP left!`);\n }\n } else if (input[i].includes(\"Recharge\")) {\n let tokens = input[i].split(\" - \");\n let hero = tokens[1];\n let amountMP = Number(tokens[2]);\n let firstMP = heroes[hero].mp;\n heroes[hero].mp += amountMP\n if (heroes[hero].mp >= 200) {\n heroes[hero].mp = 200;\n console.log(`${hero} recharged for ${200 - firstMP} MP!`);\n } else {\n console.log(`${hero} recharged for ${amountMP} MP!`);\n }\n } else if (input[i].includes(\"Heal\")) {\n let tokens = input[i].split(\" - \");\n let hero = tokens[1];\n let amountHP = Number(tokens[2]);\n let firstHP = heroes[hero].hp\n heroes[hero].hp += amountHP\n if (heroes[hero].hp >= 100) {\n heroes[hero].hp = 100;\n console.log(`${hero} healed for ${100 - firstHP} HP!`);\n } else {\n console.log(`${hero} healed for ${amountHP} HP!`);\n }\n }\n }\n if (!isTrue) {\n let sorted = Object.entries(heroes)\n sorted\n .sort((a, b) => b[1].hp - a[1].hp || a[0].localeCompare(b[0]))\n .forEach(element => {\n console.log(`${element[0]}\\n HP: ${element[1].hp}\\n MP: ${element[1].mp}`)\n });\n }\n}", "function lookupHero (eventHero,heroWho){ //\n // 14:trumps_score,15:trumps_played,16:trump_tobeat,17:trump_picked,\n // 8:trump_category,19:trumps_start,20:cat_or_char,21:trumps_xs\n //console.log(\"DEBUG [lookupHero]> Hero to find: \" + heroWho);\n let sender = eventHero.sender.id;\n let custom_id = inPlayID(sender);\n let heroWhoMatch = heroWho.toLowerCase();\n let heroWhoStored = '';\n let heroMatches = []; // May be more than one\n let bypass = false;\n // Set to start but previous card played i.e. after stop and restart\n if (SENDERS[custom_id][19] && SENDERS[custom_id][16] != '') { bypass = true };\n // Charactrer and no carried over list to pick from\n if (SENDERS[custom_id][20]=='character' && SENDERS[custom_id][21].length==0) { bypass = true };\n if (bypass){\n // lookup characters\n if (SENDERS[custom_id][19]) { // trumps_start\n let randomID = numRandomBetween(1,HERO_MAX);\n heroWho = randomID.toString();\n apiHEROcb(heroWho,true, function(){\n if (typeof HERO_ARRAY[randomID] != 'undefined') {\n heroMatches.push(randomID);\n //console.log(\"DEBUG [lookupHero]> Hero was populated for ID: \" + randomID);\n } else {\n console.log(\"ERROR [lookupHero]> Hero was NOT populated for ID: \" + randomID);\n }; // if (HERO_ARRAY\n playTopTrumps(eventHero,heroMatches); // After API i.e. may be results\n }); // apiHEROcb(heroWho\n } else { // not trumps start\n if (HERO_ARRAY.length != 0) { // Array not empty\n //console.log(\"DEBUG [lookupHero]> There are values stored\");\n for (var hero_loop = 0; hero_loop < HERO_ARRAY.length; hero_loop++) {\n if (typeof HERO_ARRAY[hero_loop] != 'undefined') {\n heroWhoStored = HERO_ARRAY[hero_loop][0].toLowerCase();\n if (heroWhoStored.includes(heroWhoMatch)) {\n heroMatches.push(hero_loop);\n //console.log(\"DEBUG [lookupHero]> Stored match No. \" + heroMatches.length + \" for \" + HERO_ARRAY[hero_loop][0] + \": \" + hero_loop);\n }; // if (heroWhoStored\n }; // if (typeof\n }; // for (var hero_loop\n }; // if (HERO_ARRAY\n if (heroMatches.length == 0) {\n //console.log(\"DEBUG [lookupHero]> No matches stored, trying API\");\n apiHEROcb(heroWho,false, function(){\n if (HERO_ARRAY.length != 0) { // Array not empty\n for (var hero_loop = 0; hero_loop < HERO_ARRAY.length; hero_loop++) {\n if (typeof HERO_ARRAY[hero_loop] != 'undefined') {\n heroWhoStored = HERO_ARRAY[hero_loop][0].toLowerCase();\n if (heroWhoStored.includes(heroWhoMatch)) {\n heroMatches.push(hero_loop);\n //console.log(\"DEBUG [lookupHero]> API match No. \" + heroMatches.length + \" for \" + HERO_ARRAY[hero_loop][0] + \": \" + hero_loop);\n }; // if (heroWhoStored\n }; // if (typeof\n }; // for (var hero_loop\n } else {\n //console.log(\"DEBUG [lookupHero]> Hero array is empty\");\n }; // if (HERO_ARRAY\n playTopTrumps(eventHero,heroMatches); // After API i.e. may be results\n }); // apiHEROcb(heroWho\n } else {\n playTopTrumps(eventHero,heroMatches); // After stored successful i.e. will be results\n } // if (heroMatches\n }; // if (HERO_ARRAY.length != 0\n } else { // category\n playTopTrumps(eventHero,heroMatches); // Complete bypass of lookup\n //console.log(\"DEBUG [lookupHero]> Hero bypass to [playTopTrumps] for category evaluation\");\n }; // if (SENDERS[custom_id][20]=='character'\n}", "function turnSuitStringToSuitImg(player, card) {\n let cardSuit = player[card - 1].suit;\n if (cardSuit == 'hearts') {\n return '<img src=\"images/heart-poker-piece.svg\">'\n } else if (cardSuit == 'diamonds') {\n return '<img src=\"images/diamond-poker-piece.svg\">'\n } else if (cardSuit == 'clubs') {\n return '<img src=\"images/chip-with-club.svg\">'\n } else if (cardSuit == 'spades') {\n return '<img src=\"images/spades-poker-piece.svg\" >'\n }\n}", "addHero(hero) {\n return this.http.post(this.heroesUrl, hero, httpOptions).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"tap\"])((newHero) => this.log(`added hero w/ id=${newHero.id}`)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"catchError\"])(this.handleError('addHero')));\n }", "function profileInfo(object) {\nlet string = `${capitalizeWord(object.name)} is a ${capitalizeWord(object.species)}`;\nreturn string;\n}", "function inName(name) {\n\t// trim the white space from outer edges of name and then split it into an array at the space.\n\tname = bio.name;\n\tconsole.log(name);\n\tname = name.trim().split(\" \");\n\tconsole.log(name);\n\t// uppercase whole last name (assuming no middle name)\n\tname[1] = name[1].toUpperCase();\n\t// make sure just first letter of first name is uppercase\n\tname[0] = name[0].slice(0,1).toUpperCase() + name[0].slice(1).toLowerCase();\n\t// return internationalized name\n\treturn name[0] + \" \" + name[1];\n}", "function nameInspector(string) {\n var isArray = /\\[\\]$/.test(string);\n var name = (isArray) ? string.match(/[^\\[]*/)[0] : string;\n return {name: name, observerName: name+\"Obs\", isArray: isArray};\n}", "function getTypeFromName(name) {\n\tfor(var i=0; i<cardTypeList.length; i++) {\n\t\tif(cardTypeList[i].name === name) {\n\t\t\treturn cardTypeList[i].type;\n\t\t}\n\t}\n\treturn \"card not found\";\n}", "constructor(name) {\n this.name = name;\n this.cards = [];\n }", "getHero(id) {\n const url = `${this.heroesUrl}/${id}`;\n return this.http.get(url).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"tap\"])(_ => this.log(`fetched hero id=${id}`)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"catchError\"])(this.handleError(`getHero id=${id}`)));\n }", "function profileInfo(object) {\n let name = object.name[0].toUpperCase() + object.name.substring(1);\n let species = object.species[0].toUpperCase() + object.species.substring(1);\n return `${name} is a ${species}`;\n}", "function profileInfo(object) {\n \n // Should take an object with a name an a species and return '<Name> is a <Species>'\n \n let {name, species} = object;\n \n let nameStr = name[0].toUpperCase() + name.substring(1,name.length);\n let speciesStr = species[0].toUpperCase() + species.substring(1,species.length);\n \n return `${nameStr} is a ${speciesStr}`;\n \n}", "function Hero(name)\n{\n console.log('the Hero is '+Hero.__proto__); // what's function () { [native code] } means\nthis.name= name;\n}", "function perfectFriend(name) {\n // error message\n if (typeof name !='object') {\n return 'Give an object';\n }\n for (let i = 0; i < name.length; i++) {\n if (name[i].length == 5) {\n return name[i];\n }\n }\n }", "function getCardString(card){\n return card.value + ' of ' + card.suit;\n}", "function cardTitle(element) {\n\n let divTitle = document.createElement('div');\n divTitle.classList.add('title');\n let name = document.createElement('span');\n name.classList.add('content-title');\n let nameText = document.createTextNode(element);\n name.appendChild(nameText);\n\n divTitle.appendChild(name);\n return divTitle;\n}", "function splitCardName(cardString) {\n return cardString.split(\" \")[0].toLowerCase();\n}", "function showHeroes(jsonObj) {\n // create a new variable of the array of members\n var heroes = jsonObj.members;\n // for each member of members, create variables to hold each bit of data\n for (let i = 0; i < heroes.length; i++) {\n var myArticle = document.createElement('article');\n var myH2 = document.createElement('h2');\n var myPara1 = document.createElement('p');\n var myPara2 = document.createElement('p');\n var myPara3 = document.createElement('p');\n var myList = document.createElement('ul');\n // set each variable's textContent to the value of the matching key\n myH2.textContent = heroes[i].name;\n myPara1.textContent = 'Secret Identity: ' + heroes[i].secretIdentity;\n myPara2.textContent = 'Age: ' + heroes[i].age;\n myPara3.textContent = 'Superpowers: ';\n\n // create a variable to hold each superhero's powers list\n var superPowers = heroes[i].powers;\n // the number of superpowers varies... go through them one by one\n // remember to use a new variable (j) to not conflict with the (i) used above\n for (let j = 0; j < superPowers.length; j++) {\n var listItem = document.createElement('li');\n listItem.textContent = superPowers[j];\n myList.appendChild(listItem);\n\n }\n // add the newly created entries to the page\n\n myArticle.appendChild(myH2);\n myArticle.appendChild(myPara1);\n myArticle.appendChild(myPara2);\n myArticle.appendChild(myPara3);\n myArticle.appendChild(myList);\n\n section.appendChild(myArticle);\n\n\n\n }\n}", "function getPlayerName(string, index) {\n\n return new Promise( async(resolve, reject) => {\n\n const nameColumn = /cell-player(.*?)<\\/td>/gs;\n const name = /(_blank\">)(.*)(<\\/a>)/s;\n\n const nameMatches = string.match(nameColumn);\n\n if (nameMatches !== null) {\n const playerMatch = nameMatches[0].match(name);\n\n resolve({\n success: playerMatch !== null ? true : false,\n name: playerMatch !== null ? playerMatch[2] : '',\n });\n\n } else {\n resolve({\n success: false,\n });\n }\n\n });\n\n}", "function getCardString(card) {\n return card.value + ' of ' + card.suit;\n}", "function name_the_frenchie(){\n var names = [\"Gaubusseau\", \"Gobi\", \"Gobysov\", \"Kaupassa\", \"FransmanNI\", \"Ranskis\", \"Gaubussuauau\", \"Ranska\", \"Gubi\", \"Kopisoi\", \"Gaubusssööö\", \"Käpysoppa\", \"Kubussi\", \"Goblin\", \"Goobysoo\", \"Bisseau\", \"Gobuzie\", \"Gabuzie\"];\n var chosenName = names[Math.floor(Math.random() * names.length)];\n return chosenName;\n\n}", "function createCard(pokemon) {\n const pokemonEl = document.createElement('div');\n pokemonEl.classList.add('card');\n pokemonEl.classList.add(`${pokemon.types[0].type.name}`)\n const pokeId = (id) => {\n if(id < 10) { return id = \"00\"+id }\n if(id < 100) { return id = \"0\"+id }\n if(id > 100) { return id }\n }\n\n const pokemonCard = `\n \n <img src=\"${pokemon.sprites.other.dream_world.front_default}\" alt=\"${pokemon.name}\" class=\"card-img\">\n <h3 class=\"card-stats-data\"> ${pokemon.name} </h3>\n <div class=\"card-stats\"> \n <div class=\"card-stats-id\"> \n #<span class=\"card-stat-idContent\"> ${pokeId(pokemon.id)} </span>\n </div>\n </div>\n <p class=\"card-stats-data\"> Type: <span> ${pokemon.types[0].type.name} </span> </p>\n `;\n\n pokemonEl.innerHTML = pokemonCard;\n pokemonContainer.appendChild(pokemonEl);\n\n}", "function consoleCards(array){\n for(x in array){\n console.log(x + '. ' + array[x].name);\n }\n}", "function getHuman(id) {\n return humanData[id];\n}", "function myName () {\n return myName.daniel;\n}", "function namePokemon(){\n var name = $('.name').val()\n var $xhr = $.getJSON('http://pokeapi.co/api/v2/pokemon/'+name);\n $xhr.done(function(data) {\n if ($xhr.status !== 200) {\n return;\n }\n $('#result').empty()\n $('#result').append(\"<p>Pokemon: \"+data['name']+\"</p>\")\n $('#result').append(\"<p>Height: \"+data['height']+\"</p>\")\n $('#result').append(\"<p>Weight: \"+data['weight']+\"</p>\")\n $('#result').append('<img src=\"'+data['sprites']['front_default']+'\"/>')\n});\n}", "[ADD_HERO](state,hero){\n state.heroes.push(hero);\n }", "function drawHero() {\n // Draw the hero's current stats on the screen\n let healthText = \"Health: \" + hero.health;\n $(\"#health\").width(PIXELS_PER_UNIT * hero.health).text(healthText);\n let magicText = \"Magic: \" + hero.magic;\n $(\"#magic\").width(PIXELS_PER_UNIT * hero.magic).text(magicText);\n let sizeText = \"Size: \" + hero.size;\n $(\"#size\").width(PIXELS_PER_UNIT * hero.size).text(sizeText);\n\n // Clear out the div for the hero's backpack\n $(\"#backpack\").empty();\n\n // Loop through the hero's backpack array\n for (let index = 0; index < hero.backpack.length; index++) {\n // The hero's backpack contains potion objects\n let aPotion = hero.backpack[index];\n // Use the potion's attribute to find its image source\n let newImage = $(\"<img>\").attr(\"src\", aPotion.image);\n // Add the image to the div\n $(\"#backpack\").append(newImage);\n }\n}", "function myName() {\n return myName.eunice;\n }", "function inName() {\n\tnames = bio.name.split(\" \");\n\tfirstName = names[0].slice(0,1).toUpperCase() + names[0].slice(1).toLowerCase();\n\tlastName = names[1].toUpperCase()\n\tfullName = firstName + \" \" + lastName\n return fullName\n}", "function treatBacName(name) {\n var bacteriaList = [];\n\n for (var i = 0; i < name.length; i++) {\n var stringName = name[i].toString();\n var splitValue = stringName.split(\";\");\n if (splitValue.length > 1) {\n bacteriaList.push(splitValue[splitValue.length - 1]);\n } else {\n bacteriaList.push(splitValue[0]);\n }\n }\n return bacteriaList;\n}", "function nomen(){\n\tvar vowels = \"aeiouy\";\n\tvar consonants = \"bcdfghjklmnprstvwxyz\";\n\tvar first = \"ABCDEFGHIJKLMNOPRSTUVWXYZ\";\n\tvar special_endings = new Array();\n\tspecial_endings[0] = \"ck\";\n\tspecial_endings[1] = \"rs\";\n\tspecial_endings[2] = \"rz\";\n\tspecial_endings[3] = \"lm\";\n\tspecial_endings[4] = \"lk\";\n\tspecial_endings[5] = \"lp\";\n\tspecial_endings[6] = \"rt\";\n\tspecial_endings[7] = \"ff\";\n\tspecial_endings[8] = \"tz\";\n\tspecial_endings[9] = \"wz\";\n\tspecial_endings[10] = \"sh\"; \n\tspecial_endings[11] = \"qu\";\n\t\n\tvar poke = first.charAt( chaos(24) );\n\tvar nameN = 2 + chaos(5);\n\t\n\t\n\t//we have our first letter!\n\tvar name = poke;\n\tfor(i = 1; i < nameN; i++){\n\t\t//if true get a consonant next else get a vowel\n\t\tif (vowels.search(poke.toLowerCase()) != -1){\n\t\t\tpoke = consonants.charAt( chaos(19) );\n\t\t\tif( i == ( nameN - 1) && ( chaos(100) <= 50 ) ){\n\t\t\t\t//this is also the last letter\n\t\t\t\t//and a 50% chance of a special ending\n\t\t\t\tpoke = special_endings[chaos(12)-1];\n\t\t\t}//end if special ending\n\t\t}else{\n\t\t\tpoke = vowels.charAt( chaos(5) );\n\t\t}//end if vowel else consonant\n\t\t\n\t\tname += poke;\n\t}//end for length of name\n\t\n\treturn name;\n\t\n}//end function nomen", "function getName() {\n return \"Hai Aku Sam\";\n}" ]
[ "0.64407414", "0.6353934", "0.63046414", "0.6006078", "0.5982191", "0.5975011", "0.5891689", "0.57782227", "0.5764481", "0.5740078", "0.5721513", "0.5629904", "0.5627157", "0.55956066", "0.557527", "0.5518778", "0.54658", "0.5457632", "0.54121363", "0.5406761", "0.5370601", "0.53607726", "0.5355026", "0.5342749", "0.5342714", "0.5329018", "0.53034866", "0.5277804", "0.5277804", "0.52747285", "0.5270232", "0.5268151", "0.5259173", "0.5238378", "0.5230298", "0.52255905", "0.52217567", "0.52191746", "0.521818", "0.5215526", "0.5215502", "0.52114224", "0.5207234", "0.52017164", "0.519769", "0.5191704", "0.518398", "0.5183838", "0.5183394", "0.5164517", "0.5148601", "0.51443964", "0.5138792", "0.51333195", "0.51281923", "0.512018", "0.511996", "0.5119502", "0.51191694", "0.5116526", "0.5110899", "0.5110501", "0.5109651", "0.5105556", "0.50961506", "0.50940365", "0.50878644", "0.5076639", "0.5072207", "0.5067708", "0.506416", "0.505453", "0.50516045", "0.5049833", "0.50496686", "0.5036128", "0.50353855", "0.50301033", "0.5021734", "0.5011954", "0.5004847", "0.5004166", "0.5003869", "0.50033605", "0.49954656", "0.4993266", "0.49924496", "0.49891645", "0.49887437", "0.49882096", "0.4986506", "0.49815392", "0.497985", "0.49796396", "0.49787435", "0.49751034", "0.49746898", "0.49739772", "0.49728486", "0.49565035", "0.49510047" ]
0.0
-1
Set the width of the side navigation to 0
function closeNav() { document.getElementById("mySidenav").style.width = "0"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeNav() {\r\n document.getElementById(\"mySidepanel\").style.width = \"0\";\r\n }", "closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n }", "function closeNav() {\r\n document.getElementById(\"mySidepanel\").style.width = \"0\";\r\n}", "function closeNav() {\n document.getElementById(\"mySidepanel\").style.width = \"0\";\n}", "function closeNav() {\n document.getElementById(\"sidebar-menu\").style.width = \"0\";\n}", "closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n }", "function closeNav() {\n document.getElementById(\"sidebar\").style.width = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidepanel\").style.width = \"0%\";\n}", "function navController(){\n if ( document.getElementById(\"mySidenav\").style.width == \"0px\" ){\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"content-wrapper\").style.marginLeft = \"250px\";\n }\n else {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"content-wrapper\").style.marginLeft = \"0px\";\n }\n }", "function closeNav() \n{\n document.getElementById(\"sideNav\").style.width = \"0%\";\n document.getElementById(\"main\").style.marginLeft = \"0%\";\n}", "function closeNav() {\r\n document.getElementById(\"mySidebar\").style.width = \"0\";\r\n}", "function closeNav() {\n document.getElementById(\"sideNav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n }", "function closeNav() {\n $(\"#mySidenav\").css('width', '0');\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n }", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n}", "function closeNav() {\n\ndocument.getElementById(\"mySidenav\").style.width = \"0\";\n\n}", "function closeNav() {\n document.getElementById(\"Sidenavv\").style.width = \"0\";\n}", "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n if (screen.width<=630) {\n document.getElementById(\"mySidebar\").style.width = \"100%\";\n document.getElementById(\"mySidebar\").style.Left = \"0px\";\n\n }\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n}", "function closeNav() {\n document.getElementById(\"Sidenav\").style.width = \"0\";\n}", "function closeNav() \n{\n document.getElementById(\"mySidenav\").style.width = \"0\";\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n //document.getElementById(\"main\").style.marginLeft = \"0\";\r\n}", "function closeNav () {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n}", "function closeNav() {\n\tdocument.getElementById('sidenav-items').style.width = '0';\n}", "function closeNav() {\n document.getElementById('mySidenav').style.width = \"0\";\n}", "closeNav() {\n document.getElementById(\"myNav\").style.width = \"0%\";\n }", "function openNav1(){\n\tdocument.getElementById(\"mySide1nav\").style.width = \"100%\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "function closeRightNav() {\n document.getElementById(\"myRightNav\").style.width = \"0\";\n}", "function closeNav() {\r\n document.getElementById(\"mySidebar\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n }", "function closeNav() {\r\n document.getElementById(\"mySidebar\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n }", "function menuOpenClicked() {\n document.getElementById('leftSideBar').style.left = \"0\";\n document.getElementById('emptyPage').style.left = \"0\";\n }", "function openNav() {\n closeRightNav();\n document.getElementById(\"mySidenav\").style.width = \"550px\";\n document.getElementById(\"mySidenav\").style.left = \"0\";\n}", "function closeNav() {\r\n document.getElementById(\"myNav\").style.width = \"0%\";\r\n }", "function closeNav() {\n$('#mySidenav').css('width', '0');\n$('#main').css('marginLeft','0');\n}", "function closeNav() {\n document.getElementById('mySidebar').style.width = '0'\n\n setContent(false)\n }", "function closeNav() {\r\n document.getElementById(\"mySidebar\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.paddingLeft = \"0\";\n}", "function closeNav() {\r\n document.getElementById(\"menuSidebar\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n}", "function closeNav() {\n document.getElementById(\"myNav\").style.width = \"0%\";\n }", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.getElementById(\"headArticle\").style.width = \"98vw\";\n document.getElementById(\"boxArticle\").style.width = \"98vw\";\n}", "function closeNav() {\n\t\t\tdocument.getElementById(\"mySidenav\").style.width = \"0\";\n\t\t}", "function closeNav() {\r\n side_nav.style.width = \"0\";\r\n side_nav_shader.style.display = \"none\";\r\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"page-top\").style.marginLeft = \"0\";\n }", "function closeNav() {\n document.getElementById(\"navigation\").style.width = \"0%\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"-8px\";\n document.getElementById(\"enhed\").style.marginLeft = \"-8px\";\n}", "function closeNav() {\n document.querySelector(\"#mySidebar\").style.width = \"0\";\n document.querySelector(\"#main\").style.marginLeft = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n}", "function closeNav() {\r\n\t\tdocument.getElementById(\"mySidenav\").style.width = \"0\";\r\n\t}", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n}", "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"main\").style.marginLeft = \"0\";\r\n }" ]
[ "0.70849997", "0.7048696", "0.70117784", "0.69661146", "0.6954063", "0.6943325", "0.690015", "0.6895077", "0.6895074", "0.68786633", "0.68749243", "0.686089", "0.68548334", "0.68548334", "0.68548334", "0.68548334", "0.68548334", "0.6847666", "0.6847666", "0.6837757", "0.6831971", "0.6803983", "0.6803983", "0.6803983", "0.67965657", "0.6795152", "0.6786731", "0.67712986", "0.67712986", "0.67712986", "0.67712986", "0.67712986", "0.67712986", "0.67712986", "0.67712986", "0.67705023", "0.6770048", "0.67666155", "0.6759461", "0.6758394", "0.6757215", "0.67499274", "0.6745421", "0.6743661", "0.6743661", "0.6743661", "0.6743661", "0.6743661", "0.67417556", "0.67403007", "0.67403007", "0.67375714", "0.67214537", "0.671459", "0.67110074", "0.6708946", "0.6697307", "0.6695283", "0.6688715", "0.6680778", "0.666885", "0.6660101", "0.6658437", "0.6657796", "0.6649701", "0.6647901", "0.6639663", "0.6631889", "0.6631889", "0.6631889", "0.6631889", "0.6631889", "0.6631889", "0.6631889", "0.6630193", "0.66294205", "0.6626586", "0.6624249" ]
0.6740824
71
Dynamic Nav for pages
function loadNav() { let url = window.location.href.split("/").pop(); let user_id = localStorage.getItem("user_id"); $(".nav-bar").html(`<ul class='cf'> ${ user_id != null ? ` <li> <a class="login out" href="./index.html"> Log Out </a> </li>` : ` <li> <a class="login" href="./index.html"> Log In </a> </li>` } ${ url != "cards.html" ? ` <li> <a href='./cards.html'>Cards</a> </li>` : "" } ${ url != "community.html" ? ` <li> <a href='./community.html'>Community Lists</a> </li> ` : "" } ${ url != "index.html" ? ` <li> <a href='./account.html'>My Lists</a> </li>` : "" } </ul> <a href="#" id="openup">Menu</a>`); $(".login.out").click(() => { localStorage.clear(); window.location.replace("/signup.html"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupPageNavs () {\n\t\t// For any nested list items, wrap the link text in a span so that we can put a border under the text on hover.\n\t\t$mobilemenu.find(\".ibm-mobilemenu-section li li a\").wrapInner(\"<span>\");\n\n\t\tIBM.common.util.a11y.makeTreeAccessible({\n\t\t\tel: $mobilemenu.find(\".ibm-mobilemenu-pagenav > ul\")\n\t\t});\n\t}", "function dynamic_nav(){\n /*\n this function generate naviagtion bar dynamically accourding to number of section\n */ \n for (section of sections){\n //Section name from section data-nav for list\n const section_name = section.getAttribute('data-nav');\n\n //Section Id for naviagtion to sections\n const section_ID = section.getAttribute('id');\n\n //create anchor element\n const anchor_element = document.createElement('a');\n\n //Attribute for the class attribute\n const attribute_class = document.createAttribute('class');\n attribute_class.value = 'menu__link';\n\n //Attribute for the href attribute\n const attribute_href = document.createAttribute('href');\n attribute_href.value = `#${section_ID}`\n\n \n //add attributes\n anchor_element.setAttributeNode(attribute_class);\n anchor_element.setAttributeNode(attribute_href);\n anchor_element.textContent = section_name;\n\n //make the li element\n const list_element = document.createElement('li');\n //append the anchor element to the list element\n list_element.appendChild(anchor_element);\n\n //append the list to the navigation bar\n nav_list.appendChild(list_element);\n };\n}", "function createNav() {\n var content = [\"About\", \"Projects\", \"Contact\"];\n content.forEach(function(item, i) {\n var liItem = $(\"<li><a id='\" + content.indexOf(item) +\n \"' class='nav-link'>\" + item + \"</a></li>\");\n $('.nav-list').append(liItem);\n liItem.click(function() {\n navRouter(liItem);\n });\n });\n }", "function createNav() {\n for(const section of sections) {\n const navLink = `<a href=\"#${section.id}\" class=\"menu__link ${section.className}\" data-link=\"${section.dataset.nav}\"><li>${section.dataset.nav}</li></a>`;\n navPosition.insertAdjacentHTML('beforeend', navLink);\n }\n}", "function navagationArray () {\n $(\".nav\").append(\"<li><a href='index.html'>Home</a></li>\" + \n \"<li><a href='FindAPet_Shelter.html'>Shelters</a></li>\" + \n \"<li><a href='Lost&Found.html'>Lost &amp; Found</a></li>\" + \n \"<li><a href='AddAPet.html'>Add A Pet</a></li>\" +\n \"<li><a href='Admin.html'>Admin Panel</a></li>\");\n }", "function navBar(students) {\n\tvar howManyPagesCreated = howManyPages(students);\n\t$('.pagination ul li').remove();\n\tfor( i = 1; i <= howManyPagesCreated; i++){\n\t\thtml = '<li><a href=#>' + i + '</a></li>';\n\t\t$('.pagination ul').append(html);\t\n\t}\n\t$('.pagination ul li:first a').addClass('active');\n}", "function build_Nav(){\n \n for(section of sections){\n let anchor = document.createElement(\"a\");\n //anchor.href = \"#\" + section.id;\n anchor.classList.add(\"menu__link\");\n anchor.innerHTML = section.getAttribute(\"data-nav\");\n frag.appendChild(anchor);\n }\n \n list.innerHTML = \"\";\n list.appendChild(frag);\n list.style.display = \"none\";\n }", "function generateNav() {\n sections.forEach(section => {\n let listItem = document.createElement('li')\n let anchorItem = document.createElement('a')\n anchorItem.classList.add('menu__link', `${section.id}`) //add class attribute to anchorItem\n anchorItem.setAttribute('href', `#${section.id}`) //add href attribute to anchorItem, which links to each sections of the page\n anchorItem.innerText = section.dataset.nav //make section IDs visible as menu link on navigation bar\n listItem.appendChild(anchorItem) //append <a> element to <li>\n ul.appendChild(listItem) //append <li> element to <ul>\n })\n}", "function buildNav() {\n for (let i of section) {\n let newSection = `<li class=\"menu__link ${i.className}\"data-link==${i.id}><a href=\"#${i.id}\">${i.dataset.nav}</li>`;\n\n navl.insertAdjacentHTML(\"beforeend\", newSection);\n }\n}", "function displayNavBar () {\n navItems.forEach(item => {\n const newEle = document.createElement('li');\n const newLink = document.createElement('a');\n navigateByClick(newEle,item);\n newLink.textContent = item.getAttribute('data-nav');\n newLink.classList.add('menu__link');\n newEle.appendChild(newLink);\n fragment.appendChild(newEle)\n })\n navList.appendChild(fragment)\n}", "function buildNavigation() {\n getSectionDetails();\n const nav = document.querySelector('#navbar__list');\n let navigation = '';\n for (let i = 0; i < sectionHeadings.length; i ++){\n // During initialisation, for the first nav item, use active state. For others, use standard state.\n navigation += '<li id=\"'+navIds[i]+'\" class=\"'+ (i === 0 ? NAV_CLASS_NAME_ACTIVE : NAV_CLASS_NAME) +'\" onclick=\"onLinkClicked(this)\" data-section=\"'+sectionIds[i]+'\">'+sectionHeadings[i]+'</li>'\n }\n nav.innerHTML = navigation;\n}", "function make_page_nav(pages){\n var newHtml = ``\n if (pages.has_other_pages) {\n // Prev page\n newHtml += `<ul class=\"paginator\">`\n if (pages.has_previous) {\n newHtml += `<li><a class=\"page_nav_button\" id=\"previous_page\">&laquo;</a></li>`; // href=\"?page=${pages.previous_page_number}\n } else {\n newHtml += `<li class=\"disabled\"><span>&laquo;</span></li>`;\n }\n // Every page number\n for (let i=1; i< (pages.num_of_pages + 1); i++){\n if (pages.number == i) {\n newHtml += `<li class=\"active\"><span class=\"active-page\">${i}</span></li>`\n } else {\n newHtml += `<li><a class=\"page_nav_button\" id=\"num_page\">${i}</a></li>`; // href=\"?page=${i}\"\n }\n }\n // Prev page\n if (pages.has_next) {\n newHtml += `<li><a class=\"page_nav_button\" id=\"next_page\">&raquo;</a></li>` // href=\"?page=${pages.next_page_number}\"\n } else {\n newHtml += `<li class=\"disabled\"><span>&raquo;</span></li>`\n }\n newHtml += `</ul>`\n }\n newHtml += `<p>Showing ${pages.start_index}-${pages.end_index} of ${pages.page_count}</p>`\n $('.page_nav').html(newHtml);\n $('#num_of_products').html(`<p id=\"num_of_products\">Number of products found: ${pages.page_count}</p>`)\n make_page_nav_event_listener()\n}", "function buildNavBar() {\n // loops over each section in sections\n for (let i=0; i<sections.length; i++) {\n const sectionName = sections[i].dataset.nav;\n const sectionId = sections[i].id;\n //creates new <li> element in the nav ul\n const tab = document.createElement('li');\n //ammends the innerHTML of li item to include link\n tab.innerHTML = `<a id=\"nav_${sectionId}\" class=\"menu__link\" href=\"#${sectionId}\">${sectionName}</a>`;\n // tab.innerHTML = `<a id=\"${sectionId}\" class=\"menu__link\" href=\"#${sectionId}\">${sectionName}</a>`;\n //appends the finished li to the parent ul\n nav.appendChild(tab);\n }\n}", "function makeNavBar() {\n for (let i = 0; i < sections.length; i++) {\n let liElement = document.createElement('li'); //create menu items\n liElement.setAttribute('class', 'Section');\n let links = document.createElement('a'); //create the links for menu items\n links.setAttribute('class', 'navLink');\n content = sections[i].getAttribute('data-nav');\n path = sections[i].getAttribute('id');\n links.setAttribute('href', `#${path}`);\n links.innerText = `${content}`;\n navList.appendChild(liElement);\n liElement.appendChild(links);\n\n }\n}", "function buildNavigation(){\n for (let i=0; i < sectionList.length; i++){\n const newMenuItem = document.createElement('li');\n const sectionName = sectionList[i].getAttribute('data-nav')\n const sectionId = sectionList[i].getAttribute('id')\n newMenuItem.innerHTML = createNavItemHTML(sectionId, sectionName)\n fragment.appendChild(newMenuItem);\n }\n const navBarList = document.getElementById('navbar__list')\n navBarList.appendChild(fragment);\n}", "function makeNav () {\n for (let i = 0; i < names.length; i++) {\n let sectionName = names[i];\n let link = document.createElement('a');\n let listItem = document.createElement('li');\n link.href = `#${sectionId[i]}`;\n link.textContent = sectionName;\n link.classList.add('menu__link');\n listItem.appendChild(link);\n container.appendChild(listItem);\n }\n}", "function buildNav(){\n const navList = document.getElementById(\"navbar__list\");\n for (let i of getAllSections()){\n const item = makeNavItem(i);\n navList.appendChild(item);\n }\n}", "function createnavitems()\n{\n const virtualpage = document.createDocumentFragment();\n listSections.forEach(element=>{\n /*add nav bar menu link*/\n const section_id=element.getAttribute(\"id\");\n const section_name =element.getAttribute(\"data-nav\");\n const listitems=document.createElement(\"li\");\n // Scroll to section on link click\n listitems.innerHTML=`<a class=menu__link href=#${section_id}>${section_name}</a> `\n\n virtualpage.appendChild(listitems);\n })\n // Build menu\n document.querySelector(\"#navbar__list\").appendChild(virtualpage)\n}", "function buildNav() {\n for (let i = 0; i < navElements.length; i++) {\n const newMenuItem = document.createElement('li');\n const sectionName = navElements[i].getAttribute('data-nav');\n const sectionId = navElements[i].getAttribute('id');\n newMenuItem.innerHTML = createNavItemHTML(sectionId, sectionName)\n fragment.appendChild(newMenuItem);\n }\n navList.appendChild(fragment);\n}", "function buildNav(){\n for(let section of sectionList){\n let newList=document.createElement('li');\n let link=document.createElement('a');\n link.setAttribute('href',`#${section.id}`);\n link.innerHTML=section.attributes['data-nav'].nodeValue;\n link.classList.add('menu__link'); \n newList.appendChild(link);\n unorderedList.appendChild(newList);\n }\n unorderedList.firstChild.firstChild.classList.add('navbar__menu-active');\n}", "static nav(to) {\n console.log(\"main nav to: \" + to)\n $.get(to, function (pageContent) {\n $('.content').html(pageContent);\n }).fail(HTMLHandler.failedGet)\n }", "function setPageNavigation(list) {\n let liprev = document.getElementById('itemPage');\n let total = 0;\n if (list.length == 0) {\n document.getElementById('myPageNavigation').className = 'hide';\n } else {\n document.getElementById('myPageNavigation').className = 'd-flex justify-content-center';\n if (list.length % 10 == 0) {\n total = list.length / 10;\n totaltemp = total;\n } else {\n total = parseInt(list.length / 10) + 1;\n totaltemp = total;\n }\n liprev.innerHTML = '';\n for (let i = itemnavigate; i <= total; i++) {\n if (i >= itemnavigate && i <= itemnavigate + 4) {\n let li = document.createElement('li');\n let a = `<a class=\"page-link mylink\" href=\"#menuFeature\">${i}</a>`;\n li.innerHTML = a;\n liprev.appendChild(li);\n setEvenItemPageNavigate(li, list);\n if (i == itempage) {\n li.className = 'page-item textdecoration';\n li.setAttribute('id', 'active');\n } else {\n li.className = 'page-item';\n }\n }\n }\n if (total == 1) {\n document.getElementById('buttonprev').className = 'page-link mylink hide';\n document.getElementById('buttonnext').className = 'page-link mylink hide';\n } else {\n if (document.getElementById('active').firstChild.innerHTML == 1) {\n document.getElementById('buttonprev').className = 'page-link mylink hide';\n document.getElementById('buttonnext').className = 'page-link mylink show';\n } else if (document.getElementById('active').firstChild.innerHTML == total) {\n document.getElementById('buttonprev').className = 'page-link mylink show';\n document.getElementById('buttonnext').className = 'page-link mylink hide';\n } else {\n document.getElementById('buttonprev').className = 'page-link mylink show';\n document.getElementById('buttonnext').className = 'page-link mylink show';\n }\n }\n }\n}", "function updateNav() {\n sections = document.querySelectorAll('section[data-nav]');\n nav.innerHTML = '';\n sections.forEach(e => {\n const li = document.createElement('li'),\n a = document.createElement('a');\n\n\n a.href = '#' + e.id;\n a.classList.add('menu__link');\n a.textContent = e.getAttribute('data-nav');\n\n li.appendChild(a);\n fragment.appendChild(li);\n\n\n });\n\n nav.appendChild(fragment);\n\n }", "function createNav(page, isLast) {\n var pageNum = parseInt(page);\n var next = pageNum - 1;\n var prev = pageNum + 1;\n \n if(pageNum == 0) {\n document.getElementById(\"next\").style.display = \"none\";\n }\n \n if(isLast) {\n document.getElementById(\"prev\").style.display = \"none\";\n }\n \n document.getElementById(\"next\").innerHTML = \"<a class='nav-link' href='./?=\" + next + \"'><span class='nav-text'>Next</span> →</a>\";\n document.getElementById(\"prev\").innerHTML = \"<a class='nav-link' href='./?=\" + prev + \"'>← <span class='nav-text'>Prev</span></a>\";\n}", "function navBuilderFun () { \n \n sectionsVar.forEach(el => {\n const navlistElement = `<li><a class='menu__link' data-link=${el.id}>${el.dataset.nav}</li>`\n navFactor.insertAdjacentHTML('beforeend', navlistElement)\n })\n \n\n }", "function addNavElements(){\n let items = [{name:'Home',to:'#'},{name:'Direction',to:'#direction'},{name:'About',to:'#about'}\n ,{name:'Event',to:'#event'},{name:'Contact',to:'#contact'}];//array of nave bar items\n\n let mainNav = document.querySelectorAll(\".navbar__list\");\n items.forEach((item)=>{//add items\n mainNav.forEach((nav)=>{\n let list = document.createElement('li');\n list.innerHTML = '<a class=\"menu__link\" href=\"'+item.to+'\">'+item.name+'<span class=\"nav__span\"></span></a>';\n nav.appendChild(list);\n });\n if(item.name=='Home'){document.querySelector('.nav__span').classList+=' active'}\n });\n}", "function buildNav() {\n for (let section of sections) {\n let item = document.createElement('li');\n item.className = 'menu__link';\n item.dataset.nav = section.id;\n item.id = `nav_${section.id}`;\n item.innerText = section.dataset.nav;\n navbar.appendChild(item);\n console.log(item.id, item.dataset.nav, section.dataset.nav);\n }\n}", "function buildNav(sec) {\n for (let index = 0; index < sec.length; index++) {\n const navList = document.createElement('li');\n const secNumber = sec[index].getAttribute(\"data-nav\");\n navList.innerHTML = '<a href\"#\" class=\"menu__link\" data-link=\"'+sec[index].getAttribute('id')+'\"> '+secNumber+' </a>';\n navBar.appendChild(navList);\n }\n}", "function generateNav(callback){\n\t\t\tdocument.getElementById(\"terminal\").innerHTML = framework[\"terminal\"];\n\t\t\tdocument.getElementById(\"terminal-content\").innerHTML = framework[\"nav\"];\n\t\t\tcallback(current_tab);\n\t\t}", "function addNavs() {\n\n sections.forEach(section => {\n \n const li = document.createElement('li');\n \n li.innerHTML = `\n <a class=\"menu__link\" data-scroll = \"${section.id}\">${section.dataset.nav}</a>\n `;\n\n navFragment.appendChild(li);\n });\n\n \n\n navList.appendChild(navFragment);\n}", "function PagesNavigation() {\n\n}", "function create_nav_list(){\n\n\tsections.forEach( section => {\n const name = section.getAttribute(\"data-nav\");\n const li_item = document.createElement(\"li\");\n const link = document.createElement(\"a\");\n li_item.classList.add(\"menu__link\");\n link.textContent= name ; \n li_item.appendChild(link);\n fragment.appendChild(li_item);\n\n // Scroll to section on link click\n link.addEventListener(\"click\" , function() {\n \tsection.scrollIntoView({behavior: \"smooth\"});\n }) \n });\n new_nav.appendChild(fragment); // Build menu \n}", "function _addNavigation() {}", "function createNavItems() {\r\n allSections.forEach(sec => {\r\n let newNavItem = document.createElement('li'); // create list item\r\n let newNavAnchor = document.createElement('a'); // create anchor element\r\n let navItemName = sec.getAttribute('data-nav'); // get list item name from data-nav\r\n let navItemLink = sec.getAttribute('id'); //get item link from id\r\n newNavAnchor.text = navItemName; // give new anchor it's text\r\n newNavAnchor.href = \"#\"+navItemLink; // give new anchoe it's link\r\n newNavAnchor.className = ('menu__link'); // add class to anchor\r\n newNavItem.className = ('navbar__menu li'); // add class to list item\r\n newNavItem.appendChild(newNavAnchor); // append anchors to lis items\r\n docFragment.appendChild(newNavItem); // append list items to fragment\r\n });\r\n navBar.appendChild(docFragment); // append created fragment to navigation bar\r\n navBar.className = ('navbar__menu ul'); // give class to navigation bar\r\n}", "prepareNavigationPanel (navigationList) {\n let self = this;\n for(let index = 0; index < Object.keys(navigationList[JSON_LABEL]).length; index++) {\n var navigationListItem = document.createElement(\"li\");\n var navigationAnchor = document.createElement(\"a\");\n var navigationLabel = document.createTextNode(navigationList[JSON_LABEL][index][NAVIGATION_DOM_LABEL]);\n \n navigationAnchor.id = navigationList[JSON_LABEL][index][NAVIGATION_DOM_SECTION];\n navigationAnchor.href = \"#\";\n navigationAnchor.setAttribute('data-gmt', navigationList[JSON_LABEL][index][NAVIGATION_GMT_DATA] );\n navigationListItem.addEventListener('click', self.navigate.bind(this));\n navigationAnchor.appendChild( navigationLabel );\n navigationListItem.appendChild( navigationAnchor );\n navigationElement.appendChild( navigationListItem );\n }\n }", "function generatePaginationNav(current_page, pages) {\n var li_divs = \"\";\n\n if (current_page > 1) {\n li_divs += ('<li class=\"page-item\"><a class=\"page-link\" onclick=\"setPage(' + (current_page - 1) + ')\">Previous</a></li>');\n }\n if (Math.max(1, current_page - 3) > 2) {\n li_divs += ('<li class=\"page-item\"><a class=\"page-link\" onclick=\"setPage(' + 1 + ')\">1</a></li>');\n li_divs += ('<li class=\"page-item\"><a class=\"page-link\">..</a></li>');\n }\n for (let i = Math.max(1, current_page - 3); i < current_page + 4 && i <= pages; i++){\n li_divs += ('<li class=\"page-item' + (i == current_page ? \" active \" : \"\") + '\"><a class=\"page-link\" onclick=\"setPage(' + i + ')\">' + i + '</a></li>');\n }\n if (current_page + 3 < pages - 1) {\n li_divs += ('<li class=\"page-item\"><a class=\"page-link\">..</a></li>');\n li_divs += ('<li class=\"page-item\"><a class=\"page-link\" onclick=\"setPage(' + pages + ')\">' + pages + '</a></li>');\n }\n if (current_page < pages) {\n li_divs += ('<li class=\"page-item\"><a class=\"page-link\" onclick=\"setPage(' + (current_page + 1) + ')\">Next</a></li>');\n }\n $(\".pagination\").html(li_divs);\n}", "function initNavBar() {\n // Get the nav list element\n const navbar = document.querySelector(\"#navbar__list\");\n // Get all sections\n const sections = document.querySelectorAll(\"section\");\n // Iterate through sections to build nav\n for (let i = 0; i < sections.length; i++) {\n // function create nav Item => Create Item in navbar\n const navItem = createNavItem(sections[i]);\n navbar.appendChild(navItem);\n }\n }", "function updateNav(page) {\n // console.log(page);\n if (markers[page - 2]) {\n $(\"a#up\").attr(\"href\", \"#\" + markers[page - 2].id);\n }\n if (markers[page]) {\n $(\"a#down\").attr(\"href\", \"#\" + markers[page].id);\n }\n}", "function createNav() {\n var node1 = ML.El.create('a', {'href': '#', 'class': 'carousel-nav next'});\n var node2 = ML.El.create('a', {'href': '#', 'class': 'carousel-nav prev'});\n \n node1.innerHTML = '<span>Next</span> <i>&rarr;</i>';\n node2.innerHTML = '<i>&larr;</i> <span>Previous</span>';\n\n el.appendChild(node1);\n el.appendChild(node2);\n\n nextButton = el.querySelector('.carousel-nav.next:not(.inactive)');\n prevButton = el.querySelector('.carousel-nav.prev:not(.inactive)');\n }", "function onepage_activ_menu() {\r\n\t\r\n\tif(j$('body').hasClass('page-template-onepage') ) {\r\n\t\tj$('#header_container nav ul li a').click(function () {\r\n\t\tj$('#header_container nav ul li').removeClass('current-menu-item');\r\n\t\tj$(this).parent('li').addClass('current-menu-item');\r\n\t\t})\r\n\t\tvar aChildren = j$(\"#header_container nav ul li\").children(); // find the a children of the list items\r\n \tvar aArray = []; // create the empty aArray\r\n\t for (var i=0; i < aChildren.length; i++) { \r\n var aChild = aChildren[i];\r\n var ahref = j$(aChild).attr('href');\r\n aArray.push(ahref);\r\n \t} // this for loop fills the aArray with attribute href values\r\n\r\n j$(window).scroll(function(){\r\n var windowPos = j$(window).scrollTop(); // get the offset of the window from the top of page\r\n\r\n\t\tif(j$('.header_bottom_nav').length > 0){\r\n\t\t\tvar h_height = j$(\"#header_container\").height();\r\n\t\t\t}\r\n\t\t\telse if(j$(\".header_to_shrink\").length > 0) {\r\n\t\t\tvar h_height = \"55\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\tvar h_height = j$(\"#header_container\").height();\r\n\t\t}\r\n var windowHeight = j$(window).height(); // get the height of the window\r\n var docHeight = j$(document).height();\r\n\r\n for (var i=0; i < aArray.length; i++) {\r\n var theID = aArray[i];\r\n var divPos = (j$(theID).offset().top)-h_height;\r\n\t\t\tvar divh = j$(theID).height();\r\n var divHeight = +divh + +h_height; // get the height of the div in question\r\n if (windowPos >= divPos && windowPos < (divPos + divHeight)) {\r\n j$(\"a[href='\" + theID + \"']\").parent('li').addClass(\"current-menu-item\");\r\n } else {\r\n j$(\"a[href='\" + theID + \"']\").parent('li').removeClass(\"current-menu-item\");\r\n }\r\n }\r\n\r\n if(windowPos + windowHeight == docHeight) {\r\n if (!j$(\"#header_container nav ul li\").hasClass(\"current-menu-item\")) {\r\n var navActiveCurrent = j$(\".current-menu-item a\").attr(\"href\");\r\n j$(\"a[href='\" + navActiveCurrent + \"']\").parent('li').removeClass(\"current-menu-item\");\r\n j$(\"#header_container nav ul li:last-child a\").parent('li').addClass(\"current-menu-item\");\r\n }\r\n }\r\n });\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}\r\n}", "function buildNav(){\n \n sections.forEach(createLi); // applying the createLi function for each Elements\n navBar.appendChild(docFrag);// now we can add the Fragment With contains all li elements to the navBar\n}", "function buildNav() {\nlet fragment = document.createDocumentFragment();\n sections.forEach((sec, index) => {\n \tlet navLink = sec.getAttribute(\"data-nav\");\n \tlet textNode = document.createTextNode(navLink);\n \tlet cLink = document.createElement(\"a\");\n \tlet elLi = document.createElement(\"li\");\n \t// Build menu\n \tcLink.setAttribute('class', 'menu__link');\n \tcLink.appendChild(textNode);\n \tlinkClick(cLink, sec);\n \telLi.appendChild(cLink);\n \tfragment.appendChild(elLi);\n });\n nav.appendChild(fragment);\n}", "function buildNav() {\r\n for (const section of sections) {\r\n // create the <li> element\r\n const navItem = document.createElement('li');\r\n //create the <a> element\r\n const navItemLink = document.createElement('a');\r\n navItemLink.className = 'menu__link';\r\n\r\n navItemLink.dataset['section'] = section.id;\r\n navItemLink.textContent = section.dataset.nav;\r\n //Append child statements\r\n navItem.appendChild(navItemLink);\r\n navbarlist.appendChild(navItem);\r\n \r\n //SrcollTo function to view section\r\n navItemLink.addEventListener(\"click\", (scroll) => {\r\n section.scrollIntoView({\r\n behavior : \"smooth\",\r\n });\r\n });\r\n }\r\n}", "function buildNav() {\n const fragment = document.createDocumentFragment();\n\n for (let i = 0; i < subHeadings.length; i++) {\n const listItem = document.createElement('li');\n listItem.innerHTML = `<a>${subHeadings[i].textContent}</a>`;\n listItem.querySelector('a').setAttribute('href', '#' + sections[i].id);\n listItem.querySelector('a').className = 'menu__link';\n\n fragment.appendChild(listItem);\n }\n\n return navUl.appendChild(fragment);\n}", "function buildNav(sections) {\n for (const section of sections) {\n let navLinkName = section.getAttribute(\"data-nav\");\n let sectionId = section.getAttribute(\"id\");\n insertNavLink(navLinkName, sectionId);\n }\n}", "function changeNav(destinationItem) {\n var destination = destinationItem.getAttribute('data-title');\n var elementsToRemoveActive = ['classLink', 'accountLink', 'statLink'];\n for (var i = 0; i < elementsToRemoveActive.length; i++) {\n document.getElementById(elementsToRemoveActive[i]).className = document.getElementById(elementsToRemoveActive[i]).className.replace(/(?:^|\\s)active(?!\\S)/g, '');\n }\n if (destination == 'classes') {\n document.getElementById('classLink').className += 'active';\n $('.container').load('panel-lessons.html', function () {\n getLessons();\n });\n } else if (destination == 'stats') {\n document.getElementById('statLink').className += 'active';\n $('.container').load('panel-stats.html', function () {\n\n });\n } else if (destination == 'account') {\n document.getElementById('accountLink').className += 'active';\n $('.container').load('panel-account.html', function () {\n\n });\n }\n}", "function createNavList() {\n //Looping over all sections\n for(section of sections) {\n //Getting section name\n secName = section.getAttribute(\"data-nav\");\n //Getting section link\n secLink = section.getAttribute(\"id\");\n //Create list for each section\n newItem = document.createElement(\"li\");\n //Add section name, link and CSS class to apply styles\n newItem.innerHTML = `<a class=\"menu__link\" href=\"#${secLink}\">${secName}</a>`;\n //Appending new list to navbar menu\n navList.appendChild(newItem);\n }\n}", "function navbuild() {\n for (let i = 0; i < allSections.length; i++) {\n const newLi = document.createElement(\"li\");\n const liIdFromSection = allSections[i].getAttribute(\"id\");\n const liValueFromSection = allSections[i].getAttribute(\"data-nav\");\n newLi.innerHTML = create_nav_li_atag(liIdFromSection, liValueFromSection);\n const navBarValues = document.getElementById(\"navbar__list\");\n navBarValues.appendChild(newLi);\n }\n}", "function setNavigation() {\r\n\t\t\tvar i, html = '';\r\n\r\n\t\t\t//generate the buttons\r\n\t\t\tif(o.buttons) {\r\n\t\t\t\t$nav = $('<ul />', {\r\n\t\t\t\t\tid: o.navigationId\r\n\t\t\t\t});\r\n\t\t\t\tfor(i = 0; i < itemNum; i++) {\r\n\t\t\t\t\thtml += '<li><span></span></li>';\r\n\t\t\t\t}\r\n\t\t\t\t$nav.html(html).appendTo($root).fadeIn(700);\r\n\r\n\t\t\t\t$navLi = $nav.find('li');\r\n\t\t\t\t$navLi.eq(0).addClass(o.selectedClass);\r\n\t\t\t}\r\n\r\n\t\t\t//generate the arrows\r\n\t\t\tif(o.arrows) {\r\n\t\t\t\t$prevArrow = $('<div />', {\r\n\t\t\t\t\t'class': o.prevArrowClass\r\n\t\t\t\t}).appendTo($root);\r\n\t\t\t\t$nextArrow = $('<div />', {\r\n\t\t\t\t\t'class': o.nextArrowClass\r\n\t\t\t\t}).appendTo($root);\r\n\t\t\t}\r\n\r\n\t\t}", "function buildNavBar() {\n let sectioninfo = '';\n\n //add each section to the navigation bar\n sections.forEach(section => {\n let sectionId = section.id;\n let sectionData = section.dataset.nav;\n sectioninfo += `<li><a class=\"menu__link ${sectionId}\" href=\"#${sectionId}\">${sectionData}</a></li>`;\n });\n navbar.innerHTML = sectioninfo;\n}", "function app_render_navigation() {\r\n\r\n $('nav').empty();\r\n appData.tagList.forEach(function (value, index) {\r\n let myHTML = `<button class=\"app_nav_cell\" data-index=\"${index}\" value=\"${appData.tagList[index]}\" oncontextmenu=\"app_nav_remove(this)\" onclick=\"app_get_images(this)\">${appData.tagList[index]}</button>`;\r\n $('nav').append(myHTML);\r\n });\r\n}", "function generate_navBar() {\n var links = [\"#hero_section\", \"#aboutUs\", \"#service\",\n \"#Portfolio\", \"#team\", \"#contact\"];\n var texts_arr = [\"HOME\", \"CAST\", \"PLOT & HISTORY\",\n \"PHOTOS\", \"TEAM\", \"COMMENT\"];\n var section_arr = [\"sec1\", \"sec2\", \"sec3\",\n \"sec4\", \"sec5\", \"sec6\"];\n var ul = document.createElement(\"ul\");\n var li, a, text;\n for (var i = 0, l = links.length; i < l; ++i) {\n li = document.createElement('li');\n a = document.createElement('a');\n text = document.createTextNode(texts_arr[i]);\n\n a.href = links[i];\n\n a.appendChild(text);\n li.appendChild(a);\n //li.id = section_arr[i];\n a.setAttribute(\"class\", section_arr[i]);\n ul.appendChild(li);\n ul.setAttribute(\"class\", \"nav navbar-nav navStyle\");\n\n }\n var element = document.getElementById(\"mainNav\");\n element.appendChild(ul);\n}", "function BuildNav() {\n let NavElement = document.querySelector('#navbar__list');\n for (let section of Sections) {\n let SectionName = section.getAttribute('data-nav');\n let LinkItem = document.createElement('li');\n LinkItem.textContent = SectionName;\n LinkItem.classList.add(\"menu__link\");\n NavElement.appendChild(LinkItem);\n LinkItem.addEventListener('click', ScrollToAnchorID);\n }\n\n}", "function buildNav() {\n var sectionContent = document.getElementsByClassName('section');\n var numberOfSections = sectionContent.length;\n var sideNav = document.getElementsByClassName('sideNav')[0];\n var titleList = [];\n var subSectionList = [];\n\n // Makes a list of all section titles and associated subsection titles\n // There should only be one sectionTitle per section\n for (i=0; i<numberOfSections; i++) {\n titleList.push(sectionContent[i].getElementsByClassName('sectionTitle'));\n subSectionList.push(sectionContent[i].getElementsByClassName('subSectionTitle'));\n }\n\n // Builds the listSection\n for (sec=0; sec<numberOfSections; sec++) {\n if (subSectionList[sec].length > 0) {\n var listSection = build(titleList[sec], 'sn-listSection', true);\n var sublist = build(subSectionList[sec], 'sn-sublist', false);\n\n listSection.appendChild(sublist)\n } else {\n var listSection = build(titleList[sec], 'sn-listSection', false);\n }\n sideNav.appendChild(listSection);\n }\n}", "function buildNav () {\n const fragment = document.createDocumentFragment();\n const section_num = document.getElementsByClassName('landing__container');\n\n for (let i = 1; i <= section_num.length; i++) {\n const newElement = document.createElement('li');\n \n newElement.innerText = 'Section ' + i;\n newElement.classList.add('menu__link');\n newElement.classList.add('scroll_to');\n fragment.appendChild(newElement);\n }\n \n document.getElementById('navbar__list').appendChild(fragment);\n}", "function buildNavBar(){\n// based on the number of sections nav elements will be created for each section\n sections.forEach(function(section){\n let sectionData = section.dataset.nav\n\n let anchor = document.createElement('a')\n anchor.href = '#' + section.id\n anchor.dataset.section = section.id\n anchor.innerText = sectionData\n\n let item = document.createElement('li')\n item.appendChild(anchor)\n\n navBarList.appendChild(item)\n })\n navBarList.style = 'display: flex; text-align: center; justify-content: space-around; margin-top: 15px; margin-bottom: 15px;'\n}", "function buildNavigationBar() {\n let pageSections = document.getElementsByTagName('section');\n let mainUl = document.getElementById('navbar__list');\n let fragment = document.createDocumentFragment();\n\n for (const sec of pageSections) {\n const secTitle = sec.getAttribute(\"data-nav\");\n const listItem = document.createElement('LI');\n const htmlText = '<a data-nav=\\\"' + secTitle + '\\\">' + secTitle + '</a>';\n\n listItem.insertAdjacentHTML('beforeend', htmlText);\n listItem.addEventListener('click', goToSection);\n //using DocumentFragment because appendChild is a expensive proccess, for better performance\n fragment.appendChild(listItem);\n }\n //painting and reflow happens only one time after the loop\n mainUl.appendChild(fragment);\n}", "function setupNav() {\n setupPageSelector();\n setupRecipeSelector();\n}", "function addProfileNav() {\n if (UTIL.idExists(\"PSTAB\")) {\n var navHTML = \"<nav class='noselect' id='jbmnplsProfileNav'><ul>\";\n var navigation = [\n \"Profile\",\n \"Personal Info\",\n \"Academic Info\",\n \"Skills Inventory\",\n ];\n $(\"#PSTAB td a\").each(function(i){\n var obj = $(this);\n var link = obj.attr(\"href\");\n if (obj.attr(\"href\") == null) {\n navHTML += \"<li style='z-index:\"+i+\";' class='selected navItem'><span>\"+navigation[i]+\"</span></li>\";\n } else {\n var onclick = link.substr(link.indexOf(\":\")+1).trim();\n navHTML += '<li style=\"z-index:'+i+'\" class=\"navItem\"><span class=\"fakeLink\" onclick=\"'+onclick+'\">'+navigation[i]+'</span></li>';\n }\n });\n navHTML += \"</ul></nav>\";\n $(\"body form:eq(0)\").append(navHTML);\n }\n}", "function addNavItems(galleries){\n console.log('Adding Nav Items...');\n aboutMeNav(galleries);\n for (var i = 0; i < galleries.gallery.length; i++) {\n $('#slide-out').append(`<li><a href=\"index.html?gallery=${galleries.gallery[i].filename}\">${galleries.gallery[i].title}</a></li> <li><div class=\"divider\"></div></li>`);\n }\n }", "function navigate(nav, navArray){\n for (var i = 0; i < navArray.length; i++) {\n if (nav == navArray[i].nav) {\n navArray[i].page.style.display = \"block\";\n if (nav != document.getElementById('homenav')){\n navArray[i].nav.style.backgroundColor = \"#FAA669\";\n }\n navArray[i].nav.style.cursor = \"default\";\n } else {\n if (!(navArray[i].page == account && (nav == signNav || nav == logNav)))\n {\n navArray[i].page.style.display = \"none\";\n }\n if (navArray[i].nav != document.getElementById('homenav')){\n navArray[i].nav.style.backgroundColor = navArray[i].color;\n }\n navArray[i].nav.style.cursor = \"pointer\";\n }\n }\n }", "function _plmNav(navInfo)\r\n{\t\r\n\tif(navInfo!=null)\r\n\t{\r\n\t\tloadWorkArea(navInfo,\"\",\"\",loadNavigationGrid);\r\n\t}\t\r\n}", "function process_navigation() {\r\n\tlet html = \"<ul class='navtree'>\";\r\n\tfunction open(linkName, signature, level) {\r\n\t\thtml += \"<li>\";\r\n\t\thtml += \"<i class='fa fa-angle-right accordion-toggle'></i>\";\r\n\t\tif (signature)\t\r\n\t\t\thtml += `<a class='navlink navlink--lvl${level}' page='${signature}'>${escape_html(linkName)}</a>`;\r\n\t\telse\r\n\t\t\thtml += `<span class='navlink navlink--lvl${level}'>${escape_html(linkName)}</span>`;\r\n\t\thtml += \"<ul class='accordion'>\";\r\n\t\treturn html;\r\n\t}\r\n\t\r\n\tfunction close() {\r\n\t\thtml += \"</ul>\";\r\n\t\thtml += \"</li>\";\r\n\t}\r\n\t\r\n\tfunction build(member) {\r\n\t\tif (member.childcount === 0) {\r\n\t\t\thtml += `<li>\r\n\t\t\t\t\t\t<a class='navlink navlink--lvl3' page='${member.signature}'>\r\n\t\t\t\t\t\t\t${escape_html(member.name)}\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t</li>`;\r\n\t\t} else {\r\n\t\t\topen(member.name, member.signature, 3);\r\n\t\t\tconst childs = findChilds(member);\r\n\t\t\tfor (const type of Object.keys(childs)) {\r\n\t\t\t\topen(SECTION_NAMES[type], null, 3);\r\n\t\t\t\tfor (const child of childs[type])\r\n\t\t\t\t\tbuild(child);\r\n\t\t\t\tclose();\r\n\t\t\t}\r\n\t\t\tclose();\r\n\t\t}\r\n\t}\r\n\t\r\n\tfor (const member of ROOT_MEMBERS) {\r\n\t\tbuild(member);\r\n\t\thtml += \"<hr/>\";\r\n\t}\t\r\n\thtml += \"</ul>\";\r\n\t\r\n\tconst navigation = $('#navigation');\r\n\tnavigation.html(html);\r\n\t\r\n\tprocess_accordions(navigation);\r\n\tprocess_links(navigation);\r\n}", "redrawNavPanel()\n {\n \tlet self = this;\n \t\n \tlet b = 0;\n \tlet sect = false;\n \tfor( let a in self.sections )\n\t\t{\n\t\t\tif( a == self.activeSection )\n\t\t\t\tsect = self.sections[ a ];\n\t\t}\n\t\tif( !sect ) return;\n\t\t\n\t\t// Make next prev\n\t\tif( !this.#navbarAdded )\n\t\t{\n\t\t\tthis.#navbarAdded = true;\n\t\t\tlet str = '';\n\t\t\tstr += '<div class=\"Previous\"><span>Previous</span></div><div class=\"Pages\"></div><div class=\"Next\"><span>Next</span></div>';\n\t\t\tthis.navpanel.innerHTML = str;\n\t\t}\n\t\t\n\t\tthis.navpanel.querySelector( '.Pages' ).innerHTML = '';\n\t\tthis.navpanel.querySelector( '.Pages' ).classList.add( 'SmoothScrolling' );\n\t\t\n\t\tlet offset = 0;\n\t\t\n\t\tif( sect.pages )\n\t\t{\n\t\t\t// First pass, check active page\n\t\t\tif( !self.currentPage )\n\t\t\t{\n\t\t\t\tfor( let a = 0; a < sect.pages.length; a++ )\n\t\t\t\t{\n\t\t\t\t\tif( sect.pages[a].ID == self.storedActivePage || ( self.storedActivePage == -1 && a == 0 ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tself.currentPage = a;\n\t\t\t\t\t\t//console.log( 'Found current page ' + a + ' where stored is ' + self.storedActivePage + ' and this page is ' + sect.pages[a].ID );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet activePage = false;\n\t\t\tfor( let a = 0; a < sect.pages.length; a++ )\n\t\t\t{\n\t\t\t\tlet p = document.createElement( 'div' );\n\t\t\t\tp.className = 'PageElement';\n\t\t\t\tp.style.left = ( ( a * 40 ) - offset ) + 'px';\n\t\t\t\tif( self.currentPage == a )\n\t\t\t\t{\n\t\t\t\t\tp.classList.add( 'ActivePage' );\n\t\t\t\t\tactivePage = p;\n\t\t\t\t}\n\t\t\t\tp.innerHTML = '<span>' + ( a + 1 ) + '</span>';\n\t\t\t\t( function( pag, num )\n\t\t\t\t{\n\t\t\t\t\tif( self.getCurrentSection().Navigation == '1' )\n \t\t\t\t{\n\t\t\t\t\t\tpag.onclick = function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( self.completed ) return;\n\t\t\t\t\t\t\tself.currentPage = num;\n\t\t\t\t\t\t\tself.renderElements();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} )( p, a );\n\t\t\t\tthis.navpanel.querySelector( '.Pages' ).appendChild( p );\n\t\t\t}\n\t\t\t\n\t\t\tlet pid = sect.pages[ self.currentPage ].ID;\n\t\t\t\n\t\t\t//console.log( 'Setting current page: ', self.currentPage + ' ' + pid );\n\t\t\t\n\t\t\t// Set active page\n\t\t\tlet csid = this.#courseSessionId;\n\t\t\t\n\t\t\t// Scroll into view\n\t\t\tif( activePage )\n\t\t\t{\n\t\t\t\tactivePage.parentNode.scrollTo( activePage.offsetLeft - 100, 0 );\n\t\t\t}\n\t\t\t\n\t\t\t// Workaround on saving issue..\n\t\t\tsetTimeout( function()\n\t\t\t{\n\t\t\t\tlet mo = new Module( 'system' );\n\t\t\t\tmo.execute( 'appmodule', {\n\t\t\t\t\tappName: 'Courses',\n\t\t\t\t\tcommand: 'setsessioninfo',\n\t\t\t\t\tcurrentPageId: pid,\n\t\t\t\t\tcourseSessionId: csid\n\t\t\t\t} );\n\t\t\t}, 250 );\n\t\t}\n\t\t\n\t\t// Set active section\n\t\tlet m = new Module( 'system' );\n\t\tm.execute( 'appmodule', {\n\t\t\tappName: 'Courses',\n\t\t\tcommand: 'setsessioninfo',\n\t\t\tcurrentSectionId: self.getCurrentSection().ID,\n\t\t\tcourseSessionId: this.#courseSessionId\n\t\t} );\n\t\t\n\t\tthis.navpanel.querySelector( '.Previous' ).onclick = function()\n\t\t{\n\t\t\tif( self.completed ) return;\n\t\t\tif( self.getCurrentSection().Navigation == '1' )\n\t\t\t{\n\t\t\t\tself.currentPage--;\n\t\t\t\tif( self.currentPage < 0 ) \n\t\t\t\t{\n\t\t\t\t\tself.currentPage = 0;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tself.renderElements();\n\t\t\t}\n\t\t}\n \t\t\n\t\tthis.navpanel.querySelector( '.Next' ).onclick = function()\n\t\t{\n\t\t\tif( self.completed ) return;\n\t\t\tif( self.pageCompleted() )\n\t\t\t{\n\t\t\t\tself.currentPage++;\n\t\t\t\tif( self.currentPage >= self.sections[ self.activeSection ].pages.length )\n\t\t\t\t{\n\t\t\t\t\t// Check if there's a next section\n\t\t\t\t\tlet b = 0;\n\t\t\t\t\tlet current = 0;\n\t\t\t\t\tfor( let a in self.sections )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( a == self.activeSection )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrent = b;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tb++;\n\t\t\t\t\t}\n\t\t\t\t\tb = 0;\n\t\t\t\t\tfor( let a in self.sections )\n\t\t\t\t\t{\n\t\t\t\t\t\t// This is the next section\n\t\t\t\t\t\tif( b == current + 1 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tself.activeSection = a;\n\t\t\t\t\t\t\tself.currentPage = 0;\n\t\t\t\t\t\t\tself.refreshStructure();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tb++;\n\t\t\t\t\t}\n\t\t\t\t\tself.currentPage--;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tself.renderElements();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tconsole.log( 'This page is not solved.' );\n\t\t\t}\n\t\t}\n }", "function nav(path) {\n var model = window.MODEL;\n var html = \"\";\n var cur = window.current_drive_order || 0;\n html += `<nav class=\"navbar navbar-expand-lg navbar-light bg-light\">\n <a class=\"navbar-brand\" href=\"/${cur}:/\"><img border=\"0\" alt=\"Shinobi Cloud\" src=\"https://user-images.githubusercontent.com/64221555/92332342-ee306400-f09a-11ea-9e61-0c246c3e0bae.png\" height=\"50px\"></a>\n <button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarSupportedContent\" aria-controls=\"navbarSupportedContent\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n <span class=\"navbar-toggler-icon\"></span>\n </button>\n\n <div class=\"collapse navbar-collapse\" id=\"navbarSupportedContent\">\n <ul class=\"navbar-nav mr-auto\">\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"/${cur}:/\">Home</a>\n </li>`;\n var names = window.drive_names;\n var drive_name = window.drive_names[cur];\n /*html += `<button class=\"mdui-btn mdui-btn-raised\" mdui-menu=\"{target: '#drive-names'}\"><i class=\"mdui-icon mdui-icon-left material-icons\">share</i> ${names[cur]}</button>`;\n html += `<ul class=\"mdui-menu\" id=\"drive-names\" style=\"transform-origin: 0px 0px; position: fixed;\">`;\n names.forEach((name, idx) => {\n html += `<li class=\"mdui-menu-item ${(idx === cur) ? 'mdui-list-item-active' : ''} \"><a href=\"/${idx}:/\" class=\"mdui-ripple\">${name}</a></li>`;\n });\n html += `</ul>`;*/\n\n // Dropdown to select different drive roots.\n html += `<li class=\"nav-item dropdown\"><a class=\"nav-link dropdown-toggle\" href=\"#\" id=\"navbarDropdown\" role=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">${drive_name}</a><div class=\"dropdown-menu\" aria-labelledby=\"navbarDropdown\">`;\n names.forEach((name, idx) => {\n html += `<a class=\"dropdown-item\" href=\"/${idx}:/\">${name}</a>`;\n });\n html += `</div></li>`;\n\n html += `<li class=\"nav-item dropdown\"><a class=\"nav-link dropdown-toggle\" href=\"#\" id=\"navbarDropdown\" role=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">Current Path</a><div class=\"dropdown-menu\" aria-labelledby=\"navbarDropdown\"><a class=\"dropdown-item\" href=\"/${cur}:/ \">> Home</a>`;\n\n if (!model.is_search_page) {\n var arr = path.trim('/').split('/');\n var p = '/';\n if (arr.length > 1) {\n arr.shift();\n for (i in arr) {\n var n = arr[i];\n n = decodeURI(n);\n p += n + '/';\n if (n == '') {\n break;\n }\n html += `<a class=\"dropdown-item\" href=\"/${cur}:${p}\">> ${n}</a>`;\n }\n }\n }\n\n html += `</div></li><li class=\"nav-item\">\n <a class=\"nav-link\" href=\"//www.facebook.com/imsjana/\">Know More About Me</a>\n </li>`;\n\n var search_text = model.is_search_page ? (model.q || '') : '';\n const isMobile = Os.isMobile;\n var search_bar = `\n</ul>\n<form class=\"form-inline my-2 my-lg-0\" method=\"get\" action=\"/${cur}:search\">\n<input class=\"form-control mr-sm-2\" name=\"q\" type=\"search\" placeholder=\"Search\" aria-label=\"Search\" value=\"${search_text}\">\n<button class=\"btn btn-outline-success my-2 my-sm-0\" onclick=\"if($('#search_bar').hasClass('mdui-textfield-expanded') && $('#search_bar_form>input').val()) $('#search_bar_form').submit();\" type=\"submit\">Search</button>\n</form>\n</div>\n</nav>\n`;\n\n // Personal or team\n if (model.root_type < 2) {\n // Show search box\n html += search_bar;\n }\n\n $('#nav').html(html);\n mdui.mutation();\n mdui.updateTextFields();\n}", "function navigation() {\n\t\n\t/* @TODO: reverse li und stelle angemeldet als nach oben */\n\t//$$('#account ul').insert( $$('#account ul li').reverse() );\n}", "function addNavButtons()\n{\n var unorderedList=document.getElementById('navbar__list');\n for(var pointer of allSections)\n {\n var navMenu=document.createElement('li');\n var anchorMenu=document.createElement('a');\n anchorMenu.className='menu__link';\n anchorMenu.innerText=pointer.dataset.nav;\n anchorMenu.dataset.nav=pointer.id;\n navMenu.appendChild(anchorMenu);\n unorderedList.appendChild(navMenu);\n\n }\n \n\n}", "function buildNav() {\n let ul = document.getElementById(\"navbar__list\");\n for (section of sections) { \n let element = document.createElement(\"li\");\n let link = document.createElement(\"a\");\n link.innerHTML=section.getAttribute(\"data-nav\");\n link.setAttribute('data-id', section.getAttribute(\"id\"));\n link.addEventListener('click', function(event){\n event.preventDefault(); \n animate(event.target);\n });\n element.appendChild(link);\n ul.appendChild(element);\n }\n}", "function startBuildingNavMenu() {\n let elementFragment = document.createDocumentFragment();\n landingPageSections.forEach((sect, index) => {\n let itsLi = document.createElement(\"li\"),\n itsAnchor = document.createElement(\"a\");\n itsAnchor.href = `#${sect.id}`;\n itsAnchor.innerText = sect.dataset.nav;\n itsAnchor.className = `menu__link${\n index === 0 ? \" currently__active\" : \"\"\n }`;\n itsLi.appendChild(itsAnchor);\n elementFragment.appendChild(itsLi);\n });\n navbar__list.appendChild(elementFragment);\n}", "function renderNavBar(data){\n for (let i = 0; i < data.length; i++){\n let name = data[i];\n let result = '<li><a href=\"#\" class=\"navBtn\" id=\"' + i + '\">' + name + '</a></li>';\n $('#navBar').append(result);\n }\n }", "function updatePageNavigation() {\n const Navigation = MonitoringConsole.Model.Settings.Navigation;\n let panelConsole = $('#console');\n if (Navigation.isCollapsed()) {\n panelConsole.removeClass('state-show-nav');\n } else {\n if (!panelConsole.hasClass('state-show-nav')) {\n panelConsole.addClass('state-show-nav'); \n }\n }\n $('#NavSidebar').replaceWith(Components.createNavSidebar(createNavSidebarModel()));\n }", "function createNav(sectionArray) {\n // loop through the now full sectionArray eg. section one, section two, ...\n for (i = 0; i < sectionArray.length; i++) {\n const li = document.createElement('li');\n const a = document.createElement('a');\n let newId = (sectionArray[i]);\n let newHref = (sectionArray[i]);\n const newText = document.createTextNode(sectionArray[i]);\n\n // add class\n a.className = 'header__nav-link';\n\n // add id\n newId = newId.replace(/\\s+/g, '');\n a.id = newId;\n\n //add href\n newHref = newHref.replace(/[`~!@#$%^&*()_|+\\-=?;:'\",.<>\\{\\}\\[\\]\\\\\\/]/gi, '').replace(/ +/g, '-');\n newHref = newHref.toLowerCase();\n a.href = '#'+newHref;\n\n //add newText to a\n a.appendChild(newText);\n //add a to li\n li.appendChild(a);\n //add li to nav\n nav.appendChild(li);\n }\n return nav;\n}", "function createNavBarList(){\n for ( let i = 0; i < sectionList.length; i++ ) {\n let section = sectionList[i];\n const sectionName = section.getAttribute('data-nav');\n const listElement = document.createElement('li');\n listElement.id = sectionName;\n listElement.innerHTML = `<span class=menu__link classList=\"${sectionName}\">${sectionName}</span>`\n navBar.appendChild(listElement);\n }\n}", "function onPageLoad() {\r\n genNavBar();\r\n}", "function buildMenu() {\n for (let section of sectionList) {\n let element = document.createElement('li');\n element.textContent = section.getAttribute(\"data-nav\");\n element.classList.add(\"menu__link\");\n \n let section_cnt = section.getAttribute(\"data-nav\").split(' ')[1]\n element.setAttribute('id',section_cnt);\n\n navbarList.appendChild(element);\n navbarList.firstElementChild.classList.add(\"active\");\n }\n}", "function getNav(arr) {\n return \"<nav>\\n\" + arr.map(x => \" <a href=\\\"\\\">\" + x + \"</a>\").join(\"\\n\") + \"\\n</nav>\";\n}", "function buildNavBar() {\n const sections = document.querySelectorAll('section');\n const docFragment = document.createDocumentFragment();\n sections.forEach((section) => {\n const listItem = document.createElement('li');\n const anchor = document.createElement('a');\n anchor.setAttribute('class', 'menu__link');\n anchor.setAttribute('href', `#${section.id}`);\n anchor.textContent = section.dataset.nav;\n listItem.appendChild(anchor);\n docFragment.appendChild(listItem);\n });\n listOfItems.appendChild(docFragment);\n}", "function DisplayNav() {\n switch (userInfo.accountType) {\n case 'E':\n return (<EmpNav />)\n\n case 'U':\n return (<UserNav />)\n\n default:\n return (<VisitNav />)\n }\n }", "function navRouter(i) {\n if (i.text() === \"About\") {\n navAnimation('#0');\n showAbout();\n } else if (i.text() === \"Projects\") {\n navAnimation('#1');\n showProjects();\n } else {\n navAnimation('#2');\n showContactInfo();\n }\n toggleMenu();\n }", "function multiLevelMenu() {\n for (let abc of list) {\n abc.addEventListener('click', function (e) {\n e.stopPropagation();\n remove(this);\n if(this.children[0].nextElementSibling === null) {\n this.classList.add(\"active\");\n pageTitle.innerHTML = this.children[0].innerHTML;\n } else {\n if (this.children[0].nextElementSibling !== null) {\n if (this.children[1].classList.contains('open')) {\n this.children[1].classList.remove('open');\n this.classList.remove('active');\n } else {\n this.children[1].classList.add('open');\n this.classList.add(\"active\");\n pageTitle.innerHTML = this.children[0].innerHTML;\n }\n } \n }\n })\n }\n\n // get nav link text and passing in include HTML file function\n $.each(listMenus, function(ind, currentMenu) {\n currentMenu.addEventListener('click', function(e) {\n pageUrl = $(this).text().trim(); // get text and remove white space around sentence\n pageId++; \n includeHTmlFile(pageUrl);\n })\n })\n }", "function Nav(conf) {\n\n var self = this;\n\n this.conf = conf;\n this.navbar_obj = document.getElementById(gs_nav_placeholder_id);\n\n /* The nav is a <ul> with items <li> and page links <a>. */\n this.genNavListTags = function() {\n\n for (index = 0; index < self.conf.nav_items.length; index++) {\n\n var li = document.createElement('li');\n var a = document.createElement('a');\n var item = self.conf.nav_items_bname[index]; // get link names\n\n /* Select active page and nav buttons. Make nav items non-active\n * by default. */\n appendAttribute(a, 'class', 'non-active-nav');\n\n /* make the nav tab show up as 'active' by excluding it from\n * the non-active-nav class. */\n if (self.conf.requested_page == item) {\n a.removeAttribute('class');\n appendAttribute(li, 'class', 'active');\n }\n\n appendAttribute(li, 'id', 'navitem');\n appendAttribute(li, 'class', 'nav-item');\n\n /* setup nav links for each button */\n appendAttribute(a, 'class', 'nav-link');\n appendAttribute(a, 'href', '?page='+item+'#');\n appendAttribute(a, 'data-toggle','tab');\n\n /* make sure the ribbon doesn't get in the way */\n appendAttribute(a, 'style', 'z-index: 1000;');\n\n /* set nav button name */\n a.innerHTML = item;\n\n li.appendChild(a);\n self.navbar_obj.appendChild(li);\n }\n };\n this.genNavListTags();\n\n}", "function initMenuItem() {\n $(\".navigation-menu a\").each(function () {\n var pageUrl = window.location.href.split(/[?#]/)[0];\n if (this.href == pageUrl) { \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 }", "function createCommentsNavigation(pages){\n\n\tvar pagesContainer = $(\".pagination-pages\"); //Get container for nav. pages\n\t\n\t//create pages menu\n\tpagesContainer.append(newPage('first','&laquo;')); //Add << button\n\t\n\t//Add each page and make page 1 active\n\tfor(var i = 1; i <= pages; i++){\n\t\tpagesContainer.append(newPage(\"Page\" + i,i)); \n\t}\n\tpagesContainer.append(newPage('last','&raquo;')); //Add >> button\n\t\n\t//Manage visual aspects\n\t$(\"#first\").addClass('disabled'); //disable first button\n\t\n\t//if only one page - Disable last button\n\tif(pages == 1){\n\t $(\"#last\").addClass('disabled');\n\t}\n\t\n\t$(\"#Page1\").addClass('active'); //Set first page as active\n \n}//END createArticlesNavigation", "function buildNav(){\n let ulFragment = document.createDocumentFragment();\n for(const section of allSections){\n let navItem = document.createElement('li');\n let navLink = document.createElement('a');\n navLink.addEventListener('click', function (e){\n e.preventDefault();\n scrollToSection(section);\n });\n navLink.innerText = section.getAttribute('data-nav');\n navItem.appendChild(navLink);\n navLink.classList.add('menu__link');\n ulFragment.appendChild(navItem);\n }\n navbarList.appendChild(ulFragment);\n navItems = navbarList.getElementsByTagName('li');\n}", "function redrawNav(){\r\n var article1Top = 0;\r\n // The top of each article is offset by half the distance to the previous article.\r\n var article2Top = $('#frontend-school').offset().top / 2;\r\n var article3Top = ($(document).height() - $('#experience').offset().top) / 2;\r\n $('nav.nav li').removeClass('active');\r\n if($(document).scrollTop() >= article1Top && $(document).scrollTop() < article2Top){\r\n $('li.general-info').addClass('active');\r\n } else if ($(document).scrollTop() >= article2Top && $(document).scrollTop() < article3Top){\r\n $('li.frontend-school').addClass('active');\r\n } else if ($(document).scrollTop() >= article3Top){\r\n $('li.experience').addClass('active');\r\n }\r\n \r\n }", "function nav(name, html) {\n if (name == 'dot') {\n html = '<ol class=\"dots\">';\n $.each(_.li, function (index) {\n html += '<li class=\"' + (index == _.i ? name + ' active' : name) + '\">' + ++index + '</li>';\n });\n html += '</ol>';\n } else {\n html = '<div class=\"';\n html = html + name + 's\">' + html + name + ' prev\">' + _.o.prev + '</div>' + html + name + ' next\">' + _.o.next + '</div></div>';\n }\n\n _.el.addClass('has-' + name + 's').append(html).find('.' + name).click(function () {\n var me = $(this);\n me.hasClass('dot') ? _.stop().to(me.index()) : me.hasClass('prev') ? _.prev() : _.next();\n });\n }", "function addVerticalNavigation(){\n \t\t\t$('body').append('<div id=\"fp-nav\"><ul></ul></div>');\n \t\t\tnav = $('#fp-nav');\n\n \t\t\tnav.css('color', options.navigationColor);\n \t\t\tnav.addClass(options.navigationPosition);\n\n \t\t\tfor (var i = 0; i < $('.fp-section').length; i++) {\n \t\t\t\tvar link = '';\n \t\t\t\tif (options.anchors.length) {\n \t\t\t\t\tlink = options.anchors[i];\n \t\t\t\t}\n\n \t\t\t\tvar li = '<li><a href=\"#' + link + '\"><span></span></a>';\n\n \t\t\t\t// Only add tooltip if needed (defined by user)\n \t\t\t\tvar tooltip = options.navigationTooltips[i];\n \t\t\t\tif (tooltip != undefined && tooltip != '') {\n \t\t\t\t\tli += '<div class=\"fp-tooltip ' + options.navigationPosition + '\">' + tooltip + '</div>';\n \t\t\t\t}\n\n \t\t\t\tli += '</li>';\n\n \t\t\t\tnav.find('ul').append(li);\n \t\t\t}\n \t\t}", "function creatNavMenu() {\n\n const menuItemToCreate = 'li';\n const menuItemClassName = 'menu__link';\n\n for (let currentItem of navMenuItems) {\n let currentNavMenuItem = document.createElement(menuItemToCreate);\n //using html data set property to manipulate DomStringMap\n currentNavMenuItem.className = menuItemClassName;\n currentNavMenuItem.dataset.nav = currentItem.id;\n currentNavMenuItem.innerText = currentItem.dataset.nav;\n navMenu.appendChild(currentNavMenuItem);\n\n };\n}", "function PageNav(conf) {\n\n var self = this;\n\n this.conf = conf;\n this.pagination_ul = document.getElementById(gs_pagination_links_id);\n this.pagination_div = document.getElementById(gs_pagination_div_id);\n\n /* The nav is a <ul> with items <li> and page links <a>. */\n this.genNavListTags = function() {\n\n /* get number of pages */\n var numPages = self.conf.numBlogIndexPages(); \n var blogTitle = self.conf.blog_items[0];\n var reqPage = self.conf.requested_blog_index_page;\n\n /* setup \"previous page\" button */\n if (reqPage > 1) {\n var li = document.createElement('li');\n var a = document.createElement('a');\n appendAttribute(a, 'href', '?page='+blogTitle+'&p='+(reqPage-1)+'#');\n a.innerHTML = \"&laquo;\";\n li.appendChild(a);\n self.pagination_ul.appendChild(li);\n }\n\n /* setup numbered page links */\n for (index = 1; index <= numPages; index++) {\n var li = document.createElement('li');\n var a = document.createElement('a');\n\n appendAttribute(a, 'href', '?page='+blogTitle+'&p='+index+'#');\n\n /* set nav button name */\n if (index == reqPage) {\n a.innerHTML = \"<em><b>\"+index+\"</b></em>\";\n } else {\n a.innerHTML = index;\n }\n\n li.appendChild(a);\n self.pagination_ul.appendChild(li);\n }\n\n /* setup \"next page\" button */\n if (reqPage < numPages) {\n var li = document.createElement('li');\n var a = document.createElement('a');\n appendAttribute(a, 'href', '?page='+blogTitle+'&p='+(reqPage+1)+'#');\n a.innerHTML = \"&raquo;\";\n li.appendChild(a);\n self.pagination_ul.appendChild(li);\n }\n\n this.pagination_div.style.display = 'block';\n };\n\n /* The nav is a <ul> with items <li> and page links <a>. */\n this.genPostNavListTags = function() {\n\n /* get current post */\n var reqPost = self.conf.getURLParameter('post');\n var index = self.conf.blog_items.indexOf(reqPost);\n\n /* setup \"previous page\" button */\n if (index > 1) {\n var li = document.createElement('li');\n var a = document.createElement('a');\n appendAttribute(a, 'href', '?post='+self.conf.blog_items[index-1]);\n a.innerHTML = \"&laquo;\";\n li.appendChild(a);\n self.pagination_ul.appendChild(li);\n }\n\n /* setup \"next page\" button */\n if (index < (self.conf.blog_items.length-1)) {\n var li = document.createElement('li');\n var a = document.createElement('a');\n appendAttribute(a, 'href', '?post='+self.conf.blog_items[index+1]);\n a.innerHTML = \"&raquo;\";\n li.appendChild(a);\n self.pagination_ul.appendChild(li);\n }\n\n this.pagination_div.style.display = 'block';\n };\n\n}", "function buildNavigationBar(sections){\n const ul=document.querySelector(\"ul\");\n for(let section of sections){\n const li = document.createElement(\"li\");\n\n const id=section.getAttribute(\"id\");\n const title=section.getAttribute(\"data-nav\");\n \n li.textContent = title;\n li.classList.add(id);\n li.addEventListener('click', () => {\n document.getElementById(id).scrollIntoView({ behavior: \"smooth\" });\n });\n ul.appendChild(li);\n };\n // const f = ul.firstElementChild;\n // f.firstElementChild.classList.add(\"active\");\n}", "function paginationNav(pages) {\n for(var i = 0; i < pages; i++) {\n header.append('<a href=\"#\" data-page=\"'+i+'\" id=\"page-button\">'+(i+1)+'</a>'); // Adding one to offset the array but to keep math logic for Listener on pagination buttons\n if(i == (pageStart/pagerSize)) {\n $('#page-button').addClass('active');\n }\n }\n paginationButtons = $('#app a#page-button');\n header.prepend('<span><input type=\"checkbox\" id=\"checkbox\" checked />Paginate</span>');\n}", "function dynamicNavBuilder(){\n const navList = document.getElementById('navbar__list');\n const docFragment = document.createDocumentFragment();\n const sections = document.querySelectorAll('section');\n for(let i=0; i<sections.length; i++) {\n const listItem = document.createElement('li');\n const section = sections[i];\n listItem.textContent = section.querySelector('h2').textContent;\n listItem.classList.add('menu__link');\n listItem.setAttribute('name', section.id);\n navClick(listItem);\n docFragment.appendChild(listItem);\n }\n console.log(docFragment);\n navList.appendChild(docFragment);\n}", "function createNavbar() {\n for (let element of sections) {\n let createElement = document.createElement(\"li\")\n let sectionName = element.getAttribute(\"data-nav\");\n let sectionId = element.getAttribute(\"id\");\n createElement.innerHTML = `<a href=\"#${sectionId}\" class=\"menu__link\">${sectionName}</a>`;\n navbarList.appendChild(createElement);\n }\n}", "function setupNavBar(){\n\t// Get the container element\n\tvar btnContainer = document.getElementById(\"navbar\");\n\n\t// Get all buttons with class=\"btn\" inside the container\n\tvar btns = btnContainer.getElementsByClassName(\"btn\");\n\n\t// Loop through the buttons and add the active class to the current/clicked button\n\tfor (var i = 0; i < btns.length; i++) {\n\t btns[i].addEventListener(\"click\", function() {\n\t \t//console.log('clicked: ' + this);\n\t \t//console.dir(this);\n\t var current = document.getElementsByClassName(\"active\");\n\t current[0].className = current[0].className.replace(\" active\", \"\");\n\t this.className += \" active\";\n\n\t //switch pages!\n\t //find the swipe section based on which button index this is:\n\t var btn_list = document.getElementById(\"navbar\").getElementsByClassName(\"btn\");\n\t var btn_idx = -1;\n\t for(var j = 0; j<btn_list.length; j++){\n\t \tif(btn_list[j] == this){\n\t \t\tbtn_idx = j;\n\t \t}\n\t }\n\n\t if(btn_idx>-1){\n\t\t\t//need to make sure that the number of buttons equals the number of swipe sections...\n\t \tcurrent_swipe_section = btn_idx;\n\t \tvar step_list = document.getElementsByClassName(\"step\");\n\t\t\tfor(var i = 0; i<step_list.length; i++){\n\t\t\t\tif(i==current_swipe_section){\n\t\t\t\t\tstep_list[i].style.display=\"block\";\n\t\t\t\t\tstep_list[i].style.zIndex=100;\n\t\t\t\t}else{\n\t\t\t\t\tstep_list[i].style.display=\"none\";\n\t\t\t\t\tstep_list[i].style.zIndex=0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconsole.log('set current swipe section to: ' + current_swipe_section);\n\t\t\twindow.location.href = \"#IntroductionAnchor\";\n\n\t \tloadSection(current_swipe_section);\t \t\n\t }else{\n\t \tconsole.log('could not find btn idx for button: ');\n\t \tconsole.dir(this);\n\t }\n\n\t });\n\t}\t\t\t\n}", "function buildNav(menueEntries){\n\n for (let menueEntry of menueEntries) {\n const ul = document.getElementById(\"navbar__list\");\n const navListElement = document.createElement('li');\n const navElement = document.createElement('a');\n navListElement.appendChild(navElement);\n \n navElement.textContent = menueEntry;\n navElement.href = '#';\n \n ul.appendChild(navListElement);\n }\n}", "function slidingmenu(item){\r\n subnav = document.getElementById('subnav');\r\n switch(item){\r\n\t default:\r\n\t subnav.innerHTML = '';\r\n\t break;\r\n\t \r\n\t case 'mydouban':\r\n\t subnav.innerHTML = '<a href=\"/mine/notes\">日记</a> <a href=\"/mine/photos\">相册</a> <a href=\"/mine/discussions\">评论和讨论</a> <a href=\"/mine/recs\">推荐</a> <a href=\"/mine/miniblogs\">广播</a> <a href=\"/mine/exchange\">二手</a> <a href=\"/mine/board\">留言板</a> ';\r\n\t break;\r\n\t \r\n\t case 'neighbor':\r\n\t subnav.innerHTML ='<a href=\"/contacts/listfriends\">我的朋友</a> <a href=\"/contacts/list\">我关注的人</a> <a href=\"/contacts/find\">找朋友</a> ';\r\n\t break;\r\n\t \r\n\t case 'groups':\r\n\t subnav.innerHTML ='<a href=\"/group/mine\">我的小组</a> <a href=\"/group/my_topics\">我的发言</a> <a href=\"/group/discover\">更多小组</a> ';\r\n\t break;\r\n\t \r\n\t case 'books':\r\n\t subnav.innerHTML ='<a href=\"/book/mine\">我读</a> <a href=\"/book/recommended\">豆瓣猜</a> <a href=\"/book/review/best/\">热评</a> <a href=\"/book/chart\">排行榜</a> <a href=\"/book/browse\">分类浏览</a> ';\r\n\t break;\r\n\t \r\n\t case 'movies':\r\n\t subnav.innerHTML ='<a href=\"/movie/mine\">我看</a> <a href=\"/movie/recommended\">豆瓣猜</a> <a href=\"/movie/review/best/\">热评</a> <a href=\"/movie/chart\">排行榜</a> <a href=\"/movie/browse\">分类浏览</a> <a href=\"/movie/tv\">电视剧</a> ';\r\n\t break;\r\n\t \r\n\t case 'music':\r\n\t subnav.innerHTML ='<a href=\"/music/mine\">我听</a> <a href=\"/music/recommended\">豆瓣猜</a> <a href=\"/music/review/best/\">热评</a> <a href=\"/music/chart\">排行榜</a> <a href=\"/music/browse\">分类浏览</a> ';\r\n\t break;\r\n\t \r\n\t case 'citys':\r\n\t subnav.innerHTML ='<a href=\"/event/mine\">我的活动</a> <a href=\"/event/\">我的城市</a> <a href=\"/event/friends\">友邻的活动</a> <a href=\"/location/world/\">浏览其他城市</a> ';\r\n\t break;\r\n\t}\r\n}", "_addNav() {\n // add nav for any anchored headings at the top of the page\n let nav = [];\n let topLinks = this._top.match(/#[^{}\\#\\r\\n]+\\s+\\{#[^\\}]+}$/m);\n if (topLinks) {\n nav.push(\"\\n #### About\");\n for (let ref of topLinks) {\n let [name, link] = ref.split(\"{#\");\n name = name.replace(/^#+/, \"\").trim();\n link = link.slice(0, -1);\n nav.push(` * [${name}](#${link})`);\n }\n }\n // add nav for all other entries\n let declHeader = false, inheritHeader = false, nsHeader = false;\n for (let c of this.doc.content) {\n // skip non-root namespace nodes\n if (c.id === this.doc.id + \".\" && declHeader)\n continue;\n // add subheadings\n if (!inheritHeader && c.spec.inherited) {\n nav.push(\"\\n #### Inherited\");\n inheritHeader = true;\n }\n else if (!declHeader && !c.spec.namespaced) {\n nav.push(\"\\n #### Declarations\");\n declHeader = true;\n }\n else if (!nsHeader && c.spec.namespaced) {\n nav.push(\"\\n #### Namespaced\");\n nsHeader = true;\n }\n // add nav entry for this node\n let name = this._getTypedName(c.spec).replace(/_/g, \"\\\\_\");\n if (c.spec.type === DeclarationFileParser_1.SpecNodeType.ClassDeclaration ||\n c.spec.type === DeclarationFileParser_1.SpecNodeType.InterfaceDeclaration ||\n c.spec.type === DeclarationFileParser_1.SpecNodeType.Namespace)\n name = \"**\" + name + \"**\";\n nav.push(` * [${name}](${navId(c.id)})`);\n }\n this.data.nav = nav.join(\"\\n\");\n }", "function paginationMaker(){\n var pagesArray =[];\n for (i=0; i<myPages.length; i++){\n pagesArray.push('<li class=\"pageItem\" onclick=\"classes();renderHtml(myPages['+i+']) \"><a>'+i+'</a></li>');\n }\n pagination = pagesArray;\n $('#pages').html(pagination);\n $('.pageItem').first().addClass('active');\n}", "static leftNav(to) {\n console.log(\"left nav to: \" + to)\n $.get(to, function (pageContent) {\n $('#left').html(pageContent);\n console.log(pageContent)\n }).fail(HTMLHandler.failedGet)\n }", "function Nav() {\n return (\n\n <nav id=\"nav\" role=\"navigation\">\n <a href=\"#nav\" title=\"Show navigation\">Show navigation</a>\n <a href=\"#\" title=\"Hide navigation\">Hide navigation</a>\n\n <ul>\n <li>\n <Link to=\"/\">Home</Link>\n </li>\n <li>\n <a href=\"/\" aria-haspopup=\"true\"><span>Pages</span></a>\n <ul>\n <li><Link to=\"/overfishing\">Over Fishing</Link></li>\n <li><Link to=\"/pollution\">Pollution</Link></li>\n <li><Link to=\"/redtide\">Red Tide</Link></li>\n <li><Link to=\"/messageboard\">Message Board</Link></li>\n <li><Link to =\"/interactivegame\">Interactive Game</Link></li>\n \n </ul>\n </li>\n\n <li>\n <Link to=\"/flashCard\">Quiz</Link>\n </li>\n <li><Link to=\"/login\">Log In</Link></li>\n </ul>\n\n </nav>\n \n );\n\n}", "function setupNav() {\n\tvar challenges = game.getChallenges();\n\tvar frag = document.createDocumentFragment();\n\tvar challengeNav = document.createElement('nav');\n\tchallengeNav.className = 'nav nav-challenges';\n\tchallenges.forEach(setupChallenge.bind(null, challengeNav));\n\tfrag.appendChild(challengeNav);\n\tgameElement.appendChild(frag);\n}" ]
[ "0.73581475", "0.72801596", "0.7272414", "0.7094888", "0.6995981", "0.696279", "0.6958643", "0.68614644", "0.68601054", "0.6859685", "0.68502456", "0.68382764", "0.6832683", "0.680222", "0.6784236", "0.67698014", "0.6765353", "0.6743272", "0.6723414", "0.67173", "0.6703209", "0.6700677", "0.6639816", "0.662799", "0.6624102", "0.6620911", "0.6606335", "0.6602015", "0.65974134", "0.656186", "0.6560063", "0.6542928", "0.6535676", "0.6532322", "0.6531371", "0.65253574", "0.652451", "0.6514565", "0.650869", "0.6508194", "0.6503834", "0.650184", "0.6499919", "0.64818674", "0.645834", "0.64322627", "0.6431604", "0.642668", "0.64230096", "0.63945335", "0.63942456", "0.6392663", "0.6392517", "0.63821393", "0.6364441", "0.6363313", "0.6356758", "0.6354585", "0.63486636", "0.6341597", "0.63350546", "0.6330146", "0.63250643", "0.6320859", "0.63193434", "0.63192177", "0.63039935", "0.62951905", "0.62898237", "0.628838", "0.62830824", "0.62755615", "0.6271036", "0.6255392", "0.6251052", "0.62447006", "0.62348604", "0.6233591", "0.62304974", "0.6226103", "0.6220979", "0.6220791", "0.6218102", "0.62115395", "0.6205335", "0.6202878", "0.61942166", "0.6191462", "0.6189766", "0.6189417", "0.6183886", "0.6175547", "0.6172524", "0.6168171", "0.616349", "0.6161705", "0.61573213", "0.6145711", "0.61447906", "0.61441714", "0.6141415" ]
0.0
-1
Create Promise for SQLite3 database SELECT query
function databaseSelect(query, params) { return new Promise((resolve, reject) => { db.all(query, params, (err, rows) => { if (err) { reject(err); } else { resolve(rows); } }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUserByRowId(id) {\n return new Promise( function (resolve,reject) {\n let db = new sqlite3.Database(file);\n\n let sql = \n `SELECT * FROM user \n WHERE id=\"${id}\"\n LIMIT 1`;\n\n db.all(sql,function(err,rows) {\n if (err) {\n reject(err);\n } else {\n resolve(rows.length > 0 ? rows[0] : null);\n }\n });\n\n db.close();\n });\n\n }", "static fetchAll(db) {\n \n return new Promise(function (resolve, reject) {\n db.query(\"SELECT * FROM persons\", function (err, rows) {\n if (!err) {\n resolve(rows);\n } else {\n reject(err);\n }\n });\n });\n\n }", "function sqlPromiseWrapper(sql) {\n return new Promise((resolve, reject) => {\n database.query(sql, function (err, result) {\n if (err) {\n reject(err);\n } else {\n resolve(result);\n }\n });\n });\n}", "function queryProductsTable(){\n\n var asyncTableQuery = new Promise(function(resolve,reject){\n // do a thing possibly async, then... \n connection.query('SELECT * FROM products',function(error,results){\n if(error){\n console.log(error);\n reject(Error(\"it broke\"));\n }\n //console.log('query worked');\n resolve(resultsToTable(results));\n });\n });\n return asyncTableQuery;\n}", "initDatabase() {\n\n return new Promise( function (resolve,reject) {\n\n var exists = fs.existsSync(file);\n var db = new sqlite3.Database(file);\n\n if (exists) {\n return process.nextTick(_ => resolve());\n } else {\n console.log(\"Creating DB file.\");\n fs.openSync(file, \"w\");\n }\n\n db.serialize(function() {\n\n let createTableSql = \n `create table user(\n id INTEGER PRIMARY KEY,\n user_id TEXT,\n password TEXT,\n first_name TEXT,\n last_name TEXT,\n gender TEXT,\n age INTEGER,\n religion TEXT,\n avatar_image TEXT,\n min_preferred_age INTEGER,\n max_preferred_age INTEGER,\n preferred_religion TEXT,\n preferred_gender TEXT\n )`;\n\n db.run(createTableSql); \n \n let insertRowSql = \n `INSERT INTO user \n VALUES(\n ?,?,?,?,?,?,\n ?,?,?,?,?,?,?\n )`;\n\n var stmt = db.prepare(insertRowSql); \n \n let users = generateRandomUsers();\n\n users.forEach((user) => {\n stmt.run(null,\n user.userId,\n user.password,\n user.firstName,\n user.lastName,\n user.gender,\n user.age,\n user.religion,\n user.avatarImage,\n user.minPreferredAge,\n user.maxPreferredAge,\n user.preferredReligion,\n user.preferredGender\n );\n });\n stmt.finalize();\n\n //\n // Debug, dump the newly created fake users.\n //\n db.each(\"SELECT * FROM user\", function(err, row) {\n console.log(row.id + \": \" + row.first_name + ' ' + row.last_name);\n });\n\n //\n // Hack. Only way I could think of (without wasting time) to be able to call \"resolve\" at the right time.\n //\n db.each(\"SELECT * from user LIMIT 1\", function(err, row) {\n resolve();\n });\n });\n\n db.close();\n }); \n }", "function querySQL(sql){\n return new Promise(function (resolve, reject){\n con.query(sql , (err,results) => {\n if(err) throw reject(err);\n resolve(results);\n });\n });\n}", "getAll() {\n\t\tlet db = this.db;\n\n\t\treturn new Promise((resolve, reject)=>{\n\t\t\tresolve(db.value());\n\t\t});\t\t\n\t}", "function dbquery(query) {\n return new Promise( (r, j) => connection.query(query, null , (err, data) => {\n\t\tif (err) {\n\t\t\tlog.error(query);\n\t\t\treturn j(err);\n\t\t}\n\t\tr(data);\n\t}))\n}", "function promisedQuery(sql) { \n return new Promise ((resolve, reject) => {\n console.log('query: ', sql);\n connection.query(sql, function(err, rows) {\n if ( err ) {\n return reject( err );\n }\n resolve( rows );\n })\n });\n }", "function exec(sql){\n const promise = new Promise((resolve,reject)=>{\n con.query(sql, (err,result)=>{\n \tif (err) {\n \t\treject(err)\n \t\treturn \n \t}\n \tresolve(result)\n })\n })\n return promise;\n}", "function queryInfo(sql, user){\n return new Promise((resolve, reject)=>{\n var results=[];\n var queryString=sql;\n var queryData=[user];\n\n db.query(queryString, queryData, function(res){\n for (var i in res){\n results.push(res[i]);\n };\n\n resolve(results);\n } );\n });\n\n}", "execute(query){\n return new Promise((resolve, reject) => {\n this.conn.query(query, (err, results, fields) => {\n if (err) reject(err);\n else resolve(results);\n })\n })\n }", "function querySQL(sql) {\r\n return new Promise(function (resolve, reject) {\r\n con.query(sql, (err, result) => {\r\n if (err) throw reject(err);\r\n resolve(result);\r\n })\r\n })\r\n}", "getMatches(loggedInUserId, gender, religion, minAge, maxAge) {\n\n\n return new Promise( function (resolve,reject) {\n let db = new sqlite3.Database(file);\n\n let sql = \n `SELECT * FROM user \n WHERE gender=\"${gender}\"\n AND religion=\"${religion}\"\n AND age >= ${minAge}\n AND age <= ${maxAge}\n AND id != ${loggedInUserId}\n LIMIT 10`;\n\n db.all(sql,function(err,rows) {\n if (err) {\n reject(err);\n } else {\n resolve(rows);\n }\n });\n\n db.close();\n });\n }", "function promiseQuery(zapytanie) {\n return new Promise(function (resolve, reject) {\n\n con.query(zapytanie, (err, rows) => {\n if (err) reject(err)\n resolve(rows)\n\n\n });\n })\n}", "function execute(sql) {\n return new Promise((resolve, reject) => {\n connection.query(sql, (err, result) => {\n if (err) {\n // console.log(\"Error \" + err);\n reject(err);\n return;\n }\n resolve(result);\n });\n });\n}", "function getAll() {\n return connSql.then(function(conn){\n let resultat = conn.query(\"SELECT * FROM chambre\");\n return resultat\n });\n}", "async function getContactos(){\n try {\n const resultset = await db.query('SELECT * FROM contactos');\n console.log(resultset)\n return resultset;\n } catch (error) {\n console.log(error);\n }\n}", "function makeOpenSqlite3(pathName){\n return async function(prevResult){\n let objDB = await openSqlite3(pathName);\n return Promise.resolve(objDB);\n }\n}", "function makeOpenSqlite3(pathName){\n return async function(prevResult){\n let objDB = await openSqlite3(pathName);\n return Promise.resolve(objDB);\n }\n}", "async function selectfromtable() {\n const client = new Client ({\n host: \"localhost\",\n user: \"postgres\",\n port: \"5432\",\n password: \"arielle\",\n database: \"postgres\"\n });\n await client.connect();\n try {\n const res = await client.query(`Select * from buns`);\n const myrows = res.rows;\n \n await client.end();\n return myrows\n } catch(err) {\n console.log(err.message);\n }\n}", "getUser(userId) {\n return new Promise( function (resolve,reject) {\n let db = new sqlite3.Database(file);\n\n let sql = \n `SELECT * FROM user \n WHERE user_id=\"${userId}\"\n LIMIT 1`;\n\n db.all(sql,function(err,rows) {\n if (err) {\n reject(err);\n } else {\n resolve(rows.length > 0 ? rows[0] : null);\n }\n });\n\n db.close();\n });\n }", "function promisedQuery(sql) {\r\n console.log('query: ', sql);\r\n return new Promise((resolve, reject) => {\r\n connection.query(sql, function (err, rows) {\r\n if (err) {\r\n console.log('error: ', err);\r\n return reject(err);\r\n }\r\n console.log('success');\r\n resolve(rows);\r\n })\r\n });\r\n }", "async function selectAllData() {\n let sql = 'SELECT sn,label FROM enterprise_info';\n console.log(sql);\n let dataList = await query(sql);\n return dataList;\n}", "executeQuery(query){\n\t\treturn new Promise((resolve, reject)=>{\n\t\t\tthis.db_connection.query(query, err=>{\n\t\t\t\tif (err){\n\t\t\t\t\treject(err);\n\t\t\t\t}else{\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "async function createTable() {\n let res = await query(sqlStatement);\n console.log(res);\n}", "async function getAll(){\n try{\n return allTasks = await db.any(`\n SELECT * FROM todos;\n `) \n }\n catch(error){\n console.log('uh ohfda');\n console.log(error);\n return []\n }\n}", "function execute(sql) {\n return new Promise((resolve, reject) => {\n connection.query(sql, (err, result) => {\n if (err) {\n reject(err);\n return;\n }\n resolve(result);\n });\n });\n}", "static getAll(){\n // Retourne promise\n return new Promise((resolve, reject) => {\n // Requete Select \n db.query(\"SELECT * FROM salles\", (err, rows) => {\n if(err) {\n reject(err);\n } else {\n resolve(rows);\n }\n });\n })\n }", "async function query_db(sql) {\n // avoid making unneccesary queries.\n if(sql.length == 0) return true;\n var result = await new Promise((res,rej) => {\n connection.query(sql, function(err, result) {\n if (err) res(null);\n res(result);\n });\n });\n return result;\n}", "createNewUser(user) {\n\n console.log('CREATE USER WITH USER: ' + user);\n\n return new Promise( function (resolve,reject) {\n\n var db = new sqlite3.Database(file);\n\n db.serialize(function() {\n \n let insertRowSql = \n `INSERT INTO user \n VALUES(\n ?,?,?,?,?,?,\n ?,?,?,?,?,?,?\n )`;\n\n var stmt = db.prepare(insertRowSql); \n \n let users = generateRandomUsers();\n \n stmt.run(null,\n user.userId,\n user.password,\n user.firstName,\n user.lastName,\n user.gender,\n user.age,\n user.religion,\n user.avatarImage,\n user.minPreferredAge,\n user.maxPreferredAge,\n user.preferredReligion,\n user.preferredGender\n );\n \n stmt.finalize();\n\n let sql = \n `SELECT * FROM user \n WHERE user_id=\"${user.userId}\"\n LIMIT 1`;\n\n db.all(sql,function(err,rows) {\n if (err) {\n reject(err);\n } else {\n resolve(rows.length > 0 ? rows[0] : null);\n }\n });\n\n\n });\n\n db.close();\n }); \n }", "query(sql) {\n return new Promise((resolve, reject) => {\n this.connection.query(sql, (err, rows) => { //when results come back...\n if (err) return reject(err); // throw all errors\n resolve(rows); // resolve original promise with rows\n });\n })\n .catch(err => {\n console.log(`\\x1b[41m\\t[DB] Couldn't perform operation: ${err.sql}\\x1b[40m \\n\\t[DB] ${err.sqlMessage}`);\n throw err;\n });\n }", "function queryDB(query) {\n let connection = makeConnection();\n return new Promise((resolve, reject) => {\n connection.query(query, function(err, res) {\n if (err) throw err;\n connection.end();\n resolve(res);\n });\n });\n}", "async function simpleQuery(query, values = [], db){\n\n const client = await db.connect();\n let res;\n\n try { \n res = await client.query(query, values);\n\n } catch (err) {\n throw err;\n\n } finally {\n client.release();\n }\n \n return res;\n}", "async function callDB(client, queryMessage) {\n\n var queryResult;\n await client.query(queryMessage)\n .then(\n (results) => {\n queryResult = results[0];\n //console.log(results[0]);\n return queryResult;\n })\n .then(\n (results) => {\n res = JSON.parse(JSON.stringify(results));\n return results\n })\n .catch(console.log)\n}", "function getData() {\n var defered = q.defer();\n connection.query(sqlStatement, defered.makeNodeResolver());\n return defered.promise;\n }", "async function hitThatDB(query){\n const session = driver.session();\n var returnObject;\n return new Promise(resolve => {\n session.run(query)\n .then(result => {\n returnObject = result.records[0]._fields[0].properties;\n console.log(returnObject);\n })\n .catch(e => {\n console.log(e + \" WE MESSED UP!!!!\")\n })\n .then(() => {\n session.close();\n resolve(returnObject);\n })\n })\n}", "function sql2array(conn,key,value,table) {\n \n return new Promise(function(resolve, reject) { \n \n var query = \"SELECT * FROM \" + table + \" WHERE \" + key + \" = '\" + value + \"'\";\n //console.log(query);\n console.log('sql2array');\n conn.queryRowPromise(query)\n .then(function(rows) {\n //console.log('rows', rows);\n var resultRow = rows;\n if (!resultRow) {\n resultRow = null;\n }\n resolve(resultRow);\n },\n function(rows) {\n console.log(rows);\n })\n }); \n \n}", "function checkData(){\n var query3 = pool.query('select * from env_var;');\n query3\n .on('result', async function(row) {\n console.log(row)\n })\n}", "async function execSql(sql, params = [],action){\n console.log(\"start execSql....\\n\");\n\n try{\n let db = await connectToDB();\n db.loadExtension(\"./extension-functions\");//compiled extension for \n\n switch (action) {\n case 'select':\n return await select();\n case 'insert':\n return await insert();\n default:\n return false;\n }\n /*db.serialize(() => {\n // Queries scheduled here will be serialized.\n db.run(\n `CREATE TABLE IF NOT EXISTS sensors (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n device_id INTEGER,\n timestamp TEXT,\n latitude REAL,\n longitude REAL,\n value INTEGER\n )`);\n \n \n\n });*/\n\n async function select(){\n return new Promise(function(resolve, reject) {\n\n db.all(sql, params, (err,result) => {\n if (err) {\n console.error(err.message);\n reject(err.message);\n }\n resolve(result);\n\n }).close((err) => {\n if (err) {\n console.error(\"error\" , err.message);\n reject(err.message);\n }\n console.log('Close the database connection.');\n });\n \n }); \n }//end select\n\n async function insert(){\n return new Promise(function(resolve, reject) {\n\n db.run(sql, params, function(err){\n if (err){\n reject(err);\n throw err;\n }\n resolve(true);\n \n }).close((err) => {\n if (err) {\n console.error(\"error\" , err.message);\n }\n console.log('Close the database connection.');\n });\n\n }); \n }//end insert\n\n \n \n\n }catch(e){\n console.log(\"execSql Error\");\n throw e;\n }\n}", "function callsASyncFunction() {\n var deferred = Q.defer();\n db.ConnectAndQuery(\"select * from UserGroup\", function () {\n console.log('Finished with non deffered async.');\n });\n return deferred.promise;\n}", "function sqlquery(str, sqlObj) {\n //console.log(str);\n return new Promise((resolve, reject) => {\n db.query(str, sqlObj, (err, results) => {\n // console.log(results);\n if (err) reject(err);\n else resolve(results);\n }\n );\n });\n}", "async function getProductos() {\r\n //se realiza una consulta de todos los productos de la tabla\r\n try {\r\n let rows = await query(\"SELECT * from productos\");\r\n //rows : array de objetos\r\n return rows;\r\n } catch (error) {\r\n //bloque en caso de que exista un error\r\n console.log(error);\r\n }\r\n}", "query(query){\n return (onSuccess,onFail) => {\n this.connect(() => {\n new sql.Request().query(query)\n .then((recordset) => {\n onSuccess(recordset);\n sql.close()\n })\n .catch((error) => {\n console.error('I fucked up',error);\n //lol like that ever happens\n if(onFail){\n onFail()\n }\n sql.close();\n });\n });\n }\n }", "async function networkTest() {\n const rows = await database.execute(\"SELECT * FROM SensorData ORDER BY id ASC LIMIT 0, 10\");\n \n // return result list\n return rows[0];\n}", "function viewDepartments() { //async?\n console.log('~~~~~~~~~~ Company Departments ~~~~~~~~~~')\n const query = 'SELECT * FROM departments'\n // let [data, fields] = await db.query(query)\n // // console.table(results);\n // console.table(data);\n // console.log(db)\n db.promise().query(query)\n .then((results) => {\n console.table(results[0])\n })\n .catch('error egtting the rows')\n .then(() => {\n menu()\n })\n}", "async init() {\n var that = this;\n\n var promise = new Promise(function(resolve, reject) {\n\n var req = indexedDB.open(that.db_name, that.version);\n\n req.onupgradeneeded = function(event) {\n that.database = event.target.result;\n //run callback method in createTable to add a new object table\n that.upgrade();\n };\n\n req.onsuccess = function (event) {\n that.database = event.target.result;\n resolve();\n };\n\n req.onerror = function (error) {\n if (req.error.name === \"VersionError\") {\n //we can never be sure what version of the database the client is on\n //therefore in the event that we request an older version of the db than the client is on, we will need to update the js version request on runtime\n that.version++;\n\n //we need to initiate a steady increment of promise connections that either resolve or reject\n that.init()\n .then(function() {\n //bubble the result\n resolve();\n })\n .catch(function() {\n //bubble the result: DOESNT WORK?\n reject();\n });\n } else {\n console.error(error);\n }\n };\n });\n return promise;\n }", "function getQueryResult(connection, query) {\n return new Promise((resolve, reject) => {\n var result = [];\n\n request = new Request(query.query, function(err, rowCount) {\n if (err) {\n console.log(err);\n reject(err);\n } else {\n resolve(result);\n }\n connection.close();\n });\n\n query.params.forEach(function(param) {\n request.addParameter(param.paramName, param.paramType, param.paramValue);\n });\n\n request.on('row', function(columns) {\n var row = {}; \n columns.forEach(function(column) {\n row[column.metadata.colName] = column.value;\n });\n result.push(row);\n });\n\n connection.execSql(request);\n }); \n}", "function fcallsASyncFunction() {\n var deferred = Q.defer();\n Q.fcall(db.ConnectAndQuery, \"select * from UserGroup\", function () {\n console.log('Finished with non deffered async.');\n });\n return deferred.promise;\n}", "function getHrmsData(sunConn,hrmsConn,trans,userID){\ntry{\n \n let requestString='SELECT *'\n if(forceTransFlag==false){\n let d=new Date()\n requestString+=` FROM JV_Report_Details_Tbl WHERE The_Month=${ d.getMonth()} AND User_ID=${1};`\n }\n else{\n requestString+=` FROM JV_Report_Details_Tbl WHERE The_Month=${forcedMonth} AND User_ID=${1};`\n }\n //console.log(requestString)\n return new Promise((resolve,reject)=>{\n request = new Request(requestString,async (err,rowCount,rows)=> { \n if (err) { \n reject(err.message)\n console.log(err);\n }\n else{\n console.log(rowCount+' rows selected')\n const headerID=await insertIntoSunHeaders(sunConn)\n if(forceTransFlag==false){\n const detailsInsertion=await insertIntoSunDetails(sunConn,trans,rows,headerID,userID,d.getMonth())\n }\n else{\n const detailsInsertion=await insertIntoSunDetails(sunConn,trans,rows,headerID,userID,forcedMonth)\n }\n }\n }); \n request.on('requestCompleted', function() { \n resolve(1)\n }); \n hrmsConn.execSql(request); \n })\n}\ncatch(err){\n console.log(err.message)\n}\n}", "function db_call(query_str){\n return new Promise( (resolve, reject) => {\n // execute a sql query to show all users\n conn_pool.query(query_str, function (err, result) {\n // if query failed then reject promise otherwise resolve with the data\n if (err) {\n reject(\"query failed\");\n } else {\n resolve(result)\n }\n })\n })\n}", "function query(q) {\n return new Promise(function (resolve, reject) {\n if (!validateQuery(q))\n return reject(new MysqlSyntaxError(\"Invalid query syntax\" + q));\n\n db.query(q, function(error, data, fields) {\n \n if (error) {\n return reject(error);\n }\n\n console.log('@query OK');\n return resolve(data);\n });\n });\n}", "function getMatchById(id){\n return new Promise((resolve, reject) => {\n const sql = `BEGIN\n SELECT user1, user2, like_id\n FROM GK7.matches \n WHERE user1 = @id OR user2 = @id\n END`\n const request = new Request(sql, err => {\n if(err) {\n reject(err)\n console.log(err)\n }}) \n request.addParameter('id', TYPES.Int, id)\n let results = [];\n request.on('row', async function(columns) {\n let result = {};\n await columns.forEach(column => { \n result[column.metadata.colName] = column.value; \n });results.push(result); \n \n });request.on('doneProc', (rowCount) => {\n resolve(results) \n }); \n connection.execSql(request)\n})}", "loginCheck(username, password) {\n var connectionDB = this.connectDB()\n var loginProcess = connectionDB.then((connection) => {\n return new Promise ((resolve, reject) => {\n connection.query('SELECT id FROM' + dbTesterInfo +' WHERE ' +\n ' testerID = ? and passWord = ?', [username, password] ,function(err, results, fields) {\n if (results.length === 1) {\n resolve()\n } else {\n reject({err: {msg : 'Invalid password or username'}})\n }\n })\n connection.release()\n })\n\n }).catch((err) => {\n return Promise.reject(err)\n })\n\n return loginProcess\n }", "async function getDataFromDatabase() {\n const response = await fetch('/api');\n const data = await response.json();\n return new Promise((resolve, reject) => {\n if (data) {\n resolve(data);\n } else {\n reject(\"Er is iets misgegaan bij het ophalen van favorieten\");\n }\n })\n}", "retrieveGame() {\n const sql = {\n text: `SELECT * FROM rooms`,\n };\n return db.query(sql).then((dbResult) => dbResult.rows[0]);\n }", "async function dbOperation(query_string)\r\n{\r\n try {\r\n console.info(query_string);\r\n const result = await query(query_string);\r\n return result;\r\n } \r\n catch(err)\r\n {\r\n console.info(err);\r\n }\r\n}", "async function dbOperation(query_string)\r\n{\r\n try {\r\n console.info(query_string);\r\n const result = await query(query_string);\r\n return result;\r\n } \r\n catch(err)\r\n {\r\n console.info(err);\r\n }\r\n}", "function getTareasById(fk_usuario) {\n return new Promise((resolve, reject) => {\n db.query('SELECT * FROM s9q90jl9ash7sm2k.tareas WHERE fk_usuario=?',\n [fk_usuario],\n (error, result) => {\n if (error) { return reject(error) }\n else {\n resolve(result);\n console.log(result);\n }\n })\n })\n}", "async exec() {\n try {\n // generate queryString\n this.buildQuery();\n // eslint-disable-next-line prefer-destructuring\n const values = this.values;\n // eslint-disable-next-line prefer-destructuring\n const queryString = this.queryString;\n\n // send query to database\n const { rows, rowCount } = await this.DB.query(queryString, values);\n\n // end the transaction!\n this.end(); // This resets all properties in this class (except `this.relation`);\n\n // send a response\n return {\n queryString,\n values,\n rows,\n rowCount,\n };\n } catch (error) {\n console.log(error.stack, error.message);\n return `Unable to complete this transaction: ${error}`;\n }\n }", "async function openEmptySqlite3() {\n console.log(\"openEmptySqlite3:start\");\n // let objDB = await new sqlite3.Database(\":memory\");\n let objDB = await new sqlite3(\":memory:\");\n return Promise.resolve(objDB);\n}", "query(q, data) {\n\t\treturn new Promise((resolve,reject) => {\n\t\t\ttry {\n\t\t\t\tthis.db.query(q, data, (err, rows) => {\n\t\t\t\t\tif(err) reject(err);\n\t\t\t\t\telse resolve(rows);\n\t\t\t\t});\n\t\t\t} catch (err) {\n\t\t\t\treject(err);\n\t\t\t}\n\t\t});\n\t}", "function queryDB(tx) {\r\n tx.executeSql(\"SELECT * FROM DEMO\", [], querySuccess, errorCB);\r\n}", "static fetchRestaurants(callback){\r\n //console.log(\"You have reached IndexedDB\");\r\n dbPromise.then(db => {\r\n const tx = db.transaction('restaurants');\r\n const store = tx.objectStore('restaurants');\r\n //console.log(store);\r\n return store.getAll();\r\n })\r\n .then(restaurants => {\r\n if (restaurants.length !== 0) {\r\n Promise.resolve(restaurants);\r\n }\r\n return DBHelper.getRestaurantsFromIDB(callback);\r\n //callback(null, restaurants);\r\n })\r\n }", "function select(id) {\n return new Promise((resolve, reject) => {\n let sql = \"SELECT * FROM [user]\";\n if (id) {\n sql = sql + \" WHERE id = @id\"\n }\n console.log('sql', sql);\n const request = new Request(sql, (err, rowcount) => {\n if (err) {\n reject(err);\n console.log(err);\n } else if (rowcount == 0) {\n reject({ message: \"User does not exist\" });\n }\n });\n\n if (id) {\n request.addParameter(\"id\", TYPES.Int, id);\n }\n\n _rows = [];\n\n request.on(\"row\", (columns) => {\n const selectedUser = {};\n console.log('columns', columns.length);\n columns.map(({ value, metadata }) => {\n if (metadata.colName !== 'hashed_password') {\n selectedUser[metadata.colName] = value;\n }\n });\n _rows.push(selectedUser);\n });\n\n // We return the set of rows after the query is complete, instead of returing row by row\n request.on(\"doneInProc\", (rowCount, more, rows) => {\n resolve(_rows);\n });\n\n connection.execSql(request);\n });\n}", "async function getOne(id){ \n try{ \n const oneTask = await db.one(`\n SELECT * FROM todos\n WHERE id = $1 \n `,[id]) \n return oneTask\n }\n catch(error){\n console.log('uh oh');\n console.log(error);\n return{}\n }\n }", "function query_promise_then(result) {\n\n\n }", "function query_promise_then(result) {\n\n\n }", "function myAction(params) {\n\n return new Promise(function(resolve, reject) {\n console.log('Connecting to MySQL database');\n var mysql = require('promise-mysql');\n var connection;\n mysql.createConnection({\n host: params.MYSQL_HOSTNAME,\n user: params.MYSQL_USERNAME,\n password: params.MYSQL_PASSWORD,\n database: params.MYSQL_DATABASE\n }).then(function(conn) {\n connection = conn;\n console.log('Querying');\n/**\n * var queryText = 'SELECT * FROM cats WHERE id=?';\n * var result = connection.query(queryText, [params.id]);\n */\n var queryText = ' SELECT DISTINCT ' +\n ' APP.NAME AS app_name, ' +\n ' COMP.NAME AS comp_name, ' +\n ' COMP_ENV.ENVIROMENT_ID, ' +\n ' APP.LAST_UPDATED_BY AS app_last_updated_by, ' +\n ' COMP_ENV.LAST_UPDATED_DATE AS last_updated_date, ' +\n ' COMP.developmode AS developmode, ' +\n ' COMP.SUB_APP_TYPE AS subapp_type, ' +\n ' ENV.ENV_ALIAS AS env_alias, ' +\n/**\n\" decode (COMP_ENV.apply_type, \" +\n \" 'grey', \" +\n \" 'Grey', \" +\n \" 'dr', \" +\n \" 'Dr', \" +\n \" 'grey_dr', \" +\n \" 'Grey_Dr', \" +\n \" 'Normal') \" +\n \" AS apply_type, \" +\n*/\n ' APP.ID AS app_id, ' +\n ' PROT.NAME AS profile_name, ' +\n ' PROT.ID AS profileid, ' +\n/** \n \" TO_CHAR (COMP_ENV.CREATED_DATE, 'yyyy-MM-dd HH24:mi:ss') \" +\n*/\n \" date_format (COMP_ENV.CREATED_DATE, '%Y-%m-%d') \" +\n ' AS apply_created_date, ' +\n\n\n ' COMP_ENV.ID AS comp_id, ' +\n ' VM.HOSTNAME AS hostname, ' +\n ' VM.BUSINESSIP AS businessip, ' +\n ' COMP_ENV.RSC_TYPE AS rsc_type, ' +\n ' COMP.CONTEXT AS context ' +\n/** ' CASE lower ( ' +\n ' xmlcast ( ' +\n ' xmlquery (\\'$xml/profile/product/text()\\' ' +\n ' PASSING prot.property AS \\'xml\\') AS VARCHAR (2000))) ' +\n ' WHEN \\'tomcat\\' ' +\n ' THEN ' +\n ' xmlcast ( ' +\n ' xmlquery (\\'$xml/profile/defaultPort/text()\\' ' +\n ' PASSING prot.property AS \\'xml\\') AS VARCHAR (2000)) ' +\n ' WHEN \\'was\\' ' +\n ' THEN ' +\n ' xmlcast ( ' +\n ' xmlquery (\\'$xml/profile/wasDefaultPort/text()\\' ' +\n ' PASSING prot.property AS \\'xml\\') AS VARCHAR (2000)) ' +\n ' ELSE ' +\n ' prot.ports ' +\n ' END ' +\n ' AS ports ' +\n*/\n ' FROM COMP_ENVIROMENT_T COMP_ENV ' +\n ' INNER JOIN APPLICATION_T APP ON APP.ID = COMP_ENV.APPLICATION_ID ' +\n ' INNER JOIN COMPONENT_T COMP ON COMP.ID = COMP_ENV.COMPONENT_ID ' +\n ' INNER JOIN ENVIROMENT_T ENV ON ENV.ID = COMP_ENV.ENVIROMENT_ID ' +\n ' LEFT JOIN COMPONENT_PROFILE_T COMP_PROFILE ' +\n ' ON COMP_ENV.ID = COMP_PROFILE.COMP_ENVIROMENT_ID ' +\n ' LEFT JOIN PROFILE_T PROT ON PROT.ID = COMP_PROFILE.PROFILE_ID ' +\n ' LEFT JOIN VIRTUAL_MACHINE_T VM ON VM.ID = PROT.VM_ID ' +\n' ORDER BY APP.NAME, ' +\n ' COMP.NAME, ' +\n ' ENV.ENV_ALIAS, ' +\n ' VM.HOSTNAME ' +\n' limit 10 '\n;\n/**\nqueryText = 'select * from COMP_ENVIROMENT_T limit 10';\n*/ \n var result = connection.query(queryText);\n connection.end(); \n return result;\n }).then(function(result) {\n console.log(result);\n if (result) {\n resolve({\n statusCode: 200,\n headers: {\n 'Content-Type': 'application/json'\n },\n body: result\n });\n } else {\n reject({\n headers: {\n 'Content-Type': 'application/json'\n },\n statusCode: 404,\n body: {\n error: \"Not found.\"\n }\n });\n }\n }).catch(function(error) {\n if (connection && connection.end) connection.end();\n console.log(error);\n reject({\n headers: {\n 'Content-Type': 'application/json'\n },\n statusCode: 500,\n body: {\n error: \"Error.\"\n }\n });\n });\n });\n\n}", "async function get_booking(content) {\r\n var sql = 'SELECT * FROM `deliveries` WHERE `delivery_id` =' + content; \r\n\r\n let promise1 = new Promise((res, rej) => {\r\n\r\n pool.query(sql, function (err, result, fields) {\r\n\r\n if (err){ console.log(err); res(\"500\")}; \r\n \r\n // making sure the result isn't an empty response\r\n console.log({result});\r\n console.log({sql});\r\n if (result[0] != undefined) {\r\n res({result});\r\n } else {\r\n res(\"NO_ITEM_FOUND\");\r\n }\r\n //testing: console.log(pool.affectedrows);\r\n });\r\n\r\n\r\n });\r\n\r\n // wait until the promise returns a value\r\n return await promise1;\r\n \r\n}", "function sqlQuery(strSql, arr) {\n return new Promise(function (resolve, reject) {\n db.query(strSql, arr, (err, results) => {\n if (err) {\n reject(err)\n }\n else {\n resolve(results)\n }\n })\n //db.release()\n })\n}", "async function openEmptySqlite3() {\n debug(\"openEmptySqlite3:start\");\n // let objDB = await new sqlite3.Database(\":memory\");\n let objDB = await new sqlite3(\":memory:\");\n return Promise.resolve(objDB);\n}", "function execSQL(sql,params=[]) {\n\n return new Promise(function (resolve, reject) {\n pool.query(sql, params, function (err, results, fields) {\n if (!err) {\n resolve(results)\n } else {\n reject(err.message)\n }\n })\n });\n\n}", "getState() {\n\t\tlet db = this.db;\n\n\t\treturn new Promise((resolve, reject)=>{\n\t\t\tresolve(db.value());\n\t\t});\n\t}", "getState() {\n\t\tlet db = this.db;\n\n\t\treturn new Promise((resolve, reject)=>{\n\t\t\tresolve(db.value());\n\t\t});\n\t}", "function executeStatement() {\n request = new Request(\"SELECT * FROM test2;\", function (err) {\n if (err) {\n console.log(err);\n }\n });\n var result = \"\";\n request.on('row', function (columns) {\n columns.forEach(function (column) {\n if (column.value === null) {\n console.log('NULL');\n } else {\n result += column.value + \" \";\n }\n });\n console.log(result);\n result = \"\";\n });\n\n request.on('done', function (rowCount, more) {\n console.log(rowCount + ' rows returned');\n });\n connection.execSql(request);\n}", "function query(sql) {\n return new Promise((resolve, reject) => {\n pool.getConnection((err, connection) => {\n if (err) reject(err); // not connected!\n connection.query(sql, (error, results) => {\n connection.release();\n if (error) reject(error);\n resolve(results);\n });\n });\n });\n}", "function checkUsername(username){\n let sql = \"SELECT * FROM admin WHERE username = ?\";\n return new Promise(function(resolve, reject){\n pool.query(sql,[username], function(err, rows,fields){\n if(err) throw err;\n //console.log(\"Rows found: \" + rows.length);\n resolve(rows);\n });//query\n });//promise\n }", "function execute_query_with_ID(query){\n return new Promise(function(resolve, reject) {\n\n pool.getConnection( function(err,connection) {\n if(err)\n reject(err);\n else{\n connection.query(query, function (err,result) {\n if (err) {\n return reject(err);\n }\n resolve(result);\n });\n connection.release();\n \n }\n \n });\n \n });\n}", "db2data() {\n\t\treturn new Promise((resolve, reject) => {\n\n\t\t\tthis.db.transaction('r', this.db.tables, async () => {\n\t\t\t\tlet tables = this.db.tables\n\t\t\t\tlet accumulator = []\n\t\t\t\tfor (var i = tables.length - 1; i >= 0; i--) {\n\t\t\t\t\t// Filter all tables starting with _\n\t\t\t\t\tif (tables[i].name.startsWith('_')) {continue}\n\t\t\t\t\t// convert table into array\n\t\t\t\t\tconst rows = await tables[i].toArray()\n\t\t\t\t\taccumulator.push({table: tables[i].name, rows: rows})\n\t\t\t\t}\n\t\t\t\treturn Promise.all(accumulator)\n\n\t\t\t}).then(result => {\n\t\t\t\tfor (var i = result.length - 1; i >= 0; i--) {\n\t\t\t\t\tthis.data[result[i].table] = result[i].rows\n\t\t\t\t}\n\t\t\t\tresolve()\n\t\t\t}).catch(e => reject(e))\n\n\n\t\t})\n\t}", "executeQuery(query) {\n return new Promise((resolve, reject) => {\n pool.getConnection((err, connection) => {\n if (err) {\n reject(err);\n }\n\n // execute query\n try {\n connection.query(query, function (err, result) {\n connection.release();\n if (err) reject(err);\n else resolve(result);\n });\n } catch (err) {\n console.log(\"mysqlApi executeQuery error: \", err);\n }\n });\n });\n }", "function queryAsync(statement, parameters, success) {\n /*sqrObject have the information about the result of query*/\n let sqrObject = new Object();\n sqrObject.data = new Array();\n sqrObject.cols = 0;\n sqrObject.rows = 0;\n\n let query = connection.createStatement(statement);\n for(var p in parameters){\n \tquery.params[p] = parameters[p];\n }\n query.executeAsync({\n handleResult: function(resultSet) {\n for(var row=resultSet.getNextRow(); row; row=resultSet.getNextRow()) {\n sqrObject.cols = row.numEntries;\n let dataRow = new Array(sqrObject.cols);\n for(var i=0; i < sqrObject.cols; i++) {\n dataRow[i] = row.getResultByIndex(i);\n }\n sqrObject.data[sqrObject.rows] = dataRow;\n sqrObject.rows++;\n }\n },\n handleError: function(error) {\n success(null, error);\n },\n handleCompletion: function(reason) {\n success(sqrObject, reason);\n }\n });\n}", "async getAll(){\n return await conn.query(\"SELECT * FROM Fitness_RoutineExercises\")\n }", "async get_message(msgid) { \n var return_value = false;\n return new Promise((resolve, reject) => {\n this.db().get(\"SELECT * FROM messages WHERE msgid = ?\", [msgid], (error, row) => {\n if(!error) {\n resolve(row);\n } else {\n // Provide feedback for the error\n console.log(error);\n resolve(false);\n }\n });\n }); \n }", "async function initializeDatabase() {\n return new Promise((resolve, reject) => {\n let database = new sqlite3.Database(\"data.sqlite\");\n database.serialize(() => {\n database.run(\"create table if not exists [data] ([council_reference] text primary key, [address] text, [description] text, [info_url] text, [comment_url] text, [date_scraped] text, [date_received] text)\");\n resolve(database);\n });\n });\n}", "async function createTable() {\n const queryText = `CREATE TABLE IF NOT EXISTS\n candidates(\n id UUID PRIMARY KEY,\n name VARCHAR(128) NOT NULL,\n age INTEGER NOT NULL,\n gender VARCHAR(32) NOT NULL,\n qualification VARCHAR(128) NOT NULL,\n city VARCHAR(64) NOT NULL,\n skills VARCHAR(128) NOT NULL,\n created_date TIMESTAMP,\n modified_date TIMESTAMP\n )`;\n \n await pool.query(queryText)\n .then((res) => {\n console.log(res); \n console.log(\"In creatTable, query to create table is done.\");\n return res;\n })\n .catch((err) => {\n console.log(err);\n console.log(\"In createTable, error encountered creating table with query\");\n return err;\n });\n }", "function query_promise_then(result) {\n }", "function query_promise_then(result) {\n }", "function _select(sql, args, resultHandle){\r\n\tmyjdbc.exequery(sql, args, function(err, result){\r\n\t\tif(err){\r\n\t\t\tconsole.log(err.toString().red);\r\n\t\t\tresultHandle(null);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tresultHandle(result);\r\n\t});\r\n}", "async function initializeDatabase() {\n return new Promise((resolve, reject) => {\n let database = new sqlite3.Database(\"data.sqlite\");\n database.serialize(() => {\n database.run(\"create table if not exists [data] ([council_reference] text primary key, [address] text, [description] text, [info_url] text, [comment_url] text, [date_scraped] text, [date_received] text, [legal_description] text)\");\n resolve(database);\n });\n });\n}", "async function excuteSelectTotal() {\n try {\n const rows = await query('SELECT * FROM products');\n return rows;\n } catch (error) {\n console.log(error)\n }\n}", "function promisifyDBCall (obj) {\n return Q.Promise(function (resolve, reject) {\n obj.exec(function (error, result) {\n if (error) {\n return reject(error)\n } else {\n return resolve(result)\n }\n })\n })\n}", "function createSelectQuery(item){\n return response = `connection.query(\"SELECT * FROM ${item}\", function(error, results, fields) {\n if (error) throw error;\n console.log(\"The solution is: \", results);\n res.json(results);\n });`\n}", "function dbAll(sql, args) {\n return new Promise(function(resolve, reject) {\n this.all(sql, args, function(err, res) {\n if(err) reject(err) \n else resolve(res)\n })\n }.bind(this))\n}", "getLevelDBData(key) {\n let self = this; // because we are returning a promise we will need this to be able to reference 'this' inside the Promise constructor\n return new Promise(function(resolve, reject) {\n self.db.get(key, (err, value) => {\n if (err) {\n reject(500);\n } else {\n resolve(value);\n }\n });\n });\n }", "async function allPets() {\n try {\n const thePets = await db.any(`select * from pets;`);\n console.log(thePets);\n return thePets;\n } catch (err) {\n console.log(err)\n return [];\n }\n}", "async function initializeDatabase() {\n return new Promise((resolve, reject) => {\n let database = new sqlite3.Database(\"data.sqlite\");\n database.serialize(() => {\n database.all(\"PRAGMA table_info('data')\", (error, rows) => {\n if (rows.some(row => row.name === \"on_notice_from\"))\n database.run(\"drop table [data]\"); // ensure that the on_notice_from (and on_notice_to) columns are removed\n database.run(\"create table if not exists [data] ([council_reference] text primary key, [address] text, [description] text, [info_url] text, [comment_url] text, [date_scraped] text, [date_received] text)\");\n resolve(database);\n });\n });\n });\n}", "async function createUserTable(){\n return connect().then(function(connection){\n let sql = `CREATE TABLE user (\n id int(11) NOT NULL AUTO_INCREMENT,\n first_name varchar(255) DEFAULT NULL,\n last_name varchar(255) DEFAULT NULL,\n PRIMARY KEY (id)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8;`;\n let result = connection.query(sql);\n connection.end();\n return result;\n }).then(function(result){\n return result;\n }).catch(function(error){\n console.log(error);\n throw error;\n })\n}", "function customQuery(db, fun, opts) {\n\t return new PouchPromise(function (resolve, reject) {\n\t db._query(fun, opts, function (err, res$$1) {\n\t if (err) {\n\t return reject(err);\n\t }\n\t resolve(res$$1);\n\t });\n\t });\n\t }", "function queryDB(sql, values, mysql) {\r\n return new Promise((resolve, reject) => {\r\n mysql.pool.query(sql, values, (err, results, fields) => {\r\n if (err) {\r\n reject(err);\r\n } else resolve(results);\r\n });\r\n });\r\n}" ]
[ "0.68799055", "0.68773186", "0.6814937", "0.67153496", "0.67111963", "0.660529", "0.6587528", "0.6569411", "0.65419465", "0.6532298", "0.6528552", "0.6507818", "0.64650536", "0.6446671", "0.6429413", "0.6417632", "0.6409268", "0.63942945", "0.6377212", "0.6377212", "0.63765043", "0.6371439", "0.63580173", "0.6333709", "0.6321598", "0.6294119", "0.62891555", "0.6283019", "0.62551886", "0.62405604", "0.6239174", "0.6224456", "0.6222491", "0.62220806", "0.62104446", "0.62096924", "0.6194301", "0.6193466", "0.61878777", "0.6184803", "0.61800665", "0.61655676", "0.6140708", "0.6118572", "0.61015403", "0.60972625", "0.60907626", "0.60904574", "0.60842115", "0.608292", "0.6081804", "0.60807735", "0.6069906", "0.6063403", "0.60625404", "0.60579365", "0.6053105", "0.6053105", "0.60356694", "0.60335016", "0.60252345", "0.6023664", "0.6023637", "0.6006684", "0.60002905", "0.5998101", "0.599273", "0.599273", "0.5982213", "0.59778845", "0.5974609", "0.5973943", "0.5952446", "0.59377974", "0.59377974", "0.5936386", "0.59356266", "0.5935154", "0.59297436", "0.5928152", "0.5925118", "0.59197646", "0.5895269", "0.58902204", "0.5879932", "0.587724", "0.58746034", "0.58746034", "0.58735454", "0.5872041", "0.5869103", "0.58631295", "0.5857701", "0.585366", "0.58377", "0.5831338", "0.58292395", "0.5821886", "0.5811669", "0.5810448" ]
0.66421974
5
Create Promise for SQLite3 database INSERT query
function databaseInsert(query, params) { return new Promise((resolve, reject) => { db.run(query, params, (err) => { if (err) { reject(err); } else { resolve(); } }); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static createTask(task={}){\n \n return new Promise(async (resolve, reject) => {\n try {\n //const person = new Task(task)\n const databaseLayer = new DatabaseLayer(async () => SQLite.openDatabase('didits.db'), Task.tableName)\n const items = [task]\n databaseLayer.bulkInsertOrReplace(items).then(response => {\n console.log(\"Insert id \"+JSON.stringify(response))\n resolve(response[0].insertId)\n }).catch((err) =>{\n reject(-1)\n })\n //await person.save()\n \n }\n catch {\n reject([])\n }\n });\n\n }", "function promiseInsertTargetTable(conn, sql, values) {\n return new Promise(function(resolve, reject) {\n console.log(sql);\n conn.query(sql, [values], function(err, result) {\n if (err) {\n console.log(err);\n reject(err);\n } else {\n conn.commit();\n console.log(\"Commit!!!\");\n //console.log(JSON.stringify(result));\n resolve(result.affectedRows);\n }\n });\n });\n}", "function insertTrack(insertStatementsArray){\n console.log(\"Updating database...\");\n // Begin a transaction. \n db.serialize(function () {\n db.exec('begin transaction'); \n var request = [];\n for(var i = 0; i < insertStatementsArray.length; i++){\n var promise = new Promise(function(resolve){\n db.run(\"INSERT INTO ITUNES_LIBRARY VALUES (?, ?, ?, ?, ?) \", insertStatementsArray[i].c1, insertStatementsArray[i].c2, insertStatementsArray[i].c3, insertStatementsArray[i].c4, insertStatementsArray[i].c5);\n resolve();\n request.push(promise);\n });\n }\n \n Promise.all(request).then(function(values){\n console.log(\"now we're here\");\n \n db.exec('COMMIT')\n .close(function(){\n console.log(\"Happy Panda :-) Database updated with all your music.\");\n });\n \n });\n });\n}", "async insert(data) {\n const sql = `INSERT INTO ${this.table} SET ?`;\n const result = await this.db.query(sql, data);\n return result;\n }", "createNewUser(user) {\n\n console.log('CREATE USER WITH USER: ' + user);\n\n return new Promise( function (resolve,reject) {\n\n var db = new sqlite3.Database(file);\n\n db.serialize(function() {\n \n let insertRowSql = \n `INSERT INTO user \n VALUES(\n ?,?,?,?,?,?,\n ?,?,?,?,?,?,?\n )`;\n\n var stmt = db.prepare(insertRowSql); \n \n let users = generateRandomUsers();\n \n stmt.run(null,\n user.userId,\n user.password,\n user.firstName,\n user.lastName,\n user.gender,\n user.age,\n user.religion,\n user.avatarImage,\n user.minPreferredAge,\n user.maxPreferredAge,\n user.preferredReligion,\n user.preferredGender\n );\n \n stmt.finalize();\n\n let sql = \n `SELECT * FROM user \n WHERE user_id=\"${user.userId}\"\n LIMIT 1`;\n\n db.all(sql,function(err,rows) {\n if (err) {\n reject(err);\n } else {\n resolve(rows.length > 0 ? rows[0] : null);\n }\n });\n\n\n });\n\n db.close();\n }); \n }", "async function insertTask(task){\n const sql = 'INSERT INTO tasks(title,resp_name,email) VALUES (?,?,?);';\n const values = [task.title, task.resp_name, task.email];\n return await conn.query(sql, values, function (err, result) { return result; });\n}", "function mysql_insert( sql )\n{\n return new Promise( (resolve, reject) =>\n {\n pool.getConnection(function(err, connection) \n {\n if (err) reject( err.message);\n \n connection.query(sql, function (err, result) \n {\n connection.release();\n if (err) \n { \n reject( err.message + \": \" + sql);\n return;\n }\n resolve( result.insertId)\n })\n })\n })\n\n}", "function addAcc(body){\n \n let conn = dbConnection();\n \n return new Promise(function(resolve, reject){\n conn.connect(function(err) {\n if (err) throw err;\n console.log(\"Connected!\");\n \n let sql = `INSERT INTO users\n (firstname, lastname, username, email, password)\n VALUES (?,?,?,?,?)`;\n \n let params = [body.firstname, body.lastname, body.username, body.email, body.password];\n \n conn.query(sql, params, function (err, rows, fields) {\n if (err) throw err;\n conn.end();\n resolve(rows);\n });\n \n });//connect\n });//promise \n} // addAcc", "function insert() {\n // connect to a database named restaurants.sqlite\n const db = new sqlite3.Database('./restaurants.sqlite');\n\n try {\n db.serialize(function () { // serialize means execute one statement at a time\n\n console.log('inserting some data');\n\n let stmt;\n\n // insert a row into the RESTAURANTS table\n try {\n // for security reasons - very important to use a \n // prepared statement here\n stmt = db.prepare(`INSERT INTO RESTAURANTS (name, imagelink) VALUES (?, ?)`);\n stmt.run(\"hells kitchen\", \"https://www.imdb.com/title/tt0437005/\");\n\n } finally {\n // IMPORTANT! Close the statement\n stmt.finalize();\n }\n\n\n // select the rows and print them out\n db.each(\"SELECT restaurants.name, count(menus.id) FROM restaurants JOIN menus ON restaurants.id = menus.restaurant_id GROUP BY restaurants.id\",\n function (err, rows) { \n console.log(rows); \n }\n );\n // db.run(\"SELECT restaurants.name, count(menus.id) FROM restaurants JOIN menus ON restaurants.id = menus.restaurant_id GROUP BY restaurants.id\");\n\n });\n } finally {\n // very important to always close database connections\n // else could lead to memory leaks\n db.close();\n console.log('table insert complete - connection closed');\n }\n}", "create(name: string, phone: number, time_created: number) {\n return new Promise<number>((resolve, reject) => {\n pool.query(\n 'INSERT INTO NameList SET name=?, phone=?, time_created=NOW()',\n [name, phone, time_created],\n (error, results) => {\n if (error) return reject(error);\n if (!results.insertId) return reject(new Error('No row inserted'));\n\n resolve(Number(results.insertId));\n }\n );\n });\n }", "insertAttachment(params, division_db, token) {\n // const self = this;\n // const deferred = Q.defer();\n // const sqlQuery = `use [${division_db}]; insert into dbo.caregiverAttachments(socialSecNum,descr,str_filename) values('${\n // params.socialSecNum\n // }','${params.descr}','${params.str_filename}')`;\n // self.db\n // .request()\n // .query(sqlQuery)\n // .then(result => {\n // deferred.resolve(result);\n // })\n // .catch(err => {\n // console.error(err);\n // deferred.reject(err);\n // });\n // return deferred.promise;\n\n const self = this;\n const deferred = Q.defer();\n var ps = new sql.PreparedStatement(self.db);\n ps.input('attachment', sql.Image);\n ps.input('socialSecNum', sql.VarChar);\n ps.input('descr', sql.VarChar);\n ps.prepare(\n `use [${division_db}]; INSERT INTO dbo.caregiverAttachments(socialSecNum,descr,attachment) VALUES (@socialSecNum, @descr, @attachment)`,\n function(err) {\n if (err) {\n console.error(err);\n deferred.reject(err);\n return;\n }\n // check err\n ps.execute(params, function(err, records) {\n // check err\n if (err) {\n console.error(err);\n deferred.reject(err);\n return;\n } else {\n deferred.resolve(records);\n }\n ps.unprepare(function(err) {\n if (err) {\n console.error(err);\n // deferred.reject(err);\n } else {\n }\n // check err\n // If no error, it's been inserted!\n });\n });\n }\n );\n\n return deferred.promise;\n }", "async insert(table, item) {\n try {\n let query = \"INSERT INTO \" + table + \" (\";\n let queryParams = [];\n for (let key in item) {\n query += `${key}, `;\n }\n query = query.slice(0, query.length - 2);\n query += \")\\nVALUES (\";\n for (let key in item) {\n query += \"?, \";\n queryParams.push(item[key]);\n }\n query = query.slice(0, query.length - 2);\n query += \");\";\n const output = await this.pool.query(query, queryParams);\n return output;\n } catch (e) {\n console.error(\"db.insert error: \", e);\n throw e;\n }\n }", "initDatabase() {\n\n return new Promise( function (resolve,reject) {\n\n var exists = fs.existsSync(file);\n var db = new sqlite3.Database(file);\n\n if (exists) {\n return process.nextTick(_ => resolve());\n } else {\n console.log(\"Creating DB file.\");\n fs.openSync(file, \"w\");\n }\n\n db.serialize(function() {\n\n let createTableSql = \n `create table user(\n id INTEGER PRIMARY KEY,\n user_id TEXT,\n password TEXT,\n first_name TEXT,\n last_name TEXT,\n gender TEXT,\n age INTEGER,\n religion TEXT,\n avatar_image TEXT,\n min_preferred_age INTEGER,\n max_preferred_age INTEGER,\n preferred_religion TEXT,\n preferred_gender TEXT\n )`;\n\n db.run(createTableSql); \n \n let insertRowSql = \n `INSERT INTO user \n VALUES(\n ?,?,?,?,?,?,\n ?,?,?,?,?,?,?\n )`;\n\n var stmt = db.prepare(insertRowSql); \n \n let users = generateRandomUsers();\n\n users.forEach((user) => {\n stmt.run(null,\n user.userId,\n user.password,\n user.firstName,\n user.lastName,\n user.gender,\n user.age,\n user.religion,\n user.avatarImage,\n user.minPreferredAge,\n user.maxPreferredAge,\n user.preferredReligion,\n user.preferredGender\n );\n });\n stmt.finalize();\n\n //\n // Debug, dump the newly created fake users.\n //\n db.each(\"SELECT * FROM user\", function(err, row) {\n console.log(row.id + \": \" + row.first_name + ' ' + row.last_name);\n });\n\n //\n // Hack. Only way I could think of (without wasting time) to be able to call \"resolve\" at the right time.\n //\n db.each(\"SELECT * from user LIMIT 1\", function(err, row) {\n resolve();\n });\n });\n\n db.close();\n }); \n }", "function insert(item) {\n return db(\"items\")\n insert(item).then(([id]) => this.find(id));\n}", "insertActivity(db, newActivity) {\n return db\n .insert(newActivity)\n .into('activity')\n .returning('*')\n .then(rows => {\n return rows[0];\n });\n }", "async function addDemoData(){\n try{\n var sql = \"INSERT INTO sensors (`device_id`, `timestamp`,`latitude`, `longitude`, `value`) VALUES\" + \n \"(100, datetime('now'), 32.95247811, 35.22012569, 25),\"+\n \"(200, datetime('now'), 32.95443762, 35.21552299, 28),\"+\n \"(300, datetime('now'), 32.95347401, 35.17686298, 15),\"+\n \"(500, datetime('now'), 32.93386939, 35.08317586, 12),\"+\n \"(600, datetime('now'), 32.84435757, 35.08893730, 20),\"+\n \"(700, datetime('now'), 33.05366374, 35.10170266, 35),\"+\n \"(800, datetime('now'), 32.95482492, 35.21514105, 19)\";\n\n\n return await execSql(sql,[],'insert');\n } catch (e) {\n console.log(\"addDemoData Error\");\n throw e;\n }\n\n}", "insert(id, cardTypeName, cardNumber, expMonth, expYear, cardCVV, firstName, lastName) {\n return new Promise((resolve) => {\n this.sql.acquire(function (err, connection) {\n let procedureName = \"uspcAddNewPaymentMethod\";\n var request = new Request(`${procedureName}`, (err, rowCount, rows) => {\n if (err) {\n console.log(err)\n }\n connection.release();\n });\n request.addParameter('UserId', TYPES.Int, id);\n request.addParameter('CardTypeName', TYPES.NVarChar, cardTypeName);\n request.addParameter('CardNumber', TYPES.NVarChar, cardNumber);\n request.addParameter('ExpMonth', TYPES.TinyInt, expMonth);\n request.addParameter('ExpYear', TYPES.SmallInt, expYear);\n request.addParameter('CardCVV', TYPES.SmallInt, cardCVV);\n request.addParameter('FirstName', TYPES.NVarChar, firstName);\n request.addParameter('LastName', TYPES.NVarChar, lastName);\n let jsonArray = []\n request.on('row', function (columns) {\n var rowObject = {};\n columns.forEach(function (column) {\n if (column.value === null) {\n console.log('NULL');\n } else {\n if (column.metadata.colName == 'ProfileImage' || column.metadata.colName == 'SenderProfileImage') {\n column.value = Buffer.from(column.value).toString('base64');\n }\n rowObject[column.metadata.colName] = column.value;\n }\n });\n jsonArray.push(rowObject)\n });\n\n request.on('doneProc', function (rowCount, more) {\n resolve(\"Card has been inserted\")\n });\n\n connection.callProcedure(request)\n });\n })\n .then((message) => {\n return message\n })\n .catch((err) => {\n console.log(err);\n });\n }", "async function execSql(sql, params = [],action){\n console.log(\"start execSql....\\n\");\n\n try{\n let db = await connectToDB();\n db.loadExtension(\"./extension-functions\");//compiled extension for \n\n switch (action) {\n case 'select':\n return await select();\n case 'insert':\n return await insert();\n default:\n return false;\n }\n /*db.serialize(() => {\n // Queries scheduled here will be serialized.\n db.run(\n `CREATE TABLE IF NOT EXISTS sensors (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n device_id INTEGER,\n timestamp TEXT,\n latitude REAL,\n longitude REAL,\n value INTEGER\n )`);\n \n \n\n });*/\n\n async function select(){\n return new Promise(function(resolve, reject) {\n\n db.all(sql, params, (err,result) => {\n if (err) {\n console.error(err.message);\n reject(err.message);\n }\n resolve(result);\n\n }).close((err) => {\n if (err) {\n console.error(\"error\" , err.message);\n reject(err.message);\n }\n console.log('Close the database connection.');\n });\n \n }); \n }//end select\n\n async function insert(){\n return new Promise(function(resolve, reject) {\n\n db.run(sql, params, function(err){\n if (err){\n reject(err);\n throw err;\n }\n resolve(true);\n \n }).close((err) => {\n if (err) {\n console.error(\"error\" , err.message);\n }\n console.log('Close the database connection.');\n });\n\n }); \n }//end insert\n\n \n \n\n }catch(e){\n console.log(\"execSql Error\");\n throw e;\n }\n}", "function testSinglePlan_Insert() {\n asyncTestCase.waitForAsync('testSinglePlan_Insert');\n assertEquals(0, cache.getCount());\n\n var queryTask = new lf.proc.UserQueryTask(\n hr.db.getGlobal(), [getSampleQuery()]);\n queryTask.exec().then(function() {\n return lf.testing.util.selectAll(global, j);\n }).then(function(results) {\n assertEquals(ROW_COUNT, results.length);\n assertEquals(ROW_COUNT, cache.getCount());\n for (var i = 0; i < ROW_COUNT; ++i) {\n assertEquals(rows[i].id(), results[i].id());\n assertObjectEquals(rows[i].payload(), results[i].payload());\n }\n asyncTestCase.continueTesting();\n }, fail);\n}", "function insert(userSubmission) {\n return db('user_submissions')\n .insert(userSubmission)\n .returning('id')\n .then(idArr => {\n const id = idArr[0];\n return db('user_submissions').where({\n id\n })\n .first();\n })\n .catch(err => console.log(err));\n}", "async function insertRow(database, developmentApplication) {\n return new Promise((resolve, reject) => {\n let sqlStatement = database.prepare(\"insert or replace into [data] values (?, ?, ?, ?, ?, ?, ?)\");\n sqlStatement.run([\n developmentApplication.applicationNumber,\n developmentApplication.address,\n developmentApplication.description,\n developmentApplication.informationUrl,\n developmentApplication.commentUrl,\n developmentApplication.scrapeDate,\n developmentApplication.receivedDate\n ], function (error, row) {\n if (error) {\n console.error(error);\n reject(error);\n }\n else {\n console.log(` Saved application \\\"${developmentApplication.applicationNumber}\\\" with address \\\"${developmentApplication.address}\\\" and description \\\"${developmentApplication.description}\\\" to the database.`);\n sqlStatement.finalize(); // releases any locks\n resolve(row);\n }\n });\n });\n}", "async function insertRow(database, developmentApplication) {\n return new Promise((resolve, reject) => {\n let sqlStatement = database.prepare(\"insert or replace into [data] values (?, ?, ?, ?, ?, ?, ?)\");\n sqlStatement.run([\n developmentApplication.applicationNumber,\n developmentApplication.address,\n developmentApplication.description,\n developmentApplication.informationUrl,\n developmentApplication.commentUrl,\n developmentApplication.scrapeDate,\n developmentApplication.receivedDate\n ], function (error, row) {\n if (error) {\n console.error(error);\n reject(error);\n }\n else {\n console.log(` Saved application \\\"${developmentApplication.applicationNumber}\\\" with address \\\"${developmentApplication.address}\\\" and description \\\"${developmentApplication.description}\\\" to the database.`);\n sqlStatement.finalize(); // releases any locks\n resolve(row);\n }\n });\n });\n}", "insertEthereumLog(obj){\n let query = `insert into ethereummessages set ?`;\n\n return new Promise((resolve, reject) => {\n db.query(query, obj, (err, suc) => {\n if (err)\n reject(new errModel(err.code, err));\n else\n resolve(true);\n })\n })\n }", "async function insertRow(database, developmentApplication) {\n return new Promise((resolve, reject) => {\n let sqlStatement = database.prepare(\"insert or replace into [data] values (?, ?, ?, ?, ?, ?, ?, ?)\");\n sqlStatement.run([\n developmentApplication.applicationNumber,\n developmentApplication.address,\n developmentApplication.description,\n developmentApplication.informationUrl,\n developmentApplication.commentUrl,\n developmentApplication.scrapeDate,\n developmentApplication.receivedDate,\n developmentApplication.legalDescription\n ], function (error, row) {\n if (error) {\n console.error(error);\n reject(error);\n }\n else {\n console.log(` Saved: application \\\"${developmentApplication.applicationNumber}\\\" with address \\\"${developmentApplication.address}\\\", description \\\"${developmentApplication.description}\\\", legal description \\\"${developmentApplication.legalDescription}\\\" and received date \\\"${developmentApplication.receivedDate}\\\" to the database.`);\n sqlStatement.finalize(); // releases any locks\n resolve(row);\n }\n });\n });\n}", "addItems() {\n let id = 0;\n let name = \"\";\n let amount = 0;\n let datecreated = \"\";\n let status = \"\";\n let type = \"\";\n\n db.transaction(async function(d) {\n\n console.log(data);\n data.forEach(e => {\n id = e.id;\n name = e.name;\n amount = e.amount;\n datecreated = e.date;\n status = e.status;\n type = e.type;\n\n d.executeSql('INSERT INTO activities (id,name, amount, datecreated, status, type) VALUES (?,?,?,?,?,?)', [id, name, amount, datecreated, status, type]);\n\n });\n });\n }", "function insertToUserData() {\n var request = new Request();\n var sql = \"INSERT INTO userData (id, password) VALUES ('emma', 'lalala')\";\n\n request = new Request(sql, (err, rowCount, rows) => {\n console.log(rowCount + ' row(s) returned');\n process.exit();\n });\n \n connection.execSql(request);\n}", "async function insertQuiz(dados){\n const conn = await connect();\n const sql = 'INSERT INTO Quiz (respostas,idUsuario) VALUES (?,?);';\n const values = [dados.resposta,dados.idUsuario]\n return await conn.query(sql,values);\n}", "function addVeiculo(dados, usuario){\n return new Promise((resolve,reject) => {\n let stm = db.prepare(\"INSERT INTO tbInfoVeiculo (usuarioCadastro, idmontadora, nomemodelo,anofabricacao,cores,tipoChassi,suspensaodianteira,suspensaotraseira,pneusdianteiro,pneutraseiro,freiodianteiro,freiotraseiro,tipodofreio,qtdcilindros,diametro,curso,cilindrada,potenciamaxima,torquemaximo,sistemadepartida,tipodealimentacao,combustivel,sistemadetransmissao,cambio,bateria,taxadecompessao,comprimento,largura,altura,distanciaentreeixos,distanciadosolo,alturadoassento,tanquedecombustivel,peso,arqFoto) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\")\n let p = dados;\n stm.run([usuario, p.montadora,p.nomeModelo,p.anoFabricacao,p.cores,p.tipoChassi,p.suspDianteira,p.suspTraseira,p.pnDianteiro,p.pnTraseiro,p.frDianteiro,p.frTraseiro,p.tpFreio,p.qtdCilindros,p.diametro,p.curso,p.cilindrada,p.potMax,p.tqMax,p.stPartida,p.tpAlimentacao,p.combustivel,p.stTransmissao,p.cambio,p.bateria,p.txCompress,p.comprimento,p.largura,p.altura,p.distEixos,p.distSolo,p.altAs,p.tqComb,p.peso,p.arqFoto], (err) => {\n if(err) {\n reject(err);\n }\n resolve(p.nomeModelo);//Confirmar veiculos\n })\n })\n}", "async function addNewProduct() {\n\n // console.log(\"Inside addNewProduct()\");\n console.log(\"\\n\");\n const newItemInfo = await addNewProductPrompt();\n\n\n const queryString = \"INSERT INTO products SET ?\";\n\n const query = connection.query(queryString, newItemInfo, function (err, res) {\n\n if (err) throw err;\n\n console.log(\"\\n\\n\\tItem successfully created in database!\");\n\n //Call manager view\n console.log(\"\\n\\n\");\n return bamazonManagerView();;\n });\n\n\n} //End of addNewProduct()", "function insertVol(id, preference){\n db.transaction(tx => {\n tx.executeSql(\n 'INSERT INTO volunteer_role_t (person_id, preference) VALUES (?,?)',\n [id, preference],\n (tx, results) => {\n console.log('Results', results.rowsAffected);\n if (results.rowsAffected > 0) {\n\n } else {\n alert('Registration Failed');\n }\n }\n );\n });\n}", "function insertIntoSunDetails(sunConn,trans,rows,headerID,userID,month){\nlet requestString=\"INSERT INTO PK1_PSTG_DETAIL \"\nlet reaminString=\" VALUES\"\nlet rowsNum=rows.length\nrows.forEach(row=>{\n // console.log(row);\nreaminString+=`('${headerID}','${rowsNum}',`\nrowsNum-=1\ntrans.forEach(element=>{\n if(element.isConst===false){\n let position=hrmsColumns[element.mappedVal]\n reaminString+=`'${row[position].value}',`\n }\n else{\n reaminString+=`'${element.mappedVal}',`\n }\n})\nreaminString = reaminString.substring(0, reaminString.length - 1);\nreaminString+='),'\n\n})\nreaminString = reaminString.substring(0, reaminString.length - 1);\nreaminString+=';'\nrequestString+=reaminString\n//console.log(requestString);\n\nreturn new Promise((resolve,reject)=>{\n request = new Request(requestString, (err,rowCount,rows)=> { \n if (err) { \n reject(err.message)\n console.log(err.message);\n }\n else{\n console.log(rowCount+' rows inserted')\n }\n });\n request.setTimeout(300000);\n request.on('requestCompleted', function() { \n console.log('transformation done')\n if(forceTransFlag==false){\n createLog(userID,month)\n }\n else{\n updateLog(userID,month)\n }\n resolve(1)\n }); \n sunConn.execSql(request); \n})\n}", "function dbInsert(data, table) {\n return knex.insert(data).into(table).returning('id')\n .then(function(id){\n return id;\n })\n .catch(err => console.log('error caught', err))\n }", "async function insertOrder(){\n const text = 'INSERT INTO shippment VALUES (1000000, current_timestamp, 362, $1, $2, 1, $3, $4, $5, 75607, $6)';\n const payment = true;\n const un = 'Revarz';\n const street = 'somestreet';\n const city = 'somecity';\n const province = 'someprovince';\n const country = 'highrise';\n\n try{\n const result = await pool.query(text, [payment, un, street, city, province, country]);\n if(result.rows){\n return;\n }\n } catch(error){\n throw error;\n }\n}", "createEmployee(employee) {\n return this.connection\n .promise()\n .query(\"INSERT INTO employee SET ?\", employee);\n }", "function insert(cloudantDb, doc, params) {\n return new Promise(function(resolve, reject) {\n cloudantDb.insert(doc, params, function(error, response) {\n if (!error) {\n console.log('success', response);\n resolve(response);\n } else {\n console.log('error', error);\n reject(error);\n }\n });\n });\n}", "async createUser(value){\n const userCreated = await db().promise().query('INSERT INTO users SET ?', [value], (error, results, _) => {\n if (error) {\n throw error\n }\n })\n console.log(userCreated)\n return userCreated[0]\n }", "insertBinanceLog(obj){\n let query = `insert into binancemessages set ?`;\n \n return new Promise((resolve, reject) => {\n db.query(query, obj, (err, data) => {\n if (err)\n reject(new errModel(err.code, err));\n else\n resolve(data)\n })\n })\n }", "newProduct(newProduct){\n // INSERT data into DB\n this.connection.queryAsync(\n 'INSERT INTO products( product_name, department_name,price, stock_quantity)VALUES(?,?,?,?)', \n [\n newProduct.name, \n newProduct.department, \n parseInt(newProduct.price), \n parseInt(newProduct.quantity)\n ])\n .then(queryItem => {\n console.log('New product has been successfully added!')\n })\n // Close DB connection\n .then(this.connection.end())\n // Handle error inserting data\n .catch((err) => console.log(err))\n }", "async function createDB() {\n //set path of sql file\n let path = \"src/db/\";\n //get destroy sql\n let destroySql = await read(path+'destroy.sql').then(returnData);\n //get init sql\n var initSql = await read(path+'init.sql').then(returnData);\n //get data sql\n var dataSql = await read(path+'data.sql').then(returnData);\n\n //destroys db\n await db.queryNotParameter(destroySql).catch(function (error) {\n console.error(error);\n });\n console.log(\"=====database destroyed=====\");\n\n //creates db\n await db.queryNotParameter(initSql).catch (function(error){\n console.error(error);\n }) ;\n console.log(\"=====database created=====\");\n\n\n //inserts data\n await db.queryNotParameter(dataSql).catch (function(error){\n console.error(error);\n }) ;\n console.log(\"=====database loaded with initial data=====\");\n \n}", "function insertPromisedNewRecordInDB(newRecord)\n{\n return new Promise(\n function(resolve, reject)\n {\n MongoClient.connect(process.env.MONGODB_URL,function(error, database)\n {\n if(error) throw error;\n else\n {\n var databaseObject = database.db(\"fcc_node_challenge_one\");\n databaseObject.collection(\"VotingApplication\").insertOne(newRecord, function(err, result)\n {\n if(err) reject(err);\n else\n {\n database.close();\n resolve(newRecord);\n }\n });\n }\n });\n }\n );\n}", "function insertItemToDB(data,response) {\n return new Promise(function(resolve,reject){\n mongoDbConnection.collection('scheduledURLExecution').insertOne(data, function (err, succes) {\n if (err)\n reject (err);\n else\n resolve(response);\n })\n });\n}", "function insert(payload) {\n console.log('payload', payload)\n return new Promise((resolve, reject) => {\n const sql = `INSERT INTO [user] (name, birthday, email, gender, country, hashed_password) VALUES (@name, @birthday, @email, @gender, @country, @hashed_password)`;\n const request = new Request(sql, (err) => {\n if (err) {\n reject(err);\n console.log(err);\n }\n });\n\n // now we set user password to hashed password\n if (payload.hashed_password) {\n bcrypt.genSalt(10, (err, salt) => {\n bcrypt.hash(payload.hashed_password, salt, (err, hash) => {\n // Now we can store the password hash in db.\n payload.hashed_password = hash\n console.log(\"payload.hashed_password 1\", payload.hashed_password);\n\n request.addParameter(\"name\", TYPES.VarChar, payload.name);\n request.addParameter(\"birthday\", TYPES.Date, payload.birthday);\n request.addParameter(\"email\", TYPES.VarChar, payload.email);\n request.addParameter(\"gender\", TYPES.VarChar, payload.gender);\n request.addParameter(\"country\", TYPES.VarChar, payload.country);\n request.addParameter(\n \"hashed_password\",\n TYPES.VarChar,\n payload.hashed_password\n );\n\n console.log(\"payload.hashed_password 2\", payload.hashed_password);\n\n request.on(\"requestCompleted\", (row) => {\n console.log(\"User inserted\", row);\n resolve(\"user inserted\", row);\n });\n connection.execSql(request);\n });\n });\n }\n });\n}", "function dbPeopleInsert(Pname, Ptitle, Pdate,Psalary)\n{\n var db = dbGetHandle()\n var rowid = 0;\n db.transaction(function (tx) {\n tx.executeSql('INSERT INTO people_DB VALUES(?, ?, ?, ?)',\n [Pname, Ptitle, Pdate,Psalary])\n var result = tx.executeSql('SELECT last_insert_rowid()')\n rowid = result.insertId\n })\n return rowid;\n}", "function insertEmergencyTable(){\n\n return new Promise((resolve, reject) => {\n emergencyContact.unshift(employeeId);\n let query = \"insert into employeeEmergencyDetails (employeeId,eFullName,eMobileNo,email,relationship) values(?,?,?,?,?)\";\n db.query(query, emergencyContact, (err, data) => {\n if (err) {\n console.log(err);\n db.rollback();\n //res.sendStatus(500);\n reject();\n } else {\n console.log('inserted emergency contact part 4 of 4 ');\n resolve();\n }\n });\n\n });\n}", "async function insertNewDoctorVisit(body) {\r\n const [ results ] = await mysqlPool.query(\r\n 'INSERT INTO doctorvisit SET ?',\r\n body\r\n );\r\n\r\n return results.insertId;\r\n}", "function pet_insert() {\n\tdb.transaction(pet_insert_db, errorDB, successDB);\n}", "static async insert(value) {\n const { rows } = await pool.query(\n 'INSERT INTO orders (quantity) VALUES ($1) RETURNING *',\n [value.quantity]\n )\n\n return new Order(rows[0]);\n}", "function insertTemporaryAddress() {\n\n return new Promise((resolve,reject)=>{\n\n addressTempDetails.unshift(employeeId);\n\n let query = \"insert into employeeAddressDetails (employeeId,street,city,province,country,zipCode,addressType) values(?,?,?,?,?,?,?)\";\n db.query(query, addressTempDetails, (err, data) => {\n if (err) {\n console.log(err);\n db.rollback();\n rej(err);\n //res.sendStatus(500);\n } else {\n console.log(\"inserted temporary address.. (i)\");\n resolve();\n }\n });\n\n });\n}", "function insertItem(item)\n{\n return new Promise((resolve, reject) => {\n\n let params = {\n TableName: 'medium_post_demo',\n Item: item\n };\n\n dynamo.put(params, (err, data) => {\n if (err) {\n reject(err);\n } else {\n resolve('All done here.');\n }\n });\n });\n}", "function insertProductCategory(instrumentID, caregory) {\n return new Promise(function (resolve, reject) {\n console.log(\"insertProductCategory**\");\n var insertCategory = squel.insert().into(\"InstrumentCategory\")\n .set('Musical_instrument', instrumentID)\n .set('CategoryName', caregory)\n .toString();\n DButilsAzure.Insert(insertCategory)\n .then(function (ans) {\n console.log(\"insertProductCategory Response :\" + ans);\n resolve(\"insertProductCategory Response :\" + ans);\n\n })\n .catch(function (reason) {\n console.log(\"insertProductCategory fail!\" + reason);\n reject(\"insertProductCategory fail!\");\n });\n });\n}", "function createPatient(patient_name,condition,location){\n return knex('patients')\n .insert({\n patient_name: patient_name,\n condition: condition,\n location: location\n })\n .then(result => {\n return result\n })\n \n}", "create(turno) {\n return __awaiter(this, void 0, void 0, function* () {\n const result = (yield this.db.query('INSERT INTO turnos SET ?', [turno]))[0].affectedRows;\n console.log(result);\n return result;\n });\n }", "async function insertJogabilidade(dados){\n const conn = await connect();\n const sql = 'INSERT INTO Jogabilidade (idJog,rota,funcao) VALUES (?,?,?);';\n const values = [dados.idJog,dados.rota,dados.funcao]\n return await conn.query(sql,values);\n}", "async function registerDB(data, cep) {\n return new Promise((resolve, reject) => {\n try {\n for (const cepUni of data) {\n //console.log(cepUni.logradouroDNEC);\n //register at DB\n var endereco = cepUni.logradouroDNEC;\n var conplemento = '';\n // Get the index of the last - \n var lastIndex = endereco.lastIndexOf(' - ');\n // Add the string before the last .\n if (lastIndex > 3) {\n endereco = cepUni.logradouroDNEC.substring(0, cepUni.logradouroDNEC.lastIndexOf(' - '));\n conplemento = cepUni.logradouroDNEC.substr(lastIndex + 3);\n }\n\n var queryString = `INSERT INTO ceptable(\n cep,logradouro,complemento,bairro,cidade,estado,exist_no_ws,data_consulta,nome_unidade,tipo_cep\n ) VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)`\n const values = [\n cepUni.cep,\n '',\n conplemento,\n cepUni.bairro,\n cepUni.localidade,\n cepUni.uf,\n 'SIM',\n new Date(),\n cepUni.nomeUnidade,\n cepUni.tipoCep\n ];\n\n pool.query(queryString,values, (err, res) => {\n if (err !== undefined) {\n // log the error to console\n //console.log(\"Postgres INSERT error:\", err);\n\n // get the keys for the error\n // var keys = Object.keys(err);\n //console.log(\"\\nkeys for Postgres error:\", keys);\n\n // get the error position of SQL string\n //console.log(\"Postgres error position:\", err.position);\n resolve(true); //já existe o cep\n }\n\n // check if the response is not 'undefined'\n if (res !== undefined) {\n // log the response to console\n //console.log(\"Postgres response:\", res);\n\n // get the keys for the response object\n // var keys = Object.keys(res);\n\n // log the response keys to console\n // console.log(\"\\nkeys type:\", typeof keys);\n // console.log(\"keys for Postgres response:\", keys);\n\n if (res.rowCount > 0) {\n console.log(\"# of records inserted:\", res.rowCount);\n } else {\n //console.log(\"No records were inserted.\");\n }\n resolve(true);\n }\n });\n\n }\n }\n catch {\n console.log(\"============================================erro salvar cep: \" + cep)\n resolve(false);\n }\n });\n}", "insertRecipe(db, ingredients, newRecipe, recipeIngredients) {\n let newRecipeId;\n return (\n db\n // using a transaction with async/await in order to ensure proper order of data submission based on dependencies\n // transaction will rollback if an error occurs at any point in the process to prevent incomplete data insertion\n .transaction(async trx => {\n // insert ingredients data, and for each ingredient, assign id returned from database to associated recipeIngredients entry\n await trx\n .into(\"ingredients\")\n .insert(ingredients)\n .returning(\"*\")\n .then(ingredients => {\n for (let i = 0; i < ingredients.length; i++) {\n recipeIngredients[i].ingredient_id = ingredients[i].id;\n }\n });\n // insert recipe data, and assign recipe_id returned from database to each entry in recipeIngredients\n await trx\n .into(\"recipes\")\n .insert(newRecipe)\n .returning(\"id\")\n .then(([recipeId]) => recipeId)\n .then(recipeId => {\n for (let recipeIngredient of recipeIngredients) {\n recipeIngredient.recipe_id = recipeId;\n }\n newRecipeId = recipeId;\n });\n // insert recipeIngredients data\n await trx.into(\"recipes_ingredients\").insert(recipeIngredients);\n })\n // query database for recipe data based on new recipe ID and return response\n .then(() => {\n return RecipesService.getById(db, newRecipeId);\n })\n );\n }", "registerNew (username, password) {\n\n var testerInfo = {\n testerID: username,\n passWord: password\n }\n\n var connectionDB = this.connectDB()\n var registerProcess = connectionDB.then((connection) => {\n return new Promise((resolve, reject) => {\n connection.query('SELECT id FROM ' + dbTesterInfo + ' WHERE ' +\n ' testerID = ?', testerInfo.testerID, (err, results, fields) => {\n if(!err) {\n if (results.length === 0) {\n resolve(connection)\n } else {\n connection.release()\n reject({err: {msg: 'The username has been used!'}})\n }\n } else {\n reject(err)\n }\n })\n })\n }).catch((err) => {\n return Promise.reject(err)\n })\n\n var registerProcess2 = registerProcess.then ((connection) => {\n return new Promise ((resolve, reject) => {\n connection.query('INSERT INTO ' + dbTesterInfo + 'SET ?', testerInfo, (err, results, fields) => {\n if (!err){\n connection.release()\n resolve()\n } else {\n reject(err)\n }\n })\n })\n }).catch ((err) => {\n // connection.release()\n return Promise.reject(err)\n })\n\n var registerProcess3 = registerProcess2.then((connection) => {\n return new Promise ((resolve, reject) => {\n fs.mkdir(config.personalStorageLocation + '/' + username, 0o700,\n (err) => {\n if(!err) {\n resolve()\n } else {\n reject(err)\n }\n })\n })\n })\n\n return registerProcess3\n }", "function createTransaction() {\n const sql = `INSERT INTO ${table} VALUES ('1')`;\n\n const request = new Request(sql, (err, rowCount) => {\n if (err) {\n console.log('Insert failed');\n throw err;\n }\n\n console.log('new Request cb');\n\n // Call connection.beginTransaction() method in this 'new Request' call back function\n beginTransaction();\n });\n\n connection.execSql(request);\n}", "async function insertNCCProfile(requestParams,context){\n if(requestParams.countryCode){\n var countryCode = requestParams.countryCode;\n var writeTable = \"INSERT INTO WM_NCC_PROFILE(ModificationFlag,CountryCode,NCCName,BankBranchNCC,BankNCCOfficeType,NewBankBranchNCC,BankName,BankBranchShortName,BankBranchFullName,BankBranchAddress,BankBranchPhoneCC,BankBranchPhoneNo,SWIFTBIC,IsNCCDP,DPNCC,SEPA,FieldA,FieldB)\"\n\t\t\t\twriteTable += \"VALUES ('\" + requestParams.ModificationFlag + \"','\" + requestBody.CountryCode + \"','\" + requestBody.NCCName + \"','\" + requestBody.BankBranchNCC + \"','\" + requestBody.BankNCCOfficeType + \"','\" + requestBody.NewBankBranchNCC + \"','\" + requestBody.BankName + \"',\"\n writeTable += \"'\" + requestBody.BankBranchShortName + \"','\" + requestBody.BankBranchFullName + \"','\" + requestBody.BankBranchAddress + \"','\" + requestBody.BankBranchPhoneCC + \"','\" + requestBody.BankBranchPhoneNo + \"','\" + requestBody.SWIFTBIC + \"','\" + requestBody.IsNCCDP + \"','\" \n writeTable += \"'\" + requestBody.DPNCC + \"','\" + requestBody.SEPA + \"','\" + requestBody.FieldA + \"','\" + requestBody.FieldB + \"')\"; \n\n const connQueryPromisified = util.promisify(connection.query).bind(connection);\n const result = await connQueryPromisified(writeTable);\n return {result};\n }\n else{\n return {\"status\":422,\"Message\":\"Required Params are missing\"};\n }\n}", "function insertNewItem(mysqlPool, item){\r\n return new Promise((resolve, reject) => {\r\n const itemValues = {\r\n id: null,\r\n name: item.name,\r\n price: item.price,\r\n location: item.location,\r\n rarity: item.rarity\r\n };\r\n mysqlPool.query(\r\n 'INSERT INTO items SET ?',\r\n itemValues,\r\n function (err, result) {\r\n if (err) {\r\n reject(err);\r\n } else {\r\n resolve(result.insertId);\r\n }\r\n }\r\n );\r\n });\r\n}", "function insertProfessionalDetails(){\n\n return new Promise((resolve, reject) => {\n\n proDetails.unshift(employeeId);\n //did a silly mistake here wasted some 40 mins or so\n let query = \"insert into employeeProfessionalDetails (employeeId,joinDate,endDate,department,skill) values(?,?,?,?,?)\";\n db.query(query, proDetails, (err,data) => {\n if (err) {\n console.log(err);\n db.rollback();\n //res.sendStatus(500);\n reject();\n } else {\n console.log('inserted professional details part 3 of 4');\n resolve();\n }\n });\n });\n}", "async function initializeDatabase() {\n return new Promise((resolve, reject) => {\n let database = new sqlite3.Database(\"data.sqlite\");\n database.serialize(() => {\n database.run(\"create table if not exists [data] ([council_reference] text primary key, [address] text, [description] text, [info_url] text, [comment_url] text, [date_scraped] text, [date_received] text)\");\n resolve(database);\n });\n });\n}", "async function addStudent(name) {\n const results = await db.query(\n \"INSERT INTO students (name) VALUES ($1) RETURNING *\",[name]\n // We're using RETURNING * to get back the new record\n // notice our use of $1 - NEVER EVER use string concatenation/interpolation in your SQL queries.\n );\n console.log(results.rows[0]); // we are using [0] because there is only 1 record here.\n}", "function insert(table, params) {\n return new Promise((resolve, reject) => {\n if (!params || !params.length || typeof params !== 'object') {\n reject('Invalid params passed in');\n } else {\n var columnNames = Object.keys(params[0]).map(key => `${key}`)\n var columns = columnNames.join(',');\n var values = params.map(row => '(' + columnNames.map(col => row[col]).join(',') + ')').join(',');\n let queryString = `INSERT INTO ${table} (${columns}) VALUES ${values}`;\n return query(queryString);\n }\n })\n }", "function insertProduct(db, producto) {\n let store = db.transaction('productos', 'readwrite').objectStore('productos');\n let addReq = store.add(producto );\n return new Promise((resolve, reject) => {\n addReq.addEventListener('success', e => resolve(e.target.result)); // Devuelve el producto insertado\n addReq.addEventListener('error', e => reject('No se puede añadir el producto'));\n });\n}", "postNewProduct(product) {\n const queryString = `INSERT INTO products (name, description, price, image_path)\n VALUES ($1, $2, $3, $4)\n RETURNING *`;\n\n const queryParams = [product.name, product.description, product.price, product.imagePath];\n\n console.log('queryString: ', queryString);\n console.log('queryParams: ', queryParams);\n\n return db\n .query(queryString, queryParams)\n .then(result => result.rows[0].id)\n .catch(error => error.message);\n }", "async function insert(auction) {\n const [id] = await db(\"Auctions\").insert(auction).returning(\"id\")\n return findById(id)\n}", "async function createTodo(value) {\n const res = await query(\n `INSERT INTO todos (todo)\n values ($1)`,\n [value]\n );\n console.log(\"models\", value);\n return res; //why res.rows?\n}", "async function initializeDatabase() {\n return new Promise((resolve, reject) => {\n let database = new sqlite3.Database(\"data.sqlite\");\n database.serialize(() => {\n database.run(\"create table if not exists [data] ([council_reference] text primary key, [address] text, [description] text, [info_url] text, [comment_url] text, [date_scraped] text, [date_received] text, [legal_description] text)\");\n resolve(database);\n });\n });\n}", "async function insertCampeoes(dados){\n const conn = await connect();\n const sql = 'INSERT INTO Campeoes (id_jog,nomeCampeao,idcampeao) VALUES (?,?,?);';\n const values = [dados.id_jog,dados.nomeCampeao,dados.idcampeao]\n return await conn.query(sql,values);\n}", "async function createUser(userDataObj) {\n const { displayname, username } = userDataObj;\n const newUserInfo = await db.one (\n `insert into users (displayname, username) values($1, $2) returning id`, [displayname, username]);\n\n console.log(newUserInfo);\n return newUserInfo\n}", "save() {\n let columns = Object.keys(this.data);\n let sql;\n // build sql string\n if (this.data[this.primaryKey]) {\n sql = Squel.update().table(this.table);\n } else {\n sql = Squel.insert().into(this.table);\n }\n\n columns.map( (column) => {\n // ignore primary key column\n if (column != this.primaryKey) {\n let value = this.data[column];\n sql.set(column, value);\n }\n });\n\n // update mode: set where condition\n if (this.data[this.primaryKey])\n sql.where(`${this.primaryKey} = ${this.data[this.primaryKey]}`);\n\n // execute sql\n sql = sql.toString();\n\n return new Promise( (resolve, reject) => {\n getSQLiteDB(this.table).executeSql(sql, [], (results) => {\n // update model's primaryKey on insertId\n if (results.insertId && !this.data[this.primaryKey])\n this.data[this.primaryKey] = results.insertId;\n\n resolve(true);\n });\n });\n }", "async function createActivity({ name, description }) {\n console.log(\"starting create activity...\");\n try {\n const { rows: [ACTIVITY] } = await client.query(`\n INSERT INTO activities(name, description) VALUES ($1, $2)\n ON CONFLICT (name) DO NOTHING \n RETURNING *\n `, [name, description]);\n return ACTIVITY;\n } catch (error) {\n console.log(\"error creating activity\", error)\n throw error;\n }\n}", "function insert(user) {\n return db('users')\n .insert(user)\n .returning('id')\n .then(idArr => {\n const id = idArr[0];\n return db('users')\n .where({\n id\n }).first();\n });\n}", "insertDocs(file_type, fileName, id, doc_name, file_name, document_status) {\n return new Promise((resolve, reject) => {\n logger.info(\"insertDocs() initiated\");\n let sql= sqlObj.upload.insertDocs;\n let sqlQuery = format(sql,id,file_name, doc_name,file_type,fileName, utils.getGMT(), document_status); \n DbInstance.doInsert(sqlQuery).then(result => {\n logger.info(\"sql query executed\");\n resolve(result);\n }).catch(err => {\n logger.error(\"error while execute the query\");\n reject(err);\n });\n })\n }", "static insertEachTransaction(restaurant, dbPromise) {\n dbPromise.then(db => {\n let tx = db.transaction(restaurantsTx, 'readwrite');\n let store = tx.objectStore(restaurantsTx);\n store.add(restaurant);\n return tx.complete;\n });\n console.log('item has been inserted');\n IDBHelper.populateReviews(restaurant.id, dbPromise);\n }", "async createProject({request, response, error}){\n try{\n var date = new Date().toUTCString().slice(4, 17);\n var data = request.body;\n let max_project_id = await Database.connection('oracledb').raw(\"SELECT (MAX(PROJECT_ID)+1) as PROJECT_ID FROM LIST_OF_PROJECTS\");\n let qry = await Database.connection('oracledb').insert({\n PROJECT_ID:max_project_id[0].PROJECT_ID,\n PROJECT_NAME:data.projectname,\n DATE_OF_CREATION: date,\n DATE_OF_UPDATION:date,\n CONVERSION_STATUS:'',\n PROJECT_CREATED_BY:data.email,\n PROJECT_DESCRIPTION:data.description\n }).into('LIST_OF_PROJECTS');\n console.log(qry);\n\n let transactions = await Database.connection('oracledb').insert({ \n PROJECT_ID:max_project_id[0].PROJECT_ID,\n TRANSACTION_DATE:date,\n ENTITIY_ACCESSED:'',\n TRANSACTION_STATUS:'project created',\n TRANSACTION_PERFORMED_BY:data.email\n }).into('PROJECT_TRANSACTIONS');\n console.log(transactions);\n \n return response.status(200).send({success:true, data:{PROJECT_ID: max_project_id[0].PROJECT_ID, PROJECT_NAME: data.projectname, PROJECT_DESCRIPTION: data.description}, msg:'Successfully created the project', err:null});\n }\n catch(error){\n return response.status(400).send({success:false, data:null, msg:'Successfully created the project', err:error});\n }\n // finally{\n // Database.close(['oracledb']);\n // }\n \n }", "function insSQL(){\n var sql = 'INSERT INTO pim_transfers(';\n sql += 'user_id, manufacturer_id, from_id, to_id, products, status_id, delivery_date, type_id, notes)VALUES(';\n sql += '$1::integer, $2::integer, $3::integer, $4::integer, $5::json, $6::integer,';\n sql += ' $7::timestamp without time zone, $8::integer, $9::json) RETURNING id;';\n return sql;\n}", "function addNewPerson(name, age, city,collegeName) {\n return new Promise((resolve, reject) => {\n connection.query(\n `INSERT INTO final (name,age,city,college) VALUES (?,?,?,?)`,\n [name, age, city,collegeName],\n (err, results) => {\n if (err)\n reject(err)\n else\n resolve()\n }\n )\n })\n}", "async create(data) { await orm.insertOne(data) }", "_insertTestToken(){\n var self = this;\n if (!process.env.VCAP_SERVICES){\n var doc = {\n type: \"SESSION\",\n cn: 'BDD - Mocha Test Automation',\n uid: \"000000631\",\n mail: \"bddmocha@xx.ibm.com\",\n expiration: moment().add(1, 'years').format(),\n cleanUp: moment().add(1, 'years').format(),\n token: this.tests.token\n };\n\n let options = {\n design: 'session',\n view: 'getAllSessions',\n query: {keys: [doc.token]}\n };\n\n this.select(options)\n .then((result) => {\n if (Array.isArray(result) && result.length === 0) {\n self.insert(doc); //is a promise but I dont care when it will be fulfilled.\n }\n });\n }\n }", "function insertBd(idGateway,idLdevice,fechaLpro, mac, snr, rssi, voltaje, dhop, temperatura, longitud, latitud, altitud) {\n (async function() {\n try {\n let pool = await sql.connect(bdConfig)\n let result2 = await pool.request()\n .input('IDGATEWAY', sql.VarChar, idGateway)\n .input('LDEVICEID', sql.VarChar, idLdevice)\n .input('DPROTIMESTAMP', sql.DateTime2, fechaLpro)\n .input('MAC', sql.VarChar, mac)\n .input('SNR', sql.Float, snr)\n .input('RSSI', sql.Float, rssi)\n .input('VOLTAJE', sql.Int, voltaje)\n .input('DHOP', sql.Float, dhop)\n .input('TEMPERATURA', sql.Float, temperatura)\n .input('X', sql.Float, longitud)\n .input('Y', sql.Float, latitud)\n .input('Z', sql.Float, altitud)\n //.output('output_parameter', sql.VarChar(50))\n .execute('INSERT_LDPRODATA')\n //console.dir(result2)\n } catch (error) {\n console.log(`Error al insertar: ${error}`);\n sql.close();\n }\n sql.close();\n })()\n}", "function agenda_insert() {\n\tdb.transaction(agenda_insert_db, errorDB, successDB);\n}", "function dbStockInsert(Pinumber, Pname, Pprice)\n{\n var db = dbGetHandle()\n var rowid = 0;\n db.transaction(function (tx) {\n tx.executeSql('INSERT INTO stock_DB VALUES(?, ?, ?)',\n [Pinumber, Pname, Pprice])\n var result = tx.executeSql('SELECT last_insert_rowid()')\n rowid = result.insertId\n })\n return rowid;\n}", "function insertNewUser({ username, firstname, lastname, email, password, admin }) { \n return new Promise((fulfill, reject) => {\n Promise.using(dbConn.get(), (conn) => {\n const query = `\n INSERT INTO users SET ?\n `\n return conn.query(query, {username: username, firstname: firstname, lastname: lastname, email: email, password: bcrypt.hashSync(password, salt), admin: 0});\n })\n .then((result) => {\n fulfill(result);\n })\n .catch((err) => {\n reject(\"Insert Error\");\n })\n })\n}", "async function insertProducto(obj) {\n try {\n // {stock_p : \"palabra\"}\n const rows = await query (\"insert into producto set ?\",obj);\n // undefined insertId es una propiedad que nos devuelve el primary A_I con el que se inserto el ultimo producto de esta peticion. \n\n return rows.insertId;\n } catch(err) {\n console.log(\"Entro al catch del model\")\n throw err;\n // console.log(err);\n }\n}", "insert(item) {\n const valuesArray = Object.values(item)\n let paramsString = valuesArray.map((value, index) => `$${index + 1}`).join(', ')\n let columnsString = Object.values(this.TABLE.COLUMNS).join(', ')\n const queryString = `\n INSERT INTO ${this.TABLE.TABLE_NAME}(${columnsString}) \n VALUES(${paramsString})\n RETURNING *;\n `\n return sendRequest(queryString, valuesArray)\n\n }", "function add(tipo,cidade,bairro,data,horario,tmusicos,torganistas){\n\t\n\n\ndb = window.sqlitePlugin.openDatabase({name: 'DB', location: 'default'});\n\ndb.executeSql('INSERT INTO ensaios (tipo, cidade, bairro, data, horario, tmusicos, torganistas) VALUES (?,?,?,?,?,?,?)', [tipo, cidade, bairro, data, horario, tmusicos, torganistas]);\n\n\nreturn 'ok';\n\n\n}", "function addToDb(sql) {\n return new Promise((resolve, reject) =>\n con.connect(function (err) {\n if (err) throw err;\n con.query(\"USE test\", function (err, result) {\n if (err) throw err;\n con.query(sql, function (err, result) {\n if (err) {\n reject(\"There was an error adding\");\n }\n else {\n resolve(\"Add was successful\");\n }\n con.end();\n });\n\n })\n }))\n}", "async function createUserTable(){\n return connect().then(function(connection){\n let sql = `CREATE TABLE user (\n id int(11) NOT NULL AUTO_INCREMENT,\n first_name varchar(255) DEFAULT NULL,\n last_name varchar(255) DEFAULT NULL,\n PRIMARY KEY (id)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8;`;\n let result = connection.query(sql);\n connection.end();\n return result;\n }).then(function(result){\n return result;\n }).catch(function(error){\n console.log(error);\n throw error;\n })\n}", "function create(table) {\n return db(tableName)\n .insert(table)\n .returning(\"*\")\n .then((rows) => rows[0]);\n}", "async createNewStory() {\n await pool.query(`\n INSERT INTO story(story_title, user_id, summary) \n VALUES ($1, $2, $3) \n RETURNING *`, [this.story_title, this.user_id, this.summary])\n .then(\n result => {\n console.log('New story: ', result.rows);\n this.story_id = result.rows[0].story_id;\n this.story_title = result.rows[0].story_title;\n this.summary = result.rows[0].summary;\n this.user_id = result.rows[0].user_id;\n this.creation_date = result.rows[0].creation_date;\n }\n )\n .catch(error => console.error(`Error: createNewStory for title ${this.story_title}, id: ${this.story_id}\\n`, error.message, error.stack));\n }", "static storeDragon(dragon) {\n const {\n birthday,\n nickname,\n generationId,\n isPublic,\n saleValue,\n sireValue\n } = dragon;\n\n return new Promise((resolve, reject) => {\n pool.query(\n `INSERT INTO dragon(birthday, nickname, \"generationId\", \"isPublic\", \"saleValue\", \"sireValue\")\n VALUES($1, $2, $3, $4, $5, $6) RETURNING id`,\n [\n birthday,\n nickname,\n generationId,\n isPublic,\n saleValue,\n sireValue\n ],\n (err, res) => {\n if (err) return reject(err);\n\n const dragonId = res.rows[0].id;\n\n //storeDragonTrait is asynchronous\n //so storeDragonTrait should wait to resolve\n //dragonId until ALL dragonTraits have been stored.\n //storeDragonTrait returns a promise for every trait\n //so I can create an array of promises and wait until\n //each promise in the array is resolved\n //before resolving dragonId\n //I can use map on traits and return all the promises\n //as an array.\n //then return an overall promise that will wrap around the\n //array of promises from map.\n\n //overall promise\n Promise.all(\n dragon.traits.map(({ traitType, traitValue }) => {\n //return promise array\n return DragonTraitTable.storeDragonTrait({\n dragonId,\n traitType,\n traitValue\n });\n })\n )\n .then(() => resolve({ dragonId }))\n .catch(err => reject(err));\n }\n );\n });\n }", "static insert (confNo, vtname, cellphone, dlicense, fromDate,\n fromTime, toDate, toTime, callback) {\n const insertQuery = `INSERT INTO reservation(confNo, vtname, cellphone, dlicense, \n fromDate, fromTime, toDate, toTime) VALUES($1, $2, $3, $4, $5, $6, $7, $8) \n RETURNING *;`\n db.query(insertQuery, [confNo, vtname, cellphone, dlicense, fromDate,\n fromTime, toDate, toTime], (err, res) => {\n if (err.error)\n return callback(err);\n callback(res);\n });\n }", "async function insertObj(jsonStr) {\n\n var parkingLog_name;\n var parkingInfo_name;\n if(jsonStr.parking_lot_id) {\n parkingLog_name = 'parkingLog_' + jsonStr.parking_lot_id;\n parkingInfo_name = 'parkingInfo_' + jsonStr.parking_lot_id;\n }\n else {\n parkingLog_name = 'parkingLog';\n parkingInfo_name = 'parkingInfo';\n }\n\n await createTable(parkingLog_name, parkingInfo_name);\n\n const log_query = 'insert into ' + parkingLog_name + ' (licenseNumber, vehicleType, enterOrExitTime, enterOrExit, parkingSlotType) values (?, ?, ?, ?, ?)';\n let log_param = [jsonStr.plate, jsonStr.vtype, jsonStr.timestamp, 0, typeMapping[jsonStr.vtype]];\n\n const result3 = await client.execute(log_query, log_param, { prepare: true });\n if(enableLog == 2)console.log('Result3: ', result3);\n\n const lot_query = 'insert into ' + parkingInfo_name + ' (licenseNumber, parkingSlotType) values (?, ?)';\n let lot_param = [jsonStr.plate, typeMapping[jsonStr.vtype]];\n\n const result4 = await client.execute(lot_query, lot_param, { prepare: true });\n if(enableLog == 2)console.log('Result4: ', result4);\n \n let parkingSlotType = {'parkingslottype': typeMapping[jsonStr.vtype]};\n\n return parkingSlotType;\n\n}", "_dbFlush () {\n Promise.resolve().then(() => (\n this._dbCreate()\n ));\n }", "createDepartment(department) {\n return this.connection\n .promise()\n .query(\"INSERT INTO department SET ?\", department);\n }", "function uploadTransaction() {\n // open a entry on the database\n const transaction = db.transaction(['new_Entry'], 'writeRead');\n\n // access your object store\n const statementObjectStore = transaction.objectStore('new_Entry');\n\n // takes all entries from object store and sets them to a variable\n const getEverything = statementObjectStore.getEverything();\n\n // if 'getEverything()' executes successfully, this function will run\n getEverything.onsuccess = function () {\n // any data in indexedDB gets sent to the api server\n if (getEverything.result.length > 0) {\n fetch('/api/transaction', {\n method: 'POST',\n body: JSON.stringify(getEverything.result),\n headers: {\n Accept: 'application/json, text/plain, */*',\n 'Content-Type': 'application/json'\n }\n })\n .then(response => response.json())\n .then(serverResponse => {\n if (serverResponse.message) {\n throw new Error(serverResponse);\n }\n // open another entry\n const transaction = db.transaction(['new_Entry'], 'writeRead');\n // access the object store\n const statementObjectStore = transaction.objectStore('new_Entry');\n // clear out all entries in your store\n statementObjectStore.clear();\n\n alert('syncing... all entries have now been entered and are up to date');\n })\n .catch(err => {\n console.log(err);\n });\n }\n }\n}", "insertDivision(params, division_db, token) {\n const self = this;\n const deferred = Q.defer();\n let createdDate = new Date().toLocaleDateString('en-US');\n const sqlQuery = `insert into AffinitySuperAdmin.dbo.switch_division_db(division_name,created_date,database_name) values('${\n params.division_name\n }','${createdDate}','${params.database_name}')`;\n self.db\n .request()\n .query(sqlQuery)\n .then(result => {\n deferred.resolve(result);\n })\n .catch(err => {\n console.error(err);\n deferred.reject(err);\n });\n return deferred.promise;\n }", "static async submitTask(id,task){\n \n try{\n const response = await db.result(`INSERT INTO todouser (users_id,todo_task)\n VALUES ($1,$2);`,[id,task]); \n return response;\n } catch (error){\n return error.message;\n }\n }", "function insertInto() {\n // create database connection\n let db = createConnection();\n\n // AUTO POPULATE DATABASE USING FAKER LIBRARY\n let data = [];\n let i;\n for (i = 1; i <= 3; i++) {\n data.push([\n faker.address.streetAddress(),\n faker.address.city(),\n faker.address.state(),\n faker.address.zipCode(),\n getRandomInt(500, 1000), // price\n getRandomInt(300, 1200), // size\n getRandomInt(1, 5), // room\n getRandomInt(1, 3), // bathroom\n faker.image.city(), // fake city image\n \"house\",\n getRandomInt(1, 10)\n ]);\n } // end for loop\n\n // Database query\n let sql =\n \"INSERT INTO property (address, city, state, zipcode, price, size, room, bathroom, img, type, distance) VALUES ?\";\n db.query(sql, [data], function(err, result, field) {\n if (err) throw err;\n console.log(\"Values inserted into table successfully...\");\n }); // end query\n} // end inserInto()" ]
[ "0.688229", "0.6774268", "0.67295337", "0.66684866", "0.66575986", "0.6649997", "0.660664", "0.6579003", "0.6554538", "0.6523943", "0.64945847", "0.64837503", "0.6471823", "0.6455231", "0.6445674", "0.6438946", "0.6409074", "0.6372778", "0.63651234", "0.6364895", "0.63413626", "0.63413626", "0.63398737", "0.63350576", "0.6315823", "0.63124967", "0.63001585", "0.6292702", "0.6289201", "0.6277975", "0.6255664", "0.6234446", "0.6234193", "0.6229906", "0.6228955", "0.6218022", "0.6203662", "0.6180526", "0.617085", "0.6163152", "0.6159532", "0.614306", "0.61417615", "0.61251366", "0.6122753", "0.6121572", "0.6107662", "0.61041623", "0.60812867", "0.608071", "0.60739744", "0.6069609", "0.6067474", "0.6065814", "0.60636723", "0.6050805", "0.60487354", "0.6048357", "0.6041748", "0.6038389", "0.60237455", "0.60190237", "0.6018857", "0.6018243", "0.60119617", "0.6011203", "0.6009292", "0.6004454", "0.6001017", "0.59967965", "0.599668", "0.5992827", "0.59837013", "0.59815574", "0.59778714", "0.5973004", "0.5972054", "0.59688866", "0.5961271", "0.5960666", "0.5952143", "0.595121", "0.5948228", "0.59473616", "0.59458554", "0.5933819", "0.59306586", "0.59184515", "0.5915688", "0.5908933", "0.59014887", "0.58972216", "0.58842194", "0.5867613", "0.5863142", "0.5860692", "0.584769", "0.5844392", "0.584016", "0.5826504" ]
0.7198979
0
Helper method to construct a JSON API url endpoint from supplied declaration and params. This will be used to build the endpoints for the various method actions
function getJsonApiUrl(declaration, params) { const endpoint = get(declaration, 'endpoint'); // Use if a fully-formed url, otherwise pass to buildUrl return endpoint.indexOf('https://') === 0 ? endpoint : buildUrl(endpoint, params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function constructURL(params){\n \n delimiter = '/';\n \n url = new Array(domainName, pathToAPI);\n\n if(params.module){\n \n url.push(params.module);\n\n if(params.id && params.datatype){\n \n url.push(params.datatype + params.id);\n \n }\n\n }else throw {code: 400, message: \"No module name\"};\n url.push(\"\");\n return url.join(delimiter);\n \n}", "function apiBuilder(endpoint, params) {\n var url = 'https://api.stackexchange.com/2.2/',\n urlPath = url + endpoint;\n params.key ='Kdg9mxpgwALz)u5ubehUFw((';\n if (params !== undefined) {\n var query = [];\n for(var prop in params) {\n if (params.hasOwnProperty(prop)) {\n query.push( prop + '=' + encodeURI(params[prop]));\n }\n }\n urlPath = urlPath + '?' + query.join('&');\n }\n return urlPath;\n }", "makeApi(module, action, id, params) {\n module = module['ucFirst']();\n var url = module;\n if (action !== \"\") {\n url += '/' + action;\n if (typeof (id) !== 'undefined' && id !== null) {\n url += '/' + id;\n }\n }\n url += '.json';\n if (typeof (params) !== 'undefined') {\n var first = true;\n for (var i in params) {\n if (first) {\n url += \"?\";\n first = false;\n }\n else {\n url += \"&\";\n }\n url += i + \"=\" + params[i];\n }\n }\n return url;\n }", "function constructUrl(base, endpoint, params = {}) {\n let url = base + endpoint;\n\n let isFirst = true;\n for (let key in params) {\n url += (isFirst ? '?' : '&') + key + '=' + params[key];\n isFirst = false;\n }\n\n return url;\n}", "function generateEndpointURL () {\n var querystring = $.param({\n start_at: this[options.startDateAttribute].toISOString(),\n ndays: options.nDays\n });\n return routes('sliced_back_office_advisor_profile_availabilities', {\n advisor_profile_id: this[options.advisorIdAttribute],\n format: 'json'\n }) + '?' + querystring;\n }", "function generateEndpointURL () {\n var querystring = $.param({\n advisor_profile_id: this[options.advisorIdAttribute],\n start_at: this[options.startDateAttribute].toISOString(),\n ndays: options.nDays\n });\n return routes('back_office_availabilities', { format: 'json' }) + '?' + querystring;\n }", "function create_url(endpoint) {\n // TODO: ここを書き換えてURL作る\n // return '/api/guchi' + endpoint\n return URL_BASE + '/deai/' + endpoint;\n}", "function api_create_url(){\n // Store our API URL parameters in this utility object\n var params = {\n \"method\": \"flickr.photosets.getPhotos\",\n \"api_key\": window.api_key,\n \"photoset_id\": window.photoset_id,\n \"format\": \"json\",\n \"nojsoncallback\": \"1\",\n \"extras\": \"url_m\"\n };\n\n // Construct the URL from the params\n var url = \"https://api.flickr.com/services/rest/?\";\n for (var prop in params){ url += prop+\"=\"+params[prop]+\"&\"; }\n\n return url;\n}", "buildUrlEndpoint(action) {\n\t\t\tconst host = this._configuration.getDomain() + '/api/Bookmark/'\n\t\t\tconst endpoint = action || '';\n\t\t\treturn host + endpoint;\n\t\t}", "function generateEndpointURL () {\n var querystring = $.param({\n advisor_profile_id: this[options.advisorIdAttribute],\n start_at: this[options.startDateAttribute].toISOString(),\n ndays: options.nDays\n });\n return API_ENDPOINT + '?' + querystring;\n }", "function createURL() {\n var query_url = api_url.concat(patientID,auth,accessToken);\n actualQuery();\n }", "function _createURL()\n { var arr\n\n if(arguments.length === 1) arr=arguments[0]\n else arr = arguments\n\n var url = _transaction.server.location\n\n // arr:['route', 'article', 54 ] => str:\"/route/article/54\"\n for (var i=0; i<arr.length; i++){\n url += '/';\n if (arr[i] in _transaction.server)\n url += _transaction.server[arr[i]];\n else if (arr[i]+'Path' in _transaction.server)\n url += _transaction.server[arr[i]+'Path'];\n else\n url += arr[i]\n }\n\n return url;\n }", "getPublicUrl( endpoint, params ) {\n let qstr = this._ajax.serializeData( Object.assign( {}, params ) );\n return this._apiurl + endpoint + '?' + qstr;\n }", "function getURL(endpoint, params) {\n if (typeof params === 'object' && Object.keys(params).length > 0) {\n return `${getBaseURL()}/api${endpoint}?${qs.stringify(params)}`;\n }\n\n return `${getBaseURL()}/api${endpoint}`;\n}", "function service(arg) {\n if (_typeof(arg) === 'object') {\n // When we add query params, our backend will complain if we don't have a\n // trailing slash.\n var path = arg.path.slice(-1) === '/' ? arg.path : arg.path.concat('/');\n var url = new URL(endpoint.concat(path));\n\n if ('params' in arg) {\n for (var key in arg.params) {\n if (arg.params.hasOwnProperty(key)) {\n var val = arg.params[key];\n url.searchParams.append(key, val);\n }\n }\n }\n\n return url;\n } else {\n return endpoint.concat(arg);\n }\n}", "function build_url(type, api, req) {\n var url = 'http://' + req.headers.host + '/' + type + '/' + api._id,\n qs = [],\n key,\n arr_i;\n\n for (key in req.query) {\n if (req.query.hasOwnProperty(key)) {\n if (req.query[key] instanceof Array) {\n for (arr_i = 0; arr_i < req.query[key].length; arr_i++) {\n if (req.query[key][arr_i].trim() !== '') {\n qs.push(key + '[]=' + req.query[key][arr_i]);\n }\n }\n } else {\n if (req.query[key].trim() !== '') {\n qs.push(key + '=' + req.query[key]);\n }\n }\n }\n }\n\n if (qs.length > 0) {\n url = url + '?' + qs.join('&');\n }\n\n return url;\n }", "function constructFlurryEndpoint(){\n var base_url_Flurry = 'http://api.flurry.com/',\n apiAccessCode = 'FX2FBFN9RQXW8DKJH4WB',\n apiKey = checkApiKey(), //'VW7Z3VDXXSK7HM6GKWZ3',\n url_metric_type = checkMetricType(),\n url_app_metric_specific = checkAppMetricSpecific(),\n url_startDate = checkStartDate(),\n url_endDate = checkEndDate(),\n url_country = 'ALL';\n url_new_Flurry = base_url_Flurry + url_metric_type + '/' + url_app_metric_specific + '/?apiAccessCode=' + apiAccessCode + '&apiKey=' + apiKey + '&startDate=' + url_startDate + '&endDate=' + url_endDate + '&country=' + url_country;\n // var DEBUG_url_new_Flurry = 'http://api.flurry.com/appMetrics/ActiveUsers?apiAccessCode=FX2FBFN9RQXW8DKJH4WB&apiKey=VW7Z3VDXXSK7HM6GKWZ3&startDate=2015-01-01&endDate=2015-10-31&country=ALL';\n // alert('URL for Endpoint is temp hardconded');\n cc('API URL: '+url_new_Flurry,'success');\n return url_new_Flurry;\n}", "function createApiEndpoint(requestor, endpoint) {\n var isCollection = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n var _get = function _get() {\n var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n return requestor.makeRequest('get', '/' + endpoint, params);\n };\n var _post = function _post(data) {\n return requestor.makeRequest('post', '/' + endpoint, data);\n };\n\n /**\n *\n * @param {*} params\n */\n var apiEndpoint = function apiEndpoint() {\n var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n // calling endpoint() is equivalent to endpoint.all()\n return _get(params);\n };\n\n if (isCollection) {\n apiEndpoint.all = _get;\n apiEndpoint.create = _post;\n apiEndpoint.find = function (id) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n return requestor.makeRequest('get', '/' + endpoint + '/' + id, params);\n };\n apiEndpoint.update = function (id, data) {\n return requestor.makeRequest('put', '/' + endpoint + '/' + id, data);\n };\n apiEndpoint.delete = apiEndpoint.remove = function (id) {\n return requestor.makeRequest('delete', '/' + endpoint + '/' + id);\n };\n apiEndpoint.one = function (key) {\n return requestor.endpoint(endpoint + '/' + key, endpoint + '_' + key, false);\n };\n } else {\n apiEndpoint.get = _get;\n apiEndpoint.post = _post;\n apiEndpoint.put = function (data) {\n return requestor.makeRequest('put', '/' + endpoint, data);\n };\n apiEndpoint.delete = function () {\n return requestor.makeRequest('delete', '/' + endpoint);\n };\n }\n\n // Wrap the endpoint with a proxy to handle undefined property as another api endpoint\n // undefined property on collection endpoint return entity endpoint\n // and collection endpoint on entity endpoint\n var apiEndpointProxy = new Proxy(apiEndpoint, {\n get: function get(apiEndpoint, prop) {\n if (prop in apiEndpoint) {\n return apiEndpoint[prop];\n }\n\n return requestor.endpoint(endpoint + '/' + prop, endpoint + '_' + prop, !isCollection);\n }\n });\n\n return apiEndpointProxy;\n}", "function buildUrl(url, params) {\n if (!params) return url;\n var parts = [];\n angular.forEach(params, function(value, key) {\n if (value === null || angular.isUndefined(value)) return;\n if (!angular.isArray(value)) value = [value];\n\n angular.forEach(value, function(v) {\n if (angular.isObject(v)) {\n v = angular.toJson(v);\n }\n parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(v));\n });\n });\n return url + ((url.indexOf('?') == -1) ? '?' : '&') + parts.join('&');\n }", "formatEndpoint(str)\n {\n var url;\n var apiKey = \"?api_key=c06e14cd13b2c6373fdc8f9f3dd47eb3\";\n var base_uri = \"https://api.themoviedb.org/3/\";\n switch(str)\n {\n case \"Trending\":\n url = base_uri+'trending/movie/week'+apiKey;\n break;\n case \"Popular\":\n url = base_uri+'movie/popular'+apiKey;\n break;\n case \"Now Playing\":\n url = base_uri+'movie/now_playing'+apiKey;\n break;\n default: \n url = base_uri+'trending/movie/week'+apiKey;\n break;\n }\n return url;\n }", "function constructAPIURL(area, arg) {\n area = can.trim(area);\n arg = can.trim(arg);\n var baseURL = dgServiceURL + area + \"/\" + arg;\n return baseURL;\n}", "function make_url() {\n let tag_url = ''\n for (let i = 0; i < tags.length; i++){\n tag_url += '&tags=' + tags[i] + '&'\n }\n return '/products?page=' + page + '&order=' + order + '&category=' + category + '&criteria=' + criteria + tag_url + '&json_response=True'\n}", "function buildUrl(url, params) {\n if (!params) {\n return url;\n }\n var parts = [];\n forEachSorted(params, function(value, key) {\n if (value === null || angular.isUndefined(value)) {\n return;\n }\n if (!angular.isArray(value)) {\n value = [value];\n }\n\n angular.forEach(value, function(v) {\n if (angular.isObject(v)) {\n if (angular.isDate(v)) {\n v = v.toISOString();\n } else {\n v = angular.toJson(v);\n }\n }\n parts.push(encodeURIComponent(key) + '=' +\n encodeURIComponent(v));\n });\n });\n if (parts.length > 0) {\n url += ((url.indexOf('?') === -1) ? '?' : '&') + parts.join('&');\n }\n return url;\n }", "function genApiURL ( offset ) {\n URL = gamesURL + apiKey + formatOffset + offset;\n return URL;\n}", "function constructFlurryAppInfoEndpoint(){\n url_app_metric_specific = 'getApplication';\n url_new_Flurry = base_url_Flurry + 'appInfo/' + url_app_metric_specific + '/?apiAccessCode=' + apiAccessCode + '&apiKey=' + apiKey;\n return url_new_Flurry;\n}", "function makeUrl(params)\n{\n var ret = SGL_JS_FRONT_CONTROLLER != ''\n ? SGL_JS_WEBROOT + '/' + SGL_JS_FRONT_CONTROLLER\n : SGL_JS_WEBROOT;\n var moduleName = params.module ? params.module : '';\n var managerName = params.manager ? params.manager : moduleName;\n\n switch (SGL_JS_URL_STRATEGY) {\n\n // make classic URL\n case 'SGL_UrlParser_ClassicStrategy':\n if (ret.charAt(ret.length - 1) != '?') {\n ret = ret + '?';\n }\n ret = ret + 'moduleName=' + escape(moduleName) + '&managerName=' + escape(managerName);\n for (x in params) {\n if (x == 'module' || x == 'manager') {\n continue;\n }\n // add param\n ret = '&' + ret + escape(x) + '=' + escape(params[x]);\n }\n break;\n\n // make default Seagull SEF URL\n default:\n ret = ret + '/' + escape(moduleName) + '/' + escape(managerName) + '/';\n for (x in params) {\n if (x == 'module' || x == 'manager') {\n continue;\n }\n ret = ret + escape(x) + '/' + escape(params[x]) + '/';\n }\n break;\n }\n return ret;\n}", "function getApiCallUrl(library, method, params = {}) {\n let url = `http://${config.server.host}:${config.server.port}/api/?type=json&method=${library}.${method}`;\n Object.keys(params).forEach((key) => {\n url += `&${key}=${encodeURIComponent(params[key])}`;\n });\n\treturn url;\n}", "function gen_url(object){\n var server = config.get('api_conf.server');\n var port = config.get('api_conf.port');\n var version = config.get('api_conf.version');\n var account = config.get('api_conf.account');\n\n url = \"http://\" + server + \":\" + port + \"/\" + version + \"/\" + account \n //Check if the container/object exist, if they exist \n //concatenate it to the url variable \n if(config.has('api_conf.container')){\n url += \"/\" + config.get('api_conf.container'); \n } \n if(config.has('api_conf.object')){\n url += \"/\" + config.get('api_conf.object');\n }\n url += object; \n\n return url;\n}", "static url(name, params) {\n\n if (!this.names[name]) {\n return null;\n }\n\n var uri = this.names[name];\n\n var query = {};\n\n if (!params) {\n params = {};\n }\n var has_query = false;\n\n _.forIn(params, function(value, param) {\n\n if (value !== undefined) {\n\n if (uri.indexOf('{'+param+'}') !== -1) {\n\n uri = uri.replace('{'+param+'}', value);\n\n } else if (uri.indexOf('{'+param+'?}') !== -1) {\n\n uri = uri.replace('{'+param+'?}', value);\n\n } else {\n\n has_query = true;\n query[param] = value;\n }\n }\n });\n\n uri = uri.replace(/\\{.*?\\?}/g, ''); //remove optional params\n uri = uri.replace(/\\{.*?\\}/g, 'null'); //replace regular unfilled params with null\n uri = uri.replace(/\\/+$/, ''); //remove any unintended trailing slashes\n\n if (has_query) {\n uri+= '?'+qs.stringify(query);\n }\n\n return uri;\n\n }", "generateReqUrl() {\n this.url = `https://api.openweathermap.org/data/2.5/weather?q=${this.loc}&appid=${this.apiKey}${this.units}${this.lang}${this.mode}`;\n this.query ? this.url += `&${queryString.stringify(this.query)}` : this.url;\n \n }", "updateUrl(action, params) {\n\n let url_params = {\n profile: params.profile,\n 'test-name': params.testName,\n 'data-provider': params.dataProvider,\n version: params.version,\n level: params.level\n };\n\n switch (action.isById) {\n case true:\n this.url = `${this.initUrl}${action.url}/${params.id}`\n break;\n\n case false:\n let queryParams = this.$httpParamSerializer(\n _.transform(url_params, (res, v, k) => {\n if (v) res[k] = v;\n }));\n this.url = `${this.initUrl}${action.url}?${queryParams}`;\n break;\n\n case 'irrelevant':\n url_params[id] = params.id;\n let queryParam = this.$httpParamSerializer(\n _.transform(url_params, (res, v, k) => {\n if (v) res[k] = v;\n }));\n this.url = `${this.initUrl}${action.url}?${queryParam}`;\n break;\n }\n }", "function createApiCallFunc(json)\n{\n return function() {\n var url = getApi(json.api);\n var requestString = JSON.stringify(json.data);\n\n if (json.description) {\n console.log(\"--> \" + json.description);\n }\n\n // requestString = '';\n // console.log('-> ' + url);\n // console.log(requestString);\n\n // var headers = {\n // 'Accept': 'application/json',\n // 'Content-type': 'application/json'\n // // or 'Content-type': 'application/x-www-form-urlencoded'\n // };\n\n this.open(url, {\n encoding: \"utf8\",\n method: json.method,\n data: requestString,\n headers: json.headers\n });\n };\n}", "addParamsToEndPoint (endpoint, params) {\n /* We test each params: are they allowed for this endpoint\n * and are they valid ? If so, chain them; otherwise ignore\n */\n const queryString = Object.keys(params).reduce((qs, paramKey) => {\n // Is the param authorized ?\n const authorizedParam = this.authorizedParameters[endpoint] &&\n this.authorizedParameters[endpoint][paramKey]\n\n // If its value is valid add it to the queryString\n const paramValue = params[paramKey]\n if (authorizedParam && authorizedParam.validate(paramValue)) {\n qs.push(`${authorizedParam.qsKey}=${paramValue}`)\n }\n\n return qs\n }, []).join('&')\n\n // Add `?` at the beginning if necessary\n return queryString.length\n ? `${endpoint}?${queryString}`\n : endpoint\n }", "_appendParamsToUrl (url, params) {\n const sigData = this.calcSignature(params)\n const { signature } = sigData\n let jsonParams = sigData.params\n\n if (url.indexOf('?') === -1) {\n url += `?signature=${signature}`\n } else {\n url += `&signature=${signature}`\n }\n\n jsonParams = encodeURIComponent(jsonParams)\n url += `&params=${jsonParams}`\n\n return url\n }", "function generateURL(searchParams) {\n let searchParamString = \"\";\n for (let key in searchParams) {\n // skip loop if the property is from prototype\n if (!searchParams.hasOwnProperty(key)) continue;\n if (searchParams[key].length === 0) continue;\n searchParamString = searchParamString + key + \"=\" + searchParams[key] + \"&\"\n }\n // remove the last &\n searchParamString = searchParamString.slice(0, -1);\n return (\"https://data.kingcounty.gov/resource/gkhn-e8mn.json?\" + searchParamString);\n }", "_RESTfulFactory(verb, type, method, params) {\n\n this.httpHelper.blockUI.start();\n\n let paramsName = ['post', 'put'].indexOf(verb) > -1 ? 'data' : 'params';\n\n return this.$http[verb](this._getUrl(type, method), {\n [paramsName]: params\n }).then(this.httpHelper.verify, this.httpHelper.error);\n\n }", "uri() {\n return [\n (this.endpoint() || ''),\n (this.exists() ? this.id() : null)\n ]\n .filter(value => !!value)\n .concat([].slice.call(arguments))\n .map(part => { \n Object.entries(this.attributes)\n .forEach(([key, value]) => {\n part = part.toString().replace(new RegExp(`\\:${key}`), value);\n });\n\n return part;\n })\n .join('/');\n }", "function constructParamsForList({uri, endpoint, id}) {\n let params = {}\n let type = getType(endpoint)\n if (type === showType.ftp) {\n params = { credId: endpoint[\"credential\"][\"credId\"], path: id || \"/\"}\n } else if (isOAuth[type]) {\n params = { \"identifier\": id,\n \"credId\": endpoint[\"credential\"][\"credId\"] || endpoint[\"credential\"][\"uuid\"],\n \"path\": encodeURI(uri),\n }\n } else {\n params = {\"credId\": endpoint[\"credential\"][\"credId\"] || endpoint[\"credential\"][\"uuid\"], \"path\": id || \"/\"}\n }\n return { params }\n}", "static makeAPICall(endpoint, input, options = {}) {\n switch (endpoint) {\n case GET_TOKEN:\n if (options.body === undefined) {\n options.body = {};\n }\n options.body.client_id = process.env.REACT_APP_CLIENT_ID;\n return this._fetchFromAPI(this.authUrlBeginning + \"token/\", options);\n case CREATE_USER:\n return this._fetchFromAPI(this.urlBeginning + \"createUser/\", options);\n case VALIDATE_TOKEN:\n return this._addAuthorization(this.urlBeginning + \"validateToken/\");\n case FORGOT_PASSWORD:\n return this._fetchFromAPI(this.urlBeginning + \"password_reset/\", options);\n case RESET_PASSWORD:\n return this._fetchFromAPI(this.urlBeginning + \"password_reset/confirm\", options);\n case UPLOAD_DOCUMENT:\n return this._addAuthorization(this.urlBeginning + \"uploadDoc/\", options);\n case UPLOAD_ANNOTATIONS:\n return this._addAuthorization(this.urlBeginning + \"uploadAnnot/\", options);\n case GET_ALL_ANNOTE_BY_CURRENT_USER:\n return this._addAuthorization(this.urlBeginning + \"getAllMyAnnots/\" + (input == null ? \"\" : input));\n case GET_ALL_ANNOTE:\n return this._addAuthorization(this.urlBeginning + \"getAllAnnots/\" + (input == null ? \"\" : input));\n case GET_ANNOTATIONS_FILENAME_USER:\n return this._addAuthorization(this.urlBeginning + \"getAnnotationsByFilenameUser/\" + input + this.json);\n case EXPORT_CURRENT_ANNOTATIONS:\n return this._addAuthorization(this.urlBeginning + \"exportAnnotations/\" + input + this.json);\n case DOWNLOAD_ANNOTATIONS_BY_ID:\n return this._addAuthorization(this.urlBeginning + \"downloadAnnotations/\" + input + this.json);\n\n // ICD APIs\n case ANCESTORS:\n return this._addAuthorization(this.urlBeginning + \"ancestors/\" + input + this.json);\n case FAMILY:\n return this._addAuthorization(this.urlBeginning + \"family/\" + input + this.json);\n case CODE_AUTO_SUGGESTIONS:\n return this._addAuthorization(this.urlBeginning + \"codeAutosuggestions/\" + input + this.json);\n case CODE_DESCRIPTION:\n return this._addAuthorization(this.urlBeginning + \"codeDescription/\" + input + this.json);\n default:\n return null;\n }\n }", "make(module, action = \"\", id, params = {}) {\n var url = module;\n if (action !== \"\") {\n url += '-' + action;\n if (typeof (id) !== 'undefined' && id !== null) {\n url += '-' + id;\n }\n }\n var first = true;\n for (var i in params) {\n if (first) {\n url += \"?\";\n first = false;\n }\n else {\n url += \"&\";\n }\n url += i + \"=\" + params[i];\n }\n return url;\n }", "function setApiUrl(entity, action) {\n switch(entity) {\n case \"track\":\n switch(action){\n case \"getAll\":\n return \"../api/track/getAll.php\";\n case 'getById':\n return \"../api/track/getById.php\";\n case 'search':\n return \"../api/track/search.php\";\n }\n break;\n case \"album\":\n switch(action){\n case \"getAll\":\n return \"../api/album/getAll.php\";\n case 'getById':\n return \"../api/album/getById.php\";\n case 'search':\n return \"../api/album/search.php\";\n }\n break;\n case \"artist\":\n switch(action){\n case \"getAll\":\n return \"../api/artist/getAll.php\";\n case 'getById':\n return \"../api/artist/getById.php\";\n case 'search':\n return \"../api/artist/search.php\";\n }\n break;\n case \"profile\":\n switch(action){\n case \"getProfile\":\n return \"../api/profile/get-profile.php\";\n case \"editProfile\":\n return \"../api/profile/edit-profile.php\";\n case \"changePassword\":\n return \"../api/profile/edit-password.php\";\n }\n break;\n case \"purchase\":\n switch(action){\n case \"createInvoice\":\n return \"../api/purchase/create-invoice.php\";\n }\n break;\n case \"user\":\n switch(action){\n case \"create\":\n return \"../api/user/create.php\";\n case \"validate\":\n return \"../api/user/validate.php\";\n case \"sign-out\":\n return \"../api/user/sign-out.php\";\n }\n break;\n }\n}", "function buildURL(BaseURL, cityID, dateFrom, dateTo, airQualityParametersObj ) {\n parameterKeys = Object.keys(airQualityParametersObj);\n // creates a collection of all selected parameters (so2, CO2 etc)\n let parameters = parameterKeys.filter(param => {\n if(airQualityParametersObj[param] === true) {\n return param;\n }\n })\n let semiBuiltURL = `${BaseURL}city=${cityID}`;\n let allParametersString = parameters.map(elem => `&parameter=${elem}`).join('');\n if (dateTo) {\n var completeURL = semiBuiltURL+ allParametersString +`&date_from=${dateFrom}&date_to=${dateTo}`;\n } else {\n\n var completeURL = semiBuiltURL+ allParametersString +`&date_from=${dateFrom}`;\n }\n console.log(completeURL);\n return completeURL;\n}", "function generateApiUri(id, secret, params) {\n var baseUri = \"https://api.foursquare.com/v2/venues/search\";\n var reqUri = `${baseUri}?client_id=${id}&client_secret=${secret}&v=20151001`;\n for (var key in params) {\n if (params.hasOwnProperty(key))\n reqUri += `&${key}=${encodeURIComponent(params[key])}`;\n }\n\n return reqUri;\n}", "createShortenedListURL(params) {\n return ApiService.post('/link', { url: params.url });\n }", "url(...args) {\n return getMethodUrl(this.name, this.host, this.route, args);\n }", "function buildRequestUrl(action, params) {\n params[\"Action\"] = action;\n params[\"Timestamp\"] = AwsUtil.dateTimeFormat();\n params[\"AWSAccessKeyId\"] = aws_access_key;\n params[\"Version\"] = sdb_version;\n params[\"SignatureVersion\"] = 1;\n params[\"Signature\"] = AwsUtil.generateSignature(params, aws_secret_key); \n var encoded_params = [];\n for(var key in params) {\n encoded_params.push(key + \"=\" + encodeURIComponent(params[key]));\n }\n var req_url = sdb_base_url + \"?\" + encoded_params.join(\"&\");\n return req_url;\n }", "function convertSwagger(source){\n var apiInfo = clone(source,false);\n apiInfo.resources = {};\n\n\tif (apiInfo.servers && apiInfo.servers.length) {\n\t\tvar u = url.parse(apiInfo.servers[0].url);\n\t\tapiInfo.host = u.host;\n\t\tapiInfo.basePath = u.path;\n\t\tapiInfo.schemes = [];\n\t\tapiInfo.schemes.push(u.protocol.replace(':',''));\n\t}\n\n for (var p in apiInfo.paths) {\n for (var m in apiInfo.paths[p]) {\n if ('.get.post.put.delete.head.patch.options.trace.'.indexOf(m)>=0) {\n var sMethod = apiInfo.paths[p][m];\n var ioMethod = {};\n ioMethod.httpMethod = m.toUpperCase();\n var sMethodUniqueName = sMethod.operationId ? sMethod.operationId : m+'_'+p.split('/').join('_');\n sMethodUniqueName = sMethodUniqueName.split(' ').join('_'); // TODO {, } and : ?\n ioMethod.name = sMethodUniqueName;\n ioMethod.summary = sMethod.summary;\n ioMethod.description = sMethod.description;\n ioMethod.parameters = {};\n var sParams = sMethod.parameters ? sMethod.parameters : [];\n if (apiInfo.paths[p].parameters) {\n sParams = sParams.concat(apiInfo.paths[p].parameters);\n }\n for (var p2 in sParams) {\n var param = sParams[p2];\n var ptr = param[\"$ref\"];\n if (ptr && ptr.startsWith('#/parameters/')) {\n ptr = ptr.replace('#/parameters/','');\n param = clone(apiInfo.parameters[ptr],false);\n }\n if (ptr && ptr.startsWith('#/components/parameters/')) {\n ptr = ptr.replace('#/components/parameters/','');\n param = clone(apiInfo.components.parameters[ptr],false);\n }\n param.location = param[\"in\"];\n delete param[\"in\"];\n\t\t\t\t\tif (!param.type && param.schema && param.schema.type) {\n\t\t\t\t\t\tparam.type = param.schema.type;\n\t\t\t\t\t}\n ioMethod.parameters[param.name] = param;\n }\n ioMethod.path = p;\n ioMethod.responses = sMethod.responses;\n var tagName = 'Default';\n if (sMethod.tags && sMethod.tags.length>0) {\n tagName = sMethod.tags[0];\n }\n if (!apiInfo.resources[tagName]) {\n apiInfo.resources[tagName] = {};\n if (apiInfo.tags) {\n for (var t in apiInfo.tags) {\n var tag = apiInfo.tags[t];\n if (tag.name == tagName) {\n apiInfo.resources[tagName].description = tag.description;\n apiInfo.resources[tagName].externalDocs = tag.externalDocs;\n }\n }\n }\n }\n if (!apiInfo.resources[tagName].methods) apiInfo.resources[tagName].methods = {};\n apiInfo.resources[tagName].methods[sMethodUniqueName] = ioMethod;\n }\n }\n }\n delete apiInfo.paths; // to keep size down\n if (apiInfo.definitions) rename(apiInfo,'definitions','schemas');\n if (apiInfo.components && apiInfo.components.schemas) rename(apiInfo,'components.schemas','schemas');\n return apiInfo;\n}", "function createUrl(val){\n return `http://localhost:3000/api/${val}`;\n \n}", "function urlCreator(reqBody) {\r\n fromPlace = reqBody.fromPlace;\r\n toPlace = reqBody.toPlace;\r\n startTime = reqBody.startTime;\r\n startDate = reqBody.startDate;\r\n return url = 'http://' + otpHost + '/otp/routers/default/plan?fromPlace=' + fromPlace + '&toPlace=' + toPlace + '&time=' + startTime + '&date=' + startDate + '&mode=TRANSIT,WALK&maxWalkDistance=500&arriveBy=false';\r\n}", "formatUrl(params) {\n if (params.token) {\n return util.format('%s://%s%s.%s/%s/%s', config.gateway.protocol, this.getURLEnvironment(), params.app, config.gateway.hostname, params.path, params.token);\n } else {\n return util.format('%s://%s%s.%s/%s', config.gateway.protocol, this.getURLEnvironment(), params.app, config.gateway.hostname, params.path);\n }\n }", "function createCompleteUri(uri) {\n // Add the passed parameter to the base\n return ApiUrlBase + uri;\n}", "function buildAPIUrl(currency1, currency2) {\n if (arguments.length !== 2) {\n return 'A source and destination currencies need to be provided to build the URL.';\n }\n\n return `https://free.currencyconverterapi.com/api/v5/convert?q=${currency1}_${currency2}&compact=ultra`;\n }", "function buildUrl(params, embedParams) {\n var query = {};\n\n if (params.measures.length > 0) {\n query.measure = _.first(params.measures);\n }\n _.each(['groups', 'series', 'rows', 'columns'], function(axis) {\n if (params[axis].length > 0) {\n query[axis] = params[axis];\n }\n });\n query.filters = _.cloneDeep(params.filters);\n if (_.isArray(params.drilldown)) {\n _.each(params.drilldown, function(item) {\n // When drilldown - replace filters for all drilldown\n // dimensions: they cannot be selected by user, but ensure\n // that there are no any garbage\n query.filters[item.dimension] = [item.filter];\n });\n }\n\n if (params.orderBy.key) {\n query.order = params.orderBy.key + '|' + params.orderBy.direction;\n }\n if ((params.visualizations.length > 0) && !embedParams) {\n query.visualizations = params.visualizations;\n }\n\n var path = '/' + params.packageId;\n if (embedParams) {\n path = '/embed/' + embedParams.visualization + path;\n if (embedParams.base) {\n var base = embedParams.base;\n if (base.substr(0, 1) != '/') {\n base = '/' + base;\n }\n if (base.substr(-1, 1) == '/') {\n base = base.substr(0, base.length - 1);\n }\n path = base + path;\n }\n }\n\n query = encodeUrlValues(query);\n\n if (!!params.lang) {\n query.lang = params.lang;\n }\n if (!!params.theme) {\n query.theme = params.theme;\n }\n\n embedParams = embedParams || {}; // to simplify next lines\n\n return url.format({\n protocol: embedParams.protocol,\n hostname: embedParams.host,\n port: embedParams.port,\n pathname: path,\n search: qs.stringify(query, {\n arrayFormat: 'brackets',\n encode: false\n })\n });\n}", "function dpURI(action, params){\n action = encodeURIComponent(action)\n if(module.exports.settings.debug)console.log(action)\n var uri = \"https://www.donorperfect.net/prod/xmlrequest.asp?action=\" + action;\n if(params !== undefined){\n uri += '&params='; \n var strParams = \"\" \n for(var i = 0; i < params.length; i++){\n switch(typeof params[i]){\n case 'string':\n if(params[i] == \"null\") strParams += encodeURIComponent(params[i]) + \",\";\n else strParams += \"'\" + encodeURIComponent(params[i]) + \"',\"\n break;\n case 'number':\n strParams += encodeURIComponent(params[i]) + \",\";\n break;\n default:\n if(params[i] === null || params[i] === undefined) strParams += \"null,\" // param is null\n else if (params[i] instanceof Date) strParams += \"'\" + encodeURIComponent(moment(params[i]).toISOString()) + \"',\";\n else strParams += \"'\" + encodeURIComponent(params[i].toString()) + \"',\" // try and use toString\n\n }\n }\n strParams = strParams.replace(/(^\\s*,)|(,\\s*$)/g, '');\n uri += strParams\n } \n uri += \"&login=\" + module.exports.credentials.username;\n uri += \"&pass=\" + module.exports.credentials.password;\n if(module.exports.settings.debug) console.log(uri)\n return uri;\n}", "_parse(method, params) {\n if (!params) params = {};\n\n const queryParts = [];\n const pathParts = [];\n\n // ?Part\n const queryPart = method.url.split('?')[1];\n if (queryPart) {\n const queryParams = queryPart.split('&');\n for (let i in queryParams) {\n const name = queryParams[i].split('=')[0];\n (params[name] || params[name] === 0) && queryParts.push(`${name}=${encodeURIComponent(params[name])}`);\n }\n }\n\n // /part\n const pathPart = method.url.split('?')[0];\n const pathParams = pathPart.split('/');\n for (let k in pathParams) {\n if (pathParams[k][0] != ':') {\n pathParts.push(pathParams[k]);\n } else {\n const param = params[pathParams[k].substr(1)];\n if (param || param === 0) {\n pathParts.push(param);\n } else {\n // check for missing required params\n if (method.optional && method.optional.indexOf(pathParams[k].substr(1)) === -1) throw Error(`Missing mandatory parameter: ${pathParams[k].substr(1)}`);\n }\n }\n }\n\n // Filters\n const filters = ['query', 'years', 'genres', 'languages', 'countries', 'runtimes', 'ratings', 'certifications', 'networks', 'status'];\n for (let p in params) {\n filters.indexOf(p) !== -1 && queryParts.indexOf(`${p}=${encodeURIComponent(params[p])}`) === -1 && queryParts.push(`${p}=${encodeURIComponent(params[p])}`);\n }\n\n // Pagination\n if (method.opts['pagination']) {\n params['page'] && queryParts.push(`page=${params['page']}`);\n params['limit'] && queryParts.push(`limit=${params['limit']}`);\n }\n\n // Extended\n if (method.opts['extended'] && params['extended']) { \n queryParts.push(`extended=${params['extended']}`);\n }\n\n return [\n this._settings.endpoint,\n pathParts.join('/'),\n queryParts.length ? `?${queryParts.join('&')}` : ''\n ].join('');\n }", "function urlFor(endpoint, values, external) {\n var url = null,\n params = [],\n maxMatchDegree = 0.0,\n keys;\n\n if ($.type(values) === \"boolean\") {\n external = values\n }\n\n values = ($.type(values) !== 'undefined') ? values : {};\n external = ($.type(external) !== 'undefined') ? external : false;\n\n if (g.rules[endpoint] === undefined) {\n throw new Error(\"Uncorrect endpoint in \" + \"urlFor(\\\"\" + endpoint + \"\\\", \" +\n JSON.stringify(values) + \")\");\n }\n\n keys = $.map(values, function (value, key) {\n return key;\n });\n\n // Find the first matched rule among rules in this endpoint.\n $.each(g.rules[endpoint], function (index, rule) {\n var match = true,\n currentMatchDegree = 0.0;\n\n $.each(rule.params, function (index, param) {\n if ($.inArray(param, keys) === -1) {\n match = false;\n return false;\n }\n });\n\n if (match) {\n currentMatchDegree = parseFloat(rule.params.length) / keys.length;\n if (currentMatchDegree > maxMatchDegree || url === null) {\n maxMatchDegree = currentMatchDegree;\n url = rule.rule;\n params = rule.params;\n }\n }\n });\n\n if (url) {\n $.each(keys, function (index, key) {\n // Built-in params\n if ($.inArray(key, params) > -1) {\n url = url.replace(new RegExp(\"<[^:]*:?\" + key + \">\"), values[key]);\n } else {\n // Query string params\n if (url.indexOf(\"?\") === -1) {\n url += \"?\";\n }\n if (!endsWith(url, '?')) {\n url += \"&\";\n }\n url += key + \"=\" + values[key];\n }\n });\n } else {\n throw new Error(\"Uncorrect parameters in \" + \"urlFor(\\\"\" + endpoint + \"\\\", \" +\n JSON.stringify(values) + \")\");\n }\n\n if (external) {\n url = g.domain + url\n }\n\n return url;\n }", "genPathByServiceAndActionName(configObj, serviceName, actionName) {\n\t\treturn `${configObj.versionEndpoint}.${serviceName}.${actionName}`;\n\t}", "function get_uri(name, title, operation, fields, category_item, insertedId, show_all) {\n \n var uri;\n if (insertedId == null) {\n uri = 'http://localhost:9000/erp/' + category_item;\n }\n else if (show_all) {\n uri = 'http://localhost:9000/erp/' + category_item;\n }\n else {\n \n uri = 'http://localhost:9000/erp/' + category_item + '/' + insertedId;\n }\n \n var return_uri = {\n \"name\": name,\n \"title\": title,\n \"method\": operation,\n \"href\": uri,\n \"type\": \"application/x-www-form-urlencoded\",\n \"fields\": fields\n };\n \n return return_uri;\n\t\n}", "function createCallParams(departments, campuses, expertise, employeeTypes, titles, size, page) {\n var filters = '';\n\n // Add departments.\n filters = filters + \"?dept_ids=\" + departments.join(',');\n // Add campuses\n if (campuses.length > 0) {\n filters = filters + \"&campuses=\" + campuses.join(',');\n }\n // Add expertise\n if (expertise.length > 0) {\n filters = filters + \"&expertise_areas=\" + expertise.map((value) => encodeURIComponent(value)).join(',');\n }\n // Add employee types\n if (employeeTypes.length > 0) {\n filters = filters + \"&employee_types=\" + employeeTypes.map((value) => encodeURIComponent(value)).join(',');\n }\n // Add titles\n if (titles.length > 0) {\n filters = filters + \"&title=\" + titles.join(',');\n }\n\n if (size > 0) {\n filters = filters + \"&size=\" + size;\n }\n if (page > 0) {\n filters = filters + \"&page=\" + page;\n }\n\n return filters + \"&sort-by=last_name_asc\";\n}", "function buildSpecUrl() {\n let {protocol, host} = window.location\n let url = window.PRELOAD.swagger_url || '/docs?format=openapi'\n return `${protocol}//${host}${url}`\n}", "function makeUrl() {\n\tconst encoding = (\"{\\\"b\\\": \" +\n\t birth.join(\"\") + \", \\\"s\\\":\" + survival.join(\"\") +\n\t\t\t \", \\\"d\\\": \\\"\" + encodeData() + \"\\\"}\");\n\tvar xhr = new XMLHttpRequest();\n\txhr.addEventListener(\"load\", makeListener);\n\txhr.open(\"POST\",\n\t\t \"https://w6reayr37i.execute-api.us-east-1.amazonaws.com/test\",\n\t\t true);\n\txhr.setRequestHeader('Content-Type', 'application/json');\n\txhr.overrideMimeType( \"application/json; charset=x-user-defined\" );\n\txhr.send(JSON.stringify(new String (encoding)));\n }", "function buildUrl(searchTerm){\n return {\n s: searchTerm,\n r: \"json\"\n }\n }", "function urlMaker() {\n url_string = \"\"\n\n // adding the first character\n url_string = url_string.concat(\"?\")\n\n // concatinating the filternames\n configSet.filters.forEach(element => {\n url_string = url_string.concat('filter_name_list=', element, '&')\n })\n\n // concatinating the thresholds\n configSet.confidence_thresholds.forEach(element => {\n url_string = url_string.concat('confidence_threshold_list=', element, '&')\n })\n\n // concatinating the column name\n url_string = url_string.concat('column_name=', configSet.col_name, '&')\n\n // concatinating the CSV URL/Path\n url_string = url_string.concat('csv_url=', encodeURIComponent(configSet.csv_url))\n\n // remove the extra & sign in the loop\n // url_string = url_string.slice(0, -1)\n return url_string\n}", "function makeurl()\r\n\t{\r\n\t\tvar url = class_baseUrl + \"?func=ll&objAction=page&objID=\" + virtual_containerId + \"&page=\" + currentPageNum + \"&sort=\" + class_sortColumn;\r\n\r\n\t\t// add on the optional pieces\r\n\t\tif ( containerSubType !== \"\" ) \r\n\t\t{\r\n\t\t\turl += \"&objType=\" + containerSubType;\r\n\t\t}\r\n\t\tif ( filterValue !== \"\" )\r\n\t\t{\r\n\t\t\turl += \"&filterValue=\" + encodeURIComponent( filterValue );\r\n\t\t}\r\n\r\n\t\tif ( objFilter !== \"\" )\r\n\t\t{\r\n\t\t\turl += \"&objFilter=\" + objFilter;\r\n\t\t}\r\n\t\t\r\n\t\tif ( currentTab !== \"\" )\r\n\t\t\t\t{\r\n\t\t\t\t\turl += \"&tab=\" + encodeURIComponent( currentTab );\r\n\t\t}\r\n\t\t\r\n\t\tfor ( var key in contentFilter ) \r\n\t\t{\r\n\t\t\tfor ( var i = 0; i < contentFilter[ key ].length; i ++ ) \r\n\t\t\t{\r\n\t\t\t\turl += \"&\" + key + \"=\" + encodeURIComponent( contentFilter[ key ][ i ] );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn url;\r\n\t}", "function _buildApiUrl (datasetname, coursekey) {\n\t\tlet url = API_BASE;\n\t\turl += '?key=' + API_KEY;\n\t\turl += datasetname && datasetname !== null ? '&dataset=' + datasetname : '';\n\t\turl += coursekey && coursekey !== null ? '&coursekey=' + coursekey : '';\n\t\t//console.log('buildApiUrl: url=' + url);\n\t\t\n\t\treturn url;\n\t}", "function routeUrl(name, params = {}) {\n let url;\n const queryParams = { ...params };\n\n switch (name) {\n case 'annotation':\n {\n const id = params.id;\n // @ts-ignore - TS doesn't know what properties `queryParams` has.\n delete queryParams.id;\n url = `/a/${id}`;\n }\n break;\n case 'stream':\n url = '/stream';\n break;\n default:\n throw new Error(`Cannot generate URL for route \"${name}\"`);\n }\n\n const query = queryString.stringify(queryParams);\n if (query.length > 0) {\n url += '?' + query;\n }\n\n return url;\n }", "function generateOAPIParameters() {\n\n return [\n {\n \"name\": \"id\",\n \"in\": \"path\",\n \"description\": \"ID of the requested object in the database.\",\n \"required\": true,\n \"schema\": {\n \"type\": \"integer\",\n \"format\": \"int32\"\n },\n \"style\": \"simple\"\n }\n ];\n\n}", "function _buildApiUrl (datasetname, configkey) {\n\t\tlet url = API_BASE;\n\t\turl += '?key=' + API_KEY;\n\t\turl += datasetname && datasetname !== null ? '&dataset=' + datasetname : '';\n\t\turl += configkey && configkey !== null ? '&configkey=' + configkey : '';\n\t\t//console.log('buildApiUrl: url=' + url);\n\t\t\n\t\treturn url;\n\t}", "buildURL(modelName, id, snapshot, requestType) {\n if (requestType === 'createRecord') {\n return `${this.get('host')}/${this.get('namespace')}/users/${id}`;\n }\n return this._super(...arguments);\n }", "function getUrl(operation, collection, options) {\n var retObj = {};\n retObj['type'] = getVerb(operation);\n if (operation === \"delete\" || operation === \"update\") {\n retObj['url'] = self.serviceURL + \"/\" + collection.id;\n retObj['data'] = JSON.stringify({\"DepartmentId\":collection.id,\n \"DepartmentName\":collection.attributes.DepartmentName});\n } else if (operation === \"create\"){\n retObj['url'] = self.serviceURL;\n retObj['data'] = JSON.stringify({\"DepartmentId\":collection.id,\n \"DepartmentName\":collection.attributes.DepartmentName});\n }\n else {\n retObj['url'] = self.serviceURL;\n }\n retObj['headers'] = {};\n //retObj['headers']['testopt'] = 'value';\n return retObj;\n }", "function getAPIEndpoint(endpoint, city) {\r\n var service = config.openweather.host + config.openweather[endpoint];\r\n var qs = $httpParamSerializer({\r\n appid: config.openweather.appid,\r\n units: config.openweather.units,\r\n q: city\r\n });\r\n\r\n return service + '?' + qs;\r\n }", "function restApi(action, moreParams) {\n return boxApi.url + \"rest?action=\" + action + \"&api_key=\" + boxApi.apiKey\n + \"&auth_token=\" + boxApi.authToken + \"&\" + (moreParams || \"\");\n }", "function constructFlurryAllAppsInfoEndpoint(){\n url_app_metric_specific = 'getAllApplications';\n url_new_Flurry = base_url_Flurry + 'appInfo/' + url_app_metric_specific + '/?apiAccessCode=' + apiAccessCode;\n return url_new_Flurry;\n}", "function buildPetUrl(obj){\n\n var urlBuild = 'https://api.petfinder.com/pet.find?key=e1bf9c7e6dcb9f122154bef369c419db&output=full&format=json&count=100'\n console.log(\"buildPetUrl\");\n console.log(obj);\n var str = \"\";\n if (obj.animal) {\n str = obj.animal.replace(/_/gi,\"%20\");\n urlBuild = urlBuild + '&animal='+str;\n }\n else if (obj.breed){\n str = obj.breed.replace(/_/gi,\"%20\");\n urlBuild = urlBuild + '&breed=' + str;\n }\n if (obj.size){\n urlBuild = urlBuild + '&size='+ obj.size;\n }\n \n urlBuild = urlBuild +'&location='+obj.zipCode;\n return urlBuild;\n}//end buildPetUrl", "function finalizeRequest(endpoint, data) {\n\n // No need to do anything if the URL is static (no parameters)\n if (!endpoint.parameters) {\n return { url: endpoint.url, payload: data };\n }\n\n // Swap all the parameter placeholders with the arguments.\n let url = endpoint.url;\n for (let index = 0; index < Object.keys(endpoint.parameters).length; index++) {\n if (data[endpoint.parameters[index]] === null || data[endpoint.parameters[index]] === undefined) {\n throw new Error(\"URL Path parameter missing\");\n }\n\n url = url.replace(`{${index}}`, data[endpoint.parameters[index]]);\n delete data[endpoint.parameters[index]];\n }\n\n return { url, payload: data };\n}", "__buildActionCodeUri(action)\n {\n var $this = this;\n var uri = action.uri;\n\n if (!action.args) {\n return uri;\n }\n\n // Traduzir params names\n Arr.each(action.args, (arg_name, arg_info) => {\n if ((arg_info != null) && (arg_info.type && (arg_info.type == 'param'))) {\n uri = Str.replaceAll('{' + arg_name + '}', $this.defs.strVar(arg_name), uri);\n }\n });\n\n return uri;\n }", "function e2URL (url) {\n this.url = url;\n this._parse_param_string =\n function(url)\n {\n if(url === undefined)\n {\n return \"\";\n }\n\n var get_params_start = url.indexOf(\"?\");\n if(get_params_start == -1)\n {\n return \"\";\n }else{\n return [url.slice(0,get_params_start),url.slice(get_params_start+1)];\n }\n };\n\n this._make_param_array = function(param_string)\n {\n var param_hash = {};\n if(param_string === undefined || param_string == \"\")\n {\n return param_hash;\n }\n\n var param_chunks = param_string.split(\"&\");\n for (var i = 0; i < param_chunks.length; i++)\n {\n var this_param = param_chunks[i].split(\"=\");\n param_hash[decodeURIComponent(this_param[0])] = decodeURIComponent(this_param[1]);\n }\n\n return param_hash;\n };\n var _parse_param_string_output = this._parse_param_string(this.url);\n this.url_head = _parse_param_string_output[0];\n this.param_string = _parse_param_string_output[1];\n this.params = this._make_param_array(this.param_string);\n\n this.make_url = function(){\n var _new_encoded_params = [];\n var _param_keys = Object.keys(this.params);\n if(_param_keys.length == 0)\n {\n return this.url_head;\n }\n for(var i = 0; i < _param_keys.length; i++)\n {\n _new_encoded_params.push(encodeURIComponent(_param_keys[i])+\"=\"+encodeURIComponent(this.params[_param_keys[i]]));\n }\n return this.url_head + \"?\" + _new_encoded_params.join(\"&\");\n }\n }", "getAPIResource(opts){\n let { type, uri, id } = opts;\n if( type === 'pathways' ){\n if( uri !== null ){\n return this.getPathway( uri );\n } else {\n throw new Error('Invalid parameter. Pathways api calls require a uri parameter');\n }\n }\n if( type === 'factoids' ){\n if( id !== null ){\n return this.getFactoid(opts.id);\n } else {\n throw new Error('Invalid paramter. Factoids api calls require a id parameter');\n }\n }\n }", "function buildPath (basePath, queryParams) {\n basePath = basePath.concat('?')\n var url = basePath.concat(queryString.stringify(queryParams))\n return url\n }", "function route(...etc)\n{\n etc.unshift(stockAPI);\n let sOut = etc.reduce((acc, curr)=>acc+=curr+'/');\n return sOut;\n}", "function buildAjaxUrl(options){\n var url = bundle.kappLocation() + \"?partial=\" +options.jsonFileName;\n if(options.type === 'Approval'){\n url += '&values[Assigned Individual]='+bundle.identity();\n }else{\n url += '&createdBy='+bundle.identity()+'&requestedFor='+bundle.identity();\n }\n if(options.coreState !== undefined){\n $.each(options.coreState, function(k,v){\n url += '&coreState='+v;\n });\n }\n if(options.excludeTypes !== undefined){\n $.each(options.excludeTypes, function(k,v){\n url += '&excludeTypes='+v;\n });\n }\n if(options.type !== undefined){\n url += '&type='+options.type;\n }\n if(options.backDate !== undefined){\n url += '&date=' + options.backDate;\n }\n if(options.length !== undefined){\n url += '&limit=' + options.length;\n }\n if(options.token && options.token() !== undefined){\n url += '&pageToken='+options.token();\n }\n return url;\n }", "static ROUTE_LIST () {\n const index = {\n endpoint: '/',\n type: 'get'\n }\n const create = {\n endpoint: '/create',\n type: 'get'\n }\n const store = {\n endpoint: '/',\n type: 'post'\n }\n const show = {\n endpoint: '/:id',\n type: 'get'\n }\n const edit = {\n endpoint: '/:id/edit',\n type: 'get'\n }\n const update = {\n endpoint: '/:id',\n type: 'put'\n }\n const destory = {\n endpoint: '/:id',\n type: 'delete'\n }\n return {\n index: { ...index },\n create: { ...create },\n store: { ...store },\n show: { ...show },\n edit: { ...edit },\n update: { ...update },\n destory: { ...destory },\n }\n }", "function buildUrl(lp, ef) {\n \"use strict\";\n var domain = \"https://content.guardianapis.com/\";\n var api_key = \"api-key=8b7ca0fc-3914-4473-9c07-e9b56781ce88\";\n var req_fields = \"&show-fields=thumbnail%2Cbyline%2Cbody\";\n\n if (ef != \"\") {\n ef = ef + \"&\";\n }\n else {\n ef = \"?\";\n }\n\n var url = \"\" + domain + lp + ef + api_key + req_fields;\n return url;\n}", "function createURI(operation, param){\n\n\tvar createUTCDate = function() {\n\t\tvar date = new Date();\n\n\t\tvar year \t= date.getUTCFullYear();\n\t\tvar month \t= ('0' + (date.getUTCMonth() + 1)).slice(-2);\n\t\tvar d \t\t= ('0' + date.getUTCDate()).slice(-2);\n\t\tvar hour \t= ('0' + date.getUTCHours()).slice(-2);\n\t\tvar minutes = ('0' + date.getUTCMinutes()).slice(-2);\n\t\tvar second \t= ('0' + date.getUTCSeconds()).slice(-2);\n\t\tvar milliSecond = ('00' + date.getUTCMilliseconds()).slice(-3);\n\n\t\treturn encodeURIComponent(util.format('%s-%s-%sT%s:%s:%s.%sZ',year, month, d, hour, minutes, second, milliSecond));\n\t}\n\n\tvar createSignature = function(signature) {\n\t\tvar hmac = crypto.createHmac('SHA256', secretKey);\n\t\thmac.update(signature);\n\t\treturn encodeURIComponent(hmac.digest('base64'));\n\t}\n\n\tvar paramArray = [];\n\tfor( var name in param ) {\n\t\tparamArray.push(util.format('%s=%s',name, encodeURIComponent(param[name])));\n\t}\n\tparamArray.push(util.format('Operation=%s',operation));\n\tparamArray.push(util.format('Service=%s','AWSECommerceService'));\n\tparamArray.push(util.format('Timestamp=%s', createUTCDate()));\n\tparamArray.push(util.format('Version=%s','2011-08-02'));\n\tparamArray.push(util.format('AWSAccessKeyId=%s', accessKey));\n\tparamArray.push('AssociateTag=onakaworld001-22');\n\tparamArray.sort();\n\n\tvar getParameter = paramArray.join('&');\n\tvar signature = createSignature(util.format('GET\\n%s\\n/onca/xml\\n%s' ,amazonApiHost ,getParameter));\n\n\treturn util.format('http://%s/onca/xml?%s&Signature=%s' ,amazonApiHost ,getParameter, signature);\n}", "function extendingEndpoints() {\n var segments = Array.prototype.slice.call(arguments, 0);\n return function () {\n var path = '';\n segments.forEach(function (pathSegment) {\n path = path + pathSegment;\n createEndpointFromPath(path);\n console.log(' registered path %s', path);\n });\n }\n}", "function createSearchURL() {\n //Filter search\n let search = \"\";\n let ingreds = resultSearch.ingredients;\n if (ingreds.length > 0) {\n search = \"&q=\";\n for (let i = 0; i < ingreds.length; i++) {\n if (i === 0) {\n search = search + ingreds[i];\n } else {\n search = search + \"+\" + ingreds[i];\n }\n }\n }\n\n // Get allergy data\n let allergySearch = \"\";\n let allergies = resultSearch.allergy; \n for (let i = 0; i < allergies.length; i++) {\n for (let j = 0; j < metaData.allergy.length; j++) {\n if (allergies[i] === metaData.allergy[j].shortDescription) {\n allergySearch = allergySearch + \"&allowedAllergy[]=\" + metaData.allergy[j].id + \"^\" + allergies[i];\n }\n }\n }\n \n // Get diet data\n let restriction = \"\";\n let restrictResults = urlParams.get(\"diet\");\n\n if (restrictResults && restrictResults !== \"\") {\n for (let i = 0; i < metaData.diet.length; i++) {\n if (metaData.diet[i].shortDescription === restrictResults) {\n restriction = \"&allowedDiet[]=\" + metaData.diet[i].id + \"^\" + restrictResults;\n }\n }\n }\n\n let endpoint = API_RECIPE_URL + search + allergySearch + restriction + \"&maxResult=1000&maxTotalTimeInSeconds=1800\";\n return endpoint;\n}", "function Resource(url, params, actions, options$$1) {\n var self = this || {},\n resource = {};\n actions = assign({}, Resource.actions, actions);\n each(actions, function (action, name) {\n action = merge({\n url: url,\n params: assign({}, params)\n }, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\t\n\t var self = this || {}, resource = {};\n\t\n\t actions = assign({},\n\t Resource.actions,\n\t actions\n\t );\n\t\n\t each(actions, function (action, name) {\n\t\n\t action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\t\n\t resource[name] = function () {\n\t return (self.$http || Http)(opts(action, arguments));\n\t };\n\t });\n\t\n\t return resource;\n\t}", "function Resource(url, params, actions, options$$1) {\n\t\n\t var self = this || {}, resource = {};\n\t\n\t actions = assign({},\n\t Resource.actions,\n\t actions\n\t );\n\t\n\t each(actions, function (action, name) {\n\t\n\t action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\t\n\t resource[name] = function () {\n\t return (self.$http || Http)(opts(action, arguments));\n\t };\n\t });\n\t\n\t return resource;\n\t}", "function createEndpointQS() {\n const qs = {};\n\n const ref = getReferrerUrl();\n if (ref) {\n qs.RefererUrl = encodeURIComponent(ref);\n }\n\n const can = getCanonicalUrl();\n if (can) {\n qs.CanonicalUrl = encodeURIComponent(can);\n }\n\n return qs;\n }", "debugEndpointProvider() {\n console.log(this.epProvider.getEndPointByName('allData'));\n console.log(this.epProvider.buildEndPointWithQueryStringFromObject({\n limit: 10,\n sort: 'title',\n page: 1,\n filter: 'marketing-automation,ad-network',\n direction: 1,\n }, '/fetch-all'));\n }", "function Resource(url, params, actions, options$$1) {\n\t var self = this || {},\n\t resource = {};\n\t actions = assign({}, Resource.actions, actions);\n\t each(actions, function (action, name) {\n\t action = merge({\n\t url: url,\n\t params: assign({}, params)\n\t }, options$$1, action);\n\n\t resource[name] = function () {\n\t return (self.$http || Http)(opts(action, arguments));\n\t };\n\t });\n\t return resource;\n\t}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}" ]
[ "0.7027609", "0.6566117", "0.6475729", "0.62919766", "0.624349", "0.6200663", "0.61838025", "0.61216277", "0.6112147", "0.6102012", "0.59820294", "0.59775764", "0.59043086", "0.58766294", "0.5876306", "0.5810037", "0.5760384", "0.57168984", "0.56911576", "0.5652379", "0.561075", "0.56016177", "0.5599883", "0.55730253", "0.5568684", "0.55496925", "0.5542561", "0.5541007", "0.55329055", "0.5525571", "0.5510376", "0.54792625", "0.5468601", "0.54512256", "0.5441409", "0.54358596", "0.54287076", "0.539757", "0.5397331", "0.539328", "0.53871936", "0.5383866", "0.5373964", "0.53640866", "0.5363774", "0.5362189", "0.5338289", "0.53272414", "0.53250706", "0.52812904", "0.52760935", "0.5274859", "0.5250745", "0.5238199", "0.5236665", "0.51989514", "0.5196235", "0.5185822", "0.5181172", "0.51742893", "0.51665545", "0.5165917", "0.5156042", "0.5156019", "0.51495343", "0.5146432", "0.51453584", "0.5142643", "0.5138456", "0.512942", "0.5123977", "0.5119454", "0.51188415", "0.50954914", "0.50925016", "0.50899506", "0.50824654", "0.50805885", "0.5073543", "0.5070283", "0.5069111", "0.5060908", "0.5054521", "0.50513965", "0.5051382", "0.50402945", "0.5004958", "0.50046146", "0.50046146", "0.50009894", "0.5000391", "0.49985692", "0.49779612", "0.49779612", "0.49779612", "0.49779612", "0.49779612", "0.49779612", "0.49779612", "0.49779612" ]
0.7601602
0
Now, transform the dispatch props (Request) into methods on the nion.action prop
function mergeProps(stateProps, dispatchProps, ownProps) { const nextProps = { ...stateProps, ...ownProps }; mapDeclaratives((declaration, key) => { const data = get(stateProps.nion, key); const ref = data ? { id: data.id, type: data.type } : null; // Add each method's corresponding request handler to the nextProps[key].request // object const methods = ['GET', 'PATCH', 'POST']; methods.forEach(method => { const dispatchFn = dispatchProps[key][method]; set(nextProps.nion, [key, 'actions', method.toLowerCase()], dispatchFn); }); // Handle deletion, where we're passing in the ref attached to the dataKey to be deleted const deleteDispatchFn = dispatchProps[key].DELETE; const deleteFn = (props) => deleteDispatchFn(ref, props); set(nextProps.nion, [key, 'actions', 'delete'], deleteFn); // Handle the special NEXT submethod, for paginated declarations if (dispatchProps[key].NEXT) { const { nion } = stateProps; const next = get(nion, [key, 'links', 'next']); const dispatchFn = dispatchProps[key].NEXT; if (next) { const nextFn = () => dispatchFn({ next }); set(nextProps.nion, [key, 'actions', 'next'], nextFn); } } if (dispatchProps[key].initializeDataKey) { const fn = dispatchProps[key].initializeDataKey; set(nextProps.nion, [key, 'actions', '_initializeDataKey'], fn); } }); // Pass along the global nion action creators nextProps.nion.updateEntity = dispatchProps.updateEntity; return nextProps; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function actionsToMethods(actions, dispatch){\n const methods = Object.keys(actions).reduce((allMethods, type) => {\n\n allMethods[type] = (payload) => dispatch({\n type,\n payload\n });\n\n return allMethods;\n }, {});\n\n return methods;\n}", "function actionsFromDispatch(dispatch) {\n\treturn {\n\t\tingestData(data, numericColumns, ordinalColumns) {\n\t\t\tdispatch({\n\t\t\t\ttype: 'INGEST_DATA',\n\t\t\t\tdata,\n\t\t\t\tnumericColumns,\n\t\t\t\tordinalColumns,\n\t\t\t});\n\t\t},\n\t\tsetX(column) {\n\t\t\tdispatch({\n\t\t\t\ttype: 'SET_X',\n\t\t\t\tcolumn\n\t\t\t});\n\t\t},\n\t\tsetY(column) {\n\t\t\tdispatch({\n\t\t\t\ttype: 'SET_Y',\n\t\t\t\tcolumn\n\t\t\t});\n\t\t},\n\t\tsetColor(column) {\n\t\t\tdispatch({\n\t\t\t\ttype: 'SET_COLOR',\n\t\t\t\tcolumn\n\t\t\t});\n\t\t},\n\t\tsetRadius(column) {\n\t\t\tdispatch({\n\t\t\t\ttype: 'SET_RADIUS',\n\t\t\t\tcolumn\n\t\t\t});\n\t\t},\n\t};\n}", "function mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n participantGetRequest,\n participantsGetRequestBySearch,\n inscriptionParticipantGetRequest,\n inscriptionParticipantsGetRequestByInscription,\n inscriptionUpdateRequest,\n inscriptionGetRequest\n }, dispatch)\n };\n }", "function mapActionToProps(dispatch) { return bindActionCreators({ GetActivityAction }, dispatch); }", "dispatch() {\r\n }", "function remotePostAction(name, url, path='') {\n var requestAction = `${name.toUpperCase()}_REQUEST`;\n var successAction = `${name.toUpperCase()}_SUCCESS`;\n var failureAction = `${name.toUpperCase()}_FAILURE`;\n\n var requestStart = () => {\n return {\n type: requestAction\n }\n };\n\n var requestSuccess = (entity, res) => {\n return {\n type: successAction,\n payload: entity,\n location: res.headers['location']\n }\n };\n\n var requestFailed = () => {\n return {\n type: failureAction\n }\n };\n\n return (entity, path='') => {\n return (dispatch) => {\n dispatch(requestStart());\n console.log('call ' + url + path);\n request\n .post(url + path)\n .withCredentials()\n .type('form')\n .send(entity)\n .end((err, res) => {\n if (res.statusType == 2 || res.statusType == 3 ) {\n console.log(res);\n dispatch(requestSuccess(entity, res));\n } else {\n dispatch(requestFailed());\n }\n });\n }\n };\n}", "updateDispatchers() {\n const { onSuccess, onError, onRequest } = this.options;\n\n const {\n invalidateResource,\n prepopulateResource,\n dispatchRequest\n } = bindActionCreators(actions, this.store.dispatch);\n\n // TODO no need to update these two\n this.invalidateResource = invalidateResource;\n this.prepopulateResource = prepopulateResource;\n\n // wrapping in a function returning a normal promise\n this.dispatchRequest = (definition) => {\n const promise = new Promise((resolve, reject) => {\n dispatchRequest(definition, {\n onSuccess: extendFunction(onSuccess, resolve),\n onError: extendFunction(onError, reject)\n });\n });\n onRequest && onRequest(promise);\n return promise;\n };\n }", "_onDispatch(action) {\n // In the pursuit of immutability of data, we want to create a new state without mutating the old state\n // So we can grab the current state and \"reduce\" it, using the current state and the provided action\n const newState = this.reduce(this._state, action);\n // Check if the action dispatched described and resulted in any changes \n if(newState !== this._state) {\n // If it did, we want to preserve a copy of the state in history\n this._history.push(this._state);\n // Then update the value of the state\n this._state = newState;\n // Then we emit the changes to notify any listeners \"automatically\" that the state has been updated\n this._emitChange();\n // Otherwise there's nothing to do\n }\n }", "__onDispatch (action) {\n switch(action.type) {\n\n case ADD_TODO:\n this.addTodo(action.id, action.text);\n this.__emitChange();\n break;\n\n case REMOVE_TODO:\n this.removeTodo(action.id);\n this.__emitChange();\n break;\n\n case TOGGLE_TODO:\n this.toggleTodo(action.id);\n this.__emitChange();\n break;\n }\n }", "function mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n // signUpRequest\n catalogsAddRequest,\n catalogsUpdateRequest,\n categoriesGetRequest\n }, dispatch)\n };\n}", "function mapActionToProps(dispatch) { return bindActionCreators({ GoProductAction }, dispatch); }", "function dispatch(action) {\n\t\tvar vm = this;\n\t\t// call the mutators one by one\n\t\tmutators.forEach(function (a) {\n\t\t\ta.call(vm, { state: state, dispatch: dispatch }, action);\n\t\t});\n\t}", "function mapActionToProps(dispatch) { return bindActionCreators({ ConfirmProductInfoAction, }, dispatch); }", "function dispatchRequest(request, response)\n{\n try {\n //Dispatch\n dispatcher.dispatch(request, response);\n }\n catch (e) {\n console.log(e);\n }\n}", "handleActions(action){\n\n switch(action.type){\n case \"DISPATCH_SALE\":\n this.dispatchSale(action.id);\n break;\n\n default: break;\n }\n }", "handleServerAction(action: Action): void {\n this.dispatch({\n source: constants.SERVER_ACTION,\n action: action\n });\n }", "static mapDispatch(dispatch) {\n return {\n actions: {\n getListCategory: () => dispatch(CategoryAction.getListCategory())\n }\n }\n }", "handleActions(action) {\n // it is check by a switch and will have a type that id it\n switch(action.type) {\n // call a function\n case 'GET_ALL': {\n this.getAll();\n }\n }\n }", "static mapDispatch(dispatch) {\n return {\n actions: {\n searchProduct: (queryService, searchKey) =>\n dispatch(ProductAction.searchProduct(queryService, searchKey)),\n viewProduct: (product, isShowExternalStock, canBack) =>\n dispatch(ProductAction.viewProduct(product, isShowExternalStock, canBack)),\n addProduct: data => dispatch(QuoteAction.addProduct(data)),\n searchByBarcode: code => dispatch(ProductAction.searchByBarcode(code)),\n resetSyncActionUpdateProduct: () => dispatch(ProductAction.syncActionUpdateProductDataFinish()),\n resetSyncActionUpdateStock: () => dispatch(ProductAction.syncActionUpdateStockDataFinish()),\n resetSyncActionUpdateCatalogRulePrice: () =>\n dispatch(ProductAction.syncActionUpdateCatalogRulePriceDataFinish()),\n resetSyncActionDeletedCatalogRulePrice: () =>\n dispatch(ProductAction.syncActionDeletedCatalogRulePriceDataFinish()),\n }\n }\n }", "function matchDispatchToProps(dispatch) {\n\treturn bindActionCreators({save, getInfo}, dispatch);\n}", "function mapDispatchToProps(dispatch) {\n return {\n actionMethods: {\n EditUser: (e) => {\n e.preventDefault();\n const requestBody = {\n firstName: e.target.firstName.value,\n email: e.target.email.value,\n userId: e.target.userId.value,\n };\n dispatch({ type: 'UPDATE_USER', requestBody });\n },\n updatePassword: (e) => {\n e.preventDefault();\n const requestBody = {\n old: e.target.old.value,\n new: e.target.new.value,\n userId: e.target.userId.value,\n };\n dispatch({ type: 'UPDATE_USER_PASSWORD', requestBody });\n },\n updateRole: (e) => {\n e.preventDefault();\n const requestBody = {\n roles: e.target.role.value,\n userId: e.target.userId.value,\n };\n dispatch({ type: 'UPDATE_USER_ROLE', requestBody });\n },\n clearInfo: () => {\n dispatch({ type: 'CLEAR_INFO' });\n },\n },\n };\n}", "function mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n programLocationByProgramIdGetRequest,\n programGetRequest,\n gradesGetRequest,\n coursesAddRequest,\n coursesUpdateRequest,\n sectionsGetRequest\n }, dispatch)\n };\n}", "_dispatch(msg) {\n var i = msg.post || 0, action = msg.action;\n this.callback = i;\n var callbacks = this.callbacks[i] || [];\n for (var j = 0, m = callbacks.length; j < m; j++) {\n if (callbacks[j].hasOwnProperty(action)) {\n callbacks[j][action].call(this,msg.data);\n break;\n }\n }\n }", "async applyAction(action){\n this._dispatchAction(action) \n }", "dispatch(action, parameters) {\n const callbacks = this.events[action];\n\n if (this.disable) {\n return;\n }\n\n if (!callbacks) {\n throw new Error();\n }\n\n for(var index = 0; index < callbacks.length; index++) {\n callbacks[index].apply(this, [this, parameters]);\n }\n }", "actions(dispatcher, context) {\n return {\n addTodo(newTodo) {\n dispatcher.dispatch(new Action(\"ADD_TODO_LOADING\"))\n dispatcher.dispatch(new Action(\"ADD_TODO_SUCCESS\", {\n newTodo\n }))\n },\n displayTodoDone() {\n dispatcher.dispatch(new Action(\"DISPLAY_TODO_DONE\"))\n\n },\n displayTodoNotDone() {\n dispatcher.dispatch(new Action(\"DISPLAY_TODO_NOT_DONE\"))\n\n },\n displayAllTodos() {\n dispatcher.dispatch(new Action(\"DISPLAY_ALL_TODO\"))\n }\n }\n }", "function dispatch(action) {\n console.log('dispatch('+ action.type + ')');\n\n stores.forEach(s => {\n \ts.onAction(action);\n });\n}", "onDispatch(action) {\n this.dispatchStack.push(action);\n\n if (this.options.dispatch instanceof Function) {\n this.options.dispatch(action);\n }\n }", "function mapDispatchToProps(dispatch) {\n return {\n actionMethods: {\n clearInfo: () => {\n dispatch({ type: 'CLEAR_INFO' });\n },\n getUsers: () => {\n dispatch({ type: 'GET_ALL_USERS' });\n },\n createComment: (e) => {\n e.preventDefault();\n const requestBody = {\n userId: e.target.userId.value,\n repairId: e.target.repairId.value,\n comments: [{ text: e.target.text.value }],\n };\n e.target.text.value = '';\n dispatch({ type: 'ADD_COMMENT', requestBody });\n },\n },\n };\n}", "function onRequest() {\n\n // sets the actually resolved action, as it is also set by notfound\n req.data.action = req.action;\n \n if (req.action != 'notfound') {\n // let soft-coded actions override\n var idempotentAction = req.action +'_'+ req.method.toLowerCase();\n var action = (this.actions[idempotentAction] || this.actions[req.action]);\n \n if (action) {\n action.call(this);\n res.stop();\n }\n }\n}", "function liftAction(action) { // 187\n var liftedAction = { // 188\n type: ActionTypes.PERFORM_ACTION, // 189\n action: action, // 190\n timestamp: Date.now() // 191\n }; // 192\n return liftedAction; // 193\n} // 194", "wrapDispatch(dispatch) {\n this._reduxDispatch = dispatch\n\n return (action) => {\n // apply this action to our scuttlebutt model (and send to peers). It\n // will dispatch, taking care of the the appropriate time ordering\n if (this._isGossipType(action.type)) {\n this.localUpdate(action)\n } else {\n return dispatch(action)\n }\n }\n }", "function handleRequestAction(dispatch, action) {\n switch (action.type) {\n case REQUEST_FETCH:\n return handleFetch(dispatch, action.payload);\n case REQUEST_CREATE:\n return handleCreate(dispatch, action.payload);\n case REQUEST_UPDATE:\n return handleUpdate(dispatch, action.payload);\n case REQUEST_DESTROY:\n return handleDestroy(dispatch, action.payload);\n default:\n }\n}", "handleActions(action){\n switch(action.type){\n case 'ADD_NODE':\n this.addNode(action.data)\n break\n case 'ADD_LINK':\n this.addLink(action.data)\n break\n case 'UPDATE_WEIGHTS':\n this.updateWeights()\n break\n case 'SET_PATH_STATS':\n this.setPathStats(action.newPathStats)\n break\n case 'RESET_PATH_STATS':\n this.resetPathStats()\n break\n case 'ADD_COLORS':\n this.addColors(action.hotLinks)\n break\n case 'ADD_NODE_LOCATION':\n this.addNodeLocation(action.data)\n break\n case 'CLEAR_STATE':\n this.clearState()\n break\n }\n }", "action(params) {\n this.beforeAction();\n this.setParams(params);\n Dispatcher.action(this, params);\n }", "function reduxActionFunctions(dispatch){\n return bindActionCreators({\n set_sampleString : set_sampleString,\n set_is_logged : set_is_logged\n\t\t// si set_sampleString function kay makit an sa actions folder\n },dispatch);\n }", "function reduxActionFunctions(dispatch){\n return bindActionCreators({\n set_sampleString : set_sampleString,\n set_is_logged : set_is_logged\n\t\t// si set_sampleString function kay makit an sa actions folder\n },dispatch);\n }", "function mapDispatchToProps(dispatch) {\n\treturn {\n\t\tactions: bindActionCreators(actions, dispatch) //so we don't have to use this.props.dispatch(actionName())\n\t}\n}", "handleViewAction(action: Action): void {\n this.dispatch({\n source: constants.VIEW_ACTION,\n action: action\n });\n }", "async fromSireneRequestOtherAPIs(dispatch, siret) {\n if (getters.idAssociationFromSirene()) {\n await store.dispatch('executeSearchByIdAssociation', { id: getters.idAssociationFromSirene(), api: 'RNA' })\n } else {\n await store.dispatch('executeSearchBySiret', { siret: siret, api: 'RNA' })\n }\n }", "function mapDispatchToProps(dispatch) {\n const creators = Map()\n .merge(...actions)\n .filter(value => typeof value === 'function')\n .toObject();\n\n // At this point creators is a giant object containing each action name and\n // the function for it.\n return {\n actions: bindActionCreators(creators, dispatch),\n dispatch\n };\n }", "function mapDispatchToProps(dispatch)\n {\n return {\n readUpdate: () => dispatch(readUpdate()),\n successUpdate: (id) => dispatch(failureUpdate(id)),\n failureUpdate: (payload) => dispatch(successUpdate(payload)) \n };\n }", "handleServiceAction(action: Action): void {\n this.dispatch({\n source: constants.SERVICE_ACTION,\n action: action\n });\n }", "function mapDispatchToProps(dispatch) {\n\nreturn bindActionCreators(actionCreators, dispatch);\n}", "_registerToActions(action) { \n switch(action.actionType) {\n case ActionTypes.CLASSES_FETCHED:\n this._setClasses(action.payload);\n break;\n case ActionTypes.CLASS_CREATED:\n ClassActions.fetchClasses();\n break;\n case ActionTypes.CLASS_FETCHED:\n this._setClass(action.payload);\n break;\n case ActionTypes.CLASS_STUDENTS_FETCHED:\n this._setClassStudents(action.payload);\n break;\n case ActionTypes.CLASS_INS_FETCHED:\n this._setClassInstructors(action.payload);\n break;\n case ActionTypes.CLASS_INS_ADDED:\n case ActionTypes.CLASS_INS_REMOVED:\n case ActionTypes.CLASS_STUDENT_ADDED:\n case ActionTypes.CLASS_STUDENT_REMOVED:\n\n setTimeout(() => { // Run after dispatcher has finished\n this.emit(CLASS_CHANGED);\n }, 0);\n break;\n }\n }", "mapDispatchToProps() {\n return {\n logout: () => this.logout(),\n changeField: (name,value) => this.changeField(name,value),\n changeImage: () => this.changeImage(),\n submit: () => this.submit()\n }\n }", "addProduct() {\n var action = {\n type: 'ADD_PRODUCT'\n };\n this.props.dispatch(action);\n }", "dispatchPersonRequest(fName, lName, dob)\n {\n this.props.actions.PersonRequest(fName,lName,dob,this.props.id);\n }", "function mapDispatchToProps(dispatch){\n\treturn bindActionCreators(ActionCreators, dispatch);\n}", "function mapDispatchToProps(dispatch) {\r\n return bindActionCreators( {fetchGif, SearchTerm}, dispatch );\r\n}", "function matchDispatchToProps(dispatch){\n return bindActionCreators({\n }, dispatch);\n}", "function mapDispatchToProps(dispatch) { \n \nreturn bindActionCreators(actionCreators, dispatch);\n}", "function mapDispatchToProps(dispatch) { // whenever <function below> is called result should be passed to all of our\n // reducers\n return bindActionCreators({\n LayoutChange: LayoutChange,\n WeaponChange: WeaponChange,\n FireWeapon: FireWeapon,\n OptionChange: OptionChange\n }, dispatch);\n}", "function getActionTrainDetails(search) {\n console.log(search);\n let data;\n return dispatch => { \n dispatch(request())\n getServiceTrainDetails(search).then(response => {\n if(response.status === 200) {\n data = response.data;\n console.log(response);\n dispatch(success(data));\n }\n })\n .catch(err => { \n console.log(err);\n dispatch(failure()) \n });\n };\n\nfunction request() {\n return { type : constants.API_REQUEST }\n}\n\nfunction success(data) { \n return { type : constants.API_SUCCESS, data }\n}\n\nfunction failure() {\n return { type : constants.API_FAILURE }\n}\n\n}", "function handleNetworkAction(action, dispatch) {\n // First dispatch included objects\n const included = getIncluded(action.payload);\n included.map(item => dispatch(makeObjectAction(action, OBJECT_FETCHED, item)));\n\n const data = getData(action.payload);\n // Find handler for supported action type to make appropriate logic\n actionHandlers[action.type](action, data, dispatch);\n}", "function mapDispachToProps(dispatch) {\n return bindActionCreators(actionCreators, dispatch);\n}", "[actions.TOPOLOGYMGMT_TYPE_REQUEST](state, action) {\n return {\n ...state,\n [action.identify]: {\n ...state[action.identify],\n refreshTopologySuccess: action.refreshTopologySuccess,\n orderBy: action.orderBy\n }\n };\n }", "function dispatchRequest( method, path, query, payload, reply )\n{\n if ( path[1] )\n {\n switch ( path[1] )\n {\n case \"users\":\n handleUserRequest( method, path, query, payload, reply );\n break;\n case \"groups\":\n handleGroupRequest( method, path, query, payload, reply );\n break;\n case \"jobs\":\n handleJobRequest( method, path, query, payload, reply );\n break;\n case \"apps\":\n handleAppRequest( method, path, query, payload, reply );\n break;\n case \"files\":\n handleFileRequest( method, path, query, payload, reply );\n break;\n case \"tags\":\n handleTagRequest( method, path, query, payload, reply );\n break;\n case \"associations\":\n handleAssociationRequest( method, path, query, payload, reply );\n break;\n default:\n throw Err.INVALID_REQUEST;\n }\n }\n else\n {\n if ( method === \"GET\" )\n {\n reply.writeHead(200);\n reply.write('{\"resources\":[\"users\",\"groups\",\"jobs\",\"apps\",\"files\",\"tags\",\"associations\"]}');\n reply.end();\n }\n else throw Err.INVALID_METHOD;\n }\n}", "function mapDispatchToProps(dispatch) {\r\n\r\n return {\r\n actions: bindActionCreators(opportunityAction, dispatch),\r\n proActions: bindActionCreators(estimateActions, dispatch),\r\n poAction: bindActionCreators(poActions, dispatch),\r\n itemaction: bindActionCreators(itemActions, dispatch),\r\n contactactions: bindActionCreators(createContactAction, dispatch)\r\n };\r\n}", "handle (action, fields) {\n return new Promise((resolve, reject) => {\n // First check if handler is implemented\n if (typeof(this[action.type]) === 'function') {\n resolve(() => this[action.type](action, fields))\n } else {\n reject(new Error('Action type not supported'))\n }\n }).then(method => method())\n }", "dispatch(action) {\n return this.dispatcher.dispatch(action);\n }", "componentDidMount(){\n this.props.dispatch({ type: 'GET_EVENT_INFO' })\n this.props.dispatch({ type: 'GET_VIDEOS_ADMIN' })\n this.props.dispatch({ type: 'GET_ENTIRE_GOAL_INFO' })\n }", "function mapDispatchToProps(StoreDispatch){\n console.log('mapDispatchToProps ');\n return{//we are returning object literal { onIncrementClick: value, onDecrementtClick: otherValue };\n //':' assigns a function as a property of an object literal. \n onIncrementClick: () => {\n const action = { type: Actions.INCREMENT_REQUESTED};\n StoreDispatch(action);\n },\n onDecrementtClick: () => {\n const action = { type: Actions.DECREMENT_REQUESTED};\n StoreDispatch(action);\n }\n }\n}", "mapDispatchToProps() {\n return {\n submit: () => this.submit(),\n changeField: (name,value) => this.changeField(name,value),\n goRegister: () => this.goRegister()\n }\n }", "function mapDispatchToProps(dispatch) {\n return {\n //bindActionCreators goes to productActionCreators and find all the actions and wrap them and call the dispatch\n actions: bindActionCreators(productActionCreators, dispatch)\n };\n}", "function matchDispatchToProps(dispatch) {\n return bindActionCreators(\n {\n setInstanceId: setInstanceId,\n setEntityId: setEntityId,\n setInstance: setInstance,\n setLoading: setLoading,\n },\n dispatch\n );\n}", "componentDidMount(){\n this.props.dispatch({type: 'GET_ADMIN_MISSION'});\n this.props.dispatch({ type: 'GET_ADMIN_FOUNDATION'});\n }", "dispatch(action) {\n this.store.dispatch(action);\n return action;\n }", "dispatch(action) {\n this.store.dispatch(action);\n return action;\n }", "dispatch (state, action) {\n let handlers = this.realm.register(action)\n let current = state\n\n for (var i = 0, len = handlers.length; i < len; i++) {\n var { key, domain, handler, length } = handlers[i]\n\n var next = null\n\n switch (length) {\n case 0:\n next = handler.call(domain)\n break;\n case 1:\n next = handler.call(domain, get(state, key))\n break;\n case 2:\n default:\n next = handler.call(domain, get(state, key), action.payload)\n }\n\n current = set(current, key, next)\n }\n\n return current\n }", "getAction(name){\n return _useAction.bind(this,name);\n }", "function reduxActionFunctions(dispatch) {\n\treturn bindActionCreators({\n\t\tset_sampleString: set_sampleString,\n\t\tset_is_logged: set_is_logged\n\t\t// si set_sampleString function kay makit an sa actions folder\n\t}, dispatch);\n}", "componentDidMount() {\n // dispateches to getClassFutureSaga.js\n this.props.dispatch({ type: 'GET_CLASSES' });\n // dispateches to setInstructorSaga.js\n this.props.dispatch({ type: 'GET_INSTRUCTORS' });\n // dispateches to seasonSaga.js\n this.props.dispatch({ type: 'GET_SEASONS' });\n // dispateches to yearSaga.js\n this.props.dispatch({ type: 'GET_YEARS' });\n }", "function mapActionsToProps(dispatch) {\n return {\n buy: function () {\n dispatch(buyAction);\n },\n sell: function () {\n dispatch(sellAction);\n },\n randomize: function () {\n dispatch(exchangeAction);\n }\n };\n}", "function dispatch (action) {\n var entries = app.store.state.entries.concat(action)\n app.store.setState({entries: entries})\n}", "_registerToActions(action) {\n switch(action.actionType) {\n\n case ActionTypes.GET_USERS:\n this._setUsers(action.payload);\n break;\n case ActionTypes.GET_USER_BY_USERNAME:\n this._setUser(action.payload);\n break;\n case ActionTypes.UPDATE_USER:\n this._updateUser(action.payload);\n break;\n case ActionTypes.ONLINE_USER:\n this._setOnlineUsers(action.payload);\n break;\n case ActionTypes.USER_CREATED:\n setTimeout(() => { // Run after dispatcher has finished\n this.emit(CHANGE);\n }, 0);\n\n default:\n break;\n }\n }", "function mapDispatchtoProps(dispatch) {\n return {\n // When createCourse is called dispatch this action with property\n //createCourse: course => dispatch(courseActions.createCourse(course))\n // simpler to use bindActionCreators from redux\n // bindActionCreators will go through course actions and find all actions and wrap them in a call to dispatch\n // Better this way as it allows you to manage actions in actions rather than making seperate course actions here\n actions: bindActionCreators(courseActions, dispatch)\n };\n}", "function matchDispatchToProps(dispatch){\n return bindActionCreators({selectTask: selectTask, sortByDeadlineUp: sortByDeadlineUp ,sortByDeadlineDown: sortByDeadlineDown, sortByPriorityUp: sortByPriorityUp, sortByPriorityDown: sortByPriorityDown, addTask: addTask}, dispatch);\n}", "parseAction(action) {\n const registeredTypes = Object.keys(this.actionMap);\n \n for (const actionType of registeredTypes) {\n // If the action's type matches a registered action type, call the\n // associated callback\n if (action.type === actionType) {\n this.actionMap[actionType](action);\n break;\n }\n }\n }", "function matchDispatchToProps(dispatch){\n return bindActionCreators({getDynamicData: getDynamicData}, dispatch)\n }", "function mapDispatchToProps(dispatch){\n return {\n updateStates(info) {\n dispatch(actualizacion(info));\n }\n }\n}", "function matchDispatchToProps(dispatch) {\n return bindActionCreators({fetchFilterData: (reqObj, id) => itemsFilterFetchData(reqObj, id), \n toggleRefineBtn: toggleRefineBtn, hideSelect: hideSelect, setSelectedFilter: setSelectedFilter,\n setSelectedOption: setSelectedOption}, dispatch);\n}", "function start (...args) {\n const startDispatchResult = dispatch(actionCreator(...args));\n setDispatchResult({ // eslint-disable-line no-use-before-define\n ...initialMethods,\n ...startDispatchResult\n });\n return startDispatchResult;\n }", "action() {}", "function mapDispatchToProps(dispatch) {\n\treturn {\n\t\tactions: bindActionCreators(courseActions, dispatch),\n\t\tajaxCalls: bindActionCreators(ajaxActions, dispatch),\n\t\tcourseFormActions: bindActionCreators(courseFormActions, dispatch)\n\t};\n}", "function mapDispatchToProps(dispatch){\r\n return {\r\n //createCourse : (course)=> dispatch(courseActions.createCourse(course))//bindactn creator simplify this\r\n actions : bindActionCreators(courseActions,dispatch)\r\n //createCourse : bindActionCreators(courseActions.createCourse(),dispatch)\r\n };\r\n}", "function mapDispatchToProps(dispatch) {\n return {\n Actions: bindActionCreators(ActionCreators, dispatch),\n };\n}", "dispatch(action) {\n this.store.dispatch(action);\n }", "function mapDispatchToProps(dispatch) {\r\n\r\n return {\r\n actions: bindActionCreators(documentAction, dispatch),\r\n oppActions: bindActionCreators(opportunityAction, dispatch),\r\n actActions: bindActionCreators(activityAction, dispatch)\r\n };\r\n}", "function mapDispatchToProps(dispatch){\n return {\n actions: bindActionCreators(fyRateActions, dispatch)\n //createCourse: course => dispatch(fyRateActions.createCourse(course))\n };\n}", "function mapDispatchToProps(dispatch){\n return bindActionCreators(actionCreators, dispatch)\n}", "function mapDispatchToProps(dispatch) {\n // take all action and pass it into funnel (dispatch)\n return bindActionCreators({ selectBook: selectBook}, dispatch);\n}", "function mapDispatchToProps(dispatch){\n return{\n actions: bindActionCreators(courseActions, dispatch)\n };\n}", "function matchDispatchToProps(dispatch){\n\nreturn bindActionCreators({pokedexView: pokedexView}, dispatch);\n\n //connect-function\n // prop : action/function\n // dispatch (behind the scenes with redux to call func)\n\n}", "function mapDispatchToProps(dispatch){\n return bindActionCreators({getHotel, getAllHotels, getBooking},dispatch);\n}", "function mapDispatchToProps(dispatch) {\n return {\n fetchData: (data) => dispatch({\n 'type': 'fetchData',\n 'data': data\n }),\n reset_reader: (data) => dispatch({'type': 'reset_reader'}),\n nextQuestion: (data) => dispatch({'type': 'nextQuestion'}),\n restart: (data) => dispatch({'type': 'restart'}),\n nextReader: ()=> dispatch({\n 'type': 'next_reader'\n })\n }\n}", "async fromRNARequestOtherAPIs(dispatch, id) {\n if (getters.siretFromRNA()) {\n await store.dispatch('executeSearchBySiret', { siret: getters.siretFromRNA(), api: 'SIRENE' })\n } else {\n await store.dispatch('executeSearchByIdAssociation', { id: id, api: 'SIRENE' })\n }\n }", "mapActionsToComponents() {\n return {\n recipeCardActions: {\n editRecipe: this.props.editRecipe,\n cancelEditingRecipe: this.props.cancelEditingRecipe,\n doneEditingRecipe: this.props.doneEditingRecipe,\n saveRecipe: this.props.saveRecipe,\n ingredientActions: {\n editIngredient: this.props.editIngredient,\n cancelEditingIngredient: this.props.cancelEditingIngredient,\n doneEditingIngredient: this.props.doneEditingIngredient,\n addIngredient: this.props.addIngredient,\n deleteIngredient: this.props.deleteIngredient,\n cancelDeletingIngredient: this.props.cancelDeletingIngredient\n },\n processActions: {\n editStep: this.props.editStep,\n cancelEditingStep: this.props.cancelEditingStep,\n doneEditingStep: this.props.doneEditingStep,\n addStep: this.props.addStep,\n deleteStep: this.props.deleteStep,\n cancelDeletingStep: this.props.cancelDeletingStep\n }\n }\n } \n }", "_registerToActions(action) {\n\n switch(action.actionType) {\n \n case ActionTypes.ACCOUNT_SIGN_IN:\n this._setUserid(action.payload);\n break;\n case ActionTypes.ACCOUNT_CREATED:\n this._setUserid(action.payload);\n case ActionTypes.GET_USER:\n this._setUser(action.payload);\n break;\n case ActionTypes.ROLES_RECEIVED:\n this._setRoles(action.payload);\n break;\n default:\n break;\n }\n }", "function mapDispatchToProps(dispatch) {\n return bindActionCreators({},dispatch)\n}" ]
[ "0.6406483", "0.63773704", "0.6309297", "0.6268497", "0.62040234", "0.6163224", "0.61537194", "0.6126306", "0.6124097", "0.61103094", "0.61092", "0.6090499", "0.6086417", "0.60673213", "0.6053477", "0.60518944", "0.6006533", "0.6005455", "0.5992352", "0.59782284", "0.59781724", "0.59566885", "0.5941477", "0.59408414", "0.59406614", "0.5922091", "0.5905432", "0.58991283", "0.5892686", "0.5885333", "0.5876551", "0.58636254", "0.5859559", "0.5855659", "0.58528805", "0.58501226", "0.58501226", "0.58429796", "0.5839935", "0.5834049", "0.5825872", "0.58202374", "0.581202", "0.5794952", "0.5793695", "0.57923067", "0.578526", "0.5782888", "0.5780894", "0.57798", "0.5778717", "0.57753813", "0.57752436", "0.5755368", "0.57543087", "0.5753468", "0.57534", "0.575002", "0.57318306", "0.5727384", "0.57115597", "0.5705021", "0.5695244", "0.56917965", "0.568702", "0.568235", "0.5680603", "0.56775826", "0.56775826", "0.5676054", "0.5675779", "0.5667009", "0.56654227", "0.5662611", "0.5662163", "0.5654172", "0.5650709", "0.56357145", "0.5634379", "0.56299096", "0.56292474", "0.5628404", "0.5627986", "0.5627243", "0.56268513", "0.56202126", "0.56201845", "0.5618565", "0.56164235", "0.5612658", "0.56114817", "0.5610752", "0.56095463", "0.56065345", "0.5601716", "0.55966604", "0.55820924", "0.55809695", "0.55772287", "0.55699056" ]
0.57759976
51
Pop out all the array into html format
function extract(msg_desc,msg_title,msg_url){ var desc = []; var title = []; var url = []; desc = msg_desc; title = msg_title; url = msg_url; var tags = ""; for(var x = 0; x < desc.length; x ++){ tags += "<h3>'"+title[x]+"'</h3><h4>'"+desc[x]+"'</h4><a href='"+url[x]+"'>Link</a><br>" } return tags; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayToHTML(json) {\n var output = '[<ul class=\"array collapsible\">';\n var hasContents = false;\n for (var prop in json) {\n hasContents = true;\n output += '<li>';\n output += valueToHTML(json[prop]);\n output += '</li>';\n }\n output += '</ul>]';\n\n if (!hasContents) {\n output = \"[ ]\";\n }\n\n return output;\n }", "function itemtoHTML() {\n for (let i = 0; i < all_html.length; i++) {\n $(\".items\").append([all_html[i]].map(movie_item_template).join(\"\"));\n }\n }", "function readyToPutInTheDOM(arr) {\n return arr.map(function(obj) {\n return \"<h1>\" +obj.name +\"</h1>\" + \"<h2>\" + obj.age +\"</h2>\";\n });\n }", "function JsontoHTML() {\n $(\"ul.items\").empty()\n all_html = []\n for (let i = 0; i < databaseObj.length; i++) {\n c = databaseObj[i];\n let keywrd = (JSON.parse(c[\"keywords\"]))\n kwrds = []\n for (let a = 0; a < keywrd.length; a++) {\n kwrds.push(keywrd[a][\"name\"])\n }\n let movieObj = new MovieInfo(c[\"budget\"], c[\"genres\"], c[\"homepage\"], c[\"runtime\"], c[\"vote_average\"],\n kwrds, c[\"title\"], c[\"id\"], c[\"image_url\"], c[\"image_url1\"], c[\"image_url2\"],\n c[\"overview\"])\n all_html.push(movieObj)\n }\n }", "function _arrayToHTML(a) {\n if (a.length === 0) {\n return \"\";\n }\n if (typeof(a[0]) != 'object') {\n return toHTML(_objectToOL(a));\n } else if (! _sameProperties(a[0], a[1])) {\n return toHTML(_objectToOL(a));\n } else {\n return _likeObjectsToHTML(function (f) {\n\ta.forEach(function(value, i) {\n\t f({index: i}, value, {});\n\t });}, null);\n }\n}", "function arrayToHtml() {\n let fullString = '';\n let tipsList = '';\n const startDiv = '<div>';\n const endDiv = '</div>';\n \n const lb = '<br>';\n let newTip = 0;\n let endTip = 2;\n const auth ='Submited By: ';\n const ti = 'Title: '\n \n for (i = 0; i < tips.length; i++)\n {\n if (i == newTip)\n { // start of new Tip add Div and author string\n fullString += startDiv + ti + tips[i] + lb;\n \n newTip += 3;\n } else if (i == endTip)\n { // end of Tip add text and close Div\n fullString += tips[i] + endDiv;\n endTip +=3;\n } else \n { // add Author data\n fullString += '<em>' + auth + tips[i] + '</em>' + lb + lb;\n }\n \n }\n \n document.getElementById(\"tipData\").innerHTML = fullString;\n // console.log(fullString);\n\n}", "function toHTML(array) {\n var mainDiv = document.querySelector('.shapceship-list');\n for (let i = 0; i < array.length; i++) {\n var individualDiv = document.createElement('div');\n var img = document.createElement('img');\n var modelP = document.createElement('p');\n var manufacturerP = document.createElement('p');\n var denominationP = document.createElement('p');\n var cargoP = document.createElement('p');\n var passengersP = document.createElement('p');\n var crewP = document.createElement('p');\n var lengthinessP = document.createElement('p');\n var consumablesP = document.createElement('p');\n var atmospheringSpeedP = document.createElement('p');\n var costP = document.createElement('P');\n var hr = document.createElement('hr')\n individualDiv.classList.add('inDiv');\n img.setAttribute('src', `img/${array[i].image}`);\n img.setAttribute('alt', `${array[i].image}`);\n modelP.innerText = `Model: ${array[i].model}`;\n manufacturerP.innerText = `Manufacturer: ${array[i].manufacturer}`;\n denominationP.innerText = `Denomination: ${array[i].denomination}`;\n cargoP.innerText = `Cargo capacity: ${array[i].cargo_capacity}`;\n passengersP.innerText = `Passengers: ${array[i].passengers}`;\n crewP.innerText = `Crew: ${array[i].crew}`;\n lengthinessP.innerText = `Lengthiness: ${array[i].lengthiness}`;\n consumablesP.innerText = `Consumables: ${array[i].consumables}`;\n atmospheringSpeedP.innerText = `Maximum atmosphering speed: ${array[i].max_atmosphering_speed}`;\n costP.innerText = `Cost: ${array[i].cost_in_credits}`;\n mainDiv.appendChild(individualDiv);\n individualDiv.appendChild(img);\n individualDiv.appendChild(modelP);\n individualDiv.appendChild(manufacturerP);\n individualDiv.appendChild(denominationP);\n individualDiv.appendChild(cargoP);\n individualDiv.appendChild(passengersP);\n individualDiv.appendChild(crewP);\n individualDiv.appendChild(lengthinessP);\n individualDiv.appendChild(consumablesP);\n individualDiv.appendChild(atmospheringSpeedP);\n individualDiv.appendChild(costP);\n individualDiv.appendChild(hr);\n\n }\n }", "_generateMarkup() {\n // console.log(this._data); // data is in the form of an array. We want to return one of the below html elements for each of the elements in that array\n\n return this._data.map(this._generateMarkupPreview).join('');\n }", "function render(arr) {\n\tvar todoItems = '';\n\n\tdocument.querySelector('.txtArea').innerHTML = '';\n\tfor (var i = 0; i < arr.length; i++) {\n\t\n\ttodoItems = (todoItems + arr[i].toString() + '<br>'); \n\t}\n\tdocument.querySelector('.txtArea').innerHTML = todoItems; \n}", "function readyToPutInTheDOM(arr){\r\n return arr.map(name => \"<h1>\" + name.name + \"</h1><h2>\" + name.age + \"</h2>\")\r\n }", "function allItems() {\n JsontoHTML()\n itemtoHTML()\n }", "function JsontoHTMLSort(array) {\n $(\"ul.items\").empty()\n all_html = []\n for (let j = 0; j < array.length; j++) {\n for (let i = 0; i < databaseObj.length; i++) {\n c = databaseObj[i];\n if (c[\"title\"] === array[j]) {\n let keywrd = (JSON.parse(c[\"keywords\"]))\n kwrds = []\n for (let k = 0; k < keywrd.length; k++) {\n kwrds.push(keywrd[k][\"name\"])\n }\n let movieObj = new MovieInfo(c[\"budget\"], c[\"genres\"], c[\"homepage\"], c[\"runtime\"], c[\"vote_average\"],\n kwrds, c[\"title\"], c[\"id\"], c[\"image_url\"], c[\"image_url1\"], c[\"image_url2\"],\n c[\"overview\"])\n all_html.push(movieObj)\n }\n }\n }\n }", "function populateHtml (array){\n //prendo il div che devo popolare\n const cardsContainer = $(\".cards-container\");\n cardsContainer.html('');\n //itero sull'array degli oggetti (che contiene anche i colori)\n for (const icon of array) {\n //estrapolo le informazioni che mi servono per creare le mie cards\n let {name, prefix, family, color} = icon;\n //definisco tramite i backticks e i valori degli oggetti che aspetto avranno le cards nella pagina html\n const iconaHtml = `\n <div class=\"card\">\n <i class='${family} ${prefix}${name} ${color}'></i>\n <h5>${name}</h5>\n </div>`;\n \n //aggiungo a cardsContainer\n cardsContainer.append(iconaHtml);\n }\n }", "function writeHTML(array) { \n return `\n <!DOCTYPE html>\n <html lang=\"en\">\n \n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <title>Team Profile Generator</title>\n <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css\" integrity=\"sha512-HK5fgLBL+xu6dm/Ii3z4xhlSUyZgTT9tuc/hSrtw6uzJOvgRr2a9jyxxT1ely+B+xFAmJKVSTbpM/CuL7qxO8w==\" crossorigin=\"anonymous\" />\n <link rel=\"stylesheet\" href=\"./dist/style.css\">\n </head>\n\n <body>\n <header>\n <h1>\n Team Profile \n </h1>\n </header>\n\n <main>\n <div class=\"main\">\n ${writeEmployees(array)}\n </div>\n </main>\n </body>\n `\n}", "function print(array,container){\r\n container.html(\"\");\r\n array.forEach((element) => {\r\n const { family,prefix,name,color}= element;\r\n container.append( `\r\n <div>\r\n <i class=\"${family} ${prefix}${name}\" style=\"color:${color}\"></i>\r\n <h3>${name}</h3>\r\n </div>\r\n `\r\n )\r\n\r\n });\r\n }", "function renderContent(arr) {\n\tlet htmlContent = '';\n\tarr.forEach(function(item, index) {\n\t\thtmlContent += `\n\t\t<div class=\"col-md-4 text-center\">\n\t\t\t<a id=\"product_${index}\" href=\"detail_product.html\" onclick=\"transferId(${index})\">${\n\t\t\titem.image\n\t\t}</a>\n\t\t\t<p class=\"products-name\">${item.name}</p>\n\t\t\t<p class=\"products-name\">Year: ${item.year}</p>\n <p class=\"products-price\">${item.price} đ</p>\n <a href=\"cart.html\" class=\"products-btn products-btn-buy btn btn-sm btn-primary\" onclick=\"pushInfoById(${index})\">Mua ngay</a>\n <a id=\"product_${index}\" href=\"detail_product.html\" class=\"products-btn products-btn-more btn btn-sm btn-primary\" onclick=\"transferId(${index})\">Xem thêm</a>\n </div>\n `;\n\t});\n\t$('.products .col-md-9 .row').html(htmlContent);\n}", "function disp(){\r\n var str = '';\r\n str = `<h2> Total number of tasks to do : ${data.length} </h2>`;\r\n data.forEach( (elem, index) => {\r\n str += `<p> ${elem} <span><a href=# onClick=\"remove_element( ${index} )\"> \\u00D7</a></span></p>`; // adding each element with key number to variable\r\n document.getElementById('myRES').innerHTML = str; // Display the elements of the array\r\n });\r\n }", "function getAllStreetViewHTML(array){\n var htmlArray = [];\n for (var i = 0; i<array.length; i++){\n var div = divWithBackground(array[i].src);\n htmlArray[i] = div;\n }\n return htmlArray;\n }", "function showArray() {\n showFancyArray2();\n document\n .querySelector('#myList')\n .innerHTML =\n '[' + myArray.join(', ') + ']';\n //saving array to div\n}", "displayPokemons(arr){\n const htmlString = arr.map(pokemon => \n `\n <article>\n <p>#${pokemon.id}</p>\n <p>${pokemon.name}</p>\n <span class=\"types\">${pokemon.types.map( type => `<p class=\"${type}\">${type}</p>`).join(\" \")}</span>\n <p><img src=\"${pokemon.sprite}\"></p>\n </article>\n `\n )\n .join('');\n\n this.main.innerHTML = htmlString;\n }", "function render(array) {\r\n for (i = 0; i < array.length; i++) {\r\n createTitle();\r\n createAuthor(); \r\n createPages();\r\n createReadButton();\r\n createDeleteButton();\r\n }\r\n }", "function readyToPutInTheDOM(arr){\n return arr.map((famousPerson) =>{\n return `<h1>${famousPerson.name}</h1><h2>${famousPerson.age}</h2>`\n })\n}", "function outPutDATAtoHTML() {\n let displayResult = STATE.searchResult.map(singleRest => {\n return `<div class=\"col-12\">\n <div class=\"col text-color\">\n <p>Name: ${singleRest.name} </p>\n <p>Address: ${singleRest.address}</p>\n <p> Price Range <img class=\"raiting-size\" src=\"images/dollar.png\" alt=\"Price rating\"> ${\n singleRest.priceRange\n } </p>\n <p>Rating <img class=\"raiting-size\" src=\"images/star.png\" alt=\"Restaurant rating\"> ${\n singleRest.ratings\n }</p>\n </div>\n <hr>\n </div>`;\n });\n \n $(\"#show-search-result\").html(displayResult);\n }", "function outputArray( heading, theArray, output )\n{\n output.innerHTML = heading + theArray.join( \" \" ); \n} // end function outputArray", "function emotesArraytoHTML(emotes){\n\tret_str = \"\"\n\tvar i;\n\tfor(i = 0; i < emotes.length; i++){\n\t\tif(emotes[i][0] != 'null'){\n\t\t\tif(LITE){\n\t\t\t\tret_str += '<p><b>\"' + emotes[i][1] + '</b>\": ' + emotes[i][2] + '</p>';\n\t\t\t}\n\t\t\telse{\n\t\t\t\tret_str += '<p><img src=\"' + IDtoImage(emotes[i][0]) + '\">: ' + emotes[i][2] + '</p>';\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn ret_str;\n}", "function showArray(elements, customText = \"\"){ \n document.write(\"<h1>Content of array \"+customText+\"</hl>\"); \n document.write(\"<ul>\"); \n elements.forEach((element, index) => { \n document.write(\"<li>\"+element+\"</li><br/>\"); \n }); \n document.write(\"</ul>\"); \n}", "function showArrays(arr){\n arr.forEach(eachItem => { // use += to replace the first one, and add items\n document.body.innerHTML += `<li> ${eachItem.name} </li>`\n });\n // arr.forEach(function(eachItem){\n // document.body.innerHTML += `<li> ${eachItem.name} </li>`\n // })\n }", "function outputArray(heading, theArray, output) {\n\toutput.innerHTML = heading + theArray.join(\" \");\n} //end function outputArray", "function elemArrayToHTML(elemArray) {\n var $container = $('<div/>');\n $.each(elemArray, function(i, val) {\n $container.append(val);\n });\n return $container.html();\n}", "function toHTML(translatedArray, language) {\n\t\tvar translatedHTML = `<p>${language} Translation:</p><p>${translatedArray}</p>`;\n\t\tcontainer.innerHTML = translatedHTML;\n\t\tconsole.log(\"HTML injected\");\n\t}", "printArrayAndCleanP() {\n document.getElementById('demo').innerHTML = this.formatArray()\n\n document.getElementById('inp').value = ''\n }", "function createHTML() {\n myTeam.forEach((member) => {\n const htmLDynamic = `\n <div class=\"card-blockchain col-md-4\">\n <div class=\"card text-black mb-3\" >\n <div class=\"card-header\">${member.role}</div>\n <div class=\"card-body\">\n <h5 class=\"card-title\">${member.name}</h5>\n <div class=\"card\" >\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${member.id}</li>\n <li class=\"list-group-item\">Email: \n <a href=\"mailto:${member.email}\">${member.email}</a></li>\n <li class=\"list-group-item\">${member[Object.keys(member)[4]]}</li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n `\n htmlArr.push(htmLDynamic)\n });\n\n // ending html code\n htmlArr.push(`\n </div>\n </div>\n </div>\n\n</body>\n\n<script src=\"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\" integrity=\"sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM\" crossorigin=\"anonymous\"></script>\n</html>`)\n\n writeToFile();\n}", "wrapInParentHtml(htmlObjectArray) {\n var newData = [];\n let innerHtml = \"\";\n //if there are more than 3 entries, do wrapping operations\n if (htmlObjectArray.length > 3) {\n // https://stackoverflow.com/questions/63462236/merge-every-3-elements-in-array-javascript\n for (let i = 0; i < htmlObjectArray.length; i += 3) { // i+=3 can solve your problem\n let three = \"\";\n // don't pass the ones that aren't null\n if (htmlObjectArray[i]) {\n three += htmlObjectArray[i];\n }\n if (htmlObjectArray[i + 1]) {\n three += htmlObjectArray[i + 1];\n }\n if (htmlObjectArray[i + 2]) {\n three += htmlObjectArray[i + 2];\n }\n //push each set of three to the newData array\n newData.push(three)\n }\n //wrap each set of 3 and then return it\n for (const setOfHtml of newData) {\n innerHtml += `<div class='columns features is-centered'>${setOfHtml}</div>`;\n }\n return innerHtml;\n } else {\n //else just return the data wrapped in one row and return\n return `<div class='columns features is-centered'>${htmlObjectArray}</div>`;\n }\n }", "function arrayToHTML(json, path) {\n if (json.length === 0) {\n return '[ ]';\n }\n let output = '';\n for (let i = 0; i < json.length; i++) {\n const subPath = `${path}[${i}]`;\n output += '<li>' + valueToHTML(json[i], subPath);\n if (i < json.length - 1) {\n output += ',';\n }\n output += '</li>';\n }\n return (json.length === 0 ? '' : '<span class=\"collapser\"></span>') +\n `[<ul class=\"array collapsible\">${output}</ul>]`;\n }", "function mainData() {\n\t\tconst getUserInfo = userArray\n\t\t\t.map(userInfo => mainDom(userInfo)) // get html ele's\n\t\t\t.join(''); // joined all the data into one string and removed the ,'s.\n\t\t\t// could have used reduce but join is quicker\n\n\t\trenderToMain(getUserInfo);\n\t}", "function renderAll(listsArray){\n $(\"#packing-list\").html(\" \");\n var end = listsArray.length - 1;\n var lastUL = \"#packing\"+end;\n for (var i = 0; i < listsArray.length; i++) {\n $('#packing-list').append(\"<div class = 'span1 packing-list'><ul id = 'packing\" + i+\"'></ul></div>\");\n listsArray[i].render($('#packing'+ i));\n }\n $(lastUL).append(modalPrintButton);\n}", "function renderAll(arr) {\n app.innerHTML = ''; // Clear div of existing content\n\n // Loop through the array provided and build out the cards for the animals\n for (let i = 0; i < arr.length; i++) {\n // let currentCard = new ZodiacCard(\n // arr[i].eng,\n // arr[i].chi,\n // arr[i].pin,\n // arr[i].year\n // );\n let currentCard = new ZodiacCard(arr[i]);\n\n app.appendChild(currentCard.generateElement());\n } // End for-loop\n}", "function recipes_steps_render(arrays){\n let html = '';\n arrays.forEach(function(e){\n html += `<li class=\"list-group-item pl-2\">${e}</li>`;\n });\n return html;\n }", "function renderQandA () {\n $('.js-QA-content').html(\"\");\n for ( let i = 0 ; i < STORE.length ; i++) {\n $('.js-QA-content').append(`\n <dt><strong>${STORE[i].question}</strong></dt>\n <dd><strong>${STORE[i].correctAnswer}</strong> - ${STORE[i].blurb}</dd>`);\n } \n}", "function showItems(arr) {\r\n document.write('your to list has :\\n');\r\n for (let i = 0; i < arr.length; i++) {\r\n document.write(`${arr[i]} \\n`);\r\n }\r\n}", "function generateHTML(data) {\n //deletes the undefined that was generated by selecting done\n data.pop()\n //adds the top of the HTML to our array\n fullHtml.push(topHtml);\n //for loop to analyze the \n for (let i = 0; i < data.length; i++) {\n if (data[i].type === 'Manager') {\n const managerCard = `<div class=\"card\" style=\"width: 18rem; margin: 15px;\">\n <div class=\"card-body\" style=\"background-color: teal; color: whitesmoke;\">\n <h5 class=\"card-title\">${data[i].name}</h5>\n <p class=\"card-text\"> Manager</p>\n </div>\n <div style=\"padding: 10px; padding-top: 20px; padding-bottom: 20px; background-color: #a6a6a6;\">\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${data[i].id} </li>\n <li class=\"list-group-item\">Email: ${data[i].email} </li>\n <li class=\"list-group-item\">Office Number ${data[i].officeNumber}</li>\n </ul>\n </div>\n </div>`\n fullHtml.push(managerCard)\n } else if (data[i].type === 'Engineer') {\n const engineerCard =\n `<div class=\"card\" style=\"width: 18rem; margin: 15px;\">\n <div class=\"card-body\" style=\"background-color: teal; color: whitesmoke;\">\n <h5 class=\"card-title\">${data[i].name}</h5>\n <p class=\"card-text\"> Engineer</p>\n </div>\n <div style=\"padding: 10px; padding-top: 20px; padding-bottom: 20px; background-color: #a6a6a6;\">\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${data[i].id} </li>\n <li class=\"list-group-item\">Email: ${data[i].email} </li>\n <li class=\"list-group-item\">Github ${data[i].github}</li>\n </ul>\n </div>\n </div>`\n fullHtml.push(engineerCard)\n } else if (data[i].type === \"Intern\") {\n const internCard =\n `<div class=\"card\" style=\"width: 18rem; margin: 15px;\">\n <div class=\"card-body\" style=\"background-color: teal; color: whitesmoke;\">\n <h5 class=\"card-title\">${data[i].name}</h5>\n <p class=\"card-text\"> Intern</p>\n </div>\n <div style=\"padding: 10px; padding-top: 20px; padding-bottom: 20px; background-color: #a6a6a6;\">\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${data[i].id} </li>\n <li class=\"list-group-item\">Email: ${data[i].email} </li>\n <li class=\"list-group-item\">School ${data[i].school}</li>\n </ul>\n </div>\n </div>`\n fullHtml.push(internCard)\n }\n }\n fullHtml.push(endHtml);\n\n const filename = 'team.html';\n writeToFile(filename, fullHtml.join());\n}", "CreateListElements(dataArray) {\n for(let i = 0; i < dataArray.length; i++) {\n this.m_Output += \"<div class='col'><div><p>\" + dataArray[i].name + \"</p></div></div>\";\n }\n }", "function printTodo(arrayInput){\n const htmlArray2 = arrayInput.map((value) =>\n `<p${\n (value.completed) ? 'class=\"done\"' :''}>\n ${value.priority}: ${value.content}\n </p>`)\n return htmlArray2\n}", "function buildHTMLlist(array) {\n var html = `<div id=\"contents\">\n <h1>List of contents</h1>\n <ul class=\"contents-list\">`\n array.forEach(function(item) {\n item = item.toJSON();\n html += `<li class=\"content-item\">\n <h2 class=\"content-item__title\">\n <p>${item.voteScore ? item.voteScore : 0}</p>\n <a href=${item.url}>${item.title}</a>\n </h2>\n <p> ${item.user.username}</p>\n <form action=\"/voteContent\" method=\"post\">\n <input type=\"hidden\" name=\"upVote\" value=\"true\">\n <input type=\"hidden\" name=\"contentId\" value=\"${item.id}\">\n <button type=\"submit\">Upvote this!</button>\n </form>\n <form action=\"/voteContent\" method=\"post\">\n <input type=\"hidden\" name=\"upVote\" value=\"false\">\n <input type=\"hidden\" name=\"contentId\" value=\"${item.id}\">\n <button type=\"submit\">Downvote this!</button>\n </form>\n </li>`\n })\n html += `</ul> \n </div>`\n return html;\n}", "function renderContent(array) {\n cards.innerHTML = array.map(function (number) {\n return `<span class=\"card card-${number}\">${number}</span>`;\n }).join(\"\");\n}", "function updateBodyStringDisplay() {\n let recipeDiv = document.getElementById(\"bodyRecipeArray\");\n if (bodyArray.length === 0) {\n recipeDiv.innerText = \"\";\n return;\n }\n\n let bodyString = \"[\";\n bodyArray.forEach((v, i) => {\n if (i !== 0) {\n bodyString += \", \";\n }\n bodyString += `<span class=\"${v.toLowerCase()}\">${v}</span>`;\n });\n\n bodyString += \"]\";\n\n recipeDiv.innerHTML = bodyString;\n }", "function outputItems() {\n let html = '';\n const output = document.getElementById('text'); /* Points to h1 tag */\n\n for (let x = 0; x < values.length; x++) {\n html += (x + 1) + '. ' + values[x] + '<br>'; /* Output index value + corresponding item for each iteration */\n }\n output.innerHTML = html;\n }", "function print(array,icons){\n icons.html(\"\");\n array.forEach((element) => {\n const {family,prefix,name,color}= element;\n icons.append( `\n <div>\n <i class=\"${family} ${prefix}${name}\"></i>\n <div class=\"title\">${name}</div>\n </div>\n `\n )\n });\n}", "function showCharacters(array) {\n let html = \"\"\n array.map(\n character => {\n html += `<article>`\n html += `<h2>${character.name}</h2>`\n html += `<img src=\"${character.image}\" />`\n html += `<div>\n <ul>\n <li>Status: ${character.status}</li>\n <li>Gender: ${character.gender}</li>\n <li>Species: ${character.species}</li>\n <li>Created: ${character.created}</li>\n </ul> \n </div>`\n html += `</article>`\n }\n )\n\n const main = document.querySelector(\"main\")\n main.innerHTML = html\n}", "function getHtmlArray(callback){\n\tgetDuplicateHtmlArray(function(err,multipleHtmlArr,singleShirtHtmlArr){\n\t\tif(err){\n\t\t\tcallback(err);\n\t\t}\n\t\telse{\n\t\t\t//concatonate the singleShirtHtmlArr with the multipleHtmlArr[0] to mae one newArr\n\t\t\tvar newArr = singleShirtHtmlArr.concat(multipleHtmlArr[0]);\n\t\t\t//filter out the duplicates in the newArr\n\t\t\tnewArr = newArr.filter(function(item,pos){\n\t\t\t\treturn newArr.indexOf(item) == pos;\n\t\t\t});\n\t\t\t//convert the array to a string and send out the string to scrapeCompiler.js\n\t\t\tcallback(null,newArr.toString());\n\t\t}\n\t\t\n\t});\n}", "function printItems(array) {\n\n var output = \"\"\n for (var i = 0; i < array.length; i++) {\n output += `<div class=\"card mr-4 mt-4\" style=\"width: 18rem;\">\n <img src=\"${array[i][4]}\" class=\"card-img-top\" alt=\"...\">\n <div class=\"card-body\">\n <h5 class=\"card-title\" id=\"itemName\">${array[i][1]}</h5>\n <p class=\"card-text\" id=\"itemDesc\">${array[i][2]}</p>\n <p class=\"card-text\">${array[i][3]}</p>\n <a href=\"#\" class=\"btn btn-primary\" id=\"addCart\" onClick=\"addKeranjang()\">Tambahkan ke keranjang</a>\n </div>\n </div>`\n\n }\n return output\n}", "function showPage() {\n htmlPage = \"\"; // reset html code in every function calls\n for(let i = start; i <= end; i++){\n generateHTML(objArray[i]); // populate html code with the data\n }\n studentList.innerHTML = htmlPage;\n}", "function displayItems(items) {\n const contents = document.getElementById('contents');\n const html = items.map(item => createHTMLString(item));\n contents.innerHTML = items.map(item => createHTMLString(item)).join('');\n}", "function displayHTML(array){\n for (var i = 0; i < array.length; i++){\n document.getElementById(divID).innerHTML += array[i];\n }\n //Insert CSS class for first streetview\n document.getElementById(divID).firstChild.className += ' current-image';\n initializePage();\n }", "function showCountries(array) {\n let contents = ''\n resultSection.innerHTML = ''\n array.forEach(function (element) {\n contents += generateContent(element)\n })\n resultSection.innerHTML = contents\n}", "function myFunction(arr) {\n var out = \"\";\n var i;\n for(i = 0; i < arr.data.children.length; i++) {\n var currArr = arr.data.children[i].data;\n\n //Formatted Article Display\n out += '<div class=\"article\">' + \n currArr.title + \n '<br>' +\n '<a href=\"' + currArr.url + '\"; target=_;>Article</a>' + \n ' ' + \n '<a href=\"https://reddit.com' + currArr.permalink + '\" target=\"_\">Comments</a>' +\n '</div>' +\n '<br>';\n }\n document.getElementById('content').innerHTML = out;\n}", "function makeTeamHTML(emplyArr) {\n fs.writeFile(outputPath, render(emplyArr), function(err) {\n err?console.log(err):console.log(\"Team html rendered. Have a look!\");\n })\n}", "function renderHTML(data) {\n var htmlString = \"\";\n\n for (i = 0; i < data.length; i++) {\n htmlString += \"<p>\" +data[i].name + \" is \" + data[i].age + \" years old.\" + \"</p>\";\n\n }\n infoContainer.insertAdjacentHTML('beforeend', htmlString);\n}", "function refreshHTML() {\n $('ul').html(movieList.reduce((accum, movie) => accum += makeHTML(movie), \"\"))\n}", "function print(array, selectorContainer) {\n\n array.forEach(iconElement => {\n\n //Per assegnare le proprietà name, prefix e type a delle variabili, uso il destructuring al posto di creare singole variabili che prendano le varie proprietà.\n\n const {name, prefix, type} = iconElement;\n\n //Creo il markup da inserire nel contenitore\n\n let markup =\n `\n <div>\n <i class=\"${prefix} ${type}\" style=\"color:black\"></i>\n <div class=\"title\">${name}</div>\n </div>\n `;\n\n //\"Stampo\" all'interno del contenitore selezionato, il markup da inserire per ottenere le icone.\n selectorContainer.insertAdjacentHTML('beforeend',markup);\n });\n\n }", "function renderHTML(data) {\n\tvar htmlString = \"\";\n\n\tfor (i = 0; i < data.length; i ++) {\n\t\thtmpString += \"<p>\" + data[i].name + \" is a \" + data[i].species + \".</p>\";\n\t}\n\n\tanimalContainer.insertAdjacentHTML('beforeend', htmlString);\n}", "function printArrayHTML(anArray) {\n //connecting the java script file with the html div element\n let container = document.getElementById(\"container\");\n //print the content without inverted commas\n container.innerHTML = \"\";\n//create a table tag in html\n let table = document.createElement(\"table\");\n//iterate through an array with the table to create a cell\n for (let i = 0; i < anArray.length; i++) {\n //creating a row in html\n let tRow = document.createElement(\"tr\");\n//iterating through each cell to create a cell\n for (let j = 0; j < anArray[i].length; j++) {\n //create a cell in html\n let tData = document.createElement(\"td\");\n//replace each symbol with an image within the array of arrays\n //x means a wall\n if(anArray[i][j] === \"x\") {\n // create a variable to create an img tag in HTML\n let myImg = document.createElement(\"img\");\n // indicate the source of the imgae starting from its root\n myImg.src = \"sokobanPack/wall.png\";\n //attach the image into the cell\n tData.appendChild(myImg);\n }\n //o means floor\n if(anArray[i][j] === \"o\") {\n let myImg = document.createElement(\"img\");\n myImg.src = \"sokobanPack/floor.png\";\n tData.appendChild(myImg);\n }\n //# means goal\n if(anArray[i][j] === \"#\") {\n let myImg = document.createElement(\"img\");\n myImg.src = \"sokobanPack/goal.png\";\n tData.appendChild(myImg);\n }\n //* means boc\n if(anArray[i][j] === \"*\") {\n let myImg = document.createElement(\"img\");\n myImg.src = \"sokobanPack/box.png\";\n tData.appendChild(myImg);\n }\n //& means player\n if (anArray[i][j] === \"&\"){\n let myImg = document.createElement(\"img\");\n myImg.src = \"sokobanPack/player.png\";\n tData.appendChild(myImg);\n }\n //Append the table cell to the table row\n tRow.appendChild(tData);\n }\n //append table row to the table\n table.appendChild(tRow);\n }\n\n // append the table to the container\n container.appendChild(table);\n}", "function catArrayPrint(){\n var catString = \"\";\n catString += `<select>`\n catString += `<option>Select Category</option>`\n for (var k=0; k<categoriesArray.length; k++){\n catString += `<option>${categoriesArray[k].name}</option>`\n }\n catString += `</select>`;\n $(\"#explosiveDiv\").append(catString);\n \n }", "function itterateProfiles(array){\n \n const htmlArray = [];\n\n array.forEach(function(item, index){\n \n let profileHTML = createProfileHTMLCards(item);\n htmlArray.push(profileHTML);\n\n })\n\n return htmlArray\n}", "function printCualities(array) {\n var txtPC=\"\";\n for (let i = 0; i < array.length ; i++) {\n txtPC+=array[i].brand+\" \"+array[i].type+\" \"+array[i].content+\" \"+array[i].price+\"<br>\";\n//Se guarda en txtPC como cadena de carácteres\n \n }\n document.getElementById(\"demo\").innerHTML = txtPC;\n \n}", "function printHTML() {\n const html = render(employeeArr);\n fs.writeFile(outputPath, html, (err) => {\n if (err) throw err;\n console.log(\"HTML successfully generated and saved to ./output.\");\n return;\n });\n}", "function print(array, selectorContainer) {\n\n array.forEach(iconElement => {\n\n const {name, prefix, type, color} = iconElement; //Cosi si destruttura un elemento, cioé le sue proprietà vengono \"Estratte\" dagli elementi.\n\n let markup =\n `\n <div>\n <i class=\"${prefix} ${type}\" style=\"color:${color}\"></i>\n <div class=\"title\">${name}</div>\n </div>\n `;\n\n //\"Stampo\" all'interno del contenitore selezionato, il markup da inserire per ottenere le icone.\n selectorContainer.insertAdjacentHTML('beforeend',markup);\n });\n\n}", "_generateMarkup() {\n return this._data.map(result => PreviewView.render(result, false)).join('');\n }", "function writeToHtml() {\n console.log(teamArray);\n const teamHtml = render(teamArray);\n console.log(teamHtml);\n fs.writeFile(outputPath, teamHtml, function (err) {\n if (err) {\n throw err;\n }\n console.log(\"success\");\n })\n}", "function displayList(arr) {\n\tvar i;\n\tvar out = '';\n\t\n\tfor (i = 0; i < arr.length; i++) {\n\t\tout += \n\t\t'<div class=\"activity-item container\">' + \n\t\t\t'<div ng-app=\"croppy\"><img src=\"' + arr[i].image + '\" width=\"70\" height=\"70\" alt=\"thumbnail\"></div>' + \n\t\t\t'<h2>' + arr[i].name + '</h2>' + \n\t\t\t'<em>' + arr[i].date + '</em>' + \n\t\t\t'<a href=\"#\" onclick=\"toggle(\\'' + arr[i].id + '\\')\" class=\"activity-item-toggle\" style=\"font-size:18px;\">+</a>' + \n\t\t\t'<div id=\"selected' + arr[i].id + '\" class=\"activity-item-detail\">' + \n\t\t\t\t'<table style=\"width:100%\">' + \n\t\t\t\t\t'<tr>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"viewImage(\\'' + arr[i].image + '\\')\"><i class=\"fa fa-picture-o\"></i> View image</a></td>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"sync(\\'' + arr[i].id + '\\')\"><i class=\"fa fa-refresh\"></i> Sync</a></td>' + \n\t\t\t\t\t'</tr>' + \n\t\t\t\t\t'<tr>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"drawing(\\'' + arr[i].image + '\\', \\'' + arr[i].id + '\\')\"><i class=\"fa fa-pencil\"></i> Create drawing</a></td>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"removePatient(\\'' + arr[i].id + '\\')\"><i class=\"fa fa-trash\"></i> Delete</a></td>' + \n\t\t\t\t\t'</tr>' +\n\t\t\t\t\t'<tr>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"drawingsScores(\\'' + arr[i].id + '\\')\"><i class=\"fa fa-bar-chart\"></i> View drawings and scores</a></td>' + \n\t\t\t\t\t\t'<td><a href=\"#\"><i class=\"fa fa-times\"></i> Close</a></td>' + \n\t\t\t\t\t'</tr>' + \n\t\t\t\t'</table>' + \n\t\t\t'</div>' + \n\t\t'</div>' + \n\t\t'<div class=\"border\"></div>';\n\t}\n\t\n\tdocument.getElementById(\"list\").innerHTML = out;\n}", "getHtmlTemplateString(employeesObjectArray) {\n let employeeDetails = \"\";\n let iconHtml = \"\";\n const returnedHtmlObjects = [];\n //iterate over each employee\n for (const employee of employeesObjectArray) {\n // https://stackoverflow.com/questions/10314338/get-name-of-object-or-class\n const currentObjectTypeName = employee.constructor.name;\n //different employee types get different HTML\n if (currentObjectTypeName == \"Manager\") {\n employeeDetails = this.getHtmlManagerDetails(employee.getId(), employee.getEmail(), employee.getOfficeNumber());\n iconHtml = \"<i class='fas fa-tasks'></i>\";\n } else if (currentObjectTypeName == \"Engineer\") {\n employeeDetails = this.getHtmlEngineerDetails(employee.getId(), employee.getEmail(), employee.getGitHub());\n iconHtml = \"<i class='fas fa-laptop-code'></i>\";\n } else if (currentObjectTypeName == \"Intern\") {\n employeeDetails = this.getHtmlInternDetails(employee.getId(), employee.getEmail(), employee.getSchool());\n iconHtml = \"<i class='fas fa-glasses'></i>\";\n }\n //add each iteration to an array\n returnedHtmlObjects.push(this.getHtmlEmployeeString(employee.getName(), employee.getDescription(), iconHtml, currentObjectTypeName, employee.getImageUrl(), employeeDetails));\n }\n //pass the array to be wrapped and return constructed and formatted HTML\n const innerHtml = this.wrapInParentHtml(returnedHtmlObjects);\n return `\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"utf-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>Our Software Team</title>\n <link rel=\"stylesheet\" href=\"https://unpkg.com/bulma@0.9.0/css/bulma.min.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"./hero.css\">\n <script src=\"https://kit.fontawesome.com/e6ff202c8b.js\" crossorigin=\"anonymous\"></script>\n </head>\n <body>\n <section class=\"hero is-info is-small\">\n <div class=\"hero-body\">\n <div class=\"container has-text-centered\">\n <p class=\"title\">\n Our Software Team\n </p>\n </div>\n </div>\n </section>\n <section class=\"container\">\n ${innerHtml}\n </section>\n </body>\n </html>`.replace(/\\s+/g, ' ');\n }", "function renderButtons(){ \n\t\t$('#moviesView').empty();//empty div\n\n\t\t\tfor(var x = 0; x<=movies.length-1;x++)//looping array\n\t\t\t\t{$('#moviesView').prepend('<button>' + movies[x] + '</button>')};//putting items to div\n\t\t}", "function displayFormat(ObjResult){\r\n html=\"\";\r\n x=0;\r\n for(var i = 0; i < ObjResult.length; i++) {\r\n\r\n if(x<ObjResult.length){\r\n //console.log(ObjResult[x].note_title);\r\n console.log(\"fin: \"+x);\r\n html+=\"<div class='row'>\"+\r\n \"<div class='col-sm-6'>\"+\r\n \"<div class='card bg-light' style='border:none;'>\"+\r\n \"<div class='card-body'>\"+\r\n \"<h5 class='card-title'><img src='public/images/bookmark.svg' alt=''></h5>\"+\r\n \"<h6 class='card-title'>\"+ObjResult[x].note_title+\"</h6>\"+\r\n \"<p class='card-text' style='font-size:xx-small;'>created: \"+ObjResult[x].note_created+\"</p>\"+\r\n \"<hr style = 'height:0.5px; background: rgb(170, 169, 169);'>\"+\r\n \"<p class='card-text' style='font-size:small;'>\"+ObjResult[x].note_body+\"</p>\"+\r\n \"<hr style = 'height:0.5px; background: rgb(170, 169, 169);'>\"+ \r\n \"<img id = 'delete_\"+ObjResult[x].note_id+\"id' src='public/images/delete.svg' alt='' style = 'cursor:pointer;'>\"+\r\n \"<img id = 'update_\"+ObjResult[x].note_id+\"id' src='public/images/update.svg' alt='' style = 'cursor:pointer;'>\"+\r\n \"<input type='hidden' id ='note\"+ObjResult[x].note_id+\"_id' value ='\"+ObjResult[x].note_id+\"'>\"+\r\n \r\n \"</div>\"+\r\n \"</div>\"+\r\n \"<br>\"+\r\n \"</div>\";\r\n let ids = ObjResult[x].note_id;\r\n let titles = ObjResult[x].note_title;\r\n let remarkss = ObjResult[x].note_body;\r\n $(document).on('click','#update_'+ObjResult[x].note_id+'id',function(){\r\n callBack(ids,titles,remarkss);\r\n });\r\n $(document).on('click','#delete_'+ObjResult[x].note_id+'id',function(){\r\n callBackDelete(ids);\r\n }); \r\n \r\n x+=1;\r\n\r\n if(x<ObjResult.length){\r\n console.log(\"fin: \"+x);\r\n html+=\"<div class='col-sm-6'>\"+\r\n \"<div class='card bg-light' style='border:none;'>\"+\r\n \"<div class='card-body'>\"+\r\n \"<h5 class='card-title'><img src='public/images/bookmark.svg' alt=''></h5>\"+\r\n \"<h6 class='card-title'>\"+ObjResult[x].note_title+\"</h6>\"+\r\n \"<p class='card-text' style='font-size:xx-small;'>created: \"+ObjResult[x].note_created+\"</p>\"+\r\n \"<hr style = 'height:0.5px; background: rgb(170, 169, 169);'>\"+\r\n \"<p class='card-text' style='font-size:small;'>\"+ObjResult[x].note_body+\"</p>\"+\r\n \"<hr style = 'height:0.5px; background: rgb(170, 169, 169);'>\"+\r\n \"<img id = 'delete_\"+ObjResult[x].note_id+\"id' src='public/images/delete.svg' alt='' style = 'cursor:pointer;'>\"+\r\n \"<img id ='update_\"+ObjResult[x].note_id+\"id' src='public/images/update.svg' alt='' style = 'cursor:pointer;'>\"+ \r\n \r\n \"</div>\"+\r\n \"</div>\"+\r\n \"<br>\"+\r\n \"</div>\"+\r\n \"</div>\"; \r\n \r\n let id = ObjResult[x].note_id;\r\n let title = ObjResult[x].note_title;\r\n let remarks = ObjResult[x].note_body;\r\n $(document).on('click','#update_'+ObjResult[x].note_id+'id',function(){\r\n callBack(id,title,remarks);\r\n }); \r\n $(document).on('click','#delete_'+ObjResult[x].note_id+'id',function(){\r\n callBackDelete(id);\r\n });\r\n\r\n x+=1;\r\n }else{\r\n html+=\"<div class='col-sm-6'></div></div>\"; \r\n console.log(\"else 2\"+x);\r\n $('#displayFrm_id').html(html);\r\n return false;\r\n }\r\n }else{\r\n html+=\"<div class='col-sm-6'></div></div>\";\r\n console.log(\"else 1\"+x);\r\n $('#displayFrm_id').html(html);\r\n return false;\r\n }\r\n\r\n \r\n \r\n };\r\n \r\n }", "function displayItems(items) {\r\n const container=document.querySelector('.items');\r\n container.innerHTML=items.map(item=>createHTMLString(item)).join('');\r\n}", "generateHtmlOutput() {\n let html = \"\";\n const stateSections = this.state.assignment.sections;\n const outSections = stateSections.custom.concat(stateSections.compulsory);\n\n for (let i = 0; i < outSections.length; i++) {\n if (outSections[i].value != \"\") {\n html += \"<h1>\" + outSections[i].title + \"</h1>\";\n html += outSections[i].value;\n }\n }\n\n return html;\n }", "function buildHTML() {\n //initialize html\n html = \"\";\n\n for(var i=0; i<elements.length; i++) {\n switch(elements[i].type) {\n case 'title':\n buildTitle(elements[i].options);\n break;\n case 'header':\n buildHeader(elements[i].options);\n break;\n case 'img-one':\n buildImageOne(elements[i].options);\n break;\n case 'img-two':\n buildImageTwo(elements[i].options);\n break;\n case 'img-three':\n buildImageThree(elements[i].options);\n break;\n case 'article-right':\n buildArticleRight(elements[i].options);\n break;\n case 'article-left':\n buildArticleLeft(elements[i].options);\n break;\n case 'text' :\n buildText(elements[i].options);\n break;\n \n }\n }\n buildEnd();\n\n document.getElementById('HTML').innerText = `${html}`;\n}", "getHTMLString() {\n var HTMLString = \"\";\n \n for (var i = 0; i < this.feedbackList.length; i++) {\n HTMLString += `<p>` + this.feedbackList[i] + `</p>`\n }\n\n return HTMLString;\n }", "function task14_16_14(){\n var arr = [];\n arr.push(\"keyboard\");\n arr.push(\"mouse\");\n arr.push(\"printer\");\n arr.push(\"monitor\");\n document.write(\" TOTAL \");\n document.write(\"<br>\");\n document.write(\"Array : \" + arr);\n\n document.write(\"<br>\");\n document.write(\" Removal \");\n document.write(\"<br>\");\n document.write(\"Array : \" + arr);\n document.write(\"<br>\");\n arr.pop(\"keyboard\");\n document.write(\"Array : \" + arr);\n document.write(\"<br>\");\n arr.pop(\"mouse\");\n document.write(\"Array : \" + arr);\n document.write(\"<br>\");\n arr.pop(\"printer\");\n document.write(\"Array : \" + arr);\n document.write(\"<br>\");\n arr.pop(\"monitor\");\n document.write(\"<br>\");\n}", "function renderResultsArray(array, target) {\n $(target).empty();\n array.sort(function (a, b) {\n var textA = a.Name.toUpperCase();\n var textB = b.Name.toUpperCase();\n return (textA < textB) ? -1 : (textA > textB) ? 1 : 0;\n });\n for (var i = 0; i < array.length; i++) {\n $(target).append(\"<div class='libResult'><a href='\" + array[i].Link + \"' target='_blank'><h2>\" + array[i].Name + \"</h2></a>Published: <span class='facetDate'>\" + array[i].Year + \"</span><p>\" + array[i].MetaDescription + \"</p></div>\");\n }\n\n $('#count').html(array.length);\n}", "function renderHTML(data) {\r\n\t// create empty string\r\n\tvar htmlString = \"\";\r\n\r\n\t// loop through array\r\n\tfor (i = 0; i < data.length; i++){\r\n\t\thtmlString += \"<p>\" + data[i].name + \" is a \" + data[i].species + \" that likes to eat \"\r\n\t\tfor (ii = 0; ii < data[i].foods.likes.length; ii++){\r\n\t\t\tif (ii == 0){\r\n\t\t\t\thtmlString += data[i].foods.likes[ii];\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\thtmlString += \" and \" + data[i].foods.likes[ii];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t\r\n\t\thtmlString += \" and dislikes \";\r\n\r\n\t\tfor (ii = 0; ii < data[i].foods.likes.length; ii++){\r\n\t\t\tif (ii == 0){\r\n\t\t\t\thtmlString += data[i].foods.likes[ii];\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\thtmlString += \" and \" + data[i].foods.likes[ii];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\thtmlString += '.</p>'\r\n\t}\r\n\r\n\tanimalContainer.insertAdjacentHTML('beforeend', htmlString)\r\n}", "function createHTML(resultArray) {\n let htmlString = `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>Cars</title>\n </head>\n <body>\n <h1>Search result</h1>\n <table>\n <thead>\n <th>Model</th>\n <th>Licence</th>\n </thead>\n <tbody>`;\n\n for (let car of resultArray) {\n htmlString += `<tr>\n <td>${car.model}</td><td>${car.licence}</td></tr>`;\n }\n\n htmlString += `</tbody> \n </table>\n </body>\n </html>`;\n}", "function addDataToPage(array){\n\n for (var i = 0; i < array.length; i++){\n var languageBox = \"<div class=\"+\"language_box\"+\">\";\n languageBox = languageBox + '<span class=\"language_name\">'+array[i].name+'</span></br>';\n languageBox = languageBox + '<span class=\"percent\">'+array[i].repos_percent+'%</span></br>';\n languageBox = languageBox + '<span class=\"language_info\">of new repositories on GitHub</span></br>';\n languageBox = languageBox + '<span class=\"percent\">'+array[i].questions_percent+'%</span></br>';\n languageBox = languageBox + '<span class=\"language_info\">of new questions on Stackoverflow</span></br>';\n $(\"#container\").append(languageBox);\n }\n\n}", "function renderHTML(apidata){\r\n var html = \"\";\r\n var apidatalength = apidata.length; // reverse randering\r\n for (i = 0; i < apidatalength; i++){\r\n html += \"<div class='content-section'>\";\r\n html += \"<h2><a href=\" + apidata[apidatalength-i-1].link_url + \">\" + apidata[apidatalength-i-1].title + \"</a></h2>\";\r\n html += \"<img src=\" + apidata[apidatalength-i-1].img_url + \">\";\r\n html += \"</div>\";\r\n }\r\n newsContainer.insertAdjacentHTML('beforeend', html);\r\n}", "function renderHTML(data) {\n var boards = [];\n var heads = data.match(/(---)\\n.+\\n.+\\n(---)/g);\n for (var i = 0; i < heads.length; i++) {\n boards[i] = {\n head: JSON.parse(\"{\" + heads[i].replace(/(---)/g, \"\") + \"}\"),\n body: marked(data.substring(data.indexOf(heads[i]), heads[i + 1] !== undefined ? data.indexOf(heads[i + 1]) : data.length).replace(heads[i], \"\")),\n };\n }\n return boards;\n}", "function filterHtmlMaking() {\n //Filter Array\n managerArray = dataArray.filter(function (item) {\n return item.position === \"Manager\";\n });\n engineerArray = dataArray.filter(function (item) {\n return item.position === \"Engineer\";\n });\n internArray = dataArray.filter(function (item) {\n return item.position === \"Intern\";\n });\n\n //Map Array\n let mangerhtml = managerArray.map(function (item) {\n return generateMhtml(item);\n });\n let engineerhtml = engineerArray.map(function (item) {\n return generateEhtml(item);\n })\n let internhtml = internArray.map(function (item) {\n return generateIhtml(item);\n })\n\n const htmlArray = mangerhtml.concat(engineerhtml, internhtml);\n\n htmlcards = htmlArray.join(\"\");\n const html = `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>My Project Team</title>\n <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css\">\n <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\"> \n <link href=\"https://fonts.googleapis.com/css2?family=Sacramento&display=swap\" rel=\"stylesheet\">\n <link href=\"https://fonts.googleapis.com/css2?family=Julius+Sans+One&family=Sacramento&display=swap\" rel=\"stylesheet\">\n <link href=\"https://fonts.googleapis.com/css2?family=Gruppo&family=Julius+Sans+One&display=swap\" rel=\"stylesheet\">\n <link rel=\"stylesheet\" href=\"https://pro.fontawesome.com/releases/v5.10.0/css/all.css\"\n integrity=\"sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p\" crossorigin=\"anonymous\"/>\n <link rel = \"stylesheet\" href = \"style.css\">\n</head>\n<body>\n <div class = \"container\" id = \"header-title\">\n <div class = \"row\">\n <div class = \"col-12 mb-3\">\n <h1 class = \"text-center\">My Project Team</h1>\n </div>\n </div>\n </div>\n</br>\n <div class = \"container\">\n <div class = \"row\">\n <div class = \"col-12 d-flex justify-content-around\">\n ${htmlcards}\n </div>\n </div>\n </div>\n</body>\n</html>`;\n\n writeToFile(html);\n}", "function displayArray(array)\n{\n\t'use strict';\n\t\n\t// If array is an object\n\tif(typeof array == \"object\")\n\t{\n\t\t// Display array on web page\n\t\tdocument.getElementById(\"array\").innerHTML = array;\n\t}\n}", "renderLoop(arr, target) {\n const wrapper = document.createElement('div');\n for (let val of arr) {\n wrapper.appendChild(val.domElem);\n }\n\n this.addToDom(wrapper, target);\n }", "function arrayStatus(clearFirst, action) {\r\n array = getArray();\r\n if (clearFirst) {\r\n var div = document.getElementById('showArray');\r\n div.innerHTML = '';\r\n }\r\n if (array && array.length) {\r\n createElements('P', action, 'showArray');\r\n if(array.length == 1){\r\n createElements('SPAN', '[ Head ] --> [ ' + array[0].element + '] --> null', 'showArray');\r\n }\r\n else {\r\n createElements('SPAN', '[ Head ] --> [ ' + array[0].element + '] --> ', 'showArray');\r\n for (var i = 1; i < array.length - 1; i++) {\r\n createElements('SPAN', '[' + array[i].element + '] --> ', 'showArray');\r\n }\r\n createElements('SPAN', '[' + array[array.length - 1].element + '] --> null', 'showArray');\r\n }\r\n }\r\n}", "function printDOM(ArraySaved){\n \trow = myTable.insertRow(myTable.rows.length);//create new row.\n \tfor (var i=0 ; i<ArraySaved.length; i++){ \n\t\trow.innerHTML=\"\";//to clear the table data and update it from the private array every time.\n\t\trow.insertCell(0).innerHTML= myTable.rows.length-1;\n \trow.insertCell(1).innerHTML= ArraySaved[i].name;\n \trow.insertCell(2).innerHTML= ArraySaved[i].amount;\n \trow.insertCell(3).innerHTML= ArraySaved[i].SingleAmount;\n\t}\n\tconsole.log(\"ArraySaved\",ArraySaved)\n }", "function showAll(arr) {\r\n for (var i = 0; i < arr.length; i++) {\r\n var frontContent = arr[i].front;\r\n var backContent = arr[i].back;\r\n $(\"#studyCards\").append(\"<div class =\\\"card front study\\\">\" + frontContent + \"</div>\");\r\n $(\"#studyCards\").append(\"<div class = \\\"card back study\\\" style = \\\"vertical-align:top\\\">\" + backContent + \"</div><br>\");\r\n }\r\n}", "function renderarr(array) {\n for (let i = 0; i < array.length; i++) {\n const div = $(`<div\"> \n <img id=\"img\" src=\"${array[i].img}\" alt=\"\">\n <h1>${array[i].Name}</h1>\n <button class=\"but\" id=\"\"+${i} onclick=\"dele(${i})\"> delete </button>\n </div>`);\n testDiv.append(div);\n }\n}", "function renderAllCards(arrayQuotes){\r\n const grilla = document.getElementById(\"cards\");\r\n let contenido = \"\";\r\n for (const card of arrayQuotes) {\r\n contenido += quoteCardTemplate(card);\r\n }\r\n grilla.innerHTML = contenido;\r\n}", "function displayItems(length, element, array) {\n const elem = element;\n for (let i = 0; i < length; i += 1) {\n if (!array[i]) {\n break;\n }\n elem.innerHTML += `${array[i].word} <span class=\"detailedStats\">(${array[i].times})</span>, `;\n }\n }", "function renderMovies(movieArray) { \n\n function createHTML(movie) {\n return `<div class=\"card mb-3\">\n <img class=\"card-img-top\" src=\"${movie.Poster}\"/>\n\n <div class=\"card-body\">\n <h1 class=\"card-title\">${movie.Title}</h1>\n <h4 class=\"card-text\">${movie.Year}</h4>\n <button onclick=\"saveToWatchlist('${movie.imdbID}')\"> <span class=\"add-symbol\">+</span> ADD<span class=\"empty-space\">+</span></button>\n </div>\n </div>`;\n }\n\n moviesHTML = movieArray.map(createHTML); \n return moviesHTML.join(\"\");\n\n }", "function mostrarComentarios(array) {\r\n\r\n let htmlContentToAppend = \"\";\r\n\r\n for (let i = 0; i < array.length; i++) {\r\n let comments = array[i];\r\n \r\n htmlContentToAppend += `\r\n \r\n <div class=\"list-group-item list-group-item-action\">\r\n <div class=\"row\">\r\n <div class=\"d-flex w-100 justify-content-between\">\r\n <h5 class=\"mb-1\">` + comments.user + `</h5><p style=\"text-align: right\"> ` + comments.description + `</p>\r\n <p>` + mostrarEstrellas(comments.score) + ` </p>\r\n </div>\r\n <p class=\"mb-1\"> ` + comments.dateTime + `</p>\r\n \r\n </div>\r\n </div>\r\n \r\n `\r\n //Guardamos la informacion en el html\r\n document.getElementById(\"comments-section\").innerHTML = htmlContentToAppend;\r\n }\r\n}", "function clearOutPutDataToHTML() {\n STATE.searchResult = [];\n render();\n}", "function displayHTML(){\n\t\tdom.name.innerHTML = \"1. Name: \"+studentArray[position].name;\n\t\tdom.address.innerHTML = \"2. Address: \"+studentArray[position].street+\n\t\t\", \"+studentArray[position].city+\n\t\t\", \"+studentArray[position].state;\n\t\tdom.grades.innerHTML = \"3. Grades: \"+studentArray[position].grades;\n\t\tdom.date.innerHTML = \"4. Date: \"+studentArray[position].getDate();\n\t\tdom.gpaAvg.innerHTML = \"5. Average GPA: \"+studentArray[position].getAverage(studentArray[position].grades).toFixed(2);\n\t}//close displayHTML function", "function arrWithNoBrsAndSpacesToString(array) {\n\tlet arrSpaces = array.map((item) => {\n\t\treturn item.join(' ')\n\t})\n\tconsole.log(arrSpaces)\n\t// console.log(arrSpaces)\n\tlet strBrsSpaces = arrSpaces.join('<br>')\n\treturn strBrsSpaces\n}", "function outputToDOM(newFoodArray){\n\tcardArray=cardBuilder(newFoodArray);\n\tcardArray.forEach(function(card){\n\toutputDog.innerHTML+= card;\n\n\t});\n}", "function createTemplates(ul) {\n for (firstI=0; firstI<numberOfPages; firstI++) {\n for (secondI=0; secondI<10; secondI++){\n if (aNumber == numberOfStudents) {break;}\n newArray += ul[loopAll(aNumber,addToANumber())].outerHTML;\n }\n secondArray[firstI] = newArray;\n newArray = [];\n }\n}", "function listAll ( booksArray ) {\r\n var arrayLength = booksArray.length;\r\n htmlText = '<p class=\"text-center mt-3 mb-2\">' + arrayLength +' book(s) matched</p>';\r\n if ( searchMode ) {\r\n htmlText += copyButtonHelp + editButtonHelp + deleteButtonHelp;\r\n }\r\n htmlText += '<ol>';\r\n for ( var i=0 ; i < arrayLength ; i++ ) {\r\n htmlText += '<li value=' + booksArray[i][bookNumberProperty] + '>';\r\n htmlText += makeTheHTMLforOneBook ( booksArray[i] );\r\n htmlText += '<p>' + nonBreakingSpaceText + '</p></li>';\r\n }\r\n print ( htmlText + '</ol>' );\r\n}" ]
[ "0.6820724", "0.6779951", "0.6771189", "0.656405", "0.65311193", "0.6512462", "0.64598024", "0.6459389", "0.6443657", "0.6436567", "0.64221805", "0.6316895", "0.62976414", "0.62747294", "0.6178981", "0.6171394", "0.6164464", "0.6156421", "0.61287475", "0.612133", "0.61029506", "0.60863876", "0.60820377", "0.60732234", "0.60478115", "0.6038269", "0.60377854", "0.60362834", "0.602613", "0.6020987", "0.6013388", "0.60081595", "0.60064435", "0.5993767", "0.5987482", "0.59871674", "0.5982468", "0.59766585", "0.5975312", "0.59673744", "0.5958402", "0.5941574", "0.59339553", "0.5926811", "0.5921664", "0.5920269", "0.59134996", "0.5908458", "0.5882341", "0.58805585", "0.5879028", "0.58749914", "0.5866165", "0.58613783", "0.58593047", "0.58573157", "0.5855806", "0.5838875", "0.5827832", "0.5819665", "0.5798437", "0.5792835", "0.57804626", "0.57716435", "0.57612777", "0.5750937", "0.57456243", "0.5745285", "0.5743905", "0.57385373", "0.57351726", "0.57330227", "0.5732031", "0.57229704", "0.5716433", "0.57136226", "0.5706502", "0.57060945", "0.5702441", "0.57020044", "0.5692335", "0.5666635", "0.56444716", "0.5639504", "0.56384575", "0.56222004", "0.56145126", "0.56135553", "0.5608212", "0.5608077", "0.560114", "0.5591929", "0.5590564", "0.55826306", "0.5577388", "0.5574602", "0.55701417", "0.5568631", "0.55672437", "0.55637306", "0.5561658" ]
0.0
-1
initiates a reset of the board depending on the difficulty selected
function reset() { gameMode = modeSelector.options[ modeSelector.selectedIndex ].value; gameDifficulty = difficultySelector.options[ difficultySelector.selectedIndex ].value; if ( gameDifficulty === "Easy" ) { playGame( 3 ); } else { playGame( 6 ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetme(){\n\tinitiateBoard();\n\tmode=0;\n\tdisplay(0);\n}", "function reset() {\n\t\t\tclear_board()\n\t\t}", "function resetBoard() {\n\t\"use strict\";\n\t// Mark all cells as empty and give default background.\n\tfor (var i = 0; i < size; i++) {\n\t\tfor (var j = 0; j < size; j++) {\n\t\t\tvar cell = getCell(i, j);\n\t\t\tcell.style.backgroundColor = background;\n\t\t\tcell.occupied = false;\n\t\t\tcell.hasFood = false;\n\t\t}\n\t}\n\t// Reset snake head node.\n\tsnakeHead = null;\n\t// Reset curent direction.\n\tcurrDirection = right;\n\t// Reset direction lock.\n\tdirectionLock = false;\n\t// Reset difficulty level.\n\tmoveInterval = difficultyLevels[level];\n\t// Reset points and time.\n\tpoints = -10;\n\taddPoints();\n\ttime = 0;\n\t// Reset countdown label\n\t$(\"#countdown\").html(\"The force is strong with this one...\");\n}", "function resetBoard() {\n\t// re-initialize board\n\tinitialize();\n\n\t// set/reset player turn\n\tplayerIndicator.className = 'player1';\n\tplayerIndicator.innerText = gs.getPlayerName(1);\n\tgs.setP1Turn();\n}", "function resetBoard() {\n \n // prevents a game reset when a game is in progress\n if (self.gameBoard.gameStatus === \"Game in progress\") {\n alert(\"Whoa! One game at a time!\");\n return;\n }\n else if (self.gameBoard.gameStatus === \"Waiting for players\") {\n alert(\"We need two players to start a game.\")\n return;\n }\n // clears the board for a new game\n else {\n for (var i = 0; i < self.gameBoard.boxes.length; i++) {\n self.gameBoard.boxes[i].isX = false;\n self.gameBoard.boxes[i].isO = false;\n self.gameBoard.$save(self.gameBoard.boxes[i]);\n }\n\n //resets the game status for the new game\n self.gameBoard.gameStatus = \"Game in progress\";\n self.gameBoard.$save(self.gameBoard.gameStatus);\n }\n \n }", "function resetBoard() {\n resetState()\n renderBoard()\n}", "function reset() {\n\t\tdrawSimpleBoard(board = new Board());\n}", "function resetGame () {\n resetBricks ();\n store.commit ('setScore', 0);\n store.commit ('setLives', 3);\n resetBoard ();\n draw ();\n}", "function resetBoard() {\n\t//return board to starting position\n\tboard = [\"r\",\"r\",\"_\",\"b\", \"b\"];\n\t//reset completion status\n\tstatus = false;\n\t//reset empty space\n\temptySpace = 2;\n\t//reset move counter\n\tmoveCounter = 0;\n\t\n\t//change box colours back to starting positions\n\tvar button0 = document.getElementById('piece0');\n\tbutton0.style.background = \"rgb(193,28,28)\";\n\tbutton0.style.border = \"1px solid black\";\n\n\tvar button1 = document.getElementById('piece1');\n\tbutton1.style.background = \"rgb(193,28,28)\";\n\tbutton1.style.border = \"1px solid black\";\n\n\tvar button2 = document.getElementById('piece2');\n\tbutton2.style.background = \"white\";\n\tbutton2.style.border = \"none\";\n\n\tvar button3 = document.getElementById('piece3');\n\tbutton3.style.background = \"black\";\n\tbutton3.style.border = \"1px solid black\";\n\n\tvar button4 = document.getElementById('piece4');\n\tbutton4.style.background = \"black\";\n\tbutton4.style.border = \"1px solid black\";\n\n\t//reset move counter\n\tdocument.getElementById('yourMoves').innerHTML=String(moveCounter);\n\t//change text of start button\n\tdocument.getElementById('textButton').innerHTML='Restart Game';\n\thideResult();\n\t\n}", "function Reset() {\n boxesTaken = 0;\n won = false;\n displayMessage = false;\n twoNoMovesInARow = 0;\n initializeBoard();\n}", "function reset() {\n\t// Generate color palette\n\tcolorPalette = new Array(codeComplexity).fill().map((_, i) => {\n\t\treturn `hsl(${Math.floor(i/codeComplexity*360)}, 90%, 60%)`\n\t})\n\n\t// User slot tracker\n\tselectedSlotIndex = 0\n\tselectedPieceIndex = 0\n\n\t// Code generation\n\tguess = new Array(codeLength).fill(null)\n\tcode = new Array(codeLength).fill(null).map(() => Math.floor(Math.random() * codeComplexity))\n\tconsole.log(code)\n\n\t// Reset the UI\n\tinitUI(codeLength, codeComplexity, slotCount, colorPalette)\n\t\n\t// DOM objects\n\tboard = new Array(slotCount).fill().map((_, i) => {\n\t\tconst slot = document.getElementsByClassName('slot')[slotCount-1-i]\n\t\treturn slot.getElementsByClassName('piece')\n\t})\n\n\tpegs = new Array(slotCount).fill().map((_, i) => {\n\t\tconst pegz = document.getElementsByClassName('pegs')[slotCount-1-i]\n\t\treturn pegz.getElementsByClassName('peg')\n\t})\n\n\tactivatePiece(selectedSlotIndex, selectedPieceIndex)\n}", "reset () {\n this.chessGame.reset()\n this.syncBoard()\n }", "function reset () {\n\t\tfillZero(xs,9);\n\t\tfillZero(os,9);\n\t\tremoveSelected(circles);\n\t\tcurrent = null;\n\t\tcounter = null;\n\t\twin = false;\n\t\tdisplay.textContent = \"tic tac toe\";\n\t}", "function resetGame () { \n\t\t\t\t\t\t\tblueNum = 0;\n\t\t\t\t\t\t greenNum = 0;\n\t\t\t\t\t\t\tredNum = 0;\n\t\t\t\t\t\t\tyellowNum = 0;\n\t\t\t\t\t\t scoreResult=0;\n\t\t\t\t\t\t\ttargetScore = 0;\n\t\t\t\t\t\t\tgetNumber(); // Restart the game and assigns new traget number\n\t\t\t\t\t\t\tscoreBoard(); // Update the score board with new values.\n\t\t}", "function resetBoard() {\n\n\tif (gameOverStatus) {\n\t\tgameReset();\n\t}\n\n\t//reset cards in play\n\tcardsInPlay = [];\n\n\t//remove cards in game-board\n\tvar usedCards = document.getElementById('game-board');\n\twhile (usedCards.hasChildNodes()) {\n\t\tusedCards.removeChild(usedCards.firstChild);\n\t}\n\n\t//fill board with cards again\n\tcreateBoard();\n}", "function reset() {\n $holder.children().remove();\n $(\"#boardLine\").children().remove();\n boardLine = createBoardLine();\n\n // create an array of tiles\n tiles = createRandomTiles(7, json);\n // changed my mind, didnt want to reset highscore but kept functionality\n // highScore = 0;\n // $highScore.text(`High Score: ${highScore}`);\n score = updateScore(boardLine);\n $score.text(`Score: ${score}`);\n }", "function resetBoard(){\n allCells.forEach(cell => cell.textContent = \"\");\n gameStarted = false;\n startButton.disabled = false;\n playerTurn = false;\n}", "function resetGame(){\t\t\n\thasStarted=false;\n\tinput=-1;\n\tsequence=[];\n\tlevel=0;\n\tdisplay(\"--\");\n\tsetTimeout(function(){\n\t\t\t$(\"#board div\").removeClass(\"clickable\");\n\t\t},500);\t\n}", "function resetBoard() {\n\tgame.score = 0;\n\tgame.dot.exists = false;\n\tworms = new Array();\n\n\tfor (var i = 0; i < game.players; i++) {\n\t\tworms.push(new Object());\n\t\tworms[i].direction = \"none\";\n\t\tworms[i].previousCells = new Array();\n\t\tworms[i].length = 1;\n\t\tworms[i].movedThisTurn = false; \n\t\tworms[i].cachedMove = 'none';\n\t\tworms[i].maxSize = 100;\n\n\t\tgame.dots = new Array();\n\t\tgame.foodOut = false;\n\t\t\n\t\tworms[i].position = new Object();\n\t\tworms[i].position.x = 1 + Math.floor(Math.random()*(game.grid.width/game.grid.size - 2));\n\t\tworms[i].position.y = 1 + Math.floor(Math.random()*(game.grid.height/game.grid.size - 2));\n\t}\t\n}", "resetBoard() {\n this.board.resetBoard();\n }", "function resetBoard() {\n var checkerIndex = 0;\n currentColor = \"black\";\n document.getElementById(\"currentPlayer\").innerHTML = \"Current player: \" + currentColor;\n for(var i = checkerIndex; i < 48; i++) {\n checkerArray[i].style.display = \"none\";\n if(checkerArray[i].classList.contains(\"jumpAvailable\")) {\n checkerArray[i].classList.remove(\"jumpAvailable\");\n }\n }\n var boardString = \"b:bbbbbbbbbbbb--------rrrrrrrrrrrr\";\n setBoard(boardString);\n document.getElementById(\"boardInput\").value = boardString;\n document.getElementById(\"blackCBox\").checked = false;\n document.getElementById(\"redCBox\").checked = false;\n document.getElementById(\"forcedJump\").innerHTML = \"No forced jumps.\";\n document.getElementById(\"promptButton\").disabled = true;\n turnCounter = 1;\n while(document.getElementById(\"gameRecord\").rows.length > 1) {\n document.getElementById(\"gameRecord\").deleteRow(-1);\n }\n}", "function resetGame() {\n gBoard = buildBoard();\n gGame.shownCount = 0;\n gGame.isOn = false;\n gLivesCount = 3;\n}", "function resetGame() {\n account.score = 0;\n account.lines = 0;\n account.level = 0;\n board.reset();\n time = { start: 0, elapsed: 0, level: LEVEL[account.level] };\n}", "function resetGame() {\n newSquares = Array(9).fill(null);\n setSquares(newSquares);\n setXTurn(true);\n }", "function resetGame(){\n const players = {...state.players};\n players.one.selected = [];\n players.two.selected = [];\n\n dispatch({\n type: 'RESET_GAME',\n payload: {\n players,\n currentPlayerTurn: PLAYER_ONE_CODE,\n board: initBoardArray\n }\n });\n }", "function resetBoard() {\n // reset any colored cells\n $(\"#chessboard td\").removeClass(\"start\");\n $(\"#chessboard td\").removeClass(\"end\");\n $(\"#chessboard td\").removeClass(\"path\");\n\n // remove any path counters on the board\n $(\".counter\").remove();\n\n // reset start and end points\n start = null;\n end = null;\n\n // reset displayed cell number\n $(\"#output\").html('Please select a source and destination cell.');\n}", "function resetBoard() {\n isOneTileFlipped = false;\n lockBoard = false;\n firstTile = null;\n secondTile = null;\n}", "function resetGame() {\n\t\ttokbox.forceUnpublish();\n\t\tfor(x = 1; x < 21; x++) {\n\t\t\t$(\"#score_\"+x).css(\"background-color\", \"transparent\");\n\t\t\tif(x < 5) {\n\t\t\t\t$(\"#solution_\"+ (x - 1) + \"_right\").html(\"\");\n\t\t\t\t$(\"#solution_\" + (x - 1) + \"_container\").css(\"background-color\", \"#BFBB11\").css(\"border-color\", \"#730046\").css(\"color\", \"black\");\n\t\t\t}\n\t\t\t$(\"#help_container_computer_normal\").fadeIn('slow');\n\t\t\t$(\"#help_container_audience_normal\").fadeIn('slow');\n\t\t\t$(\"#help_container_phone_normal\").fadeIn('slow');\n\t\t\tif(user_type == 'host') {\n\t\t\t\t$(\"#correct_answer\").html(\"\");\n\t\t\t}\n\t\t\tif(user_type == 'user') {\n\t\t\t\t$(\".question_holder\").unbind('click');\n\t\t\t\t$(\"#help_container_phone_normal\").unbind('click');\n\t\t\t\t$(\"#help_container_audience_normal\").unbind('click');\n\t\t\t\t$(\"#help_container_computer_normal\").unbind('click');\n\t\t\t\tuser_type = \"viewer\";\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tif(user_type == 'host') {\n\t\t\tquestion_counter = 0;\n\t\t\ttrivia_questions = [];\n\t\t\tdisplay_question = [];\n\t\t\tloadQuestions(MAX_QUESTIONS);\n\t\t}\n\t\t$(\"#actual_question\").html(\"\");\n\t\t$(\"#game_recap_container\").fadeOut('slow');\n\t}", "reset() {\n this.board.reset();\n this.nextPlayer = x;\n this.winner = ' '; // needs to be like this (recursion)\n this.history = [];\n\n this.valid_plays = this.board.all_valid_plays();\n }", "function reset() {\n chessboard = new Set();\n for(i = 0; i < 9; i++) {\n chessboard.add(i);\n place(i, \"\");\n }\n playerO = new Set();\n playerX = new Set();\n lock = false;\n setState(\"YOUR TURN\");\n}", "function resetBoard() {\n\t\tfor (var i = $boxes.length -1; i>= 0; i--) {\n\t\t\tvar $box = $($boxes[i]);\n\t\t\t$box.attr('class', 'clear');\n\t\t}\n\t\tredMoves = [];\n\t\tyellowMoves = [];\n\t\twinCounter = 0;\n\t\tcounter = 0;\n\t\tconsole.log('resetBoard')\n\t\taddRedandYellowListeners()\n\t\t$turnText.html(\"It's Player 1 turn RED\")\n\t\tremoveRedandYellowListeners();\n\t\tstart();\n\t\n\t}", "function resetBoard() {\n [hasFlippedCard, lockBoard] = [false, false];\n [firstCard, secondCard] = [null, null];\n // if all the cards have been matched then start gameOver function.\n if (matchedCards === 9) {\n gameOver();\n }\n}", "function reset() {\n generateLevel(0);\n Resources.setGameOver(false);\n paused = false;\n score = 0;\n lives = 3;\n level = 1;\n changeRows = false;\n pressedKeys = {\n left: false,\n right: false,\n up: false,\n down: false\n };\n }", "function reset_board() {\n $.each(cells, function (i, v) {\n v.className = \"\";\n $(v).addClass(cell + \" \" + empty_cell);\n });\n final_message_str = \"\";\n $(message_element_id).html(\"Keep playing!!\");\n computer_first_move = true;\n computer_second_move = true;\n }", "function reset() {\n x = 20;\n y = 35;\n level = 1;\n lost = false;\n won =false;\n game = false;\n loseColor =0;\n winColor=1;\n}", "function reset() {\n timesPlayed = -1;\n right = 0;\n wrong = 0;\n startGame ();\n }", "function reset(){\n\t\tquestionIndex = 0;\n\t\toptionIndex = 0;\n\t\t$(\"#option0, #option1, #option2, #option3\").show();\n\t\t$('#timeclock').show();\n\t\ttime();\n\t\tunanswered = 0;\n\t\twrongoption = 0;\n\t\ttotalscore = 0;\n\t\tgamestart();\n\t}", "function resetTiles(){\n//\tprint(tilesChanged);\n\tchecking = false;\n\ttempScore = 0;\n\tfor(let i = 0;i < tilesChanged.length; i++){\n//\t\tprint(tiles[tilesChanged[i]].letter);\n\t\ttiles[tilesChanged[i]].letter = null;\n\t}\t\n\ttilesChanged = [];\n\tlettersUsed = [];\n\tendTurnButton.show();\n\t//print(tilesChanged);\n}", "function reset(){\n wins = 0;\n loses = 0;\n i = 0;\n $(\".reset\").remove();\n displayQuestionAndSelections();\n }", "function resetGameBoard() {\n \n game.xBuffer = imgDetail.imgWidth + imgDetail.imgWidth * 0.4;\n game.yBuffer = imgDetail.imgHeight + imgDetail.imgWidth * 0.2;\n game.xOffSet = 0;\n game.noOfRowOfEnemy = 3;\n game.direction = -1;\n game.verocity = 0;\n game.x2 = game.width - 10;\n game.y2 = game.height - 10;\n game.maxOffSet = Math.floor(game.xBuffer * 2);\n game.startX = 10;\n game.startY = 120;\n game.noOfEnemyPerRow = Math.floor((game.width - 4 * game.xBuffer) / game.xBuffer);\n game.direction = 1;\n game.verocity = Math.floor(imgDetail.width / 2);\n\n \n }", "function resetGame() {\n resetClockAndTime();\n resetMoves();\n resetStars();\n initGame();\n activateCards();\n startGame();\n}", "function winReset(winner){\r\n winner[2]=winner[2] + 1;\r\n $('#scores').html('X: '+choice1[2]+' <br>O: '+choice2[2]);\r\n turnCount=0;\r\n $('td').html('');\r\n boardArr=[\"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\"];\r\n let current=humanPlayer;\r\n gameWon=false;\r\n $(\"#reset\").show();\r\n }", "function reset_play(){\n\t//re-enable\n\tdocument.getElementById('player1_id').disabled = false;\n\tdocument.getElementById('player2_id').disabled = false;\n\t//clear boxes\n\tdocument.getElementById('player1_id').value = null;\n\tdocument.getElementById('player2_id').value = null;\n\t//reset cell text\n\tdocument.getElementById('A1').innerHTML = 'A1';\n\tdocument.getElementById('A2').innerHTML = 'A2';\n\tdocument.getElementById('A3').innerHTML = 'A3';\n\tdocument.getElementById('B1').innerHTML = 'B1';\n\tdocument.getElementById('B2').innerHTML = 'B2';\n\tdocument.getElementById('B3').innerHTML = 'B3';\n\tdocument.getElementById('C1').innerHTML = 'C1';\n\tdocument.getElementById('C2').innerHTML = 'C2';\n\tdocument.getElementById('C3').innerHTML = 'C3';\n\t//reset turn info\n\tdocument.getElementById('turn_info').innerHTML = \"Game has not begin.\";\n\t//reset game data\n\tthis.board_state = [-1,-1,-1,-1,-1,-1,-1,-1,-1];\n\tthis.turn = 1;\n\tthis.started = false;\n}", "function reset() {\n graphics.clearAll();\n for (var i = 0; i < grid.length; i++) {\n for (var j = 0; j < grid[i].length; j++) {\n $(\"#\" + grid[i][j]).parent().removeClass(\"red\");\n squares[grid[i][j]] = \"empty\";\n p2Move = false;\n }\n }\n timesPlayed = 0;\n $(\"#screen3\").children().hide();\n $(\"#screen1\").children().show();\n talker.notice(\"start up\");\n}", "function resetGame() {\n\tresetClockAndTime();\n\tresetMoves();\n\tresetStars();\n\tshuffleDeck();\n\tresetCards();\n\tmatched = 0;\n\ttoggledCards = [];\n}", "function gameReset(){\n\t\t\tshowAction(\"RESET!\");\n\t\t\tif(timer) gameEnd();\n\t\t\t$(\".info .timer .sec\").text(0);\n\t\t\t$(\".info .timer .sectext\").hide();\n\t\t\ttime = null;\n\t\t\tcardsleft = settings.cardcnt;\n\t\t\t$(\"#wrap-gameboard li.flip\").removeClass(\"found selected flip\");\n\t\t\t$(\"#wrap-gameboard li.hover\").removeClass(\"hover\");\n\t\t}", "function resetGame() {\n boardSquares.forEach((square)=> {\n square.reset();\n });\n}", "function resetGame() {\n matched = 0;\n resetTimer();\n resetMoves();\n resetStars();\n resetCards();\n shuffleDeck();\n}", "reset() {\n this.grid = this.getEmptyBoard();\n }", "function boardReset() {\n turn.innerHTML = \"X's turn\";\n move = 0;\n won = false;\n tiles.forEach(tile => {\n tile.innerHTML = \"\";\n })\n}", "resetBoard() {\n this._gameBoard = [\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",];\n this._gameOver = false;\n this._tiedGame = false;\n this.changePlayer(); //alternate between starting players \n }", "function resetGame() {\n boardSquares.forEach((square)=> {\n square.reset()\n });\n}", "function resetBoard() {\n\t\tboard = new Array(9);\n\t}", "function resetGame() {\n\t// Repopulate card deck\n\tcardDeck = masterDeck.map(function(card) { return card }); \n\t// Empty all containers of their elements\n\t$('#game-board').html('')\n\t$('#p1-hand').html(''); \n\t$('#p2-hand').html('');\n\t$('#p1-points').html('');\n\t$('#p2-points').html('');\n\t$('#turn-count').html('');\n\t// Reset board array\n\tgameBoard = [0, 1, 2, 3, 4, 5, 6, 7, 8]; \n\t// Reset turn count\n\tturnCount = 0;\n\t// Reset points\n\tplayer1.points = 5; \n\tplayer2.points = 5;\n}", "function resetGame() {\n \n // reset varaibles\n wrong = 0;\n correct = 0;\n index = -1;\n \n // Update HTML\n clearContent();\n\n // Restart game\n loadQuestion();\n }", "function resetGame() {\r\n\t\r\n\t\tfor(var i=0; i<board.length; i++) {\r\n\t\t\tboard[i].innerHTML = \" \";\r\n\t\t\tboard[i].style.color = 'navy';\r\n\t\t\tboard[i].style.backgroundColor = 'transparent';\r\n\t\t}\r\n\t\tgameOver = false;\r\n\t\tempty = 9;\r\n\t\tsetMessage(player + \" gets to start.\");\r\n\t\tsetMessage2(\"Go!\");\r\n\t\tconsole.log(\"visited resetGame\");\r\n\t}", "function reset(){\n\tdocument.getElementById('game-board').innerHTML = \" \"; //to clear the game board.\n\tcardsInPlay = []; //to clear the array content so the alert will be effective again once we reset the board.\n\tcreateBoard(); //to create a new game board :)\n}", "function resetBoard() {\r\n store.score = 0;\r\n store.head = {top: 0, left: 0};\r\n store.speed = 300;\r\n store.body = [];\r\n store.gameOver = false;\r\n store.currentDirection = 'down';\r\n store.bodyPartId = 0;\r\n \r\n // Empty the elements from the board\r\n while(board.firstChild) {\r\n document.querySelector('#board').removeChild(board.firstChild)\r\n }\r\n \r\n // Remove the elements from the container\r\n const playAgainElem = document.getElementById('play-again');\r\n const congratsElem = document.getElementById('congrats');\r\n playAgainElem.remove();\r\n if (congratsElem) congratsElem.remove();\r\n \r\n \r\n // Reset the score display\r\n document.querySelector('#score').innerHTML = `Score: <span>${store.score} </span>`;\r\n newGame();\r\n }", "reset() {\n this.grid = this.getEmptyBoard();\n }", "function resetGame() {\n\n\t// show it (when page loads the bugs are hidden)\n\t$(\".bug-bg\").css({\n\t\t\"display\": \"block\"\n\t});\n\n\t// reset state vars\n\tcurrentHighestIndex = 0;\n\tnumberErrors = 0;\n\n\tplaySound('#resetSound');\n\n\t// reset visuals\n\t$(\"#currentHighestIndex\").html(currentHighestIndex);\n\t$(\"#numberErrors\").html(numberErrors);\n\t// remove all boxes\n\t$(\".hidden-btn\").removeClass(\"correct\").removeClass(\"incorrect\");\n}", "function reset() {\n //Return global variables to start\n possible = generate();\n currentStep = 0;\n tempKnuth = JSON.parse(JSON.stringify(nextGuess));\n //Zero b/w values\n for(var i=0;i<5;i++) {\n document.getElementById('black' + i).value = '0';\n document.getElementById('white' + i).value = '0';\n }\n //Empty guess boxes, i is initially one because the first guess is always 1122\n for(i=1;i<6;i++) {\n document.getElementById('input' + i).value = '';\n document.getElementById('input' + i).style['background-color'] = '';\n }\n}", "function resetGame() {\n cardShuffle();\n resetBoard();\n cardsInPlay = [];\n cardInPlayId = -1;\n}", "function resetBoard() {\n [app.hasFlippedCard, app.lockBoard] = [false, false];\n [app.firstCard, app.secondCard] = [null, null];\n}", "function resetGame() {\n resetClockAndTime();\n resetMoves(); \n resetRatings();\n startGame();\n}", "function resetGame() {\n generateTarget();\n generateNumbers();\n distributeNumbers();\n}", "function resetScoreboard() {\n $('#game-board').empty();\n $('#elapsed-seconds').empty();\n $('#matches-found').empty();\n $('#remaining-pair').empty();\n $('#attempts-made').empty();\n $('#turn-report').empty();\n $('#actions').text('Please Click A Tile');\n window.clearInterval(timer);\n elapsedSeconds = 0;\n attempts = 0;\n remainingPairs = 8;\n matchedPairs = 0;\n clicks = 0;\n flippedTiles = [];\n flippedImg = [];\n tilesList = [];\n for (idx = 1; idx <= 32; idx++) {\n tilesList.push({\n tileNum: idx,\n src: 'img/tile' + idx + '.jpg',\n flipped: false,\n matched: false\n });\n }\n}", "function resetting() {\n\n\t\talert ('Game Over! Start New Game');\n\t\t$('.cell').addClass('occupied');\n\t\tmoves = 0;\n\n}", "function resetGame() {\n resetTimer();\n resetMoves();\n resetStars();\n shuffleDeck();\n resetCards();\n}", "function resetBoard() {\r\n\tbanner.style.backgroundColor = \"#428bca\"\t\r\n\tmsg.textContent = \"\"\r\n\tpickedColour = pickColour()\r\n\tcolourDisplay.textContent = pickedColour\r\n\treset.textContent = \"New Colours\"\r\n}", "function resetGame() {\n\t$(\"#gameOver\").fadeOut();\n\ttotal = 0;\n\tupdateTotal(0);\n\ttotalEmptyCells = 16;\n\tgrid = getGrid();\n\tgridSpans = getSpanGrid();\n\t$(gridSpans).each(function(i,r) { $(r).each(function(i,c) { $(c).parent().css(\"background-color\", \"#D1E3EB\"); $(c).text(\"\"); }); });\n\tsetRandCell(get2or4());\n\tsetRandCell(get2or4());\n}", "function reset() {\n //Reset the game\n channelResetGame();\n }", "restart() {\n $('#player_turn').text('Red')\n const $board = $(this.selector)\n $board.empty()\n this.drop_btn()\n this.create_board()\n this.turn = 0\n this.game_over = false\n }", "function reset(){\n document.getElementById('game-board').innerHTML = ''\n cardsInPlay = []\n createBoard()\n}", "resetGame() {\n this.initGrid();\n this.setDefaultSeeds();\n this.iteration = 0;\n }", "resetGameBoard() {\n for (var i = 1; i < this.boardHeight - 1; i++) {\n for (var j = 1; j < this.boardWidth - 1; j++) {\n this.gameBoard[i][j].setType('dirt');\n }\n }\n }", "function reset() {\n state.moves = [];\n state.turnCount = 0;\n state.playbackSpeed = 700;\n chooseMove();\n }", "function resetBoard() {\n board = [];\n makeBoard();\n currPlayer = 1;\n\n // TODO: destroy htmlBoard \n document.getElementById(\"board\").remove();\n}", "function reset() {\n for (var x = 0; x < BOARD_SIZE; x++) {\n board[x][0] = new Piece(START_POSITION.charAt(x), WHITE);\n board[x][1] = new Piece(PAWN, WHITE);\n \n board[x][6] = new Piece(PAWN, BLACK);\n board[x][7] = new Piece(START_POSITION.charAt(x), BLACK);\n }\n }", "function resetBoard()\n{\n\tfor(let i = 0; i < allChips.length; i++)\n\t{\n\t\tfor(let j = 0; j < 6; j++)\n\t\t{\n\t\t\tallChips[i][j] = 0;\n\t\t}\n\t}\n}", "function actionOnResetClick () {\n gameRestart();\n }", "function reset() {\n gameOver = false;\n whoseTurn = 'playerOne';\n $('td').html(\"\");\n playerOneMoves = [];\n playerTwoMoves = [];\n $(\"#XO\").modal(\"show\");\n }", "function resetGame() {\n userScore = 0;\n computerScore = 0;\n gameSwitch(winningScore);\n}", "function reset() {\n // reset the player (puts him at starting tile)\n player.reset();\n // reset the enemies - they will begin off screen to the left\n allEnemies.forEach(function(enemy) {\n enemy.reset();\n });\n // reset the game clock - I'm not really using this timer for now but good to have\n gameTimeElapsed = 0;\n // redraw the background of the scoreboard if the high score changed. We try to \n // draw this as seldom as possible to be more efficient. \n if ( currentScore > highScore ) {\n highScore = currentScore;\n scoreboardBG.setForceDraw();\n }\n // reset the current score to zero\n currentScore = 0;\n\n }", "function resetBoard() {\n [hasFlippedCard, lockBoard] = [false, false];\n [firstCard, secondCard] = [null, null];\n }", "function reset() {\n guessesRemaining = 9;\n wrongGuess = [];\n lines = [];\n Game()\n}", "function resetGame(){\r\n\r\n\tvar gridT = document.getElementsByTagName(\"table\")[0];\r\n\tdocument.getElementById(\"winDiv\").innerHTML = \"\";\r\n\tdocument.getElementById(\"errorDiv\").innerHTML = \"\";\r\n\tdocument.getElementById(\"BlkPlayer\").innerHTML = \"\";\r\n\tdocument.getElementById(\"GryPlayer\").innerHTML = \"\";\r\n\tgameState.checkArr = [[],[],[],[],[],[],[],[]];\r\n\tgameState.blkChips = [];\r\n\tgameState.gryChips = [];\r\n\tgameState.liveBChips = 0;\r\n\tgameState.liveGChips = 0;\r\n\tgameState.turn = 1;\r\n\tgameState.gameOver = false;\r\n\r\n\tfor(var i = 0; i < 8; i++){\r\n\t\tfor(var j = 0; j < 8; j++){\r\n\t\tgridT.rows[i].cells[j].innerHTML = \"\";\r\n\t\tgridT.rows[i].cells[j].dataset.checkChip = 0;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tstartGame();\r\n}", "function reset() {\n resetGame(gameId);\n updateCharList([]);\n updateChar(\"\");\n }", "function resetGame(){\n startingLevel = 1;\n startingScore = 0;\n startingLives = 5;\n\n changeScore(startingLevel, startingScore);\n changeLevel(startingLevel);\n}", "function resetGame(){\n setWinner(undefined)\n setPlayerBoard(()=> GameBoard('player'))\n setAiBoard(()=> GameBoard('ai'))\n setAI(() => Player('ai'))\n setIsPlayerTurn(true)\n setUpGame()\n }", "function resetGame() {\n\tplayerMessage.innerHTML = `...maybe do better this time?`;\n\ttowerA.append(smallDisk);\n\ttowerA.append(mediumDisk);\n\ttowerA.append(largeDisk);\n\tsmallDisk.classList.remove('selected');\n\tmediumDisk.classList.remove('selected');\n\tlargeDisk.classList.remove('selected');\n\tmoveCounter.innerText = '';\n\tcounter = 1;\n\ttimerSeconds.innerText = '00';\n\tsetCurrentDiskNull();\n}", "function resetGame() {\n clearGameCards();\n resetMoves();\n resetTimer();\n}", "function reset(){\r\n $(\"#score-text\").text(\"Current high score: Level \" + topScore);\r\n $(\"#reset\").hide();\r\n gameOver = false;\r\n sequence = [];\r\n sequenceNum = 0;\r\n level = 1;\r\n start();\r\n}", "function resetSketch() {\n image(simulationScreenImg, 0, 0, 1000, 500);\n\n // reset the variables\n cupChoice = 0;\n\n // resetting the booleans\n cup1IsActive = false;\n cup2IsActive = false;\n\n cup1MilkTeaIsActive = false;\n cup1TaroIsActive = false;\n cup2MilkTeaIsActive = false;\n cup2TaroIsActive = false;\n\n toppingBobaCup1IsActive = false;\n toppingStrawberryCup1IsActive = false;\n toppingBobaCup2IsActive = false;\n toppingStrawberryCup2IsActive = false;\n\n strawCup1IsActive = false;\n strawCup2IsActive = false;\n}", "function winReset(winner){\n \twinner[2] ++;\n \t$('#scores').html('P1: '+p1[2]+' <br>P2: '+p2[2]);\n \tturnCount=0;\n \t$('td').html('');\n \tboardArr = [\"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\"];\n \tif(human === p1){\n \t\tcurrent = human;\n \t}else{\n\n \t\tlet current = comp;\n \tvar tile = pickEmpty();\n \t$('#'+tile).html(comp[1]);\n \tboardArr[tile] = comp[1];\n \tturnCount++;\n\n \t}\n \tgameWon = false;\n }", "function reset () {\n answer = \"\";\n if (questionCount < questions.length) {\n $(\".game\").html(\"\");\n $(\"#choices\").html(\"\");\n questionSetup();\n time = 20;\n }\n else {\n finish();\n }\n }", "function resetGame() {\n\t$(\"#reset-button\", \"#main\").click(function(){\n\t\tif (button_lock) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Hide and change appropriate css fields\n\t\tdocument.getElementById(\"question-answer-container\").style.visibility = \"hidden\";\n\t\thideAnswers();\n\t\tdocument.getElementById(\"stats\").style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"menu\").style.visibility = \"visible\";\n\t\tdocument.getElementById(\"reset-button\").style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"status\").style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"question\").textContent = \"Loading...\";\n\t\tArray.from(document.getElementsByClassName(\"help-item\")).forEach(\n\t\t function(element) {\n\t\t \telement.style.background = \"#ffd6a1\";\n\t\t }\n\t\t);\n\t\t// Reset audience and friend help text \n \tvar audience_help = document.getElementById(\"audience-help\");\n \tif (audience_help.textContent != \"Ask Audience\") {\n \t\taudience_help.textContent = \"Ask Audience\";\n \t}\n \tvar friend_help = document.getElementById(\"friend-help\");\n \tif (friend_help.textContent != \"Call a Friend\") {\n \t\tfriend_help.textContent = \"Call a Friend\";\n \t}\n \t// Reset money levels\n\t\tArray.from(document.getElementsByClassName(\"money-level-item\")).forEach(\n\t\t function(element) {\n\t\t \tif (element.firstChild.textContent == \"1\") {\n\t\t \t\telement.id = \"current-level\";\n\t\t \t} else if (element.id == \"current-level\") {\n\t\t \t\telement.id = \"\";\n\t\t \t}\n\t\t }\n\t\t);\n\t\tmoney_level = 1;\n\t\tbutton_lock = false;\n\t\tusedHelps = [];\n\t}); \n}", "function reset() {\n checked = false;\n time = 15;\n // DONE: Change the \"display\" div to \"00:15 and reset questions\"\n $(\"#display\").text(\"00:15\");\n $(\"#question\").empty();\n $(\"#answer4\").empty();\n $(\"#answer1\").empty();\n $(\"#answer2\").empty();\n $(\"#answer3\").empty();\n startGame();\n }", "resetMatrix() {\r\n\t\tfor (let i = 1; i < this.board.length - 1; i++) {\r\n\t\t\tfor (let j = 1; j < this.board[i].length - 1; j++) {\r\n\t\t\t\tdocument.getElementById(`${i},${j}`).className = \"dead\";\r\n\t\t\t\tthis.board[i][j] = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\tconsole.log(\"you just reset the board\");\r\n\t}", "function resetBoard() {\n for (var i = boxes.length - 1; i >= 0; i--) {\n boxes[i].innerHTML = '';\n boxes[i].setAttribute('class', 'clear');\n }\n OMoves = [];\n XMoves = [];\n winCounter = 0;\n counter = 1;\n turnText.innerHTML = 'Kick off the game, Player X';\n}", "resetGame(){\n this.setState({\n squares: initialState.squares,\n stepNumber: initialState.stepNumber,\n xIsNext: initialState.xIsNext,\n squareNum: initialState.squareNum,\n history: [{\n stepNumber: 0,\n xIsNext: true,\n squareNum: '',\n }],\n })\n this.sendReset();\n }" ]
[ "0.786401", "0.78084767", "0.77674884", "0.75676", "0.7567517", "0.75581074", "0.74128515", "0.74029344", "0.7400406", "0.7396109", "0.7378152", "0.7338557", "0.7320339", "0.72804195", "0.7254268", "0.7245536", "0.72187936", "0.72061366", "0.7199692", "0.71851075", "0.71837425", "0.7179125", "0.717202", "0.71715254", "0.71528256", "0.71472746", "0.71470916", "0.71446174", "0.7136008", "0.71343964", "0.7123591", "0.7119045", "0.71127", "0.71012497", "0.70991445", "0.70802027", "0.706273", "0.70528835", "0.7045428", "0.7043722", "0.703842", "0.70379347", "0.7034341", "0.7027042", "0.70252514", "0.70213884", "0.7020433", "0.7019969", "0.701641", "0.70097715", "0.70083153", "0.70076954", "0.7004854", "0.69995683", "0.69980085", "0.69936585", "0.6992344", "0.6989044", "0.69750243", "0.6974076", "0.69709647", "0.6961736", "0.6957374", "0.6955905", "0.69551784", "0.6943598", "0.6919298", "0.6903076", "0.6901423", "0.69008344", "0.6899388", "0.68934864", "0.68910474", "0.6886909", "0.6882188", "0.68789107", "0.68764585", "0.6863768", "0.6858337", "0.6856991", "0.6853561", "0.6852626", "0.6847147", "0.6841444", "0.6838787", "0.68336576", "0.68336445", "0.68326443", "0.68248725", "0.682185", "0.6820907", "0.68196493", "0.6816074", "0.6814713", "0.6810805", "0.68088853", "0.67990875", "0.6797704", "0.6794657", "0.6794089" ]
0.76778036
3
loads the game board ready for the player to play
function playGame( difficultyValue ) { colours = generateRandomColours( difficultyValue ); pickedColour = pickRandomColour( colours ); colourDisplay.textContent = pickedColour; if ( difficultyValue === 3 ) { for ( let index = 0; index < squares.length; index++ ) { if ( colours[ index ] ) { console.log( colours[ index ] ); squares[ index ].style.backgroundColor = colours[ index ]; } else { squares[ index ].style.display = "none"; } } } else { for ( let index = 0; index < squares.length; index++ ) { squares[ index ].style.backgroundColor = colours[ index ]; squares[ index ].style.display = "block"; } } changeSquaresToRandomColours( colours ); title.style.backgroundColor = "#232323"; resetButton.textContent = "Reset"; messageDisplay.textContent = ""; processInput(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadGame(){\n\tgame = getJSON(\"http://navy.hulu.com/create?user=rhassan@andrew.cmu.edu\");\n\tboard = [];\n\t\n\t// Display game information\n\twriteToConsole(\"GAME ID = \" + game.game_id);\n\twriteToConsole(\"SHIPS = [\" + game.ship_sizes + \"]\");\n\twriteToConsole(\"BOARD = (\" + game.board_size.width + \", \" + game.board_size.height + \")\");\n\t\n\t// Intialize board to default values\n\tfor(var w=0; w<game.board_size.width; w++){\n\t\tboard[w] = [];\n\t\tfor(var h=0; h<game.board_size.height; h++){\n\t\t\tboard[w][h]=0;\t\t// signifies uninspected\n\t\t}\n\t}\n\t\n\tships = game.ship_sizes;\n\t\n\traiseSuccess(\"Game intialized\");\n}", "load() {\n if (!!this.saveArray) {\n this.board = this.saveArray[0];\n this.currentColour = this.saveArray[1];\n this.currentColour == 'white' ? this.otherColour = 'black' : this.otherColour = 'white';\n this.displayBoard();\n console.log(\"game loaded\");\n }\n }", "function loadGameScreen () {\n /* reset all of the player's states */\n for (var i = 1; i < players.length; i++) {\n gameDisplays[i-1].reset(players[i]);\n }\n $gameLabels[HUMAN_PLAYER].removeClass(\"loser tied current\");\n clearHand(HUMAN_PLAYER);\n\n previousLoser = -1;\n recentLoser = -1;\n gameOver = false;\n\n $gamePlayerCardArea.show();\n $gamePlayerCountdown.hide();\n $gamePlayerCountdown.removeClass('pulse');\n chosenDebug = -1;\n updateDebugState(showDebug);\n \n /* randomize start lines for characters using legacy start lines.\n * The updateAllBehaviours() call below will override this for any\n * characters using new-style start lines.\n *\n * Also go ahead and commit any marker updates from selected lines.\n */\n players.forEach(function (p) {\n if(p.chosenState) {\n p.commitBehaviourUpdate();\n }\n }.bind(this));\n\n updateAllBehaviours(null, null, GAME_START);\n updateBiggestLead();\n\n /* set up the poker library */\n setupPoker();\n preloadCardImages();\n\n /* disable player cards */\n for (var i = 0; i < $cardButtons.length; i++) {\n $cardButtons[i].attr('disabled', true);\n }\n\n /* enable and set up the main button */\n allowProgression(eGamePhase.DEAL);\n}", "function initLoad()\n{\n console.log('page load');\n myGame.buildBoard();\n myGame.nextMove();\n myGame.reset();\n}", "function drawBoard(board) {\n\tif(loaded == elemToLoad) {\n\t\tclearBoard();\n\t\tfor (i in board) {\n\t\t\tfor (j in board[i]) {\n\t\t\t\tvar y = j-3;\n\t\t\t\ty *= -1;\n\t\t\t\ty += 4;\n\t\t\t\tdrawTile(i, j, i*tileSize, y*tileSize, board[i][j]);\n\t\t\t}\n\t\t}\n\t\tstage.draw();\n\t} else {\n\t\twindow.setTimeout(function() {drawBoard(board)}, 1000);\n\t}\n}", "function loadGame() {\n ticTacToeBoard.createBoard();\n loadStatus();\n loadHistory();\n //display to index.htm\n document.getElementById(\"game\").innerHTML = ticTacToeBoard.displayBoard();\n}", "function initGameBoard() {\n\t\tvar totalPlayer = game.getPlayerCount();\n\t\t$('.rubblish').hide();\n\t\t$('.rubblishBin').hide();\t\t\n\t\tfor(var i = 1; i < totalPlayer; i++) {\n\t\t\t$('#player'+ (i+1) +'-holder').hide();\n\t\t\t$('#player'+ (i+1) +'-cardNumber').hide();\n\t\t\t$('#player'+ (i+1) +'-CrystalArea').hide();\n\t\t}\n\t\t$('#player1-holder').hide();\n\t\t$('#player1-CrystalArea').hide();\n\t\t$('#Pass').hide();\n\t\t$('.rubblishBin').fadeIn(800);\n\t\t\n\t\tui.lockNewGame(true);\n\t\tclearCardHolders();\n\t\t\n\t\tvar map = playerMap[totalPlayer];\n\n\t\t// Set the player title on the game board\n\t\tvar counter = 0;\n\t\tfor(var i = 0; i < 4; i++) {\n\t\t\tvar title = $('#player' + (i + 1) + '-title');\n\t\t\tif(i <= totalPlayer) {\n\t\t\t\tif(map[counter] === (i + 1)) {\n\t\t\t\t\ttitle.html('Player ' + (counter + 1));\n\t\t\t\t\tcounter++;\n\t\t\t\t} else {\n\t\t\t\t\ttitle.html('');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttitle.html('');\n\t\t\t}\n\t\t}\n\n\t\taddCardToStockPile();\n\n\t\t// Add cards for human player\n\t\tvar cardArray = game.getPlayerCards(0);\n\t\tvar cardNumber = cardArray.length;\n\t\tfor(var i = 0; i < cardNumber; i++) {\n\t\t\tui.addCardToHumanPlayerTray(cardArray[i]);\n\t\t}\n\n\t\t// Add 4 cards for computer players\n\t\tfor(var i = 1; i < totalPlayer; i++) {\n\t\t\tui.initCardToComputerPlayerTray(i, 4);\n\t\t\tvar holder = document.getElementById('player' + map[i] + '-cardNumber');\n\t\t\tholder.innerHTML=\"X \" + game.getPlayerCardNumber(i);\n\t\t\tvar j = i - 1;\n\t\t\t$('#player'+ (i+1) +'-holder').delay(((i*800)+(j*800))).fadeIn(800);\n\t\t\t$('#player'+ (i+1) +'-cardNumber').delay(((i*800)+(j*800))).fadeIn(800);\n\t\t\t$('#player'+ (i+1) +'-CrystalArea').delay((((i*800)+800)+(j*800))).fadeIn(800);\n\t\t}\n\n\t\tui.lockNewGame(false);\n\t\t$('#player1-holder').delay(5600).fadeIn(800);\n\t\t$('#player1-CrystalArea').delay(5600).fadeIn(800);\n\t\t$('#Pass').delay(5600).fadeIn(800);\n\t\tui.showToast('Hello! It&rsquo;s your turn now. Please play a card.');\n\t\t$('#toast').hide();\n\t\t$('#toast').delay(6400).fadeIn('fast');\n\t\t\n\t}", "loadGame() {\n alert(\"Loading saved game!\");\n tiles = []; // empty tile array\n numPiecesChosen = []; // reset\n numPiecesMatched = 0;\n $(\".wrapper\").empty(); // clear everything\n this.currentBoard = new Board();\n this.currentBoard.loadBoard(function() {\n current.currentBoard.renderTiles(function() {\n current.addFlip(current);\n });\n });\n }", "function load() {\r\n\t\tvar loaded = $.parseJSON(localStorage.getItem(STORAGE_NAME)),\r\n\t\t\tcondition = loaded.condition;\r\n\t\tSIZE = loaded.size;\r\n\t\tTOTALCELLS = SIZE*SIZE;\r\n\t\tMINES = loaded.minecells.length;\r\n\t\tcells = loaded.cells;\r\n\t\tminecells = loaded.minecells;\r\n\t\ttime = loaded.time;\r\n\t\tclicks = loaded.clicks;\r\n\t\tnewGame(true, loaded.board, condition);\r\n\t}", "function loadBoard(campaign, state) {\n var lev = state.current_level\n var boardConfig = campaign[lev.world_index].levels[lev.level_index].level\n\n var board = {\n num_cols: boardConfig.num_cols,\n num_rows: boardConfig.num_rows,\n coins: cloneDeep(boardConfig.coins),\n blocks: cloneDeep(boardConfig.blocks),\n traps: cloneDeep(boardConfig.traps),\n coinsCollected: 0\n }\n\n /**\n * Contains all data that is needed to visualize the board and game state.\n * How can you tell what data belongs in board.visualize?\n * Data should appear in board.visualize if, and only if, the data is\n * ignored in \"headless\" mode (i.e. non-visualization mode).\n */\n board.visualize = {\n\n // mutable data that persists across simulator steps\n persist: {},\n\n // immutable data that is valid for only one simulation step. Every\n // simulation step begins by erasing the contents of step.\n step: {}\n }\n\n if (\"hint\" in boardConfig) {\n board.visualize.persist.hint = boardConfig.hint\n }\n \n // the index of the bot being programmed by the code editor\n // TODO: this should be bot __id__ not bot __index__\n // TODO: this should go into board.visualize.persist\n board.visualize.programming_bot_index = boardConfig.programming_bot_index\n\n board.win_conditions = cloneDeep(boardConfig.win_conditions)\n\n board.constraints = cloneDeep(boardConfig.constraints)\n\n /**\n * The awards that will be given to the player once the level is\n * completed.\n */\n board.badges = cloneDeep(boardConfig.badges)\n\n // set to true once victory has been achieved\n board.victory = false\n\n board.markers = newMatrix(\n board.num_cols,\n board.num_rows,\n function () {\n return newMatrix(\n Direction.NUM_DIRECTIONS,\n BotColor.NUM_COLORS, undefined)\n })\n\n board.bots = []\n\n for (var i = 0; i < boardConfig.bots.length; i++) {\n var configBot = boardConfig.bots[i]\n var program = compilePuzzleCode(configBot.program, board)\n\n assert(program.constraintViolation == false,\n \"loadBoard: program.constraintViolation == false\")\n\n if (program.instructions == null) {\n // TODO: handle this error better\n console.error(\"Could not compile: \" + configBot.program)\n } else {\n var bot = {\n // bot.id is immutable, and unique only w.r.t. this board\n id: i,\n cellX: configBot.cellX,\n cellY: configBot.cellY,\n botColor: configBot.botColor,\n facing: configBot.facing,\n ip: 0,\n program: program\n }\n board.bots.push(bot)\n }\n }\n\n // newly created bots get id == board.next_bot_id\n // don't need to worry about int overflows on bot ids because JS uses floats\n board.next_bot_id = boardConfig.bots.length\n\n return board\n}", "function initGame() {\n gBoard = buildBoard(gLevel);\n renderBoard();\n}", "function loadGame(){\n\t// images\n\tbgImage.src = \"images/backgframe_480.jpg\";\n\tdude.src = \"images/person.png\";\n\tscrollImage.src = \"images/scroll.png\";\n\t\n\t// required buttons\n \tpauseButtonImage.src = \"images/gmenub1.png\";\n\t\n \tpauseButtonImage2.src = \"images/gpauseButton.png\";\n\t\n\t// test buttons (debugging)\n \tgenerateButtonImage.src = \"images/button.png\";\n\tvictoryButtonImage.src = \"images/button.png\";\n\taddscoreButtonImage.src = \"images/button.png\";\n\taddGameOverButtonImage.src = \"images/button.png\";\n\n\t/*// turn off main menu music\n\tmusicOn = false;\n\tmusic.pause();*/\n\t\n\tinitGameSetting(); //rules.js\n}", "function load()\n {\n populateMap(gameInfo.jediList);\n init();\n gameInfo.gameState = \"pickChar\";\n }", "function loadGameScreen(data){\r\n\t\t\t$('#container1').hide(); \r\n\t\t\t\t$('body').css(\"background-color\", \"white\");\r\n\t\t\t\t$('#boxes').show();\r\n\t\t\t\tmessage.autosize();\r\n\t\t\t\t// if current letters is a non-empty string, hide start game div & display letters\r\n\t\t\t\tif(data.game.state === 'active'){\r\n\t\t\t\t\t// if current letters, then game has started so hide the startgame\r\n\t\t\t\t\tstartGameDiv.hide();\r\n\t\t\t\t\thints.masonry('reload');\r\n\t\t\t\t} else{\r\n\t\t\t\t\t$introText.html(data.game.message);\r\n\t\t\t\t\t// game has not yet started\r\n\t\t\t\t\tsendHintDiv.hide();\r\n\t\t\t}\r\n\t\t}", "function playGame() {\n if (game) {\n board.updateGrid();\n }\n}", "function game_initBoard(){\n\t//get map from data.\n\tvar mapdata=data_map[GLOBAL['gid']].map;\n\tvar spawntiles=[];\n\tGLOBAL['board']=[];\n\t//copy data into a board of tile objects\n\tfor(var i=0;i<mapdata.length;i++){\n\t\tGLOBAL['board'][i]=[];\n\t\tfor(var j=0;j<mapdata[i].length;j++){\n\t\t\tvar tile={x:i,y:j,type:mapdata[i][j]};\n\t\t\ttile.color=Math.round(170+(Math.random()*30));\n\t\t\tif(tile.type==2){\n\t\t\t\tspawntiles.push(tile);\n\t\t\t}\n\t\t\tGLOBAL['board'][i][j]=tile;\n\t\t}\n\t}\n\tvar xmax=46*GLOBAL['board'].length;\n\tvar ymax=46*GLOBAL['board'][0].length;\n\t//share the board offset, and spawn tiles.\n\n\tGLOBAL['gamevars'].xoffset=Math.round(($('#game')[0].width-xmax)/2);\n\tGLOBAL['gamevars'].yoffset=Math.round(($('#game')[0].height-ymax)/2);\n\tGLOBAL['gamevars'].spawnpoints=spawntiles;\n}", "function play(){\n\n //Clear the board, any active player turn, and start player turn toggle\n clearBoard();\n restart();\n player1Turn();\n\n //Players alternatively click, event listeners turn on and off allow placement of X or O\n //board state checked after each turn for winner\n placePiece();\n }", "function load(){\n\t//Display the loading progress bar while the game\n\tprogressBar.create(g.canvas, assets);\n\tprogressBar.update();\n}", "load() {\n Logger.info(`The game(${this._id}) is loading...`)\n this.event_manager.trigger('game_load', [this])\n Logger.info('Loading the game mode')\n _.forEach(this._games, (game) => game._load())\n }", "function prepareBoard(){\n // Retreive the high score from localStorage and update the field\n updateHighScore(highScore)\n // TODO: after every board button click, remember the gameState and retrieve\n // it from localStorage on page load to then fill in\n}", "async function load() {\n await Datas.Settings.read();\n await Datas.Systems.read();\n //RPM.gameStack.pushTitleScreen();\n //RPM.datasGame.loaded = true;\n Manager.GL.initialize();\n Manager.GL.resize();\n Manager.Stack.requestPaintHUD = true;\n}", "function start(){\n initializeBoard();\n playerTurn();\n }", "function loadGame(){\n myGameArea.start();\n}", "static async load()\n {\n await RPM.settings.read();\n await RPM.datasGame.read();\n RPM.gameStack.pushTitleScreen();\n RPM.datasGame.loaded = true;\n RPM.requestPaintHUD = true;\n }", "function LoadGame() {\n\t// Your code goes here for loading a game\n\tprint(\"Complete this method in Singleplayer.js\");\n}", "function onload()\r\n{\r\n\tcomputerwins=0;\r\n\tplayerwins=0;\r\n\tnodraws=0;\r\n\tplayername=\"player\";\r\n\tresetboard();\r\n\tstartgame();\r\n}", "function itemLoaded(event) {\n BD18.loadCount--;\n if (BD18.doneWithLoad === true && BD18.loadCount <= 0) {\n BD18.gameBoard = new GameBoard(BD18.bdImage,BD18.bx.board);\n makeTrays();\n makeBdTileList();\n makeBdTokenList();\n canvasApp();\n delayCheckForUpdate();\n }\n}", "handleInitialGameLoad(serializedGameData) {\n var gameData = JSON.parse(serializedGameData);\n if (!gameData.board_state) {\n if (!this.isHost) {\n // Server isn't ready yet. We're not the host, so let's idle.\n var self = this;\n window.setTimeout(function () {\n self.loadInitialBoard();\n }, 3000);\n console.warn(\"trying again\");\n } else {\n // Server isn't ready yet. We're the host, so let's\n // make it ready.\n if (this.hostNewGameCallback !== null) {\n this.hostNewGameCallback();\n }\n if (this.loadCompleteCallback !== null) {\n this.loadCompleteCallback(false);\n }\n }\n } else {\n if (this.loadServerDataCallback !== null) {\n this.loadServerDataCallback(gameData);\n }\n if (this.loadCompleteCallback !== null) {\n this.loadCompleteCallback(gameData.finalized);\n }\n }\n }", "function initGame(){\n resetGameStats()\n setLevel()\n gBoard = buildBoard()\n renderBoard(gBoard)\n gGame.isOn = true\n\n}", "function initGame() {\n\tdebugAlert(\"initGame\", false);\n\tif(gGameActive === true) return;\n\t\n\tgBoardRowCount = 8;//document.getElementById(\"row\").value;\n\tgBoardColumnCount = 6;//document.getElementById(\"column\").value;\n\t\n\t//Create the play area canvas and listeners\n\tgPlayAreaCanvas = createCanvas(getPlayAreaWidth(), getPlayAreaHeight());\n\tgPlayAreaCanvasDrawingContext = gPlayAreaCanvas.getContext(\"2d\");\n\taddListenerToElement(gPlayAreaCanvas,onMouseMovePlayArea,\"mousemove\");\n\taddListenerToElement(gPlayAreaCanvas,onMouseClickPlayArea,\"click\");\n\t\n\t//Create the tile chooser canvas and listeners\n\tgTileChooserCanvas = createCanvas(getTileLayoutWidth(), getTileLayoutHeight());\n\tgTileCanvasDrawingContext = gTileChooserCanvas.getContext(\"2d\");\n\taddListenerToElement(gTileChooserCanvas, onMouseClick,\"click\");\n\taddListenerToElement(gTileChooserCanvas, onDoubleClick,\"dblclick\");\n\taddListenerToElement(gTileChooserCanvas,onMouseMoveTileArea,\"mousemove\");\n\n\t//Create the tiles\n\tiRightElbow = new Image();\n\tiRightElbow.src = \"elbow.png\";\n\tiLeftElbow = new Image();\n\tiLeftElbow.src = \"elbow2.png\";\n\t\n\tiStraight = new Image();\n\tiStraight.src = \"straight.png\";\n\tiPlumber = new Image();\n\tiPlumber.src = \"plumber.jpg\";\n\tiToilet = new Image();\n\tiToilet.addEventListener(\"load\", function(){\n\t\t//after the resources are loaded start a new game\n\t\tflushHandle();\n\t\tnewGame();\n\t\tgGameActive = true;\n\t}, false);\n\tiToilet.src =\"toilet.png\";\n}", "function loadRound(){\n\tenableButtons();\n\tupdateScore();\n\tunbindHandlers();\n\tshuffle();\n\n\tsetGame(0);\n\tsetGame(1);\n\tsetGame(2);\n\tbindSelectors();\n}", "loadGame(p1Name, p2Name) {\n body[0].innerHTML = this._boardHTML;\n const player1Highlight = document.getElementById('player1');\n const player2Highlight = document.getElementById('player2');\n const boardSpaces = document.querySelectorAll('.box');\n player1Highlight.classList.add('active');\n\n //Conditional statements check if the players have entered a name and displays them if they have\n //otherwise, the 'X' and 'O' graphic will be displayed by default.\n if (p1Name.length > 0) {\n player1Highlight.innerText = p1Name;\n }\n if (p2Name.length > 0) {\n player2Highlight.innerText = p2Name;\n }\n\n //Loops through all board spaces and applies the class of 'free' indicated it is an empty space\n for (let i = 0; i < boardSpaces.length; i++) {\n boardSpaces[i].id = i;\n boardSpaces[i].classList.add('free');\n }\n }", "function loadGame() {\n \tconsole.log('startGame');\n \tallCards = shuffle(allCards);\n\n \t// Reset the number of moves\n \tnumberOfMoves = 0;\n\tcounterForMoves.innerHTML = numberOfMoves;\n\n\topenCards = [];\n\t// Iterate through the cards array and append it to the deck\n\t// And remove the attributes\n\tfor (let card of allCards){\n\t\tdeckOfCards.append(card);\n\t\tcard.classList.remove(\"show\", \"open\", \"match\", \"disabled\");\n }\n\n \t// reset rating\n for (var i= 0; i < stars.length; i++){\n stars[i].style.visibility = \"visible\";\n }\n\n //reset timer\n second = 0;\n minute = 0;\n hour = 0;\n\n timerClock.innerHTML = \"00:00:00\";\n clearInterval(interval);\n }", "loaded() {\n me.pool.register('player', game.Player);\n me.pool.register('enemy', game.Enemy);\n me.pool.register('laser', game.Laser);\n\n me.state.WIN = me.state.USER + 1;\n me.state.LOSE = me.state.USER + 2;\n me.state.LEVEL_1 = me.state.USER + 3;\n me.state.LEVEL_2 = me.state.USER + 4;\n me.state.LEVEL_3 = me.state.USER + 5;\n me.state.LEVEL_4 = me.state.USER + 6;\n\n // set the \"Play/Ingame\" Screen Object\n this.level1 = new game.PlayScreen();\n this.level2 = new game.PlayScreen(2, 'teal');\n this.level3 = new game.PlayScreen(3, 'orange');\n this.level4 = new game.PlayScreen(4, '#49B');\n\n this.winScreen = new game.WinScreen();\n this.loseScreen = new game.LoseScreen();\n\n me.state.set(me.state.LEVEL_1, this.level1);\n me.state.set(me.state.LEVEL_2, this.level2);\n me.state.set(me.state.LEVEL_3, this.level3);\n me.state.set(me.state.LEVEL_4, this.level4);\n\n me.state.set(me.state.WIN, this.winScreen);\n me.state.set(me.state.LOSE, this.loseScreen);\n\n // start the game\n me.state.change(me.state[`LEVEL_${store.getState().level}`]);\n }", "function board_pieces_setup(){\r\n\tif(game.num_of_players == 71 || game.num_of_players == 72)\r\n game.num_of_players = 7;\r\n\r\n if(game.num_of_players == 81 || game.num_of_players == 82)\r\n game.num_of_players = 8;\r\n\r\n\tif(game.num_of_players > 3) //since we only need 4+ players to run this check, bc 3 is the minimum number needed to play\r\n\t{\r\n\t\tbluePiece.position.set(sevenCenterX, pieceVisible, sevenCenterZ+DiceOffsetZ); //redrawing needed pieces visibly in Safe House\r\n\t}\r\n\tif(game.num_of_players > 4){\r\n\t\torangePiece.position.set(sevenCenterX+DiceOffsetX, pieceVisible, sevenCenterZ+DiceOffsetZ);\r\n\t}\r\n\tif(game.num_of_players > 5){\r\n\t\tpurplePiece.position.set(sevenCenterX-DiceOffsetX, pieceVisible, sevenCenterZ+DiceOffsetZ);\r\n\t}\r\n\tif(game.num_of_players > 6){\r\n\t\tyellowPiece.position.set(sevenCenterX+DiceOffsetX, pieceVisible, sevenCenterZ);\r\n\t}\r\n\tif(game.num_of_players > 7){\r\n\t\tblackPiece.position.set(sevenCenterX-DiceOffsetX, pieceVisible, sevenCenterZ-DiceOffsetZ);\r\n\t}\r\n\t//if 9th player added, follow suit\r\n}", "function on_load()\n{\n\tgame.start();\n}", "function loaded()\n{\n console.log('Spritesheet loaded.');\n spritesheetLoaded = true;\n createWorld();\n}", "start() {\n if (this.state == STATES.WAITING || this.state == STATES.GAMEOVER) {\n var d = new Date();\n var t = d.getTime();\n this.gameStart = t;\n this.gameStart2 = t;\n this.gameMode = this.scene.gameMode;\n this.gameLevel = this.scene.gameLevel;\n this.makeRequest(\"initialBoard\", this.verifyTabReply);\n this.timeleft = TIME_LEFT;\n this.SaveForMovie();\n // if (this.state == STATES.DISPLAYED) {\n this.state = STATES.READY_TO_PICK_PIECE;\n //}\n }\n }", "function reloadGame(skipBoard) {\n $.get(\"/games/\"+gameId, function( game, status ) {\n window.game = game;\n console.log( \"Game (status \"+status+\"):\", game);\n // --- 1: action button\n switch(game.state) {\n case \"preparing\":\n if(game.ownerId == userId) {\n // owner\n setAction(\"Start\", \"start_game\");\n } else if(userId != null) {\n if(game.players[userId] == null) {\n // not part of the game yet\n setAction(\"Join\", \"player_join\");\n } else {\n // part of the game\n setAction(\"Leave\", \"player_leave\");\n }\n } else {\n // anonymous\n setAction(\"Signin\", null);\n }\n break;\n case \"playing\":\n if(userId != null && game.players[userId] != null) {\n var selIdx = game.queue.indexOf(userId);\n if(selIdx == 0) {\n // currently queue\n setAction(\"Cancel\", \"cancel_trio\");\n } else if(selIdx > 0) {\n // in the selection queue\n $( \"#action\" ).text(\"Wait\").off(\"click\");\n } else if(game.players[userId] != null) {\n // looking for trio\n setAction(\"Trio!\", \"declare_trio\");\n }\n } else {\n // anonymous or not part of game\n setAction(\"Wait\", null);\n }\n\n break;\n case \"over\":\n if(game.ownerId == userId) {\n // owner\n setAction(\"Again\", \"restart_game\");\n } else if(userId != null) {\n setAction(\"Wait\", null);\n } else {\n // anonymous\n setAction(\"Signin\", null);\n }\n break;\n }\n\n // --- 2: players and scores\n var $scores = $(\"#scores .players\");\n $scores.empty();\n var maxScore = -1000;\n for(var playerId in game.players) {\n maxScore = Math.max(maxScore, game.scores[playerId] | 0);\n }\n for(var playerId in game.players) {\n var points = game.scores[playerId] | 0;\n var row = document.createElement(\"tr\");\n row.id = \"player_\"+playerId;\n var status = document.createElement(\"td\");\n status.className = \"status\";\n var selIdx = game.queue.indexOf(playerId);\n if(game.state == \"over\") {\n // mark winners\n if(points == maxScore) {\n row.className = \"winner\";\n }\n } else {\n if(selIdx == 0) {\n // currently selecting\n row.className = \"selecting\";\n } else if(selIdx > 0) {\n // in the selection queue\n row.className = \"waiting\";\n var rank = document.createElement(\"span\");\n rank.className = \"rank\";\n rank.innerText = selIdx;\n row.appendChild(rank);\n }\n }\n\n var name = document.createElement(\"td\");\n name.className = \"player\";\n name.innerText = game.players[playerId].name;\n var score = document.createElement(\"td\");\n score.className = \"score\";\n score.innerText = points;\n row.appendChild(status);\n row.appendChild(name);\n row.appendChild(score);\n $scores.append(row);\n }\n\n sortPlayersByScore();\n\n // --- 3: board\n if(!skipBoard) {\n var board = document.getElementById(\"board\");\n $(board).empty();\n for (var i = 0; i < game.board.length; i++) {\n var card = game.board[i];\n if (card != null) {\n board.appendChild(createCard(i, card.value));\n }\n }\n }\n\n // --- 4: deck\n $(\"#deck\").text(game.cardsLeft);\n });\n}", "startGame() {\r\n\t\tthis.board.drawHTMLBoard();\r\n\t\tthis.activePlayer.activeToken.drawHTMLToken();\r\n\t\tthis.ready = true;\r\n\t}", "function initializeboard() {\n do{\n board = shuffleArray(board);\n } while(! isSolvable(board));\n }", "function initBoard(rows, columns) {\n createBoard(rows, columns);\n placePlayer();\n print('Creating board and placing Player...');\n}", "function loadGame() {\n mayiPivot = false;\n startButton.animate().alpha(0).duration(500).onEnd = function() {\n startButton.setHidden(true);\n startButton.setClickable(false);\n };\n dropSpider.animate().alpha(0).duration(500).onEnd = function() {\n dropSpider.setHidden(true);\n }\n mainOverlayBG.setHidden(false);\n mainOverlayBG.animate().alpha(1).duration(1100);\n gameBG.setHidden(false);\n gameBG.animate().alpha(1).duration(1100);\n deadpool.setHidden(false);\n deadpool.animate().alpha(1).duration(1200);\n gameHeader.setHidden(false);\n gameHeader.animate().alpha(1).duration(1200);\n gameHeart3.setHidden(false);\n gameHeart3.animate().alpha(1).duration(1200);\n spideyBody.setHidden(false);\n spideyBody.animate().alpha(1).duration(1200);\n spideyHead.setHidden(false);\n spideyHead.animate().alpha(1).duration(1200);\n gameScore.setHidden(false);\n gameTimer.setHidden(false);\n blackScreen.setHidden(false);\n blackScreen.animate().alpha(0.75).duration(1200);\n gameInstructions.animate().alpha(1).duration(1300).onEnd = function() {\n gameInstructions.setHidden(false);\n }\n gameInstructions.setClickable(true);\n}", "function init() {\n board = [\n [0, 0, 0, 0, 0, 0], // col 0\n [0, 0, 0, 0, 0, 0], // col 1\n [0, 0, 0, 0, 0, 0], // col 2\n [0, 0, 0, 0, 0, 0], // col 3\n [0, 0, 0, 0, 0, 0], // col 4\n [0, 0, 0, 0, 0, 0], // col 5\n [0, 0, 0, 0, 0, 0], // col 6\n ];\n turn = 1;\n winner = null;\n render();\n}", "function initiateGame() {\n fillBoard(1);\n}", "Initialize() {\n let board = new BoardData_1.BoardData();\n let whitePieces = this.CreatePieces(this.Players[0], board, 1, 0, Enum_1.Side.White); //Remove if not needed\n let blackPieces = this.CreatePieces(this.Players[1], board, 6, 7, Enum_1.Side.Black); //Remove if not needed\n this.gameData = new GameData_1.GameData(this.Id, board);\n this.gameData.PickFirstPlayer(this.Players); //move this so it is done first\n //send initial game setup to clients\n for (var i = 0; i < this.Players.length; i++) {\n Server_1.SendNetworkMessage(\"InitializeGame\", this.gameData, this.Players[i].Connection);\n }\n this.GameHistory.Board = board.Copy();\n for (var i = 0; i < whitePieces.length; i++) {\n whitePieces[i].SetBoardData(this.gameData.Board);\n blackPieces[i].SetBoardData(this.gameData.Board);\n }\n console.log(\"Game started\");\n }", "function gameLoaded() {\n\t\t$('#loading').hide();\n\t\t$('#bg-images').append('<img id=\"bg-image\" src=\"images/bg_init.jpg\">');\n\t\t$('#intro-screen').slideDown();\n\n\t\t//Add level select\n\t\tfor (var i in levels) {\n\t\t\tvar ln = 1 + (i * 1);\n\t\t\t$('#levels').append('<div id=\"level-' + ln +'\" class=\"level\" data-level=\"' + ln +'\">Level ' + ln +' <br><span class=\"level-title\">'+ levels[i]['title'] +'</span></div>');\n\t\t}\n\n\t\t$('.level').click(function(){\n\t\t\t$('#levels').hide();\n\t\t\tvar level = $(this).data('level');\n\t\t\trenderLevel(level-1);\n\t\t});\n\n\t\t$('#next-level').click(function() {\n\t\t\trenderLevel(current_level +1);\n\t\t});\n\n\t\t$('#share-fb').click(function() {\n\t\t\tshareScoreToFacebook(score);\n\t\t});\n\n\t\t$('#share-tw').click(function() {\n\t\t\tshareScoreToTwitter(score);\n\t\t});\n\n\t\t$('#play-it-again').click(function() {\n\t\t\twindow.location.reload();\n\t\t});\n\t}", "function importBoard() {\n let grid = board.createGrid(); // will return our board element\n // let surface_element = document.createElement('div')\n // surface_element.style.position = \"relative\"\n // surface_element.style\n obstacles = obstacle.creationBasedOnArray(\n ArrayForObstacles[\"level\" + currentLevel]\n );\n parent_container.appendChild(grid); // assign the location in our dom we want to put it in\n}", "function loadPlayerList() {\n playerArray.forEach(addPlayerToUIList);\n }", "static loadPlayerSelector() {\n if (this._isLoaded(\"player_selector\"))\n return\n\n let game = this.game\n let players = game.cache.getJSON(\"players\")\n\n for (let type in players)\n game.load.spritesheet(type + \"_player\" , \"./assets/players/\" + type + \"/images/player.png?__version__\", players[type][\"sprite\"][\"width\"], players[type][\"sprite\"][\"height\"])\n\n game.load.image('menu_player_up', './assets/menu/images/up.png?__version__')\n game.load.image('menu_player_down', './assets/menu/images/down.png?__version__')\n game.load.audio(\"menu_player_change\", \"./assets/menu/sounds/change.mp3?__version__\");\n game.load.audio(\"menu_player_confirm\", \"./assets/menu/sounds/confirm.mp3?__version__\");\n }", "function play(col) {\r\n\tvar data = {\r\n\t\t\"action\": \"next\",\r\n\t\t\"currentPlayer\": playerY.symbol,\r\n\t\t\"board\": {\r\n\t\t\t\"numCols\": NUM_COLS,\r\n\t\t\t\"numRows\": NUM_ROWS,\r\n\t\t\t\"rows\": board\r\n\t\t},\r\n\t\t\"column\": col\r\n\t};\r\n\r\n\tplayerIsWaiting = true;\r\n\tvar request = $.ajax({\r\n\t\turl: \"/game/play\",\r\n\t\tmethod: \"POST\",\r\n\t\tdata: JSON.stringify(data),\r\n\t\tdataType: \"json\"\r\n\t});\r\n\r\n\trequest.done(function(msg) {\r\n\t\tif(msg.exception != undefined){\r\n\t\t\t// Error\r\n\t\t\tif(msg.exception.code == \"COLUMN_FULL\" || msg.exception.code == \"OUT_OF_BOUNDS\"){\r\n\t\t\t\tplayerIsWaiting = false;\r\n\t\t\t}else{\r\n\t\t\t\talert(\"Could not play col '\" + col + \"' because: \" + msg.exception);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tboard = msg.playerBoard.rows;\r\n\t\tgameState = msg.gameState;\r\n\t\t// animate play to our row\r\n\t\tvar playerDiscTween = drawDisc(playerY, col, msg.playerRow);\r\n\t\t// if we won, animate we won and end game\r\n\t\tif (gameState == GAME_STATE.PLAYER_Y_WON) {\r\n\t\t\tshowText(\"You won!\");\r\n\t\t\tplayerIsWaiting = false;\r\n\t\t} else {\r\n\t\t\tvar aiCol = msg.aiCol;\r\n\t\t\tvar aiRow = msg.aiRow;\r\n\t\t\t// if ai null AND is draw, then draw and end game\r\n\t\t\tif (aiCol == null && gameState == GAME_STATE.DRAW) {\r\n\t\t\t\tshowText(\"It's a draw!\");\r\n\t\t\t\tplayerIsWaiting = false;\r\n\t\t\t} else {\r\n\t\t\t\tboard = msg.aiBoard.rows;\r\n\t\t\t\tvar opponentTween = drawDisc(playerR, aiCol, aiRow, playerDiscTween);\r\n\t\t\t\tif (gameState == GAME_STATE.PLAYER_R_WON) {\r\n\t\t\t\t\t// if opponent won, animate opponent won and end game\r\n\t\t\t\t\tshowText(\"The bot won!\");\r\n\t\t\t\t\tplayerIsWaiting = false;\r\n\t\t\t\t} else if (gameState == GAME_STATE.DRAW) {\r\n\t\t\t\t\tshowText(\"It's a draw!\");\r\n\t\t\t\t\tplayerIsWaiting = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\topponentTween.onComplete.add(function(){ playerIsWaiting = false; }, this);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\trequest.fail(function(jqXhr, textStatus) {\r\n\t\talert(\"Request failed: \" + jqXhr.responseText);\r\n\t\tplayerIsWaiting = false;\r\n\t});\r\n}", "constructor(scene,player1,player2, timePerPlay){\n super(scene);\n this.scene = scene;\n //Currently selected bishop\n this.activeBishop = null;\n this.pause = false;\n this.board = new Board(scene, timePerPlay);\n //The type of players (Human/AI/Random)\n this.player1 = player1;\n this.player2 = player2;\n //Current boardState in PROLOG list\n this.boardState = null;\n //Previous State that would be implemented if a play was undone\n this.previousBoardState = null;\n //Previous Bishops in the last play that would revert the animations\n this.previousBishops = [];\n //Array of all the moves done in the game\n this.gameMoves = [];\n //Piece count\n this.whitePieces = 25;\n this.blackPieces = 25;\n this.timePerPlay = timePerPlay;\n\n this.playerTurn = 2;\n this.displayMovie = false;\n this.tempGameMoves = [];\n\n makeRequest(\"initial_state\", data => this.initializeBoard(data));\n }", "startGame () {\n\t\tif ( this.model.isBoardShuffling ) return;\n\t\tif ( this.model.isModalOpen ) this.toggleModal();\n\t\tif ( this.model.isBoardBlocked ) this.toggleBoardLock( this.model.isBoardBlocked );\n\t\tthis.model.populateListOfPossibleChanges();\n\t\tthis.view.alocatePieces( this.model.finalPositionsArr, this.model.baseNumber, this.model.getPieceSize(), this.model.gutterSize );\n\t\tthis.shufflePieces();\n\t\tthis.resetConter();\n\t}", "function boardSetup() {\n\n\tclearBoard();\n\t$('#game_info').show();\n\t// add tie break track\n\t$('#tie_break_track').append(\n\t\t$('<span/>').text('Tie Break:')\n\t);\n\tfor (i = 0; i < numPlayers; i ++) {\n\t\tvar c = tieBreak[i];\n\t\t$('#tie_break_track').append(\n\t\t\t$('<div/>')\n\t\t\t\t.addClass('tie_break_token')\n\t\t\t\t.css('background-color', playerColors[c])\n\t\t\t\t.text(Number(i+1))\n\t\t\t\t.attr('title', players[c].username)\n\t\t);\n\t\t// distribute starting resources depending on tie break order\n\t\tplayers[c].money += (startingMoney + Math.floor(i/2));\n\t\tplayers[c].numRibbons += i%2;\n\t}\n\n\t// add status bar\n\tvar $statusBar = $('<div/>').addClass('status_bar')\n\t\t.append(\n\t\t\t$('<span/>').addClass('status_bar--turn'),\n\t\t\t$('<span/>').addClass('status_bar--phase'),\n\t\t\t$('<span/>').addClass('status_bar--text')\n\t\t);\n\n\t$('#status_bar').append($statusBar);\n\n\t// add opponents' boards on the top\n\tfor (i = 0; i < numPlayers; i ++)\n\t\tif (myID != i) {\n\t\t\tvar $board = $('<div/>')\n\t\t\t\t\t.addClass('player_board')\n\t\t\t\t\t.css('background-color', playerColors[i])\n\t\t\t\t\t.val(i);\n\t\t\tvar $vase = $('<div/>').addClass('player_vase').addClass('player_vase--opponent');\n\n\t\t\tfor (j = 0; j < 3; j ++)\n\t\t\t\t$($vase).append(\n\t\t\t\t\t$('<img/>').attr('src', 'img/empty_vase.png')\n\t\t\t\t\t\t.addClass('icon--small empty_vase')\n\t\t\t\t);\n\n\t\t\tvar $upperBoard = $('<div/>').append(\n\t\t\t\t// name \n\t\t\t\t$('<span/>').text(players[i].username)\n\t\t\t\t\t.addClass('player_name'), \n\t\t\t\t// money\n\t\t\t\t$('<img/>').attr('src','img/money_icon.png')\n\t\t\t\t\t.addClass('icon--small'),\n\t\t\t\t$('<span/>').text(players[i].money)\n\t\t\t\t\t.addClass('player_money'),\n\t\t\t\t// score\n\t\t\t\t$('<img/>').attr('src','img/score_icon.png')\n\t\t\t\t\t.addClass('icon--small'),\n\t\t\t\t$('<span/>').text(players[i].score)\n\t\t\t\t\t.addClass('player_score'),\n\t\t\t\t// time\n\t\t\t\t$('<img/>').attr('src','img/time_icon.png')\n\t\t\t\t\t.addClass('icon--small'),\n\t\t\t\t$('<span/>').text(players[i].time)\n\t\t\t\t\t.addClass('player_time'),\n\t\t\t\t$('<br>'),\n\t\t\t\t$vase\n\t\t\t);\n\n\t\t\tvar $lowerBoard = $('<div/>').append(\n\t\t\t\t// ribbons\n\t\t\t\t$('<img/>').attr('src','img/ribbon_icon.png')\n\t\t\t\t\t.addClass('icon--small'),\n\t\t\t\t$('<span/>').text(players[i].numRibbons)\n\t\t\t\t\t.addClass('player_ribbon'),\n\t\t\t\t// action cubes\n\t\t\t\t$('<img/>').attr('src','img/action_cube_icon.png')\n\t\t\t\t\t.addClass('icon--small'),\n\t\t\t\t$('<span/>').text(players[i].actionCubes)\n\t\t\t\t\t.addClass('player_action_cube'),\n\t\t\t\t// number of played cards\n\t\t\t\t$('<img/>').attr('src','img/played_cards_icon.png')\n\t\t\t\t\t\t.addClass('icon--small'),\n\t\t\t\t$('<span/>').text(0)\n\t\t\t\t\t.addClass('player_number_played_cards'),\n\t\t\t\t\n\t\t\t\t$('<br>')\n\t\t\t);\n\n\t\t\tfor (j = 1; j < 4; j ++) {\n\t\t\t\tvar starColor = players[i].bonus[j-1] + 1;\n\t\t\t\t$lowerBoard.append(\n\t\t\t\t\t$('<img/>').attr('src', 'img/bonus_icon' + j + '.png')\n\t\t\t\t\t\t.addClass('icon--small')\n\t\t\t\t\t\t.css('background-color', shopColors[starColor]),\n\t\t\t\t\t$('<span/>').text(0)\n\t\t\t\t\t\t.addClass('bonus_star')\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$($board).append(\n\t\t\t\t$upperBoard,\n\t\t\t\t$lowerBoard\n\t\t\t);\n\t\t\t$($lowerBoard).css({\n\t\t\t\t\t'background-color': playerColors[i],\n\t\t\t\t\t'z-index': 0\n\t\t\t\t})\n\t\t\t\t.addClass('lower_opponent_board')\n\t\t\t\t.hide();\n\n\t\t\t$('#opponent_board_area').append($board);\n\t\t\tplayers[i].addBoard($board);\n\t\t}\n\n\t\t$('#opponent_board_area').append(\n\t\t\t$('<button/>').text('More')\n\t\t\t\t.addClass('button button--expand_opponent_board')\n\t\t);\n\t// add info to your board at the bottom of the screen\n\t$('#my_board').css('background-color', playerColors[myID])\n\t\t.val(myID);\n\n\t$('#my_name .player_name').text(myusername);\n\n\t// starting resources\n\t$('#my_money .player_money').text(players[myID].money);\n\t$('#my_score .player_score').text(0);\n\t$('#my_ribbon .player_ribbon').text(players[myID].numRibbons);\t\n\t$('#my_action_cube .player_action_cube').text(0);\n\n\t// time_track\n\t$('#my_time_track').append(\n\t\t$('<img/>').attr('src','img/time_track0.png')\n\t\t\t.addClass('time_track_image')\n\t)\n\n\t// the rest\n\t$('#my_number_played_cards span').text(0);\n\t\n\tfor (i = 1; i < 4; i ++) {\n\t\tvar starColor = players[myID].bonus[i-1] + 1;\n\t\t$('#bonus_icon' + i).css('background-color', shopColors[starColor])\n\t\t\t.append(\n\t\t\t\t$('<img/>').attr('src', 'img/bonus_icon' + i + '.png')\n\t\t\t\t\t.addClass('icon')\n\t\t\t\t\t.attr('title', bonusTypeString[i-1])\n\t\t\t);\n\t\t\n\t\t$('#my_bonus' + i).css('background-color', shopColors[starColor])\n\t\t\t.append(\n\t\t\t\t$('<span/>').text(0)\n\t\t\t\t\t.addClass('bonus_star'),\n\t\t\t\t$('<img/>').attr('src', 'img/star_icon' + starColor + '.png')\n\t\t\t\t\t.addClass('icon--small')\n\t\t\t);\n\n\t\t$('#my_vase').append(\n\t\t\t$('<img/>').attr('src', 'img/empty_vase.png')\n\t\t\t\t.addClass('empty_vase')\n\t\t);\n\t}\n\n\t// add tool tokens and popup area that shows all tools with all levels\n\tshops = [[],[],[],[],[],[]];\n\tfor (i = 0; i < 6; i ++)\n\t\tshops[5].push(\n\t\t\tnew toolToken(i)\n\t\t);\n\t\t\n\t$('#tool_lookup').append(\n\t\t$('<button/>').text('Close')\n\t\t\t.addClass('button--expand_tool')\n\t);\n\n\tfor (i = 0; i < 3; i ++ ) {\n\t\t$('#tool_lookup').append(\n\t\t\t$('<br>'),\n\t\t\t$('<span/>').text('level ' + i).css('color', 'white')\n\t\t);\n\t\t$('#tool_lookup').append($('<br>'));\n\t\tfor (j = 0; j < 6; j ++) {\n\t\t\t$('#tool_lookup').append(\n\t\t\t\t$(\"<img/>\")\n\t\t\t\t\t.attr('src', 'img/tool' + j + 'lv' + i + '.jpg' )\n\t\t\t\t\t.addClass('tool--large')\n\t\t\t\t\t.val(i)\n\t\t\t);\n\t\t}\n\t}\n\n\t // add as many achievements as the number of players\n\t$('#achievement_area').empty();\n\t$('#achievement_area--large').empty();\n\t$('#achievement_area').append(\n\t\t$('<span/>').text('Achievements'),\n\t\t$('<br>'),\n\t\t$('<button/>').text('Expand')\n\t\t\t.addClass('button button--expand_achievement')\n\t\t\t.css({'position':'absolute','top':'0'})\n\t);\n\n\tfor (i = 0; i < achievements.length; i ++) {\n\t\tvar type = achievements[i].type;\n\t\tvar $accard = \n\t\t$('#achievement_area').append(\n\t\t\t$('<img/>').attr('src','img/achievement' + type + '.png')\n\t\t\t\t.addClass('achievement_card')\n\t\t\t\t.data({\n\t\t\t\t\ttype: type,\n\t\t\t\t\tindex: i\n\t\t\t\t}),\n\t\t\t$('<span/>').addClass('achievement_claimer_token')\n\t\t);\n\n\t\t$('#achievement_area--large').append(\n\t\t\t$('<img/>').attr('src','img/achievement' + type + '.png')\n\t\t\t\t.addClass('achievement_card--large')\n\t\t\t\t.data({\n\t\t\t\t\ttype: type,\n\t\t\t\t\tindex: i\n\t\t\t\t})\n\t\t);\n\t}\n\n\t$('#achievement_area--large').append(\n\t\t$('<button/>').text('Close')\n\t\t\t.addClass('button button--expand_achievement')\n\t);\n\n\t// initialize board component\n\tplayers[myID].addBoard(\n\t\t$('#my_board')\n\t);\n}", "function onload()\r\n{\r\n\tarr=[[0,0,0],[0,0,0],[0,0,0]];\r\n\tp1=\"computer\";\r\n\tp2=\"player\";\r\n\tmatcheswon1=0;\r\n\tmatcheswon2=0;\r\n\tmatchesdrawn=0;\r\n\tnochances=0;\r\n\tplayerchancelegal=1;\r\n\tplayerschance=oneortwo();\r\n\tfirstmoveplayer=playerschance;\r\n\tupdateplayersname();\r\n\tresetcell(10);\r\n\tresetcell(11);\r\n\tupdateindex();\r\n\tstartgame();\r\n}", "function load(){\n game.loadingBar();\n}", "function handleGamePlay(){\n if (this.readyState == 4 && this.status == 200) {\n var response = JSON.parse(this.responseText);\n // Update the board with this data\n for (var id in response) {\n var el = document.getElementById(id)\n if (el !== null) {\n el.innerHTML = response[id];\n }\n }\n \n kikuNotify(\"<div class='player-move'>\" + response['player-move-description'] + \"</div><div class='computer-move'>\" + response['computer-move-description'] + \"</div>\", true)\n }\n }", "initializeBoard(data) {\n \n this.boardState = JSON.parse(data.target.response)[0];\n this.whitePieces = JSON.parse(data.target.response)[1];\n this.blackPieces = JSON.parse(data.target.response)[2];\n this.playerTurn = JSON.parse(data.target.response)[3];\n\n\n }", "function loadBoard(onlyContents) {\n var params = {id: $stateParams.boardID};\n if (onlyContents) {\n Board.loadContents($scope.board, true, true);\n } else {\n Board.get(params, function(board) {\n $scope.board = board;\n Board.loadContents(board, true, true);\n });\n }\n }", "function loadLevel(mapInfoFile) {\n\n mapReady = false;\n playerWon = false;\n\n setup();\n\n\n /*======CONNECT TO JSON FILE=======*/\n $.getJSON(mapInfoFile, function(data) {\n console.log(\"loading level\");\n //ARRAY OF MOVES \n playerMoves = data.playerMoves;\n\n //POSITION OF DESTINATION/FINAL PIPE\n endX = data.end.x * cellSize;\n endY = data.end.y * cellSize;\n\n //STARTING PIPE POSITION\n // startX = data.start.x * cellSize;\n // startY = data.start.y * cellSize;\n\n //INFORMATION FOR ALL DIFFERENT OBSTACLES\n obstaclesInfo = data.obstaclesInfo;\n\n //OBSTACLE POSITIONS\n for (var i = 0; i < obstaclesInfo.length; i++) {\n console.log(\"ready to work\");\n console.log(obstaclesInfo[i]);\n var coordinateX = obstaclesInfo[i].coordinates.x;\n var coordinateY = obstaclesInfo[i].coordinates.y;\n for (var j = 0; j < obstaclesInfo[i].relativeShape.length; j++) {\n var relativeX = obstaclesInfo[i].relativeShape[j].x;\n var relativeY = obstaclesInfo[i].relativeShape[j].y;\n obstaclesList.push({ x: coordinateX + relativeX, y: coordinateY + relativeY });\n }\n }\n\n //Number of pipes left\n pipesRemaining = data.pipesRemaining;\n\n //FINAL PLAYER ENDPOINT\n destinationX = data.destination.x;\n destinationY = data.destination.y;\n\n enemies = data.enemyInfo;\n\n /*=======LOAD IMAGES=======*/\n bg = loadImage(\"assets/background.png\");\n user = loadImage(\"assets/user.png\");\n endPipe = loadImage(\"assets/end.png\");\n gameOver = loadImage(\"assets/loser.png\");\n winner = loadImage(\"assets/winnerTwo.png\");\n crack = loadImage(\"assets/crack.png\");\n brrr = loadImage(\"assets/frozen.png\");\n final = loadImage(\"assets/final.png\");\n\n for (i = 0; i < obstaclesInfo.length; i++) {\n obstaclesInfo[i][\"img\"] = loadImage(obstaclesInfo[i].artwork);\n }\n\n for (i = 0; i < enemies.length; i++) {\n enemies[i][\"img\"] = loadImage(enemies[i].artwork);\n enemies[i][\"currentCoordinates\"] = enemies[i].startCoordinates;\n enemies[i][\"currentDirection\"] = Math.random();\n }\n\n //UNCOMMENT FOR BACKGROUND SOUNDTRACK\n // track.play();\n\n //SETUP 2D OBSTACLE AND PIPE ARRAYS\n for (var i = 0; i < COLUMNS; i++) {\n pipes[i] = [];\n obstacles[i] = [];\n for (var j = 0; j < ROWS; j++) {\n pipes[i][j] = \"empty\";\n obstacles[i][j] = \"empty\";\n }\n }\n\n //STORING OBSTACLES INTO OBSTACLE ARRAY\n\n for (var i = 0; i < obstaclesList.length; i++) {\n obstacles[obstaclesList[i].x][obstaclesList[i].y] = \"occupied\";\n }\n\n mapReady = true;\n\n });\n}", "function load() {\n\n\n convertToIndex();\n buildGraph();\n graph.consolePrintGraph();\n gameIntro();\n $(\"#newGame\").click(start);\n}", "function initGame() {\r\n renderLevels()\r\n gGame = {\r\n isOn: true,\r\n isFirstClick: true,\r\n\r\n }\r\n gBoard = buildBoard();\r\n renderBoard(gBoard);\r\n startTimer()\r\n\r\n}", "function load() {\n if (generate) return\n\n\n const canvas = canvasRef.current;\n canvas.width = width;\n canvas.height = height;\n ctx.current.clearRect(0, 0, canvasRef.current.width, canvasRef.current.height);\n let resGrid = buildGrid()\n\n let colDiff = Math.round((resGrid.length - loadGrid.grid.length) / 2)\n let rowDiff = Math.round((resGrid[0].length - loadGrid.grid[0].length) / 2)\n\n if (resGrid.length > loadGrid.grid.length) {\n for (let col = 0; col < loadGrid.grid.length; col++) {\n for (let row = 0; row < loadGrid.grid[col].length; row++) {\n resGrid[col + colDiff][row + rowDiff] = loadGrid.grid[col][row]\n }\n }\n setGrid(resGrid)\n } else {\n for (let col = 0; col < resGrid.length; col++) {\n for (let row = 0; row < resGrid[col].length; row++) {\n resGrid[col][row] = loadGrid.grid[col - colDiff][row - rowDiff];\n }\n }\n\n setGrid(resGrid)\n }\n renderLifeBox()\n genCount.current = 0\n }", "function init(){\n board = new Array(9).fill(null);\n turn = 1;\n winner = false;\n render();\n}", "initBoard () {\n\t\tthis.clearBoard();\n\t\t/* Init piece-list */\n\t\t/* White */\n\t\tthis.pieces = [\n\t\t\tnew Lance(COLOR.WHITE, position.toIdx(1, 'a')),\n\t\t\tnew Knight(COLOR.WHITE, position.toIdx(2, 'a')),\n\t\t\tnew Silver(COLOR.WHITE, position.toIdx(3, 'a')),\n\t\t\tnew Gold(COLOR.WHITE, position.toIdx(4, 'a')),\n\t\t\tnew King(COLOR.WHITE, position.toIdx(5, 'a')),\n\t\t\tnew Gold(COLOR.WHITE, position.toIdx(6, 'a')),\n\t\t\tnew Silver(COLOR.WHITE, position.toIdx(7, 'a')),\n\t\t\tnew Knight(COLOR.WHITE, position.toIdx(8, 'a')),\n\t\t\tnew Lance(COLOR.WHITE, position.toIdx(9, 'a')),\n\t\t\tnew Rook(COLOR.WHITE, position.toIdx(2, 'b')),\n\t\t\tnew Bishop(COLOR.WHITE, position.toIdx(8, 'b')),\n\t\t];\n\t\tfor (let i = 1; i <= NUM_COLS; i++) {\n\t\t\tthis.pieces.push(new Pawn(COLOR.WHITE, position.toIdx(i, 'c')));\n\t\t}\n\t\t/* Black */\n\t\tthis.pieces = this.pieces.concat([\n\t\t\tnew Lance(COLOR.BLACK, position.toIdx(1, 'i')),\n\t\t\tnew Knight(COLOR.BLACK, position.toIdx(2, 'i')),\n\t\t\tnew Silver(COLOR.BLACK, position.toIdx(3, 'i')),\n\t\t\tnew Gold(COLOR.BLACK, position.toIdx(4, 'i')),\n\t\t\tnew King(COLOR.BLACK, position.toIdx(5, 'i')),\n\t\t\tnew Gold(COLOR.BLACK, position.toIdx(6, 'i')),\n\t\t\tnew Silver(COLOR.BLACK, position.toIdx(7, 'i')),\n\t\t\tnew Knight(COLOR.BLACK, position.toIdx(8, 'i')),\n\t\t\tnew Lance(COLOR.BLACK, position.toIdx(9, 'i')),\n\t\t\tnew Rook(COLOR.BLACK, position.toIdx(2, 'h')),\n\t\t\tnew Bishop(COLOR.BLACK, position.toIdx(8, 'h')),\n\t\t]);\n\t\tfor (let i = 1; i <= NUM_COLS; i++) {\n\t\t\tthis.pieces.push(new Pawn(COLOR.BLACK, position.toIdx(i, 'g')));\n\t\t}\n\n\t\t/* Put pieces on board */\n\t\tthis.pieces.forEach((piece) => {\n\t\t\tthis.putPiece(piece, piece.pos);\n\t\t});\n\t}", "function newGame() {\n //hide game over screen\n $(\"#finish\").remove();\n //show board\n $(\"#board\").show();\n\n //reset variables, classes and attributes\n playerOne = [];\n playerTwo = [];\n moveCounter = 0;\n $('.box').css('background-image', 'none'); //clear background images\n \t\t$('#player1').addClass('active'); //set player one to active\n $(\"li.box\").removeAttr(\"clicked\").removeClass(\"box-filled-1 box-filled-2 filled\");\n $(\"li.box\").removeClass(\"box-filled-1 box-filled-2 filled\");\n\n //invoke previous game choice\n //board(playerOneName, playerTwoName);\n }", "function startGame(){\n getDictionary();\n var state = $.deparam.fragment();\n options.variant = state.variant || options.variant;\n makeGameBoard();\n loadState();\n }", "function init() {\n canvas = $(\"#board\").get(0);\n ctx = canvas.getContext(\"2d\");\n boardDiv = $(\"#div_game\");\n\n for (let color of [cRed, cGreen, cPurple]) {\n for (let shape of [sDiamond, sWave, sOval]) {\n for (let fill of [fEmpty, fPartial, fSolid]) {\n for (let count of [1, 2, 3]) {\n //console.log(count + \" \" + color + \" \" + fill + \" \" + shape);\n board.deck.push({color: color, shape: shape, fill: fill, count: count});\n }\n }\n }\n }\n shuffle(board.deck);\n\n while (board.inPlayMain.length < 12) {\n board.inPlayMain.push(board.deck.pop());\n console.log(\"Board now has \" + board.inPlayMain.length + \" inPlayMain\");\n }\n\n if (!isSetAvailable()) {\n needExtraCards();\n }\n\n resizedWindow();\n drawBoard();\n\n //canvas.onclick = clickedBoard;\n}", "function create_game_board(){\n update_number_of_players();\n create_player_areas();\n // create new game\n game_instance.deal_cards();\n \n render_cards();\n apply_card_event_handlers();\n \n game_instance.determine_winners();\n // determine_winners();\n // show_best_hands(); //for diagnostics\n }", "function loadGameFromServerFEN(xhttp) {\n playerInfo.playingAs = parseServerResponseFor(xhttp.responseText, \"Colour\").toLowerCase();\n board.load(parseServerResponseFor(xhttp.responseText, \"FEN\"));\n }", "function onBoardClick() {\n if (!hasStarted) {\n startGame();\n } else {\n startPause();\n }\n }", "function load() {\n clearObjects(\"monsters\");\n clearObjects(\"monsterbullets\");\n clearObjects(\"goodthings\");\n clearObjects(\"bullets\");\n\n bulletsLeft = NUM_BULLETS;\n updateBulletsNumber();\n\n player = new Player();\n\n addLevel();\n goodThingsLeft = NUM_GOOD_THINGS;\n\n resetPlatforms();\n createPortals();\n\n for (i = 0; i < numMonsters; ++i) {\n createMonster(i == 0);\n }\n\n for (i = 0; i < NUM_GOOD_THINGS; ++i) {\n createGoodThing();\n }\n\n // Attach keyboard events\n document.addEventListener(\"keydown\", keydown, false);\n document.addEventListener(\"keyup\", keyup, false);\n\n startTimer();\n}", "function loadGame() {\n\ttry {\n\t\tvar gameArray = [];\n\t\t\n\n\t\tfor (var i = 0; i < gameList.length; i++) {\n\t\t\tif (gameList[i].Notification == 1) {\n\n\t\t\t\t//Ti.API.info('gameIcons', \"/images/gameIcons/\" + \"C\" + gameList[i].CTestID + \".png\");\n\n\t\t\t\tgameArray.push({\n\t\t\t\t\ttemplate : \"gameListTemplate\",\n\n\t\t\t\t\tgameNameLabel : {\n\t\t\t\t\t\ttext : gameList[i].CTestName\n\t\t\t\t\t},\n\t\t\t\t\ticonImage : {\n\t\t\t\t\t\timage : \"/images/gameIcons/\" + \"C\" + gameList[i].CTestID + \".png\"\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\t$.lstSection.setItems(gameArray);\n\n\t} catch(ex) {\n\t\tcommonFunctions.handleException(\"welcomeContentScreen\", \"loadGame\", ex);\n\t}\n}", "function renderBoard() {\n model.checkGameStatus();\n model.toString();\n model.checkGameStatus();\n }", "function handleReadyButton(event) {\r\n //If the game is already past set up, the ready button does nothing\r\n if (state.phase !== 'setup') {\r\n return;\r\n }\r\n let unplacedShips = 0;\r\n for (let ship in playerShipState) {\r\n unplacedShips += playerShipState[ship].counter\r\n }\r\n if (unplacedShips !== 0) {\r\n return;\r\n } else {\r\n state.phase = 'pending';\r\n setUpEnemyBoard();\r\n state.phase = 'playing';\r\n event.target.textContent = 'PLAYING!';\r\n sinkMessageEl.textContent = ``;\r\n sinkMessageEl.style.backgroundColor = 'transparent';\r\n render();\r\n }\r\n}", "startGame() {\n this.playerOne = new Player(p1Name, true);\n this.playerTwo = new Player(p2Name, false);\n this.masterBoardArray = this.playerOne.boardArray.concat(this.playerTwo.boardArray);\n this.render();\n }", "resetBoard() {\n this._gameBoard = [\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",];\n this._gameOver = false;\n this._tiedGame = false;\n this.changePlayer(); //alternate between starting players \n }", "function loadBattleScreen(hero,enemy) {\n// use of this function could be pared down...\n// currently all of this is reloaded after every attack.\n// revisit this in the case of performance issues\n\n\t/* load hero data */\n\tloadHeroLvl(hero);\n\tloadHeroHp(hero);\n\tloadHeroExp(hero);\n\tloadHeroAttacks(hero,enemy);\n \n\t/* load enemy data */\n\tloadEnemyImage(enemy);\n\tloadEnemyName(enemy);\n\tloadEnemyLvl(enemy);\n\tloadEnemyHp(enemy);\n\t\n\t// Idea: determine which enemy the data will be brought in from\n\t//\n\t// - this is a function or something that will return the name of the enemy\n\t// - var minion = function();\n\t// - the minion variable will be used to build the object reference for the enemy.\n}", "function startGame(){\n\tif(!$.editor.enable){\n\t\tfor(n=0;n<levels_arr.length;n++){\n\t\t\t$.stage[n].visible = false;\n\t\t}\n\t\t$.stage[gameData.levelNum].visible = true;\n\t}\n\t\n\tgameData.planes = [];\n\tgameData.runway = [];\n\tgameData.types = [];\n\tgameData.typeCount = 0;\n\tgameData.countPlane = 0;\n\tgameData.totalPlane = levels_arr[gameData.levelNum].level.total;\n\tgameData.speed = levels_arr[gameData.levelNum].level.speed;\n\tgameData.nextPlaneTimer = levels_arr[gameData.levelNum].level.planTimer;\n\tgameData.stageComplete = false;\n\t\n\tplayerData.score = playerData.displayScore = 0;\n\tplayerData.total = 0;\n\tupdateStatus();\n\t\n\tfor(var n=0;n<levels_arr[gameData.levelNum].runway.length;n++){\n\t\tcreateRunway(false, levels_arr[gameData.levelNum].runway[n].type, levels_arr[gameData.levelNum].runway[n].x, levels_arr[gameData.levelNum].runway[n].y, levels_arr[gameData.levelNum].runway[n].rotation);\n\t\t\n\t\tfor(var t=0;t<levels_arr[gameData.levelNum].runway[n].planes.length;t++){\n\t\t\tgameData.types.push(levels_arr[gameData.levelNum].runway[n].planes[t]);\t\t\n\t\t}\n\t}\n\t\n\tgameData.types = unique(gameData.types);\n\tshuffle(gameData.types);\n\t\n\tTweenMax.ticker.useRAF(false);\n\tTweenMax.lagSmoothing(0);\n\n\titemBoom.visible = false;\n\tcompleteContainer.visible = false;\n\t\n\tif(gameData.tutorial){\n\t\tgameData.tutorial = false;\n\t\ttoggleTutorial(true);\n\t}else{\n\t\tstartPlaneTimer(0);\n\t\tgameData.paused = false;\n\t}\n}", "function doneLoading(e)\n{\n // Create all sprite sheets\n createPlayerSheet();\n createEnemySheet();\n createBackgroundSheet()\n createTileSheet();\n createWaveSheet();\n createDoorSheet();\n createBulletSheet();\n\n // Place the background\n for(let i = 0; i < 8; i++)\n {\n createBackground(i * 600, 0);\n }\n\n // Load in the level\n loadLevel();\n\n\n\n // Start the game loop\n app.ticker.add(gameLoop);\n \n}", "function loadGameStateChangeStarter() {\n store.dispatch( {\n type: GAME_LOAD,\n payload: {\n savedData: savedData\n }\n });\n }", "function preload () {\n window.width = GAME_WIDTH;\n window.height = GAME_HEIGHT;\n gameFont = loadFont('data/fonts/GameOverFont.ttf');\n\n screens.push(new Background());\n screens.push(new Menu());\n screens.push(new Highscores());\n screens.push(new GameLauncher());\n screens.push(new Weather());\n /*game itself will be added from game launcher\n /*in order to maintain access to it from there */\n screens.push(createCancelButton());\n}", "function init() {\n //go through menus\n menus = true;\n //choosing play style\n choosingStyle = true;\n //Display text and buttons\n AI.DecidePlayStyle();\n //load the board and interactable cubes\n LoadBoard();\n LoadInteractables();\n}", "function startGame () {\n // check to see if everything has been loaded\n let everythingLoaded = true;\n Object.keys(loading).forEach(function (key) {\n if (!loading[key]) everythingLoaded = false;\n });\n\n // only join the Oasis and start ticking/rendering if all game data has been loaded\n if (everythingLoaded) {\n // THE WHOLE GAME HAS LOADED\n joinGame();\n\n // start game loop\n startGameLoop(tick, render, 60);\n }\n}", "function displayBoards() {\n displayGameBoard();\n displayPlayerBoard();\n displayExpeditions();\n}", "function windowLoad() {\n\tdraw(startX, startY, startDirection);\n\tkarel[startX][startY] = true;\n//\tcheckWallAround(startX, startY);\n//\tcheckBeepersPresent(startX, startY);\n//\tloadDatabase();\n}", "function run () {\n var $canvasBox;\n \n $('#newGameLink').removeAttr('disabled'); // can click new game link\n\n if (m.debug > m.NODEBUG) { console.log('screens.gameScreen.run'); }\n \n if (needsInit) {\n \n // disable mouse events on canvas and halt the game loop when we return to the menu\n $('#gameMenuLink')\n .click( function (event) {\n m.playtouch.unhookMouseEvents();\n m.Model.stopGameNow();\n m.Audio.beQuiet();\n m.screens.showScreen('menuScreen');\n });\n \n // shuffle and deal if we ask nicely\n $('#newGameLink')\n .click( function (event) {\n // disallow double-clicks, also disabled in the model while dealing\n if ( $(this).attr('disabled') === 'disabled' ) { return false; } \n $(this).attr('disabled', 'disabled'); \n // if you start a new game before winning, give 'em the not impressed face\n if (m.Settings.getPlaySounds() && !hasWon) {\n m.Sounds.playSoundFor(m.Sounds.QUIT);\n }\n \n // now we play\n setTimeout( function() {\n m.Model.stopGameNow();\n m.screens.showScreen('gameScreen');\n }, m.Settings.Delays.Quit);\n return false;\n });\n \n }\n needsInit = false;\n \n // start the game animation loop\n m.gameloop.setLoopFunction(m.view.refreshDisplay);\n \n // start a new game\n m.view.newGame($('#gameViewBox'));\n \n // hook up event handling\n m.playtouch.hookMouseEvents(); \n\n // resize the game pane if needed after a short delay\n $(window)\n .resize(function (event) {\n setTimeout( function () {\n mikeycell.view.setMetrics();\n }, 500);\n });\n\n }", "function initialise() {\n\tboard = new Board();\n\n\tvar handler = createDiv();\n\thandler.parent('#bagh-chal');\n\thandler.id('handler');\n\n\t// --- Game Properties ---\n\tvar propertiesDiv = createDiv();\n\tpropertiesDiv.child(createElement('h3', 'Game'));\n\tpropertiesDiv.parent('#handler');\n\tpropertiesDiv.id('properties');\n\n\t// Turn\n\tvar turnSpan = createSpan('Turn: ');\n\tturnSpan.parent('#properties');\n\tturnSpan.child(turnP = createP('?'));\n\n\t// Goats In-Hand\n\tvar goatsInHandSpan = createSpan('Goats In-Hand: ');\n\tgoatsInHandSpan.parent('#properties');\n\tgoatsInHandSpan.child(goatsInHandP = createP('?'));\n\n\t// Goats Captured\n\tvar goatsCapturedSpan = createSpan('Goats Captured: ');\n\tgoatsCapturedSpan.parent('#properties');\n\tgoatsCapturedSpan.child(goatsCapturedP = createP('?'));\n\n\t// Tigers Trapped\n\tvar tigersTrappedSpan = createSpan('Tigers Trapped: ');\n\ttigersTrappedSpan.parent('#properties');\n\ttigersTrappedSpan.child(tigersTrappedP = createP('?'));\n\n\t// Status\n\tvar statusSpan = createSpan('Status: ');\n\tstatusSpan.parent('#properties');\n\tstatusSpan.child(statusP = createP('Running').class('running'));\n\n\t// --- Controls ---\n\tvar controlsDiv = createDiv();\n\tcontrolsDiv.parent('#handler');\n\tcontrolsDiv.id('controls');\n\tcontrolsDiv.child(createElement('h3', 'Controls'));\n\n\t// Game Mode\n\tcontrolsDiv.child(gameMode = createSelect());\n\tgameMode.option('Game Mode');\n\tgameMode.option('Player vs Player', 0);\n\tgameMode.option('Player vs AI', 1);\n\tgameMode.option('AI vs AI', 2);\n\tgameMode.value(1);\n\tgameMode.changed(updateHandler);\n\n\t// Play As\n\tcontrolsDiv.child(playAsSelect = createSelect());\n\tplayAsSelect.option('Play As');\n\tplayAsSelect.option('Tiger', 0);\n\tplayAsSelect.option('Goat', 1);\n\tplayAsSelect.value(playAsTiger ? 0 : 1);\n\tplayAsSelect.changed(changePlayAs);\n\n\t// Goat Algorithm/Depth\n\tcontrolsDiv.child(goatP = createP('Goat'));\n\tcontrolsDiv.child(goatAlgorithm = createSelect());\n\tgoatAlgorithm.option('Algorithm');\n\tgoatAlgorithm.option('Minimax', 0);\n\tgoatAlgorithm.option('Alpha-Beta', 1);\n\tgoatAlgorithm.option('MCTS', 2);\n\tgoatAlgorithm.value(1);\n\tgoatAlgorithm.changed(updateHandler);\n\n\tcontrolsDiv.child(goatDepth = createSelect());\n\tgoatDepth.option('Depth');\n\tgoatDepth.option('Depth 1 (Very Easy)', 1);\n\tgoatDepth.option('Depth 2 (Easy)', 2);\n\tgoatDepth.option('Depth 3 (Moderate)', 3);\n\tgoatDepth.option('Depth 4 (Hard)', 4);\n\tgoatDepth.option('Depth 5 (Very Hard)', 5);\n\tgoatDepth.value(3);\n\tgoatDepth.changed(reset);\n\n\tcontrolsDiv.child(goatTime = createSelect());\n\tgoatTime.option('Time');\n\tgoatTime.option('2s', 2);\n\tgoatTime.option('4s', 4);\n\tgoatTime.option('6s', 6);\n\tgoatTime.option('8s', 8);\n\tgoatTime.option('10s', 10);\n\tgoatTime.value(2);\n\tgoatTime.changed(reset);\n\n\t// Tiger Algorithm/Depth\n\tcontrolsDiv.child(tigerP = createP('Tiger'));\n\tcontrolsDiv.child(tigerAlgorithm = createSelect());\n\ttigerAlgorithm.option('Algorithm');\n\ttigerAlgorithm.option('Minimax', 0);\n\ttigerAlgorithm.option('Alpha-Beta', 1);\n\ttigerAlgorithm.option('MCTS', 2);\n\ttigerAlgorithm.value(1);\n\ttigerAlgorithm.changed(updateHandler);\n\n\tcontrolsDiv.child(tigerDepth = createSelect());\n\ttigerDepth.option('Depth');\n\ttigerDepth.option('Depth 1 (Very Easy)', 1);\n\ttigerDepth.option('Depth 2 (Easy)', 2);\n\ttigerDepth.option('Depth 3 (Moderate)', 3);\n\ttigerDepth.option('Depth 4 (Hard)', 4);\n\ttigerDepth.option('Depth 5 (Very Hard)', 5);\n\ttigerDepth.value(3);\n\ttigerDepth.changed(reset);\n\n\tcontrolsDiv.child(tigerTime = createSelect());\n\ttigerTime.option('Time');\n\ttigerTime.option('2s', 2);\n\ttigerTime.option('4s', 4);\n\ttigerTime.option('6s', 6);\n\ttigerTime.option('8s', 8);\n\ttigerTime.option('10s', 10);\n\ttigerTime.value(2);\n\ttigerTime.changed(reset);\n\n\t// Delay\n\tdelaySpan = createSpan('Min. Simulation Delay');\n\tdelaySpan.parent('#controls');\n\tdelaySpan.child(delaySlider = createSlider(0, 500, 250));\n\n\t// Reset\n\tcontrolsDiv.child(resetButton = createButton('Reset'));\n\tresetButton.mousePressed(reset);\n\n\t// Pause\n\tcontrolsDiv.child(pauseButton = createButton('Pause'));\n\tpauseButton.mousePressed(togglePause);\n\n\t// --- AI Debugging ---\n\tdebuggingDiv = createDiv();\n\tdebuggingDiv.parent('#handler');\n\tdebuggingDiv.id('debugging');\n\tdebuggingDiv.child(createElement('h3', 'AI Debugging'));\n\n\t// Iterations\n\tvar iterationsSpan = createSpan('Iterations: ');\n\titerationsSpan.parent('#debugging');\n\titerationsSpan.child(countP = createP('?'));\n\n\t// Time\n\tvar timeSpan = createSpan('Time to Run: ');\n\ttimeSpan.parent('#debugging');\n\ttimeSpan.child(timeP = createP('?'));\n\n\t// Score\n\tvar scoreSpan = createSpan('Score/Wins: ');\n\tscoreSpan.parent('#debugging');\n\tscoreSpan.child(scoreP = createP('?'));\n\n\t// Tiger Wins\n\t//var scoreSpan = createSpan('Tiger Wins: ');\n\t//scoreSpan.parent('#debugging');\n\t//scoreSpan.child(tigerWinsP = createP('?'));\n\n\t// Goat Wins\n\t//var scoreSpan = createSpan('Goat Wins: ');\n\t//scoreSpan.parent('#debugging');\n\t//scoreSpan.child(goatWinsP = createP('?'));\n\n\t// Draws\n\t//var scoreSpan = createSpan('Draws: ');\n\t//scoreSpan.parent('#debugging');\n\t//scoreSpan.child(drawsP = createP('?'));\n\n\t// Update what's disabled/hidden\n\t$('select > option:first-child').attr('disabled', true);\n\tupdateHandler();\n}", "function load_game(){\n $.ajax({\n type: \"POST\",\n url: \"backend/load.php\",\n data: {\n },\n dataType: \"text\",\n success: function (d) {\n console.log(\"Game Loaded Successfully\")\n console.log(d)\n var result = $.parseJSON(d);\n board = result[0];\n activeBlock = result[1];\n activeBlock.shapeMatrix = GenerateShape((activeBlock.shapeMatrix - 1) * 10);\n activeBlock.rotation = activeBlock[\"rotation\"]\n for (var i = 0; i < activeBlock.rotation; i++){\n Rotate(-1);\n }\n EraseOldActiveBlockPosition();\n nextBlock[\"shapeMatrixNum\"] = result[2];\n nextBlock.shapeMatrix = GenerateShape((nextBlock.shapeMatrixNum - 1) * 10);\n var other_vars = result[3];\n boardHeight = other_vars[\"boardHeight\"];\n boardWidth = other_vars[\"boardWidth\"];\n changePowerups = other_vars[\"changePowerups\"];\n level = other_vars[\"level\"];\n player_name = other_vars[\"player_name\"];\n score = other_vars[\"score\"];\n\n $('#NewGame').click();\n },\n error: function (error) {\n console.log(\"Error in ajax call for get_high_scores\")\n console.log(error)\n }\n });\n}", "loadGame() {\n this.player = new Player(100, 100);\n this.treasure = new Treasure()\n this.playerImg = loadImage(\"assets/character-down.png\");\n this.treasureImg = loadImage(\"assets/treasure.png\");\n this.score = 0\n this.bg = loadImage(\"assets/background.png\");\n }", "function load(){\n\tvar count;\n\tvar widthh=0;\n\tvar t=0;\n\tvar l=0;\n\tvar bgx=0;\n\tvar bgy=0;\n\tvar space;\n\n\tfor(let count = 0; count < puzzle.length; count++){\n\t\t$(puzzle[count]).addClass(\"puzzlepiece\");\n\t\tpuzzle[count].style.color=\"blue\";\n\t\tpuzzle[count].style.top=t+\"px\";\n\t\tpuzzle[count].style.left=l+\"px\";\n\t\t$(puzzle[count]).css({'background-position':bgx+'px '+bgy+'px'});\n\t\tbgx-=100;\n\n\t\tl+=100;\n\t\twidthh+=1;\n\t\tif(widthh%4==0){\n\t\t\tt+=100;\n\t\t\tl=0;\n\t\t\tbgy-=100;\n\t\t}\n\n\t}\n}", "function load_Game(){\n\nboard.empty()\nwinner_container.empty()\nreset_button.hide()\nactive = true\nplayer1 = true\ncreateBoard(9)\ncurrent_player_show()\n\n\nfunction createBoard(v){\n // Create a div for our current player image\n var current_player_div = $(\"<div></div>\").addClass(\"current_player\")\n \t// Create 3 rows\n for (var i = 0; i < v; i++){\n row = document.createElement(\"div\");\n row.className = \"row \" + \"row\" + i;\n row.setAttribute(\"data-row\", i)\n\n // Create 9 cells\n for(var j=0; j < v; j++){\n\n cell = document.createElement(\"div\");\n \ttoken = document.createElement(\"div\");\n cell.className = \"cell \" + \"cell\" + j;\n cell.setAttribute(\"data-cell\", j)\n token.className = \"token\";\n row.appendChild(cell);\n cell.appendChild(token);\n\n //for adding a number system to the macro board\n // where V is the total number of rows/columns \n // right now v=9 but v could be 27\n // \n // looks like:\n // 1 2 3\n // 1 x x x\n // 2 x x x\n // 3 x x x\n //\n // I should add some code that says divide by 3 until\n // there are 3 squares added to each class?\n\n\n if(i< (v/3)) {\n \tcell.className += \" BR1\";\n \t\t}\n \t\telse if(i>=(v/3) && i<(2*(v/3))){\n \t\t\tcell.className += \" BR2\";\t\n\t\t\t}else{\n\t\t\t\tcell.className += \" BR3\";\n\t\t\t}\n\n if(j< (v/3)) {\n \tcell.className += \" BC1\";\n \t\t}\n \t\telse if(j>=(v/3) && j<(2*(v/3))){\n \t\t\tcell.className += \" BC2\";\t\n\t\t\t}else{\n\t\t\t\tcell.className += \" BC3\";\n\t\t\t}\n\n }\n\n board.append(row)\n }\n // Create the matrix - Our \"back-end\" logic that connects to the front-end grid we created above.\n // We work with the matrix to deal wth the computations and conditional logic that allows our\n // game to come alive.\n matrix = new Array(9);\n\tfor (var i = 0; i < matrix.length; i++) {\n\t\tmatrix[i] = new Array(9);\n\t}\n\t//create big matrix\n\t\t\n\t//create little matrix\n\t//for storing win conditions\n\tlittlematrix = new Array(3);\n\tfor (var i = 0; i < littlematrix.length; i++) {\n\t\tlittlematrix[i] = new Array(3);\n\t}\n\n\n// Append the div we created at the very start of this function to the HTML generated div.\n// Add the \"my turn\" content that sits next to the image of the cat\n\n winner_container.append(current_player_div)\n current_player = $(\".current_player\")/*\n current_player.html(\"<span>My Turn!</span>\")\n*/\n} //createBoard END\n\n// Check which player's turn it is, then show the relevant image\nfunction current_player_show(){\n\t\n\tif ( player1 === true ) {\n\t\tcurrent_player.removeClass(\"sox\")\n\t\tcurrent_player.addClass(\"snowy\")\n\t} else if ( player1 === false ) {\n\t\tcurrent_player.removeClass(\"snowy\")\n\t\tcurrent_player.addClass(\"sox\")\n\t }\n\n}\n\n//create a function that returns a little row or little collumn value\nfunction little(dataRow,dataCell){\n\tvar LR = (dataRow)%3;\n\tvar LC = (dataCell)%3;\n\t//console.log(dataCell);\n\tvar LRLC=[LR,LC]\n\treturn LRLC;\n}\n\n//create a function that checks if little row, little collumn is full\nfunction full(dataRow,dataCell){\n\tvar LR = (dataRow)%3;\n\tvar LC = (dataCell)%3;\n\tfor (var i=0; i<=2;i++){\n\tif (typeof matrix[3*LR+i][3*LC] === 'undefined' || typeof matrix[3*LR][3*LC+i] === 'undefined' || typeof matrix[3*LR+i][3*LC+i] === 'undefined'){\n\t\treturn false;\n\t}\n\t\n\t}\n\tconsole.log('true?')\n\n\t\n\n}\n\n\n\n// When a user clicks on a cell\n$( \".cell\" ).click(function() {\n\n\t\n\tclickedRow = $(this).parent().attr('data-row') \n\tclickedCell = $(this).attr(\"data-cell\")\n\ttoken = $(this).find('div')\n\t\n\tvalid = true;\n\t\n\n\t// Check first if that square is already occupied, in this case alert the user to try another cell\n\tif ( $(this).find('div').hasClass( \"snowy\" ) || $(this).find('div').hasClass( \"sox\" ) ){\n\t\talert(\"Hey! Stop poking me\")\n\t} \n\n\t//create logic that only allows user to place in bc & br\n\tif(player1 == true || player1 === 'undefined'){\n\t\t//if BRBC is not already full\n\t\t//console.log(full(clickedRow,clickedCell))\n\t\tif (full(clickedRow,clickedCell)== false){\n\t\t//console.log('p1 bc '+clickedCell);\n\t\tP1BRBC= little(clickedRow, clickedCell);\n\t\t//console.log(P1BRBC[0]);\n\n\n\t\t}\n\t\telse{\n\t\tconsole.log('you can go anywhere')\n\t\tP1BRBC=undefined\t\n\t\t}\n\n\n\t\t//console.log('player1 '+'row '+P1BRBC[0]+'column '+P1BRBC[1])\n\t}else if(player1 == false){\n\t\tif (full(clickedRow,clickedCell)== false){\n\n\t\t//console.log(\"why \"+clickedCell);\t\n\t\tP2BRBC= little(clickedRow, clickedCell);\n\n\t\t}\n\t\telse{\n\t\tconsole.log('you can go anywhere')\n\t\tP2BRBC=undefined\t\n\t\t}\n\t\t//console.log('player2')\t\n\t}else{console.log('Too many players?')}\n\n\tif (typeof P2BRBC === 'undefined'){\n\t\t//console.log('first round you can go anywhere');\n\t\t//highlight\n\t\tfunction highlight1(classNameBRBC){\n\t\t\tvar x = document.getElementsByClassName(classNameBRBC);\n\t\t\tvar i;\n\t\t\tfor (i = 0; i < x.length; i++) {\n\t\t\t//instead of changing the background add a class that changes the background\n\t\t\tx[i].className +=' highlight';\n\t\t\t}\n\t\t}\n\t\tif(P1BRBC[0]==0 && P1BRBC[1]==0)\n\t\t{ highlight1(\"BR1 BC1\");}\n\t\telse if(P1BRBC[0]==1 && P1BRBC[1]==0)\n\t\t{ highlight1(\"BR2 BC1\");}\n\t\telse if(P1BRBC[0]==2 && P1BRBC[1]==0)\n\t\t{ highlight1(\"BR3 BC1\");}\n\t\telse if(P1BRBC[0]==0 && P1BRBC[1]==1)\n\t\t{ highlight1(\"BR1 BC2\");}\n\t\telse if(P1BRBC[0]==1 && P1BRBC[1]==1)\n\t\t{ highlight1(\"BR2 BC2\");}\n\t\telse if(P1BRBC[0]==2 && P1BRBC[1]==1)\n\t\t{ highlight1(\"BR3 BC2\");}\n\t\telse if(P1BRBC[0]==0 && P1BRBC[1]==2)\n\t\t{ highlight1(\"BR1 BC3\");}\n\t\telse if(P1BRBC[0]==1 && P1BRBC[1]==2)\n\t\t{ highlight1(\"BR2 BC3\");}\n\t\telse if(P1BRBC[0]==2 && P1BRBC[1]==2)\n\t\t{ highlight1(\"BR3 BC3\");}\n\t}//else if(filled()){ you can go anywhere}\n\telse{\n\t\t//reset board background\n\t\tfunction reset(){\n\t\t\t//only change color of squares that habe not been won\n\t\t\tvar x = document.getElementsByClassName(\"cell\");\n\t\t\tvar i;\n\t\t\tfor (i = 0; i < x.length; i++) {\n\t\t\t\tif ($(x[i]).hasClass('highlight')){\n\t\t\t\t\t//instead remove highlight class\n\t\t\t\t\t$(x[i]).removeClass('highlight');\n\t\t\t\t}\n\t\t\t\telse if ($(x[i]).hasClass('highlight1')){\n\t\t\t\t\t$(x[i]).removeClass('highlight1');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(player1==true && P2BRBC !== undefined){\n\n\t\t\t\t//console.log('player2 '+'row '+P2BRBC[0]+'column '+P2BRBC[1]);\n\t\t\t\tif(P2BRBC[0] == 0 && clickedRow>2){\n\t\t\t\t\t//console.log(\"Hey! Stop poking me you chose big row 2 or 3 and p2 chose little row 1\");\n\t\t\t\t\tvalid=false;\n\t\t\t\t}else if(P2BRBC[0] == 1 && (clickedRow<3 || clickedRow>5)){\n\t\t\t\t\t//console.log(\"Hey! Stop poking me you clicked big Row 1 or 3 and p1 chose little row 1\");\n\t\t\t\t\tvalid=false;\n\t\t\t\t}else if(P2BRBC[0] == 2 && clickedRow<6){\n\t\t\t\t\t//console.log(\"Hey! Stop poking me\");\n\t\t\t\t\tvalid=false;\n\t\t\t\t}else if(P2BRBC[1] == 0 && clickedCell>3){\n\t\t\t\t\t//console.log(\"Hey! Stop poking me\");\n\t\t\t\t\tvalid=false;\n\t\t\t\t}else if(P2BRBC[1] == 1 && (clickedCell<3 || clickedCell>5)){\n\t\t\t\t\t//console.log(\"Hey! Stop poking me\");\n\t\t\t\t\tvalid=false\n\t\t\t\t}else if(P2BRBC[1] == 2 && clickedCell<6){\n\t\t\t\t\t//console.log(\"Hey! Stop poking me\");\n\t\t\t\t\tvalid=false;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//console.log(P2BRBC[0]);\n\t\t\t\t\t//console.log(P2BRBC[1]);\n\t\t\t\t\tvalid=true;\n\t\t\t\t\treset();\n\t\t\t\t\tfunction highlight1(classNameBRBC){\n\t\t\t\t\t\tvar x = document.getElementsByClassName(classNameBRBC);\n\t\t\t\t\t\tvar i;\n\t\t\t\t\t\tfor (i = 0; i < x.length; i++) {\n\t\t\t\t\t\t//instead of changing the background add a class that changes the background\n\t\t\t\t\t\t//x[i].style.background = \"#ea7cf4\";\n\t\t\t\t\t\tx[i].className +=' highlight';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(P1BRBC[0]==0 && P1BRBC[1]==0)\n\t\t\t\t\t{ highlight1(\"BR1 BC1\");}\n\t\t\t\t\telse if(P1BRBC[0]==1 && P1BRBC[1]==0)\n\t\t\t\t\t{ highlight1(\"BR2 BC1\");}\n\t\t\t\t\telse if(P1BRBC[0]==2 && P1BRBC[1]==0)\n\t\t\t\t\t{ highlight1(\"BR3 BC1\");}\n\t\t\t\t\telse if(P1BRBC[0]==0 && P1BRBC[1]==1)\n\t\t\t\t\t{ highlight1(\"BR1 BC2\");}\n\t\t\t\t\telse if(P1BRBC[0]==1 && P1BRBC[1]==1)\n\t\t\t\t\t{ highlight1(\"BR2 BC2\");}\n\t\t\t\t\telse if(P1BRBC[0]==2 && P1BRBC[1]==1)\n\t\t\t\t\t{ highlight1(\"BR3 BC2\");}\n\t\t\t\t\telse if(P1BRBC[0]==0 && P1BRBC[1]==2)\n\t\t\t\t\t{ highlight1(\"BR1 BC3\");}\n\t\t\t\t\telse if(P1BRBC[0]==1 && P1BRBC[1]==2)\n\t\t\t\t\t{ highlight1(\"BR2 BC3\");}\n\t\t\t\t\telse if(P1BRBC[0]==2 && P1BRBC[1]==2)\n\t\t\t\t\t{ highlight1(\"BR3 BC3\");}\n\t\t\t\t\t//console.log('valid entry');\n\t\t\t\t}\n\t\t}\n\t\telse if(player1==false && P1BRBC !== undefined){\n\t\t\t\t\n\t\t\t\t//console.log('player1 '+'row '+P1BRBC[0]+'column '+P1BRBC[1])\n\t\t\t\tif(P1BRBC[0] == 0 && clickedRow>2){\n\t\t\t\t\t//console.log(\"Hey! Stop poking me p1 chose little row 0\");\n\t\t\t\t\tvalid=false;\n\t\t\t\t}else if(P1BRBC[0] == 1 && (clickedRow<3 || clickedRow>5)){\n\t\t\t\t\t//console.log(\"Hey! Stop poking me p1 chose little row 1\");\n\t\t\t\t\tvalid=false;\n\t\t\t\t}else if(P1BRBC[0] == 2 && clickedRow<6){\n\t\t\t\t\t//console.log(\"Hey! Stop poking me p1 chose little row 2\");\n\t\t\t\t\tvalid=false;\n\t\t\t\t}else if(P1BRBC[1] == 0 && clickedCell>2){\n\t\t\t\t\t//console.log(\"Hey! Stop poking me little collumn \" + P1BRBC[1]);\n\t\t\t\t\tvalid=false;\n\t\t\t\t}else if(P1BRBC[1] == 1 && (clickedCell<3 || clickedCell>5)){\n\t\t\t\t\t//console.log(\"Hey! Stop poking me lc2\");\n\t\t\t\t\tvalid=false;\n\t\t\t\t}else if(P1BRBC[1] == 2 && clickedCell<6){\n\t\t\t\t\t//console.log(\"Hey! Stop poking me lc3\");\n\t\t\t\t\tvalid=false;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//console.log('row '+ P1BRBC[0]);\n\t\t\t\t\t//console.log('column '+P1BRBC[1]);\n\t\t\t\t\tvalid=true;\n\t\t\t\t\treset();\n\t\t\t\t\t//highlight where you can go\n\t\t\t\t\tfunction highlight(classNameBRBC){\n\t\t\t\t\t\tvar x = document.getElementsByClassName(classNameBRBC);\n\t \t\t\t\tvar i;\n\t \t\t\t\tfor (i = 0; i < x.length; i++) {\n\t \t\t\t\t//instead of changing the background add a class that changes the background\n\t \t\t\t\tx[i].className +=' highlight1';\n\t \t\t\t//x[i].style.background = \"#a67cf4\";\n\t \t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(P2BRBC[0]==0 && P2BRBC[1]==0)\n\t\t\t\t\t{ highlight(\"BR1 BC1\");\n\t \t\t}\n\t\t\t\t\telse if(P2BRBC[0]==1 && P2BRBC[1]==0)\n\t\t\t\t\t{ highlight(\"BR2 BC1\");}\n\t\t\t\t\telse if(P2BRBC[0]==2 && P2BRBC[1]==0)\n\t\t\t\t\t{ highlight(\"BR3 BC1\");}\n\t\t\t\t\telse if(P2BRBC[0]==0 && P2BRBC[1]==1)\n\t\t\t\t\t{ highlight(\"BR1 BC2\");}\n\t\t\t\t\telse if(P2BRBC[0]==1 && P2BRBC[1]==1)\n\t\t\t\t\t{ highlight(\"BR2 BC2\");}\n\t\t\t\t\telse if(P2BRBC[0]==2 && P2BRBC[1]==1)\n\t\t\t\t\t{ highlight(\"BR3 BC2\");}\n\t\t\t\t\telse if(P2BRBC[0]==0 && P2BRBC[1]==2)\n\t\t\t\t\t{ highlight(\"BR1 BC3\");}\n\t\t\t\t\telse if(P2BRBC[0]==1 && P2BRBC[1]==2)\n\t\t\t\t\t{ highlight(\"BR2 BC3\");}\n\t\t\t\t\telse if(P2BRBC[0]==2 && P2BRBC[1]==2)\n\t\t\t\t\t{ highlight(\"BR3 BC3\");}\n\t\t\t\t\t//console.log('valid entry');\n\t\t\t\t}\n\t\t}\n\t}\n\n\n\n\tif (active === true && valid===true){ // user clicks an empty cell\n\n\t\tif (player1 === true) { // I'm breaking the DRY rule here (dont repeat yourself) sorry!\n\t\t\t//retreive some data?\n\t\t\ttoken.css(\"display\", \"block\") // CSS and classes for occupied cell styles\n\t \t\ttoken.addClass(\"snowy\")\n\t \t\ttoken.css(\"border\", \"none\")\n\t \t\ttoken.addClass(\"expandOpen\")\n\t \t\tmatrix[clickedRow][clickedCell] = \"p1\" // to show this matrix cell is now occupied\n\t \t\t//send this variable to the websocket\n\t \t\t\n\n\t \t\tcounter++ // add one to the turn counter\n\t \t\tif (typeof P2BRBC !== 'undefined'){\n\t \t\t\t//console.log(\"BR \"+P2BRBC[0]+\"BC \"+P2BRBC[1])\n\t \t\t\t//check if other player has already won the square\n\t \t\t\tif (littlematrix[P2BRBC[0]][P2BRBC[1]] !== \"p2\") {\n\t \t\t\t//console.log(littlematrix)\n\t \t\t\twin_condition_check((P2BRBC[0]+1),(P2BRBC[1]+1)); // check if our player has won\n\t \t\t\t}\n\t \t\t\telse{\n\t \t\t\t//check if player overturns square\n\t \t\t\tconsole.log(\"overturn check p1\")\n\t \t\t\toverturn_check(P2BRBC[0],P2BRBC[1],\"p1\")\n\t \t\t\t}\t\n\n\t \t\t}\n\t \t\t\n\t \t\t\n\t \t\tplayer1 = false; // Set variable to player 2\n\t \t\t\n\t\t}\n\n\t \telse if (player1 === false) { \n\t\t\ttoken.css(\"display\", \"block\")\n\t \t\ttoken.addClass(\"sox\")\n\t \t\ttoken.addClass(\"expandOpen\")\n\n\t \t\t//console.log(clickedRow)\n\t \t\t//console.log(clickedCell)\n\t \t\tmatrix[clickedRow][clickedCell] = \"p2\"\n\t \t\t\n\t \t\tcounter++\n\t \t\tif (typeof P1BRBC !== 'undefined'){\n\t \t\t\t//console.log(\"BR \"+P1BRBC[0]+\"BC \"+P1BRBC[1])\n\t \t\t\tif (littlematrix[P1BRBC[0]][P1BRBC[1]] !== \"p1\") {\n\t \t\t\t\t//console.log(littlematrix);\n\t \t\t\t\twin_condition_check((P1BRBC[0]+1),(P1BRBC[1]+1)) // check if our player has won\n\t \t\t\t}else{\n\t \t\t\t//check if player overturns square\n\t \t\t\tconsole.log(\"overturn check p2\")\n\t \t\t\toverturn_check(P1BRBC[0],P1BRBC[1],\"p2\")\n\t \t\t\t}\n\t \t\t}\n\t \t\tplayer1 = true\n\n\t \t\t\n\t \t}\n\t \t\n\t \tcurrent_player_show() \n\n\t}\n\n\n\n\n}); // End click_cell event listener\n\n// A button that appears to reload the game\n$(\"#reset\").click(function(){ \n\t\n\tcurrent_player.removeClass(\"snowy sox\")\n\tload_Game()\n\tcounter = 0\n\tstart_game_button.hide()\n\n\n})\n\n\n\n\nfunction win_condition_check(BR,BC){ //tion, sorry again. I've used a lot of conditional logic, attempting to scale it down only met with errors and tears.\n\t//console.log(\"big row \"+BR+\" big column \"+BC)\n\t// Check the console.logs for the intended results.\n\tif ((counter%2)===1) { // If it's player one's turn\n\t\t//Check in only BR,BC\n\t\t//Check in all the Bigger squares\n\t\tlittle_check(((BR-1)*3),((BC-1)*3));\n\t\t//little_check(0,3);\n\t\t//little_check(0,6);\n\t\t//little_check(3,0);\n\t\t//little_check(3,3);\n\t\t//little_check(3,6);\n\t\t//little_check(6,0);\n\t\t//little_check(6,3);\n\t\t//little_check(6,6);\n\n\t\t//\n\t\tfunction little_check(count,count2){\n\t\t\t\n\t\t\t//console.log(\"count \"+ count+\"count2 \"+count2);\t\t\t\n \t \t\tfor ( var x=count; x <= (count+2); x++) { // cycle the matrix rows...\n \t \t\t\tfor (var y=count2; y <= (count2+2); y++) { // ...and cycle the matrix cells\n\t\t\t\t\t//var BR=1;\n\n\t\t\t\t\t//console.log(\"matrx[x] \"+ x+\"martix[y] \"+y);\n\t\t\t\t\tif ((matrix[x][(count2+0)]) === \"p1\" && (matrix[x][(count2+1)]) === \"p1\" && (matrix[x][(count2+2)]) === \"p1\") { // If our cell has been 'tagged' p1 given x is (e.g 0) then: x0y0, x0y1, x0y2 would mean player one has 3 horizontal cells in a line = victory!\n\t\t\t\t\t\tif (player1 === true){\n\t\t\t\t\t\t//console.log(\"horizontal victory\")\n\t\t\t\t\t\t//console.log(\"player1 wins square row \"+BR+ \"column \"+BC )\n\t\t\t\t\t\twinner_show(BR,BC)\n\t\t\t\t\t\tlittlematrix[(BR-1)][(BC-1)]=\"p1\";\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\telse if\t( (matrix[(count+0)][y]) === \"p1\" && (matrix[(count+1)][y]) === \"p1\" && (matrix[(count+2)][y]) === \"p1\") { // Repeated for other conditions\n\t\t\t\t\t\tif (player1 === true){\n\t\t\t\t\t\t//console.log(\"vertical victory\")\n\t\t\t\t\t\t//console.log(\"player1 wins\")\n\t\t\t\t\t\twinner_show(BR,BC)\n\t\t\t\t\t\tlittlematrix[(BR-1)][(BC-1)]=\"p1\";\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if ((matrix[(count+0)][(count2+0)]) === \"p1\" && (matrix[(count+1)][(count2+1)]) === \"p1\" && (matrix[(count+2)][(count2+2)]) === \"p1\") {\n\t\t\t\t\t\tif (player1 === true){\n\t\t\t\t\t\tconsole.log(\"LtopRdown diagonal\")\n\t\t\t\t\t\tconsole.log(\"player1 wins\")\n\t\t\t\t\t\twinner_show(BR,BC)\n\t\t\t\t\t\tlittlematrix[(BR-1)][(BC-1)]=\"p1\";\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\telse if\t( (matrix[(count+0)][(count2+2)]) === \"p1\" && (matrix[(count+1)][(count2+1)]) === \"p1\" && (matrix[(count+2)][(count2+0)]) === \"p1\") {\t\n\t\t\t\t\t\tif (player1 === true){\n\t\t\t\t\t\tconsole.log(\"Rtop Ldown diagonal\")\n\t\t\t\t\t\tconsole.log(\"player1 wins\")\n\t\t\t\t\t\twinner_show(BR,BC)\n\t\t\t\t\t\tlittlematrix[(BR-1)][(BC-1)]=\"p1\";\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\n\t \t} \n\t} // End player one check\n\n\n\tif ((counter%2)===0) {\t// Now for player 2\n\n\t\tlittle_check1(((BR-1)*3),((BC-1)*3));\n\t\t//little_check1(0,3);\n\t\t//little_check1(0,6);\n\t\t//little_check1(3,0);\n\t\t//little_check1(3,3);\n\t\t//little_check1(3,6);\n\t\t//little_check1(6,0);\n\t\t//little_check1(6,3);\n\t\t//little_check1(6,6);\n\n\t\t//\n\t\tfunction little_check1(count,count2){\n\n\n\t \t for (var x = count; x <= (count+2); x++) {\n\t\t\tfor (var y = count2; y <= (count2+2); y++) {\n\n\t\t\t\tif ((matrix[x][(count2+0)]) === \"p2\" && (matrix[x][(count2+1)]) === \"p2\" && (matrix[x][(count2+2)]) === \"p2\") {\n\t\t\t\t\n\t\t\t\t//console.log(player1)\n\n\t\t\t\tif (player1== false) {\n\t\t\t\t\tconsole.log(\"horizontal victory\")\n\t\t\t\t\tconsole.log(\"player2 wins\")\n\t\t\t\t\twinner_show(BR,BC)\n\t\t\t\t\tlittlematrix[(BR-1)][(BC-1)]=\"p2\";\n\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse if\t((matrix[(count+0)][y]) === \"p2\" && (matrix[(count+1)][y]) === \"p2\" && (matrix[(count+2)][y]) === \"p2\") {\n\t\t\t\tif (player1== false) {\n\t\t\t\t\tconsole.log(\"vertical victory\")\n\t\t\t\t\tconsole.log(\"player2 wins\")\n\t\t\t\t\twinner_show(BR,BC)\n\t\t\t\t\tlittlematrix[(BR-1)][(BC-1)]=\"p2\";\n\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ((matrix[(count+0)][(count2+0)]) === \"p2\" && (matrix[(count+1)][(count2+1)]) === \"p2\" && (matrix[(count+2)][(count2+2)]) === \"p2\") {\n\t\t\t\tif (player1== false) {\t\n\t\t\t\t\tconsole.log(\"LtopRdown diagonal\")\n\t\t\t\t\tconsole.log(\"player2 wins\")\n\t\t\t\t\twinner_show(BR,BC)\n\t\t\t\t\tlittlematrix[(BR-1)][(BC-1)]=\"p2\";\n\t\t\t\t\treturn;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\telse if\t((matrix[(count+0)][(count2+2)]) === \"p2\" && (matrix[(count+1)][(count2+1)]) === \"p2\" && (matrix[(count+2)][(count2+0)]) === \"p2\") {\t\n\t\t\t\t\tif (player1== false) {\n\t\t\t\t\tconsole.log(\"Rtop Ldown diagonal\")\n\t\t\t\t\tconsole.log(\"player2 wins\")\n\t\t\t\t\twinner_show(BR,BC)\n\t\t\t\t\tlittlematrix[(BR-1)][(BC-1)]=\"p2\";\n\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\n\t\t}\n\t\t}\t\n\t} // End player 2 check\n\n\t\n\n\t// In the case of a DRAW. We announce this and allow the users to play again\n\t// check all 9 space\n\n\n\n} // Function win_condition_check END\n\nfunction overturn_check(BR,BC,P){\n\t\t\n\t\tvar overturn_counter=0;\n\t\tfor (var x = 3*BR; x <= (3*BR+2); x++) {\n\t\t\t\t//console.log(\"BR \"+BR+\"BC \"+BC+\"P \"+P)\n\n\t\t\t\tif ((matrix[x][(3*BC+0)]) == P && (matrix[x][(3*BC+1)]) == P && (matrix[x][(3*BC+2)]) == P) {\n\t\t\t\t\toverturn_counter+=1;\n\t\t\t\t\tconsole.log(\"BR \"+BR+\"BC \"+BC);\n\t\t\t\t\tconsole.log(overturn_counter);\n\t\t\t\t\tif (overturn_counter>1) {\n\t\t\t\t\t\tconsole.log(P +\" overturned the square\")\n\t\t\t\t\t\t//winner_show(BR,BC)\n\t\t\t\t\t\tlittlematrix[BR][BC]= P;\n\t\t\t\t\t\twin_condition_check((BR+1),(BC+1));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\tfor (var y = 3*BC; y <= (3*BC+2); y++) {\n\t\t\t\tif\t((matrix[(3*BR+0)][y]) == P && (matrix[(3*BR+1)][y]) == P && (matrix[(3*BR+2)][y]) == P) {\n\t\t\t\t\toverturn_counter+=1;\n\t\t\t\t\tconsole.log(\"BR \"+BR+\"BC \"+BC);\n\t\t\t\t\tconsole.log(overturn_counter);\n\t\t\t\t\tif (overturn_counter>1) {\n\t\t\t\t\tconsole.log(P + \" overturned the square\")\n\t\t\t\t\t//winner_show(BR,BC)\n\t\t\t\t\tlittlematrix[BR][BC]= P;\n\t\t\t\t\twin_condition_check((BR+1),(BC+1));\n\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t}\n\n}\n\n\nfunction winner_show(BR,BC){ \n\t\n\tif (player1 == true) { // a bit confusing, but basically, if the game has finished player 2 has finished \n\t\twinner_snowy_div = document.createElement(\"div\");\n\t\twinner_snowy_div.setAttribute(\"id\", \"winner_snowy\")\n\t winner_snowy_div.setAttribute(\"class\", \"winner snowy\")\n\t //change the background color in all cells BC, BR\n\t $( \".BC\"+BC+\".BR\"+BR ).css( \"background\", \"pink\" );\n\n\t winner_container.append(winner_snowy_div)\n\t\t\n\t\t//reset_button.show()\n\t\t//active = false\n\t\t//current_player.hide()\n\t}\n\n\tif (player1 == false) {\n\t\twinner_sox_div = document.createElement(\"div\");\n\t\twinner_sox_div.setAttribute(\"id\", \"winner_sox\")\n\t winner_sox_div.setAttribute(\"class\", \"winner sox\")\n\t winner_sox_div.innerHTML = \"<span>\" + 'I Win!' + \"</span>\"\n\t winner_container.append(winner_sox_div)\n\t\t\n\t\t$( \".BC\"+BC+\".BR\"+BR ).css( \"background\", \"sandybrown\" );\n\t\t//reset_button.show()\n\t\t//active = false\t\n\t\t//current_player.hide()\t\n\t}\n}\n\n\n }// Load Game end", "function startGame(){\n gBoard = buildBoard()\n renderBoard(gBoard)\n placeMines()\n setMinesNegsCount(gBoard)\n openNegs(gBoard, gGame.safeCell.i, gGame.safeCell.j)\n renderBoard(gBoard)\n startTimer()\n}", "function loadFirstLocal() {\n if(mapID < 0 || !localStorage[\"map0\"])\n return;\n\n Board.init(JSON.parse(localStorage[\"map0\"]));\n}", "loadBoardData() {\n this.setState({\n isLoaded: false,\n err: null,\n visionBoards: []\n });\n\n execFetch('/api/visionboard/boards', { method: 'GET' })\n .then(res => res.json())\n .then(res => this.setState({ visionBoards: res }))\n .catch(err => this.setState({ err: err.message }))\n .finally(() => this.setState({ isLoaded: true }));\n }", "function loadGameData()\n\t\t\t{\n\t\t\t\tif(gameName == \"fatcat7\")\n\t\t\t\t{\n\t\t\t\t\tgame = new FatCat7Game();\n\t\t\t\t\tisFreeSpinGame = true;\n\t\t\t\t}\n\t\t\t\telse if(gameName == \"bounty\")\n\t\t\t\t{\n\t\t\t\t\tgame = new BountyGame();\n\t\t\t\t\tisFreeSpinGame = true;\n\t\t\t\t}\n\t\t\t\telse if(gameName == \"gummibar\")\n\t\t\t\t{\n\t\t\t\t\tgame = new GummiBarGame();\n\t\t\t\t\tisFreeSpinGame = false;\n\t\t\t\t}\n\t\t\t\telse if(gameName == \"aprilmadness\")\n\t\t\t\t{\n\t\t\t\t\tgame = new AprilMadnessGame();\n\t\t\t\t\tisFreeSpinGame = true;\n\t\t\t\t}\n\t\t\t\telse if(gameName == \"moneybooth\")\n\t\t\t\t{\n\t\t\t\t\tgame = new MoneyBoothGame();\n\t\t\t\t\tisFreeSpinGame = false;\n\t\t\t\t}\n\t\t\t\telse if(gameName == \"astrologyanswers\")\n\t\t\t\t{\n\t\t\t\t\tgame = new AstrologyAnswersGame();\n\t\t\t\t\tisFreeSpinGame = false;\n\t\t\t\t\tisBothFreeSpinAndOtherBonus = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tgame.importGame(xmlData);\n\t\t\t}", "function preload() {\n delete gameData;\n if (myID == 0){\n TetrisBoard.style.opacity = .7;\n BreakoutBoard.style.opacity = 1;\n }\n else {\n TetrisBoard.style.opacity = 1;\n BreakoutBoard.style.opacity = .7;\n }\n onReady(); // Calling onReady Tetris function\n game.scale.scaleMode = Phaser.ScaleManager.NO_SCALE;\n game.scale.pageAlignHorizontally = true;\n game.scale.pageAlignVertically = true;\n game.stage.backgroundColor = '#eee';\n game.load.spritesheet('ball', 'client/img/wobble.png', 20, 20);\n game.load.image('paddle', 'client/img/paddle.png');\n game.load.image('brick', 'client/img/brick.png');\n game.load.spritesheet('button', 'client/img/button.png', 120, 40);\n\t\tgame.load.image('gameover','client/img/over.png')\n }", "function loadState(state){\n\n // set timer to saved time\n timer = state.score;\n $(\"#time\").text(timer);\n\n // remove previous empty piece\n var empty = $(\"#empty\");\n empty.removeAttr(\"id\");\n empty.addClass(\"piece\");\n\n // set saved values for new pieces \n for(var i = 1 ; i <=16; i++){\n var laatta = $(\".\"+i);\n laatta.text(state.boardstate[i-1]);\n if(laatta.text()===\"\"){\n laatta.attr(\"id\",\"empty\");\n laatta.removeClass(\"piece\");\n }\n }\n \n // set movable pieces\n setMovablePieces();\n\n }", "function initializeBoard() {\n // Grab and reset the title\n document.getElementById(\n 'turn-indicator'\n ).innerHTML = `<span id=\"player-indicator\" class=\"player1\">Player 1</span> Turn`;\n\n // Grab and set the board\n document.getElementById('board').innerHTML = generateBoardHTML();\n\n // Reset gameboard state\n gameState.resetBoard();\n\n // add event listeners to all slots\n document.querySelectorAll('.slot input[type=checkbox]').forEach(input => {\n input.addEventListener('change', runTurn);\n });\n}", "loadGame(gameState) {\n this.gameState.score = gameState.score;\n this.gameState.won = gameState.won;\n this.gameState.over = gameState.over;\n this.gameState.board = gameState.board;\n }", "function onloadFunction(){\n\t\n\tPlayers.init();\n}" ]
[ "0.7372514", "0.73632103", "0.73471427", "0.72948307", "0.70983773", "0.70877457", "0.70814455", "0.70803124", "0.7075369", "0.7024341", "0.69789964", "0.6963253", "0.6943282", "0.6767274", "0.6752374", "0.6752306", "0.67032015", "0.66990477", "0.6690518", "0.66616356", "0.6661397", "0.66539836", "0.6648649", "0.66136897", "0.658233", "0.6567162", "0.65367365", "0.65355957", "0.65250474", "0.6521616", "0.6504722", "0.64653516", "0.64512247", "0.6450831", "0.6427617", "0.6399882", "0.63849634", "0.6384445", "0.6373401", "0.63649035", "0.6342428", "0.633249", "0.63295776", "0.6328541", "0.6326379", "0.63057053", "0.63037336", "0.6288224", "0.62876606", "0.6268079", "0.62660563", "0.6259645", "0.62529975", "0.6249862", "0.62429005", "0.624067", "0.6222393", "0.62123394", "0.6203508", "0.6197733", "0.6180731", "0.61803806", "0.61751676", "0.61680573", "0.6163463", "0.61590225", "0.613445", "0.61276513", "0.61175066", "0.61146307", "0.611391", "0.61088544", "0.6103184", "0.60919493", "0.60825473", "0.6079652", "0.60782236", "0.60756874", "0.6073107", "0.6066464", "0.6057375", "0.6051396", "0.6048381", "0.60481566", "0.6046894", "0.60452473", "0.6042401", "0.60422975", "0.60418034", "0.6041697", "0.6040189", "0.6039224", "0.6037968", "0.6032653", "0.6029741", "0.60238415", "0.6023468", "0.60176355", "0.60148257", "0.60111946", "0.60110706" ]
0.0
-1
processes input from the user on the game board
function processInput() { for ( let index = 0; index < squares.length; index++ ) { squares[ index ].addEventListener( "click", function() { if ( gameMode === "RGB" ) { var clickedColour = this.style.backgroundColor; } else { var clickedColour = rgbToHex( this.style.backgroundColor ); } console.log( "This is the colour I clicked " + clickedColour ); if ( clickedColour === pickedColour ) { messageDisplay.textContent = "✅"; resetButton.textContent = "Play again?"; changeSquaresToWinningColour( clickedColour ); title.style.backgroundColor = clickedColour; } else { this.style.background = "#232323"; messageDisplay.textContent = "❌"; } } ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getInput(e) {\n\tif(!e) { var e = window.event; }\n\t\n\t// Preventing the defult browser controls to prevent unwanted scrolling.\n\te.preventDefault();\n\t\n\tif(isGameOver != true) {\n\t\tswitch(e.keyCode) {\n\t\t\t\n\t\t\t// 2 different keycodes so both arrows and WASD work for moving pieces.\n\t\t\tcase 65: {}\n\t\t\tcase 37: \n\t\t\tif(checkMove(ourPiece.gridX - 1, ourPiece.gridY, ourPiece.curState)) {\n\t\t\t\tourPiece.gridX--;\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 68: {}\n\t\t\tcase 39:\n\t\t\tif(checkMove(ourPiece.gridX + 1, ourPiece.gridY, ourPiece.curState)) {\n\t\t\t\tourPiece.gridX++;\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 87: {}\n\t\t\tcase 38:\n\t\t\t{\n\t\t\tvar newState = ourPiece.curState - 1;\n\t\t\t\n\t\t\tif(newState < 0) \n\t\t\t\tnewState = ourPiece.states.length - 1;\n\t\t\t\n\t\t\t\n\t\t\tif(checkMove(ourPiece.gridX, ourPiece.gridY, newState)) \n\t\t\t\tourPiece.curState = newState;\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 83: {}\t\n\t\t\tcase 40:\n\t\t\tif(checkMove(ourPiece.gridX, ourPiece.gridY + 1, ourPiece.curState)) {\n\t\t\t\tourPiece.gridY++;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\telse {\n\t\t// If game is over send score to highscore update function and inform player of his achievings and ask if he wants to play again.\n\t\tupdateHiScore(score);\n\t\tvar newGame = prompt(\"You got \" + currentLines + \" lines. \\nYour score was: \" + score + \"\\nStart new game? (y/n)\");\n\t\tif(newGame === \"y\") {\n\t\t\tinitGame();\n\t\t} \n\t}\n}", "function processInput (input, data) {\n let {settings, commands, player, places, messages, defaults} = data\n\n input = input.toLowerCase()\n\n if (input.length > 0) {\n println(settings.prepend + input)\n line()\n }\n\n // ask for help\n if (input.indexOf(commands.help) > -1) {\n println(messages.helpText)\n\n // look around describe where you are\n } else if (input.indexOf(commands.observe) > -1) {\n if (canSee(player)) {\n println(description(player.currentLocation, places))\n } else {\n println(messages.visibilityError)\n }\n\n // walk places\n } else if (input.indexOf(commands.move) > -1) {\n // input = input.replace(\"walk to\", \"\").trim().input.replace(\"the\", \"\").trim()\n let placeName = trimInput(input, commands.move)\n let place = placeFromString(placeName, places)\n if (place !== undefined) {\n place = applyPlaceDefaults(place, defaults)\n if (locationIsAccessable(place, player.currentLocation, places) && place !== undefined) {\n if (!locationIsLocked(place, player.pockets)) {\n player = walkTo(player, placeName, places, defaults)\n if (player.currentLocation.settings.isLocked) {\n println(player.currentLocation.messages.successEntryGranted)\n }\n player.currentLocation = unlockLocation(player.currentLocation, player.pockets)\n if (player.currentLocation.leaveUnlocked) {\n println(player.currentLocation.messages.unlock)\n }\n println(messages.moveMessage + placeName)\n } else {\n println(place.messages.locked)\n }\n } else if (place === player.currentLocation) {\n println(messages.moveRedundancy + place.name)\n } else {\n println(messages.moveError)\n }\n } else {\n println(messages.moveError)\n }\n\n // take items\n } else if (input.indexOf(commands.gainItem) > -1) {\n let item = trimInput(input, commands.gainItem)\n if (item in player.currentLocation.objects) {\n player.currentLocation.objects = hashRemove(item, player.currentLocation.objects)\n player.pockets = hashAdd(item, player.pockets)\n println(messages.pickUpSuccess + addArticle(item))\n } else {\n println(messages.pickUpError + addArticle(item))\n }\n\n // drop items\n } else if (input.indexOf(commands.loseItem) > -1) {\n let item = trimInput(input, commands.loseItem)\n if (item in player.pockets) {\n player.pockets = hashRemove(item, player.pockets)\n player.currentLocation.objects = hashAdd(item, player.currentLocation.objects)\n println(messages.dropSuccess + addArticle(item))\n } else {\n println(messages.inventoryItemError + addArticle(item))\n }\n } else if (input.indexOf(commands.useItem) > -1) {\n let item = trimInput(input, commands.useItem)\n if (item in player.pockets) {\n if (player.currentLocation.exchanges[item]) {\n player.pockets = hashRemove(item, player.pockets)\n player.pockets = hashAdd(player.currentLocation.exchanges[item], player.pockets)\n println(messages.exchangeSuccess + addArticle(player.currentLocation.exchanges[item]))\n } else {\n println(messages.useError)\n }\n } else {\n println(messages.inventoryItemError + addArticle(item))\n }\n\n // take inventory\n } else if (input.indexOf(commands.takeInventory) > -1) {\n if (player.pockets !== {}) {\n println(hashList(player.pockets, messages.inventoryError))\n }\n } else if (input.indexOf(commands.perceiveItems) > -1) {\n println(hashList(player.currentLocation.objects))\n } else {\n if (input.length > 0) {\n println(messages.commandInvalid)\n }\n }\n Object.assign(data, {player, places})\n return data\n}", "function run() {\n // Clean up Input to lowercase\n\n inputNew = inputRaw.value;\n inputNew = inputNew.toLowerCase();\n console.log(\"action requested: \" + inputNew);\n\n // Clear message field\n\n message = mapText[here];\n\n // Directional Manipulation Options\n\n if (\n inputNew === \"north\" &&\n (here == 2 ||\n here == 3 ||\n here == 4 ||\n (here == 7 && spikes[2] == 1) ||\n here == 10)\n ) {\n here += 4;\n message = mapText[here];\n } else if (\n inputNew === \"south\" &&\n (here == 6 || here == 7 || here == 8 || here == 11 || here == 14)\n ) {\n here -= 4;\n message = mapText[here];\n } else if (\n inputNew === \"east\" &&\n ((here >= 0 && here < 3) ||\n (here >= 4 && here < 6) ||\n (here >= 8 && here < 11) ||\n (here == 14 && axe[2] === 1))\n ) {\n here += 1;\n message = mapText[here];\n } else if (\n inputNew === \"west\" &&\n ((here > 0 && here <= 3) ||\n (here > 4 && here <= 6) ||\n (here > 8 && here <= 11) ||\n here == 15)\n ) {\n here -= 1;\n message = mapText[here];\n } else if (\n inputNew === \"north\" ||\n inputNew === \"south\" ||\n inputNew === \"east\" ||\n inputNew === \"west\"\n ) {\n message = \"Impossible to travel \" + inputNew;\n }\n\n // Action Manipulation Options\n else if (\n inputNew === \"use axe\" ||\n inputNew === \"use spikes\" ||\n inputNew === \"use snacks\" ||\n inputNew === \"use shovel\"\n ) {\n useF();\n } else if (\n inputNew === \"take axe\" ||\n inputNew === \"take spikes\" ||\n inputNew === \"take snacks\" ||\n inputNew === \"take shovel\"\n ) {\n takeF();\n } else if (\n inputNew === \"check axe\" ||\n inputNew === \"check spikes\" ||\n inputNew === \"check mail\" ||\n inputNew === \"check snacks\" ||\n inputNew === \"check shovel\" ||\n inputNew === \"check outback\" ||\n inputNew === \"check logs\" ||\n inputNew === \"check gate\" ||\n inputNew === \"check sign\"\n ) {\n checkF();\n }\n\n // Miscellaneous\n else if (inputNew === \"pack\") {\n if (pack[0] === undefined) {\n message = \"Pack: empty\";\n } else {\n message = \"Pack: \" + pack;\n }\n } else if (inputNew === \"ronaustin\") {\n window.open(\"images/mailboxMap.png\");\n } else if (inputNew === \"reset\") {\n endGame();\n } else if (inputNew === \"credits\") {\n credits();\n } else if (inputNew === \"\") {\n display();\n } else {\n message = \"Unacceptable Request\";\n }\n\n display(); // necessary to map navigation\n}", "function processInputCommand()\n {\n var inputText = my.html.input.value\n var goodChars = my.current.correctInputLength\n\n if (inputCommandIs('restart') || inputCommandIs('rst')) {\n location.href = '#restart'\n } else if (inputCommandIs('fix') || inputCommandIs('xxx')){\n my.html.input.value = inputText.substring(0, goodChars)\n updatePracticePane()\n } else if (inputCommandIs('qtpi')) {\n qtpi()\n }\n }", "function userInput(field){\n let colHeight = 0;\n let rowLength = 0;\n let currentHeight = 0;\n let currentLength = 0;\n let pField = field;\n let gameStatus = true\n // for loop to get the field height and width\n for (let i=1; i <= pField.length; i++){\n // console.log(i)\n if (i === pField.length){\n colHeight = i;\n for (let j in pField[i-1]){\n rowLength++\n }\n }\n }\n while(gameStatus === true){\n\n clear();\n console.log(pField);\n let moving = prompt(\"Select your move. (u for Up, d for down, l for left and r for right==> \");\n \n // console.log(moving)\n // console.log(rowLength)\n // console.log(colHeight)\n if (moving.toLowerCase() === \"u\"){\n currentHeight -= 1\n gameStatus = checkStatus(currentHeight, currentLength, colHeight, rowLength, pField)\n // return gameStatus\n }\n else if(moving.toLowerCase() === \"d\"){\n currentHeight += 1\n gameStatus = checkStatus(currentHeight, currentLength, colHeight, rowLength, pField)\n // return gameStatus\n }\n else if(moving.toLowerCase() === \"l\"){\n currentLength -= 1\n gameStatus = checkStatus(currentHeight, currentLength, colHeight, rowLength, pField)\n // return gameStatus\n }\n else if(moving.toLowerCase() === \"r\"){\n currentLength += 1\n gameStatus = checkStatus(currentHeight, currentLength, colHeight, rowLength, pField) \n }\n\n } \n // console.log(gameStatus)\n}", "function input(e){\n\tlet code = e.keyCode;\n\tif(code == 38) // Up arrow\n\t{\n\t\tif(!started)\n\t\t{\n\t\t\tstarted = true;\n\t\t\tif(result != \"\")\n\t\t\t{\n\t\t\t\tAI.points = 0;\n\t\t\t\tplayer.points = 0;\n\t\t\t\tdocument.getElementById('computerScore').innerHTML = AI.points;\n\t\t\t\tdocument.getElementById('userScore').innerHTML = player.points;\n\t\t\t\tstressLevel = 50;\n\t\t\t\tstressLevelSystem();\n\t\t\t\tfor(i = 0; i < universityHidden.length; i++) universityHidden[i] = true;\n\t\t\t\tfor(i = 0; i < lifeHidden.length; i++) lifeHidden[i] = true;\n\t\t\t\tresult = \"\";\n\t\t\t}\n\t\t\tdocument.getElementById('gameInfo').style.color = 'rgba(0,0,0,0)';\n\t\t}\n\n\t\tplayer.vel = -10;\n\t}\n\telse if(code == 40) // Down arrow\n\t{\n\t\tif(!started)\n\t\t{\n\t\t\tstarted = true;\n\t\t\tif(result != \"\")\n\t\t\t{\n\t\t\t\tAI.points = 0;\n\t\t\t\tplayer.points = 0;\n\t\t\t\tdocument.getElementById('computerScore').innerHTML = AI.points;\n\t\t\t\tdocument.getElementById('userScore').innerHTML = player.points;\n\t\t\t\tstressLevel = 50;\n\t\t\t\tstressLevelSystem();\n\t\t\t\tfor(i = 0; i < universityHidden.length; i++) universityHidden[i] = true;\n\t\t\t\tfor(i = 0; i < lifeHidden.length; i++) lifeHidden[i] = true;\n\t\t\t\tresult = \"\";\n\t\t\t}\n\t\t\tdocument.getElementById('gameInfo').style.color = 'rgba(0,0,0,0)';\n\t\t}\n\t\tplayer.vel = 10;\n\t}\n}", "handleInput() {}", "function gameStep(input) {\n var cmd = interpret(input); // parse the user input\n var result = execute(cmd); // run the desired command\n report(result); // display the results on the screen\n}", "function handleInput() {\n process(input.value());\n}", "function handleInput() {\n process(input.value());\n}", "function UserInputs(action, input) {\n switch (action) {\n case \"concert-this\":\n runBandsInTown(input);\n fixString(input)\n break;\n case \"spotify-this-song\":\n runSpotify(input);\n fixString(input)\n break;\n case \"movie-this\":\n runOmdb(input);\n fixString(input)\n break;\n case \"do-what-it-says\":\n runRandom(input);\n break;\n default:\n console.log(\"\\n--------------------------------------------------------\");\n console.log(\n \"Please enter a valid argument, such as:\\n\\nnode liri.js movie-this [MOVIE TITLE]\\n\\nnode liri.js spotify-this-song [SONG TITLE]\\n\\nnode liri.js concert-this [ARTIST NAME]\\n\\nnode liri.js do-what-it-says\"\n );\n console.log(\n \"--------------------------------------------------------\\n\\n\"\n );\n }\n}", "function applyInput(inputList, gid, playerPos) {\n gameList[gid].processInput(inputList, playerPos);\n }", "handleInput(input) {\n\t\t\n\t}", "function __processInput() {\n var degreeInc = 2.0,\n zInc = 0.05;\n //console.log(_keyPressed);\n\n for (var keyCode in __keyPressed) {\n\n if (!__keyPressed[keyCode]) {\n continue;\n }\n\n var key = parseInt(keyCode);\n\n switch (key) {\n case 87: // rotate up keys = (w, W)\n case 119:\n __rotateMap(degreeInc);\n break;\n\n case 83: // rotate down keys = (s, S)\n case 115:\n __rotateMap(-degreeInc);\n break;\n\n case 65: // rotate left keys = (a, A)\n case 97:\n __rotateMap(null, degreeInc);\n break;\n\n case 68: // rotate right keys = (d, D)\n case 100:\n __rotateMap(null, -degreeInc);\n break;\n\n case 32: // space bar\n __hasGameStarted = true;\n __setGamePauseStatus(!__getGameStatus());\n break;\n\n case 37: // move player left\n if (!__isGamePaused()) {\n __thePlayer.setDirection(__DIRECTIONS.EAST);\n }\n break;\n\n case 39: // move player right\n if (!__isGamePaused()) {\n __thePlayer.setDirection(__DIRECTIONS.WEST);\n }\n break;\n\n case 49: // zoom out\n __rotateMap(null, null, -zInc);\n break;\n\n case 50: // zoom in\n __rotateMap(null, null, zInc);\n break;\n\n default:\n console.log('Did not recognize key with code: ' + keyCode);\n __keyPressed[keyCode] = false;\n __keyReleased[keyCode] = false;\n\n break;\n }\n\n if (key === 32 || (__keyPressed[keyCode] && __keyReleased[keyCode])) {\n\n switch (key) {\n case 37: // stop player\n case 39:\n __thePlayer.setDirection(__DIRECTIONS.NONE);\n break;\n\n default:\n break;\n }\n\n __keyPressed[keyCode] = false;\n __keyReleased[keyCode] = false;\n //console.log(__keyReleased);\n }\n\n }\n }", "function input() {\n if(65 in keysDown) {\n if (getTile((player.x - player.speed) + 1, player.y + 16) !== \"1\") { //If player runs into a wall, they will not be allowed to go through it.\n player.x -= 3; //when \"A\" is pressed on keyboard, move player 3 pixels to left.\n }\n }\n if(68 in keysDown) {\n if (getTile(((player.x + player.width) + player.speed) - 1, player.y + 16) !== \"1\") { //If player runs into a wall, they will not be allowed to go through it.\n player.x += 3; //when \"D\" is pressed on keyboard, move player 3 pixels to right.\n }\n }\n if(87 in keysDown && player.yke === 0) {\n if(getTile(player.x, player.y -1) !== \"1\" && getTile(player.x + 32, player.y -1) !== \"1\") {\n player.yke += 8;\n }\n } \n}", "function mainGame(){\n\t\n\t//get the command from the user and make sure it's valid\n\tvar userInput = document.getElementById('userInputBox').value; //need to add a userInputBox text box\n\tuserInput = userInput.toLowerCase(); //makes the whole string lowercase for comparison reasons\n\tinputArray = userInput.split(\" \"); //split up individual words into an array using blank spaces as the delimiter\n\t\t\n\t//search to see if the first action word of the user is valid and set the currentAction variable to that action\n\tif(!isValid(inputArray, validActions, 'action')){\n\t\t//print message about invalid input\n\t\tdocument.getElementById('outputDiv').innerHTML= 'Do what now?';\n\t\tclear();\n\t\treturn; //leave the main function and wait for another user input\n\t}\n\t\n\t\n\t//see if the action is end\n\tif(currentAction === 'exit'){\n\t\tif(currentLocation.adjacentLocations.length === 1){\n\t\t\tgoTo(currentLocation.adjacentLocations[0]);\n\t\t} else{\n\t\t\tdocument.getElementById('outputDiv').innerHTML= 'You can\\t exit the town like this. Type end to end the game.';\n\t\t}\n\t\tclear();\n\t\treturn; //leave the main function and wait for another user input\n\t\n\t}\n\t\n\t//see if the action is end\n\tif(currentAction === 'end'){\n\t\tend(); //run the help function\n\t\tclear();\n\t\treturn; //leave the main function and wait for another user input\n\t\n\t}\n\t\n\t\n\t//see if the action is help\n\tif(currentAction === 'help'){\n\t\thelp(); //run the help function\n\t\tclear();\n\t\treturn; //leave the main function and wait for another user input\n\t\n\t}\n\t\n\t//see if the action is inventory\n\tif(currentAction === 'inventory'){\n\t\tprintInventory();\n\t\tclear();\n\t\treturn; //leave the main function and wait for another user input\n\t\n\t}\n\t\n\t\n\t//search to see if the first subject word of the user is valid and set the currentSubject variable to that subject\n\t//first, see if the subject is a person\n\tif(!isValid(inputArray, currentLocation.people, 'person')){\n\t\t//next, see if the subject is an item\n\t\tif(!isValid(inputArray, currentLocation.items, 'item')){\n\t\t\t//finally, see if the subject is an adjacent location\n\t\t\tif(!isValid(inputArray, currentLocation.adjacentLocations, 'location')){\n\t\t\t\t//if it gets this far then the input must not contain a valid subject\n\t\t\t\t//print message about invalid input\n\t\t\t\tdocument.getElementById('outputDiv').innerHTML= 'That doesn\\'t make any sense.';\n\t\t\t\tclear();\n\t\t\t\treturn; //leave the main function and wait for another user input\n\t\t\t}\n\t\t\n\t\t}\n\t}\n\t\n\t//at this point, everything should be valid\n\t//time to perform the action\n\t\n\tswitch(currentAction){\n\t\tcase 'go':\n\t\t\tif(currentSubjectType === 'location'){\n\t\t\t\tgoTo(currentSubject);\t\t\t\t\n\t\t\t} else{\n\t\t\t\t\n\t\t\t\tdocument.getElementById('outputDiv').innerHTML= 'How exactly do you go to ' + currentSubject.name + '?';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'enter':\n\t\t\tif(currentSubjectType === 'location'){\n\t\t\t\tgoTo(currentSubject);\t\t\t\t\n\t\t\t} else{\n\t\t\t\t//print a message saying you can't go to a non location\n\t\t\t\tdocument.getElementById('outputDiv').innerHTML= 'How exactly do you enter ' + currentSubject.name + '?';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'pick':\n\t\t\tif(currentSubjectType === 'item'){\n\t\t\t\tpickUp(currentSubject);\t\t\t\t\n\t\t\t} else{\n\t\t\t\t//print a message saying you can't pick up a non item\n\t\t\t\tdocument.getElementById('outputDiv').innerHTML= 'How do you expect to pick up a ' + currentSubject.name + '?';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'get':\n\t\t\tif(currentSubjectType === 'item'){\n\t\t\t\tpickUp(currentSubject);\t\t\t\t\n\t\t\t} else{\n\t\t\t\t//print a message saying you can't pick up a non item\n\t\t\t\tdocument.getElementById('outputDiv').innerHTML= 'How do you expect to get a ' + currentSubject.name + ' in your inventory?';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'talk':\n\t\t\tif(currentSubjectType === 'person'){\n\t\t\t\ttalkTo(currentSubject);\t\t\t\t\n\t\t\t} else{\n\t\t\t\t//print a message saying you can't talk to a non person\n\t\t\t\tdocument.getElementById('outputDiv').innerHTML= 'You can talk to that ' + currentSubject.name + ' all you want. It\\'s not going to respond.';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'examine':\n\t\t\tdocument.getElementById('outputDiv').innerHTML= currentSubject.description;\n\t\t\tbreak;\n\t\n\t}\n\tclear();\n\t\n\t//Is the game over yet?\n\tif(endOfGame){\n\t\tend();\n\t}\n}", "function prepare_board_for_user_input() {\n console.log(\"preparing board for user input\");\n\n console.log(\"line328\");\n // i believe the default is set for grid size = 16\n if (trial.grid_size == 9) {\n document.getElementById(\"board\").style.width='245px';\n document.getElementById(\"board\").style.height='245px';\n }\n\n // UNPURGE GRID REMNANTS, PURGE PROMPT AND STIM\n console.log(\"here in line 322\");\n jsPsych.pluginAPI.setTimeout(function() {\n display_element.querySelector('#board').style.display = 'block';\n }, 0);\n jsPsych.pluginAPI.setTimeout(function() {\n display_element.querySelector('#board-grid-text').style.display = 'block';\n }, 0);\n jsPsych.pluginAPI.setTimeout(function() {\n display_element.querySelector('#Verify_Test').style.display = 'block';\n }, 0);\n jsPsych.pluginAPI.setTimeout(function() {\n display_element.querySelector('#jspsych-html-button-response-prompt').style.display = 'none';\n }, 0);\n jsPsych.pluginAPI.setTimeout(function() {\n display_element.querySelector('#jspsych-html-button-response-rating').style.display = 'none';\n }, 0);\n\n\n var output = '', j;\n tile_flipped = 0;\n\n user_input_tile_ids = [];\n // document.getElementById('board').innerHTML = \"\";\n\n for (var i=0; i<trial.grid_size; i++) {\n var result = 'tile_' + i;\n output += '<div id=\"'+ result +'\" class=\"tile\"></div>';\n }\n\n document.getElementById('board').innerHTML = output;\n\n console.log(\"waiting for clicks line 341\");\n for (var i=0; i<trial.grid_size; i++) {\n var result = 'tile_' + i;\n var tile = document.getElementById(result);\n tile.addEventListener('click', flip);\n }\n\n document.getElementById (\"Verify_Test\").addEventListener(\"click\", verify_result, false);\n }", "handleInput(input) {\n if(modalGameOverActive() || modalInstructionsActive()) {\n if (input === 'up') 0;\n if (input === 'down') 0;\n if (input === 'left') 0;\n if (input === 'right') 0;\n if (input === 'enter') restartGame();\n } else {\n if (input === 'up' && this.y > 0) this.y -= 86;\n if (input === 'down' && this.y <= 380) this.y += 86;\n if (input === 'left' && this.x >= 10) this.x -= 101;\n if (input === 'right' && this.x < 400) this.x += 101;\n }\n }", "function Input()\n{\n\tmap.input();\n\tplayer1.input(input1);\n\tplayer2.input(input2);\n}", "function Commands()\n{\n input = 0;\n if (input != 2)\n {\n readline.question(\"Enter Command: \", input =>\n {\n if (input == save)\n {\n playerinfo.playername=playername;\n playerinfo.playerlvl=playerlvl;\n playerinfo.health=health;\n playerinfo.mana=mana;\n playerinfo.gold=gold;\n playerinfo.savecoord=savecoord;\n playerinfo.savedatasw=savedatasw;\n Save();\n input = 0;\n Map();\n Hud();\n console.log(\"\\n\\nGame saved.\\n\\n\");\n Commands();\n return;\n }\n \n if (input == load)\n {\n Load();\n input = 0;\n Map();\n Hud();\n console.log(\"\\n\\nGame loaded.\\n\\n\");\n Commands();\n\n return;\n }\n\n if (input == exit)\n {\n \n playerinfo.playername=playername;\n playerinfo.playerlvl=playerlvl;\n playerinfo.health=health;\n playerinfo.mana=mana;\n playerinfo.gold=gold;\n playerinfo.savecoord=savecoord;\n playerinfo.savedatasw=savedatasw;\n Save();\n console.log(\"\\n\\nGame saved. Exiting.\\n\\n\");\n process.exit();\n }\n\n else \n {\n Map();\n Hud();\n console.log(Red,\"You have entered an incorrect command. Please try again.\", Reset);\n Commands();\n }\n \n return;\n });\n return;\n };\n}", "function processInput() {\r\n let construction = $(\"#opaqueThick\").val();\r\n let constructionType = $(\"#insulationOptions option:selected\").val();\r\n let window = $(\"#windowSlider\").val();\r\n let chapters = $(\"#chapters\").val()\r\n \r\n\r\n draw(construction, window);\r\n opaqueThick(construction, constructionType);\r\n calculateOutputBoxes(construction, window);\r\n concept();\r\n\r\n \r\n\r\n}", "handleInput(keyPressed){\n // don't handle input when game is not running or when player is hit\n if (gameStarted === false || player.hit === true){\n return;\n }\n switch (keyPressed) {\n case 'left':\n if (this.col > 1) {\n this.col -= 1;\n }\n break;\n case 'right':\n if (this.col < 5) {\n this.col += 1;\n }\n break;\n case 'up':\n if (this.row > 1) {\n this.row -= 1;\n } else {\n levelUp();\n this.col = 3;\n this.row = 4;\n }\n break;\n case 'down':\n if (this.row < 5) {\n this.row += 1;\n }\n break;\n }\n // only check if fruit is taken when player changes posiion\n checkFruitTaken();\n }", "function gameTurn() {\n printBoard(board);\n console.log('Player ' + currentTurn + ' please choose your next move. Choose one of the remaining numbers.')\n process.stdin.once('data', (move) => {\n move = move.toString().trim();\n if (isEntryValid(move)) { \n board[board.indexOf(move)] = currentTurn;\n if (checkVictory()) {\n console.log('Player ' + currentTurn + ' won!!');\n printBoard(board);\n process.exit();\n }\n turnCount++;\n if (turnCount > 9) {\n console.log('It is a tie!!');\n printBoard(board);\n process.exit();\n }\n if (turnCount % 2 !== 0) {\n currentTurn = 'X'\n } else {\n currentTurn = \"O\"\n }\n gameTurn();\n } else {\n gameTurn();\n }\n });\n\n}", "function executeInput(event){\n // get input and put into array, filter out empty cell at end due to extra space\n let input = display.textContent.split(' ').filter(item => item !== '' && item);\n // if not enough inputs return immediately\n if (input.length < 3) {\n return;\n }\n // if the last input was an operator trim it off the end\n if (operators.includes(input[input.length - 1])) {\n input.splice(input.length - 1, 1);\n }\n // generate ratings array, element at each index will correspond to MDAS rating of each element in input array, numbers will be 0\n let ratings = input.map(item => operators.includes(item) ? mdas[item] : 0);\n // run calculations \n result = calculateResults(input, ratings);\n // if the result is a solid number display it, otheriwse trim to 5 decimal places then display, when sent as number to string it will also trim trailing zeros \n if (Number.isInteger(result)) {\n display.textContent = `${result} `;\n } else {\n display.textContent = `${Number(result.toFixed(5))} `;\n }\n }", "function gameStep (input){\n var command = interpret (input);\n var result = execute (command);\n report (result);\n}", "function processInput() {\n string = inputForm.value.toLowerCase();\n raiseError = checkInputError(string);\n\n if (raiseError) {\n showInputError();\n }\n else if (string != body.style.backgroundColor) {\n setColour(string);\n }\n}", "function start(){\n \t// Local variables\n\tlet height = prompt('What height for your board? ');\n\tlet width = prompt('What width for your board? ');\n\n\t// SYNCHRONOUSLY read from keyboard\n\tconsole.log('Creating a board with size ' + height + ' x ' + width + '.');\n\t// Create new board object\n\tlet myBoard = new board(height, width);\n\n\t// Print board\n\n\t// Loop, asking user input, calling appropriate functions.\n\tconsole.log('\\nWelcome to Othello\\n');\n\tconsole.log('Player 1 is black(b), Player 2 is white(w)');\n\tlet turn = 1;\n\twhile(!(myBoard.isGameOver()))\n\t{\n\n\t\tmyBoard.printBoard();\n\t\tif(turn == 1 && myBoard.isValidMoveAvailable('b'))\n\t\t{\n\t\t\tconsole.log('\\nPlayer 1(b) turn\\n');\n\t\t\tlet row = prompt('\\nEnter row: ');\n\t\t\tif(row == -1)\n\t\t\t{\n\t\t\t\tbreak; \t\t\t//for debugging\n\t\t\t}\n\t\t\tlet col = prompt('\\nEnter column: ');\n\t\t\twhile(!(myBoard.isValid(row,col,'b')))\n\t\t\t{\n\t\t\t\tconsole.log('Not a valid move');\n\t\t\t\tlet row = prompt('\\nEnter row: ');\n\t\t\t\tlet col = prompt('\\nEnter column: ');\n\t\t\t}\n\t\t\tmyBoard.placeDiscAt(row,col,'b');\n\t\t\tturn++;\n\t\t}\n\t\telse if(turn == 1 && !(myBoard.isValidMoveAvailable('b')))\n\t\t{\n\t\t\tconsole.log('No Valid Moves. Turn is skipped\\n');\n\t\t\tturn++;\n\t\t}\n\t\tif(turn == 2 && myBoard.isValidMoveAvailable('w'))\n\t\t{\n\t\t\tconsole.log('\\nPlayer 2(w) turn\\n');\n\t\t\tlet row = prompt('\\nEnter row: ');\n\t\t\tif(row == -1)\n\t\t\t{\n\t\t\t\tbreak; \t\t\t//for debugging\n\t\t\t}\n\t\t\tlet col = prompt('\\nEnter column: ');\n\t\t\tconsole.log('\\nPlayer 2(w) turn\\n');\n\t\t\twhile(!(myBoard.isValid(row,col,'w')))\n\t\t\t{\n\t\t\t\tconsole.log('Not a valid move');\n\t\t\t\tlet row = prompt('\\nEnter row: ');\n\t\t\t\tlet col = prompt('\\nEnter column: ');\n\t\t\t}\n\t\t\tmyBoard.placeDiscAt(row,col,'w');\n\t\t\tturn--;\n\t\t}\n\t\telse if(turn == 2 && !(myBoard.isValidMoveAvailable('w')))\n\t\t{\n\t\t\tconsole.log('No Valid Moves. Turn is skipped\\n');\n\t\t\tlet cont = prompt('Infinite Loop??????????? Enter -1 to exit\\n');\n\t\t\tif(cont == -1)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tturn--;\n\t\t}\n\t}\n\tconsole.log('Game Over');\n\n\tif(myBoard.checkWinner() != null)\n\t{\n\t\tconsole.log('Winner is color: ' + myBoard.checkWinner());\n\t}\n\telse\n\t\tconsole.log('The game ended in a tie');\n\t// Save board example code.\n\tsaveFile(\"test.json\", myBoard);\n}", "function handleInput(coa) {\n\n // update random memory value\n nextRandom();\n\n // get player role\n var playerRole = getParticipantByRole(\"player\");\n\n // handle inputs\n var inputq = coa.realizations;\n for (var inputRealizationIndex in inputq) {\n var realization = inputq[inputRealizationIndex];\n\n // add to action queue\n _actionQueue.push({\n type: ActiveDialogConstants.ACTIVE_DIALOG_ACTION_OUTPUT,\n anima: realization.anima,\n text: realization.uttText,\n sound: realization.sound,\n speaker: playerRole\n });\n }\n\n // handle outputs\n if (coa.transitionIndex > -1) {\n handleTransitionInput(DATA.transitions[coa.transitionIndex])\n } else {\n handleRetInput( coa.retId, coa.retInputId );\n }\n\n\n // update course of action options\n getCOAs();\n\n\n // update objectives\n _objectives.forEach( function( o ) {\n o.pass = evalPostfix( o.condition );\n });\n\n var retVideo = coa.transitionIndex > -1 ? null : DATA.retq[coa.retId].inputq[coa.retInputId].video;\n\n var retVid = retVideo == null ? null :\n retVideo[ blockId ] ? retVideo[ blockId ] :\n retVideo[ 'b0000' ];\n\n}", "function processInput(input) {\n switch (input) {\n case \"=\":\n calculate();\n break;\n case \"ce\":\n clearEntry();\n break;\n case \"ac\":\n clearAll();\n break;\n case \"/\":\n case \"*\":\n case \"+\":\n case \"-\":\n case \".\":\n case \"0\":\n validateInput(input);\n break;\n default:\n updateDisplay(input);\n }\n}", "function userinput()\n{\n\twindow.addEventListener(\"keydown\", function (event) {\n\t\tif (event.defaultPrevented) {\n\t\t\treturn; // Do nothing if the event was already processed\n\t\t}\n\n\t\tswitch (event.key) {\n\t\t\tcase \"b\":\n\t\t\t\t// code for \" \" key press.\n\t\t\t\tif(baw==0)\n\t\t\t\t{\n\t\t\t\t\tbaw=1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbaw=0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"l\":\n\t\t\t\t// code for \" \" key press.\n\t\t\t\tif(lighton==0)\n\t\t\t\t{\n\t\t\t\t\tlighton=1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlighton=0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \" \":\n\t\t\t\t// code for \" \" key press.\n\t\t\t\tconsole.log(hoverbonus);\n\t\t\t\tif(hoverbonus>0)\n\t\t\t\t{\n\t\t\t\t\tend-=1;\n\t\t\t\t\thoverbonus-=1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"ArrowDown\":\n\t\t\t\t// code for \"down arrow\" key press.\n\t\t\t\tcharacter.tick(\"d\",ontrain);\n\t\t\t\tbreak;\n\t\t\tcase \"ArrowLeft\":\n\t\t\t\t// code for \"left arrow\" key press.\n\t\t\t\tpol.tick(\"l\");\n\t\t\t\td.tick(\"l\");\n\t\t\t\tcharacter.tick(\"l\",ontrain);\n\t\t\t\tif(character.getpos()[0]==-6)\n\t\t\t\t{\n\t\t\t\t\tdead=1;\n\t\t\t\t\tend+=1;\n\t\t\t\t\tpol.tick(\"r\");\n\t\t\t\t\td.tick(\"r\");\n\t\t\t\t\tcharacter.tick(\"r\",ontrain);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"ArrowRight\":\n\t\t\t\t// code for \"right arrow\" key press.\n\t\t\t\tpol.tick(\"r\");\n\t\t\t\td.tick(\"r\");\n\t\t\t\tcharacter.tick(\"r\",ontrain);\n\t\t\t\tif(character.getpos()[0]==6)\n\t\t\t\t{\n\t\t\t\t\tdead=1;\n\t\t\t\t\tend+=1;\n\t\t\t\t\tpol.tick(\"l\");\n\t\t\t\t\td.tick(\"l\");\n\t\t\t\t\tcharacter.tick(\"l\",ontrain);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn; // Quit when this doesn't handle the key event.\n\t\t}\n\n\t\t// Cancel the default action to avoid it being handled twice\n\t\tevent.preventDefault();\n\t}, true);\n\t// the last option dispatches the event to the listener first,\n\t// then dispatches event to window\n}", "function userInput() {\n debugger;\n userChoice = process.argv[2];\n userSearch = process.argv.splice(3).join(\" \");\n\n if (userChoice === undefined) {\n toDo();\n } else {\n checkingToDo();\n }\n}", "processUserInput() {\n this.state.clearControllers();\n this.state.flags[Defines.INPUT] = false;\n this.state.flags[Defines.HADMATCH] = false;\n this.state.vars[Defines.UNKNOWN_WORD] = 0;\n this.state.vars[Defines.LAST_CHAR] = 0;\n\n // If opening of the menu was \"triggered\" in the last cycle, we open it now before processing the rest of the input.\n if (this.state.menuOpen) {\n this.menu.menuInput();\n }\n\n // F12 shows the priority and control screens.\n if (this.userInput.keys[123] && !userInput.oldKeys[123]) {\n while (this.userInput.keys[123]);\n this.commands.showPriorityScreen();\n }\n\n // Handle arrow keys.\n if (this.state.userControl) {\n if (this.state.holdKey) {\n // In \"hold key\" mode, the ego direction directly reflects the direction key currently being held down.\n let direction = 0;\n if (this.userInput.Keys[38]) direction = 1; // UP\n if (this.userInput.Keys[33]) direction = 2; // PAGEUP\n if (this.userInput.Keys[39]) direction = 3; // RIGHT\n if (this.userInput.Keys[34]) direction = 4; // PAGEDOWN\n if (this.userInput.Keys[40]) direction = 5; // DOWN\n if (this.userInput.Keys[35]) direction = 6; // END\n if (this.userInput.Keys[37]) direction = 7; // LEFT\n if (this.userInput.Keys[36]) direction = 8; // HOME\n this.state.vars[Defines.EGODIR] = direction;\n }\n else {\n // Whereas in \"release key\" mode, the direction key press will toggle movement in that direction.\n let direction = 0;\n if (this.userInput.keys[38] && !this.userInput.oldKeys[38]) direction = 1; // UP\n if (this.userInput.keys[33] && !this.userInput.oldKeys[33]) direction = 2; // PAGEUP\n if (this.userInput.keys[39] && !this.userInput.oldKeys[39]) direction = 3; // RIGHT\n if (this.userInput.keys[34] && !this.userInput.oldKeys[34]) direction = 4; // PAGEDOWN\n if (this.userInput.keys[40] && !this.userInput.oldKeys[40]) direction = 5; // DOWN\n if (this.userInput.keys[35] && !this.userInput.oldKeys[35]) direction = 6; // END\n if (this.userInput.keys[37] && !this.userInput.oldKeys[37]) direction = 7; // LEFT\n if (this.userInput.keys[36] && !this.userInput.oldKeys[36]) direction = 8; // HOME\n if (direction > 0) {\n this.state.vars[Defines.EGODIR] = (this.state.vars[Defines.EGODIR] == direction ? 0 : direction);\n }\n }\n }\n\n // Check all waiting characters.\n let ch;\n while ((ch = this.userInput.getKey()) > 0) {\n // Check controller matches. They take precedence.\n if (this.state.keyToControllerMap.has(ch)) {\n this.state.controllers[this.state.keyToControllerMap[ch]] = true;\n }\n else if ((ch >= (0x80000 + 'A'.charCodeAt(0))) && (ch <= (0x80000 + 'Z'.charCodeAt(0))) && \n (this.state.keyToControllerMap.has(0x80000 + String.fromCharCode(ch - 0x80000).toLowerCase().charCodeAt(0)))) {\n // We map the lower case alpha chars in the key map, so check for upper case and convert to\n // lower when setting controller state. This allows for if the user has CAPS LOCK on.\n this.state.controllers[this.state.keyToControllerMap[0x80000 + String.fromCharCode(ch - 0x80000).toLowerCase().charCodeAt(0)]] = true;\n }\n else if ((ch & 0xF0000) == 0x80000) // Standard char from a keypress event. \n {\n this.state.vars[Defines.LAST_CHAR] = (ch & 0xff);\n\n if (this.state.acceptInput) {\n // Handle normal characters for user input line.\n if ((this.state.strings[0].length + (this.state.cursorCharacter != '' ? 1 : 0) + this.state.currentInput.length) < Defines.MAXINPUT)\n {\n this.state.currentInput += String.fromCharCode(ch & 0xff);\n }\n }\n }\n else if ((ch & 0xFF) == ch) // Unmodified Keys value, i.e. there is no modifier. \n {\n this.state.vars[Defines.LAST_CHAR] = (ch & 0xff);\n\n if (this.state.acceptInput) {\n // Handle enter and backspace for user input line.\n switch (ch) {\n case 13: // ENTER\n if (this.state.currentInput.length > 0)\n {\n this.parser.parse(this.state.currentInput);\n this.state.lastInput = this.state.currentInput;\n this.state.currentInput = '';\n }\n while (this.userInput.keys[13]) { /* Wait until ENTER released */ }\n break;\n\n case 8: // BACK\n if (this.state.currentInput.length > 0) {\n this.state.currentInput = this.state.currentInput.slice(0, -1);\n }\n break;\n }\n }\n }\n }\n }", "function userInput() {\n var h = 101;\n while (Number.isNaN(h) || h > 100) {\n h = prompt('How many squares do you want in the horizontal axis? (no more than 100): '); \n }\n var v = 101;\n while (Number.isNaN(v) || v > 100) {\n v = prompt('How many squares do you want in the vertical axis? (no more than 100): '); \n }\n createGrid(h, v);\n}", "function inputResult() {\n\n\tvar action = \"none\";\n\n\tfor(var i=0; i < allPlayers.length; i++) {\n\t\tif( isKeyboardKeyDown( playerControls[i].up ) )\n\t\t\t{ keyboardKeys[ playerControls[i].up ] = \"none\"; action = \"up\"; }\n\t\telse if( isKeyboardKeyDown( playerControls[i].gc_up ) )\n\t\t\t{ keyboardKeys[ playerControls[i].gc_up ] = \"none\"; action = \"up\"; }\n\n\t\telse if( isKeyboardKeyDown( playerControls[i].down ) )\n\t\t\t{ keyboardKeys[ playerControls[i].down ] = \"none\"; action = \"down\"; }\n\t\telse if( isKeyboardKeyDown( playerControls[i].gc_down ) )\n\t\t\t{ keyboardKeys[ playerControls[i].gc_down ] = \"none\"; action = \"down\"; }\n\t\t\n\t\telse if( isKeyboardKeyDown( playerControls[i].left ) )\n\t\t\t{ keyboardKeys[ playerControls[i].left ] = \"none\"; action = \"left\"; }\n\t\telse if( isKeyboardKeyDown( playerControls[i].gc_left ) )\n\t\t\t{ keyboardKeys[ playerControls[i].gc_left ] = \"none\"; action = \"left\"; }\n\t\t\n\t\telse if( isKeyboardKeyDown( playerControls[i].right ) )\n\t\t\t{ keyboardKeys[ playerControls[i].right ] = \"none\"; action = \"right\"; }\n\t\telse if( isKeyboardKeyDown( playerControls[i].gc_right ) )\n\t\t\t{ keyboardKeys[ playerControls[i].gc_right ] = \"none\"; action = \"right\"; }\n\n\t\t//only char change if over a char\n\t\tif( resultVars[ \"blockp\" + i] < 4) {\n\t\t\tif( action === \"up\") {\n\t\t\t\tresultVars[ \"c\" + resultVars[ \"blockp\" + i] + \"p\" + i] += 1;\n\t\t\t\tif( resultVars.ccZref < resultVars[ \"c\" + resultVars[ \"blockp\" + i] + \"p\" + i] )\n\t\t\t\t\t{ resultVars[ \"c\" + resultVars[ \"blockp\" + i] + \"p\" + i] = resultVars.ccAref; }\n\t\t\t}\n\t\t\tif( action === \"down\") {\n\t\t\t\tresultVars[ \"c\" + resultVars[ \"blockp\" + i] + \"p\" + i] -= 1;\n\t\t\t\tif( resultVars.ccAref > resultVars[ \"c\" + resultVars[ \"blockp\" + i] + \"p\" + i] )\n\t\t\t\t\t{ resultVars[ \"c\" + resultVars[ \"blockp\" + i] + \"p\" + i] = resultVars.ccZref; }\n\t\t\t}\n\t\t\tallResultVisuals.midLayer[\"player\" + (i+1) + \"c\" + resultVars[ \"blockp\" + i] ].text(\n\t\t\t\tString.fromCharCode( resultVars[ \"c\" + resultVars[ \"blockp\" + i] + \"p\" + i] )\n\t\t\t);\n\t\t}//end if changing a char\n\n\t\t//move the block\n\t\tif( (action === \"left\") && (resultVars[ \"blockp\" + i] > 1) ) {\n\t\t\tresultVars[ \"blockp\" + i] -= 1;\n\t\t\tallResultVisuals.frontLayer[\"player\" + (i+1) + \"block\"].x( allResultVisuals.midLayer[\"player\" + (i+1) + \"c\" + resultVars[ \"blockp\" + i] ].x() );\n\t\t}\n\t\telse if( (action === \"right\") && (resultVars[ \"blockp\" + i] < 4) ) {\n\t\t\tresultVars[ \"blockp\" + i] += 1;\n\t\t\tallResultVisuals.frontLayer[\"player\" + (i+1) + \"block\"].x(\n\t\t\t\tallResultVisuals.midLayer[\"player\" + (i+1) + \"c1\" ].x()\n\t\t\t\t+ ( (resultVars[ \"blockp\" + i] - 1) * allResultVisuals.frontLayer[\"player\" + (i+1) + \"block\"].width() )\n\t\t\t);\n\t\t}\n\n\t} //end for each player\n\n\n\n\n\t//End the input to submit scores.\n\tif(keyboardKeys[\"Enter\"] === \"down\") {\n\n\t\tresultScoreCheckingBeforePageReload();\n\n\t\tdocument.location.reload(true);\n\t}\n\n}", "handleInput(input) {\n if (input == \"up\" && this.y >= 45) {\n this.y-=85\n } else if (input == \"right\" && this.x <= 300) {\n this.x+=100\n } else if (input == \"down\" && this.y <= 300) {\n this.y+=85\n } else if (input == \"left\" && this.x >= 50) {\n this.x-=100\n }\n if (this.y <= -40) {\n gameOver();\n }\n }", "run() {\n // Render the player name and associated counter to help the user know who is who\n console.log(`\\n\\n${this.player[0].getName()} : ${this.player[0].getCounterIcon()} | ${this.player[1].getName()} : ${this.player[1].getCounterIcon()}\\n`);\n\n // Render an initial view of the board\n this.board.render();\n\n // Get the input from the current player\n this.player[this.playerTurn].getInput((input) => {\n // Try and drop a counter into the board\n let dropped = this.board.dropCounter(input, this.player[this.playerTurn].counterIcon);\n\n if (dropped) {\n // Did we connect 4 (or maxCountToWin!)?\n if (this.board.checkWin(this.player[this.playerTurn].getCounterIcon())) {\n this.board.render();\n console.log(`\\n####### ${this.player[this.playerTurn].getName()} is the winner!! #######`);\n return;\n }\n\n // Switch players\n this.playerTurn === 0 ? this.playerTurn = 1 : this.playerTurn = 0;\n\n // All good? Re-run and give the next player a turn\n this.run();\n } else {\n console.log('\\n*** Invalid input, try again! ***');\n // Bad input or the column is full, let's run again as the same player\n this.run();\n }\n }, this.board.getCols(), this.board.getRows());\n }", "function doBrowserInput(event) {\r\n if (GAME.gameOver) {\r\n return;\r\n }\r\n if (event.which === 13 || event.keyCode === 13) {\r\n var ti = document.getElementById(\"con_stdin\");\r\n doBrowserOutput(ti.value + \"\\n\");\r\n GAME.input(ti.value);\r\n ti.value = \"\";\r\n } \r\n}", "handleInput(key) {\n\n switch (key) {\n case \"left\":\n //check for wall, otherwise move left\n if (this.x > this.wall.left && !timeModel.isStop) {\n this.x -= this.move.x;\n }\n break;\n case \"right\":\n //check for wall, otherwise move right\n if (this.x < this.wall.right && !timeModel.isStop) {\n this.x += this.move.x;\n }\n break;\n case \"up\":\n //check if player reached top of water, if so call success function,\n // otherwise move up\n if (this.y < this.wall.top && !timeModel.isStop) {\n canvas.inceaseScore();\n canvas.completeLevel();\n } else if(!timeModel.isStop) {\n this.y -= this.move.y;\n }\n break;\n case \"down\":\n //check for bottom, otherwise move down\n if (this.y < this.wall.bottom && !timeModel.isStop) {\n this.y += this.move.y;\n }\n break;\n \n case \"start\":\n // enter to start/restart the game \n if (timeModel.isStop) {\n addDiv.innerHTML = ''; \n timeModel.isStop = false;\n canvas.setTimer();\n canvas.completeLevel();\n score = 0;\n break; \n } \n }\n }", "handleInput(input) {\n switch (input) {\n case \"left\":\n if (this.x > 0) {\n this.x -= this.rightLeft;\n }\n break;\n case \"right\":\n if (this.x < 4 * this.rightLeft) {\n this.x += this.rightLeft;\n }\n break;\n case \"up\":\n if (this.y > 5) {\n this.y -= this.upDown;\n this.win();\n }\n break;\n case \"down\":\n if (this.y < 4 * this.upDown) {\n this.y += this.upDown;\n }\n break;\n default:\n break;\n }\n }", "runGame() {\r\n HangmanUtils.displayGameOptions();\r\n let gameOption = input.questionInt(\">> \");\r\n let game = new Game(this.sourceFileName, this.recordsFileName, this.maxScore);\r\n switch (gameOption) {\r\n case 1:\r\n game.opOneRoundIndependent();\r\n break;\r\n case 2:\r\n game.opOneGameplay();\r\n break;\r\n case 3:\r\n game.opContinuousGameplays();\r\n break;\r\n case 4:\r\n break;\r\n default:\r\n console.log(\"\\nPlease only enter 1, 2, 3 or 4!\");\r\n input.question(\"\\nPress \\\"Enter\\\" to proceed...\");\r\n }\r\n }", "function processGameRound(command) {\n\n // Remove any spaces from the command text\n trimCommand = $.trim(command);\n\n // Process command takes the players action\n processCommand(command);\n\n if (!directionalMovePerformed) {\n // This means an unsuccessful N, E, W, or S was entered and the user has not moved yet.\n // Get the heck out of here!\n return;\n }\n\n // Meeting NegaBea (Negative Bea..opps, almost gave that away)\n if (currentRoomName(currentRoom) == negaBeaLair && isNegaBeaAlive) {\n // You are fighting the NegaBea\n var powerOfLoveIndex = gameObjects.indexOf(\"Power of Love\");\n var powerOfSelfRespectIndex = gameObjects.indexOf(\"Power of Self Respect\");\n\n if (inventoryContainsItem(powerOfLoveIndex)) {\n simple_alertify(\"Nega-Bea appeared and attacked but YOU had the \" + gameObjects[powerOfLoveIndex] + \n \" so it's dead.\", \"Yay now dismiss.\");\n isNegaBeaAlive = false;\n attackedMonster(\"Nega-Bea\");\n } \n else if (inventoryContainsItem(powerOfSelfRespectIndex)) \n {\n simple_alertify(\"Nega-Bea appeared and attacked but YOU had the \" + gameObjects[powerOfSelfRespectIndex] + \n \" so it's dead.\", \"Yay now dismiss.\");\n isNegaBeaAlive = false;\n attackedMonster(\"Nega-Bea\");\n }\n else \n {\n simple_alertify_closure(\"Nega-Bea appeared and attacked your self-esteem.<br/>You got hurt but not badly.\", \n \"Dismiss because you feel bad.\", \n function (e) { \n if (e) { \n lostHP(1, \"Nega-Bea\"); \n hits--;\n\n if (hits <= 0) {\n // Set hits to 0, negative is possible and would freak people out.\n hits = 0;\n userHasDied();\n isGameOver = true;\n }\n\n displayGameScreen();\n } \n });\n }\n }\n\n // Meeting the Shipper (Final Boss). Yes, Shipper as in Korrasami shippers.\n if (currentRoomName(currentRoom) == shippersLair && isShipperAlive) {\n // if you are fighting the shipper and you have the deadly combo needed.\n var exodiaItemIndex = gameObjects.indexOf(\"Exodia Deck\");\n var realityItemIndex = gameObjects.indexOf(\"Reality Cheque\");\n\n if (inventoryContainsItem(exodiaItemIndex) && inventoryContainsItem(realityItemIndex)) {\n simple_alertify(\"The Shipper appeared but you attacked it by using obliderate from the \" + gameObjects[exodiaItemIndex] + \n \" and cashing in the \" + gameObjects[realityItemIndex] + \"!<br/><br/>He will no longer suggest weird ships and you \" + \n \"got your cellphone back!<br/><br/>You finished in \" + getMoveCount() + \" moves.\", \"Congratulation!\");\n isShipperAlive = false; //End Game\n isGameOver = true; \n }\n else {\n simple_alertify_closure(\"The Shipper appeared and attacked you with its uncomfortable fan fiction. Tough luck kid, you're dead.\", \n \"Dismiss\",\n function (e) {\n if (e) {\n hits = 0;\n userHasDied();\n isGameOver = true;\n displayGameScreen(); // Refresh.\n }\n });\n }\n }\n\n // Meeting the Big 4 because you have Wind...get it? His Attack is also 4 now...\n if (currentRoomName(currentRoom) == windRoom) {\n var randomIndex = randomItemIndexFromGameObjects();\n if (inventoryContainsItem(randomIndex)) {\n simple_alertify(\"You heard your phone ring and because you had \" + gameObjects[randomIndex] + \n \". You were safe from a potential attack\", \"Dismiss\");\n } \n else {\n simple_alertify_closure(\"You heard your cellphone ring but the Big 4 attacked you<br/>in the dark before you could make sense \" +\n \"of it!<br/>You got hurt physically and emotionally.\", \n \"Dismiss\", \n function (e) { \n if (e) { \n lostHP(4, \"Big 4\"); \n\n hits = hits - 4;\n if (hits <= 0) {\n hits = 0;\n userHasDied();\n isGameOver = true;\n }\n\n displayGameScreen();\n } \n });\n }\n }\n\n displayGameScreen();\n }", "function processInput() {\n //\n // Double buffering on the queue so we don't asynchronously receive inputs\n // while processing.\n let processMe = inputQueue;\n inputQueue = [];\n\n for (let inputIndex in processMe) {\n let input = processMe[inputIndex];\n let client = activeClients[input.clientId];\n client.lastMessageId = input.message.id;\n switch (input.message.type) {\n case 'thrust':\n // Need to compute the difference since the last update and when the thrust\n // input was received. This time difference needs to be simulated before the\n // thrust input is processed in order to keep the client and server thinking\n // the same think about the player's ship.\n client.player.thrust(input.message.elapsedTime, input.receiveTime - lastUpdateTime);\n lastUpdateTime = input.receiveTime;\n break;\n case 'rotate-left':\n client.player.rotateLeft(input.message.elapsedTime);\n break;\n case 'rotate-right':\n client.player.rotateRight(input.message.elapsedTime);\n break;\n case 'fire':\n client.player.fire(input.message.elapsedTime);\n break;\n case 'join-game':\n handleJoinGame(input);\n break;\n case 'hyperspace':\n client.player.hyperspace(input);\n break;\n }\n }\n}", "function inputBox (){\n\tinput = document.getElementById(\"inputBox\").value;\n\tconsole.log(input);\n\n\tif (input === \"N\" || input === \"n\") {\n\t\tmoveNorth();\n\t\tdocument.getElementById(\"error\").innerHTML = \"\";\n\t}\n\telse if (input === \"S\" || input === \"s\") {\n\t\tmoveSouth();\n\t\tdocument.getElementById(\"error\").innerHTML = \"\";\n\n\t}\n\telse if (input === \"E\" || input === \"e\") {\n\t\tmoveEast();\n\t\tdocument.getElementById(\"error\").innerHTML = \"\";\n\n\t}\n\telse if (input === \"W\" || input === \"w\") {\n\t\tmoveWest();\n\t\tdocument.getElementById(\"error\").innerHTML = \"\";\n\t}\n\telse if (input === \"T\" || input === \"t\") {\n\t\ttakeButton();\t\n\t}\n\telse if (input === \"H\" || input === \"h\") {\n\t\thelp();\n\t} \n\telse if (input === \"X\" || input === \"x\") {\n\t\tsearchForItem();\n\t}\n\telse if (input === \"I'm ready\") {\n\t\tuserStaplePaper();\n\t}\n\t\n\telse {\n\t\tdocument.getElementById(\"error\").innerHTML = \"That is not a valid input. Please enter S, N, E, or W.\";\n\t}\n}", "function createGameBoard(){\n // Store the value set to uppercase, spilt into arr in var\n inputWord = inputField.val();\n // Stores the return value for validate func\n let valiadation = validate(inputWord);\n if (valiadation) {\n inputWord = inputWord.toUpperCase().split('');\n input.hide();\n createLetterHolders(inputWord);\n createAlphabet();\n alphabet.show();\n wordField.show();\n }else {\n inputField.val('');\n }\n }// end createGameBoard func", "function input(){\n console.log('Enter 1 to DIPOSIT.\\nEnter 2 to WITHDRAW.\\nEnter 3 to CHECK BALANCE.',\n '\\nEnter 4 to ADD someone to queue',\n '\\nEnter 5 to see the LENGTH of the queue\\nEnter 6 to Exit the process');\n rl.question('Enter option: ', function(i){\n try{\n if(isNaN(i)||i==''||parseInt(i)<0||i%1!=0)\n throw 'try again and enter a valid input '\n switch (parseInt(i)) {\n case 1:deposit(input); \n break;\n case 2:withdraw(input);\n break;\n case 3:console.log('our balance is: ',bal);\n input();\n break;\n case 4:queue.push(1);\n console.log('new length of the queue: ',queue.size);\n input();\n break;\n case 5:console.log('length of the queue: ',queue.size);\n input();\n break;\n case 6: rl.close();\n process.exit(0);\n break;\n default:console.log('please enter a valid input.');\n input();\n break;\n }\n }catch(err){\n console.log(err);\n input();\n }\n });\n }", "function enter() {\n if (userInput.value.length > 0) {\n if (isValidGuess(userInput.value)) {\n let correctGuess = userInput.value.toLowerCase();\n let index = targetWords.indexOf(correctGuess);\n let boardWord = board.childNodes[index];\n boardWord.childNodes.forEach((tile) => {\n // show word on board\n tile.style.opacity = \"1.0\";\n tile.childNodes[0].classList.remove(\"invisible\");\n tile.classList.add(\"wordFound\");\n });\n }\n deleteInput(); // clear input\n }\n }", "function processInput() {\n var value = inputArea.value;\n /* split input in text area by newline */\n var lines = value.split('\\n');\n var output = parseLines(lines);\n /* Output is an object with two properties,\n 'outputLines' and 'errors' */\n var outputLines = output.outputLines;\n var errors = output.errors;\n /* Toggle visibility of errors section\n depending on if there are errors at all */\n if (errors.length == 0) {\n errorsContainer.classList.remove('visible');\n } else {\n errorsContainer.classList.add('visible');\n /* clear all errors before adding new ones */\n while (errorsUl.firstChild) {\n errorsUl.removeChild(errorsUl.firstChild);\n }\n errors.forEach(function(error) {\n addErrorToUl(error);\n });\n }\n /* actually set the output to pre element,\n join multiple lines with newline */\n outputPre.innerHTML = outputLines.join('\\n');\n }", "function start(){\n \t// Local variables\n //Sets Heigh and Width\n\tlet height = prompt('What height for your board? ');\n let width = prompt('What width for your board? ');\n\n\n\t// SYNCHRONOUSLY read from keyboard\n\tconsole.log('Creating a board with size ' + height + ' x ' + width + '.');\n\t// Create new board object\n\tlet myBoard = new board(height, width);\n\n\tconsole.log('----Othello----');\n let p2 = 'W';\n\tlet p1 = prompt('Player 1, choose B or W ');\n //Sets P1 to Black or White\n\tif (p1 == 'B' || p1 == 'b'){\n p1 = 'B';\n p2 = 'W';\n\t} else if (p1 == 'W' || p1 == 'w'){\n p1 = 'W';\n p2 = 'B';\n\t} else{\n while (p1 != ('B' || 'b') || ('W' || 'w'))\n\t\tp1 = prompt('Player 1, choose B or W ');\n\t}\n\tif(p1 == 'B'){\n\t\tp1 = 'B';\n\t\tp2 = 'W';\n\t}else{\n\t\tp1 = 'W';\n\t\tp2 = 'B';\n\t}\n\n //Begin Game\n\tconsole.log('Player 1:' + p1);\n\tconsole.log('Player 2:' + p2);\n\tconsole.log('----Begin----');\n\n\t// Print board\n\tmyBoard.printBoard();\n\n //Log of Total Moves since game start\n\tlet totalMoves = 0;\n //Current Player\n var current = p1;\n //Exit Variable for Quiting\n\tlet exit = false;\n\t// Loop, asking user input, calling appropriate functions.\n\twhile (!myBoard.isGameOver() && !exit) {\n\n //If even, it is player 1's turn, else it is player 2's turn\n\t if ( totalMoves%2 == 0){\n\t\t\tcurrent = p1;\n\t\t\tconsole.log(\"Player 1 Choose, or E for Exit\")\n\t\t} else {\n\t\t\tcurrent = p2;\n\t\t\tconsole.log(\"Player 2 Choose, or E for exit\")\n\t\t}\n\n\t\tlet row = prompt('What row? ');\n\t\tlet col = 0;\n\t\tlet gameSave = '';\n exit = false;\n\n //If player chooses e, let them exit\n\t\tif ( row == \"e\"){\n\t\tconsole.log(\"Would you like to save?\");\n\t\tgameSave = prompt('Y for yes, N for no');\n //If game save is y, save board to file in same dir\n\t\tif(gameSave == 'Y' || 'y'){\n\t\t\texit = true;\n\t\t\tconsole.log(\"Game Saved\");\n\t\t\tsaveFile(\"test\",myBoard);\n //Don't save game\n\t\t}else if(gameSave == 'N' || 'n'){\n\t\t\texit = true;\n\t\t}else{\n\t\t\tconsole.log(\"The game continues!\");\n\t\t}\n }\n\n //Player 1, if game is not exited\n\t\tif(!exit){\n\t\tcol = prompt('What col? ');\n\t\tif ( col == \"e\"){\n\t\tconsole.log(\"Would you like to save?\");\n\t\tgameSave = prompt('Y for yes, N for no');\n\t\tif(gameSave == 'Y' || 'y'){\n\t\t\texit = true;\n\t\t\tconsole.log(\"Game Saved\");\n\t\t\tsaveFile(\"test\",myBoard);\n\t\t}else if(gameSave == 'N' || 'n'){\n\t\t\texit = true;\n\t\t}else{\n\t\t\tconsole.log(\"The game continues!\");\n\t\t}\n\t}\n}\n\n //Player 2, if game is not exited\n\t\tif(!exit){\n\t\tif ((myBoard.isValid(row - 1,col - 1,current)) == true){\n\t\t\t// Print board\n console.log('Good move');\n\t\t\tmyBoard.placeDiskAt(row-1,col-1,current);\n\t\t\tmyBoard.printBoard();\n\t\t\ttotalMoves++;\n\t\t} else if(myBoard.isValidMoveAvailable(current) == false){\n\t\t\tconsole.log('No valid moves possible for ' + current);\n\t\t} else {\n console.log('Skipping');\n totalMoves++;\n\t }\n\t }\n\n\t}\n\n console.log('Goodbye');\n\tlet winner = myBoard.checkWinner();\n\tif (winner == p1 || winner == p2) {\n\tconsole.log('Game is over. The winner is ' + winner);\n\t} else {\n\tconsole.log(\"Game is over. No winner.\");\n\t}\n\n\n\t// Save board example code.\n\t//saveFile(\"test.json\", myBoard);\n}", "function gameParser(input) {\n TicTacToe.mostRecentCommand = input;\n // console.log(\"GAMEPARSER input: \" + input);\n var inputArray = input.slice(4).split('-');\n // console.log(inputArray);\n var actionParams = eval(\"ttt.\".concat(inputArray[0], \".params\"));\n // console.log(actionParams);\n gameParamString = \"\";\n for (i = 1; i < actionParams + 1; i++) {\n if (i == actionParams) {\n gameParamString = gameParamString.concat(\"'\", inputArray[i], \"'\");\n } else {\n gameParamString = gameParamString.concat(\"'\", inputArray[i], \"',\");\n }\n }\n // console.log(gameParamString);\n eval(\"ttt.\".concat(inputArray[0], \".action(\" + gameParamString + \")\"));\n}", "function input() {\n rl.question('Length: ', length => {\n rl.question('Width: ', width => {\n rl.question('Height: ', height => {\n if (!isNaN(length) && !isNaN(width) && !isNaN(height)) {\n console.log(`\\nBeam: ${beam(length, width, height)}`);\n rl.close()\n } else {\n console.log(`Length, Width and Height must be a number\\n`);\n input()\n }\n })\n })\n })\n}", "function execute() {\n \"use strict\";\n\tif (game === 0) {\n\t\tif (arrayofmoves[nmb] !== 1 && arrayofmoves[nmb] !== 2) {\n\t\t\t//Storage functions\n\t\t\tblcknumb = blok + numbarray[nmb];\t//saves ID name\n\t\t\tarrayofmoves[nmb] = turnswitch; //Saves player action into array\n\t\t\tdocument.getElementById(blcknumb).innerHTML = character; //writes O or X to ID\n\t\t\t\n\t\t\t//calculating functions\n\t\t\tturncounter(); //counts turn's\n\t\t\twin(); //Tests for a won game\n\t\t\tif (game === 0) {\n\t\t\t\tturnswitcher();\t\t\t\t//Switches player after each turn\n\t\t\t\tcpu_opponent();\t\t\t\t//Plays computer opponent\n\t\t\t}\n\t\t\tprintdisplay();\t\t\t\t\t//Return's to display\n\t\t}\n\t}\n}", "function game(userChoice) {\n const comp_input = comp_choice();\n console.log(\"So, you hit the -->\" + userChoice);\n console.log(\"Computer hit -->\" + comp_input);\n win_loss(userChoice, comp_input);\n}", "function processInput(elapsedTime) {\n //\n // Start with the keyboard updates so those messages can get in transit\n // while the local updating of received network messages are processed.\n myKeyboard.update(elapsedTime);\n //\n // Double buffering on the queue so we don't asynchronously receive messages\n // while processing.\n let processMe = network.getQueue();\n network.resetQueue();\n\n while (!processMe.empty) {\n let message = processMe.dequeue();\n\n switch (message.type) {\n case NetworkIds.SET_STARTING_POSITION:\n connectPlayerSelf(message.data);\n break;\n case NetworkIds.OPPONENT_STARTING_POSITION:\n connectPlayerOther(message.data);\n break;\n case NetworkIds.DISCONNECT_OTHER:\n disconnectPlayerOther(message.data);\n break;\n case NetworkIds.UPDATE_SELF:\n updatePlayerSelf(message.data);\n break;\n case NetworkIds.UPDATE_OTHER:\n updatePlayerOther(message.data);\n break;\n case NetworkIds.BULLET_NEW:\n bulletNew(message.data);\n break;\n case NetworkIds.BULLET_HIT:\n bulletHit(message.data);\n break;\n case NetworkIds.REMOVE_POWERUPS:\n currentPowerups.removePowerups(message.data);\n break;\n case NetworkIds.UPDATE_SCORE:\n score = message.data;\n break;\n case NetworkIds.SHIELD_INIT:\n shield.initialize(message.data);\n break;\n case NetworkIds.POWERUP_INIT:\n currentPowerups.initialize(message.data);\n break;\n case NetworkIds.WINNER:\n window.alert('You are the champion!');\n break;\n case NetworkIds.END_OF_GAME:\n let finalScores = JSON.parse(message.data);\n let formattedAlert = formatEndingAlert(finalScores);\n network.emit(NetworkIds.DISCONNECT_GAME);\n window.alert(`Final Scores:\\n${formattedAlert}`);\n menu.showScreen('main-menu');\n break;\n }\n }\n }", "function askUser() {\n if (turn === 0){\n board[shipRow][shipCol] = \"I\";\n console.log(`My hidden battleship is indicated at \"I\"! haha!`)\n printBoard();\n process.exit();\n } else {\n askUserForRow();\n }\n}", "function Getstats()\n{\n if (input==0)\n {\n readline.question(\"\\n\\nPlease tell me your name. \", playername =>\n {\n console.log(\"\\nYou have chosen the name: %s. \", playername);\n playernamesw = 1;\n holdname = playername;\n health=100;\n mana=50;\n gold=10;\n playerlvl = 1;\n playerloc = [0, 0, 0];\n savedatasw = 1;\n input = 1;\n Save();\n Graphic2();\n Map();\n Hud();\n Commands();\n });\n }\n}", "function input(event) {\n if (bossFight == false) {// Take Input from the Player\n if (event.type === \"keydown\") {\n switch (event.keyCode) {\n case 37:\n gamerInput = new GamerInput(\"Left\");\n direction = 1;\n break; //Left key\n case 39:\n gamerInput = new GamerInput(\"Right\");\n direction = 2;\n break; //Right key\n case 69:\n dig = true;\n break;\n default:\n gamerInput = new GamerInput(\"None\"); //No Input\n direction = 0;\n\n }\n } else {\n gamerInput = new GamerInput(\"None\"); //No Input\n direction = 0;\n dig = false;\n }\n console.log(\"Gamer Input :\" + gamerInput.action);\n }\n}", "function handleInput()\n{\n\t// Empty input packet\n\tuserInputPacket = [];\n\t\n\t// Mouse angle\n\tif (!globalOrientWorldAroundPlayer) {\n\t\tuserInputPacket.push('ANGLE' + mouseAngle);\n\t}\n\t\n\t// Movement\n\tif (input.isDown(userInputControls.down)) {\n\t\tuserInputPacket.push('DOWN');\n\t}\n\tif (input.isDown(userInputControls.up)) {\n\t\tuserInputPacket.push('UP');\n\t}\n\tif(input.isDown(userInputControls.rleft)) {\n\t\tuserInputPacket.push('RLEFT');\n\t}\n\tif(input.isDown(userInputControls.rright)) {\n\t\tuserInputPacket.push('RRIGHT');\n\t}\n\tif(input.isDown(userInputControls.left)) {\n\t\tuserInputPacket.push('LEFT');\n\t}\n\tif(input.isDown(userInputControls.right)) {\n\t\tuserInputPacket.push('RIGHT');\n\t}\n\n\t// Brakes\n\tif(input.isDown(userInputControls.brake))\n\t{\n\t\tuserInputPacket.push('BRAKE');\n\t}\n\n\t// Weapons\n\tif(input.isDown(userInputControls.fire)) {\n\t\tuserInputPacket.push('FIRE');\n\t}\n\t\n\tif(input.isDown(userInputControls.swap_weapons)) {\n\t\tuserInputPacket.push('SWAP_WEAPONS');\n\t}\n\t\n\t\n\t// Mouse buttons (weapons)\n\tif (mouseButtonsDown[1]) {\n\t\tuserInputPacket.push('FIRE');\n\t}\n\tif (mouseButtonsDown[2]) {\n\t\tuserInputPacket.push('SWAP_WEAPONS');\n\t}\n\tif (mouseButtonsDown[3]) {\n\t\tuserInputPacket.push('FIRE2');\n\t}\n\n\n\tif(input.isDown(userInputControls.loot_weapon)) {\n\t\tuserInputPacket.push('LOOT_WEAPON');\n\t}\n\tif(input.isDown(userInputControls.loot_weapon2)) {\n\t\tuserInputPacket.push('LOOT_WEAPON2');\n\t}\n\tif(input.isDown(userInputControls.loot_armor)) {\n\t\tuserInputPacket.push('LOOT_ARMOR');\n\t}\n\tif(input.isDown(userInputControls.loot_engine)) {\n\t\tuserInputPacket.push('LOOT_ENGINE');\n\t}\n\n\n\tif(input.isDown('k')) // Suicide button\n\t{\n\t\tuserInputPacket.push('k');\n\t}\n\n\n\treturn userInputPacket;\n}", "function userInput() {\n let gridSize = 1;\n while (gridSize < 2 || gridSize > 50) {\n gridSize = prompt(\"How many squares per side would you like your grid to have? Maximum of 50.\");\n }\n createChildDivs(gridSize);\n}", "function runProgram(){\n\n userWord=initialPrompt();\n\n\n\n transformStyle=scoreStylePrompt();\n\n console.log(userWord);\n console.log(transformStyle);\n \n}", "function handlerGame(event) {\n //Need to prevent the default behaviour through the method:\n event.preventDefault();\n\n //Save user number each time \n const userTrial = (inputEl.value);\n //Converted to number (parsing)\n const userTrialParsed = parseInt(userTrial);\n // console.log(userTrial, userTrialParsed);\n\n //Call the function that evaluates the number and show results \n // evaluateNumber2(userTrial,userTrialParsed);\n evaluateNumber3(userTrialParsed);\n\n //Call the function that sets the accumulator according to the user's trials; \n countUserTrials();\n}", "function myInputEvent() {\n if(document.getElementById(\"rowNum\").value == \"\")\n puzzle_N = default_N;\n puzzle_N = document.getElementById(\"rowNum\").value;\n reset = true;\n}", "function handleInput( keyPressed ) {\n // if the user pressed the space bar\n if ( keyPressed === \"space\" )\n {\n // if we're in the \"showResult\" game state\n if ( global.gameState === \"showResult\" )\n {\n // reset the game and transition back to the running state\n reset();\n global.gameState = \"running\";\n }\n }\n }", "function submitConsoleInput(event, $value){\n var input = $('#input');\n\n switch (event.keyCode) {\n case 13: //enter\n document.getElementById(\"input\").value = \"\";\n Module.print(\"> \" + $value);\n commandsArray.push($value);\n commandsArrayIndex = commandsArray.length;\n\n switch ($value) {\n //If submitted command is 'time' toggle the button.\n case 'time':\n toggleTime();\n break;\n default:\n interpret($value);\n break;\n }\n break;\n\n //Handle command history\n case 38: //arrow up\n if (commandsArrayIndex > 0){\n commandsArrayIndex--;\n }\n input.val(commandsArray[commandsArrayIndex]);\n input.caretToEnd();//Place the text cursor at the end of the line.\n break;\n case 40: //arrow down\n if (commandsArrayIndex < commandsArray.length){\n commandsArrayIndex++;\n }\n input.val(commandsArray[commandsArrayIndex]);\n break;\n }\n\n}", "function submitInput () {\n\tif (heightInput.value === \"\" || charInput.value === \"\") {\n\t\talert(\"You must type a height (number) and a character to build your tree!\");\n\t} \n\telse {\n\t\t//tree object to store values from user input\n\t\tvar christmas = {\n\t\theight: heightInput.value,\n\t\tchar: charInput.value\n\t\t};\n\t\ttree(christmas);\n\t}\n}", "handleInput(input) {\n switch(input) {\n case 'left':\n if (this.x > 0) {\n this.x -= this.step;\n }\n break;\n case 'up':\n if (this.y > this.jump) {\n this.y -= this.jump;\n }\n break;\n case 'right':\n if (this.x < this.step * 4) {\n this.x += this.step;\n }\n break;\n case 'down':\n if (this.y < this.jump * 4) {\n this.y += this.jump;\n }\n break; \n }\n }", "function processInput(message)\r\n\r\n{\r\n \r\n if(message == \"hello\")\r\n {\r\n return(\"What's up?\");\r\n \r\n }\r\n \r\n \r\n else{\r\n return(\"You suck!\");\r\n }\r\n \r\n \r\n}", "handleInput(input){\n switch(input) {\n case 'left':\n if (this.x > 0) {\n this.x -= this.step;\n }\n break;\n case 'up':\n if (this.y > 0) {\n this.y -= this.jump \n } ;\n break;\n case 'right':\n if( this.x < this.step * 4) {\n this.x += this.step;\n }\n break;\n case 'down':\n if( this.y < this.jump * 4){\n this.y += this.jump;\n }\n break;\n }\n\n }", "function userInput(e)\n {\n if(!isGamePaused)\n {\n switch (e.keyCode)\n {\n // a --- left\n case 65:\n moveShapeLeft();\n break;\n \n \n // s --- down\n case 83:\n speedUpShape();\n break;\n \n \n // d --- right\n case 68:\n moveShapeRight();\n break;\n \n \n // w --- rotate/change rotation\n case 87:\n\n if(canRotate)\n {\n rotateShape(); \n }\n \n break;\n }\n }\n }", "handleInputBob() {\n if (this.state.phaseNumber === 1) {\n this.setState({comment:\"Click on a Word!\"});\n }\n //actions of passive players\n else if (this.state.phaseNumber === 2) {\n //gives clue\n if (this.state.bobInput !== this.state.mysteryWords[(this.state.mysteryWordId-1)]){\n this.updatePhaseHUD(3);\n this.setState({phaseNumber:3, comment:\"Very Nice!\"});\n } else {\n this.setState({comment:\"Try to give an valid Clue please!\"});\n }\n }\n else if (this.state.phaseNumber === 4) {\n this.setState({comment:\"The Tutorial is already over!\"});\n }\n else {\n this.setState({comment:\"It's not Bob's Turn!\"});\n }\n }", "function input() {\n rl.question(\"Panjang sisi: \", (x) => {\n \n if (!isNaN(x) ) {\n console.log(`\\n Kubus: ${cubeFormula(x)}`);\n rl.close();\n } else {\n console.log(`sisi harus angka\\n`);\n input();\n }\n \n });\n}", "function tic_tac_toe(id) // main function\n{\n userInput(id);\n}", "handleInput(keys) {\n switch(keys) {\n \t\tcase 'left' :\n this.x = this.x - 100;\n if (this.x < 0) {\n this.x = 0;\n }\n \t\tbreak;\n\n \t\tcase 'right' :\n this.x = this.x + 100;\n if (this.x > 400) {\n this.x = 400;\n }\n \t\tbreak;\n\n \t\tcase 'down' :\n this.y = this.y + 85;\n if (this.y > 485) {\n this.y = 485;\n }\n \t\tbreak;\n \n //if player reaches the river, player ++.\n \t\tcase 'up' :\n this.y = this.y - 85;\n if (this.y <= -25) {\n this.x = 200;\n this.y = 485;\n this.score++;\n scoreIncrease.innerHTML = this.score;\n //if player gets to 20, win games!\n if (this.score === 20) {\n this.winGame();\n this.reset();\n }\n }\n \t\tbreak;\n \t}\n }", "function userInput(option, input){\n switch (option) {\n case 'concert-this':\n concertInfo(input);\n break; \n \n case 'spotify-this-song': \n songInfo(input);\n break; \n \n case 'movie-this': \n movieInfo(input); \n\n break; \n\n case 'do-what-it-says':\n showInfo();\n break; \n\n default: \n log(\"Invalid\");\n }\n }", "run() {\r\n let runOption = 0;\r\n do {\r\n console.clear();\r\n HangmanUtils.displayIntroduction();\r\n runOption = input.questionInt(\">> \");\r\n switch (runOption) {\r\n case 1:\r\n console.clear();\r\n HangmanUtils.displayRules();\r\n this.runGame();\r\n break;\r\n case 2:\r\n this.runStatistics();\r\n break;\r\n case 3:\r\n console.log(\"Good Bye! :)\");\r\n break;\r\n default:\r\n console.log(\"\\nPlease enter 1, 2 or 3 only!\");\r\n input.question(\"\\nPress \\\"Enter\\\" to proceed...\");\r\n }\r\n }\r\n while (runOption !== 3);\r\n }", "function handleInput() {\n\t\t\tif (onInput) {\n\t\t\t\tonInput(value);\n\t\t\t}\n\t\t}", "function handleKeyInput() {\n\t\t\tif(keys.isPressed(keyCodes.UP) && !(\"UP\" in keyBurns) && selectedLane > 0 && timeSinceSelection <= 0) {\n\t\t\tselectedLane--;\n\t\t\tlanes[selectedLane+1].unhighlight();\n\t\t\tlanes[selectedLane].highlight();\n\t\t\tcar.moveTo(lanes[selectedLane].getYCenter());\n\t\t\tkeyBurns[\"UP\"] = 10;\n\t\t}\n\t\telse if(keys.isPressed(keyCodes.DOWN) && !(\"DOWN\" in keyBurns) && selectedLane < 3 && timeSinceSelection <= 0) {\n\t\t\tselectedLane++;\n\t\t\tlanes[selectedLane-1].unhighlight();\n\t\t\tlanes[selectedLane].highlight();\n\t\t\tcar.moveTo(lanes[selectedLane].getYCenter());\n\t\t\tkeyBurns[\"DOWN\"] = 10;\n\t\t}\n\t\tif(keys.isPressed(keyCodes.SPACE) && !(\"SPACE\" in keyBurns) && selectedLane >= 0 && selectedLane <= 3 && timeSinceSelection <= 0) {\n\t\t\tif(gameStarted) {\n\t\t\t\tif(lanes[selectedLane].getAnswer() == question.term)\n\t\t\t\t\thandleCorrectAnswer();\n\t\t\t\telse handleIncorrectAnswer();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(selectedLane == 3)\n\t\t\t\t\tstartGame();\n\t\t\t}\n\t\t\tcar.moveTo(lanes[selectedLane].getYCenter());\n\t\t\tkeyBurns[\"SPACE\"] = 15;\n\t\t}\n\t\tfor(var i in keyBurns) {\n\t\t\tkeyBurns[i]--;\n\t\t\tif(keyBurns[i] == 0)\n\t\t\t\tdelete keyBurns[i];\n\t\t}\n\t}", "function gameLoop() {\n\t\t\tMAET_GDK.getInputs();\n\t\t\tthisGSM.runGameState();\n\t\t\t\n\t\t\treturn;\n\t\t}", "handleInput(key) {\n this.keyCode = key;\n switch (key) {\n case \"esc\":\n if (this.state == \"running\") {\n this.changeState(\"paused\", this.bugsSpeeds);\n }\n else if (this.state == \"paused\") {\n this.changeState(\"running\", this.bugsSpeeds);\n }\n break;\n \n case \"enter\":\n if (this.state == \"stopped\") {\n this.changeState('running', this.bugsSpeeds);\n } else {\n if ((this.state == 'lost')||(this.state == 'won')) {\n this.changeState('stopped', this.bugsSpeeds);\n this.initGame();\n this.life.numberOfThis = 5;\n this.gemCounter.numberOfThis = 0;\n this.keyCounter.numberOfThis = 0;\n this.player.lifes = 5;\n this.player.keys = 0;\n this.player.x = this.player.startX;\n this.player.y = this.player.startY;\n }\n }\n break;\n\n case 'space':\n if (this.state == 'stopped') {\n (this.currentSprite < this.players.length-1) ? this.currentSprite++ : this.currentSprite = 0;\n this.player.sprite = this.players[this.currentSprite];\n this.heroPlayer.sprite = this.players[this.currentSprite];\n };\n break;\n \n case 'l':\n if (this.state == 'stopped') {\n (this.levelCount < this.levels.length-1) ? this.levelCount++ : this.levelCount = 0;\n this.level = this.levels[this.levelCount];\n this.initGame();\n };\n break;\n \n // Not a game menu call the Player's method\n default:\n if (this.state == \"running\") this.player.move(key);\n break;\n }\n }", "function selectTypeGame(){\r\n\r\n inputs.forEach(input => input.value = \"\");//clean all imputs\r\n //if the user want to play with other user\r\n if(this.id === '2user'){\r\n //run the btnGame's logic\r\n containerModeGame.style.display = 'none';\r\n containerForm.style.display = 'block';\r\n\r\n //if the user want to play with the computer\r\n }else if(this.id === 'computerUser'){\r\n const userSelects = document.querySelectorAll('.userSelect');//btns X or O\r\n const userPrime = document.getElementById('userPrime');// input user name\r\n \r\n containerModeGame.style.display = 'none';\r\n containerPlayWithComputer.style.display = 'block'\r\n\r\n \r\n userSelects.forEach(userSelect => userSelect.addEventListener('click',(e)=>{\r\n \r\n if(userPrime.value.length === 0){//checks if the input is empty\r\n \r\n userPrime.parentNode.lastElementChild.textContent = 'User name cannot be empty';// write the message in the div\r\n //input.parentNode.lastElementChild.classList.add('alert');//add the alert class to the div\r\n\r\n userPrime.classList.add('input-alert');//add the input-alert class to the input\r\n\r\n } else {\r\n \r\n value1 = e.target.id === 'userX'? 'X':'O';\r\n value2 = value1 === 'X'? 'O':'X';\r\n\r\n //creating the user objects\r\n user1V = Object.assign(user1V,newUser(userPrime.value,true,value1));\r\n user2V = Object.assign(user2V,newUser('Computer',false,value2));\r\n\r\n \r\n containerPlayWithComputer.style.display = 'none';\r\n containerGame.style.display = 'block';\r\n\r\n //call the game; gameTicTacToe it's a module now \r\n const gameTicTacToe = game();\r\n\r\n\r\n gameTicTacToe.newGrid();\r\n gameTicTacToe.renderGrid();\r\n \r\n }\r\n\r\n \r\n }))\r\n\r\n }\r\n}", "function input(x){\nconsole.log('running input')\n return x.split(\" \"); //[hit,enemy,with,sword]\n}", "function handleSubmitBtn() {\n try {\n const result = game.playersGuessSubmission( input.value );\n if (result === 'You Win!' || result === 'You Lose.') {\n pauseScreen(result);\n } else {\n updateScreen(result);\n }\n } catch (error) {\n updateScreen(error);\n }\n \n input.value = '';\n}", "function input() {\n r = inputNumber(ipR, 3, true, 0.1, 10); // radio (m)\n tPer = inputNumber(ipT, 3, true, 1, 10); // // período (s) \n m = inputNumber(ipM, 3, true, 0.1, 10); // masa (kg)\n}", "handleInput(input) {\n console.log(\"keystroke\", input)\n switch (input) {\n case \"left\":\n return this.move(-50, 0);\n break;\n case \"up\":\n return this.move(0, -50);\n break;\n case \"right\":\n return this.move(50, 0);\n break;\n case \"down\":\n return this.move(0, 50);\n break;\n }\n }", "function readInput() {\n if (controls.moveUp) player.moveUp();\n if (controls.moveDown) player.moveDown();\n if (controls.moveLeft) player.moveLeft();\n if (controls.moveRight) player.moveRight();\n if (controls.faceUp) player.faceUp();\n if (controls.faceDown) player.faceDown();\n if (controls.faceLeft) player.faceLeft();\n if (controls.faceRight) player.faceRight();\n if (controls.shoot) player.shoot();\n}", "function process(input) {\n if (input == \"triangle\") { shape = \"triangle\"; updateCanvas(input); return \"Your complex shape simplifies and you display proudly your three sides.\" + \"<br>\"; }\n\telse if (input == \"square\") { shape = \"square\"; updateCanvas(input);}\n\telse if (input == \"circle\") { shape = \"circle\"; updateCanvas(input);}\n\telse if (input == \"octagon\") { shape = \"octagon\"; updateCanvas(input);}\n\telse if (input == \"ngon\") { shape = \"ngon\"; return \"Your already numerous faces multiply at an alarming rate. Do something about it.\";}\n else if (input == \"pink\") { color = \"pink\"; $('body').css('background-color', 'pink');}\n\telse if (input == \"exit\") { return \"There is no exit, only more shapes\" + \"<br>\" + \"\"; }\n\telse if (input == \"help\") { return \"To help you, here is a list of usefull commands:\";}\n\telse { shape = \"none\"; return \"<strong>\" + input + \"</strong> is a pretty complex shape, so complex that your body slowly <strong>disintegrates</strong> into pure matter. Quick, pick another one.\"; }\n}", "function input(event) {\n // Take Input from the Player\n // console.log(\"Input\");\n // console.log(\"Event type: \" + event.type);\n\n if (event.type === \"keydown\") {\n switch (event.keyCode) {\n case 37:\n gamerInput = new GamerInput(\"Left\");\n break; //Left key\n case 38:\n gamerInput = new GamerInput(\"Up\");\n break; //Up key\n case 39:\n gamerInput = new GamerInput(\"Right\");\n break; //Right key\n case 40:\n gamerInput = new GamerInput(\"Down\");\n break; //Down key\n case 32:\n gamerInput = new GamerInput (\"Space\");\n break;\n default:\n gamerInput = new GamerInput(\"None\"); //No Input\n }\n } else {\n gamerInput = new GamerInput(\"None\"); //No Input\n }\n console.log(\"Gamer Input :\" + gamerInput.action);\n}", "function userTurn(){\n correctInput = false;\n while(correctInput == false){\n userChoice = prompt(\"Pick Number: \" + movesArr);\n for(var i =0; i < board.length; i ++){\n for(var j =0; j < board[i].length;j++){\n if (userChoice == board[i][j]){\n board[i][j] = \"x\";\n correctInput = true;\n } else if (isNaN(userChoice)){\n correctInput = false\n }\n else if (userChoice > 9) {\n correctInput = false\n }\n }\n }\n }\n}", "function execute(){\n //add player input to the input array and compare with the 'random' colorArray\n inputArr.push(colorInput);\n //if player made a mistake\n if (colorArr[inputArr.length-1] != colorInput) {\n\n //flipAnimation is the main animation function, arguments are color, speed, isPlayerTurn and isCorrect\n inputArr = [];\n flipAnimation(colorInput, speed, phase, true, false, false);\n $('.underLine').css('width', '0');\n if (!hardMode) setTimeout(() => colorRoll(),1000);\n // if hardmode, reset to intro\n else{\n $('h4').hide().html('Game Over').fadeIn(2000);\n setTimeout(() => location.reload(), 4000);\n }\n }\n //if correctly played\n else{\n //if end of the array\n if (colorArr.length == inputArr.length){\n flipAnimation(colorInput, speed, phase, true, true ,true);\n inputArr = [];\n\n //if stage 15, victory\n if (colorArr.length == 15){\n setTimeout(() => {\n $('h4').hide().html('Victory!').fadeIn(2000);\n $('.underLine').css('width', '0');\n countSound.play();\n },speed*2);\n setTimeout(() => location.reload(), 4000);\n }\n\n else{\n getColor();\n stage++;\n setTimeout(() => {\n colorRoll();\n if (stage == 15) $('h4').hide().html('Final Stage').fadeIn(2000);\n else $('h4').hide().html('Stage '+stage).fadeIn(2000);\n $('.underLine').css('width', '0');\n $('img').attr('src', 'Images/simon.png');\n countSound.play();\n },speed*2);\n }\n }\n else flipAnimation(colorInput, speed, phase, true, true, false);\n }\n }", "start_playing() {\n if (this.nickname_input.text !== \"\") {\n // Mark game in progress\n if (Game_Controller.#playing === false) {\n Game_Controller.#playing = true;\n\n // Saves provided username for later display/database integration\n this.username = this.nickname_input.text;\n app.stage.removeChild(this.graphics);\n\n // Setup dropping of meteors\n setInterval(this.get_col, 2000);\n\n // Focus the user textbox\n this.input.focus();\n\n //Capture the keyboard arrow keys\n let enter = this.keyboard(\"Enter\");\n enter.press = () => {\n this.match_words();\n };\n enter.release = () => {\n this.input.focus();\n }\n\n // Reimplementation of backspace\n let backspace = this.keyboard(\"Backspace\");\n backspace.press = () => {\n //this.input.text = this.input.text.slice(0, -1);\n this.input.text = \"\";\n }\n backspace.release = () => {\n // Refocuses the text box\n this.input.focus();\n }\n }\n }\n }", "function manage_user_input(){\n let input = $(\"#user_input\").val().toUpperCase();\n if(input.length > 0 && !all_user_input.includes(input)){\n $(\"#game_message_p\").attr(\"hidden\",true);\n $(\"#user_input\").val(\"\");\n let isTarget = check_user_input(input);\n store_user_input(input,isTarget);\n } else {\n $(\"#game_message_p\")\n .text(\"Input too short (min length = 1) or you already tried this word.\")\n .attr(\"hidden\",false);\n }\n}", "function userInput(letter){\n \n\n}", "function checkInput(i){\t\n\tif(hasStarted){\t\t\n\t\t//if all the sequence has been reproduced without mistakes \n\t\tif(i>=sequence.length){\t\t\n\t\t\tlevel++;\t\t\t\n\t\t\t//after passing level 20 - you are a winner!\n\t\t\tif(level>20){\n\t\t\t\tcelebrate();\n\t\t\t\treturn;\n\t\t\t}\t\t\t\n\t\t\tdisplay(level);\t\t\t\n\t\t\t//append new entry to the sequence\n\t\t\taddRandomNumber();\n\t\t\t$(\"#board div\").removeClass(\"clickable\");\n\t\t\t//play the sequence again(including the new entry)\n\t\t\tsetTimeout(function(){iterateThrough();},1500);\t\t\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\t//waiting user input\n\t\tif(input===undefined||input<0){\t\t\n\t\t\tsetTimeout(function(){checkInput(i)}, 100);\n\t\t}else{//got input\n\n\t\t\tvar temp=input;\n\t\t\tinput=-1;\n\n\t\t\t//the input was wrong\n\t\t\tif(temp!==sequence[i]){\t\n\t\t\t\t\n\t\t\t\tdisplay(\"!!\");\t\t\t\n\t\t\t\terrorSound.play();\n\n\t\t\t\t$(\"#board div\").removeClass(\"clickable\");\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\tdisplay(level);\n\t\t\t\t\t$(\"#board div\").addClass(\"clickable\");\n\t\t\t\t},1500);\n\t\t\t\t//restart the game in case of strict mode\t\n\t\t\t\tif(isStrict)\n\t\t\t\t\tsetTimeout(function(){startGame();},1500);\t\t\t\n\t\t\t\t//if normal mode - repeat the sequence(without adding new entry) \n\t\t\t\telse\t\t\t\n\t\t\t\t\tsetTimeout(function(){iterateThrough();},1500);\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t\t//correct input\n\t\t\telse{\n\t\t\t\t//play according sound\n\t\t\t\tplayTune(temp);\t\t\n\t\t\t\t//get the next user input\n\t\t\t\tsetTimeout(function(){checkInput(i+1)},100);\t\t\t\n\t\t\t}\n\t\t}\t\t\n\t}\t\n}", "doInputLocal(message) {\n\n // some synchronization strategies (interpolate) ignore inputs on client side\n if (this.gameEngine.ignoreInputs) {\n return;\n }\n\n const inputEvent = { input: message.data, playerId: this.gameEngine.playerId };\n this.gameEngine.emit('client__processInput', inputEvent);\n this.gameEngine.emit('processInput', inputEvent);\n this.gameEngine.processInput(message.data, this.gameEngine.playerId, false);\n }", "HandleInput(gameTime, parent) {\n this.HandleMove(gameTime, parent);\n }", "function runGame(userChoice){\n const computerChoice = getCompChoice();\n\n //compares the users and computers choice and calls the appropriate function\n switch(userChoice+computerChoice){\n case \"rs\":\n case \"pr\":\n case \"sp\":\n win(userChoice,computerChoice);\n break;\n case \"rp\":\n case \"ps\":\n case \"sr\":\n lose(userChoice,computerChoice);\n break;\n case \"rr\":\n case \"pp\":\n case \"ss\":\n draw(userChoice,computerChoice);\n break; \n }\n}", "async takeTurn() {\n let takingInput = true\n let shot\n\n while (takingInput) {\n shot = await this.getPlayerShot()\n\n try {\n shot = this.translateInput(shot)\n takingInput = false\n }\n catch(e) {\n console.log(\"Please enter a valid format : \", e)\n }\n\n }\n \n if(shot == 'Q') {\n this.quit()\n } else {\n this.Players[1].recieveShot(shot);\n this.endTurn()\n }\n }", "handleInputAlice() {\n if (this.state.phaseNumber === 1) {\n this.setState({comment:\"Click on a Word!\"});\n }\n else if (this.state.phaseNumber === 3) {\n //guess mystery word\n if (this.state.aliceInput.toLowerCase() === this.state.mysteryWords[(this.state.mysteryWordId-1)].toLowerCase()){\n this.updatePhaseHUD(4);\n this.setState({phaseNumber:4, comment:\"You got it now!\", aliceNumber: 1});\n this.updateRightGuess();\n } else {\n this.updatePhaseHUD(4);\n this.setState({phaseNumber:4, comment:\"Wrong Guess but still very noice!\"});\n this.updateWrongGuess();\n }\n }\n else if (this.state.phaseNumber === 4) {\n this.setState({comment:\"The Tutorial is already over!\"});\n }\n else {\n this.setState({comment:\"It's not Alice's Turn!\"});\n }\n }", "function systemPosition()\n{\n\tvar AI = 0;\n\tvar Run = false;\n\t\n\t\n\t//Checking if there is any empty field available\n\tfor(var field = 0; field < 9; field++)\n\t{\n\t\tif(gameBoard.Rows[field] === true)\n\t\t{\n\t\t\tRun = true;\n\t\t}\n\t}\n\t\n\t//Error-Message if not System`s turn\n\tif(gameBar.Rounds[0].turn !== \"Rival\")\n\t{\n\t\tRun = false;\n\t\t\n\t\talert(\"Player`s turn!\");\n\t}\n\t\n\t\n\t//Searching for an empty field\n\twhile(Run)\n\t{\n\t\tAI = Brain();\n\t\t\n\t\t\n\t\tif( gameBoard.Rows[AI] === true)\n\t\t{\n\t\t\t//Stop searching for an index\n\t\t\tRun = false;\n\t\t\t\n\t\t\t/*\n\t\t\tATTENTION:\n\t\t\tShifting the game bar array.\n\t\t\t*/\n\t\t\tgameBar.Rounds.shift();\n\n\t\t\t//Clearing game bar\n\t\t\tgameBar.DivContainer.innerHTML = \"\";\n\n\t\t\t//Updating game bar (turns/rounds) and showing in browser\n\t\t\tfor(var round = 0; round < gameBar.Rounds.length; round++)\n\t\t\t{\n\t\t\t\tgameBar.DivContainer.innerHTML += gameBar.Rounds[round].image;\n\t\t\t}\n\t\t\t\n\t\t\t//Updating field occupation\n\t\t\tgameBoard.Rows[AI] = false;\n\n\t\t\t//Visualising field occupation\n\t\t\tif(AI >= 0 && AI <= 2)\n\t\t\t{\n\n\t\t\t\tgameBoard.firstROW[AI].src = gameBar.Star; \n\n\t\t\t}\n\t\t\telse if(AI >= 3 && AI <= 5)\n\t\t\t{\n\t\t\t\t//Setting AI to a valid index\n\t\t\t\tAI -= 3;\n\t\t\t\t\n\t\t\t\tgameBoard.secondROW[AI].src = gameBar.Star;\n\n\t\t\t}\n\t\t\telse if(AI >= 6 && AI <= 8)\n\t\t\t{\n\t\t\t\t//Setting AI to a valid index\n\t\t\t\tAI -= 6;\n\n\t\t\t\tgameBoard.thirdROW[AI].src = gameBar.Star;\n\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n}", "function processInput(input) {\n // then a miracle occurs\n return [left, right, top, bottom];\n}", "function setup() {\n\t//reset gridcontainer each time button is pressed\n\tdocument.getElementById('gameboard').innerHTML = '';\n\t\n\t// get user input\n\tvar rows = parseInt(document.getElementById('numrows').value, 10);\n\tvar cols = parseInt(document.getElementById('numcols').value, 10);\n\t\n\t// create and setup the game board\n\tgame = new BattleshipGame(rows, cols, 50, document.getElementById(\"gameboard\"));\n\tconsole.log('Set up new game with a ' + rows + ' by ' + cols + ' board.');\n\tconsole.log(game);\n}" ]
[ "0.6951294", "0.69132525", "0.66958964", "0.66536516", "0.6629008", "0.6626635", "0.662475", "0.6616964", "0.65451765", "0.65451765", "0.65155584", "0.6494442", "0.6488087", "0.64642763", "0.645679", "0.6435435", "0.6425906", "0.6388714", "0.6360538", "0.636015", "0.6353615", "0.63458735", "0.63430864", "0.6300759", "0.6217619", "0.6154551", "0.6143047", "0.6140576", "0.6118841", "0.6115908", "0.6100213", "0.6097302", "0.60686177", "0.6057817", "0.6051608", "0.6049058", "0.60467714", "0.6037887", "0.60313326", "0.598822", "0.5980059", "0.595915", "0.5958694", "0.5957708", "0.5953828", "0.5951141", "0.5947781", "0.59464633", "0.5945805", "0.5943378", "0.5938173", "0.5933019", "0.59101295", "0.59065765", "0.588655", "0.5861725", "0.5859995", "0.5852543", "0.58410627", "0.58337003", "0.58202815", "0.5817915", "0.5815595", "0.5806997", "0.5794287", "0.57922393", "0.57875884", "0.5787122", "0.5785603", "0.57764053", "0.57751393", "0.5773859", "0.5771225", "0.57691526", "0.5759239", "0.5743197", "0.5740789", "0.5733536", "0.57290024", "0.5719539", "0.57163113", "0.5715974", "0.5715795", "0.56984633", "0.56937516", "0.5692155", "0.5688462", "0.56830996", "0.56747216", "0.56671154", "0.5663083", "0.56597507", "0.5658824", "0.56534266", "0.56481797", "0.5644743", "0.56345356", "0.5623447", "0.5603969", "0.5600375" ]
0.61138165
30
sets the difficulty of the game
function setDifficulty() { difficultySelector.addEventListener( "input", function() { if ( this.options[ this.selectedIndex ].value === "Easy" ) { gameDifficulty = "Easy"; } else { gameDifficulty = "Hard"; } reset(); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setDifficulty(val) {\n if (difficulty !== val) {\n difficulty = val;\n score = 0;\n lives = 2;\n\n resetGame();\n // these functions are defined in HighScore.js\n removeHighScoreTable();\n defineCollection();\n renderHighScoreTable(collection);\n }\n}", "function setDifficulty(dif){\n if(dif==='easy'){\n elementsAroundMines.clear();\n clear();\n amountOfMines=10;\n elementsCount=100;\n difficulty='easy';\n drawGame(100, '50vw', '80vh', '10%', '10%', 10, 10);\n }\n if(dif==='normal'){\n elementsAroundMines.clear();\n clear();\n amountOfMines=38;\n elementsCount=240;\n difficulty='normal';\n drawGame(240, '65vw', '80vh', '5%', '8.33333%', 12, 20);\n }\n if(dif==='hard'){\n elementsAroundMines.clear();\n clear();\n amountOfMines=90;\n elementsCount=500;\n difficulty='hard';\n drawGame(500, '80vw', '80vh', '4%', '5%', 20, 25); \n }\n }", "function setDifficulty (challenge) {\n if (challenge === 'Easy') {\n difficultyTemp = 1;\n } else if (challenge == 'Medium') {\n difficultyTemp = 2;\n } else {\n difficultyTemp = 3;\n }\n\n if (multiplayerTemp != null) {\n document.getElementById('menuStartButton').disabled = false;\n }\n}", "function setDifficulty(level) {\n switch(level) {\n case 1:\n info.time = 2000;\n info.numberOfWeeds = 9;\n break;\n case 2:\n info.time = 1700;\n info.numberOfWeeds = 7;\n break;\n case 3:\n info.time = 1400;\n info.numberOfWeeds = 5;\n break;\n case 4:\n info.time = 1100;\n info.numberOfWeeds = 3;\n break;\n default:\n console.log(\"default\");\n info.time = 700;\n info.numberOfWeeds = 1;\n }\n}", "setGameDifficulty(gd)\n {\n this.gameDifficulty = gd;\n }", "function setDifficulty() {\n var hash = window.location.hash;\n if (hash.length > 1) {\n hash = hash.substr(1);\n newLevel = LEVEL_TO_DIFFICULTY.indexOf(hash);\n if (newLevel != -1) {\n level = newLevel;\n rightStreakLength = 0;\n wrongStreakLength = 0;\n loadNewExpression();\n }\n window.location.hash = \"\";\n }\n }", "function setDifficulty(){\n if(difficulty==1){\n size = [12,20]\n }\n if(difficulty==2){\n size = [25,40]\n }\n if(difficulty==3){\n size = [50,80]\n }\n}", "function increaseDifficulty() {\r\n \r\n switch (increaseDifficulty.difficulty) {\r\n\r\n case undefined:\r\n toggleEnemySpawner();\r\n toggleEnemySpawner.spawnRate = 1000;\r\n toggleEnemySpawner();\r\n increaseDifficulty.difficulty = \"easy\";\r\n break;\r\n\r\n case \"start\":\r\n toggleEnemySpawner();\r\n toggleEnemySpawner.spawnRate = 1000;\r\n toggleEnemySpawner();\r\n increaseDifficulty.difficulty = \"easy\";\r\n break;\r\n\r\n case \"easy\":\r\n toggleEnemySpawner();\r\n toggleEnemySpawner.spawnRate = 500;\r\n toggleEnemySpawner();\r\n increaseDifficulty.difficulty = \"medium\";\r\n break;\r\n\r\n case \"medium\":\r\n Enemy.v = 6;\r\n toggleEnemySpawner();\r\n toggleEnemySpawner.spawnRate = 250;\r\n toggleEnemySpawner();\r\n increaseDifficulty.difficulty = \"hard\";\r\n break;\r\n\r\n case \"hard\":\r\n toggleEnemySpawner();\r\n toggleEnemySpawner.spawnRate = 125;\r\n toggleEnemySpawner();\r\n increaseDifficulty.difficulty = \"extreme\";\r\n break;\r\n\r\n default:\r\n break;\r\n\r\n }\r\n}", "levelUpDifficulty() {\n if (gameState.maxNumber < 900) {\n gameState.maxNumber += 5; // Increase the maximum number found in a cell.\n }\n if (gameState.expressNum < 100) {\n gameState.expressNum += 4; // Increase how much the expressions can deviate by.\n }\n }", "changeGameMode(mode) {\n DATA.difficultyMode = mode;\n VIEW.displayDifficulty();\n }", "increaseDifficulty () {\n this.difficulty++\n }", "function difficultySetting(string) {\r\n\t\tswitch (string) {\r\n\t\t\tcase \"easy\":\r\n\t\t\t\treturn 150;\r\n\t\t\tcase \"hard\":\r\n\t\t\t\treturn 70;\r\n\t\t\tcase \"hell\":\r\n\t\t\t\treturn 50;\r\n\t\t\tdefault: case \"normal\":\r\n\t\t\t\treturn 100;\r\n\t\t}\r\n\t}", "upgradeDifficulty(times) {\n if (times === undefined) {\n times = 1;\n }\n for (let i = 0; i < times; i++) {\n if (this.difficulty > 0) {\n this.difficulty--;\n this.challenge++;\n } else {\n this.difficulty++;\n }\n }\n }", "_setTime() {\n switch(this.difficultyLevel) {\n case 1:\n // this.gameTime uses ms\n this.gameTime = 45000;\n break;\n case 2:\n this.gameTime = 100000;\n break;\n case 3:\n this.gameTime = 160000;\n break;\n case 4:\n this.gameTime = 220000;\n break;\n default:\n throw new Error('there is no time');\n }\n }", "changeGameLevel(difficultyLevel) {\n this.setState({ difficultyLevel: difficultyLevel });\n this.reset();\n }", "function setDifficultyWindow() {\n $scope.coin.core.DIFFICULTY_WINDOW_V1 = Math.ceil(24 * 60 * 60 / $scope.coin.core.DIFFICULTY_TARGET);\n $scope.coin.core.DIFFICULTY_WINDOW_V2 = Math.ceil(24 * 60 * 60 / $scope.coin.core.DIFFICULTY_TARGET);\n return 0;\n }", "function difficultyLevel() {\n if (chosenLevel === 'EASY') {\n chosenWordArray = easyLetterWords;\n } else if (chosenLevel === 'MEDUIM') {\n chosenWordArray = meduimLetterWords;\n } else if (chosenLevel === 'HARD') {\n chosenWordArray = hardLetterWords;\n } else if (chosenLevel === 'IMPOSSIBLE') {\n chosenWordArray = impossible;\n }\n }", "startGame() {\n //@todo: have this number set to the difficulty, easy = 3, normal = 6, hard = 9\n StateActions.onStart(5, 5, this.state.difficulty);\n StateStore.setGameState(1);\n this.gameState();\n }", "function setLevel(level) {\n if (level === 1) {\n gUserLevelInput = 4;\n gSetMineNumber = 2;\n } else if (level === 2) {\n gUserLevelInput = 8;\n gSetMineNumber = 10;\n } else if (level === 3) {\n gUserLevelInput = 16;\n gSetMineNumber = 50;\n }\n init()\n}", "function changeDifficulty(){\r\n\tcomputerDifficulty = computerDifficulty == \"Easy\" ? \"Hard\" : \"Easy\";\r\n\tdocument.getElementById(\"difficulty\").innerHTML = computerDifficulty;\r\n\tresetGame();\r\n} // changeDifficulty", "function init(difficulty = EASY_MODE) {\n game = new Game(difficulty)\n clickCount = 0\n timeUsedInSeconds = 0\n flagCount = 0\n game.init()\n $totalMines.text(game.difficulty.totalMine);\n $totalFlags.text(flagCount)\n render()\n}", "constructor(difficulty) {\n\n this.difficultyLevel = difficulty;\n this.nextGameSpaceToMoveTo = -1;\n\n }", "function setTurns(number){\n\t\t\t\t\tif(number == 1){\n\t\t\t\t\t\tgame.gender = 'woman';\n\t\t\t\t\t\tgame.turnLimit = 82; //82;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tgame.gender = 'man';\n\t\t\t\t\t\tgame.turnLimit = 79; //79;\n\t\t\t\t\t}\n\t\t\t\t}", "function set() {\n\t\tif ($(this).html() !== EMPTY) {\n\t\t\treturn;\n\t\t}\n\t\t$(this).html(turn);\n\t\tmoves += 1;\n\t\tscore[turn] += $(this)[0].identifier;\n\t\tif (win($(this))) {\n\t\t\talert('Wygrał: Gracz ' + turn);\n\t\t\tstartNewGame();\n\t\t} else if (moves === N_SIZE * N_SIZE) {\n\t\t\talert(\"Remis\");\n\t\t\tstartNewGame();\n\t\t} else {\n\t\t\tturn = turn === \"X\" ? \"O\" : \"X\";\n\t\t\t$('#turn').text('Gracz ' + turn);\n\t\t}\n\t}", "function init(difficulty) {\r\n\r\n // set stat fields\r\n setTowerStatFields();\r\n\r\n // Model\r\n game = new Game(difficulty);\r\n \r\n // update all game pieces\r\n update();\r\n // draw all updated piecesw\r\n draw();\r\n\r\n pausePanel.setPanel('pause');\r\n\r\n gameboard.style.display = 'flex';\r\n\r\n}", "function gameMenuBattlePanelDifficultyStateChangeStarter(value) {\n activeGameState.difficulty = value;\n\n store.dispatch( {\n type: DIFFICULTY_CHANGE,\n payload: {\n activeGameState: activeGameState\n }\n });\n }", "function setActiveDifficulty() {\n\tfor (const [index, button] of difficultyButtons.entries()) {\n\t\tif (difficulty === difficultyButtons.length - index - 1) button.classList.add('active');\n\t\telse button.classList.remove('active');\n\t}\n\tscore = 0;\n\tscoreDisplay.innerHTML = '0';\n}", "function diffUp() {\n difficulty++;\n if (difficulty > 10)\n difficulty = 0;\n updateDiff();\n}", "upgradeDifficulty(times) {\n if (times === undefined) {\n times = 1;\n }\n let downgrade = false;\n if (times < 0) {\n downgrade = true;\n times = Math.abs(times);\n }\n\n for (let i = 0; i < times; i++) {\n if (downgrade) {\n if (this.challenge > 0) {\n this.challenge--;\n this.difficulty++;\n } else if (this.difficulty > 0) {\n this.difficulty--;\n }\n } else {\n if (this.difficulty > 0) {\n this.difficulty--;\n this.challenge++;\n } else {\n this.difficulty++;\n }\n }\n }\n }", "function gameMenuBattlePanelDifficultyChoose() {\n if (store.getState().lastAction == DIFFICULTY_CHANGE) {\n gameMenuBattleStartPanelChooseDifficultyid.checked = false;\n gameMenuBattleStartPanelActualDifficultyid.classList.remove('game-menu-battle-start-panel-actual-difficulty-casual');\n gameMenuBattleStartPanelActualDifficultyid.classList.remove('game-menu-battle-start-panel-actual-difficulty-normal');\n gameMenuBattleStartPanelActualDifficultyid.classList.remove('game-menu-battle-start-panel-actual-difficulty-veteran');\n if (store.getState().activeGameState.difficulty == 'CASUAL') {\n gameMenuBattleStartPanelActualDifficultyid.classList.add('game-menu-battle-start-panel-actual-difficulty-casual');\n }\n if (store.getState().activeGameState.difficulty == 'NORMAL') {\n gameMenuBattleStartPanelActualDifficultyid.classList.add('game-menu-battle-start-panel-actual-difficulty-normal');\n }\n if (store.getState().activeGameState.difficulty == 'VETERAN') {\n gameMenuBattleStartPanelActualDifficultyid.classList.add('game-menu-battle-start-panel-actual-difficulty-veteran');\n }\n }\n }", "function botSet() {\n //let the player know that it is the bots turn\n displayTextStatic(\"- BOT SET -\");\n\n setTimeout(function() {\n // make a list of all the possible tricks to set.\n // must be current lvl or the lvl below (and not already set)\n for (var i = 0; i < (TOTALTRICKS); i++) {\n if (((tricks[i][1] <= level) && (tricks[i][1] >= level-1)) && (tricks[i][2] != 1)) {\n possibleTricks.push(i);\n }\n }\n //if those tricks have all been set try the level up\n if (possibleTricks.length == 0) {\n for (var i = 0; i < (TOTALTRICKS); i++) {\n if ((tricks[i][1] == level+1) && (tricks[i][2] != 1)) {\n possibleTricks.push(i);\n }\n }\n }\n //select a trick to attempt\n attemptedTrick = possibleTricks[Math.floor(Math.random() * possibleTricks.length)];\n //reset the possible tricks\n console.log(possibleTricks);\n possibleTricks = [];\n //ATTEMPT THE odds !!!!\n botAttemptSet(tricks[attemptedTrick][1]);\n }, 1500);\n}", "function startGame() {\n if(gameState.gameDifficulty === 'easy')\n {\n easyMode();\n } \n if(gameState.gameDifficulty ==='normal'){\n normalMode();\n }\n\n if(gameState.gameDifficulty ==='hard'){\n hardMode();\n }\n\n}", "handleDifficultyChange(value){\n difficultyLevel = value;\n this.setState({difficulty: difficultyLevel});\n this.getRandomWord(value);\n }", "function reset() {\n currentMonsterHealth = chosenMaxLife;\n currentPlayerHealth = chosenMaxLife;\n resetGame(chosenMaxLife);\n}", "function selectDifficulty() {\n var difficulty = document.querySelector('.difficulty');\n switch (difficulty.value) {\n case '1': init(4, 2); break;\n case '2': init(6, 5); break;\n case '3': init(8, 15); break;\n default: init(4, 2); break;\n }\n\n}", "function easy() {\n gLevel.SIZE = 4;\n gLevel.MINES = 3;\n gStorage = 'bestTime'\n init();\n}", "setChallenge(){\n this.leftBigDigit = this.CHALLENGE;\n this.rightBigDigit = this.CHALLENGE;\n this.leftSmallDigit = 0;\n this.rightSmallDigit = 0;\n }", "function getDifficulty() {\n return (2800 - (difficultyBase * 25));\n }", "SetNameAndLevel(name, level) {\n this.name = name;\n this.quizLevel = level;\n cookies.Set(\"previousUser\", this.userLevelCode());\n let bestTimeAndOriginCode = cookies.Get(this.userLevelCode().toLowerCase());\n if (bestTimeAndOriginCode) {\n let btoc = bestTimeAndOriginCode.split(\" \");\n this.bestTime = parseInt(btoc[0]);\n } else {\n ui.ShowTips(); // new player\n ui.Tip(\"Use arrow keys to move around. Collect all the eggs, then exit\");\n }\n ui.SetBestTime(this.bestTime);\n }", "function set() {\r\n if (this.innerHTML !== CLEAR) {\r\n return;\r\n }\r\n\r\n this.innerHTML = turn;\r\n moves += 1;\r\n score[turn] += this.identifier;\r\n if (win(this)) {\r\n alert('Player ' + turn + ' Wins');\r\n restartGame();\r\n } else if (moves === BoardSize * BoardSize) {\r\n alert('It is a tie');\r\n restartGame();\r\n } else {\r\n turn = turn === 'X' ? 'O' : 'X';\r\n document.getElementById('turn').textContent = 'Player ' + turn;\r\n }\r\n}", "changeDifficulty(rows, cols) {\n \n this.setState(() => ({\n theBoard: this.initTempBoard(rows, cols),\n gameStarted: false\n }))\n\n this.props.stopTimer();\n this.props.resetTimer();\n }", "function initializeGameType() {\r\n Math.seedrandom(seed);\r\n showTeamModulo = parseInt(variables['showTeamModulo']);\r\n if (showTeamModulo == -1) { \r\n var info = Math.floor(Math.random()*3);\r\n switch (info) {\r\n case 0:\r\n showTeamModulo = 0;\r\n break;\r\n case 1:\r\n showTeamModulo = 1;\r\n break;\r\n default:\r\n showTeamModulo = 3;\r\n break;\r\n }\r\n }\r\n \r\n var best = Math.floor(Math.random()*2);\r\n best = 1; // delme\r\n// alert('best:'+best);\r\n switch (best) {\r\n case 0:\r\n showBest = false;\r\n break;\r\n case 1:\r\n showBest = true;\r\n break;\r\n }\r\n \r\n if (showBest) {\r\n $(\"#prev_solution\").attr(\"value\",\"Load Best Solution\");\r\n $(\"#ii_prev_solution\").attr(\"value\",\"Load Best Solution\");\r\n }\r\n \r\n if (numPlayers < 2) { // delme\r\n forceBots = 2;\r\n }\r\n \r\n// botType = Math.floor(Math.random()*2);\r\n// botType = 0; // delme\r\n\r\n try {\r\n showScore = parseInt(variables['showScore']);\r\n if (isNaN(showScore)) {\r\n throw \"showScore not valid\" // throw error\r\n }\r\n if (showScore < 0) {\r\n showScore = Math.floor(Math.random*2); // 0 or 1\r\n } \r\n switch(showScore) {\r\n case 0:\r\n showScore = false;\r\n break;\r\n default:\r\n showScore = true;\r\n break;\r\n } \r\n } catch (err) {\r\n// alert(err);\r\n try {\r\n showScore = variables['showScore'].toLowerCase() == 'true';\r\n } catch (err2) {\r\n showScore = true;\r\n// alert(err2);\r\n }\r\n }\r\n \r\n try {\r\n showMap = parseInt(variables['showMap']);\r\n if (isNaN(showMap)) {\r\n throw \"showMap not valid\" // throw error\r\n }\r\n if (showMap < 0) {\r\n showMap = Math.floor(Math.random*2); // 0 or 1\r\n } \r\n switch(showMap) {\r\n case 0:\r\n showMap = false;\r\n break;\r\n default:\r\n showMap = true;\r\n break;\r\n } \r\n } catch (err) {\r\n// alert(err);\r\n try {\r\n showMap = variables['showMap'].toLowerCase() == 'true';\r\n } catch (err2) {\r\n showMap = true;\r\n// alert(err2);\r\n }\r\n }\r\n \r\n\r\n \r\n $(\".gameid\").append(botType);\r\n \r\n if (showBest) {\r\n $(\".gameid\").append(\"B\");\r\n } else {\r\n $(\".gameid\").append(\"L\"); \r\n }\r\n $(\".gameid\").append(showTeamModulo);\r\n// alert(showTeamModulo+\" \"+showBest);\r\n\r\n}", "function diffChoice(event) {\n resetGame();\n app.difficultyLevel = event.id;\n closeModals();\n}", "function changeGameSetting() {\n\tlet dimensionArray = boardSelect.value.split(\"x\");\n\treturn new GameSettings(difficultyEnum[diffSelect.value], new Dimension(parseInt(dimensionArray[0], 10), parseInt(dimensionArray[1], 10)));\n}", "changeDifficulty(state,cuadrados){\n state.cuadrados = cuadrados\n }", "function set() {\n if (this.innerHTML !== EMPTY) {\n return;\n }\n\n this.innerHTML = turn;\n moves += 1;\n score[turn] += this.identifier;\n console.log(`score[${turn}]: ${score[turn]}`);\n if (win(this)) {\n alert('Winner: Player ' + turn);\n startNewGame();\n } else if (moves === N_SIZE * N_SIZE) {\n alert(\"Draw\");\n startNewGame();\n } else {\n turn = turn === \"X\" ? \"O\" : \"X\";\n document.getElementById('turn').textContent = 'Player ' + turn;\n }\n\n mSet()\n}", "function reset() {\n gameMode = modeSelector.options[ modeSelector.selectedIndex ].value;\n gameDifficulty = difficultySelector.options[ difficultySelector.selectedIndex ].value;\n if ( gameDifficulty === \"Easy\" ) {\n playGame( 3 );\n } else {\n playGame( 6 );\n }\n}", "function diffDown() {\n difficulty--;\n if (difficulty < 0)\n difficulty = 10;\n updateDiff();\n}", "function newGame()\r\n{\r\n playerScore = 0;\r\n playerLevel = levels.LEVEL1;\r\n}", "function checkDifficultyLevel() {\n if(localStorage.difficultyLevel == \"Easy\"){\n obstacleFrequency = 110;\n } else if(localStorage.difficultyLevel == \"Medium\"){\n obstacleFrequency = 80;\n } else {\n obstacleFrequency = 60;\n }\n}", "setCurrentHp(val, type) {\n if (type === 'melee') {\n this.currentHps -= val;\n } else if (type === 'heal') {\n this.currentHps + val > this.getMaxHp()\n ? this.currentHps = this.getMaxHp()\n : this.currentHps += val;\n }\n this.scene.registry.set('playerHps', this.currentHps)\n }", "function correctAnswer(){\n\tscore += addScore(time);\n\tupdateScore();\n if(++level == 10){\n difficulty = 1;\n } else if(level == 20){\n difficulty = 2;\n }\n document.getElementById('level').innerHTML = \"Level : \" + level;\n\tresetComponent();\n}", "function updateLevel(correct) {\n if (correct) {\n rightStreakLength++;\n wrongStreakLength = 0;\n } else {\n rightStreakLength = 0;\n wrongStreakLength++;\n }\n // Increase/decrease difficulty based on performance.\n if (rightStreakLength >= STREAK_TO_LEVEL_UP) {\n rightStreakLength = 0;\n level = Math.min(level + 1, MAX_LEVEL)\n } else if (wrongStreakLength >= STREAK_TO_LEVEL_DOWN) {\n wrongStreakLength = 0;\n level = Math.max(level - 1, 0);\n }\n }", "changelevel(num,speed)\n\t{\n\t\tthis.hitnum = num;\n\t\tthis.len = speed;\n\t}", "difficulty(event) {\n this.setState({\n difficulty: event.target.value,\n difficulty_seconds: StateStore.setDifficulty(event.target.value)\n });\n\n event.preventDefault();\n }", "function checkDifficulty(){\n if (FLASH_DELAY.length !== FLASH_SPEED.length){\n console.log('Unexpected state: Flash diffculty states are inconsistent!');\n }\n if (currentScore > 0 && currentScore % DIFFICULTY_SHIFT_INCREMENT === 0){\n if (currentDifficulty+1 < FLASH_DELAY.length){\n currentDifficulty++;\n }\n }\n }", "function gamemode(levelgame) {\n if (levelgame == \"easy\")\n counter(5);\n else\n counter(1);\n}", "function difficultyTrigger() {\n\t$(\"#difficulty\").change(function () {\n\t\tif(alive) {\n\t\t\t$('#resume').animate({\n\t\t\t\tmarginTop: '-15px',\n\t\t\t\topacity: 1\n\t\t\t}, 300);\n\t\t\t$('.newGame').toggleClass('restart');\n\t\n\t\t\t$('#resume').click(function(e){ \n\t\t\t\tloadDifficulties();\n\t\t\t\t$('#resume').animate({\n\t\t\t\t\tmarginTop: '-88px',\n\t\t\t\t\topacity: 0\n\t\t\t\t}, 300);\n\t\t\t\t$('.newGame').removeClass('restart');\n\t\t\t});\n\t\t\t\n\t\t\t$('.restart').click(function(e){ \n\t\t\t\tdifficulty = $('#difficulty :selected').val();\n\t\t\t\t$('.newGame').removeClass('restart');\n\t\t\t\t$('#resume').animate({\n\t\t\t\t\tmarginTop: '-88px',\n\t\t\t\t\topacity: 0\n\t\t\t\t}, 300);\n\t\t\t\tnewGame(); \n\t\t\t});\n\t\t} else {\n\t\t\tdifficulty = $('#difficulty :selected').val();\n\t\t}\n\t}).trigger('change');\n}", "function setupGame() {\n level = 1; // Updates level to default value\n lives = 5; // Updates lives to default value\n max = 100; // Updates max range to default value\n min = 0; // Updates min range to default value\n randomNumber = getRandomInt(max, min); // Generates random number with default ranges for round\n settingsVisibility = false; // Settings element not visible\n loadEmoji('start'); // Renders emoji of type start\n\n // Update DOM Elements Data to default values\n errorMsg.innerText = \"\";\n guessInput.className = \"\"; // Removes error animation if any\n feedback.innerText = \"Click Guess to START GAME!\";\n guessInput.value = \"\";\n indicator.innerText = \"Good Luck!\";\n maxInput.value = 100; // Sets max Input value to default range\n minInput.value = 0; // Sets min Input value to default range\n newRanges.className = \"\"; // Removes animation to new ranges element\n newRanges.innerText = \"\";\n\n // Sets Attributes for Default Range Inputs\n guessInput.setAttribute('max', 100); // Sets attribute to default value\n guessInput.setAttribute('min', 0); // Sets attribute to default value\n}", "function cycleDifficulty() {\n difficulty = difficultyLevels[difficultyIndex];\n if (difficultyIndex === 2) {\n difficultyIndex = 0;\n } else {\n difficultyIndex++;\n }\n $('#difficulty').text(difficulty);\n }", "function initGame(){\n\t// init available number of hidden tip\n\tmarioGame.nTips = 5;\n\t$(\"#level\").click(tipNhack);\n\t$(\"#level\").css({\n\t\t\"cursor\" : \"help\"\n\t});\n\t\n\tsetTimeout( displayStart, 500);\n\t\n}", "function displayDifficulty(difficulty) {\n $(\"#difficulty\").html(\"Difficulty: \" + difficulty + \n \" <b class=\\\"caret\\\"></b>\");\n }", "function changeLevel() {\n if (!gameRunning()) {\n // if game is not running allow level changing\n showGameField.classList.remove(gameLevel.innerText);\n var levels = [{ name: \"terrier\", size: 9 }, { name: \"bernese\", size: 16 }, { name: \"puppy\", size: 4 }];\n\n // run through the levels\n level++;\n level = level % 3;\n\n if (levels[level].size % 2 == 0) fieldSizeIsOdd = false;\n\n gameLevel.innerText = levels[level].name;\n fieldSize = levels[level].size;\n showGameField.classList.add(gameLevel.innerText);\n start();\n } else changeLevelHint();\n // show hint, that is is not allowed to change level while game is running\n }", "function setReward(state) {\n\n let currentLevel = state.currentLevel;\n let difficulty = state.difficulty;\n let reward = Reward[difficulty];\n let levels = state.levels;\n\n \n if(currentLevel===0){\n levels[0].reward = reward.rewardPer;\n }\n else if(currentLevel < 10){\n \n\n function correctCount(levels, currentLevel){\n let correct = 0;\n levels.forEach(function(level){\n if(level.correct){\n correct +=1;\n }\n });\n return correct;\n };\n\n levels[currentLevel].reward = reward.rewardPer * correctCount(levels);\n }\n\n state.levels = levels;\n return state;\n}", "changeShakingStrength(power)\n {\n this.shakingRadius = power;\n }", "function resetGame(){\n startingLevel = 1;\n startingScore = 0;\n startingLives = 5;\n\n changeScore(startingLevel, startingScore);\n changeLevel(startingLevel);\n}", "function SetGameOptions()\n{\n\tGameEvents.SendCustomGameEventToServer( \"set_game_mode\", {\n\t\t\"is_host\": CheckForHostPrivileges(),\n\t\t\"modes\": {\n\t\t\t\"all_random\": $('#AllRandomToggle').checked,\n\t\t\t\"frantic_mode\": $('#FranticToggle').checked,\n\t\t\t\"tower_upgrades\": $('#TowerUpgradesToggle').checked,\n\t\t\t\"bounty_multiplier\": $('#GoldExpOptionsDropdown').GetSelected().id,\n\t\t\t\"creep_power\": $('#CreepPowerOptionsDropdown').GetSelected().id,\n\t\t\t\"tower_power\": $('#TowerPowerOptionsDropdown').GetSelected().id,\n\t\t\t\"respawn_reduction\": $('#RespawnTimeOptionsDropdown').GetSelected().id,\n\t\t\t\"hero_power\": $('#InitialGoldExpDropdown').GetSelected().id,\n\t\t\t\"kills_to_end\": $('#KillsToEndOptionsDropdown').GetSelected().id,\n \"hero_pick_rule\" : $('#HeroPickRuleDropdown').GetSelected().id,\n\t\t}\n\t});\n\n\tAnimatePanel($('#game_options_container'), { \"transform\": \"translateX(-150px);\", \"opacity\": \"0;\" }, 0.8);\n}", "setBeakerColor()\n {\n if(this.gameDifficulty === 3)\n {\n let color = this.determineDifficulty2_Color();\n\n }\n else if (this.gameDifficulty === 2)\n {\n\n let color = this.determineDifficulty2_Color();\n }\n else\n {\n\n let color = this.determineDifficulty1_Color();\n\n }\n }", "function getDifficulty() {\n return LEVEL_TO_DIFFICULTY[level];\n }", "function determineGameSpeed(){\r\n let difficulty = $('input[name=difficulty]:checked').val()\r\n switch(difficulty){\r\n case 'Easy':\r\n gameSpeed.spawnTime = 2000\r\n gameSpeed.despawnTime = 3000\r\n break\r\n case 'Medium':\r\n gameSpeed.spawnTime = 1000\r\n gameSpeed.despawnTime = 1250\r\n break\r\n case 'Hard':\r\n gameSpeed.spawnTime = 500\r\n gameSpeed.despawnTime = 900\r\n break\r\n case 'Good Luck':\r\n gameSpeed.spawnTime = 2000\r\n gameSpeed.despawnTime = 3000\r\n difficultyTimer = setInterval(updateGameSpeed, 5000)\r\n }\r\n}", "function setStats(){\n console.log('Stats set')\n\n switch(Global.PLAYER_CLASS) {\n \n case 'Ninja':\n //this.ONE();\n break;\n \n case 'Warrior':\n Global.PLAYER_DEFENSE = 4;\n Global.PLAYER_SKILL1 = 20;\n mod = prob/10.0;\n Global.PLAYER_SKILL2 = Math.round((Global.PLAYER_SKILL1 + Global.PLAYER_SKILL1) * (mod))\n //player_skill2 = (int)Math.round((player_skill1 + player_skill1) * (mod));\n Global.PLAYER_HEALTH = 100;\n //gameClass = \"warrior\";\n break;\n\n case 'Knight':\n //this.THREE();\n break;\n\n case 'Preist':\n //this.FOUR();\n break;\n\n }\n\n\n}", "function startGame() {\n luminousScore = 0;\n}", "function setup_level(level) {\n switch (level) {\n case 1:\n game_level_score = level1.score;\n set_game_level_score(game_level_score);\n drop_gifts(level1.items());\n break;\n case 2:\n game_level_score = level2.score;\n set_game_level_score(game_level_score);\n drop_gifts(level2.items());\n break;\n case 3:\n game_level_score = level3.score;\n set_game_level_score(game_level_score);\n drop_gifts(level3.items());\n break;\n default:\n console.log(\"Levels exhausted. Sorry!\");\n }\n}", "function resetVals(){\n var s = document.getElementById(\"initSize\");\n size = s.options[s.selectedIndex].value;\n var d = document.getElementById(\"initDiff\");\n difficulty = d.options[d.selectedIndex].value;\n startGame();\n}", "function setLevel() {\n level = 1;\n}", "function gameSetUp() {\n\ttargetNumber = \"\";\n\tcurrentScore = 0\n\t$(\"#current-score\").text(currentScore);\n\t$(\"#wins\").text(\"Wins: \" + wins);\n\t$(\"#losses\").text(\"Losses: \" + losses);\n\tsetTarget();\n\tsetImageValues();\n\tassignAttributes();\n}", "function setUpLevels() {\n if (level === 1) {\n console.log(`level: ${level}`)\n setTime(40)\n } else if (level === 2) {\n console.log(`level: ${level}`)\n setTime(20)\n } else if (level === 3) {\n console.log(`level: ${level}`)\n setTime(10)\n }\n}", "function initializeGame() { // FONCTION POUR METTRE EN ROUTE\n\n\tgame.difficult = requestInteger(\"Choisir difficulté easy:1 ; medium:2 ; hard:3\", 1, 3);\n\t \n switch (game.difficult) {\n\n\t\tcase 1:\n\t game.HpDragon = getRandomInteger(150,200);\n\t game.HpPlayer= getRandomInteger(200,250);\n\t break;\n\t \n\t case 2:\n\t game.HpDragon = getRandomInteger(200,250);\n\t game.HpPlayer= getRandomInteger(200,250);\n\t break;\n\n\t\tcase 3:\n\t game.HpDragon = getRandomInteger(200,250);\n\t game.HpPlayer= getRandomInteger(150,200);\n\t break; \n\t}\n\n\tgame.armor = requestInteger(\"Choisir armure: 1:en cuivre, 2:en fer, 3:magique \", 1, 3);\n\n\tswitch (game.armor) {\n\n\t\tcase 1:\n\n\t game.armorRatio = 1;\n\t break;\n\t \n\t case 2:\n\n\t game.armorRatio = 1.25;\n\t break;\n\n\t\tcase 3:\n\n\t game.armorRatio = 2;\n\t break; \n\t}\n\n\tgame.weapon =requestInteger(\"Choisir une arme: 1: en cuivre, 2:en fer, 3: excalibur \", 1, 3);\n\n\tswitch (game.weapon) {\n\n\t\tcase 1:\n\n\t game.weaponRatio = 0.5;\n\t break;\n\t \n\t case 2:\n\n\t game.weaponRatio = 1;\n\t break;\n\n\t\tcase 3:\n\n\t game.weaponRatio = 2;\n\t break; \n\t}\n}", "function sizetodepth(size, dif){\n if(dif == \"Easy\"){\n if(size == 4) difficulty = 2;\n else if(size == 5) difficulty = 2;\n else if(size == 6) difficulty = 2;\n else if(size == 7) difficulty = 2;\n else difficulty = 2;\n }else if(dif == \"Medium\"){\n if(size == 4) difficulty = 5;\n else if(size == 5) difficulty = 5;\n else if(size == 6) difficulty = 5;\n else if(size == 7) difficulty = 5;\n else difficulty = 5;\n }else if(dif == \"Hard\"){\n if(size == 4) difficulty = 10;\n else if(size == 5) difficulty = 10;\n else if(size == 6) difficulty = 9;\n else if(size == 7) difficulty = 8;\n else difficulty = 7;\n }else if(dif == \"Hardcore (may be slow)\"){\n if(size == 4) difficulty = 14;\n else if(size == 5) difficulty = 12;\n else if(size == 6) difficulty = 10;\n else if(size == 7) difficulty = 9;\n else difficulty = 9;\n }\n}", "function setGameState() {\n for(var i = 0; i < puzzle.length; i++) {\n if (i == 0 || i == puzzle.length - 1) {\n var t = \"locked\";\n } else {\n var t = \"\";\n }\n GAME_STATE.words[i] = {\n word: puzzle[i],\n team: t\n }\n }\n}", "function autoLevelEquipment() {\n //if((game.jobs.Miner.locked && game.global.challengeActive != 'Metal') || (game.jobs.Scientist.locked && game.global.challengeActive != \"Scientist\"))\n //return;\n var Best = {\n 'healthwood': {\n Factor: 0,\n Name: '',\n Wall: false,\n Status: 'white'\n },\n 'healthmetal': {\n Factor: 0,\n Name: '',\n Wall: false,\n Status: 'white'\n },\n 'attackmetal': {\n Factor: 0,\n Name: '',\n Wall: false,\n Status: 'white'\n },\n 'blockwood': {\n Factor: 0,\n Name: '',\n Wall: false,\n Status: 'white'\n }\n };\n var enemyDamage = getEnemyMaxAttack(game.global.world + 1, 30, 'Snimp', .85);\n var enemyHealth = getEnemyMaxHealth(game.global.world + 1);\n \n //below challenge multiplier not necessarily accurate, just fudge factors\n if(game.global.challengeActive == \"Toxicity\") {\n //ignore damage changes (which would effect how much health we try to buy) entirely since we die in 20 attacks anyway?\n if(game.global.world < 61)\n enemyDamage *= 2;\n enemyHealth *= 2;\n }\n if(game.global.challengeActive == 'Lead') {\n enemyDamage *= 2.5;\n enemyHealth *= 7;\n }\n //change name to make sure these are local to the function\n var enoughHealthE = !(doVoids && voidCheckPercent > 0) && (baseHealth * 4 > 30 * (enemyDamage - baseBlock / 2 > 0 ? enemyDamage - baseBlock / 2 : enemyDamage * 0.2) || baseHealth > 30 * (enemyDamage - baseBlock > 0 ? enemyDamage - baseBlock : enemyDamage * 0.2));\n var enoughDamageE = (baseDamage * 4 > enemyHealth);\n \n if (game.global.world == 200) { //&& ((new Date().getTime() - game.global.zoneStarted) / 1000 / 60) > 10 && ((new Date().getTime() - game.global.zoneStarted) / 1000 / 60) < 20){\t\t\n enoughHealthE = false;\t\t\n enoughDamageE = false;\t\t\n }\n\n for (var equipName in equipmentList) {\n var equip = equipmentList[equipName];\n // debug('Equip: ' + equip + ' EquipIndex ' + equipName);\n var gameResource = equip.Equip ? game.equipment[equipName] : game.buildings[equipName];\n // debug('Game Resource: ' + gameResource);\n if (!gameResource.locked) {\n document.getElementById(equipName).style.color = 'white';\n var evaluation = evaluateEquipmentEfficiency(equipName);\n // debug(equipName + ' evaluation ' + evaluation.Status);\n var BKey = equip.Stat + equip.Resource;\n // debug(equipName + ' bkey ' + BKey);\n\n if (Best[BKey].Factor === 0 || Best[BKey].Factor < evaluation.Factor) {\n Best[BKey].Factor = evaluation.Factor;\n Best[BKey].Name = equipName;\n Best[BKey].Wall = evaluation.Wall;\n Best[BKey].Status = evaluation.Status;\n }\n\n document.getElementById(equipName).style.borderColor = evaluation.Status;\n if (evaluation.Status != 'white' && evaluation.Status != 'yellow') {\n document.getElementById(equip.Upgrade).style.color = evaluation.Status;\n }\n if (evaluation.Status == 'yellow') {\n document.getElementById(equip.Upgrade).style.color = 'white';\n }\n if (evaluation.Wall) {\n document.getElementById(equipName).style.color = 'yellow';\n }\n\n //Code is Spaced This Way So You Can Read It:\n if (\n evaluation.Status == 'red' &&\n (\n ( getPageSetting('BuyWeaponUpgrades') && equipmentList[equipName].Stat == 'attack' ) \n ||\n ( getPageSetting('BuyWeaponUpgrades') && equipmentList[equipName].Stat == 'block' )\n ||\n ((getPageSetting('BuyArmorUpgrades') && ((equipmentList[equipName].Resource != 'metal')\n || ((gameResource.prestige+5 <= (game.global.world-5)/5 && game.global.soldierHealth > 0 && ((armorTempValue > 50 && armorTempValue < 100)|| armorValue < 1000))\n || (gameResource.prestige+4 <= (game.global.world-5)/5 && game.global.soldierHealth > 0 && ((armorTempValue > 20 && armorTempValue < 50)|| armorValue < 500))\n || (gameResource.prestige+3 <= (game.global.world-5)/5 && game.global.soldierHealth > 0 && ((armorTempValue > 10 && armorTempValue < 20)|| armorValue < 200))\n || (gameResource.prestige+2 <= (game.global.world-5)/5 && game.global.soldierHealth > 0 && ((armorTempValue > 1 && armorTempValue < 10)|| armorValue < 100)))\n || gameResource.prestige < 5 || game.global.world == 200 ) && (equipmentList[equipName].Stat == 'health'))\n && \n //Only buy Armor prestiges when 'DelayArmorWhenNeeded' is on, IF:\n (\n (game.global.world == 200) // not in level 200\n ||\n\t\t\t(getPageSetting('DelayArmorWhenNeeded') && !shouldFarm) // not during \"Farming\" mode \n || // or\n (getPageSetting('DelayArmorWhenNeeded') && enoughDamage) // has enough damage (not in \"Wants more Damage\" mode)\n || // or \n (getPageSetting('DelayArmorWhenNeeded') && !enoughDamage && !enoughHealth) // if neither enough dmg or health, then tis ok to buy.\n || \n (getPageSetting('DelayArmorWhenNeeded') && equipmentList[equipName].Resource == 'wood')\n || \n !getPageSetting('DelayArmorWhenNeeded') //or when its off.\n )\n )\n )\n ) \n {\n var upgrade = equipmentList[equipName].Upgrade;\n if (upgrade != \"Gymystic\")\n debug('Upgrading ' + upgrade + \" - Prestige \" + game.equipment[equipName].prestige, '*upload');\n else\n debug('Upgrading ' + upgrade + \" # \" + game.upgrades[upgrade].allowed, '*upload');\n buyUpgrade(upgrade, true, true);\n }\n }\n }\n preBuy();\n game.global.buyAmt = 1;\n for (var stat in Best) {\n if (Best[stat].Name !== '') {\n var eqName = Best[stat].Name;\n var DaThing = equipmentList[eqName];\n document.getElementById(Best[stat].Name).style.color = Best[stat].Wall ? 'orange' : 'red';\n //If we're considering an attack item, we want to buy weapons if we don't have enough damage, or if we don't need health (so we default to buying some damage)\n if (getPageSetting('BuyWeapons') && DaThing.Stat == 'attack' && (!enoughDamageE || enoughHealthE)) {\n if (DaThing.Equip && !Best[stat].Wall && canAffordBuilding(eqName, null, null, true)) {\n debug('Leveling equipment ' + eqName, '*upload3');\n buyEquipment(eqName, null, true);\n }\n }\n //If we're considering a health item, buy it if we don't have enough health, otherwise we default to buying damage\n if (getPageSetting('BuyArmor') && (DaThing.Stat == 'health' || DaThing.Stat == 'block') && !enoughHealthE) {\n if (DaThing.Equip && !Best[stat].Wall && canAffordBuilding(eqName, null, null, true)) {\n debug('Leveling equipment ' + eqName, '*upload3');\n buyEquipment(eqName, null, true);\n }\n }\n if (getPageSetting('BuyArmor') && (DaThing.Stat == 'health') && getPageSetting('AlwaysArmorLvl2') && game.equipment[eqName].level < 2){\n if (DaThing.Equip && !Best[stat].Wall && canAffordBuilding(eqName, null, null, true)) { \n debug('Leveling equipment ' + eqName + \" (AlwaysArmorLvl2)\", '*upload3');\n buyEquipment(eqName, null, true);\n } // ??idk?? && (getPageSetting('DelayArmorWhenNeeded') && enoughDamage)\n }\n }\n }\n postBuy();\n}", "function initHard() {\n init(difficultyConfigServices.hard.x,\n difficultyConfigServices.hard.y,\n difficultyConfigServices.hard.b)\n }", "function setGame() {\n if(whichReset === \"resetBtn\") {\n setRange(1, 100);\n } else {\n setRange(parseInt(minNumRange.value), parseInt(maxNumRange.value));\n }\n setRangeValue(minNum, maxNum);\n setMinMaxValues(minNum, maxNum);\n randomNumber = Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum;\n guessText.className = \"normalText\";\n lastGuessNumber.innerText = \"Take a guess between \" + minNum + \" & \" + maxNum;\n numberGuessInput.value = \"\";\n lastGuessNumber.style.color = \"black\";\n resetBtn.disabled = true;\n guessBtn.disabled = false;\n numberGuessInput.disabled = false;\n typeOfInput();\n textVisible();\n disableClearBtn();\n console.log(\"Min:\" + minNum + \" Max:\" + maxNum + \" Random:\" + randomNumber);\n}", "initGame() {\n\n this.state = 'stopped';\n this.bugsSpeeds = []; // empty bug speed with every init\n\n // change the state and create entities depending on the choosed lvl\n switch(this.level) {\n case 'Easy':\n this.numOfBugs = 4;\n\n this.allBugs = Enemy.createMultiple(this.numOfBugs, this.numRows);\n this.allGems = Gem.createMultiple(this.gemColor.length+2, this.winWidth, this.gemColor, this.numCols);\n this.allRocks = [];\n // for caching original bug speed as it'll be stoped or zerolized [= 0] upon pause state\n for (let bug of this.allBugs) {\n this.bugsSpeeds.push(bug.speed);\n }\n\n this.changeState(this.state, this.bugsSpeeds);\n break;\n case 'Medium':\n this.numOfBugs = 5;\n this.numOfRocks = 2;\n\n this.allBugs = Enemy.createMultiple(this.numOfBugs, this.numRows);\n this.allGems = Gem.createMultiple(this.numCols/1.6, this.winWidth, this.gemColor, this.numCols);\n this.allRocks = Rock.createMultiple(this.numOfRocks, this.winWidth, this.numRows, this.numCols);\n \n for (let bug of this.allBugs) {\n this.bugsSpeeds.push(bug.speed);\n }\n\n this.changeState(this.state, this.bugsSpeeds);\n break;\n case 'Hard':\n this.numOfBugs = 7;\n this.numOfRocks = 3;\n\n this.allBugs = Enemy.createMultiple(this.numOfBugs, this.numRows);\n this.allGems = Gem.createMultiple(this.numCols-1, this.winWidth, this.gemColor, this.numCols);\n this.allRocks = Rock.createMultiple(this.numOfRocks, this.winWidth, this.numRows, this.numCols);\n \n for (let bug of this.allBugs) {\n this.bugsSpeeds.push(bug.speed);\n }\n\n this.changeState(this.state, this.bugsSpeeds);\n break;\n };\n // random img for game states to show in modal\n this.randomWinImg = this.winnerImg[Math.floor(Math.random() * ((this.winnerImg.length-1)-0) + 1) + 0];\n this.randomLoseImg = this.loserImgs[Math.floor(Math.random() * ((this.loserImgs.length-1)-0) + 1) + 0];\n this.randomPauseImg = this.zzz[Math.floor(Math.random() * (this.zzz.length-1)-0)/* + 0) + 0*/];\n // let randomDefaultImg = this.players[Math.floor(Math.random() * (this.players.length-1) - 0) + 0];\n\n }", "function changeSpawnRate() {\n\tif (game.score < 50) {\n\t\tgame.spawnRate = 1.3;\n\t}\n\telse if (game.score < 100) {\n\t\tgame.spawnRate = 1.15;\n\t}\n\telse if (game.score < 150) {\n\t\tgame.spawnRate = 1;\n\t}\n\telse if (game.score < 200) {\n\t\tgame.spawnRate = 0.9;\n\t}\n\telse if (game.score < 250) {\n\t\tgame.spawnRate = 0.8;\n\t}\n\telse if (game.score < 300) {\n\t\tgame.spawnRate = 0.7;\n\t}\n\telse if (game.score < 350) {\n\t\tgame.spawnRate = 0.6;\n\t}\n\telse {\n\t\tgame.spawnRate = 0.5;\n\t}\n}", "move() {\n if(difficulty === 1){\n this.speed = 5;\n if(random() < 0.1 &&\n stealer.pos.x + stealer.size / 6 > this.x - this.w / 2){\n this.vy = this.speed;\n }\n }\n else if(difficulty === 2 || difficulty === 4){\n this.speed = 10;\n if(random() < 0.1 &&\n stealer.pos.x + stealer.size / 6 > this.x - this.w / 2){\n this.vy = this.speed;\n }\n }\n else if(difficulty === 3){\n this.speed = 15;\n if(random() < 0.1 &&\n stealer.pos.x + stealer.size / 6 > this.x - this.w / 2){\n this.vy = this.speed;\n }\n }\n this.y += this.vy;\n }", "setGameLength() {\r\n const { league } = this.props;\r\n if (league === \"mlb\") {\r\n gameLength = helper.innings;\r\n } else if (league === \"nhl\") {\r\n gameLength = helper.periods;\r\n } else {\r\n gameLength = helper.quarters;\r\n }\r\n }", "function PrepareGame() {\n SelectLevel()\n basic.showString(\"S:\" + screen)\n PrepareChallenge()\n new_y = -1\n total_tries = 0\n in_game = true\n score = 0\n selectedDots = [-1, -1, -1, -1, -1]\n SelectSpeed()\n while (input.buttonIsPressed(Button.A) || input.buttonIsPressed(Button.B) || input.buttonIsPressed(Button.AB)) {\n }\n}", "function newGame() {\n level = 1;\n lives = 3;\n levelKey = 0;\n levelHeart = 0;\n time = 0;\n startTimer();\n}", "attack() {\n const userWeaponNameInFrench = this.map.weapons[this.weaponName].nameFR;\n this.game.textToPrompt = `Votre attaque grâce à votre ${userWeaponNameInFrench} fait <b>${this.damages} de dégâts</b> sur l'adversaire`;\n\n if (this.number === 2) { //P2\n const player1 = this.game.players[0];\n if (player1.isDefending) {\n player1.life -= (this.damages / 2);\n player1.isDefending = !player1.isDefending;\n this.game.textToPrompt = `Votre attaque grâce à votre ${userWeaponNameInFrench} fait <b>${this.damages/2} de dégâts</b> sur l'adversaire`;\n } else {\n player1.life -= this.damages;\n }\n } else { //P1 \n const player2 = this.game.players[1];\n if (player2.isDefending) {\n player2.life -= (this.damages / 2);\n player2.isDefending = !player2.isDefending;\n this.game.textToPrompt = `Votre attaque grâce à votre ${userWeaponNameInFrench} fait <b>${this.damages/2} de dégâts</b> sur l'adversaire`;\n } else {\n player2.life -= this.damages;\n }\n }\n //updating lifebar (color, number and animation)\n this.game.players.forEach(player => {\n const playerLifeBar = `#life-bar-p${player.number}`;\n player.life <= 75 ? $(playerLifeBar).addClass(\"yellow\") : \"\";\n player.life <= 50 ? $(playerLifeBar).addClass(\"orange\") : \"\";\n player.life <= 25 ? $(playerLifeBar).addClass(\"red\") : \"\";\n $(playerLifeBar).css(\"width\", this.game.players[player.number - 1].life + \"%\");\n $(`#life-p${player.number}`).html(this.game.players[player.number - 1].life);\n })\n }", "setSpeed() {\n const speedChoice = this.getRandom();\n const slow = 3;\n const medium = 6;\n const fast = 9;\n \n if (speedChoice < 4) {\n return slow;\n } else if (speedChoice < 7) {\n return medium;\n } else {\n return fast;\n }\n }", "function changeSpeed() {\n gameSpeed = (gameSpeed % 3) + 1;\n updateSpeedOption();\n}", "function C012_AfterClass_Jennifer_PleasurePlayerSetSpeed(SpeedFactor) {\n\tC012_AfterClass_Jennifer_PleasurePlayerSpeed = C012_AfterClass_Jennifer_PleasurePlayerSpeed + SpeedFactor;\n\tif (C012_AfterClass_Jennifer_PleasurePlayerSpeed < 0) C012_AfterClass_Jennifer_PleasurePlayerSpeed = 0;\n\tif (C012_AfterClass_Jennifer_PleasurePlayerSpeed > 2) C012_AfterClass_Jennifer_PleasurePlayerSpeed = 2;\n}", "function resetHealth() {\n lukeSkywalker.healthPoints = 140;\n obiWan.healthPoints = 120;\n princessLeia.healthPoints = 115;\n hanSolo.healthPoints = 129;\n maceWindu.healthPoints = 140;\n yoda.healthPoints = 150;\n \n darthVader.healthPoints = 119;\n darthMaul.healthPoints = 110;\n tarkin.healthPoints = 90;\n palpatine.healthPoints = 130;\n kyloRen.healthPoints = 129;\n snoke.healthPoints = 145;\n console.log('user health: ' + userFighter.healthPoints);\n }", "function resetSkills(){\n\n\tfor (let i=0; i < levels.length; i++){\n\t\t\n\t\tif( i == 12 || i == 18 ){ continue; }\n\t\t\n\t\tif( i == 0 || i == 1 ){\n\t\t\tlevels[i] = 1;\n\t\t}else{\n\t\t\tlevels[i] = 0;\n\t\t}\n\t\t\n\t\tlet skillTexts = document.getElementsByClassName(\"skill_text\");\n\t\tif( skillTexts[i] != undefined ){\n\t\t\tskillTexts[i].innerHTML = levels[i] + \"/\" + maxLevels[i];\n\t\t}\n\t\tsetPointsUsed();\n\t\t\n\t}\n\n\tsetSkillLock();\n\tsetUrl();\n\n}", "function setGameMode(gameMode)\n{\n\tif (!gameInProgress)\n\t{\n\t\tswitch(gameMode)\n\t\t{\n\t\t\tcase \"VEasy\":\n\t\t\t\tnumRows = 6;\n\t\t\t\tnumColumns = 6;\n\t\t\t\tballRadius = 20;\n\t\t\t\tballSpeed = 1.25;\n\t\t\t\tpaddleSpeed = 7;\n\t\t\t\tpaddleWidth = 200;\n\t\t\t\tpaddleBounciness = 0.1;\n\t\t\t\tblankFrequency = 30;\n\t\t\t\tbreak;\n\t\t\tcase \"Easy\":\n\t\t\t\tnumRows = 8;\n\t\t\t\tnumColumns = 8;\n\t\t\t\tballRadius = 16;\n\t\t\t\tballSpeed = 1.5;\n\t\t\t\tpaddleSpeed = 7;\n\t\t\t\tpaddleWidth = 200;\n\t\t\t\tpaddleBounciness = 0.1;\n\t\t\t\tblankFrequency = 20;\n\t\t\t\tbreak;\n\t\t\tcase \"Normal\":\n\t\t\t\tnumRows = 10;\n\t\t\t\tnumColumns = 10;\n\t\t\t\tballRadius = 12;\n\t\t\t\tballSpeed = 2;\n\t\t\t\tpaddleSpeed = 4;\n\t\t\t\tpaddleWidth = 180;\n\t\t\t\tpaddleBounciness = 0.1;\n\t\t\t\tblankFrequency = 15;\n\t\t\t\tbreak;\n\t\t\tcase \"Hard\":\n\t\t\t\tnumRows = 12;\n\t\t\t\tnumColumns = 12;\n\t\t\t\tballRadius = 10;\n\t\t\t\tballSpeed = 2.5;\n\t\t\t\tpaddleSpeed = 5;\n\t\t\t\tpaddleWidth = 160;\n\t\t\t\tpaddleBounciness = 0.1;\n\t\t\t\tblankFrequency = 10;\n\t\t\t\tbreak;\n\t\t\tcase \"VHard\":\n\t\t\t\tnumRows = 14;\n\t\t\t\tnumColumns = 14;\n\t\t\t\tballRadius = 7;\n\t\t\t\tballSpeed = 3.5;\n\t\t\t\tpaddleSpeed = 6;\n\t\t\t\tpaddleWidth = 140;\n\t\t\t\tpaddleBounciness = 0.1;\n\t\t\t\tblankFrequency = 5;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t}\n\t\tupdateProperties();\n\t\trestartGame();\n\t}\n}", "function resetGame() {\n account.score = 0;\n account.lines = 0;\n account.level = 0;\n board.reset();\n time = { start: 0, elapsed: 0, level: LEVEL[account.level] };\n}", "function increaseDifficulty() {\n setGridInvisible();\n if (!isGreatestDimension()) {\n if (row < col) {\n setGrid(row+1, col);\n } else {\n setGrid(row, col+1);\n }\n }\n resetGrid(\"increase\");\n}", "function C012_AfterClass_Amanda_PleasurePlayerSetSpeed(SpeedFactor) {\n\tC012_AfterClass_Amanda_PleasurePlayerSpeed = C012_AfterClass_Amanda_PleasurePlayerSpeed + SpeedFactor;\n\tif (C012_AfterClass_Amanda_PleasurePlayerSpeed < 0) C012_AfterClass_Amanda_PleasurePlayerSpeed = 0;\n\tif (C012_AfterClass_Amanda_PleasurePlayerSpeed > 2) C012_AfterClass_Amanda_PleasurePlayerSpeed = 2;\n}", "function setSpeed() {\n\tvar baseSpeed = 25;\n\tvar raceMod = 0;\n\tif (race !== \"Gnome\" && race !== \"Halfling\" && race !== \"Dwarf\")\n\t\traceMod += 5;\n\tif (subrace + race == \"Wood Elf\")\n\t\traceMod += 5;\n\tspeed = baseSpeed + raceMod;\n\treturn \"Speed: \" + speed;\n}" ]
[ "0.8102562", "0.7884789", "0.7537295", "0.7385058", "0.717491", "0.7153394", "0.6932113", "0.6904888", "0.6806206", "0.65710235", "0.6531491", "0.6496348", "0.6464565", "0.6403068", "0.63918793", "0.6248661", "0.6247666", "0.6220067", "0.62052923", "0.6178988", "0.6171837", "0.6167034", "0.6148947", "0.61140424", "0.6097578", "0.6075372", "0.6007142", "0.5979185", "0.595792", "0.5955427", "0.59361506", "0.59319395", "0.5917618", "0.5874383", "0.58716047", "0.5859117", "0.58409405", "0.5834234", "0.58084583", "0.5784701", "0.5757543", "0.57255113", "0.5721742", "0.57028955", "0.5691633", "0.56751585", "0.56675625", "0.56629086", "0.56496125", "0.5649489", "0.56425786", "0.56333256", "0.5628339", "0.56213087", "0.55991036", "0.5565158", "0.55584246", "0.5555595", "0.55551904", "0.55501944", "0.5547955", "0.5537589", "0.5530421", "0.55275536", "0.5499495", "0.5494802", "0.54932696", "0.54853076", "0.54782254", "0.5470405", "0.5470114", "0.54691654", "0.5464864", "0.5455777", "0.5451768", "0.5427648", "0.54221404", "0.5421985", "0.54209036", "0.5419246", "0.5407408", "0.5405054", "0.5391874", "0.5386813", "0.53790253", "0.53519064", "0.53329885", "0.53299254", "0.5304609", "0.5301457", "0.5299308", "0.5290653", "0.52858734", "0.52847266", "0.5279547", "0.5272528", "0.5270861", "0.52658314", "0.5262017", "0.5261095" ]
0.7435733
3
Sets the colour of each square to a single colour
function changeSquaresToWinningColour( colour ) { for ( let index = 0; index < squares.length; index++ ) { squares[ index ].style.backgroundColor = colour; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeColors(square){\n\t// loop through all squares\n\tfor(var i = 0; i < square.length; i++){\n\n\t// change each color to match the given color\n\tsquare[i].style.backgroundColor = pickedColor;\n}\n}", "function changeAllSquareColor(color) {\n for (i = 0; i < squares.length; i++) {\n $(squares[i]).css(\"background-color\", color)\n };\n}", "function changeColorAllSquares(color){\r\n for (var i=0; i< squareColor.length; i++){\r\n squareColor[i].style.backgroundColor = color;\r\n\r\n }\r\n}", "function changeColors(color){\n //loop through all squares\n for(var i = 0; i < squares.length; i++){\n //change each other square color to match given color\n squares[i].style.backgroundColor = color;\n }\n}", "function setColor(squares){\n squares.each(function(){\n $(this).css( \"backgroundColor\",randomRGB());\n });\n}", "function setColors () {\r\n for (let i = 0; i<squares.length; i++) {\r\n squares[i].style.backgroundColor = colors[i];\r\n}}", "function changeColors(color){\n //loop through all squares\n for (var i = 0; i < squares.length; i++) {\n //change each square color to match given color\n squares[i].style.backgroundColor = color;\n }\n}", "function changeSquareColors(colors){\n\tfor(var i = 0; i < squares.length; i++){\n\t\tsquares[i].style.background = colors[i];\n\t}\n}", "function setColours() {\r\n\tfor(var i = 0; i < colours.length; i++) {\r\n\t\tsquares[i].style.backgroundColor = colours[i]\r\n\t}\r\n}", "function changeColors(color) {\n // loop through all squares\n for (var i = 0; i < squares.length; i++) {\n // change each color to match given color \n squares[i].style.backgroundColor = color;\n };\n}", "function changeColors(color) {\n for (var i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = color;\n }\n}", "function changeEachColor(pickedColor){\r\n for (var i=0;i<squares.length;i++){\r\n squares[i].style.background=pickedColor;\r\n }\r\n}", "function changeColors(color){\r\n\tfor(var i = 0; i < squares.length; i++){\r\n\t\tsquares[i].style.backgroundColor = color;\r\n\t}\r\n}", "function changeAllSquare(){\r\n\t\tfor(var i=0;i<6;i++){\r\n\t\t\tsquares[i].style.background = selectedColor ;\r\n\t\t}\r\n}", "function changeColors(color){\r\n\t//loop through all squares\r\n\tfor(var i = 0; i < squares.length; i++){\r\n\t\t//change each color to match given color\r\n\t\tsquares[i].style.background = color;\r\n\t}\r\n}", "function changeColors(color){\n //loop through all squares\n for (let i = 0; i < squares.length; i++) {\n //change each color to match given color\n squares[i].style.backgroundColor = color;\n }\n}", "function changeColors(color){\n\tfor(var i = 0; i < squares.length ; i++){\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function changeColors(color) {\r\n\t//loop through all squares:\r\n\tfor(var i = 0; i < squares.length; i++) {\r\n\t//change each color to match given color\r\n\tsquares[i].style.background = color;\r\n\t}\r\n\t\r\n}", "function changeColor(color){\n for(let i=0; i < squares.length; i++){\n //change color of every square to match given color\n squares[i].style.backgroundColor = color;\n }\n}", "function changecolor(color){\n for (var i=0; i<square.length; i++) {\n square[i].style.backgroundColor=color;\n }\n}", "function changeColors(color){\n //loop through squares \n for(var i = 0; i < squares.length; i++){\n //change each color to match given color\n squares[i].style.backgroundColor = color;\n }\n}", "function changeColors(color){\n\t//Change colors of all squares using for loop\n\tfor(var i = 0; i < squares.length; i++) {\n\t\tsquares[i].style.background = color;\n\t}\n}", "function changeColors(color){\n\tfor(var i = 0; i<squares.length;i++){\n\t\t// change colors\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function changeColors(color) {\n\tfor (var i = 0; i < squares.length; i++) {\n\t\tsquares[i].style.background = color;\n\t}\n}", "function changeColors(color){\n\t//loop through all squares\n\tfor(let i=0; i < squares.length; i++){\n\t\t//change each color to match given color\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function changeColors(color) {\n\t//loop through all squares\n\tfor(var i = 0; i < squares.length; i++) {\n\t\t//change each color to match given color\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function colorChange (color) {\n\tfor (var i = 0; i < squares.length; i++) {\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function changeColors(color1) {\n for(var i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = color1;\n }\n}", "function setColors(n) { //give colors to blocks\r\n for (var i = 0; i < color.length; i++) {\r\n square[i].style.background = color[i];\r\n square[i].style.display = \"block\";\r\n\r\n }\r\n\r\n}", "function changeColors(color){\n\tfor (var i =0; i <squares.length; i++) {\n\t\tsquares[i].style.background=color;\n\t}\n}", "function changeColors(color){\n\tfor(i = 0; i < 6; i++){\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function changeColors(color){\n\tfor(let i = 0; i< squares.length; i++){\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function changeColors(color){\r\nfor(var i=0 ; i<squares.length; i++){\r\n\tsquares[i].style.background=color;\r\n}\r\n}", "function changeColor(color){\n for(var i=0; i<squares.length; i++){\n squares[i].style.background = color;\n }\n}", "function changeColors(color){\n\tsquares.forEach(function(square){\n\t\tsquare.style.background = color;\n\t});\n}", "function changeColors(color){\n for (var i = 0; i<colors.length; i++){\n squares[i].style.backgroundColor = color;\n }\n}", "function changeColor (color) {\n // -(7.1)- Loop through all squares \n for (let index = 0; index < squares.length; index++) {\n\n // -(7.2)- Change each color to match goal color\n squares[index].style.backgroundColor = color;\n }\n}", "function changeColors ( color ) {\n // loop through all colors.\n // change each color to match given color. \n\n for ( var i=0 ; i < colors.length ; i++ ) {\n squares[i].style.background = color ; \n }\n\n}", "function changeColors(color) {\n for (let i = 0; i < colors.length; i++) {\n squares[i].style.backgroundColor = color\n }\n}", "function colorChange(color) {\n for(var i = 0; i < squares.length; i++) {\n if(colors[i])\n squares[i].style.backgroundColor = color;\n else\n squares[i].style.backgroundColor = \"#232323\";\n }\n}", "function changeColors(x) {\n for (var i = colors.length - 1; i >= 0; i--) {\n squares[i].style.backgroundColor = x;\n }\n}", "function changeColor(color) {\n squares.forEach(element => {\n element.style.backgroundColor = color;\n });\n}", "function newColors() {\n for (var i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = randomColor();\n }\n}", "function setAllColors(){\n\tfor (i=0; i<squares.length; i++){\n\t\tsquares[i].style.background = pickColor;\n\t}\n\th1.style.background = pickColor;\n}", "function square_change_colour(){\n\tif(settings.last_colour_square == 'black'){\n\t\tsettings.last_colour_square = 'white';\n\t} else {\n\t\tsettings.last_colour_square = 'black';\n\t}\n}", "function testColourSquares(Grid) {\n let rows = Grid.rows;\n let cols = Grid.cols; \n let count = 0;\n\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < cols; j++) {\n setSquareColour(`${i}-${j}`, count, \"lightblue\");\n count++;\n }\n } \n}", "function winningColors(color){\n //loop through all the squares\n for(let i=0;i<squares.length;i++){\n //change all colors to match the picked color\n squares[i].style.backgroundColor = color; \n } \n}", "function assignColors() {\r\n\t// assign the right color\r\n\trightColor = colors[Math.floor(Math.random()*mode)];\r\n\t// display it\r\n\tcolorDisplay.textContent = rightColor;\r\n\r\n\t// loop through colors array and assign rgb to squares\r\n\tfor(var i = 0; i < colors.length; i++){\r\n\t\tsquares[i].style.backgroundColor = colors[i];\r\n\t} \r\n}", "function colorSquare(){\n let s = new Array;\n let v = new Array;\n for (let k = 0; k <= numberofTree; k++) {\n ctx.fillRect(parseFloat($('#mortal-tree'+k).css('left'))-780,parseFloat($('#mortal-tree'+k).css('top')) - 360,29,29);\n ctx.fillStyle = \"rgb(214,236,239)\";\n }\n for (let k = 1; k <= numberofTree; k++) {\n s[k] = (parseFloat($('#mortal-tree'+k).css('left'))-780)/30;\n v[k] = (parseFloat($('#mortal-tree'+k).css('top')) - 360)/30;\n tab[i+v[k]][j+s[k]] = 4;\n } \n }", "function winningColor(color) {\n for (var i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = color\n }\n}", "function setupSquares(){\n for(var i = 0 ; i < squares.length; i++){\n // adding click events to squares\n squares[i].addEventListener(\"click\", function(){\n // grab color of clicked square\n var clickedColor = this.style.backgroundColor;\n //compare color to pickedColor\n if(clickedColor === pickedColor){\n messageDisplay.textContent = \"Corect!\";\n changeColors(clickedColor);\n h1.style.backgroundColor = clickedColor;\n resetButton.textContent = \"Play Again?\";\n } else{\n messageDisplay.textContent = \"Try Again\";\n this.style.backgroundColor = \"#232323\";\n }\n });\n }\n}", "function changeColors(color) {\n for (let i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = color;\n heading.style.backgroundColor = color;\n }\n}", "function setColors() {\n var len = points.length / 3;\n for (var i = 0; i < len; i++) {\n colors.push(1.0);\n colors.push(0.0);\n colors.push(0.0);\n colors.push(1.0);\n }\n}", "function changeSquaresToRandomColours( colours ) {\n for ( let index = 0; index < squares.length; index++ ) {\n squares[ index ].style.backgroundColor = colours[ index ];\n }\n}", "function clear() {\n squares.forEach((square) => {\n square.style.backgroundColor = \"white\";\n });\n}", "function changeColor(color)\n{\n for(let i=0; i<num ; i++){\n squares[i].style.backgroundColor=color;\n }\n heading.style.backgroundColor=color;\n}", "function changeColor(color)\n{\n\n // Also changing the h1 color\n\n h1.style.backgroundColor = color;\n h2.style.backgroundColor = color;\n // loop through all the square\n for (let i = 0; i < squares.length; i++) {\n // change the color of square to the given color\n squares[i].style.backgroundColor = color;\n }\n \n}", "function setupSquares() {\n for (let i = 0; i < squares.length; i++) {\n // Add click listeners to squares\n squares[i].addEventListener('click', function() {\n // Store colour of clicked square\n const colourClicked = this.style.backgroundColor;\n // Compare clicked colour with set colour\n if (colourClicked === colourSet) {\n messageDisplay.textContent = 'Correct!';\n // Call function to change colour of all squares to clicked colour\n changeColours(colourClicked);\n // Update header colour to clicked colour\n header.style.backgroundColor = colourClicked;\n // Change reset button text\n buttonReset.textContent = 'Play again?';\n } else {\n this.style.backgroundColor = '#232323';\n messageDisplay.textContent = 'Try again!';\n }\n });\n }\n}", "function matchColors(color){\n\tfor(var i = 0; i < squares.length; i++){\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function setColor() {\n \t\t\t$(this).setPixels({\n\t \t\tx: 260, y: 30,\n\t \t\twidth: 60, height: 40,\n\t \t\t// loop through each pixel\n\t \t\teach: function(px) {\n\t \t\t\tpx.r = rgb_r;\n\t \t\t\tpx.g = rgb_g;\n\t \t\t\tpx.b = rgb_b;\n\t \t\t}\n \t\t\t});\n\t\t}", "function changeColor() {\n for (i = 0; i < colorSquares.length; i++) {\n colorSquares[i].addEventListener('click', function () {\n ctx.strokeStyle = `${this.style.backgroundColor}`;\n })\n }\n}", "function changeSquareColour(square1, square2, colour) {\n document.getElementById(square1).style.backgroundColor = colour;\n document.getElementById(square2).style.backgroundColor = colour;\n document.getElementById(square1).style.borderColor = colour;\n document.getElementById(square2).style.borderColor = colour;\n}", "function changeColorsWin(color){\r\n for(let i =0;i<squares.length;i++){\r\n squares[i].style.backgroundColor=color;\r\n }\r\n document.querySelector(\"h1\").style.backgroundColor=color;\r\n }", "set_colors()\r\n {\r\n /* colors */\r\n let colors = [\r\n Color.of( 0.9,0.9,0.9,1 ), /*white*/\r\n Color.of( 1,0,0,1 ), /*red*/\r\n Color.of( 1,0.647,0,1 ), /*orange*/\r\n Color.of( 1,1,0,1 ), /*yellow*/\r\n Color.of( 0,1,0,1 ), /*green*/\r\n Color.of( 0,0,1,1 ), /*blue*/\r\n Color.of( 1,0,1,1 ), /*purple*/\r\n Color.of( 0.588,0.294,0,1 ) /*brown*/\r\n ]\r\n\r\n this.boxColors = Array();\r\n for (let i = 0; i < 8; i++ ) {\r\n let randomIndex = Math.floor(Math.random() * colors.length);\r\n this.boxColors.push(colors[randomIndex]);\r\n colors[randomIndex] = colors[colors.length-1];\r\n colors.pop();\r\n }\r\n\r\n }", "function changeColor(color)\r\n{\r\n\tfor(var i=0;i<squares.length;i++)\r\n\t\tsquares[i].style.backgroundColor=color;\r\n\thead.style.backgroundColor=color;\r\n}", "function changeColours(colour) {\r\n\tfor(var i = 0; i < colours.length; i++) {\r\n\t\tsquares[i].style.backgroundColor = colour\r\n\t}\r\n\r\n\tbanner.style.backgroundColor = colour\r\n}", "setColors() {\n var squares = document.querySelectorAll('.square');\n\n for (var square of squares) {\n square.style.backgroundColor = 'hsl(' + this.fg + ',50%,50%)';\n }\n\n var hands = document.querySelectorAll('.hand');\n\n for (var hand of hands) {\n hand.style.backgroundColor = 'hsl(' + this.fg + ',20%,50%)';\n }\n\n var backColorFlr = Math.floor(this.bg);\n document.body.style.backgroundImage = 'linear-gradient(to bottom right, hsl(' + backColorFlr + ',50%,80%), hsl(' + backColorFlr + ',50%,50%))';\n }", "function refreshEasyColors(){\n\t\tcolors = createColors(squares.length);\n\t\treset();\n\n}", "function setColor() { //function to set color and position, called by var start\n\n var index;\n var gamesquare = [gs1, gs2, gs3, gs4, gs5, gs6, gs7, gs8, gs9];\n for (index = 0; index < gamesquare.length; index++) {\n gamesquare[index].style.backgroundColor = \"white\"; }; // resets square before start of loop \n\n console.log ('Round count ' + (x+1));\n console.log ('Position ' + (levelArr[x][1]+1) + ' Color ' + colors[levelArr[x][0]]);\n gamesquare[levelArr[x][1]].style.backgroundColor = colors[levelArr[x][0]]; // sets color and position for square\n x++; // increments x on each loop iteration\n\n\n if(x >= rounds){\n console.log('Level complete, stopping engine');\n clearInterval(start); // stops engine after x is above rounds\n }; \n\n}", "function alterColor(e) {\n const currentSquare = this;\n if (state === \"Color\") {\n currentSquare.style.backgroundColor = getColor();\n } else if (state === \"Erase\") {\n currentSquare.style.backgroundColor = defaultSquareColor;\n } else if (state === \"Random\") {\n setColor(getRandomColor());\n currentSquare.style.backgroundColor = getColor();\n }\n}", "function changeColors(color) {\r\n for (let i = 0; i < sq.length; i++) {\r\n sq[i].style.background = color;\r\n }\r\n}", "function setAllGrey() {\n for (let i = 0; i < squares.length; i++) {\n squares[i].style.background = \"grey\";\n }\n rotateGrid();\n setTimeout(() => toggleGridClickable(), 500);\n \n}", "function fillSquares(level) {\n\tfor(var i = 0; i < squares.length; i++) {\n\t\tvar rotationDegree = randomArr[i] * level;\n\t\tsquares[i].setAttribute(\"style\",\"background-color:\" + color + \"; filter: hue-rotate(\" + rotationDegree + \"deg);\");\n\t}\n}", "function Square(index, color){\n\tthis.index = index;\n\tthis.color = color;\n}", "function fnSetCellColors(ctx, grid) {\n for (var x = 0; x <= (gridSize - 1); x++) {\n for (var y = 0; y <= (gridSize - 1); y++) {\n fnColorCells(ctx, grid, x, y);\n }\n }\n}", "function changeColors(color){\n\tfor(var i=0; i<difficulty; i++){\n\t\tsquares[i].style.backgroundColor=color;\n\t}\n\th1.style.backgroundColor=color;\n}", "function setcolor(colors, pickedColor, n){\r\n for(let i=0;i<n;i++)\r\n {\r\n squares[i].style.background = colors[i];\r\n squares[i].addEventListener(\"click\", function(){\r\n const clickedColor = this.style.background;\r\n \r\n if(clickedColor === pickedColor){\r\n\t\t\t\tmessageDisplay.textContent = \"Correct!\";\r\n\t\t\t\treset.textContent = \"Play Again?\"\r\n\t\t\t\tchangeColors(clickedColor);\r\n\t\t\t\th1.style.background = clickedColor;\r\n\t\t\t} else {\r\n\t\t\t\tthis.style.background = \"black\";\r\n\t\t\t\tmessageDisplay.textContent = \"Try Again\"\r\n\t\t\t}\r\n })\r\n }\r\n}", "function setColor(colNr){\r\n currentColor = colNr;\r\n\r\n pixels.children.forEach(pixel => {\r\n pixel.tweenTo({ fillColor: colors[currentColor][pixel.colStep]}, { duration: _.random(200, 1000)});\r\n });\r\n}", "function squareColor(i) {\n var remainder;\n remainder = (i + j) % 2;\n if (remainder == 1) {\n fill('black');\n } else {\n fill('white');\n }\n\n}", "function setColour(colour) {\n /* With each new colour it pushes it in the array,\n colours the background, puts the colour hex in the box,\n and changes the colour of each boxie one by one. */\n\n previousColours.shift();\n previousColours.push(currentColour);\n currentColour = colour;\n\n $( 'body' ).css( 'background-color', colour );\n $( '#mainInput' ).val(colour);\n $( '.boxie' ).each(function(index, element) {\n $(element).css( 'background-color', previousColours[index] );\n });\n\n resetInputError();\n }", "function setupColors(){\n for (var i = 0; i < squares.length; i++) {\n\n squares[i].addEventListener('click', function() {\n var clickedColor = this.style.backgroundColor;\n if (clickedColor === pickedColor) {\n prompt.textContent = \"CORRECT!!\";\n newGame.textContent = \"Play Again?\";\n changeColor(clickedColor);\n } else {\n this.style.backgroundColor = \"#4abdac\";\n prompt.textContent = \"Try again...\";\n }\n });\n }\n}", "function changeSqsColor(correctColor){\r\n for(var i=0; i<circles.length; i++){\r\n circles[i].style.background=correctColor;\r\n }\r\n}", "function finalColors(){\n\treset.textContent=\"Play Again?\";\n\th1.style.backgroundColor=pickedColor;\n\tfor(var i=0;i<squares.length;i++)\n\t\tsquares[i].style.backgroundColor=pickedColor;\n}", "function changeColors(color)\n{\n\tfor (var i = 0; i < colors.length; i++)\n\t{\n\t\tsqrs[i].style.backgroundColor = color;\n\t}\n}", "set color(value) {}", "function colorGrid(i) {\n if(i < 400) {\n document.getElementsByClassName('square')[visitedNodes[i] * 40 + visitedNodes[i + 1]].style = 'background-color: #FF9AA2';\n } else if(i < 800) {\n document.getElementsByClassName('square')[visitedNodes[i] * 40 + visitedNodes[i + 1]].style = 'background-color: #FFB7B2';\n } else if(i < 1200) {\n document.getElementsByClassName('square')[visitedNodes[i] * 40 + visitedNodes[i + 1]].style = 'background-color: #FFDAC1';\n } else {\n document.getElementsByClassName('square')[visitedNodes[i] * 40 + visitedNodes[i + 1]].style = 'background-color: #E2F0CB';\n }\n}", "setColorSquare() {\n const history = this.state.history.slice(0, this.state.stepNumber + 1);\n const current = history[history.length - 1];\n const squares = current.squares.slice();\n const winner = calculateWinner(squares);\n this.setState({\n numberOfWin: winner ? winner[1] : []\n })\n }", "function changeColor(tmp_stage,tmp_arr){\n tmp_arr.forEach(function (item) {\n tmp_stage.find(\"#\" + item[0]).fill(DICT_COLORS[item[1]]);\n tmp_stage.find(\"#main_l\").draw();\n });\n}", "function changeSquareColor(){\n $('.square').hover(function () {\n $(this).css(\"background-color\", \"#0F0F0F\")\n });\n}", "function correctColorDisplay(){\r\n\theader.style.backgroundColor = colorPicked;\t\r\n\tfor(var x=0; x<squares.length; x++){\r\n\t\tsquares[x].style.backgroundColor = colorPicked;\r\n\t\tsquares[x].style.opacity = \"1\";\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t}\r\n}", "function refreshHardColors(){\n\t colors = createHardColors(squares.length , range);\n\t\treset();\n}", "function squareSetup() {\n colors.forEach(function (colorsArry) {\n sqCreate = document.createElement(\"div\");\n sqCreate.className = \"square\";\n document.querySelector(\"#containerColors\").appendChild(sqCreate);\n sqCreate.style.backgroundColor = colorsArry;\n squares = document.querySelectorAll(\".square\");\n sqCreate.addEventListener(\"click\", function () {\n let clickedColor = this.style.backgroundColor;\n if (clickedColor === pickedColor) {\n winner(clickedColor);\n } else {\n poorChoice();\n this.remove();\n }\n });\n });\n}", "function changeColors(clickedColor, msg){\n for(var i=0;i<squares.length;i++){\n squares[i].style.backgroundColor = pickedColor.textContent;\n }\n h1.style.backgroundColor = clickedColor;\n msg.textContent =\"Correct!\";\n resetButton.textContent = \"play again?\";\n}", "function colorgenerator() {\n let colours = [],\n i;\n for (i = 0; i < 372; i++){\n colours[i] = 'hsl(' + i + ', 100%, 50%)';\n if (i > 359) {\n colours[i] = 'hsl(0, 100%, 100%)';\n }\n }\n colours = colours.toString();\n //console.log(colours);\n root.style.setProperty(\"--colours\", colours);\n}", "function setupSquares() {\n for (var i = squares.length - 1; i >= 0; i--) {\n squares[i].addEventListener('click', function() {\n var clickedColor = this.style.backgroundColor;\n if (clickedColor === pickedColor) {\n messageDisplay.textContent =\n correctMessages[Math.floor(Math.random() * correctMessages.length)];\n changeColors(pickedColor);\n h1.style.backgroundColor = pickedColor;\n newGameButton.textContent = 'Play Again?';\n } else {\n this.style.backgroundColor = theme;\n messageDisplay.textContent =\n wrongMessages[Math.floor(Math.random() * wrongMessages.length)];\n }\n });\n }\n}", "function resetSquareBg() {\n for (i = 0; i < squares.length; i++) {\n $(squares[i]).css(\"background-image\", \"url('images/mesh.jpg')\")\n };\n}", "function displayShape(){\n displaySquares.forEach(square =>{\n square.classList.remove('tetromino')\n square.style.backgroundColor ='';\n })\n upNextTetrominoes[nextRandom].forEach( index => {\n displaySquares[displayIndex+ index].classList.add('tetromino');\n displaySquares[displayIndex + index].style.backgroundColor = colors[nextRandom];\n })\n }", "function setupSquares(){\n\tfor (let i = 0; i<squares.length; i++){\n\t\tsquares[i].addEventListener(\"click\", function(){\n\t\t\tlet clickedColor = this.style.backgroundColor;\n\t\t\tconsole.log(clickedColor,pickedColor);\n\t\t\t//compares the clicked and the picked color\n\t\t\tif(clickedColor===pickedColor){\n\t\t\t\tresetButton.textContent = \"Play again?\"\n\t\t\t\tchangeColors(clickedColor);\n\t\t\t\tmessageDisplay.textContent = \"RIGHT!\";\n\t\t\t\tmessageDisplay.style.color = clickedColor;\n\t\t\t\tif(h1.style.backgroundColor != clickedColor){\n\t\t\t\t\tcorrectAnswers++;\n\t\t\t\t\tcorrectDisplay.textContent = correctAnswers;\n\t\t\t\t\ttimeout = setTimeout(reset, 2000);\n\t\t\t\t}\n\t\t\t\th1.style.backgroundColor = clickedColor;\n\t\t\t} else {\n\t\t\t\tthis.style.backgroundColor = \"#232323\";\n\t\t\t\tmessageDisplay.textContent = \"WRONG!\"\n\t\t\t\tmessageDisplay.style.color = clickedColor;\n\t\t\t\tif(guesses>0){\n\t\t\t\tguesses--;\n\t\t\t\tguessesDisplay.textContent = guesses;} else {\n\t\t\t\t\tgameOver();\n\t\t\t\t}\n\t\t\t}\t\n\t\t});\n\t}\n}", "function updateGridSquare(e) {\n const gridSquare = e.target;\n let squareColor = getSquareColor();\n\n if (colorMode === \"black\") {\n gridSquare.style.backgroundColor = getSquareColor();\n gridSquare.setAttribute(\"data-color\", \"\");\n } else if (colorMode === \"random\") {\n if (gridSquare.dataset.color !== \"\") {\n squareColor = darkenColor(gridSquare.dataset.color);\n }\n gridSquare.style.backgroundColor = squareColor;\n gridSquare.setAttribute(\"data-color\", squareColor);\n }\n}", "function draw() {\n current.forEach(index => {\n squares[currentPosition + index].classList.add('tetrimino')\n squares [currentPosition + index].style.backgroundColor = colors[random]\n })\n}" ]
[ "0.7908317", "0.7805191", "0.7799405", "0.7772632", "0.7737764", "0.77086467", "0.77014196", "0.76969635", "0.7664235", "0.75763154", "0.7561774", "0.75436103", "0.75128436", "0.7512291", "0.7509444", "0.75034666", "0.74976194", "0.7493061", "0.7484999", "0.74814045", "0.74698585", "0.74671555", "0.744121", "0.74402785", "0.74401003", "0.7436944", "0.74301463", "0.7421096", "0.7411792", "0.74105394", "0.7405205", "0.7396378", "0.7386037", "0.73828715", "0.7360951", "0.7356534", "0.7340979", "0.73321134", "0.7277365", "0.72308934", "0.72108525", "0.7098212", "0.70343816", "0.70162296", "0.69875693", "0.6963194", "0.6948441", "0.69254255", "0.6900251", "0.6881181", "0.6854466", "0.68533605", "0.6806536", "0.6778488", "0.67747766", "0.6769783", "0.6766222", "0.67524123", "0.67323774", "0.6729546", "0.67061824", "0.6668932", "0.6656857", "0.66409177", "0.66399014", "0.6639186", "0.6610374", "0.66027623", "0.660146", "0.65926975", "0.65827674", "0.653982", "0.65077543", "0.65064216", "0.65056074", "0.6505056", "0.6499758", "0.6475382", "0.64744", "0.6458959", "0.64536846", "0.64404905", "0.6427012", "0.6401747", "0.639539", "0.63650405", "0.63530785", "0.6334963", "0.63346624", "0.632304", "0.63188356", "0.6298763", "0.62961733", "0.6292157", "0.62905043", "0.6286031", "0.6281763", "0.6274581", "0.62736446", "0.62728244" ]
0.73833954
33
sets the value of each square to a range of colours
function changeSquaresToRandomColours( colours ) { for ( let index = 0; index < squares.length; index++ ) { squares[ index ].style.backgroundColor = colours[ index ]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setColors(n) { //give colors to blocks\r\n for (var i = 0; i < color.length; i++) {\r\n square[i].style.background = color[i];\r\n square[i].style.display = \"block\";\r\n\r\n }\r\n\r\n}", "function changeColors(square){\n\t// loop through all squares\n\tfor(var i = 0; i < square.length; i++){\n\n\t// change each color to match the given color\n\tsquare[i].style.backgroundColor = pickedColor;\n}\n}", "function changeSquareColors(colors){\n\tfor(var i = 0; i < squares.length; i++){\n\t\tsquares[i].style.background = colors[i];\n\t}\n}", "function setColours() {\r\n\tfor(var i = 0; i < colours.length; i++) {\r\n\t\tsquares[i].style.backgroundColor = colours[i]\r\n\t}\r\n}", "function changeAllSquare(){\r\n\t\tfor(var i=0;i<6;i++){\r\n\t\t\tsquares[i].style.background = selectedColor ;\r\n\t\t}\r\n}", "function changeColorAllSquares(color){\r\n for (var i=0; i< squareColor.length; i++){\r\n squareColor[i].style.backgroundColor = color;\r\n\r\n }\r\n}", "function setColors () {\r\n for (let i = 0; i<squares.length; i++) {\r\n squares[i].style.backgroundColor = colors[i];\r\n}}", "function changeAllSquareColor(color) {\n for (i = 0; i < squares.length; i++) {\n $(squares[i]).css(\"background-color\", color)\n };\n}", "function changeColors(color){\n //loop through all squares\n for(var i = 0; i < squares.length; i++){\n //change each other square color to match given color\n squares[i].style.backgroundColor = color;\n }\n}", "function setColor(squares){\n squares.each(function(){\n $(this).css( \"backgroundColor\",randomRGB());\n });\n}", "function changeColors(color){\n\tfor(i = 0; i < 6; i++){\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function changeColors(color){\n //loop through all squares\n for (var i = 0; i < squares.length; i++) {\n //change each square color to match given color\n squares[i].style.backgroundColor = color;\n }\n}", "function changeEachColor(pickedColor){\r\n for (var i=0;i<squares.length;i++){\r\n squares[i].style.background=pickedColor;\r\n }\r\n}", "function changeColors(color){\r\n\t//loop through all squares\r\n\tfor(var i = 0; i < squares.length; i++){\r\n\t\t//change each color to match given color\r\n\t\tsquares[i].style.background = color;\r\n\t}\r\n}", "function changeColors(x) {\n for (var i = colors.length - 1; i >= 0; i--) {\n squares[i].style.backgroundColor = x;\n }\n}", "function changeColors(color) {\r\n\t//loop through all squares:\r\n\tfor(var i = 0; i < squares.length; i++) {\r\n\t//change each color to match given color\r\n\tsquares[i].style.background = color;\r\n\t}\r\n\t\r\n}", "function changeColors(color){\r\nfor(var i=0 ; i<squares.length; i++){\r\n\tsquares[i].style.background=color;\r\n}\r\n}", "function changeColors(color) {\n // loop through all squares\n for (var i = 0; i < squares.length; i++) {\n // change each color to match given color \n squares[i].style.backgroundColor = color;\n };\n}", "function changeColors(color){\n //loop through all squares\n for (let i = 0; i < squares.length; i++) {\n //change each color to match given color\n squares[i].style.backgroundColor = color;\n }\n}", "function changeColors(color){\r\n\tfor(var i = 0; i < squares.length; i++){\r\n\t\tsquares[i].style.backgroundColor = color;\r\n\t}\r\n}", "function setBackgroundOnRange (range) { \n for (i = 7; i < range.getNumRows(); i++) {\n var values = range.getValues();\n colors = values.map(function(obj) {\n var result = findByName(operatorColors, obj[0])\n \n if (result) {\n return [result.color]\n } else {\n return [\"#FFFFFF\"]\n }\n \n })\n }\n \n range.setBackgrounds(colors)\n}", "function changeColors ( color ) {\n // loop through all colors.\n // change each color to match given color. \n\n for ( var i=0 ; i < colors.length ; i++ ) {\n squares[i].style.background = color ; \n }\n\n}", "function changeColors(color){\n //loop through squares \n for(var i = 0; i < squares.length; i++){\n //change each color to match given color\n squares[i].style.backgroundColor = color;\n }\n}", "_prepareColorShades(min, max) {\n let step = (max - min) / 5;\n this._shades = [];\n for (let i = 0; i < 5; i++) {\n this._shades.push(max - i * step);\n }\n }", "function changeColors(color){\n\tfor (var i =0; i <squares.length; i++) {\n\t\tsquares[i].style.background=color;\n\t}\n}", "function changeColors(color){\n\tfor(var i = 0; i < squares.length ; i++){\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function changeColors(color1) {\n for(var i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = color1;\n }\n}", "function changeColors(color) {\n for (var i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = color;\n }\n}", "function changeColors(color){\n\t//Change colors of all squares using for loop\n\tfor(var i = 0; i < squares.length; i++) {\n\t\tsquares[i].style.background = color;\n\t}\n}", "function changeColors(color) {\n\tfor (var i = 0; i < squares.length; i++) {\n\t\tsquares[i].style.background = color;\n\t}\n}", "function changeColors(color){\n\t//loop through all squares\n\tfor(let i=0; i < squares.length; i++){\n\t\t//change each color to match given color\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function changeColors(color){\n for (var i = 0; i<colors.length; i++){\n squares[i].style.backgroundColor = color;\n }\n}", "function colorSquare(){\n let s = new Array;\n let v = new Array;\n for (let k = 0; k <= numberofTree; k++) {\n ctx.fillRect(parseFloat($('#mortal-tree'+k).css('left'))-780,parseFloat($('#mortal-tree'+k).css('top')) - 360,29,29);\n ctx.fillStyle = \"rgb(214,236,239)\";\n }\n for (let k = 1; k <= numberofTree; k++) {\n s[k] = (parseFloat($('#mortal-tree'+k).css('left'))-780)/30;\n v[k] = (parseFloat($('#mortal-tree'+k).css('top')) - 360)/30;\n tab[i+v[k]][j+s[k]] = 4;\n } \n }", "function changeColor(color){\n for(let i=0; i < squares.length; i++){\n //change color of every square to match given color\n squares[i].style.backgroundColor = color;\n }\n}", "function changeSquaresToWinningColour( colour ) {\n for ( let index = 0; index < squares.length; index++ ) {\n squares[ index ].style.backgroundColor = colour;\n }\n}", "function changeColors(color){\n\tfor(var i = 0; i<squares.length;i++){\n\t\t// change colors\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function changeColors(color) {\n\t//loop through all squares\n\tfor(var i = 0; i < squares.length; i++) {\n\t\t//change each color to match given color\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function changeColors(color){\n\tfor(let i = 0; i< squares.length; i++){\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function changeColors(color) {\n for (let i = 0; i < colors.length; i++) {\n squares[i].style.backgroundColor = color\n }\n}", "function changeColor (color) {\n // -(7.1)- Loop through all squares \n for (let index = 0; index < squares.length; index++) {\n\n // -(7.2)- Change each color to match goal color\n squares[index].style.backgroundColor = color;\n }\n}", "function changecolor(color){\n for (var i=0; i<square.length; i++) {\n square[i].style.backgroundColor=color;\n }\n}", "set_colors()\r\n {\r\n /* colors */\r\n let colors = [\r\n Color.of( 0.9,0.9,0.9,1 ), /*white*/\r\n Color.of( 1,0,0,1 ), /*red*/\r\n Color.of( 1,0.647,0,1 ), /*orange*/\r\n Color.of( 1,1,0,1 ), /*yellow*/\r\n Color.of( 0,1,0,1 ), /*green*/\r\n Color.of( 0,0,1,1 ), /*blue*/\r\n Color.of( 1,0,1,1 ), /*purple*/\r\n Color.of( 0.588,0.294,0,1 ) /*brown*/\r\n ]\r\n\r\n this.boxColors = Array();\r\n for (let i = 0; i < 8; i++ ) {\r\n let randomIndex = Math.floor(Math.random() * colors.length);\r\n this.boxColors.push(colors[randomIndex]);\r\n colors[randomIndex] = colors[colors.length-1];\r\n colors.pop();\r\n }\r\n\r\n }", "function fillSquares(level) {\n\tfor(var i = 0; i < squares.length; i++) {\n\t\tvar rotationDegree = randomArr[i] * level;\n\t\tsquares[i].setAttribute(\"style\",\"background-color:\" + color + \"; filter: hue-rotate(\" + rotationDegree + \"deg);\");\n\t}\n}", "function assignColors() {\r\n\t// assign the right color\r\n\trightColor = colors[Math.floor(Math.random()*mode)];\r\n\t// display it\r\n\tcolorDisplay.textContent = rightColor;\r\n\r\n\t// loop through colors array and assign rgb to squares\r\n\tfor(var i = 0; i < colors.length; i++){\r\n\t\tsquares[i].style.backgroundColor = colors[i];\r\n\t} \r\n}", "function colorgenerator() {\n let colours = [],\n i;\n for (i = 0; i < 372; i++){\n colours[i] = 'hsl(' + i + ', 100%, 50%)';\n if (i > 359) {\n colours[i] = 'hsl(0, 100%, 100%)';\n }\n }\n colours = colours.toString();\n //console.log(colours);\n root.style.setProperty(\"--colours\", colours);\n}", "function changeColors(color){\n\tsquares.forEach(function(square){\n\t\tsquare.style.background = color;\n\t});\n}", "function colorChange (color) {\n\tfor (var i = 0; i < squares.length; i++) {\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function winningColors(color){\n //loop through all the squares\n for(let i=0;i<squares.length;i++){\n //change all colors to match the picked color\n squares[i].style.backgroundColor = color; \n } \n}", "function changeColor(color){\n for(var i=0; i<squares.length; i++){\n squares[i].style.background = color;\n }\n}", "function testColourSquares(Grid) {\n let rows = Grid.rows;\n let cols = Grid.cols; \n let count = 0;\n\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < cols; j++) {\n setSquareColour(`${i}-${j}`, count, \"lightblue\");\n count++;\n }\n } \n}", "function setColors() {\n var len = points.length / 3;\n for (var i = 0; i < len; i++) {\n colors.push(1.0);\n colors.push(0.0);\n colors.push(0.0);\n colors.push(1.0);\n }\n}", "function newColors() {\n for (var i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = randomColor();\n }\n}", "set rgb (rgbaArray) { this.setColor(...rgbaArray) }", "set colorValue(value) {}", "function colorChange(color) {\n for(var i = 0; i < squares.length; i++) {\n if(colors[i])\n squares[i].style.backgroundColor = color;\n else\n squares[i].style.backgroundColor = \"#232323\";\n }\n}", "function rangeColors(rangeNumber) {\n var colorArr = [];\n var red = new Color(232, 9, 26),\n white = new Color(255, 255, 255),\n green = new Color(6, 170, 60),\n start = green,\n end = red;\n // if (rangeNumber > 50) {\n // start = white,\n // end = red;\n // rangeNumber = rangeNumber % 51;\n // }\n var startColors = start.getColors(),\n endColors = end.getColors();\n for (var i = 0; i <= rangeNumber; i++) {\n var r = Interpolate(startColors.r, endColors.r, rangeNumber, i);\n var g = Interpolate(startColors.g, endColors.g, rangeNumber, i);\n var b = Interpolate(startColors.b, endColors.b, rangeNumber, i);\n var color = \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n colorArr.push(color);\n }\n\n function Interpolate(start, end, steps, count) {\n var s = start,\n e = end,\n final = s + (((e - s) / steps) * count);\n return Math.floor(final);\n }\n\n function Color(_r, _g, _b) {\n var r, g, b;\n var setColors = function(_r, _g, _b) {\n r = _r;\n g = _g;\n b = _b;\n };\n setColors(_r, _g, _b);\n this.getColors = function() {\n var colors = {\n r: r,\n g: g,\n b: b\n };\n return colors;\n };\n }\n return colorArr;\n}", "function colorGrid(i) {\n if(i < 400) {\n document.getElementsByClassName('square')[visitedNodes[i] * 40 + visitedNodes[i + 1]].style = 'background-color: #FF9AA2';\n } else if(i < 800) {\n document.getElementsByClassName('square')[visitedNodes[i] * 40 + visitedNodes[i + 1]].style = 'background-color: #FFB7B2';\n } else if(i < 1200) {\n document.getElementsByClassName('square')[visitedNodes[i] * 40 + visitedNodes[i + 1]].style = 'background-color: #FFDAC1';\n } else {\n document.getElementsByClassName('square')[visitedNodes[i] * 40 + visitedNodes[i + 1]].style = 'background-color: #E2F0CB';\n }\n}", "function setColor() {\n \t\t\t$(this).setPixels({\n\t \t\tx: 260, y: 30,\n\t \t\twidth: 60, height: 40,\n\t \t\t// loop through each pixel\n\t \t\teach: function(px) {\n\t \t\t\tpx.r = rgb_r;\n\t \t\t\tpx.g = rgb_g;\n\t \t\t\tpx.b = rgb_b;\n\t \t\t}\n \t\t\t});\n\t\t}", "setColors() {\n var squares = document.querySelectorAll('.square');\n\n for (var square of squares) {\n square.style.backgroundColor = 'hsl(' + this.fg + ',50%,50%)';\n }\n\n var hands = document.querySelectorAll('.hand');\n\n for (var hand of hands) {\n hand.style.backgroundColor = 'hsl(' + this.fg + ',20%,50%)';\n }\n\n var backColorFlr = Math.floor(this.bg);\n document.body.style.backgroundImage = 'linear-gradient(to bottom right, hsl(' + backColorFlr + ',50%,80%), hsl(' + backColorFlr + ',50%,50%))';\n }", "function refreshHardColors(){\n\t colors = createHardColors(squares.length , range);\n\t\treset();\n}", "function setSliders() {\n let colorToChange =\n document.querySelector(\"#colorToChange\").style.backgroundColor;\n // console.log(246, colorToChange, typeof colorToChange);\n colorToChange = colorToChange\n .substring(4, colorToChange.length - 1)\n .split(\", \");\n // console.log(250, colorToChange);\n colorToChange = colorToChange.map((elem) => (elem = parseInt(elem)));\n console.log(252, colorToChange);\n const rangeRed = document.querySelector(\"#rangeRed\");\n const rangeGreen = document.querySelector(\"#rangeGreen\");\n const rangeBlue = document.querySelector(\"#rangeBlue\");\n rangeRed.value = colorToChange[0];\n rangeGreen.value = colorToChange[1];\n rangeBlue.value = colorToChange[2];\n console.log(\n 260,\n \"Sliders were set to:\",\n rangeRed.value,\n rangeGreen.value,\n rangeBlue.value\n );\n}", "function setAllColors(){\n\tfor (i=0; i<squares.length; i++){\n\t\tsquares[i].style.background = pickColor;\n\t}\n\th1.style.background = pickColor;\n}", "function setColor() { //function to set color and position, called by var start\n\n var index;\n var gamesquare = [gs1, gs2, gs3, gs4, gs5, gs6, gs7, gs8, gs9];\n for (index = 0; index < gamesquare.length; index++) {\n gamesquare[index].style.backgroundColor = \"white\"; }; // resets square before start of loop \n\n console.log ('Round count ' + (x+1));\n console.log ('Position ' + (levelArr[x][1]+1) + ' Color ' + colors[levelArr[x][0]]);\n gamesquare[levelArr[x][1]].style.backgroundColor = colors[levelArr[x][0]]; // sets color and position for square\n x++; // increments x on each loop iteration\n\n\n if(x >= rounds){\n console.log('Level complete, stopping engine');\n clearInterval(start); // stops engine after x is above rounds\n }; \n\n}", "function winningColor(color) {\n for (var i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = color\n }\n}", "set color(value) {}", "function updateColors () {\n // ADJUST COLOR VARIABLES FOR COLOR VALUE\n r = redSlider.value;\n g = greenSlider.value;\n b = blueSlider.value;\n\n // UPDATE ALL COLORS WITH NEW VALUES\n setColors(r, g, b);\n}", "function fnSetCellColors(ctx, grid) {\n for (var x = 0; x <= (gridSize - 1); x++) {\n for (var y = 0; y <= (gridSize - 1); y++) {\n fnColorCells(ctx, grid, x, y);\n }\n }\n}", "function changeEveryColorToRed(colors) {\n}", "function changeColors(color) {\r\n for (let i = 0; i < sq.length; i++) {\r\n sq[i].style.background = color;\r\n }\r\n}", "function changeColours(colour) {\r\n\tfor(var i = 0; i < colours.length; i++) {\r\n\t\tsquares[i].style.backgroundColor = colour\r\n\t}\r\n\r\n\tbanner.style.backgroundColor = colour\r\n}", "function AssignColors(mag) \r\n{\r\n xLen=uIntervals.length;\r\n for (let i = 0; i < xLen; i++) \r\n {\r\n if (mag > uIntervals[xLen-i]) {return uColors[i]}\r\n }\r\n return \"gainsboro\";\r\n}", "function matchColors(color){\n\tfor(var i = 0; i < squares.length; i++){\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "populateGridColorArrays() {\n //for every column..\n for (let i = 0; i < this.colNum; i++) {\n\n // //Generate colors based on a split complementry palette\n // if (i % 2 == 0) {\n // this.hVal = 19;\n // this.sVal = 91;\n // this.bVal = 95;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // } else if (i % 3 == 0) {\n // this.hVal = 59;\n // this.sVal = 96;\n // this.bVal = 87;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // }else{\n // this.hVal = 240;\n // this.sVal = 57;\n // this.bVal = 89;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // }\n\n // //Generate colors based on a triad palette\n // if (i % 2 == 0) {\n // this.hVal = 19;\n // this.sVal = 91;\n // this.bVal = 100;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // } else if (i % 3 == 0) {\n // this.hVal = 173;\n // this.sVal = 96;\n // this.bVal = 40;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // }else{\n // this.hVal = 259;\n // this.sVal = 82;\n // this.bVal = 90;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // }\n\n //Generate colors based on a analogus palette\n\n //based on the row number push one of three possible colors into the right hand side color array\n if (i % 3 === 0) {\n this.hVal = 261;\n this.sVal = 75;\n this.bVal = 91;\n this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n } else if (i % 2 === 0) {\n this.hVal = 231;\n this.sVal = 90;\n this.bVal = 89;\n this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n } else {\n this.hVal = 202;\n this.sVal = 90;\n this.bVal = 89;\n this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n }\n\n //based on the row number push one of two possible colors (white or black) into the left hand side color array\n //two possible colors linearly interpolate to three possible colors creating and asnyschronus relation between the left and right hand sides\n if (i % 2 == 0) {\n this.hVal = 0;\n this.sVal = 0;\n this.bVal = 20;\n this.colorsLeft[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n } else {\n this.hVal = 0;\n this.sVal = 0;\n this.bVal = 85;\n this.colorsLeft[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n }\n }\n\n }", "function createSquares(num){\r\n\tvar arr = [];\r\n\tfor(var i = 0; i < num; i++){\r\n\t\tarr.push(pickColor());\r\n\t}\r\n\treturn arr;\r\n}", "function squareColor(i) {\n var remainder;\n remainder = (i + j) % 2;\n if (remainder == 1) {\n fill('black');\n } else {\n fill('white');\n }\n\n}", "checkColor(checkColor, cell1) {\n if (checkColor == \"-\") return \n let num = Number(checkColor);\n for (let j = 0; j < spectrum.length; j++) { \n if (num <= spectrum[j].a) {\n cell1.style.backgroundColor = spectrum[j].b;\n cell1.style.color = spectrum[j].f;\n break\n } \n }\n }", "function changeColor(color) {\n squares.forEach(element => {\n element.style.backgroundColor = color;\n });\n}", "set pixelRect(value) {}", "function changeColors(color)\n{\n\tfor (var i = 0; i < colors.length; i++)\n\t{\n\t\tsqrs[i].style.backgroundColor = color;\n\t}\n}", "set rectValue(value) {}", "function paint(){\r\n\t\t\tfor (var i=4; i<20; i++){\r\n\t\t\t\tvar grid = document.getElementById(\"grid\");\r\n\t\t\t\tvar cella = document.getElementById(\"casella\" + i);\r\n\t\t\t\tvar riga = Math.floor(i/4);\r\n\t\t\t\tvar colonna = i%4;\r\n\t\t\t\tvar n = grid.childNodes[riga].childNodes[colonna].value;\r\n\t\t\t\tcella.style.backgroundColor = colors[n];\r\n\t\t\t\t} \r\n\t\t}", "function changeSqsColor(correctColor){\r\n for(var i=0; i<circles.length; i++){\r\n circles[i].style.background=correctColor;\r\n }\r\n}", "function changeColor(color)\n{\n for(let i=0; i<num ; i++){\n squares[i].style.backgroundColor=color;\n }\n heading.style.backgroundColor=color;\n}", "function setColorValues () {\n // CONVERT RGB AND SET HEXIDECIMAL\n hex = rgbToHex(r, g, b);\n\n // CONVERT RGB AND SET HSL\n var hslvalues = rgbToHsl(r, g, b);\n h = hslvalues[0];\n s = hslvalues[1];\n l = hslvalues[2];\n}", "set RGBAHalf(value) {}", "function recolor() {\n\td3.selectAll(\"rect\").style(\"fill\", function() {\n\t\tvar values = stdSlider.noUiSlider.get();\n\t\tleft = values[0];\n\t\tright = values[1];\n\t\tvar lilval = (Math.floor(backwards(this.x.baseVal.value)));\n\t\treturn colorUp(lilval);\n\t})\n}", "function changeColorsWin(color){\r\n for(let i =0;i<squares.length;i++){\r\n squares[i].style.backgroundColor=color;\r\n }\r\n document.querySelector(\"h1\").style.backgroundColor=color;\r\n }", "function setColor(colNr){\r\n currentColor = colNr;\r\n\r\n pixels.children.forEach(pixel => {\r\n pixel.tweenTo({ fillColor: colors[currentColor][pixel.colStep]}, { duration: _.random(200, 1000)});\r\n });\r\n}", "set ASTC_RGB_5x5(value) {}", "set color(value) {\n this._state.color.set(value || [0.7, 0.7, 0.8]);\n this._renderer.imageDirty();\n }", "function changeColors(color) {\n for (let i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = color;\n heading.style.backgroundColor = color;\n }\n}", "set ASTC_RGB_6x6(value) {}", "function cella_90( ctx, num_canvas_cells) \r\n{\r\n ctx.save( );\r\n ctx.fillStyle = 'black';\r\n\r\n // the offset of the canvas to put the squares in the right place\r\n var x_offset = 20;\r\n var y_offset = 15;\r\n\r\n // the number of pixels of every box\r\n var box_size = 5;\r\n\r\n // initializes the 400x400 array (filled with 0s) to determine coloring\r\n let array = Array(num_canvas_cells).fill().map(() => Array(num_canvas_cells).fill(0)); \r\n\r\n // initializes the start of the cella rule\r\n var half_num_canvas = Math.floor(num_canvas_cells / 2);\r\n var starting_index = half_num_canvas - 1;\r\n array[0][starting_index] = 1;\r\n color_starting_square(ctx, num_canvas_cells, x_offset, y_offset);\r\n \r\n //console.log(array[0][starting_index]);\r\n\r\n // for indexing through the rows starting at the second one since the first one has been initialized\r\n for ( var i = 1; i < num_canvas_cells; ++i )\r\n {\r\n \r\n // for indexing through the columns\r\n // you do not need to search every element since the rules expands linearly outwards in each direction\r\n\t\tstarting_index -=i;\r\n\t\tif (starting_index < 0) {starting_index = 0;}\r\n\t\tvar jEnd = half_num_canvas + i;\r\n\t\tif (jEnd > num_canvas_cells) {jEnd = num_canvas_cells;}\r\n for (var j = starting_index - i; j < jEnd; ++j )// going too far over. \r\n {\r\n // value to be passed into rule_rule check to determine the next generation of the cell\r\n var cell_value = 0;\r\n \r\n // checks the value of above and left\r\n if (array[i - 1][j - 1] === 1 && j != 0)\r\n {\r\n \tcell_value += 4;\r\n }\r\n\r\n // checks the value of above and right\r\n if (array[i - 1][j + 1] === 1 && j < num_canvas_cells)\r\n {\r\n cell_value += 1;\r\n }\r\n\r\n // checks the value of right above\r\n if (array[i - 1][j] === 1)\r\n {\r\n cell_value += 2;\r\n }\r\n\r\n var color = rule_check(cell_value);\r\n\r\n // colors the square if it is 1 i.e. black, since the color is already white\r\n if (color === 1)\r\n {\r\n array[i][j] = 1;\r\n \r\n if (j >= 0 && j < 400)\r\n {\r\n // made an asynchronous function so it loads the webpage before everything is finished\r\n color_cell(ctx, x_offset + (j * 5), y_offset + (i * 5));\r\n }\r\n }\r\n }\r\n }\r\n ctx.restore( );\r\n}", "function color_starting_square(ctx, num_canvas_cells, x_offset, y_offset)\r\n{\r\n ctx.save( );\r\n ctx.fillStyle = 'black';\r\n\r\n // rect(the x cord in the upper left corner, the y cord of the upper left rect, width, height)\r\n ctx.rect(x_offset + ((Math.floor(num_canvas_cells / 2) - 1) * 5), y_offset, 5, 5);\r\n ctx.fill();\r\n ctx.restore( );\r\n}", "function createCanvas() {\r\n var numSquares = 2059\r\n for (var i = 0; i < numSquares; i++) {\r\n var pixelDiv = $(\"<div>\").addClass(\"square\");\r\n pixelDiv.appendTo(\"body\");\r\n pixelDiv.on(\"mouseover\", function() {\r\n changeColor($(\"#colour\").val(), $(this));\r\n })\r\n };\r\n}", "function setColors(colorArr){ //removed \"[]\"\n let i = 0;\n let len = colorArr.length;\n for(i = 0; i < len; i++){\n colorArr[i] = {red: randomInt(255), green: randomInt(255), blue: randomInt(255)};\n //TODO we will need to add a function that makes sure that no two colors are the same.\n //Maybe use a while loop? (RON)\n }\n}", "function setcolor(colors, pickedColor, n){\r\n for(let i=0;i<n;i++)\r\n {\r\n squares[i].style.background = colors[i];\r\n squares[i].addEventListener(\"click\", function(){\r\n const clickedColor = this.style.background;\r\n \r\n if(clickedColor === pickedColor){\r\n\t\t\t\tmessageDisplay.textContent = \"Correct!\";\r\n\t\t\t\treset.textContent = \"Play Again?\"\r\n\t\t\t\tchangeColors(clickedColor);\r\n\t\t\t\th1.style.background = clickedColor;\r\n\t\t\t} else {\r\n\t\t\t\tthis.style.background = \"black\";\r\n\t\t\t\tmessageDisplay.textContent = \"Try Again\"\r\n\t\t\t}\r\n })\r\n }\r\n}", "function changeColor(color)\n{\n\n // Also changing the h1 color\n\n h1.style.backgroundColor = color;\n h2.style.backgroundColor = color;\n // loop through all the square\n for (let i = 0; i < squares.length; i++) {\n // change the color of square to the given color\n squares[i].style.backgroundColor = color;\n }\n \n}", "function setAllGrey() {\n for (let i = 0; i < squares.length; i++) {\n squares[i].style.background = \"grey\";\n }\n rotateGrid();\n setTimeout(() => toggleGridClickable(), 500);\n \n}", "function showRange() {\n\n for (var i = 0; i < N; i += 1) {\n\n var state = algo.render.kS_GRAY;\n\n if (i >= LEFT && i <= RIGHT) {\n state = algo.render.kS_BLUE;\n }\n if (i === LEFT || i === RIGHT) {\n state = algo.render.kS_RED;\n }\n if (i === M1 || i === M2) {\n state = algo.render.kS_GREEN;\n }\n A[i].element.set({\n state: state\n });\n }\n }" ]
[ "0.7146685", "0.71362925", "0.7108997", "0.7062834", "0.70416677", "0.7015922", "0.7002145", "0.69848514", "0.697579", "0.6939395", "0.6909422", "0.6896878", "0.68754196", "0.683647", "0.6821803", "0.68204945", "0.6809752", "0.67887586", "0.67839664", "0.6774938", "0.6770446", "0.67703515", "0.6753115", "0.67494136", "0.67375964", "0.6731364", "0.67211765", "0.6718921", "0.6699428", "0.66972506", "0.66772085", "0.6671974", "0.66620255", "0.66568196", "0.66543484", "0.6648625", "0.6645497", "0.66361785", "0.6616749", "0.6606785", "0.6604806", "0.66036147", "0.6561584", "0.65546757", "0.6553067", "0.6551076", "0.65387416", "0.6523973", "0.65208364", "0.6506648", "0.6466618", "0.6464776", "0.644788", "0.64086926", "0.6386645", "0.63789684", "0.63591224", "0.6323444", "0.6315401", "0.6305024", "0.62932307", "0.6279682", "0.62781054", "0.6183918", "0.6177809", "0.6168851", "0.61687756", "0.6168014", "0.61630857", "0.6160293", "0.61360806", "0.613438", "0.61288184", "0.61227864", "0.61089945", "0.61063665", "0.610272", "0.6075547", "0.607447", "0.6071421", "0.605339", "0.60481006", "0.6046223", "0.60420334", "0.60245734", "0.60230356", "0.6015272", "0.60055006", "0.6004734", "0.5983031", "0.59790426", "0.59772104", "0.59666795", "0.5964597", "0.5956732", "0.5952069", "0.5948557", "0.594774", "0.59476596", "0.5944351" ]
0.62655234
63
selects a single colour from an array of colours at random
function pickRandomColour() { var randomNumber = Math.floor( Math.random() * colours.length ); return colours[ randomNumber ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pickColor(){\n\tvar random = Math.floor(Math.random() * colors.length);\n\t//Return random colour from array\n\treturn colors[random];\n}", "function pickColor(){\n //generate a number between 1 and the length of our color array\n var random = Math.floor(Math.random() * color.length);\n //return that index in our color array\n return color[random];\n}", "function pickColor(){\n var rand = Math.floor(Math.random()*color.length);\n return color[rand];\n}", "function pickColor(){\n var random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickColor(){\n var random = Math.floor(Math.random()* colors.length);\n return colors[random];\n}", "function pickColor(){\n\tvar random=Math.floor(Math.random()*colors.length);\n\treturn colors[random];\n}", "function pickColor(){\n\tvar random=Math.floor(Math.random()*colors.length);\n\treturn colors[random];\n}", "function pickColor(){\n var random = Math.floor(Math.random()*colors.length);\n return colors[random];\n}", "function pickColor(){\n var random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickColor(){\n var random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickColor(){\n var random=Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickColor() {\n var index = Math.floor(Math.random() * colors.length);\n return colors[index];\n}", "function pickColor(){\r\n\tvar random=Math.floor(Math.random() * colors.length);\r\n\treturn colors[random];\r\n}", "function pickColor(){\r\n\tvar random = Math.floor(Math.random()*colors.length);\r\n\treturn colors[random];\r\n}", "function selectColor() {\n index = Math.floor(Math.random() * colors.length);\n return colors[index];\n}", "function pickColor(){\n\tvar random = Math.floor(Math.random() * colors.length);\n\n\treturn colors[random];\n}", "function randomPickedColorIndex()\r\n{\r\n\treturn Math.floor(Math.random()*arr.length);\r\n}", "function pickColor() {\n var random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickColor() {\r\n\tvar random = Math.floor(Math.random() * colors.length);\r\n\t//Use this variable (random number) to access an element from the array at that index (the random\r\n\t//number that is picked, e.g. 3, is the index number of the array above:\r\n\treturn colors[random];\r\n}", "function pickColor() {\n var random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function getRandomColor() {\n return arrayOfColors[Math.floor(Math.random()*arrayOfColors.length)];\n}", "function pickColor(colors){\r\n\tvar random = Math.floor(Math.random() * colors.length);\r\n\treturn colors[random];\r\n}", "function pickColour() {\r\n\tvar rand = Math.floor(Math.random() * colours.length)\r\n\treturn colours[rand]\r\n}", "function pickColor(){\n\tlet random = Math.floor(Math.random()*colors.length);\n\treturn colors[random];\n}", "function pickColor(){\n\tlet random = Math.floor(Math.random() * colors.length);\n\treturn colors[random];\t\n\n}", "function pickColor() {\n let random = Math.floor(Math.random() * colors.length); \n return colors[random];\n}", "function pickColor() {\n return (color[Math.floor(Math.random() * color.length)]);\n}", "function pickColor() {\n return colors[Math.floor(Math.random() * numSquares)];\n}", "function pickColor()\n{\n\tvar rand = Math.floor((Math.random() * colors.length));\n\treturn colors[rand];\n}", "function pickColor() {\n\tvar random = Math.floor(Math.random() * colors.length);\n\treturn colors[random];\n}", "function pickColor() {\n const random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickColor () {\r\n let random = Math.floor(Math.random() * colors.length)\r\n return colors[random];\r\n}", "function selectRandomColour() {\n\n let random = Math.floor(Math.random() * colours.length);\n \n return colours[random];\n}", "function pickColor() {\n let random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickColor() {\n let random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickColor(){\n\treturn colors[Math.floor((Math.random() *6) + 0)];\n}", "function pickcolor(){\r\n var randomOneColor=Math.floor(Math.random()*colors.length);\r\n return colors[randomOneColor];\r\n}", "function pickcolor() {\n\tvar random=Math.floor(Math.random()*color.length);\n\t return color[random];\n\t// body...\n}", "pickColor(colorArray) {\n let randomColor = Math.floor(Math.random() * colorArray.length);\n return colorArray[randomColor];\n }", "function getRandomColor(array) {\n var colorIndex = Math.floor(Math.random() * (colors.length)); // \n var randomColor = array[colorIndex]; // 2\n \n return randomColor; // 3\n}", "function pickColor(){\n //store a random index in a var\n let random = Math.floor(Math.random() * colors.length);\n //return that index color \n return colors[random];\n}", "function pickColor(){\n //Pick a random number\n var random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickRandomColor () {\n\tvar random = Math.floor(Math.random() * colors.length);\n\treturn colors[random];\n}", "function pickRandomColor() {\n var rando = Math.floor(Math.random() * colors.length);\n return colors[rando];\n}", "function pickColor(){\n return Math.floor(Math.random()*numColors);\n}", "function chooseColors() {\n let random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function chooseRandomColor() {\n let randomColor = colorArray[Math.floor(Math.random() * colorArray.length)];\n return randomColor;\n }", "function pickedColor() {\n var random = Math.floor(Math.random() * differentColors.length);\n return differentColors[random];\n}", "function pickColor() {\n // floor number so no decimals, random number\n var random = Math.floor(Math.random() * colors.length);\n // this picks a random number, so it retuns colors[3] for example \n return colors[random];\n}", "function randomColor(){\n return colors[Math.floor(Math.random() * colors.length)]\n}", "function pickColor(){\n\treturn colors[(Math.floor(Math.random() * difficulty))]\n}", "function getRandomColor() {\n return colors[Math.floor(Math.random() * colors.length)];\n}", "function randomColor(){\r\n var random = Math.floor(Math.random() * colors.length);\r\n return colors[random];\r\n}", "function getRandomColor() {\n var i = Math.floor(Math.random() * colors.length);\n return colors[i];\n}", "function pickColor(){\n\tvar random = Math.floor(Math.random() * difficulty);\n\treturn colors[random];\n}", "function randomColor() {\n const len = colors.length;\n return colors[Math.floor(Math.random() * len)];\n}", "function randomColor() {\n var randomNum = Math.floor(Math.random()*colors.length);\n return colors[randomNum];\n}", "function randomColor() {\n\t//array with red, green, and blue\n\tvar colors = [color(255,0,0),color(0,255,0),color(0,0,255)];\n\treturn random(colors);\t\t//returns a random color from the array\n}", "function getColor(){\n //var colors = [ \"rgba(237, 106, 90, 1)\", \"rgba(247, 244, 205, 1)\", \"rgba(155, 193, 188, 1)\", \"rgba(92, 164, 169, 1)\", \"rgba(230, 235, 224, 1)\"];\n var colors = cscheme;\n\n //generates random n to select a color from the array above\n //if new color (colors[n]) is equal to last color selected, it loops again to not repeat colors\n do{\n n = Math.floor(Math.random() * colors.length);\n }while( colors[n] === color );\n\n return colors[n];\n }", "function answer(){\n let random = Math.floor(Math.random() * colors.length);\n return colors[random];\n }", "function pickRandomColors(arrOfColors) {\n let randIdx = Math.floor(Math.random() * arrOfColors.length + 1);\n return arrOfColors[randIdx];\n}", "function pickAColour() {\n if(clickHistory.length > 0) {\n var a = clickHistory[random(0, clickHistory.length-1)][1] * random(0, 10); //generates random color based on clickHistory array value * random(0,10)//\n return a;\n } else {\n return colourList[Math.floor(Math.random() * colourList.length)]; //otherwise, generates completely random color from the colourList array of 255//\n }\n}", "function randomColour() {\n let random = Math.floor(Math.random() * colours.length);\n return colours[random];\n}", "function RandChooseColor()\n{\n var randId = floor(\n random(ColorPallette.length-0.00001));\n var cr = ColorPallette[randId];\n \n return cr;\n}", "randomColor(){\n return colors[Math.floor(Math.random() * colors.length)];\n }", "function getRandomColor() {\n var random = (Math.round(Math.random() * (colors.length -1)));\n return colors[random];\n}", "chooseColor() {\n let colors = ['#E55F5D', '#FA8455', '#FFC670', '#51CD99', '#7FD6D8', '#8E97DA', '#E3AEC9'];\n let color = colors[Math.round(Math.random() * 6)];\n \n return color;\n }", "function RandomPick() {\r\n // Randomly select one colour and return it back\r\n var picks = [\"Red\", \"Green\", \"Yellow\", \"Blue\"];\r\n return picks[Math.floor(Math.random()*picks.length)];\r\n}", "function randomColor(){\n var randomNumber = Math.floor(Math.random()* colors.length);\n var randomRGB = colors[randomNumber];\n\n return randomRGB;\n}", "function getRandomColor()\n{\n let randNumber = Math.floor(Math.random() * colors.length);\n return colors[randNumber];\n}", "function getRandomColor () { \n var colours = ['#349e72', '#c78a29', '#269bbd', '#b04600', '#DA70D6', '#76ab76']\n return colours[getRandomNumber(0, 5)]\n}", "function pickWinningColor(){\r\n const result = Math.floor(Math.random() * colors.length);\r\n return colors[result];\r\n }", "function getColorSet(){\n\tvar colorSet = [\n\t\"#05668D\",\n\t\"#028090\",\n\t\"#00A896\",\n\t\"#02C39A\",\n\t\"#FF5733\"\n\t];\n\n\tvar selectColor = colorSet[Math.floor(Math.random() * 5)];\n\t//console.log(selectColor);\n\treturn selectColor;\n}", "function random_colour ()\n{\n var colour_no = Math.floor (Math.random () * 6);\n return colours[colour_no];\n}", "function randomCorrectColor(){\n var random = Math.floor(Math.random()*colors.length);\n return colors[random];\n}", "function getRandomColor(){\n var rndNbr = Math.floor(Math.random()*4);\n return colors[rndNbr];\n}", "function randomColorSelector() {\n let red = Math.random() * (255 - 0);\n let green = Math.random() * (255 - 0);\n let blue = Math.random() * (255 - 0);\n return [\"rgb(\", red, \",\", green, \",\", blue, \")\"].join(\"\");\n\n}", "function getRandomColor() {\n let randomNumber = Math.floor(Math.random() * colors.length);\n return colors[randomNumber];\n}", "function getRandomColor() {\r\n let randomColor = Math.floor(Math.random() * colors.length);\r\n\r\n return colors[randomColor];\r\n}", "function pickRandomColor(colors) {\n let pickColor = Math.floor(Math.random() * colors.length);\n return colors[pickColor];\n}", "function randColor() {\n const colors = [\"black\", \"dodgerblue\", \"cadetblue\", \"aquamarine\", \"green\", \"blue\", \"red\", \"maroon\", \"brown\"];\n return colors[Math.floor(Math.random() * colors.length)];\n}", "function getRandomColor(array) {\n const index = getRandomNumber(array);\n document.querySelector('body').style.background = array[index];\n}", "randomColor() {\n const color = [\"#CBA00F\", \"#E5901E\", \"#DF5F07\", \"#5AB4EB\", \"#BBCD56\"];\n\n let num = Math.floor(Math.random() * Math.floor(color.length));\n\n return(color[num])\n }", "function getRandomColour() {\n return COLOURS[Math.floor(Math.random() * COLOURS.length)];\n}", "function randomColor() { return Array.from({ length: 3 }, () => Math.floor(Math.random() * 256)); }", "function getWinningColor(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n}", "function getRandomColor() {\n var colors= [\"#444444\",\"#777777\",\"#aaaaaa\",\"#bbbbbb\",\"#cccccc\"]\n return colors[Math.floor(Math.random() * 5)]\n}", "function randomColor(colors) {\n return colors[Math.floor(Math.random() * colors.length)];\n}", "function getRandomColor() {\n let randomColor = Math.floor(Math.random() * colors.length);\n\n return colors[randomColor];\n}", "function randomColor(color){\n return color[Math.floor((Math.random() * 3))];\n }", "function getRandomNumber(){\r\n return Math.floor(Math.random() * colors.length);\r\n}", "function pickColor() {\n if (colorArray.length > 1) {\n var oldColorIndex = colorArray.indexOf(document.getElementById(\"center-tile\").style.backgroundColor);\n if (freshStart == true) {\n oldColorIndex = -1;\n }\n if (oldColorIndex > -1) {\n var oldColor = colorArray[oldColorIndex];\n colorArray.splice(oldColorIndex, 1);\n }\n var colorToReturn = colorArray[Math.floor(Math.random() * colorArray.length)];\n if (oldColorIndex > -1) {\n colorArray.push(oldColor);\n }\n return colorToReturn;\n } else {\n return colorArray[Math.floor(Math.random() * colorArray.length)];\n }\n }", "function randomColor() {\n colors = [red, blue, yellow, green];\n index = Math.floor(Math.random() * 4);\n\n return colors[index];\n }", "function randomColor(){\r\n this.colorArray = [\"#CC0000\", \"#FF8800\", \"#007E33\", \"#00695c\", \"#0d47a1\", \"#9933CC\"];\r\n var ranColor = Math.floor(Math.random()*6);\r\n var color = colorArray[ranColor];\r\n return color;\r\n}", "function pickColor() {\n let colorOptions = ['#FF6F61', '#D69C2F', '#343148', '#7F4145', '#BD3D3A', '#766F57'];\n let max = colorOptions.length - 1;\n let min = 0;\n let pickRandom = Math.random() * (max - min) + min\n let randomColor = colorOptions[Math.floor(pickRandom)]\n return randomColor;\n}", "function randcolor(a) {\n\t\tvar r = Math.floor(Math.random()*192) + 64;\n\t\tvar g = Math.floor(Math.random()*192) + 64;\n\t\tvar b = Math.floor(Math.random()*192) + 64;\n\t\tfor (var i=0; i<a.length; i++)\n\t\t\trgb(a[i], r, g, b);\n\t}", "function randomColor() {\n colors = [\"red\", \"yellow\", \"blue\", \"green\"];\n return colors[Math.floor(Math.random() * 7)];\n }", "function pickColor(colorArry){\r\n\tvar correctColorIdx = Math.floor(Math.random()*colorArry.length);\t//choose a random index, use the array length as it may be 3/6sqaures\r\n\trgbDisplay.textContent = colorArry[correctColorIdx];\t\t\t\t//display the \"RGB Value\" of the picked color\r\n\treturn colorArry[correctColorIdx];\t\t\t\t\t\t\t\t\t//return the \"RGB Value\"\r\n}", "function pickColor() {\n\n // Array containing colors \n var colors = [\n '#A6A1D0', '#D77790', '#E17142',\n '#66C3C1', '#939D18', '#E1AC3E' , 'black'\n ];\n\n // selecting random color \n var random_color = colors[Math.floor(\n Math.random() * colors.length)];\n\n var x = document.getElementById('pick');\n x.style.color = random_color;\n }", "function changeColor(){\n var i = Math.floor(Math.random() * 8);\n col = c[i];\n}" ]
[ "0.8576947", "0.8440747", "0.8423161", "0.8380474", "0.83637166", "0.83602935", "0.83602935", "0.8345294", "0.8344562", "0.8344562", "0.83434045", "0.83354145", "0.83278894", "0.83237773", "0.8321711", "0.8321304", "0.8317993", "0.83070946", "0.8305222", "0.83003736", "0.82890874", "0.8278446", "0.82757676", "0.8273183", "0.8264148", "0.8254875", "0.8251487", "0.8250058", "0.8248588", "0.824626", "0.8244034", "0.82433534", "0.82370335", "0.82303673", "0.8213484", "0.8199616", "0.8194177", "0.81868774", "0.81229854", "0.810682", "0.80688804", "0.80412114", "0.8031533", "0.8027567", "0.8016647", "0.8006662", "0.80028224", "0.7995481", "0.7984625", "0.7940779", "0.7868261", "0.7860075", "0.7847538", "0.78449386", "0.7782667", "0.7775979", "0.77650404", "0.775821", "0.77547", "0.77451307", "0.773369", "0.7729791", "0.7715242", "0.7699612", "0.76967955", "0.7696287", "0.76931965", "0.7687504", "0.7685803", "0.7680249", "0.7675861", "0.7668022", "0.7650328", "0.7638966", "0.7630039", "0.7624459", "0.7608359", "0.75953704", "0.7592562", "0.7586848", "0.75709337", "0.7563953", "0.75601065", "0.75549823", "0.75522274", "0.7548209", "0.7542749", "0.7533467", "0.75219023", "0.7509235", "0.7479516", "0.7471332", "0.7459251", "0.7455725", "0.7452736", "0.74527025", "0.74519736", "0.7451824", "0.7443792", "0.744221" ]
0.8137231
38